Re: [PATCH 2/2] MAINTAINERS: Update powerpc BPF JIT maintainers

2024-07-16 Thread Hari Bathini
On 14/07/24 2:04 pm, Naveen N Rao wrote: Hari Bathini has been updating and maintaining the powerpc BPF JIT since a while now. Christophe Leroy has been doing the same for 32-bit powerpc. Add them as maintainers for the powerpc BPF JIT. I am no longer actively looking into the powerpc BPF JIT

Re: [PATCH 2/6] kallsyms: Emit symbol at the holes in the text

2024-07-16 Thread Masahiro Yamada
On Thu, Jun 13, 2024 at 10:36 PM Zheng Yejian wrote: > > When a weak type function is overridden, its symbol will be removed > from the symbol table, but its code will not be removed. Besides, > due to lacking of size for kallsyms, kernel compute function size by > substracting its symbol address

Re: [PATCH v4 13/29] arm64: convert protection key into vm_flags and pgprot values

2024-07-16 Thread Anshuman Khandual
On 5/3/24 18:31, Joey Gouly wrote: > Modify arch_calc_vm_prot_bits() and vm_get_page_prot() such that the pkey > value is set in the vm_flags and then into the pgprot value. > > Signed-off-by: Joey Gouly > Cc: Catalin Marinas > Cc: Will Deacon > --- > arch/arm64/include/asm/mman.h | 8 +

Re: [PATCH v4 14/29] arm64: mask out POIndex when modifying a PTE

2024-07-16 Thread Anshuman Khandual
On 5/3/24 18:31, Joey Gouly wrote: > When a PTE is modified, the POIndex must be masked off so that it can be > modified. > > Signed-off-by: Joey Gouly > Cc: Catalin Marinas > Cc: Will Deacon > Reviewed-by: Catalin Marinas Reviewed-by: Anshuman Khandual > --- > arch/arm64/include/asm/p

Re: [PATCH v4 13/29] arm64: convert protection key into vm_flags and pgprot values

2024-07-16 Thread Joey Gouly
On Tue, Jul 16, 2024 at 02:35:48PM +0530, Anshuman Khandual wrote: > > > On 5/3/24 18:31, Joey Gouly wrote: > > Modify arch_calc_vm_prot_bits() and vm_get_page_prot() such that the pkey > > value is set in the vm_flags and then into the pgprot value. > > > > Signed-off-by: Joey Gouly > > Cc: Ca

Re: [PATCH 2/2] MAINTAINERS: Update powerpc BPF JIT maintainers

2024-07-16 Thread Google
Hi, On Tue, 16 Jul 2024 12:36:11 +0530 Hari Bathini wrote: > > > On 14/07/24 2:04 pm, Naveen N Rao wrote: > > Hari Bathini has been updating and maintaining the powerpc BPF JIT since > > a while now. Christophe Leroy has been doing the same for 32-bit > > powerpc. Add them as maintainers for t

Re: [PATCH 1/2] MAINTAINERS: Update email address of Naveen

2024-07-16 Thread Google
Hi Naveen, On Sun, 14 Jul 2024 14:04:23 +0530 Naveen N Rao wrote: > I have switched to using my @kernel.org id for my contributions. Update > MAINTAINERS and mailmap to reflect the same. > Looks good to me. Reviewed-by: Masami Hiramatsu (Google) Would powerpc maintainer pick this? Thanks,

Re: [PATCH v4 15/29] arm64: handle PKEY/POE faults

2024-07-16 Thread Anshuman Khandual
A minor nit. The fault is related to POE in terms of the HW rather than PKEY which it is abstracted out in core MM. Hence it might be better to describe the fault as POE one rather than PKEY related. arm64/mm: Handle POE faults On 5/3/24 18:31, Joey Gouly wrote: > If a memory fault occurs that is

Re: [PATCH v4 16/29] arm64: add pte_access_permitted_no_overlay()

2024-07-16 Thread Anshuman Khandual
On 5/3/24 18:31, Joey Gouly wrote: > We do not want take POE into account when clearing the MTE tags. > > Signed-off-by: Joey Gouly > Cc: Catalin Marinas > Cc: Will Deacon Reviewed-by: Anshuman Khandual > --- > arch/arm64/include/asm/pgtable.h | 11 +++ > 1 file changed, 7 insert

Re: [PATCH] arch/powerpc/kvm: Avoid extra checks when emulating HFSCR bits

2024-07-16 Thread Gautam Menghani
On Tue, Jul 16, 2024 at 11:17:13AM GMT, Michael Ellerman wrote: > Gautam Menghani writes: > > When a KVM guest tries to use a feature disabled by HFSCR, it exits to > > the host for emulation support, and the code checks for all bits which > > are emulated. Avoid checking all the bits by using a s

Re: [PATCH v4 21/29] arm64/ptrace: add support for FEAT_POE

2024-07-16 Thread Anshuman Khandual
On 5/3/24 18:31, Joey Gouly wrote: > Add a regset for POE containing POR_EL0. > > Signed-off-by: Joey Gouly > Cc: Catalin Marinas > Cc: Will Deacon > Reviewed-by: Mark Brown > Reviewed-by: Catalin Marinas Reviewed-by: Anshuman Khandual > --- > arch/arm64/kernel/ptrace.c | 46 ++

Re: [PATCH v4 20/29] arm64: enable POE and PIE to coexist

2024-07-16 Thread Anshuman Khandual
On 5/3/24 18:31, Joey Gouly wrote: > Set the EL0/userspace indirection encodings to be the overlay enabled > variants of the permissions. Could you please explain the rationale for this ? Should POE variants for pte permissions be used (when available) instead of permission indirection ones. >

Re: [PATCH v4 19/29] arm64: enable PKEY support for CPUs with S1POE

2024-07-16 Thread Anshuman Khandual
On 5/3/24 18:31, Joey Gouly wrote: > Now that PKEYs support has been implemented, enable it for CPUs that > support S1POE. > > Signed-off-by: Joey Gouly > Cc: Catalin Marinas > Cc: Will Deacon > Acked-by: Catalin Marinas Reviewed-by: Anshuman Khandual > --- > arch/arm64/include/asm/pkey

Re: [PATCH v4 22/29] arm64: add Permission Overlay Extension Kconfig

2024-07-16 Thread Anshuman Khandual
On 5/3/24 18:31, Joey Gouly wrote: > Now that support for POE and Protection Keys has been implemented, add a > config to allow users to actually enable it. > > Signed-off-by: Joey Gouly > Cc: Catalin Marinas > Cc: Will Deacon Reviewed-by: Anshuman Khandual > --- > arch/arm64/Kconfig | 2

[PATCH 00/17] mm: introduce numa_memblks

2024-07-16 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Hi, Following the discussion about handling of CXL fixed memory windows on arm64 [1] I decided to bite the bullet and move numa_memblks from x86 to the generic code so they will be available on arm64/riscv and maybe on loongarch sometime later. While it could b

[PATCH 01/17] mm: move kernel/numa.c to mm/

2024-07-16 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" The stub functions in kernel/numa.c belong to mm/ rather than to kernel/ Signed-off-by: Mike Rapoport (Microsoft) --- kernel/Makefile | 1 - mm/Makefile | 1 + {kernel => mm}/numa.c | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename {k

[PATCH 02/17] MIPS: sgi-ip27: make NODE_DATA() the same as on all other architectures

2024-07-16 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" sgi-ip27 is the only system that defines NODE_DATA() differently than the rest of NUMA machines. Add node_data array of struct pglist pointers that will point to __node_data[node]->pglist and redefine NODE_DATA() to use node_data array. This will allow pulling

[PATCH 03/17] MIPS: loongson64: rename __node_data to node_data

2024-07-16 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Make definition of node_data match other architectures. This will allow pulling declaration of node_data to the generic mm code in the following commit. Signed-off-by: Mike Rapoport (Microsoft) --- arch/mips/include/asm/mach-loongson64/mmzone.h | 4 ++-- arch/

[PATCH 04/17] arch, mm: move definition of node_data to generic code

2024-07-16 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Every architecture that supports NUMA defines node_data in the same way: struct pglist_data *node_data[MAX_NUMNODES]; No reason to keep multiple copies of this definition and its forward declarations, especially when such forward declaration is the only

[PATCH 05/17] arch, mm: pull out allocation of NODE_DATA to generic code

2024-07-16 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Architectures that support NUMA duplicate the code that allocates NODE_DATA on the node-local memory with slight variations in reporting of the addresses where the memory was allocated. Use x86 version as the basis for the generic alloc_node_data() function and

[PATCH 06/17] x86/numa: simplify numa_distance allocation

2024-07-16 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Allocation of numa_distance uses memblock_phys_alloc_range() to limit allocation to be below the last mapped page. But NUMA initializaition runs after the direct map is populated and there is also code in setup_arch() that adjusts memblock limit to reflect how m

[PATCH 07/17] x86/numa: move FAKE_NODE_* defines to numa_emu

2024-07-16 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" The definitions of FAKE_NODE_MIN_SIZE and FAKE_NODE_MIN_HASH_MASK are only used by numa emulation code, make them local to arch/x86/mm/numa_emulation.c Signed-off-by: Mike Rapoport (Microsoft) --- arch/x86/include/asm/numa.h | 2 -- arch/x86/mm/numa_emulation

[PATCH 08/17] x86/numa_emu: simplify allocation of phys_dist

2024-07-16 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" By the time numa_emulation() is called, all physical memory is already mapped in the direct map and there is no need to define limits for memblock allocation. Replace memblock_phys_alloc_range() with memblock_alloc(). Signed-off-by: Mike Rapoport (Microsoft) -

[PATCH 09/17] x86/numa_emu: split __apicid_to_node update to a helper function

2024-07-16 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" This is required to make numa emulation code architecture independent so that it can be moved to generic code in following commits. Signed-off-by: Mike Rapoport (Microsoft) --- arch/x86/include/asm/numa.h | 2 ++ arch/x86/mm/numa.c | 22 +++

[PATCH 10/17] x86/numa_emu: use a helper function to get MAX_DMA32_PFN

2024-07-16 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" This is required to make numa emulation code architecture independent s that it can be moved to generic code in following commits. Signed-off-by: Mike Rapoport (Microsoft) --- arch/x86/include/asm/numa.h | 1 + arch/x86/mm/numa.c | 5 + arch/x86

[PATCH 11/17] x86/numa: numa_{add,remove}_cpu: make cpu parameter unsigned

2024-07-16 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" CPU id cannot be negative. Making it unsigned also aligns with declarations in include/asm-generic/numa.h used by arm64 and riscv and allows sharing numa emulation code with these architectures. Signed-off-by: Mike Rapoport (Microsoft) --- arch/x86/include/as

[PATCH 12/17] mm: introduce numa_memblks

2024-07-16 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Move code dealing with numa_memblks from arch/x86 to mm/ and add Kconfig options to let x86 select it in its Kconfig. This code will be later reused by arch_numa. No functional changes. Signed-off-by: Mike Rapoport (Microsoft) --- arch/x86/Kconfig

[PATCH 13/17] mm: move numa_distance and related code from x86 to numa_memblks

2024-07-16 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Move code dealing with numa_distance array from arch/x86 to mm/numa_memblks.c This code will be later reused by arch_numa. No functional changes. Signed-off-by: Mike Rapoport (Microsoft) --- arch/x86/mm/numa.c | 101

[PATCH 14/17] mm: introduce numa_emulation

2024-07-16 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Move numa_emulation codfrom arch/x86 to mm/numa_emulation.c This code will be later reused by arch_numa. No functional changes. Signed-off-by: Mike Rapoport (Microsoft) --- arch/x86/Kconfig | 8 arch/x86/include/asm/numa.h | 12 ---

[PATCH 15/17] mm: make numa_memblks more self-contained

2024-07-16 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Introduce numa_memblks_init() and move some code around to avoid several global variables in numa_memblks. Signed-off-by: Mike Rapoport (Microsoft) --- arch/x86/mm/numa.c | 53 - include/linux/numa_memblks.h | 9 + mm/num

[PATCH 16/17] arch_numa: switch over to numa_memblks

2024-07-16 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Until now arch_numa was directly translating firmware NUMA information to memblock. Using numa_memblks as an intermediate step has a few advantages: * alignment with more battle tested x86 implementation * availability of NUMA emulation * maintaining node inform

[PATCH 17/17] mm: make range-to-target_node lookup facility a part of numa_memblks

2024-07-16 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" The x86 implementation of range-to-target_node lookup (i.e. phys_to_target_node() and memory_add_physaddr_to_nid()) relies on numa_memblks. Since numa_memblks are now part of the generic code, move these functions from x86 to mm/numa_memblks.c and select CONFIG_

Re: [PATCH v4 17/29] arm64: implement PKEYS support

2024-07-16 Thread Anshuman Khandual
On 7/9/24 18:37, Kevin Brodsky wrote: > On 03/05/2024 15:01, Joey Gouly wrote: >> @@ -267,6 +294,28 @@ static inline unsigned long mm_untag_mask(struct >> mm_struct *mm) >> return -1UL >> 8; >> } >> >> +/* >> + * We only want to enforce protection keys on the current process >> + * beca

[PATCH v2] KVM: PPC: Book3S HV: Refactor HFSCR emulation for KVM guests

2024-07-16 Thread Gautam Menghani
Refactor HFSCR emulation for KVM guests when they exit out with H_FAC_UNAVAIL to use a switch case instead of checking all "cause" values, since the "cause" values are mutually exclusive; and this is better expressed with a switch case. Signed-off-by: Gautam Menghani --- V1 -> V2: 1. Reword chan

Re: [PATCH 03/17] MIPS: loongson64: rename __node_data to node_data

2024-07-16 Thread Jiaxun Yang
在2024年7月16日七月 下午7:13,Mike Rapoport写道: > From: "Mike Rapoport (Microsoft)" > > Make definition of node_data match other architectures. > This will allow pulling declaration of node_data to the generic mm code in > the following commit. > > Signed-off-by: Mike Rapoport (Microsoft) Reviewed-by:

Re: [PATCH v4 06/29] arm64: context switch POR_EL0 register

2024-07-16 Thread Mark Brown
On Mon, Jul 15, 2024 at 01:57:10PM +0530, Anshuman Khandual wrote: > On 5/3/24 18:31, Joey Gouly wrote: > > +static inline bool system_supports_poe(void) > > +{ > > + return IS_ENABLED(CONFIG_ARM64_POE) && > CONFIG_ARM64_POE has not been defined/added until now ? That's a common pattern when a

Re: [PATCH v4] cxl: Fix possible null pointer dereference in read_handle()

2024-07-16 Thread Ma Ke
> Michael Ellerman wrote: > > In read_handle(), of_get_address() may return NULL if getting address and > > size of the node failed. When of_read_number() uses prop to handle > > conversions between different byte orders, it could lead to a null pointer > > dereference. Add NULL check to fix potent

Re: [PATCH v4 20/29] arm64: enable POE and PIE to coexist

2024-07-16 Thread Joey Gouly
On Tue, Jul 16, 2024 at 04:11:54PM +0530, Anshuman Khandual wrote: > > > On 5/3/24 18:31, Joey Gouly wrote: > > Set the EL0/userspace indirection encodings to be the overlay enabled > > variants of the permissions. > > Could you please explain the rationale for this ? Should POE variants for > p

Re: [PATCH V7 00/18] Add data type profiling support for powerpc

2024-07-16 Thread kajoljain
Patchset looks fine to me. Tested-by: Kajol Jain Reviewed-by: Kajol Jain Thanks, Kajol Jain On 7/13/24 22:25, Athira Rajeev wrote: > The patchset from Namhyung added support for data type profiling > in perf tool. This enabled support to associate PMU samples to data > types they refer using DWA

[PATCH AUTOSEL 6.9 03/22] powerpc/pseries: Whitelist dtl slub object for copying to userspace

2024-07-16 Thread Sasha Levin
From: Anjali K [ Upstream commit 1a14150e1656f7a332a943154fc486504db4d586 ] Reading the dispatch trace log from /sys/kernel/debug/powerpc/dtl/cpu-* results in a BUG() when the config CONFIG_HARDENED_USERCOPY is enabled as shown below. kernel BUG at mm/usercopy.c:102! Oops: Exception in

[PATCH AUTOSEL 6.9 04/22] powerpc/eeh: avoid possible crash when edev->pdev changes

2024-07-16 Thread Sasha Levin
From: Ganesh Goudar [ Upstream commit a1216e62d039bf63a539bbe718536ec789a853dd ] If a PCI device is removed during eeh_pe_report_edev(), edev->pdev will change and can cause a crash, hold the PCI rescan/remove lock while taking a copy of edev->pdev->bus. Signed-off-by: Ganesh Goudar Signed-off

[PATCH AUTOSEL 6.6 02/18] powerpc/pseries: Whitelist dtl slub object for copying to userspace

2024-07-16 Thread Sasha Levin
From: Anjali K [ Upstream commit 1a14150e1656f7a332a943154fc486504db4d586 ] Reading the dispatch trace log from /sys/kernel/debug/powerpc/dtl/cpu-* results in a BUG() when the config CONFIG_HARDENED_USERCOPY is enabled as shown below. kernel BUG at mm/usercopy.c:102! Oops: Exception in

[PATCH AUTOSEL 6.6 03/18] powerpc/eeh: avoid possible crash when edev->pdev changes

2024-07-16 Thread Sasha Levin
From: Ganesh Goudar [ Upstream commit a1216e62d039bf63a539bbe718536ec789a853dd ] If a PCI device is removed during eeh_pe_report_edev(), edev->pdev will change and can cause a crash, hold the PCI rescan/remove lock while taking a copy of edev->pdev->bus. Signed-off-by: Ganesh Goudar Signed-off

[PATCH AUTOSEL 6.1 02/15] powerpc/pseries: Whitelist dtl slub object for copying to userspace

2024-07-16 Thread Sasha Levin
From: Anjali K [ Upstream commit 1a14150e1656f7a332a943154fc486504db4d586 ] Reading the dispatch trace log from /sys/kernel/debug/powerpc/dtl/cpu-* results in a BUG() when the config CONFIG_HARDENED_USERCOPY is enabled as shown below. kernel BUG at mm/usercopy.c:102! Oops: Exception in

[PATCH AUTOSEL 6.1 03/15] powerpc/eeh: avoid possible crash when edev->pdev changes

2024-07-16 Thread Sasha Levin
From: Ganesh Goudar [ Upstream commit a1216e62d039bf63a539bbe718536ec789a853dd ] If a PCI device is removed during eeh_pe_report_edev(), edev->pdev will change and can cause a crash, hold the PCI rescan/remove lock while taking a copy of edev->pdev->bus. Signed-off-by: Ganesh Goudar Signed-off

[PATCH AUTOSEL 5.15 2/9] powerpc/pseries: Whitelist dtl slub object for copying to userspace

2024-07-16 Thread Sasha Levin
From: Anjali K [ Upstream commit 1a14150e1656f7a332a943154fc486504db4d586 ] Reading the dispatch trace log from /sys/kernel/debug/powerpc/dtl/cpu-* results in a BUG() when the config CONFIG_HARDENED_USERCOPY is enabled as shown below. kernel BUG at mm/usercopy.c:102! Oops: Exception in

[PATCH AUTOSEL 5.15 3/9] powerpc/eeh: avoid possible crash when edev->pdev changes

2024-07-16 Thread Sasha Levin
From: Ganesh Goudar [ Upstream commit a1216e62d039bf63a539bbe718536ec789a853dd ] If a PCI device is removed during eeh_pe_report_edev(), edev->pdev will change and can cause a crash, hold the PCI rescan/remove lock while taking a copy of edev->pdev->bus. Signed-off-by: Ganesh Goudar Signed-off

[PATCH AUTOSEL 5.10 2/7] powerpc/pseries: Whitelist dtl slub object for copying to userspace

2024-07-16 Thread Sasha Levin
From: Anjali K [ Upstream commit 1a14150e1656f7a332a943154fc486504db4d586 ] Reading the dispatch trace log from /sys/kernel/debug/powerpc/dtl/cpu-* results in a BUG() when the config CONFIG_HARDENED_USERCOPY is enabled as shown below. kernel BUG at mm/usercopy.c:102! Oops: Exception in

[PATCH AUTOSEL 5.10 3/7] powerpc/eeh: avoid possible crash when edev->pdev changes

2024-07-16 Thread Sasha Levin
From: Ganesh Goudar [ Upstream commit a1216e62d039bf63a539bbe718536ec789a853dd ] If a PCI device is removed during eeh_pe_report_edev(), edev->pdev will change and can cause a crash, hold the PCI rescan/remove lock while taking a copy of edev->pdev->bus. Signed-off-by: Ganesh Goudar Signed-off

[PATCH AUTOSEL 5.4 2/7] powerpc/pseries: Whitelist dtl slub object for copying to userspace

2024-07-16 Thread Sasha Levin
From: Anjali K [ Upstream commit 1a14150e1656f7a332a943154fc486504db4d586 ] Reading the dispatch trace log from /sys/kernel/debug/powerpc/dtl/cpu-* results in a BUG() when the config CONFIG_HARDENED_USERCOPY is enabled as shown below. kernel BUG at mm/usercopy.c:102! Oops: Exception in

[PATCH AUTOSEL 5.4 3/7] powerpc/eeh: avoid possible crash when edev->pdev changes

2024-07-16 Thread Sasha Levin
From: Ganesh Goudar [ Upstream commit a1216e62d039bf63a539bbe718536ec789a853dd ] If a PCI device is removed during eeh_pe_report_edev(), edev->pdev will change and can cause a crash, hold the PCI rescan/remove lock while taking a copy of edev->pdev->bus. Signed-off-by: Ganesh Goudar Signed-off

[PATCH v2 0/8] PCI: Align small (<4k) BARs

2024-07-16 Thread Stewart Hildebrand
This series sets the default minimum resource alignment to 4k for memory BARs. In preparation, it makes an optimization and addresses some corner cases observed when reallocating BARs. I consider the prepapatory patches to be prerequisites to changing the default BAR alignment. I considered introd

[PATCH v2 6/8] powerpc/pci: Preserve IORESOURCE_STARTALIGN alignment

2024-07-16 Thread Stewart Hildebrand
There is a corner case in pcibios_allocate_resources()/alloc_resource() where the IORESOURCE_STARTALIGN alignment of memory BAR resources gets overwritten. This does not affect bridge resources. Account for IORESOURCE_STARTALIGN. Signed-off-by: Stewart Hildebrand --- v1->v2: * new patch --- arch

Re: [PATCH 1/2] MAINTAINERS: Update email address of Naveen

2024-07-16 Thread Michael Ellerman
Masami Hiramatsu (Google) writes: > Hi Naveen, > > On Sun, 14 Jul 2024 14:04:23 +0530 > Naveen N Rao wrote: > >> I have switched to using my @kernel.org id for my contributions. Update >> MAINTAINERS and mailmap to reflect the same. >> > > Looks good to me. > > Reviewed-by: Masami Hiramatsu (Go