Re: [PATCH V12 01/20] uapi: simplify __ARCH_FLOCK{,64}_PAD a little

2022-07-14 Thread Florian Fainelli
On 4/5/2022 12:12 AM, guo...@kernel.org wrote: From: Christoph Hellwig Don't bother to define the symbols empty, just don't use them. That makes the intent a little more clear. Remove the unused HAVE_ARCH_STRUCT_FLOCK64 define and merge the 32-bit mips struct flock into the generic one.

Re: [RFC PATCH 1/2] asm-generic: Remove pci.h copying code out to architectures

2022-07-14 Thread Stafford Horne
On Thu, Jul 14, 2022 at 06:45:27PM -0700, Max Filippov wrote: > On Thu, Jul 14, 2022 at 2:47 PM Stafford Horne wrote: > > > > The generic pci.h header provides a definition of pci_get_legacy_ide_irq > > which is used by architectures that use PC-style interrupt numbers. > > > > This patch removes

Re: [RFC PATCH 1/2] asm-generic: Remove pci.h copying code out to architectures

2022-07-14 Thread Max Filippov
On Thu, Jul 14, 2022 at 2:47 PM Stafford Horne wrote: > > The generic pci.h header provides a definition of pci_get_legacy_ide_irq > which is used by architectures that use PC-style interrupt numbers. > > This patch removes the old pci.h in order to make room for a new > pci.h to be used by

[PATCH v2] powerpc: add documentation for HWCAPs

2022-07-14 Thread Nicholas Piggin
Take the arm64 HWCAP documentation file and adjust it for powerpc. Signed-off-by: Nicholas Piggin --- Thanks for the comments. v2: - Addition of "categories" paragraph. - Change "features should not be probed via other means" to "HWCAP is preferred". - Speling fix. -

Re: [PATCH Linux] powerpc: add documentation for HWCAPs

2022-07-14 Thread Nicholas Piggin
Excerpts from Segher Boessenkool's message of May 25, 2022 4:32 am: > On Tue, May 24, 2022 at 11:52:00AM +0200, Florian Weimer wrote: >> * Nicholas Piggin: >> >> > +2. Facilities >> > +- >> > +The Power ISA uses the term "facility" to describe a class of >> > instructions, >> >

Re: [PATCH Linux] powerpc: add documentation for HWCAPs

2022-07-14 Thread Nicholas Piggin
Finally got some details about the icache snoop question so just coming back to this now, sorry for the delay... (POWER10 does support the coherent icache flush sequence as expected, there was some updates to the UM wording but that will be fixed). Excerpts from Segher Boessenkool's message of

Re: [PATCH] macintosh:fix oob read in do_adb_query function

2022-07-14 Thread Benjamin Herrenschmidt
On Wed, 2022-07-13 at 11:53 -0700, Kees Cook wrote: > On Wed, Jul 13, 2022 at 11:37:34PM +0800, Ning Qiang wrote: > > In do_adb_query function of drivers/macintosh/adb.c, req->data is > > copy > > form userland. the parameter "req->data[2]" is Missing check, the > > array size of adb_handler[] is

Re: [PATCH] macintosh:fix oob read in do_adb_query function

2022-07-14 Thread Benjamin Herrenschmidt
On Wed, 2022-07-13 at 23:37 +0800, Ning Qiang wrote: > In do_adb_query function of drivers/macintosh/adb.c, req->data is > copy > form userland. the parameter "req->data[2]" is Missing check, the > array size of adb_handler[] is 16, so "adb_handler[ > req->data[2]].original_address" and

[RFC PATCH 1/2] asm-generic: Remove pci.h copying code out to architectures

2022-07-14 Thread Stafford Horne
The generic pci.h header provides a definition of pci_get_legacy_ide_irq which is used by architectures that use PC-style interrupt numbers. This patch removes the old pci.h in order to make room for a new pci.h to be used by arm64, riscv, openrisc, etc. The existing code in pci.h is moved out

Re: [PATCH] powerpc/52xx: Mark gpt driver as not removable

2022-07-14 Thread Uwe Kleine-König
hello, On Sun, Jun 12, 2022 at 11:34:00PM +0200, Uwe Kleine-König wrote: > Returning an error code (here -EBUSY) from a remove callback doesn't > prevent the driver from being unloaded. The only effect is that an error > message is emitted and the driver is removed anyhow. > > So instead drop

Re: [PATCH v6 5/6] of: kexec: Refactor IMA buffer related functions to make them reusable

2022-07-14 Thread Rob Herring
On Thu, Jul 07, 2022 at 01:20:25PM -0400, Stefan Berger wrote: > Refactor IMA buffer related functions to make them reusable for carrying > TPM logs across kexec. > > Signed-off-by: Stefan Berger > Cc: Rob Herring > Cc: Frank Rowand > Cc: Mimi Zohar > > --- > v6: > - Add __init to

[Bug 216183] [bisected] Kernel 5.19-rc4 boots ok with CONFIG_PPC_RADIX_MMU=y but fails to boot with CONFIG_PPC_HASH_MMU_NATIVE=y

2022-07-14 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=216183 --- Comment #8 from Erhard F. (erhar...@mailbox.org) --- Created attachment 301425 --> https://bugzilla.kernel.org/attachment.cgi?id=301425=edit bisect.log Successfully did a bisect which revealed this commit: # git bisect good

Re: [PATCH linux-next] powerpc: use raw_smp_processor_id in arch_touch_nmi_watchdog

2022-07-14 Thread John Ogness
On 2022-07-14, Zhouyi Zhou wrote: > Thank John for correcting me ;-) After looking more closely, I do not think disabling migration is the correct fix either. The per-cpu variable @wd_timer_tb is written from 2 functions: - watchdog_timer_interrupt() <-- irq handler - arch_touch_nmi_watchdog()

Re: [PATCH linux-next] powerpc: use raw_smp_processor_id in arch_touch_nmi_watchdog

2022-07-14 Thread Zhouyi Zhou
Thank John for correcting me ;-) On Thu, Jul 14, 2022 at 5:25 PM John Ogness wrote: > > On 2022-07-14, Zhouyi Zhou wrote: > > use raw_smp_processor_id() in arch_touch_nmi_watchdog > > because when called from watchdog, the cpu is preemptible. > > I would expect the correct solution is to make

Re: [PATCH linux-next] powerpc: use raw_smp_processor_id in arch_touch_nmi_watchdog

2022-07-14 Thread John Ogness
On 2022-07-14, Zhouyi Zhou wrote: > use raw_smp_processor_id() in arch_touch_nmi_watchdog > because when called from watchdog, the cpu is preemptible. I would expect the correct solution is to make it a non-migration section. Something like the below (untested) patch. John Ogness diff --git

mainline build failure of powerpc allmodconfig for prom_init_check

2022-07-14 Thread Sudip Mukherjee (Codethink)
Hi All, Not sure if it has been reported before but the latest mainline kernel branch fails to build for powerpc allmodconfig with gcc-12 and the error is: Error: External symbol 'memset' referenced from prom_init.c make[2]: *** [arch/powerpc/kernel/Makefile:204:

[PATCH kernel 3/3] powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains

2022-07-14 Thread Alexey Kardashevskiy
Up until now PPC64 managed to avoid using iommu_ops. The VFIO driver uses a SPAPR TCE sub-driver and all iommu_ops uses were kept in the Type1 VFIO driver. Recent development added 2 uses of iommu_ops to the generic VFIO which broke POWER: - a coherency capability check; - blocking IOMMU domain -

[PATCH kernel 2/3] powerpc/pci_64: Init pcibios subsys a bit later

2022-07-14 Thread Alexey Kardashevskiy
The following patches are going to add dependency/use of iommu_ops which is initialized in subsys_initcall as well. This moves pciobios_init() to the next initcall level. This should not cause behavioral change. Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/kernel/pci_64.c | 2 +- 1

[PATCH kernel 1/3] powerpc/iommu: Add "borrowing" iommu_table_group_ops

2022-07-14 Thread Alexey Kardashevskiy
PPC64 IOMMU API defines iommu_table_group_ops which handles DMA windows for PEs: control the ownership, create/set/unset a table the hardware for dynamic DMA windows (DDW). VFIO uses the API to implement support on POWER. So far only PowerNV IODA2 (POWER8 and newer machines) implemented this and

[PATCH kernel 0/3] powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains

2022-07-14 Thread Alexey Kardashevskiy
Here is another take on iommu_ops on POWER to make VFIO work again on POWERPC64. The tree with all prerequisites is here: https://github.com/aik/linux/tree/kvm-fixes-wip The previous discussion is here:

[PATCH kernel] powerpc/iommu: Fix iommu_table_in_use for a small default DMA window case

2022-07-14 Thread Alexey Kardashevskiy
The existing iommu_table_in_use() helper checks if the kernel is using any of TCEs. There are some reserved TCEs: 1) the very first one if DMA window starts from 0 to avoid having a zero but still valid DMA handle; 2) it_reserved_start..it_reserved_end to exclude MMIO32 window in case the default

[PATCH kernel] powerpc/ioda/iommu/debugfs: Generate unique debugfs entries

2022-07-14 Thread Alexey Kardashevskiy
The iommu_table::it_index is a LIOBN which is not initialized on PowerNV as it is not used except IOMMU debugfs where it is used for a node name. This initializes it_index witn a unique number to avoid warnings and have a node for every iommu_table. This should not cause any behavioral change

Re: [PATCH kernel v2] pseries/iommu/ddw: Fix kdump to work in absence of ibm,dma-window

2022-07-14 Thread Hari Bathini
On 29/06/22 11:36 am, Alexey Kardashevskiy wrote: The pseries platform uses 32bit default DMA window (always 4K pages) and optional 64bit DMA window available via DDW ("Dynamic DMA Windows"), 64K or 2M pages. For ages the default one was not removed and a huge window was created in addition.

Re: [PATCH 1/2] powerpc/kvm: Move pmu code in kvm folder to separate file for power9 and later platforms

2022-07-14 Thread Madhavan Srinivasan
On 7/13/22 11:11 AM, Nicholas Piggin wrote: Excerpts from Kajol Jain's message of July 11, 2022 1:49 pm: File book3s_hv_p9_entry.c in powerpc/kvm folder consists of functions like freeze_pmu, switch_pmu_to_guest and switch_pmu_to_host which are specific to Performance Monitoring Unit(PMU) for