[PATCH] tpm: Fix kexec crash due to access to ops NULL pointer (powerpc)

2021-12-11 Thread Stefan Berger
Fix the following crash on kexec by checking chip->ops for a NULL pointer in tpm_chip_start() and returning an error code if this is the case. BUG: Kernel NULL pointer dereference on read at 0x0060 Faulting instruction address: 0xc099a06c Oops: Kernel access of bad area, sig: 11 [#1]

[PATCH v2 2/2] powerpc/module_64: Use patch_memory() to apply relocations to loaded modules

2021-12-11 Thread Russell Currey
Livepatching a loaded module involves applying relocations through apply_relocate_add(), which attempts to write to read-only memory when CONFIG_STRICT_MODULE_RWX=y. Work around this by performing these writes through the text poke area by using patch_memory(). Similar to x86 and s390

[PATCH v2 1/2] powerpc/code-patching: add patch_memory() for writing RO text

2021-12-11 Thread Russell Currey
powerpc allocates a text poke area of one page that is used by patch_instruction() to modify read-only text when STRICT_KERNEL_RWX is enabled. patch_instruction() is only designed for instructions, so writing data using the text poke area can only happen 4 bytes at a time - each with a page

Re: [PATCH v2 0/2] kdump: simplify code

2021-12-11 Thread Christophe Leroy
Le 11/12/2021 à 18:53, David Laight a écrit : > From: Tiezhu Yang >> Sent: 11 December 2021 03:33 >> >> v2: >>-- add copy_to_user_or_kernel() in lib/usercopy.c >>-- define userbuf as bool type > > Instead of having a flag to indicate whether the buffer is user or kernel, > would it be

RE: [PATCH v2 0/2] kdump: simplify code

2021-12-11 Thread David Laight
From: Tiezhu Yang > Sent: 11 December 2021 03:33 > > v2: > -- add copy_to_user_or_kernel() in lib/usercopy.c > -- define userbuf as bool type Instead of having a flag to indicate whether the buffer is user or kernel, would it be better to have two separate buffer pointers. One for a user

Re: [PATCH] PCI/AER: potential dereference of null pointer

2021-12-11 Thread Bjorn Helgaas
[+cc Rajat, author of aer_stats: db89ccbe52c7 ("PCI/AER: Define aer_stats structure for AER capable devices" 81aa5206f9a7 ("PCI/AER: Add sysfs attributes to provide AER stats and breakdown"] On Thu, Dec 09, 2021 at 05:45:56PM +0800, Jiasheng Jiang wrote: > he return value of kzalloc() needs to

Re: [patch V3 12/35] soc: ti: ti_sci_inta_msi: Allocate MSI device data on first use

2021-12-11 Thread Arnd Bergmann
On Fri, Dec 10, 2021 at 11:19 PM Thomas Gleixner wrote: > > From: Thomas Gleixner > > Allocate the MSI device data on first invocation of the allocation function. > > Signed-off-by: Thomas Gleixner > Reviewed-by: Greg Kroah-Hartman > Reviewed-by: Jason Gunthorpe > Cc: Nishanth Menon > Cc:

Re: [patch V3 34/35] soc: ti: ti_sci_inta_msi: Get rid of ti_sci_inta_msi_get_virq()

2021-12-11 Thread Arnd Bergmann
On Fri, Dec 10, 2021 at 11:19 PM Thomas Gleixner wrote: > > From: Thomas Gleixner > > Just use the core function msi_get_virq(). > > Signed-off-by: Thomas Gleixner > Reviewed-by: Greg Kroah-Hartman > Reviewed-by: Jason Gunthorpe > Cc: Peter Ujfalusi > Cc: Vinod Koul > Cc:

Re: [patch V3 07/35] device: Move MSI related data into a struct

2021-12-11 Thread Arnd Bergmann
On Fri, Dec 10, 2021 at 11:18 PM Thomas Gleixner wrote: > > From: Thomas Gleixner > > The only unconditional part of MSI data in struct device is the irqdomain > pointer. Everything else can be allocated on demand. Create a data > structure and move the irqdomain pointer into it. The other MSI

Re: [patch V3 05/35] powerpc/cell/axon_msi: Use PCI device property

2021-12-11 Thread Arnd Bergmann
On Fri, Dec 10, 2021 at 11:18 PM Thomas Gleixner wrote: > > From: Thomas Gleixner > > instead of fiddling with MSI descriptors. > > Signed-off-by: Thomas Gleixner > Cc: Arnd Bergmann > Cc: Michael Ellerman > Cc: Benjamin Herrenschmidt > Cc: linuxppc-dev@lists.ozlabs.org > --- Acked-by: Arnd

[PATCH 2/2] powerpc/module_64: Use patch_memory() to apply relocations to loaded modules

2021-12-11 Thread Russell Currey
Livepatching a loaded module involves applying relocations through apply_relocate_add(), which attempts to write to read-only memory when CONFIG_STRICT_MODULE_RWX=y. Work around this by performing these writes through the text poke area by using patch_memory(). Similar to x86 and s390

[PATCH 1/2] powerpc/code-patching: add patch_memory() for writing RO text

2021-12-11 Thread Russell Currey
powerpc allocates a text poke area of one page that is used by patch_instruction() to modify read-only text when STRICT_KERNEL_RWX is enabled. patch_instruction() is only designed for instructions, so writing data using the text poke area can only happen 4 bytes at a time - each with a page

Re: [patch V3 03/35] x86/apic/msi: Use PCI device MSI property

2021-12-11 Thread Greg Kroah-Hartman
On Fri, Dec 10, 2021 at 11:18:47PM +0100, Thomas Gleixner wrote: > From: Thomas Gleixner > > instead of fiddling with MSI descriptors. > > Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman

[next-20211210] Build break powerpc/kvm: unknown member wait

2021-12-11 Thread Sachin Sant
next-20211210 ( commit ea922272cbe547) powerpc build fails due to following error: arch/powerpc/kvm/book3s_hv.c: In function 'kvmhv_run_single_vcpu': arch/powerpc/kvm/book3s_hv.c:4591:27: error: 'struct kvm_vcpu' has no member named 'wait' prepare_to_rcuwait(>wait);

Re: [PATCH v2 1/2] kdump: vmcore: remove copy_to() and add copy_to_user_or_kernel()

2021-12-11 Thread Christophe Leroy
Le 11/12/2021 à 04:33, Tiezhu Yang a écrit : > In arch/*/kernel/crash_dump*.c, there exist many similar code > about copy_oldmem_page(), remove copy_to() in fs/proc/vmcore.c > and add copy_to_user_or_kernel() in lib/usercopy.c, then we can > use copy_to_user_or_kernel() to simplify the related

[PATCH] soc: fsl: qe: fix typo in a comment

2021-12-11 Thread Jason Wang
The double `is' in the comment in line 150 is repeated. Remove one of them from the comment. Signed-off-by: Jason Wang --- drivers/soc/fsl/qe/qe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/fsl/qe/qe.c b/drivers/soc/fsl/qe/qe.c index