[PATCH v3 8/8] KVM: arm64: Support the vCPU preemption check

2020-01-16 Thread Zengruan Ye
+---+-- System Benchmarks Index Score | 1835.1 | 1327.6 Signed-off-by: Zengruan Ye --- arch/arm64/include/asm/paravirt.h | 3 + arch/arm64/kernel/paravirt.c | 125 ++ arch

[PATCH v3 7/8] KVM: arm64: Add interface to support vCPU preempted check

2020-01-16 Thread Zengruan Ye
the spin loops upon the retval of vcpu_is_preempted. As kernel has used this interface, So lets support it. Reported-by: kbuild test robot Signed-off-by: Zengruan Ye --- arch/arm64/include/asm/paravirt.h | 12 arch/arm64/include/asm/spinlock.h | 9 + arch/arm64

[PATCH v3 5/8] KVM: arm64: Support pvlock preempted via shared structure

2020-01-16 Thread Zengruan Ye
Implement the service call for configuring a shared structure between a vCPU and the hypervisor in which the hypervisor can tell the vCPU that is running or not. Signed-off-by: Zengruan Ye --- arch/arm/include/asm/kvm_host.h | 18 + arch/arm64/include/asm/kvm_host.h | 18

[PATCH v3 1/8] KVM: arm64: Document PV-lock interface

2020-01-16 Thread Zengruan Ye
of the shared memory structures. Signed-off-by: Zengruan Ye --- Documentation/virt/kvm/arm/pvlock.rst | 68 + Documentation/virt/kvm/devices/vcpu.txt | 14 + 2 files changed, 82 insertions(+) create mode 100644 Documentation/virt/kvm/arm/pvlock.rst diff --git

[PATCH v3 0/8] KVM: arm64: vCPU preempted check support

2020-01-16 Thread Zengruan Ye
SMCCC Zengruan Ye (6): KVM: arm64: Document PV-lock interface KVM: arm64: Add SMCCC paravirtualised lock calls KVM: arm64: Support pvlock preempted via shared structure KVM: arm64: Provide vCPU attributes for PV lock KVM: arm64: Add interface to support vCPU preempted check KVM: arm64

[PATCH v3 6/8] KVM: arm64: Provide vCPU attributes for PV lock

2020-01-16 Thread Zengruan Ye
. 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 --- arch/arm64/include/asm/kvm_host.h | 9 + arch/arm64/include/uapi/asm/kvm.h | 2 ++ arch/arm64/kvm/guest.c

[PATCH v3 2/8] arm64: Probe for the presence of KVM hypervisor services during boot

2020-01-16 Thread Zengruan Ye
From: Will Deacon Although the SMCCC specification provides some limited functionality for describing the presence of hypervisor and firmware services, this is generally applicable only to functions designated as "Arm Architecture Service Functions" and no portable discovery mechanism is

[PATCH v3 4/8] KVM: arm64: Add SMCCC paravirtualised lock calls

2020-01-16 Thread Zengruan Ye
-by: Zengruan Ye --- arch/arm64/include/asm/pvlock-abi.h | 16 include/linux/arm-smccc.h | 10 ++ 2 files changed, 26 insertions(+) create mode 100644 arch/arm64/include/asm/pvlock-abi.h diff --git a/arch/arm64/include/asm/pvlock-abi.h b/arch/arm64/include/asm

[PATCH v3 3/8] arm/arm64: KVM: Advertise KVM UID to guests via SMCCC

2020-01-16 Thread Zengruan Ye
From: Will Deacon We can advertise ourselves to guests as KVM and provide a basic features bitmap for discoverability of future hypervisor services. Signed-off-by: Will Deacon [yezengr...@huawei.com: rebased] --- virt/kvm/arm/hypercalls.c | 37 - 1 file

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

2019-12-26 Thread Zengruan Ye
. 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 --- arch/arm64/include/asm/kvm_host.h | 9 + arch/arm64/include/uapi/asm/kvm.h | 2 ++ arch/arm64/kvm/guest.c

[PATCH v2 5/6] KVM: arm64: Add interface to support VCPU preempted check

2019-12-26 Thread Zengruan Ye
the spin loops upon the retval of vcpu_is_preempted. As kernel has used this interface, So lets support it. Signed-off-by: Zengruan Ye --- arch/arm64/include/asm/paravirt.h | 12 arch/arm64/include/asm/spinlock.h | 7 +++ arch/arm64/kernel/Makefile | 2

[PATCH v2 0/6] KVM: arm64: VCPU preempted check support

2019-12-26 Thread Zengruan Ye
number of PV lock features. * Report some basic validation when PV lock init. * Document preempted field. * Bunch of typo fixes. Zengruan Ye (6): KVM: arm64: Document PV-lock interface KVM: arm64: Add SMCCC paravirtualised lock calls KVM: arm64: Support pvlock preempted via shared

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

2019-12-26 Thread Zengruan Ye
+---+-- System Benchmarks Index Score | 1835.1 | 1327.6 Signed-off-by: Zengruan Ye --- arch/arm64/include/asm/paravirt.h | 3 + arch/arm64/kernel/paravirt.c | 117 ++ arch

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

2019-12-26 Thread Zengruan Ye
been preempted. Signed-off-by: Zengruan Ye --- arch/arm/include/asm/kvm_host.h | 18 arch/arm64/include/asm/kvm_host.h | 19 + arch/arm64/kvm/Makefile | 1 + virt/kvm/arm/arm.c| 8 ++ virt/kvm/arm/hypercalls.c | 8 ++ virt/kvm

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

2019-12-26 Thread Zengruan Ye
of the shared memory structures. Signed-off-by: Zengruan Ye --- Documentation/virt/kvm/arm/pvlock.rst | 63 + Documentation/virt/kvm/devices/vcpu.txt | 14 ++ 2 files changed, 77 insertions(+) create mode 100644 Documentation/virt/kvm/arm/pvlock.rst diff --git

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

2019-12-26 Thread Zengruan Ye
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 --- arch/arm64/include/asm/pvlock