[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220322080710.51727-4-gshan@redhat.com>
Date: Tue, 22 Mar 2022 16:06:51 +0800
From: Gavin Shan <gshan@...hat.com>
To: kvmarm@...ts.cs.columbia.edu
Cc: linux-kernel@...r.kernel.org, eauger@...hat.com,
shannon.zhaosl@...il.com, maz@...nel.org,
Jonathan.Cameron@...wei.com, will@...nel.org, pbonzini@...hat.com,
james.morse@....com, mark.rutland@....com, drjones@...hat.com,
vkuznets@...hat.com, shan.gavin@...il.com
Subject: [PATCH v5 03/22] KVM: arm64: Support SDEI_VERSION hypercall
This supports SDEI_VERSION hypercall by returning v1.1, which is
the specification version we're following. The vendor is set to
'KVM'.
Signed-off-by: Gavin Shan <gshan@...hat.com>
---
arch/arm64/kvm/sdei.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/arch/arm64/kvm/sdei.c b/arch/arm64/kvm/sdei.c
index 8a9b477b8977..5a3a64cd6e84 100644
--- a/arch/arm64/kvm/sdei.c
+++ b/arch/arm64/kvm/sdei.c
@@ -118,6 +118,14 @@ static bool remove_all_vcpu_events(struct kvm_vcpu *vcpu,
return pending;
}
+static unsigned long hypercall_version(struct kvm_vcpu *vcpu)
+{
+ /* v1.1 and the vendor is KVM */
+ return (1UL << SDEI_VERSION_MAJOR_SHIFT) |
+ (1UL << SDEI_VERSION_MINOR_SHIFT) |
+ 0x4b564d;
+}
+
int kvm_sdei_hypercall(struct kvm_vcpu *vcpu)
{
struct kvm *kvm = vcpu->kvm;
@@ -142,6 +150,8 @@ int kvm_sdei_hypercall(struct kvm_vcpu *vcpu)
switch (func) {
case SDEI_1_0_FN_SDEI_VERSION:
+ ret = hypercall_version(vcpu);
+ break;
case SDEI_1_0_FN_SDEI_EVENT_REGISTER:
case SDEI_1_0_FN_SDEI_EVENT_ENABLE:
case SDEI_1_0_FN_SDEI_EVENT_DISABLE:
--
2.23.0
Powered by blists - more mailing lists