Re: [External] Re: [v2 0/6] KVM: arm64: implement vcpu_is_preempted check

2022-12-05 Thread Usama Arif
On 24/11/2022 13:55, Usama Arif wrote: On 18/11/2022 00:20, Marc Zyngier wrote: On Mon, 07 Nov 2022 12:00:44 +, Usama Arif wrote: On 06/11/2022 16:35, Marc Zyngier wrote: On Fri, 04 Nov 2022 06:20:59 +, Usama Arif wrote: This patchset adds support for vcpu_is_preempted

Re: [External] Re: [v2 0/6] KVM: arm64: implement vcpu_is_preempted check

2022-11-24 Thread Usama Arif
On 18/11/2022 00:20, Marc Zyngier wrote: On Mon, 07 Nov 2022 12:00:44 +, Usama Arif wrote: On 06/11/2022 16:35, Marc Zyngier wrote: On Fri, 04 Nov 2022 06:20:59 +, Usama Arif wrote: This patchset adds support for vcpu_is_preempted in arm64, which allows the guest to check

Re: [v2 0/6] KVM: arm64: implement vcpu_is_preempted check

2022-11-09 Thread Usama Arif
On 07/11/2022 18:24, Punit Agrawal wrote: Hi Usama, Usama Arif writes: This patchset adds support for vcpu_is_preempted in arm64, which allows the guest to check if a vcpu was scheduled out, which is useful to know incase it was holding a lock. vcpu_is_preempted can be used to improve

Re: [v2 3/6] KVM: arm64: Support pvlock preempted via shared structure

2022-11-07 Thread Usama Arif
On 07/11/2022 18:02, Punit Agrawal wrote: Usama Arif writes: Implement the service call for configuring a shared structure between a VCPU and the hypervisor in which the hypervisor can tell whether the VCPU is running or not. The preempted field is zero if the VCPU is not preempted. Any

Re: [v2 2/6] KVM: arm64: Add SMCCC paravirtualised lock calls

2022-11-07 Thread Usama Arif
On 07/11/2022 17:58, Punit Agrawal wrote: Usama Arif writes: Add a new SMCCC compatible hypercalls for PV lock features: ARM_SMCCC_KVM_FUNC_PV_LOCK: 0xC602 Also add the header file which defines the ABI for the paravirtualized lock features we're about to add. Signed-off

Re: [v2 1/6] KVM: arm64: Document PV-lock interface

2022-11-07 Thread Usama Arif
On 07/11/2022 17:56, Punit Agrawal wrote: Hi Usama, Usama Arif writes: Introduce a paravirtualization interface for KVM/arm64 to obtain whether the VCPU is currently running or not. The PV lock structure of the guest is allocated by user space. A hypercall interface is provided

Re: [External] Re: [v2 0/6] KVM: arm64: implement vcpu_is_preempted check

2022-11-07 Thread Usama Arif
On 06/11/2022 16:35, Marc Zyngier wrote: On Fri, 04 Nov 2022 06:20:59 +, Usama Arif wrote: This patchset adds support for vcpu_is_preempted in arm64, which allows the guest to check if a vcpu was scheduled out, which is useful to know incase it was holding a lock. vcpu_is_preempted can

Re: [External] Re: [RFC 5/6] KVM: arm64: Support the VCPU preemption check

2022-11-04 Thread Usama Arif
On 03/11/2022 13:25, Steven Price wrote: On 02/11/2022 16:13, Usama Arif wrote: Support the vcpu_is_preempted() functionality under KVM/arm64. This will enhance lock performance on overcommitted hosts (more runnable VCPUs than physical CPUs in the system) as doing busy waits for preempted

[v2 6/6] KVM: selftests: add tests for PV time specific hypercall

2022-11-04 Thread Usama Arif
This is a vendor specific hypercall. Signed-off-by: Usama Arif --- tools/testing/selftests/kvm/aarch64/hypercalls.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/kvm/aarch64/hypercalls.c b/tools/testing/selftests/kvm/aarch64/hypercalls.c index a39da3fe4952

[v2 5/6] KVM: arm64: Support the VCPU preemption check

2022-11-04 Thread Usama Arif
-by: Zengruan Ye Signed-off-by: Usama Arif --- arch/arm64/include/asm/paravirt.h | 2 + arch/arm64/include/asm/spinlock.h | 16 - arch/arm64/kernel/paravirt.c | 112 ++ arch/arm64/kernel/setup.c | 3 + include/linux/cpuhotplug.h| 1 + 5 files

[v2 4/6] KVM: arm64: Provide VCPU attributes for PV lock

2022-11-04 Thread Usama Arif
. The address is given in terms of the physical address visible to the guest and must be 64 byte aligned. The guest will discover the address via a hypercall. Signed-off-by: Zengruan Ye Signed-off-by: Usama Arif --- arch/arm64/include/asm/kvm_host.h | 7 arch/arm64/include/uapi/asm/kvm.h | 2

[v2 0/6] KVM: arm64: implement vcpu_is_preempted check

2022-11-04 Thread Usama Arif
mu/commit/2da2c2927ae8de8f03f439804a0dad9cf68501b6, Looking forward to your response! Thanks, Usama --- RFC->v2 - Fixed table and code referencing in pvlock documentation - Switched to using a single hypercall similar to ptp_kvm and made check for has_kvm_pvlock simpler Usama Arif (6): KVM: arm64: Document PV-lock int

[v2 3/6] KVM: arm64: Support pvlock preempted via shared structure

2022-11-04 Thread Usama Arif
-by: Zengruan Ye Signed-off-by: Usama Arif --- Documentation/virt/kvm/arm/hypercalls.rst | 3 ++ arch/arm64/include/asm/kvm_host.h | 18 ++ arch/arm64/include/uapi/asm/kvm.h | 1 + arch/arm64/kvm/Makefile | 2 +- arch/arm64/kvm/arm.c | 8

[v2 2/6] KVM: arm64: Add SMCCC paravirtualised lock calls

2022-11-04 Thread Usama Arif
Add a new SMCCC compatible hypercalls for PV lock features: ARM_SMCCC_KVM_FUNC_PV_LOCK: 0xC602 Also add the header file which defines the ABI for the paravirtualized lock features we're about to add. Signed-off-by: Zengruan Ye Signed-off-by: Usama Arif --- arch/arm64/include/asm

[v2 1/6] KVM: arm64: Document PV-lock interface

2022-11-04 Thread Usama Arif
-by: Zengruan Ye Signed-off-by: Usama Arif --- Documentation/virt/kvm/arm/index.rst| 1 + Documentation/virt/kvm/arm/pvlock.rst | 52 + Documentation/virt/kvm/devices/vcpu.rst | 25 3 files changed, 78 insertions(+) create mode 100644 Documentation/virt

[PATCH] arm64: paravirt: remove conduit check in has_pv_steal_clock

2022-11-04 Thread Usama Arif
arm_smccc_1_1_invoke() which is called later on in the function will return failure if there's no conduit (or pre-SMCCC 1.1), hence the check is unnecessary. Suggested-by: Steven Price Signed-off-by: Usama Arif --- arch/arm64/kernel/paravirt.c | 4 1 file changed, 4 deletions(-) diff

Re: [External] Re: [RFC 1/6] KVM: arm64: Document PV-lock interface

2022-11-03 Thread Usama Arif
:35PM +, Usama Arif wrote: += == +Function ID: (uint32)0xC620 +PV_call_id: (uint32)The function to query for support. + Currently only PV_LOCK_PREEMPTED is supported. +Return value: (int64

[PATCH] kvm/arm: Fix pvtime documentation

2022-11-03 Thread Usama Arif
This includes table format and using reST labels for cross-referencing to vcpu.rst. Suggested-by: Bagas Sanjaya Signed-off-by: Usama Arif --- Documentation/virt/kvm/arm/pvtime.rst | 14 -- Documentation/virt/kvm/devices/vcpu.rst | 2 ++ 2 files changed, 10 insertions(+), 6

[RFC 6/6] KVM: selftests: add tests for PV time specific hypercalls

2022-11-02 Thread Usama Arif
These are vendor specific hypercalls. Signed-off-by: Usama Arif --- tools/testing/selftests/kvm/aarch64/hypercalls.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/kvm/aarch64/hypercalls.c b/tools/testing/selftests/kvm/aarch64/hypercalls.c index a39da3fe4952

[RFC 5/6] KVM: arm64: Support the VCPU preemption check

2022-11-02 Thread Usama Arif
-by: Zengruan Ye Signed-off-by: Usama Arif --- arch/arm64/include/asm/paravirt.h | 2 + arch/arm64/include/asm/spinlock.h | 16 +++- arch/arm64/kernel/paravirt.c | 126 ++ arch/arm64/kernel/setup.c | 3 + include/linux/cpuhotplug.h| 1 + 5 files

[RFC 3/6] KVM: arm64: Support pvlock preempted via shared structure

2022-11-02 Thread Usama Arif
-by: Zengruan Ye Signed-off-by: Usama Arif --- Documentation/virt/kvm/arm/hypercalls.rst | 3 ++ arch/arm64/include/asm/kvm_host.h | 18 ++ arch/arm64/include/uapi/asm/kvm.h | 1 + arch/arm64/kvm/Makefile | 2 +- arch/arm64/kvm/arm.c | 8

[RFC 4/6] KVM: arm64: Provide VCPU attributes for PV lock

2022-11-02 Thread Usama Arif
. The address is given in terms of the physical address visible to the guest and must be 64 byte aligned. The guest will discover the address via a hypercall. Signed-off-by: Zengruan Ye Signed-off-by: Usama Arif --- arch/arm64/include/asm/kvm_host.h | 7 arch/arm64/include/uapi/asm/kvm.h | 2

[RFC 2/6] KVM: arm64: Add SMCCC paravirtualised lock calls

2022-11-02 Thread Usama Arif
Add two new SMCCC compatible hypercalls for PV lock features: PV_LOCK_FEATURES: 0xC620 PV_LOCK_PREEMPTED: 0xC621 Also add the header file which defines the ABI for the paravirtualized lock features we're about to add. Signed-off-by: Zengruan Ye Signed-off-by: Usama Arif

[RFC 0/6] KVM: arm64: implement vcpu_is_preempted check

2022-11-02 Thread Usama Arif
e to test this is at https://github.com/uarif1/qemu/commit/2da2c2927ae8de8f03f439804a0dad9cf68501b6, if this patchset looks good to start review, I can send the QEMU change to the qemu mailing list to start its review as well. Looking forward to your response! Thanks, Usama Usama Arif (6): KVM: arm64:

[RFC 1/6] KVM: arm64: Document PV-lock interface

2022-11-02 Thread Usama Arif
and the location of the shared memory structures. Signed-off-by: Zengruan Ye Signed-off-by: Usama Arif --- Documentation/virt/kvm/arm/pvlock.rst | 64 + Documentation/virt/kvm/devices/vcpu.rst | 23 + 2 files changed, 87 insertions(+) create mode 100644 Documentation/virt/kvm