On Mon, Apr 22, 2024 at 09:15:02PM +0530, Naveen N Rao wrote:
> On Tue, Apr 02, 2024 at 12:36:54PM +0530, Gautam Menghani wrote:
> > PAPR hypervisor has introduced three new counters in the VPA area of
> > LPAR CPUs for KVM L2 guest (see [1] for terminology) observability - 2
-by: Gautam Menghani
---
v5 -> v6:
1. Use TRACE_EVENT_FN to enable/disable counters only once.
2. Remove the agg. counters from vcpu->arch.
3. Use PACA to maintain old counter values instead of zeroing on every
entry.
4. Simplify variable names
v4 -> v5:
1. Define helper functions fo
|
avg = 11 usecs, total: 57,720,612 usecs, count: 4,917,325
4. This patch series has been also tested on KVM on Power8 CPU.
[1]: https://github.com/iovisor/bcc/blob/master/tools/funclatency.py
Gautam Menghani (3):
arch/powerpc/kvm: Use bitmap to speed up res
When an irq is to be resent, all 1024 irqs in an ICS are scanned and the
irqs having 'resend' flag set are resent. Optimize this flow using bitmap
array to speed up the resends.
Signed-off-by: Gautam Menghani
---
arch/powerpc/kvm/book3s_xics.c | 22 +++---
arch/p
Given a server number, kvmppc_xics_find_server() does a linear search
over the vcpus of a VM. Optimize this logic by using an array to
maintain the mapping between server number -> icp.
Signed-off-by: Gautam Menghani
---
arch/powerpc/kvm/book3s_xics.c | 4 ++--
arch/powerpc/kvm/book3s_xic
Take a spinlock on state of an IRQ instead of an entire ICS. This
improves scalability by reducing contention.
Signed-off-by: Gautam Menghani
---
arch/powerpc/kvm/book3s_hv_rm_xics.c | 8 ++---
arch/powerpc/kvm/book3s_xics.c | 44
arch/powerpc/kvm
: Vaibhav Jain
Signed-off-by: Gautam Menghani
---
v6 -> v7:
1. Use TRACE_EVENT_FN_COND to handle zero counters case.
2. Use for_each_present_cpu() to handle hotplugs.
v5 -> v6:
1. Use TRACE_EVENT_FN to enable/disable counters only once.
2. Remove the agg. counters from vcpu->arch.
3. Us
: Naveen N Rao
Signed-off-by: Vaibhav Jain
Signed-off-by: Gautam Menghani
---
v7 -> v8:
1. Use per_cpu vars instead of paca members.
2. Fix build error for powernv config.
v6 -> v7:
1. Use TRACE_EVENT_FN_COND to handle zero counters case.
2. Use for_each_present_cpu() to handle hotplugs.
v5
Remove extended_cede_processor() definition as it has no callers since
commit 48f6e7f6d948("powerpc/pseries: remove cede offline state for CPUs")
Signed-off-by: Gautam Menghani
---
arch/powerpc/include/asm/plpar_wrappers.h | 18 --
1 file changed, 18 deletions(-)
di
On Tue, May 14, 2024 at 04:20:04PM GMT, Naveen N Rao wrote:
> On Tue, May 14, 2024 at 03:35:03PM GMT, Gautam Menghani wrote:
> > Remove extended_cede_processor() definition as it has no callers since
> > commit 48f6e7f6d948("powerpc/pseries: remove cede of
Remove extended_cede_processor() and its helpers as
extended_cede_processor() has no callers since
commit 48f6e7f6d948("powerpc/pseries: remove cede offline state for CPUs")
Signed-off-by: Gautam Menghani
---
v1 -> v2:
1. Remove helpers of extended_cede_processor()
arch/powerp
|
avg = 11 usecs, total: 57,720,612 usecs, count: 4,917,325
4. This patch series has been also tested on KVM on Power8 CPU.
[1]: https://github.com/iovisor/bcc/blob/master/tools/funclatency.py
Changes v1 -> v1 resend
1. Add Cedric to CC
Gautam Menghani (3):
a
Take a spinlock on state of an IRQ instead of an entire ICS. This
improves scalability by reducing contention.
Signed-off-by: Gautam Menghani
---
arch/powerpc/kvm/book3s_hv_rm_xics.c | 8 ++---
arch/powerpc/kvm/book3s_xics.c | 44
arch/powerpc/kvm
When an irq is to be resent, all 1024 irqs in an ICS are scanned and the
irqs having 'resend' flag set are resent. Optimize this flow using bitmap
array to speed up the resends.
Signed-off-by: Gautam Menghani
---
arch/powerpc/kvm/book3s_xics.c | 22 +++---
arch/p
Given a server number, kvmppc_xics_find_server() does a linear search
over the vcpus of a VM. Optimize this logic by using an array to
maintain the mapping between server number -> icp.
Signed-off-by: Gautam Menghani
---
arch/powerpc/kvm/book3s_xics.c | 4 ++--
arch/powerpc/kvm/book3s_xic
: Naveen N Rao
Signed-off-by: Vaibhav Jain
Signed-off-by: Gautam Menghani
---
v8 -> v9:
1. Fix linker errors when compiling as module.
v7 -> v8:
1. Use per_cpu vars instead of paca members.
2. Fix build error for powernv config.
v6 -> v7:
1. Use TRACE_EVENT_FN_COND to handle zero counter
()). Add DPDES support in the host KVM code to fix
doorbell emulation.
Fixes: 6ccbbc33f06a ("KVM: PPC: Add helper library for Guest State Buffers")
Signed-off-by: Gautam Menghani
---
Documentation/arch/powerpc/kvm-nested.rst | 4 +++-
arch/powerpc/include/asm/guest-state-buf
()). Add DPDES support in the host KVM code to fix
doorbell emulation.
Fixes: 6ccbbc33f06a ("KVM: PPC: Add helper library for Guest State Buffers")
Cc: sta...@vger.kernel.org
Signed-off-by: Gautam Menghani
---
v1 -> v1 resend:
1. Add the stable tag
Documentation/arch/powerpc/k
Hello,
Please review this series and let me know if any changes are needed.
Thanks,
Gautam
Hello,
Please review this patch and let me know if any changes are needed.
Thanks,
Gautam
On Fri, May 31, 2024 at 08:09:13AM GMT, Greg KH wrote:
> On Fri, May 31, 2024 at 10:54:58AM +0530, Gautam Menghani wrote:
> > Hello,
> >
> > Please review this patch and let me know if any changes are needed.
>
> There already was review comments on it, why ignore t
On Mon, Jun 03, 2024 at 03:42:22PM GMT, Nicholas Piggin wrote:
> On Wed May 22, 2024 at 6:49 PM AEST, Gautam Menghani wrote:
> > Doorbell emulation is broken for KVM on PowerVM guests as support for
> > DPDES was not added in the initial patch series. Due to this, a KVM on
> >
its own patch
Gautam Menghani (2):
arch/powerpc/kvm: Add DPDES support in helper library for Guest state
buffer
arch/powerpc/kvm: Fix doorbell emulation for v2 API
Documentation/arch/powerpc/kvm-nested.rst | 4 +++-
arch/powerpc/include/asm/guest-state-buffer.h | 3 ++-
arch/powerpc
ost
KVM code to fix doorbell emulation.
Fixes: 19d31c5f1157 ("KVM: PPC: Add support for nestedv2 guests")
Cc: sta...@vger.kernel.org # v6.7
Signed-off-by: Gautam Menghani
---
arch/powerpc/kvm/book3s_hv.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/arch/powerpc/kvm/book3
Add support for using DPDES in the library for using guest state
buffers. DPDES support is needed for enabling usage of doorbells in a
L2 KVM on PAPR guest.
Fixes: 6ccbbc33f06a ("KVM: PPC: Add helper library for Guest State Buffers")
Cc: sta...@vger.kernel.org # v6.7
Signed-off-
On Thu, Jun 06, 2024 at 01:00:19PM GMT, Nicholas Piggin wrote:
> On Wed Jun 5, 2024 at 9:39 PM AEST, Gautam Menghani wrote:
> > Doorbell emulation for KVM on PAPR guests is broken as support for DPDES
> > was not added in initial patch series [1].
> > Add DPDES support
On Wed, Jun 05, 2024 at 05:09:08PM GMT, Gautam Menghani wrote:
> Doorbell emulation for KVM on PAPR guests is broken as support for DPDES
> was not added in initial patch series [1].
> Add DPDES support and doorbell handling support for V2 API.
>
> [1] lore.kernel.o
7c2a0b78 3821fd30 41c20008 e82d0910 <0981fd30> f9210160
f9610130 f9810138
[ 2598.923269] ---[ end trace ]---
[ 2598.926662] pstore: backend (nvram) writing error (-1)
With this patch, the disabled cpus are woken up and kexec goes through
fine.
Tested-by: Gautam Menghani
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 switch case.
Signed-off-by: Gautam Menghani
---
arch/powerpc/kvm/book3s_hv.c | 16
Doorbell emulation for nested KVM guests in V1 API is broken because of
2 reasons:
1. L0 presenting H_EMUL_ASSIST to L1 instead of H_FAC_UNAVAIL
2. Broken plumbing for passing around doorbell state.
Fix the trap passed to L1 and the plumbing for maintaining doorbell
state.
Gautam Menghani (2
t;KVM: PPC: Book3S HV Nested: Stop forwarding all HFUs to
L1")
the L1 ends up getting a H_EMUL_ASSIST because of which, the L1 ends up
injecting a SIGILL when L2 (nested guest) tries to use doorbells.
Signed-off-by: Gautam Menghani
---
arch/powerpc/kvm/book3s
plumbing to utilize vcpu->doorbell_request instead of vcore->dpdes
on P9 and above.
Fixes: 6398326b9ba1 ("KVM: PPC: Book3S HV P9: Stop using vc->dpdes")
Signed-off-by: Gautam Menghani
---
arch/powerpc/kvm/book3s_hv.c| 9 -
arch/powerpc/kvm/book3s_hv_neste
arch_compat = PVR_ARCH_300;
> + } else {
> + arch_compat = vcpu->arch.vcore->arch_compat;
> + }
> + rc = kvmppc_gse_put_u32(gsb, iden, arch_compat);
> break;
> }
>
> --
> 2.43.0
>
I tested this patch on pseries Power 10 machine with KVM support :
Without this patch, with the latest mainline as host,the kvm guest on
pseries/powervm fails to reboot and with this patch, reboot works fine.
Tested-by: Gautam Menghani
-by: Gautam Menghani
---
arch/powerpc/include/asm/kvm_host.h | 5 +
arch/powerpc/include/asm/lppaca.h | 11 ---
arch/powerpc/kvm/book3s_hv.c| 20
arch/powerpc/kvm/trace_hv.h | 24
4 files changed, 57 insertions(+), 3
-by: Gautam Menghani
---
V1 -> V2:
1. Fix the build error due to invalid struct member reference.
arch/powerpc/include/asm/kvm_host.h | 5 +
arch/powerpc/include/asm/lppaca.h | 11 ---
arch/powerpc/kvm/book3s_hv.c| 20
arch/powerpc/kvm/trace_h
the near future.
[1] Terminology:
a. L1 refers to the VM (LPAR) booted on top of PAPR hypervisor
b. L2 refers to the KVM guest booted on top of L1.
Signed-off-by: Vaibhav Jain
Signed-off-by: Gautam Menghani
---
v1 -> v2:
1. Fix the build error due to invalid struct member reference.
v2 -&
On Fri, Mar 22, 2024 at 03:41:32PM +0530, Gautam Menghani wrote:
> PAPR hypervisor has introduced three new counters in the VPA area of
> LPAR CPUs for KVM L2 guest (see [1] for terminology) observability - 2
> for context switches from host to guest and vice versa, and 1 counter
> for
the near future.
[1] Terminology:
a. L1 refers to the VM (LPAR) booted on top of PAPR hypervisor
b. L2 refers to the KVM guest booted on top of L1.
Signed-off-by: Vaibhav Jain
Signed-off-by: Gautam Menghani
---
v1 -> v2:
1. Fix the build error due to invalid struct member reference.
v2 -&
the near future.
[1] Terminology:
a. L1 refers to the VM (LPAR) booted on top of PAPR hypervisor
b. L2 refers to the KVM guest booted on top of L1.
Signed-off-by: Vaibhav Jain
Signed-off-by: Gautam Menghani
---
arch/powerpc/include/asm/kvm_host.h | 5
arch/powerpc/include/asm/lppaca.h |
the near future.
[1] Terminology:
a. L1 refers to the VM (LPAR) booted on top of PAPR hypervisor
b. L2 refers to the KVM guest booted on top of L1.
Signed-off-by: Vaibhav Jain
Signed-off-by: Gautam Menghani
---
v5 RESEND:
1. Add the changelog
v4 -> v5:
1. Define helper functions for g
On Thu, Jul 06, 2023 at 05:50:57PM +1000, Jordan Niethe wrote:
>
>
> On 30/6/23 3:56 pm, Gautam Menghani wrote:
> > Remove an unnecessary piece of code that does an endianness conversion but
> > does not use the result. The following warning was reported by Clang&
On Thu, Jul 06, 2023 at 05:50:57PM +1000, Jordan Niethe wrote:
>
>
> On 30/6/23 3:56 pm, Gautam Menghani wrote:
> > Remove an unnecessary piece of code that does an endianness conversion but
> > does not use the result. The following warning was reported by Clang&
lso
removed 'server' from the error message for the call to opal_get_xive().
Fix the warning by removing the server variable assignment.
Fixes: bf8e0f891a32 ("powerpc/powernv: Fix endian issues in OPAL ICS backend")
Reviewed-by: Jordan Niethe
Signed-off-by: Gautam Menghani
--
On Sat, Jul 29, 2023 at 08:54:26PM +1000, Michael Ellerman wrote:
> Gautam Menghani writes:
> > On Thu, Jul 06, 2023 at 05:50:57PM +1000, Jordan Niethe wrote:
> >> On 30/6/23 3:56 pm, Gautam Menghani wrote:
> >> > Remove an unnecessary piece of code that does an end
KCSAN warnings at consumer's callsites.
>
> Signed-off-by: Rohan McLure
> Reported-by: Michael Ellerman
> Reported-by: Gautam Menghani
> Acked-by: Arnd Bergmann
> ---
> include/asm-generic/mmiowb.h | 17 +++--
> 1 file changed, 11 insertions(+), 6 del
On Mon, Jun 05, 2023 at 04:48:48PM +1000, Jordan Niethe wrote:
> From: Michael Neuling
Hi,
There are some minor typos in the documentation pointed out below
> +H_GUEST_GET_STATE()
> +---
> +
> +This is called to get state associated with an L2 (Guest-wide or vCPU
> specific).
>
server = be16_to_cpu(oserver);
As the result of endianness conversion is never used, delete the line
and fix the warning.
Signed-off-by: Gautam Menghani
---
arch/powerpc/sysdev/xics/ics-opal.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/powerpc/sysdev/xics/ics-opal.c
b/arch/powe
server = be16_to_cpu(oserver);
As the result of endianness conversion is never used, delete the line
and fix the warning.
Signed-off-by: Gautam Menghani
---
arch/powerpc/sysdev/xics/ics-opal.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/powerpc/sysdev/xics/ics-opal.c
b/arch/powe
On Fri, Jun 30, 2023 at 11:43:26AM +0530, Gautam Menghani wrote:
> Remove an unnecessary piece of code that does an endianness conversion but
> does not use the result. The following warning was reported by Clang's
> static analyzer:
>
> arch/powerpc/sysdev/xics/ics-opal.c:1
On Thu, Jul 06, 2023 at 05:50:57PM +1000, Jordan Niethe wrote:
>
>
> On 30/6/23 3:56 pm, Gautam Menghani wrote:
> > Remove an unnecessary piece of code that does an endianness conversion but
> > does not use the result. The following warning was reported by Clang&
Hello,
Please review this patch and let me know if any changes are needed.
Thanks,
Gautam
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 al
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
---
53 matches
Mail list logo