Re: [PATCH 05/26] vfio: KVM: Pass get/put helpers from KVM to VFIO, don't do circular lookup

2023-12-01 Thread Sean Christopherson
On Mon, Sep 18, 2023, Jason Gunthorpe wrote: > On Mon, Sep 18, 2023 at 08:49:57AM -0700, Sean Christopherson wrote: > > On Mon, Sep 18, 2023, Jason Gunthorpe wrote: > > > On Fri, Sep 15, 2023 at 05:30:57PM -0700, Sean Christopherson wrote: > > > > Explicitly pass KVM's get/put helpers to VFIO when

Re: [PATCH 1/6] x86: Use PCI_HEADER_TYPE_* instead of literals

2023-12-01 Thread Bjorn Helgaas
[+cc scsi, powerpc folks] On Fri, Dec 01, 2023 at 02:44:47PM -0600, Bjorn Helgaas wrote: > On Fri, Nov 24, 2023 at 11:09:13AM +0200, Ilpo Järvinen wrote: > > Replace 0x7f and 0x80 literals with PCI_HEADER_TYPE_* defines. > > > > Signed-off-by: Ilpo Järvinen > > Applied entire series on the PCI

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

2023-12-01 Thread Roy Zang
> From: Frank Li > Subject: [PATCH v5 4/4] PCI: layerscape: Add suspend/resume for ls1043a > > Add suspend/resume support for Layerscape LS1043a. > > 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

RE: [PATCH v5 3/4] PCI: layerscape(ep): Rename pf_* as pf_lut_*

2023-12-01 Thread Roy Zang
> From: Frank Li > Subject: [PATCH v5 3/4] PCI: layerscape(ep): Rename pf_* as pf_lut_* > > '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

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

2023-12-01 Thread Roy Zang
> From: Frank Li > Subject: [PATCH v5 2/4] PCI: layerscape: Add suspend/resume for ls1021a > > Add suspend/resume support for Layerscape LS1021a. > > 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

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

2023-12-01 Thread Roy Zang
> From: Frank Li > Subject: [PATCH v5 1/4] PCI: layerscape: Add function pointer for > exit_from_l2() > > 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

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

2023-12-01 Thread Frank Li
Add suspend/resume support for Layerscape LS1043a. 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

[PATCH v5 3/4] PCI: layerscape(ep): Rename pf_* as pf_lut_*

2023-12-01 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 v5 2/4] PCI: layerscape: Add suspend/resume for ls1021a

2023-12-01 Thread Frank Li
Add suspend/resume support for Layerscape LS1021a. 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

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

2023-12-01 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 v5 0/4] PCI: layerscape: Add suspend/resume support for ls1043 and ls1021

2023-12-01 Thread Frank Li
Add suspend/resume support for ls1043 and ls1021. Change log see each patch Frank Li (4): PCI: layerscape: Add function pointer for exit_from_l2() PCI: layerscape: Add suspend/resume for ls1021a PCI: layerscape(ep): Rename pf_* as pf_lut_* PCI: layerscape: Add suspend/resume for ls1043a

[PATCH 11/12] KVM: PPC: Reduce reliance on analyse_instr() in mmio emulation

2023-12-01 Thread Vaibhav Jain
From: Jordan Niethe Commit 709236039964 ("KVM: PPC: Reimplement non-SIMD LOAD/STORE instruction mmio emulation with analyse_instr() input") and commit 2b33cb585f94 ("KVM: PPC: Reimplement LOAD_FP/STORE_FP instruction mmio emulation with analyse_instr() input") made kvmppc_emulate_loadstore() use

[PATCH 09/12] KVM: PPC: Book3S HV nestedv2: Do not call H_COPY_TOFROM_GUEST

2023-12-01 Thread Vaibhav Jain
From: Jordan Niethe H_COPY_TOFROM_GUEST is part of the nestedv1 API and so should not be called by a nestedv2 host. Do not attempt to call it. Signed-off-by: Jordan Niethe --- arch/powerpc/kvm/book3s_64_mmu_radix.c | 3 +++ 1 file changed, 3 insertions(+) diff --git

[PATCH 12/12] KVM: PPC: Book3S HV nestedv2: Do not cancel pending decrementer exception

2023-12-01 Thread Vaibhav Jain
From: Jordan Niethe In the nestedv2 case, if there is a pending decrementer exception, the L1 must get the L2's timebase from the L0 to see if the exception should be cancelled. This adds the overhead of a H_GUEST_GET_STATE call to the likely case in which the decrementer should not be

[PATCH 03/12] KVM: PPC: Book3S HV nestedv2: Do not check msr on hcalls

2023-12-01 Thread Vaibhav Jain
From: Jordan Niethe The check for a hcall coming from userspace is done for KVM-PR. This is not supported for nestedv2 and the L0 will directly inject the necessary exception to the L2 if userspace performs a hcall. Avoid checking the MSR and thus avoid a H_GUEST_GET_STATE hcall in the L1.

[PATCH 10/12] KVM: PPC: Book3S HV nestedv2: Register the VPA with the L0

2023-12-01 Thread Vaibhav Jain
From: Jordan Niethe In the nestedv2 case, the L1 may register the L2's VPA with the L0. This allows the L0 to manage the L2's dispatch count, as well as enable possible performance optimisations by seeing if certain resources are not being used by the L2 (such as the PMCs). Use the

[PATCH 08/12] KVM: PPC: Book3S HV nestedv2: Avoid msr check in kvmppc_handle_exit_hv()

2023-12-01 Thread Vaibhav Jain
From: Jordan Niethe The msr check in kvmppc_handle_exit_hv() is not needed for nestedv2 hosts, skip the check to avoid a H_GUEST_GET_STATE hcall. Signed-off-by: Jordan Niethe --- arch/powerpc/kvm/book3s_hv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 04/12] KVM: PPC: Book3S HV nestedv2: Get the PID only if needed to copy tofrom a guest

2023-12-01 Thread Vaibhav Jain
From: Jordan Niethe kvmhv_copy_tofrom_guest_radix() gets the PID at the start of the function. If pid is not used, then this is a wasteful H_GUEST_GET_STATE hcall for nestedv2 hosts. Move the assignment to where pid will be used. Suggested-by: Nicholas Piggin Signed-off-by: Jordan Niethe ---

[PATCH 07/12] KVM: PPC: Book3S HV nestedv2: Do not inject certain interrupts

2023-12-01 Thread Vaibhav Jain
From: Jordan Niethe There is no need to inject an external interrupt in kvmppc_book3s_irqprio_deliver() as the test for BOOK3S_IRQPRIO_EXTERNAL in kvmhv_run_single_vcpu() before guest entry will raise LPCR_MER if needed. There is also no need to inject the decrementer interrupt as this will be

[PATCH 00/12] KVM: PPC: Nested APIv2 : Performance improvements

2023-12-01 Thread Vaibhav Jain
From: vaibhav This patch series introduces series of performance improvements to recently added support for Nested APIv2 PPC64 Guests via [1]. Details for Nested APIv2 for PPC64 Guests is available in Documentation/powerpc/kvm-nested.rst. This patch series introduces various optimizations for

[PATCH 06/12] KVM: PPC: Book3S HV: Handle pending exceptions on guest entry with MSR_EE

2023-12-01 Thread Vaibhav Jain
From: Nicholas Piggin Commit 026728dc5d41 ("KVM: PPC: Book3S HV P9: Inject pending xive interrupts at guest entry") changed guest entry so that if external interrupts are enabled, BOOK3S_IRQPRIO_EXTERNAL is not tested for. Test for this regardless of MSR_EE. For an L1 host, do not inject an

[PATCH 05/12] KVM: PPC: Book3S HV nestedv2: Ensure LPCR_MER bit is passed to the L0

2023-12-01 Thread Vaibhav Jain
From: Jordan Niethe LPCR_MER is conditionally set during entry to a guest if there is a pending external interrupt. In the nestedv2 case, this change is not being communicated to the L0, which means it is not being set in the L2. Ensure the updated LPCR value is passed to the L0. Signed-off-by:

[PATCH 01/12] KVM: PPC: Book3S HV nestedv2: Invalidate RPT before deleting a guest

2023-12-01 Thread Vaibhav Jain
From: Jordan Niethe An L0 must invalidate the L2's RPT during H_GUEST_DELETE if this has not already been done. This is a slow operation that means H_GUEST_DELETE must return H_BUSY multiple times before completing. Invalidating the tables before deleting the guest so there is less work for the

[PATCH 02/12] KVM: PPC: Book3S HV nestedv2: Avoid reloading the tb offset

2023-12-01 Thread Vaibhav Jain
From: Jordan Niethe The kvmppc_get_tb_offset() getter reloads KVMPPC_GSID_TB_OFFSET from the L0 for nestedv2 host. This is unnecessary as the value does not change. KVMPPC_GSID_TB_OFFSET also need not be reloaded in kvmppc_{s,g}et_dec_expires(). Signed-off-by: Jordan Niethe ---

[powerpc:next-test] BUILD SUCCESS 0f9c7c805ff837d0d0ffeaa9cc16d9664c9aa325

2023-12-01 Thread kernel test robot
allnoconfig gcc arc allyesconfig gcc arc defconfig gcc archsdk_defconfig gcc arc randconfig-001-20231201 gcc arc randconfig

[powerpc:next] BUILD SUCCESS ede66cd22441820cbd399936bf84fdc4294bc7fa

2023-12-01 Thread kernel test robot
gcc arc allnoconfig gcc arc allyesconfig gcc arc defconfig gcc archsdk_defconfig gcc arc randconfig-001-20231201 gcc arc

Re: [PATCH v2] powerpc/book3s/hash: Drop _PAGE_PRIVILEGED from PAGE_NONE

2023-12-01 Thread Christophe Leroy
Le 01/12/2023 à 11:35, Michael Ellerman a écrit : > "Aneesh Kumar K.V" writes: >> There used to be a dependency on _PAGE_PRIVILEGED with pte_savedwrite. >> But that got dropped by >> commit 6a56ccbcf6c6 ("mm/autonuma: use can_change_(pte|pmd)_writable() to >> replace savedwrite") >> >> With

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

2023-12-01 Thread Conor Dooley
On Thu, Nov 30, 2023 at 10:39:53AM +0800, Baoquan He wrote: $subject has a typo in the arch bit :) > Replace pr_debug() with the newly added kexec_dprintk() in kexec_file > loading related codes. Commit messages should be understandable in isolation, but this only explains (part of) what is

Re: [PATCH v2] powerpc/book3s/hash: Drop _PAGE_PRIVILEGED from PAGE_NONE

2023-12-01 Thread Michael Ellerman
"Aneesh Kumar K.V" writes: > There used to be a dependency on _PAGE_PRIVILEGED with pte_savedwrite. > But that got dropped by > commit 6a56ccbcf6c6 ("mm/autonuma: use can_change_(pte|pmd)_writable() to > replace savedwrite") > > With the change in this patch numa fault pte (pte_protnone()) gets

Re: [PATCH v2] powerpc/mm: Fix null-pointer dereference in pgtable_cache_add

2023-12-01 Thread Michael Ellerman
Kunwu Chan writes: > kasprintf() returns a pointer to dynamically allocated memory > which can be NULL upon failure. Ensure the allocation was successful > by checking the pointer validity. > > Suggested-by: Christophe Leroy > Suggested-by: Michael Ellerman > Signed-off-by: Kunwu Chan > --- >

Re: [PATCH][next] powerpc/crypto: Avoid -Wstringop-overflow warnings

2023-12-01 Thread Herbert Xu
On Tue, Nov 21, 2023 at 12:52:44PM -0600, Gustavo A. R. Silva wrote: > The compiler doesn't know that `32` is an offset into the Hash table: > > 56 struct Hash_ctx { > 57 u8 H[16]; /* subkey */ > 58 u8 Htable[256]; /* Xi, Hash table(offset 32) */ > 59 }; > > So, it

Re: [PATCH] powerpc/irq: Allow softirq to hardirq stack transition

2023-12-01 Thread Christophe Leroy
Le 01/12/2023 à 11:05, Michael Ellerman a écrit : > Christophe Leroy writes: >> Le 30/11/2023 à 13:50, Michael Ellerman a écrit : >>> Allow a transition from the softirq stack to the hardirq stack when >>> handling a hardirq. Doing so means a hardirq received while deep in >>> softirq

Re: [PATCH] powerpc/irq: Allow softirq to hardirq stack transition

2023-12-01 Thread Michael Ellerman
Christophe Leroy writes: > Le 30/11/2023 à 13:50, Michael Ellerman a écrit : >> Allow a transition from the softirq stack to the hardirq stack when >> handling a hardirq. Doing so means a hardirq received while deep in >> softirq processing is less likely to cause a stack overflow of the >>

Re: [PATCH] scsi: ibmvscsi: replace deprecated strncpy with strscpy

2023-12-01 Thread Michael Ellerman
Justin Stitt writes: > strncpy() is deprecated for use on NUL-terminated destination strings > [1] and as such we should prefer more robust and less ambiguous string > interfaces. > > We expect partition_name to be NUL-terminated based on its usage with > format strings: > |

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

2023-12-01 Thread Herve Codina
Hi Arnd, On Wed, 29 Nov 2023 15:03:02 +0100 "Arnd Bergmann" wrote: > 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; > > > > +

Re: [kvm-unit-tests PATCH v1 00/18] arm/arm64: Rework cache maintenance at boot

2023-12-01 Thread Shaoqin Huang
Hi Alexandru, Just take your time. I also appreciate your work. :) Thanks, Shaoqin On 11/30/23 18:35, Alexandru Elisei wrote: Hi, Thank you so much for reviving this, much appreciated. I wanted to let you know that I definitely plan to review the series as soon as possible, unfortunately I

[powerpc:fixes-test] BUILD SUCCESS e0ecbc227526df88604d776a5ccaf74a6bbb0160

2023-12-01 Thread kernel test robot
archsdk_defconfig gcc arc randconfig-001-20231201 gcc arc randconfig-002-20231201 gcc arc tb10x_defconfig gcc arcvdk_hs38_defconfig gcc arm