[PATCH V2 5/5] selftests/powerpc/pmu: Update comment with details to understand auxv_generic_compat_pmu() utility function

2025-01-12 Thread Athira Rajeev
auxv_generic_compat_pmu() utility function is to detect whether the system is having generic compat PMU. The check is based on base platform value from /proc/self/auxv. Update the comment with details on how auxv is used to detect the platform. Signed-off-by: Athira Rajeev --- Changelog: v1 -> v

[PATCH V2 2/5] tools/testing/selftests/powerpc: Add check for power11 pvr for pmu selfests

2025-01-12 Thread Athira Rajeev
Some of the tests depends on pvr value to choose the event. Example: - event_alternatives_tests_p10: alternative event depends on registered PMU driver which is based on pvr - generic_events_valid_test varies based on platform - bhrb_filter_map_test: again its dependent on pmu to decide which b

[PATCH V2 3/5] tools/testing/selftests/powerpc/pmu: Update comment description to mention ISA v3.1 for power10 and above

2025-01-12 Thread Athira Rajeev
Updated the comments in the pmu selftests to include power11/ISA v3.1 where ever required. Signed-off-by: Athira Rajeev --- Changelog: v1 -> v2 No code changes. Rebased to latest upstream .../event_code_tests/group_constraint_l2l3_sel_test.c | 2 +- .../group_constraint_radix_scope_qual_tes

[PATCH 2/2] arch/powerpc/perf: Update get_mem_data_src function to use saved values of sier and mmcra regs

2025-01-12 Thread Athira Rajeev
During performance monitor interrupt handling, the regs are setup using perf_read_regs function. Here some of the pt_regs fields is overloaded. Samples Instruction Event Register (SIER) is loaded into pt_regs, overloading regs->dar. And regs->dsisr to store MMCRA (Monitor Mode Control Register A) s

[PATCH 1/2] arch/powerpc/perf: Check the instruction type before creating sample with perf_mem_data_src

2025-01-12 Thread Athira Rajeev
perf mem report aborts as below sometimes (during some corner case) in powerpc: # ./perf mem report 1>out *** stack smashing detected ***: terminated Aborted (core dumped) The backtrace is as below: __pthread_kill_implementation () raise () abort () __libc_message __fortif

Re: [PATCH v6 07/26] fs/dax: Ensure all pages are idle prior to filesystem unmount

2025-01-12 Thread Alistair Popple
On Sun, Jan 12, 2025 at 06:49:40PM -0800, Darrick J. Wong wrote: > On Mon, Jan 13, 2025 at 11:57:18AM +1100, Alistair Popple wrote: > > On Fri, Jan 10, 2025 at 08:50:19AM -0800, Darrick J. Wong wrote: > > > On Fri, Jan 10, 2025 at 05:00:35PM +1100, Alistair Popple wrote: > > > > File systems call d

[PATCH] powerpc/pseries/iommu: Don't unset window if it was never set

2025-01-12 Thread Shivaprasad G Bhat
On pSeries, when user attempts to use the same vfio container used by different iommu group, the spapr_tce_set_window() returns -EPERM and the subsequent cleanup leads to the below crash. Kernel attempted to read user page (308) - exploit attempt? BUG: Kernel NULL pointer dereference on read

Re: [PATCH] fs: introduce getfsxattrat and setfsxattrat syscalls

2025-01-12 Thread kernel test robot
Hi Andrey, kernel test robot noticed the following build warnings: [auto build test WARNING on brauner-vfs/vfs.all] [also build test WARNING on geert-m68k/for-next powerpc/next powerpc/fixes s390/features linus/master v6.13-rc6 next-20250110] [cannot apply to geert-m68k/for-linus deller-parisc/f

Re: [PATCH v6 21/26] fs/dax: Properly refcount fs dax pages

2025-01-12 Thread Alistair Popple
On Fri, Jan 10, 2025 at 08:54:55AM -0800, Darrick J. Wong wrote: > On Fri, Jan 10, 2025 at 05:00:49PM +1100, Alistair Popple wrote: > > Currently fs dax pages are considered free when the refcount drops to > > one and their refcounts are not increased when mapped via PTEs or > > decreased when unma

Re: [PATCH v6 07/26] fs/dax: Ensure all pages are idle prior to filesystem unmount

2025-01-12 Thread Darrick J. Wong
On Mon, Jan 13, 2025 at 11:57:18AM +1100, Alistair Popple wrote: > On Fri, Jan 10, 2025 at 08:50:19AM -0800, Darrick J. Wong wrote: > > On Fri, Jan 10, 2025 at 05:00:35PM +1100, Alistair Popple wrote: > > > File systems call dax_break_mapping() prior to reallocating file > > > system blocks to ensu

Re: [PATCH v6 05/26] fs/dax: Create a common implementation to break DAX layouts

2025-01-12 Thread Darrick J. Wong
On Mon, Jan 13, 2025 at 11:47:41AM +1100, Alistair Popple wrote: > On Fri, Jan 10, 2025 at 08:44:38AM -0800, Darrick J. Wong wrote: > > On Fri, Jan 10, 2025 at 05:00:33PM +1100, Alistair Popple wrote: > > > Prior to freeing a block file systems supporting FS DAX must check > > > that the associated

Re: [PATCH 3/5] KVM: Add a common kvm_run flag to communicate an exit needs completion

2025-01-12 Thread Chao Gao
On Fri, Jan 10, 2025 at 05:24:48PM -0800, Sean Christopherson wrote: >Add a kvm_run flag, KVM_RUN_NEEDS_COMPLETION, to communicate to userspace >that KVM_RUN needs to be re-executed prior to save/restore in order to >complete the instruction/operation that triggered the userspace exit. > >KVM's cur

Re: [PATCH v6 00/26] fs/dax: Fix ZONE_DEVICE page reference counts

2025-01-12 Thread Alistair Popple
On Fri, Jan 10, 2025 at 07:35:57PM -0800, Dan Williams wrote: > Andrew Morton wrote: > > On Thu, 9 Jan 2025 23:05:56 -0800 Dan Williams > > wrote: > > > > > > - Remove PTE_DEVMAP definitions from Loongarch which were added since > > > >this series was initially written. > > > [..] > > > >

Re: [PATCH v6 07/26] fs/dax: Ensure all pages are idle prior to filesystem unmount

2025-01-12 Thread Alistair Popple
On Fri, Jan 10, 2025 at 08:50:19AM -0800, Darrick J. Wong wrote: > On Fri, Jan 10, 2025 at 05:00:35PM +1100, Alistair Popple wrote: > > File systems call dax_break_mapping() prior to reallocating file > > system blocks to ensure the page is not undergoing any DMA or other > > accesses. Generally th

Re: [PATCH v6 05/26] fs/dax: Create a common implementation to break DAX layouts

2025-01-12 Thread Alistair Popple
On Fri, Jan 10, 2025 at 08:44:38AM -0800, Darrick J. Wong wrote: > On Fri, Jan 10, 2025 at 05:00:33PM +1100, Alistair Popple wrote: > > Prior to freeing a block file systems supporting FS DAX must check > > that the associated pages are both unmapped from user-space and not > > undergoing DMA or ot

Re: [PATCH] MAINTAINERS: powerpc: Update my status

2025-01-12 Thread Stephen Rothwell
Hi Michael, On Sat, 11 Jan 2025 10:57:38 +1100 Michael Ellerman wrote: > > Maddy is taking over the day-to-day maintenance of powerpc. I will still > be around to help, and as a backup. > > Re-order the main POWERPC list to put Maddy first to reflect that. > > KVM/powerpc patches will be handle

Re: [PATCH v2] powerpc/64s: Rewrite __real_pte() and __rpte_to_hidx() as static inline

2025-01-12 Thread IBM
Christophe Leroy writes: > Rewrite __real_pte() and __rpte_to_hidx() as static inline in order to > avoid following warnings/errors when building with 4k page size: > > CC arch/powerpc/mm/book3s64/hash_tlb.o > arch/powerpc/mm/book3s64/hash_tlb.c: In function 'hpte_need_flush':

[PATCH v2] powerpc/64s: Rewrite __real_pte() and __rpte_to_hidx() as static inline

2025-01-12 Thread Christophe Leroy
Rewrite __real_pte() and __rpte_to_hidx() as static inline in order to avoid following warnings/errors when building with 4k page size: CC arch/powerpc/mm/book3s64/hash_tlb.o arch/powerpc/mm/book3s64/hash_tlb.c: In function 'hpte_need_flush': arch/powerpc/mm/book3s64

Re: [PATCH] powerpc/64s: Rewrite __real_pte() as a static inline

2025-01-12 Thread Christophe Leroy
Le 11/01/2025 à 18:03, Ritesh Harjani a écrit : Christophe Leroy writes: Rewrite __real_pte() as a static inline in order to avoid following warning/error when building with 4k page size: CC arch/powerpc/mm/book3s64/hash_tlb.o arch/powerpc/mm/book3s64/hash_tlb.c: In

[PATCH 2/2] PCI: dwc: layerscape: Use syscon_regmap_lookup_by_phandle_args

2025-01-12 Thread Krzysztof Kozlowski
Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over syscon_regmap_lookup_by_phandle() combined with getting the syscon argument. Except simpler code this annotates within one line that given phandle has arguments, so grepping for code would be easier. Signed-off-by: Krzysztof Kozlo

[PATCH 1/2] PCI: dwc: dra7xx: Use syscon_regmap_lookup_by_phandle_args

2025-01-12 Thread Krzysztof Kozlowski
Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over syscon_regmap_lookup_by_phandle() combined with getting the syscon argument. Except simpler code this annotates within one line that given phandle has arguments, so grepping for code would be easier. There is also no real benefit

[PATCH 0/2] PCI: Simplify few things

2025-01-12 Thread Krzysztof Kozlowski
-dra7xx.c | 27 ++- drivers/pci/controller/dwc/pci-layerscape.c | 10 -- 2 files changed, 10 insertions(+), 27 deletions(-) --- base-commit: 2ddfbff29a2d45551e8c3e4f0c6b7c4618de24b7 change-id: 20250112-syscon-phandle-args-pci-d97537922ddd Best regards

Re: [PATCH v2] treewide: const qualify ctl_tables where applicable

2025-01-12 Thread Baoquan He
On 01/10/25 at 03:16pm, Joel Granados wrote: ...snip... > diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c > index c0caa14880c3..71b0809e06d6 100644 > --- a/kernel/kexec_core.c > +++ b/kernel/kexec_core.c > @@ -925,7 +925,7 @@ static int kexec_limit_handler(const struct ctl_table > *table, i

[PATCH 4/5] KVM: e500: map readonly host pages for read

2025-01-12 Thread Paolo Bonzini
The new __kvm_faultin_pfn() function is upset by the fact that e500 KVM ignores host page permissions - __kvm_faultin requires a "writable" outgoing argument, but e500 KVM is nonchalantly passing NULL. If the host page permissions do not include writability, the shadow TLB entry is forcibly mapped

[PATCH 5/5] KVM: e500: perform hugepage check after looking up the PFN

2025-01-12 Thread Paolo Bonzini
e500 KVM tries to bypass __kvm_faultin_pfn() in order to map VM_PFNMAP VMAs as huge pages. This is a Bad Idea because VM_PFNMAP VMAs could become noncontiguous as a result of callsto remap_pfn_range(). Instead, use the already existing host PTE lookup to retrieve a valid host-side mapping level a

[PATCH 3/5] KVM: e500: track host-writability of pages

2025-01-12 Thread Paolo Bonzini
Add the possibility of marking a page so that the UW and SW bits are force-cleared. This is stored in the private info so that it persists across multiple calls to kvmppc_e500_setup_stlbe. Signed-off-by: Paolo Bonzini --- arch/powerpc/kvm/e500.h | 2 ++ arch/powerpc/kvm/e500_mmu_host.

[PATCH 2/5] KVM: e500: use shadow TLB entry as witness for writability

2025-01-12 Thread Paolo Bonzini
kvmppc_e500_ref_setup is returning whether the guest TLB entry is writable, which is than passed to kvm_release_faultin_page. This makes little sense for two reasons: first, because the function sets up the private data for the page and the return value feels like it has been bolted on the side; s

[PATCH v2 0/5] KVM: e500: map readonly host pages for read, and cleanup

2025-01-12 Thread Paolo Bonzini
The new __kvm_faultin_pfn() function is upset by the fact that e500 KVM ignores host page permissions - __kvm_faultin requires a "writable" outgoing argument, but e500 KVM is passing NULL. While a simple fix would be possible that simply allows writable to be NULL, it is quite ugly to have e500 KV

[PATCH 1/5] KVM: e500: always restore irqs

2025-01-12 Thread Paolo Bonzini
If find_linux_pte fails, IRQs will not be restored. This is unlikely to happen in practice since it would have been reported as hanging hosts, but it should of course be fixed anyway. Cc: sta...@vger.kernel.org Reported-by: Sean Christopherson Signed-off-by: Paolo Bonzini --- arch/powerpc/kvm/

[PATCH] powerpc: Fix warning with '__powerpc64__'

2025-01-12 Thread Yu-Chun Lin
As reported by the kernel test robot, the following error occurs: arch/powerpc/lib/sstep.c: In function 'analyse_instr': >> arch/powerpc/lib/sstep.c:1172:28: warning: variable 'suffix' set but not >> used [-Wunused-but-set-variable] 1172 | unsigned int word, suffix; |