lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220322080710.51727-14-gshan@redhat.com>
Date:   Tue, 22 Mar 2022 16:07:01 +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 13/22] KVM: arm64: Support SDEI_FEATURES hypercall

This supports SDEI_FEATURES hypercall. It's used by the guest to
retrieve the supported features, which are number of binding slots
and relative mode for the event handler. Currently, none of them
is supported.

Signed-off-by: Gavin Shan <gshan@...hat.com>
---
 arch/arm64/kvm/sdei.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/arm64/kvm/sdei.c b/arch/arm64/kvm/sdei.c
index 0dec35a0eed1..1e0ca9022eaa 100644
--- a/arch/arm64/kvm/sdei.c
+++ b/arch/arm64/kvm/sdei.c
@@ -662,6 +662,20 @@ static unsigned long hypercall_reset(struct kvm_vcpu *vcpu, bool private)
 	return ret;
 }
 
+static unsigned long hypercall_features(struct kvm_vcpu *vcpu)
+{
+	unsigned long feature = smccc_get_arg1(vcpu);
+
+	switch (feature) {
+	case 0: /* BIND_SLOTS */
+		return 0;
+	case 1: /* RELATIVE_MODE */
+		return 0;
+	}
+
+	return SDEI_INVALID_PARAMETERS;
+}
+
 int kvm_sdei_hypercall(struct kvm_vcpu *vcpu)
 {
 	struct kvm *kvm = vcpu->kvm;
@@ -734,6 +748,8 @@ int kvm_sdei_hypercall(struct kvm_vcpu *vcpu)
 		ret = hypercall_reset(vcpu, false);
 		break;
 	case SDEI_1_1_FN_SDEI_FEATURES:
+		ret = hypercall_features(vcpu);
+		break;
 	default:
 		ret = SDEI_NOT_SUPPORTED;
 	}
-- 
2.23.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ