Re: [v3 1/7] powerpc/mce: Make machine_check_ue_event() static

2019-07-05 Thread Nicholas Piggin
Santosh Sivaraj's on July 6, 2019 7:26 am: > From: Reza Arbab > > The function doesn't get used outside this file, so make it static. > > Signed-off-by: Reza Arbab > Signed-off-by: Santosh Sivaraj Reviewed-by: Nicholas Piggin

[Bug 203839] Kernel 5.2-rc3 fails to boot on a PowerMac G4 3,6: systemd[1]: Failed to bump fs.file-max, ignoring: invalid argument

2019-07-05 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=203839 Erhard F. (erhar...@mailbox.org) changed: What|Removed |Added Status|NEW |RESOLVED

[v3 7/7] powerpc/64s: save r13 in MCE handler (simulator workaroud)

2019-07-05 Thread Santosh Sivaraj
From: Reza Arbab Testing my memcpy_mcsafe() work in progress with an injected UE, I get an error like this immediately after the function returns: BUG: Unable to handle kernel data access at 0x7fff84dec8f8 Faulting instruction address: 0xc008009c00b0 Oops: Kernel access of bad area, sig: 11

[v3 6/7] powerpc: add machine check safe copy_to_user

2019-07-05 Thread Santosh Sivaraj
Use memcpy_mcsafe() implementation to define copy_to_user_mcsafe() Signed-off-by: Santosh Sivaraj --- arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/uaccess.h | 12 2 files changed, 13 insertions(+) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig

[v3 5/7] powerpc/memcpy_mcsafe: return remaining bytes

2019-07-05 Thread Santosh Sivaraj
memcpy_mcsafe currently return -EFAULT on a machine check exception, change it to return the remaining bytes that needs to be copied, so that machine check safe copy_to_user can maintain the same behavior as copy_to_user. Signed-off-by: Santosh Sivaraj --- arch/powerpc/lib/memcpy_mcsafe_64.S |

[v3 4/7] powerpc/mce: Handle UE event for memcpy_mcsafe

2019-07-05 Thread Santosh Sivaraj
If we take a UE on one of the instructions with a fixup entry, set nip to continue exucution at the fixup entry. Stop processing the event further or print it. Based-on-patch-by: Reza Arbab Cc: Reza Arbab Cc: Mahesh Salgaonkar Signed-off-by: Santosh Sivaraj --- arch/powerpc/include/asm/mce.h

[v3 3/7] powerpc/memcpy: Add memcpy_mcsafe for pmem

2019-07-05 Thread Santosh Sivaraj
From: Balbir Singh The pmem infrastructure uses memcpy_mcsafe in the pmem layer so as to convert machine check exceptions into a return value on failure in case a machine check exception is encountered during the memcpy. This patch largely borrows from the copyuser_power7 logic and does not add

[v3 2/7] powerpc/mce: Bug fixes for MCE handling in kernel space

2019-07-05 Thread Santosh Sivaraj
From: Balbir Singh The code currently assumes PAGE_SHIFT as the shift value of the pfn, this works correctly (mostly) for user space pages, but the correct thing to do is 1. Extract the shift value returned via the pte-walk API's 2. Use the shift value to access the instruction address. Note,

[v3 0/7] powerpc: implement machine check safe memcpy

2019-07-05 Thread Santosh Sivaraj
During a memcpy from a pmem device, if a machine check exception is generated we end up in a panic. In case of fsdax read, this should only result in a -EIO. Avoid MCE by implementing memcpy_mcsafe. Before this patch series: ``` bash-4.4# mount -o dax /dev/pmem0 /mnt/pmem/ [ 7621.714094]

[v3 1/7] powerpc/mce: Make machine_check_ue_event() static

2019-07-05 Thread Santosh Sivaraj
From: Reza Arbab The function doesn't get used outside this file, so make it static. Signed-off-by: Reza Arbab Signed-off-by: Santosh Sivaraj --- arch/powerpc/kernel/mce.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/mce.c

Re: [PATCH] i2c: remove casting dma_alloc

2019-07-05 Thread Wolfram Sang
On Sun, Jun 23, 2019 at 11:13:53PM +0200, Vasyl Gomonovych wrote: > From: Vasyl > > Generated by: alloc_cast.cocci > > Signed-off-by: Vasyl Applied to for-next, thanks! I fixed the missing full name for you, but please fix your setup. signature.asc Description: PGP signature

Re: [PATCH] tpm: fixes uninitialized allocated banks for IBM vtpm driver

2019-07-05 Thread Jarkko Sakkinen
On Fri, 2019-07-05 at 20:50 +0300, Jarkko Sakkinen wrote: > To summarize this patch fixes one regression and introduces two > completely new ones... Anyway, take the time and update it. The principle is right anyway. I'll merge it once it is in a better shape... /Jarkko

Re: [PATCH] tpm: fixes uninitialized allocated banks for IBM vtpm driver

2019-07-05 Thread Jarkko Sakkinen
On Fri, 2019-07-05 at 11:32 -0400, Nayna wrote: > I am not sure of the purpose of tpm_stop_chip(), so I have left it as it > is. Jarkko, what do you think about the change ? Stefan right. Your does not work, or will randomly work or not work depending on the chip. You need to turn the TPM on

Re: [PATCH] tpm: fixes uninitialized allocated banks for IBM vtpm driver

2019-07-05 Thread Nayna
On 07/05/2019 10:13 AM, Stefan Berger wrote: On 7/3/19 11:32 PM, Nayna Jain wrote: The nr_allocated_banks and allocated banks are initialized as part of tpm_chip_register. Currently, this is done as part of auto startup function. However, some drivers, like the ibm vtpm driver, do not run

Re: [PATCH] tpm: fixes uninitialized allocated banks for IBM vtpm driver

2019-07-05 Thread Stefan Berger
On 7/3/19 11:32 PM, Nayna Jain wrote: The nr_allocated_banks and allocated banks are initialized as part of tpm_chip_register. Currently, this is done as part of auto startup function. However, some drivers, like the ibm vtpm driver, do not run auto startup during initialization. This results in

Re: [PATCH v12 01/11] MODSIGN: Export module signature definitions

2019-07-05 Thread Philipp Rudo
Hi Thiago, On Thu, 04 Jul 2019 15:57:34 -0300 Thiago Jung Bauermann wrote: > Hello Philipp, > > Philipp Rudo writes: > > > Hi Thiago, > > > > > > On Thu, 04 Jul 2019 03:42:57 -0300 > > Thiago Jung Bauermann wrote: > > > >> Jessica Yu writes: > >> > >> > +++ Thiago Jung Bauermann

Re: [PATCH] tpm: fixes uninitialized allocated banks for IBM vtpm driver

2019-07-05 Thread Jarkko Sakkinen
On Fri, 2019-07-05 at 13:42 +0300, Jarkko Sakkinen wrote: > On Wed, 2019-07-03 at 23:32 -0400, Nayna Jain wrote: > > The nr_allocated_banks and allocated banks are initialized as part of > > tpm_chip_register. Currently, this is done as part of auto startup > > function. However, some drivers,

Re: [PATCH] tpm: fixes uninitialized allocated banks for IBM vtpm driver

2019-07-05 Thread Michal Suchánek
On Fri, 05 Jul 2019 13:42:18 +0300 Jarkko Sakkinen wrote: > On Wed, 2019-07-03 at 23:32 -0400, Nayna Jain wrote: > > The nr_allocated_banks and allocated banks are initialized as part of > > tpm_chip_register. Currently, this is done as part of auto startup > > function. However, some drivers,

Re: [PATCH] tpm: fixes uninitialized allocated banks for IBM vtpm driver

2019-07-05 Thread Jarkko Sakkinen
On Wed, 2019-07-03 at 23:32 -0400, Nayna Jain wrote: > The nr_allocated_banks and allocated banks are initialized as part of > tpm_chip_register. Currently, this is done as part of auto startup > function. However, some drivers, like the ibm vtpm driver, do not run > auto startup during

Re: [PATCH] mm/kprobes: Add generic kprobe_fault_handler() fallback definition

2019-07-05 Thread Masami Hiramatsu
Hi Anshuman, On Fri, 5 Jul 2019 11:00:29 +0530 Anshuman Khandual wrote: > Architectures like parisc enable CONFIG_KROBES without having a definition > for kprobe_fault_handler() which results in a build failure. Hmm, as far as I can see, kprobe_fault_handler() is closed inside each arch

[PATCH v3 2/2] powerpc/boot: pass CONFIG options in a simpler and more robust way

2019-07-05 Thread Masahiro Yamada
Commit 5e9dcb6188a4 ("powerpc/boot: Expose Kconfig symbols to wrapper") was wrong, but commit e41b93a6be57 ("powerpc/boot: Fix build failures with -j 1") was also wrong. The correct dependency is: $(obj)/serial.o: $(obj)/autoconf.h However, I do not see the reason why we need to copy

[PATCH v3 1/2] powerpc/boot: add {get, put}_unaligned_be32 to xz_config.h

2019-07-05 Thread Masahiro Yamada
The next commit will make the way of passing CONFIG options more robust. Unfortunately, it would uncover another hidden issue; without this commit, skiroot_defconfig would be broken like this: | WRAParch/powerpc/boot/zImage.pseries | arch/powerpc/boot/wrapper.a(decompress.o): In function

Re: [PATCH v2] powerpc/boot: pass CONFIG options in a simpler and more robust way

2019-07-05 Thread Masahiro Yamada
On Thu, Jul 4, 2019 at 9:26 AM Michael Ellerman wrote: > > Masahiro Yamada writes: > > > Commit 5e9dcb6188a4 ("powerpc/boot: Expose Kconfig symbols to wrapper") > > was wrong, but commit e41b93a6be57 ("powerpc/boot: Fix build failures > > with -j 1") was also wrong. > > > > The correct

[PATCH] powerpc: fix use-after-free on fixup_port_irq()

2019-07-05 Thread Wen Yang
There is a possible use-after-free issue in the fixup_port_irq(): 460 static void __init fixup_port_irq(int index, 461 struct device_node *np, 462 struct plat_serial8250_port *port) 463 { ... 469 if (!virq &&

[PATCH] powerpc/83xx: fix use-after-free on mpc831x_usb_cfg()

2019-07-05 Thread Wen Yang
The np variable is still being used after the of_node_put() call, which may result in use-after-free. We fix this issue by calling of_node_put() after the last usage. This patatch also do some cleanup. Fixes: fd066e850351 ("powerpc/mpc8308: fix USB DR controller initialization") Signed-off-by:

[PATCH] powerpc/prom: fix use-after-free on cpu_to_chip_id()

2019-07-05 Thread Wen Yang
The np variable is still being used after the of_node_put() call, which may result in use-after-free. We fix this issue by calling of_node_put() after the last usage. Fixes: 3eb906c6b6c1 ("powerpc: Make cpu_to_chip_id() available when SMP=n") Signed-off-by: Wen Yang Cc: Benjamin Herrenschmidt

Re: [PATCH V2 2/2] ASoC: fsl_esai: recover the channel swap after xrun

2019-07-05 Thread S.j. Wang
> > > + > > + /* restore registers by regcache_sync */ > > + fsl_esai_register_restore(esai_priv); > > + > > + regmap_update_bits(esai_priv->regmap, REG_ESAI_TCR, > > +ESAI_xCR_xPR_MASK, 0); > > + regmap_update_bits(esai_priv->regmap, REG_ESAI_RCR, > > +

[PATCH 1/3] powerpc/fsl_booke: replace PAGE_OFFSET with KERNELBASE

2019-07-05 Thread Jason Yan
We setup a mapping in PAGE_OFFSET and jump to KERNELBASE. This is not a problem when PAGE_OFFSET = KERNELBASE. Replace PAGE_OFFSET with KERNELBASE here to make it consistent. Signed-off-by: Jason Yan --- arch/powerpc/kernel/fsl_booke_entry_mapping.S | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH 3/3] powerpc: move memstart_addr and kernstart_addr to init-common.c

2019-07-05 Thread Jason Yan
These two variables are both defined in init_32.c and init_64.c. Move them to init-common.c. Signed-off-by: Jason Yan --- arch/powerpc/mm/init-common.c | 5 + arch/powerpc/mm/init_32.c | 5 - arch/powerpc/mm/init_64.c | 5 - 3 files changed, 5 insertions(+), 10 deletions(-)

[PATCH 0/3] some misc tidy-up

2019-07-05 Thread Jason Yan
Unify some definitions and micros. No functional change. Jason Yan (3): powerpc/fsl_booke: replace PAGE_OFFSET with KERNELBASE powerpc: unify definition of M_IF_NEEDED powerpc: move memstart_addr and kernstart_addr to init-common.c arch/powerpc/include/asm/nohash/mmu-book3e.h | 10

[PATCH 2/3] powerpc: unify definition of M_IF_NEEDED

2019-07-05 Thread Jason Yan
M_IF_NEEDED is defined too many times. Move it to a common place. Signed-off-by: Jason Yan --- arch/powerpc/include/asm/nohash/mmu-book3e.h | 10 ++ arch/powerpc/kernel/exceptions-64e.S | 10 -- arch/powerpc/kernel/fsl_booke_entry_mapping.S | 10 --

Re: [PATCH 2/2] powerpc: expose secure variables via sysfs

2019-07-05 Thread Michael Ellerman
Hi Nayna, Nayna Jain writes: > As part of PowerNV secure boot support, OS verification keys are stored > and controlled by OPAL as secure variables. These need to be exposed to > the userspace so that sysadmins can perform key management tasks. > > This patch adds the support to expose secure