Re: [PATCH v9 4/7] powerpc: mm: Default p{m,u}d_pte implementations

2023-11-29 Thread Christophe Leroy
Le 30/11/2023 à 03:53, Rohan McLure a écrit : > For 32-bit systems which have no usecases for p{m,u}d_pte() prior to > page table checking, implement default stubs. Is that the best solution ? If I understand correctly, it is only needed for pmd_user_accessible_page(). Why not provide a stub

Re: [PATCH v9 7/7] powerpc: mm: Support page table check

2023-11-29 Thread Christophe Leroy
Le 30/11/2023 à 03:54, Rohan McLure a écrit : > On creation and clearing of a page table mapping, instrument such calls > by invoking page_table_check_pte_set and page_table_check_pte_clear > respectively. These calls serve as a sanity check against illegal > mappings. > > Enable

Re: [PATCH v9 6/7] powerpc: mm: Use __set_pte_at() for early-boot / internal usages

2023-11-29 Thread Christophe Leroy
Le 30/11/2023 à 03:53, Rohan McLure a écrit : > In the new set_ptes() API, set_pte_at() (a special case of set_ptes()) > is intended to be instrumented by the page table check facility. There > are however several other routines that constitute the API for setting > page table entries, including

[PATCH] powerpc/ftrace: Fix stack teardown in ftrace_no_trace

2023-11-29 Thread Naveen N Rao
Commit 41a506ef71eb ("powerpc/ftrace: Create a dummy stackframe to fix stack unwind") added use of a new stack frame on ftrace entry to fix stack unwind. However, the commit missed updating the offset used while tearing down the ftrace stack when ftrace is disabled. Fix the same. In addition, the

Re: [PATCH v9 5/7] poweprc: mm: Implement *_user_accessible_page() for ptes

2023-11-29 Thread Christophe Leroy
Le 30/11/2023 à 03:53, Rohan McLure a écrit : > Page table checking depends on architectures providing an > implementation of p{te,md,ud}_user_accessible_page. With > refactorisations made on powerpc/mm, the pte_access_permitted() and > similar methods verify whether a userland page is

Re: [PATCH v9 3/7] powerpc: mm: Add common pud_pfn stub for all platforms

2023-11-29 Thread Christophe Leroy
Le 30/11/2023 à 03:53, Rohan McLure a écrit : > Prior to this commit, pud_pfn was implemented with BUILD_BUG as the inline > function for 64-bit Book3S systems but is never included, as its > invocations in generic code are guarded by calls to pud_devmap which return > zero on such systems. A

Re: [PATCH 5/5] powerpc/64s: Fix CONFIG_NUMA=n build

2023-11-29 Thread Michael Ellerman
"Arnd Bergmann" writes: > On Wed, Nov 29, 2023, at 14:19, Michael Ellerman wrote: >> diff --git a/arch/powerpc/mm/mmu_decl.h b/arch/powerpc/mm/mmu_decl.h >> index 7f9ff0640124..72341b9fb552 100644 >> --- a/arch/powerpc/mm/mmu_decl.h >> +++ b/arch/powerpc/mm/mmu_decl.h >> + >> +#ifdef

Re: Ping? Re: [PATCH rc] kvm: Prevent compiling virt/kvm/vfio.c unless VFIO is selected

2023-11-29 Thread Michael Ellerman
Sean Christopherson writes: > On Wed, Nov 29, 2023, Jason Gunthorpe wrote: >> On Wed, Nov 29, 2023 at 05:07:45PM -0800, Sean Christopherson wrote: >> > On Wed, Nov 29, 2023, Michael Ellerman wrote: >> > > Sean Christopherson writes: >> > > > On Fri, Nov 10, 2023, Michael Ellerman wrote: >> > >

Re: [PATCH v9 2/7] powerpc: mm: Implement p{m,u,4}d_leaf on all platforms

2023-11-29 Thread Christophe Leroy
Le 30/11/2023 à 03:53, Rohan McLure a écrit : > The check that a higher-level entry in multi-level pages contains a page > translation entry (pte) is performed by p{m,u,4}d_leaf stubs, which may > be specialised for each choice of mmu. In a prior commit, we replace > uses to the catch-all stubs,

[PATCH v9 6/7] powerpc: mm: Use __set_pte_at() for early-boot / internal usages

2023-11-29 Thread Rohan McLure
In the new set_ptes() API, set_pte_at() (a special case of set_ptes()) is intended to be instrumented by the page table check facility. There are however several other routines that constitute the API for setting page table entries, including set_pmd_at() among others. Such routines are themselves

[PATCH v9 2/7] powerpc: mm: Implement p{m,u,4}d_leaf on all platforms

2023-11-29 Thread Rohan McLure
The check that a higher-level entry in multi-level pages contains a page translation entry (pte) is performed by p{m,u,4}d_leaf stubs, which may be specialised for each choice of mmu. In a prior commit, we replace uses to the catch-all stubs, p{m,u,4}d_is_leaf with p{m,u,4}d_leaf. Replace the

[PATCH v9 3/7] powerpc: mm: Add common pud_pfn stub for all platforms

2023-11-29 Thread Rohan McLure
Prior to this commit, pud_pfn was implemented with BUILD_BUG as the inline function for 64-bit Book3S systems but is never included, as its invocations in generic code are guarded by calls to pud_devmap which return zero on such systems. A future patch will provide support for page table checks,

[PATCH v9 1/7] powerpc: mm: Replace p{u,m,4}d_is_leaf with p{u,m,4}_leaf

2023-11-29 Thread Rohan McLure
Replace occurrences of p{u,m,4}d_is_leaf with p{u,m,4}_leaf, as the latter is the name given to checking that a higher-level entry in multi-level paging contains a page translation entry (pte) throughout all other archs. A future patch will implement p{u,m,4}_leaf stubs on all platforms so that

[PATCH v9 7/7] powerpc: mm: Support page table check

2023-11-29 Thread Rohan McLure
On creation and clearing of a page table mapping, instrument such calls by invoking page_table_check_pte_set and page_table_check_pte_clear respectively. These calls serve as a sanity check against illegal mappings. Enable ARCH_SUPPORTS_PAGE_TABLE_CHECK for all platforms. See also: riscv

[PATCH v9 5/7] poweprc: mm: Implement *_user_accessible_page() for ptes

2023-11-29 Thread Rohan McLure
Page table checking depends on architectures providing an implementation of p{te,md,ud}_user_accessible_page. With refactorisations made on powerpc/mm, the pte_access_permitted() and similar methods verify whether a userland page is accessible with the required permissions. Since page table

[PATCH v9 4/7] powerpc: mm: Default p{m,u}d_pte implementations

2023-11-29 Thread Rohan McLure
For 32-bit systems which have no usecases for p{m,u}d_pte() prior to page table checking, implement default stubs. Signed-off-by: Rohan McLure --- v9: New patch --- arch/powerpc/include/asm/book3s/64/pgtable.h | 3 +++ arch/powerpc/include/asm/nohash/64/pgtable.h | 2 ++

[PATCH v9 0/7] Support page table check

2023-11-29 Thread Rohan McLure
Support the page table check sanitiser on all PowerPC platforms. This sanitiser works by serialising assignments, reassignments and clears of page table entries at each level in order to ensure that anonymous mappings have at most one writable consumer, and likewise that file-backed mappings are

Re: [PATCH v3 2/7] kexec_file: print out debugging message if required

2023-11-29 Thread Joe Perches
On Thu, 2023-11-30 at 10:39 +0800, Baoquan He wrote: > Replace pr_debug() with the newly added kexec_dprintk() in kexec_file > loading related codes. trivia: > diff --git a/kernel/crash_core.c b/kernel/crash_core.c [] > @@ -551,9 +551,12 @@ int crash_prepare_elf64_headers(struct crash_mem *mem,

[PATCH v3 7/7] kexec_file, parisc: print out debugging message if required

2023-11-29 Thread Baoquan He
Replace pr_debug() with the newly added kexec_dprintk() in kexec_file loading related codes. Signed-off-by: Baoquan He --- arch/parisc/kernel/kexec_file.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/parisc/kernel/kexec_file.c

[PATCH v3 6/7] kexec_file, power: print out debugging message if required

2023-11-29 Thread Baoquan He
Replace pr_debug() with the newly added kexec_dprintk() in kexec_file loading related codes. Signed-off-by: Baoquan He --- arch/powerpc/kexec/elf_64.c | 8 arch/powerpc/kexec/file_load_64.c | 18 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git

[PATCH v3 5/7] kexec_file, ricv: print out debugging message if required

2023-11-29 Thread Baoquan He
Replace pr_debug() with the newly added kexec_dprintk() in kexec_file loading related codes. And also remove kexec_image_info() because the content has been printed out in generic code. Signed-off-by: Baoquan He --- arch/riscv/kernel/elf_kexec.c | 11 ++-

[PATCH v3 4/7] kexec_file, arm64: print out debugging message if required

2023-11-29 Thread Baoquan He
Replace pr_debug() with the newly added kexec_dprintk() in kexec_file loading related codes. And also remove the kimage->segment[] printing because the generic code has done the printing. Signed-off-by: Baoquan He --- arch/arm64/kernel/kexec_image.c| 6 +++---

[PATCH v3 3/7] kexec_file, x86: print out debugging message if required

2023-11-29 Thread Baoquan He
Replace pr_debug() with the newly added kexec_dprintk() in kexec_file loading related codes. And also print out e820 memmap passed to 2nd kernel just as kexec_load interface has been doing. Signed-off-by: Baoquan He --- arch/x86/kernel/crash.c | 4 ++--

[PATCH v3 1/7] kexec_file: add kexec_file flag to control debug printing

2023-11-29 Thread Baoquan He
When specifying 'kexec -c -d', kexec_load interface will print loading information, e.g the regions where kernel/initrd/purgatory/cmdline are put, the memmap passed to 2nd kernel taken as system RAM ranges, and printing all contents of struct kexec_segment, etc. These are very helpful for

[PATCH v3 2/7] kexec_file: print out debugging message if required

2023-11-29 Thread Baoquan He
Replace pr_debug() with the newly added kexec_dprintk() in kexec_file loading related codes. And also print out type/start/head of kimage and flags to help debug. Signed-off-by: Baoquan He --- kernel/crash_core.c| 9 ++--- kernel/kexec_file.c| 11

[PATCH v3 0/7] kexec_file: print out debugging message if required

2023-11-29 Thread Baoquan He
Currently, specifying '-d' on kexec command will print a lot of debugging informationabout kexec/kdump loading with kexec_load interface. However, kexec_file_load prints nothing even though '-d' is specified. It's very inconvenient to debug or analyze the kexec/kdump loading when something wrong

Re: [PATCH v2] powerpc/pseries/vas: Use usleep_range() to support HCALL delay

2023-11-29 Thread Michael Ellerman
Haren Myneni writes: > VAS allocate, modify and deallocate HCALLs returns > H_LONG_BUSY_ORDER_1_MSEC or H_LONG_BUSY_ORDER_10_MSEC for busy > delay and expects OS to reissue HCALL after that delay. But using > msleep() will often sleep at least 20 msecs even though the > hypervisor expects to

Re: Ping? Re: [PATCH rc] kvm: Prevent compiling virt/kvm/vfio.c unless VFIO is selected

2023-11-29 Thread Sean Christopherson
On Wed, Nov 29, 2023, Jason Gunthorpe wrote: > On Wed, Nov 29, 2023 at 05:07:45PM -0800, Sean Christopherson wrote: > > On Wed, Nov 29, 2023, Michael Ellerman wrote: > > > Sean Christopherson writes: > > > > On Fri, Nov 10, 2023, Michael Ellerman wrote: > > > >> Jason Gunthorpe writes: > > > >>

Re: [PATCH v2] powerpc/pseries/vas: Use usleep_range() to support HCALL delay

2023-11-29 Thread Nathan Lynch
Haren Myneni writes: > VAS allocate, modify and deallocate HCALLs returns > H_LONG_BUSY_ORDER_1_MSEC or H_LONG_BUSY_ORDER_10_MSEC for busy > delay and expects OS to reissue HCALL after that delay. But using > msleep() will often sleep at least 20 msecs even though the > hypervisor expects to

Re: Ping? Re: [PATCH rc] kvm: Prevent compiling virt/kvm/vfio.c unless VFIO is selected

2023-11-29 Thread Jason Gunthorpe
On Wed, Nov 29, 2023 at 05:07:45PM -0800, Sean Christopherson wrote: > On Wed, Nov 29, 2023, Michael Ellerman wrote: > > Sean Christopherson writes: > > > On Fri, Nov 10, 2023, Michael Ellerman wrote: > > >> Jason Gunthorpe writes: > > >> > There are a bunch of reported randconfig failures now

Re: Ping? Re: [PATCH rc] kvm: Prevent compiling virt/kvm/vfio.c unless VFIO is selected

2023-11-29 Thread Sean Christopherson
On Wed, Nov 29, 2023, Michael Ellerman wrote: > Sean Christopherson writes: > > On Fri, Nov 10, 2023, Michael Ellerman wrote: > >> Jason Gunthorpe writes: > >> > There are a bunch of reported randconfig failures now because of this, > >> > something like: > >> > > >> >>>

Re: [PATCH v13 17/35] KVM: Add transparent hugepage support for dedicated guest memory

2023-11-29 Thread Sean Christopherson
On Mon, Nov 27, 2023, Vlastimil Babka wrote: > On 11/2/23 16:46, Paolo Bonzini wrote: > > On Thu, Nov 2, 2023 at 4:38 PM Sean Christopherson > > wrote: > >> Actually, looking that this again, there's not actually a hard dependency > >> on THP. > >> A THP-enabled kernel _probably_ gives a

Re: Ping? Re: [PATCH rc] kvm: Prevent compiling virt/kvm/vfio.c unless VFIO is selected

2023-11-29 Thread Alex Williamson
On Wed, 29 Nov 2023 10:31:03 -0800 Sean Christopherson wrote: > On Wed, Nov 29, 2023, Jason Gunthorpe wrote: > > On Tue, Nov 28, 2023 at 06:21:42PM -0800, Sean Christopherson wrote: > > > diff --git a/include/linux/vfio.h b/include/linux/vfio.h > > > index 454e9295970c..a65b2513f8cd 100644 > >

[PATCH v4 4/4] PCI: layerscape: Add suspend/resume for ls1043a

2023-11-29 Thread Frank Li
In the suspend path, PME_Turn_Off message is sent to the endpoint to transition the link to L2/L3_Ready state. In this SoC, there is no way to check if the controller has received the PME_To_Ack from the endpoint or not. So to be on the safer side, the driver just waits for

[PATCH v4 3/4] PCI: layerscape: Rename pf_* as pf_lut_*

2023-11-29 Thread Frank Li
'pf' and 'lut' is just difference name in difference chips, but basic it is a MMIO base address plus an offset. Rename it to avoid duplicate pf_* and lut_* in driver. Signed-off-by: Frank Li --- Notes: pf_lut is better than pf_* or lut* because some chip use 'pf', some chip use 'lut'.

[PATCH v4 2/4] PCI: layerscape: Add suspend/resume for ls1021a

2023-11-29 Thread Frank Li
ls1021a add suspend/resume support. In the suspend path, PME_Turn_Off message is sent to the endpoint to transition the link to L2/L3_Ready state. In this SoC, there is no way to check if the controller has received the PME_To_Ack from the endpoint or not. So to be on the safer side, the driver

[PATCH v4 1/4] PCI: layerscape: Add function pointer for exit_from_l2()

2023-11-29 Thread Frank Li
Since difference SoCs require different sequence for exiting L2, let's add a separate "exit_from_l2()" callback. This callback can be used to execute SoC specific sequence. Change ls_pcie_exit_from_l2() return value from void to int. Return error if exit_from_l2() failure at exit resume flow.

[PATCH v4 0/4] dwc general suspend/resume functionality

2023-11-29 Thread Frank Li
Add a API for dwc suspend/resume. In layerscape platform call this api. Frank Li (4): PCI: layerscape: Add function pointer for exit_from_l2() PCI: layerscape: Add suspend/resume for ls1021a PCI: layerscape: Rename pf_* as pf_lut_* PCI: layerscape: Add suspend/resume for ls1043a

Re: [PATCH] perf test record+probe_libc_inet_pton: Fix call chain match on powerpc

2023-11-29 Thread Arnaldo Carvalho de Melo
Em Sun, Nov 26, 2023 at 02:09:14AM -0500, Likhitha Korrapati escreveu: > The perf test "probe libc's inet_pton & backtrace it with ping" fails on > powerpc as below: > > root@xxx perf]# perf test -v "probe libc's inet_pton & backtrace it with > ping" > 85: probe libc's inet_pton & backtrace it

Re: Ping? Re: [PATCH rc] kvm: Prevent compiling virt/kvm/vfio.c unless VFIO is selected

2023-11-29 Thread Sean Christopherson
On Wed, Nov 29, 2023, Jason Gunthorpe wrote: > On Tue, Nov 28, 2023 at 06:21:42PM -0800, Sean Christopherson wrote: > > diff --git a/include/linux/vfio.h b/include/linux/vfio.h > > index 454e9295970c..a65b2513f8cd 100644 > > --- a/include/linux/vfio.h > > +++ b/include/linux/vfio.h > > @@ -289,16

Re: [PATCH 00/17] Prepare the PowerQUICC QMC and TSA for the HDLC QMC driver

2023-11-29 Thread Arnd Bergmann
On Tue, Nov 28, 2023, at 15:07, Herve Codina wrote: > Hi, > > This series updates PowerQUICC QMC and TSA drivers to prepare the > support for the QMC HDLC driver. > > Patches were previously sent as part of a full feature series: > "Add support for QMC HDLC, framer infrastructure and PEF2256

Re: [PATCH 15/17] soc: fsl: cpm1: qmc: Handle timeslot entries at channel start() and stop()

2023-11-29 Thread Arnd Bergmann
On Tue, Nov 28, 2023, at 15:08, Herve Codina wrote: > @@ -272,6 +274,8 @@ int qmc_chan_get_info(struct qmc_chan *chan, struct > qmc_chan_info *info) > if (ret) > return ret; > > + spin_lock_irqsave(>ts_lock, flags); > + > info->mode = chan->mode; >

Re: [PATCH 1/5] powerpc/suspend: Add prototype for do_after_copyback()

2023-11-29 Thread Arnd Bergmann
On Wed, Nov 29, 2023, at 14:19, Michael Ellerman wrote: > With HIBERNATION=y the build breaks with: > > arch/powerpc/kernel/swsusp_64.c:14:6: error: no previous prototype > for ‘do_after_copyback’ [-Werror=missing-prototypes] > 14 | void do_after_copyback(void) > | ^

Re: [PATCH 5/5] powerpc/64s: Fix CONFIG_NUMA=n build

2023-11-29 Thread Arnd Bergmann
On Wed, Nov 29, 2023, at 14:19, Michael Ellerman wrote: > diff --git a/arch/powerpc/mm/mmu_decl.h b/arch/powerpc/mm/mmu_decl.h > index 7f9ff0640124..72341b9fb552 100644 > --- a/arch/powerpc/mm/mmu_decl.h > +++ b/arch/powerpc/mm/mmu_decl.h > + > +#ifdef CONFIG_MEMORY_HOTPLUG > +int

Re: [PATCH v4 05/13] powerpc/rtas: Facilitate high-level call sequences

2023-11-29 Thread Michael Ellerman
Nathan Lynch writes: > Michael Ellerman writes: > >> Nathan Lynch via B4 Relay >> writes: >>> From: Nathan Lynch >>> >>> On RTAS platforms there is a general restriction that the OS must not >>> enter RTAS on more than one CPU at a time. This low-level >>> serialization requirement is

[PATCH 3/5] powerpc/512x: Fix missing prototype warnings

2023-11-29 Thread Michael Ellerman
The mpc512x_defconfig build fails with: arch/powerpc/platforms/512x/mpc5121_ads_cpld.c:142:1: error: no previous prototype for ‘mpc5121_ads_cpld_map’ [-Werror=missing-prototypes] 142 | mpc5121_ads_cpld_map(void) | ^~~~

[PATCH 5/5] powerpc/64s: Fix CONFIG_NUMA=n build

2023-11-29 Thread Michael Ellerman
With CONFIG_NUMA=n the build fails with: arch/powerpc/mm/book3s64/pgtable.c:275:15: error: no previous prototype for ‘create_section_mapping’ [-Werror=missing-prototypes] 275 | int __meminit create_section_mapping(unsigned long start, unsigned long end, |

[PATCH 4/5] powerpc/44x: Make ppc44x_idle_init() static

2023-11-29 Thread Michael Ellerman
The 44x/fsp2_defconfig build fails with: arch/powerpc/platforms/44x/idle.c:30:12: error: no previous prototype for ‘ppc44x_idle_init’ [-Werror=missing-prototypes] 30 | int __init ppc44x_idle_init(void) |^~~~ Fix it by making ppc44x_idle_init() static.

[PATCH 2/5] powerpc/512x: Make pdm360ng_init() static

2023-11-29 Thread Michael Ellerman
The mpc512x_defconfig config fails with: arch/powerpc/platforms/512x/pdm360ng.c:104:13: error: no previous prototype for ‘pdm360ng_init’ [-Werror=missing-prototypes] 104 | void __init pdm360ng_init(void) | ^ Fix it by making pdm360ng_init() static.

[PATCH 1/5] powerpc/suspend: Add prototype for do_after_copyback()

2023-11-29 Thread Michael Ellerman
With HIBERNATION=y the build breaks with: arch/powerpc/kernel/swsusp_64.c:14:6: error: no previous prototype for ‘do_after_copyback’ [-Werror=missing-prototypes] 14 | void do_after_copyback(void) | ^ do_after_copyback() is only called from asm, so there is no

Re: Ping? Re: [PATCH rc] kvm: Prevent compiling virt/kvm/vfio.c unless VFIO is selected

2023-11-29 Thread Jason Gunthorpe
On Tue, Nov 28, 2023 at 06:21:42PM -0800, Sean Christopherson wrote: > diff --git a/include/linux/vfio.h b/include/linux/vfio.h > index 454e9295970c..a65b2513f8cd 100644 > --- a/include/linux/vfio.h > +++ b/include/linux/vfio.h > @@ -289,16 +289,12 @@ void vfio_combine_iova_ranges(struct

Re: [PATCH] powerpc: Don't clobber fr0/vs0 during fp|altivec register save

2023-11-29 Thread Christophe Leroy
Le 29/11/2023 à 11:30, Salvatore Bonaccorso a écrit : > Hi, > > On Sun, Nov 19, 2023 at 06:14:50AM -0700, Jens Axboe wrote: >> On 11/18/23 4:45 PM, Timothy Pearson wrote: >>> During floating point and vector save to thread data fr0/vs0 are clobbered >>> by the FPSCR/VSCR store routine. This

Re: [PATCH] powerpc: Don't clobber fr0/vs0 during fp|altivec register save

2023-11-29 Thread Salvatore Bonaccorso
Hi, On Sun, Nov 19, 2023 at 06:14:50AM -0700, Jens Axboe wrote: > On 11/18/23 4:45 PM, Timothy Pearson wrote: > > During floating point and vector save to thread data fr0/vs0 are clobbered > > by the FPSCR/VSCR store routine. This leads to userspace register > > corruption > > and application

Re: Ping? Re: [PATCH rc] kvm: Prevent compiling virt/kvm/vfio.c unless VFIO is selected

2023-11-29 Thread Michael Ellerman
Sean Christopherson writes: > On Fri, Nov 10, 2023, Michael Ellerman wrote: >> Jason Gunthorpe writes: >> > There are a bunch of reported randconfig failures now because of this, >> > something like: >> > >> >>> arch/powerpc/kvm/../../../virt/kvm/vfio.c:89:7: warning: attribute >> >>>

Re: linux-next: duplicate patches in the char-misc tree

2023-11-29 Thread Greg KH
On Wed, Nov 29, 2023 at 12:24:05PM +1100, Stephen Rothwell wrote: > Hi all, > > The following commits are also in the powerpc tree as different commits > (but the same patches): > > bc1183a63057 ("misc: ocxl: main: Remove unnecessary ‘0’ values from rc") > 29eb0dc7bd1e ("misc: ocxl: link:

[PATCH v2] powerpc: Add PVN support for HeXin C2000 processor

2023-11-29 Thread Zhao Ke
HeXin Tech Co. has applied for a new PVN from the OpenPower Community for its new processor C2000. The OpenPower has assigned a new PVN and this newly assigned PVN is 0x0066, add pvr register related support for this PVN. Signed-off-by: Zhao Ke Link: