Re: [PATCH] powerpc: don't select KFENCE on platform PPC_FSL_BOOK3E

2021-10-11 Thread LEROY Christophe
Le 12/10/2021 à 03:43, Liu Shixin a écrit : > kindly ping. Hi Based on the discussion we had, this patch is not enough. It should at least also de-activate DEBUG_PAGEALLOC, However I'm looking at fixing it the other way round. Give me one week or two. Christophe > > > On 2021/9/24

[PATCH v1 02/10] powerpc: Rename 'funcaddr' to 'addr' in 'struct ppc64_opd_entry'

2021-10-11 Thread Christophe Leroy
There are three architectures with function descriptors, try to have common names for the address they contain in order to refactor some functions into generic functions later. powerpc has 'funcaddr' ia64 has 'ip' parisc has 'addr' Vote for 'addr' and update 'struct ppc64_opd_entry' accordingly.

[PATCH v1 03/10] ia64: Rename 'ip' to 'addr' in 'struct fdesc'

2021-10-11 Thread Christophe Leroy
There are three architectures with function descriptors, try to have common names for the address they contain in order to refactor some functions into generic functions later. powerpc has 'funcaddr' ia64 has 'ip' parisc has 'addr' Vote for 'addr' and update 'struct fdesc' accordingly.

[PATCH v2] scsi: ibmvscsi: Use dma_alloc_noncoherent() instead of get_zeroed_page/dma_map_single()

2021-10-11 Thread Cai Huoqing
Replacing get_zeroed_page/free_page/dma_map_single/dma_unmap_single() with dma_alloc_noncoherent/dma_free_noncoherent() helps to reduce code size, and simplify the code, and the hardware can keeep DMA coherent itself. Signed-off-by: Cai Huoqing --- v1->v2: *Change to

[PATCH v2] tpm: ibmvtpm: Make use of dma_alloc_noncoherent()

2021-10-11 Thread Cai Huoqing
Replacing kmalloc/kfree/get_zeroed_page/free_page/dma_map_single/ dma_unmap_single() with dma_alloc_noncoherent/dma_free_noncoherent() helps to reduce code size, and simplify the code, and the hardware can keep DMA coherent itself. Signed-off-by: Cai Huoqing --- v1->v2: *Change to

[PATCH v1 04/10] asm-generic: Use HAVE_DEREFERENCE_FUNCTION_DESCRIPTOR to define associated stubs

2021-10-11 Thread Christophe Leroy
Use HAVE_DEREFERENCE_FUNCTION_DESCRIPTOR instead of 'dereference_function_descriptor' to know whether arch has function descriptors. Signed-off-by: Christophe Leroy --- arch/ia64/include/asm/sections.h| 4 ++-- arch/parisc/include/asm/sections.h | 6 --

[PATCH v1 01/10] powerpc: Move 'struct ppc64_opd_entry' back into asm/elf.h

2021-10-11 Thread Christophe Leroy
'struct ppc64_opd_entry' doesn't belong to uapi/asm/elf.h It was initially in module_64.c and commit 2d291e902791 ("Fix compile failure with non modular builds") moved it into asm/elf.h But it was by mistake added outside of __KERNEL__ section, therefore commit c3617f72036c ("UAPI: (Scripted)

Re: [PATCH] powerpc: don't select KFENCE on platform PPC_FSL_BOOK3E

2021-10-11 Thread Liu Shixin
kindly ping. On 2021/9/24 14:39, Liu Shixin wrote: > On platform PPC_FSL_BOOK3E, all lowmem is managed by tlbcam. That means > we didn't really map the kfence pool with page granularity. Therefore, > if KFENCE is enabled, the system will hit the following panic: > > BUG: Kernel NULL pointer

[PATCH] powerpc/s64: Clarify that radix lacks DEBUG_PAGEALLOC

2021-10-11 Thread Joel Stanley
The page_alloc.c code will call into __kernel_map_pages when DEBUG_PAGEALLOC is configured and enabled. As the implementation assumes hash, this should crash spectacularly if not for a bit of luck in __kernel_map_pages. In this function linear_map_hash_count is always zero, the for loop exits

Re: linux-next: build warnings in Linus' tree

2021-10-11 Thread Rob Herring
+Arnd in regards to removing platforms. On Sun, Oct 10, 2021 at 4:27 PM Stephen Rothwell wrote: > > Hi all, > > [Cc'ing Rob] > > Rob: these warnings have been there for a long time ... If anyone cares about these platforms, then the warnings should be fixed by folks that care. If not, then

Re: [PATCH] powerpc/boot: Use CONFIG_PPC_POWERNV to compile OPAL support

2021-10-11 Thread Joel Stanley
On Mon, 11 Oct 2021 at 07:42, Cédric Le Goater wrote: > > CONFIG_PPC64_BOOT_WRAPPER is selected by CPU_LITTLE_ENDIAN which is > used to compile support for other platforms such as Microwatt. There > is no need for OPAL calls on these. > > Signed-off-by: Cédric Le Goater Reviewed-by: Joel

Re: [PATCH v3 02/52] powerpc/64s: guard optional TIDR SPR with CPU ftr test

2021-10-11 Thread Michael Ellerman
Fabiano Rosas writes: > Nicholas Piggin writes: > >> The TIDR SPR only exists on POWER9. Avoid accessing it when the >> feature bit for it is not set. > > Not related to this patch, but how does this work with compat mode? A P9 > compat mode guest would get an invalid instruction when trying to

Re: [PATCH v3 02/52] powerpc/64s: guard optional TIDR SPR with CPU ftr test

2021-10-11 Thread Fabiano Rosas
Nicholas Piggin writes: > The TIDR SPR only exists on POWER9. Avoid accessing it when the > feature bit for it is not set. Not related to this patch, but how does this work with compat mode? A P9 compat mode guest would get an invalid instruction when trying to access this SPR? >

[PATCH v1 05/10] asm-generic: Define 'funct_descr_t' to commonly describe function descriptors

2021-10-11 Thread Christophe Leroy
We have three architectures using function descriptors, each with its own name. Add a common typedef that can be used in generic code. Also add a stub typedef for architecture without function descriptors, to avoid a forest of #ifdefs. Signed-off-by: Christophe Leroy ---

[PATCH v1 08/10] lkdtm: Really write into kernel text in WRITE_KERN

2021-10-11 Thread Christophe Leroy
WRITE_KERN is supposed to overwrite some kernel text, namely do_overwritten() function. But at the time being it overwrites do_overwritten() function descriptor, not function text. Fix it by dereferencing the function descriptor to obtain function text pointer. And make do_overwritten()

[PATCH 00/22] PCI: Unify PCI error response checking

2021-10-11 Thread Naveen Naidu
An MMIO read from a PCI device that doesn't exist or doesn't respond causes a PCI error. There's no real data to return to satisfy the CPU read, so most hardware fabricates ~0 data. This patch series adds PCI_ERROR_RESPONSE definition and other helper defintion SET_PCI_ERROR_RESPONSE and

[PATCH v1 00/10] Fix LKDTM for PPC64/IA64/PARISC

2021-10-11 Thread Christophe Leroy
PPC64/IA64/PARISC have function descriptors. LKDTM doesn't work on those three architectures because LKDTM messes up function descriptors with functions. This series does some cleanup in the three architectures and refactors function descriptors so that it can then easily use it in a generic way

[PATCH v1 06/10] asm-generic: Refactor dereference_[kernel]_function_descriptor()

2021-10-11 Thread Christophe Leroy
dereference_function_descriptor() and dereference_kernel_function_descriptor() are identical on the three architectures implementing them. Make it common. Signed-off-by: Christophe Leroy --- arch/ia64/include/asm/sections.h| 19 --- arch/parisc/include/asm/sections.h | 9

[PATCH v1 07/10] lkdtm: Force do_nothing() out of line

2021-10-11 Thread Christophe Leroy
LKDTM tests display that the run do_nothing() at a given address, but in reality do_nothing() is inlined into the caller. Force it out of line so that it really runs text at the displayed address. Signed-off-by: Christophe Leroy --- drivers/misc/lkdtm/perms.c | 4 ++-- 1 file changed, 2

[PATCH 17/22] PCI/DPC: Use RESPONSE_IS_PCI_ERROR() to check read from hardware

2021-10-11 Thread Naveen Naidu
An MMIO read from a PCI device that doesn't exist or doesn't respond causes a PCI error. There's no real data to return to satisfy the CPU read, so most hardware fabricates ~0 data. Use RESPONSE_IS_PCI_ERROR() to check the response we get when we read data from hardware. This helps unify PCI

Re: [PATCH] KVM: PPC: Book3S HV: H_ENTER filter out reserved HPTE[B] value

2021-10-11 Thread Fabiano Rosas
Nicholas Piggin writes: > The HPTE B field is a 2-bit field with values 0b10 and 0b11 reserved. > This field is also taken from the HPTE and used when KVM executes > TLBIEs to set the B field of those instructions. > > Disallow the guest setting B to a reserved value with H_ENTER by > rejecting

[PATCH v1 10/10] lkdtm: Fix execute_[user]_location()

2021-10-11 Thread Christophe Leroy
execute_location() and execute_user_location() intent to copy do_nothing() text and execute it at a new location. However, at the time being it doesn't copy do_nothing() function but do_nothing() function descriptor which still points to the original text. So at the end it still executes

[PATCH v1 09/10] lkdtm: Fix lkdtm_EXEC_RODATA()

2021-10-11 Thread Christophe Leroy
Behind a location, lkdtm_EXEC_RODATA() executes a real function, not a copy of do_nothing(). So do it directly instead of using execute_location(). And fix displayed addresses by dereferencing the function descriptors. Signed-off-by: Christophe Leroy --- drivers/misc/lkdtm/perms.c | 9

[PATCH 01/22] PCI: Add PCI_ERROR_RESPONSE and it's related defintions

2021-10-11 Thread Naveen Naidu
An MMIO read from a PCI device that doesn't exist or doesn't respond causes a PCI error. There's no real data to return to satisfy the CPU read, so most hardware fabricates ~0 data. Add a PCI_ERROR_RESPONSE definition for that and use it where appropriate to make these checks consistent and

[PATCH] powerpc/xive: Discard disabled interrupts in get_irqchip_state()

2021-10-11 Thread Cédric Le Goater
When an interrupt is passed through, the KVM XIVE device calls the set_vcpu_affinity() handler which raises the P bit to mask the interrupt and to catch any in-flight interrupts while routing the interrupt to the guest. On the guest side, drivers (like some Intels) can request at probe time some

Re: [PATCH 1/2] firmware: include drivers/firmware/Kconfig unconditionally

2021-10-11 Thread Geert Uytterhoeven
On Sat, Oct 9, 2021 at 11:24 AM Paul Menzel wrote: > [Cc: +linuxppc-dev@lists.ozlabs.org] > > Am 28.09.21 um 09:50 schrieb Arnd Bergmann: > > From: Arnd Bergmann > > > > Compile-testing drivers that require access to a firmware layer > > fails when that firmware symbol is unavailable. This

[PATCH] powerpc/boot: Use CONFIG_PPC_POWERNV to compile OPAL support

2021-10-11 Thread Cédric Le Goater
CONFIG_PPC64_BOOT_WRAPPER is selected by CPU_LITTLE_ENDIAN which is used to compile support for other platforms such as Microwatt. There is no need for OPAL calls on these. Signed-off-by: Cédric Le Goater --- arch/powerpc/boot/serial.c | 2 +- arch/powerpc/boot/Makefile | 2 +- 2 files changed,

Re: [PATCH] powerpc/xive: Discard disabled interrupts in get_irqchip_state()

2021-10-11 Thread seeteena
Tested-by: seeteena I have used a KVM guest with a passthrough ethernet adapter and the lspci output to identify the adapter. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org

Re: [PATCH] powerpc/xive: Discard disabled interrupts in get_irqchip_state()

2021-10-11 Thread seeteena
Tested-by: seeteena I have used a KVM guest with a passthrough ethernet adapter and the lspci output to identify the adapter.

Re: [PATCH v2 3/3] powerpc/numa: Fill distance_lookup_table for offline nodes

2021-10-11 Thread Michael Ellerman
Srikar Dronamraju writes: > * Michael Ellerman [2021-09-23 21:17:25]: > >> Srikar Dronamraju writes: >> > * Michael Ellerman [2021-08-26 23:36:53]: >> > >> >> Srikar Dronamraju writes: >> >> > Scheduler expects unique number of node distances to be available at >> >> > boot. >> ... >> > >> >>

Re: [PATCH] powerpc/mem: Fix arch/powerpc/mm/mem.c:53:12: error: no previous prototype for 'create_section_mapping'

2021-10-11 Thread Michael Ellerman
On Mon, 13 Sep 2021 17:17:26 +0200, Christophe Leroy wrote: > Commit 8e11d62e2e87 ("powerpc/mem: Add back missing header to fix 'no > previous prototype' error") was supposed to fix the problem, but in > the meantime commit a927bd6ba952 ("mm: fix phys_to_target_node() and* >

Re: [PATCH] powerpc/powermac: Remove stale declaration of pmac_md

2021-10-11 Thread Michael Ellerman
On Fri, 3 Sep 2021 08:23:52 + (UTC), Christophe Leroy wrote: > pmac_md doesn't exist anymore, remove stall declaration. > Applied to powerpc/next. [1/1] powerpc/powermac: Remove stale declaration of pmac_md https://git.kernel.org/powerpc/c/9d7fb0643a156a5887814e1263b648501cb0

Re: [PATCH] powerpc: fix unbalanced node refcount in check_kvm_guest()

2021-10-11 Thread Michael Ellerman
On Tue, 28 Sep 2021 07:45:50 -0500, Nathan Lynch wrote: > When check_kvm_guest() succeeds in looking up a /hypervisor OF node, it > returns without performing a matching put for the lookup, leaving the > node's reference count elevated. > > Add the necessary call to of_node_put(), rearranging the

Re: [PATCH v2 0/2] powerpc/paravirt: vcpu_is_preempted() tweaks

2021-10-11 Thread Michael Ellerman
On Tue, 28 Sep 2021 16:41:45 -0500, Nathan Lynch wrote: > Minor changes arising from discovering that this code throws warnings with > DEBUG_PREEMPT kernels. > > Changes since v1: > * Additional commentary to (1) distinguish hypervisor dispatch and preempt > behavior from kernel scheduler

Re: [PATCH v2 0/4] CPU DLPAR/hotplug for v5.16

2021-10-11 Thread Michael Ellerman
On Mon, 27 Sep 2021 15:19:29 -0500, Nathan Lynch wrote: > Fixes for some vintage bugs in handling cache node addition and removal, a > miscellaneous BUG->WARN conversion, and removal of the fragile "by count" > CPU DLPAR code that probably has no users. > > Changes since v1: > * Remove set but

Re: [PATCH v2 00/11] Add Apple M1 support to PASemi i2c driver

2021-10-11 Thread Hector Martin
On 11/10/2021 17.54, Wolfram Sang wrote: MAINTAINERS. It'll probably apply cleanly to 5.15-rc5 but if that happens again It doesn't because Linus' git doesn't have: Documentation/devicetree/bindings/pci/apple,pcie.yaml Because MAINTAINER dependencies can be a bit nasty, I suggest I drop the

Re: [PATCH] powerpc/476: Fix sparse report

2021-10-11 Thread Michael Ellerman
On Sat, 18 Sep 2021 11:22:32 +0200, Christophe Leroy wrote: > arch/powerpc/platforms/44x/ppc476.c:236:17: warning: cast removes > address space '__iomem' of expression > arch/powerpc/platforms/44x/ppc476.c:241:34: warning: incorrect type in > argument 1 (different address spaces) >

Re: [PATCH kernel v2] powerps/pseries/dma: Add support for 2M IOMMU page size

2021-10-11 Thread Michael Ellerman
On Wed, 6 Oct 2021 15:47:35 +1100, Alexey Kardashevskiy wrote: > The upcoming PAPR spec adds a 2M page size, bit 23 right after 16G page > size in the "ibm,query-pe-dma-window" call. > > This adds support for the new page size. Since the new page size is out > of sorted order, this changes the

Re: [PATCH] video: fbdev: use memset_io() instead of memset()

2021-10-11 Thread Michael Ellerman
On Wed, 15 Sep 2021 15:34:35 +0200, Christophe Leroy wrote: > While investigating a lockup at startup on Powerbook 3400C, it was > identified that the fbdev driver generates alignment exception at > startup: > > --- interrupt: 600 at memset+0x60/0xc0 > NIP: c0021414 LR: c03fc49c CTR:

Re: [PATCH trivial v2] powerpc/powernv/dump: Fix typo in comment

2021-10-11 Thread Michael Ellerman
On Tue, 14 Sep 2021 20:08:02 +0530, Vasant Hegde wrote: > Applied to powerpc/next. [1/1] powerpc/powernv/dump: Fix typo in comment https://git.kernel.org/powerpc/c/ee87843795ec5dc2f3bb315fade3ec098c88f639 cheers

Re: [PATCH] powerpc: Remove unused prototype for of_show_percpuinfo

2021-10-11 Thread Michael Ellerman
On Fri, 3 Sep 2021 16:32:46 +1000, Daniel Axtens wrote: > commit 6d7f58b04d82 ("[PATCH] powerpc: Some minor cleanups to setup_32.c") > removed of_show_percpuinfo but didn't remove the prototype. > > Remove it. > > > > [...] Applied to powerpc/next. [1/1] powerpc: Remove unused prototype for

Re: [PATCH 0/1] Arch use of pci_dev_is_added()

2021-10-11 Thread Michael Ellerman
On Fri, 10 Sep 2021 16:19:39 +0200, Niklas Schnelle wrote: > In my proposal to make pci_dev_is_added() more regularly usable by arch code > you mentioned[0] that you believe the uses in arch/powerpc are not necessary > anymore. From code reading I agree and so does Oliver O'Halloran[1]. > > So as

Re: [PATCH v2 0/2] powerpc:85xx: fix timebase sync issue when CONFIG_HOTPLUG_CPU=n

2021-10-11 Thread Michael Ellerman
On Wed, 29 Sep 2021 11:36:44 +0800, Xiaoming Ni wrote: > When CONFIG_SMP=y, timebase synchronization is required for mpc8572 when > the second kernel is started > arch/powerpc/kernel/smp.c: > int __cpu_up(unsigned int cpu, struct task_struct *tidle) > { > ... >

Re: [PATCH] powerpc: clean up UPD_CONSTR

2021-10-11 Thread Michael Ellerman
On Tue, 14 Sep 2021 09:17:04 -0700, Nick Desaulniers wrote: > UPD_CONSTR was previously a preprocessor define for an old GCC 4.9 inline > asm bug with m<> constraints. > > > > Applied to powerpc/next. [1/1] powerpc: clean up UPD_CONSTR

Re: [PATCH v2 4/4] powerpc/pseries/cpuhp: remove obsolete comment from pseries_cpu_die

2021-10-11 Thread Michael Ellerman
Nathan Lynch writes: > Michael Ellerman writes: >> Daniel Henrique Barboza writes: >>> This is enough to say that we can't easily see the history behind this >>> comment. >>> I also believe that we're better of without it since it doesn't make sense >>> with the current codebase. >> >> It was

Re: [PATCH v2 00/11] Add Apple M1 support to PASemi i2c driver

2021-10-11 Thread Wolfram Sang
> MAINTAINERS. It'll probably apply cleanly to 5.15-rc5 but if that happens > again It doesn't because Linus' git doesn't have: Documentation/devicetree/bindings/pci/apple,pcie.yaml Because MAINTAINER dependencies can be a bit nasty, I suggest I drop the MAINTAINER additions for now and we add

Re: [PATCH v2 00/11] Add Apple M1 support to PASemi i2c driver

2021-10-11 Thread Wolfram Sang
> > Because MAINTAINER dependencies can be a bit nasty, I suggest I drop the > > MAINTAINER additions for now and we add them later. Then, you can add > > the pasemi-core as well. D'accord? > > > > We can just split the MAINTAINERS changes into a separate patch and I can > push that one through

Re: [PATCH 1/2] firmware: include drivers/firmware/Kconfig unconditionally

2021-10-11 Thread Arnd Bergmann
On Mon, Oct 11, 2021 at 10:42 AM Geert Uytterhoeven wrote: > On Sat, Oct 9, 2021 at 11:24 AM Paul Menzel wrote: > > Am 28.09.21 um 09:50 schrieb Arnd Bergmann: > > > From: Arnd Bergmann > > +# > > +# ARM System Control and Management Interface Protocol > > +# > > +# end of ARM System Control

Re: [PATCH v2 00/11] Add Apple M1 support to PASemi i2c driver

2021-10-11 Thread Wolfram Sang
On Fri, Oct 08, 2021 at 06:35:21PM +0200, Sven Peter wrote: > Hi, > > v1: > https://lore.kernel.org/linux-i2c/20210926095847.38261-1-s...@svenpeter.dev/ > > Changes for v2: > - Added reviewed-by/acks > - Switched from ioport_map to pci_iomap as suggested by Arnd Bergmann > - Renamed

Re: [V3 0/4] powerpc/perf: Add instruction and data address registers to extended regs

2021-10-11 Thread kajoljain
On 10/7/21 12:25 PM, Athira Rajeev wrote: > Patch set adds PMU registers namely Sampled Instruction Address Register > (SIAR) and Sampled Data Address Register (SDAR) as part of extended regs > in PowerPC. These registers provides the instruction/data address and > adding these to extended regs