]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target/arm/kvm: Add helper to detect EL2 when using KVM
authorHaibo Xu <haibo.xu@linaro.org>
Mon, 7 Jul 2025 16:40:28 +0000 (18:40 +0200)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 10 Jul 2025 10:41:02 +0000 (11:41 +0100)
Introduce query support for KVM_CAP_ARM_EL2.

Signed-off-by: Haibo Xu <haibo.xu@linaro.org>
Signed-off-by: Miguel Luis <miguel.luis@oracle.com>
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20250707164129.1167837-3-eric.auger@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
target/arm/kvm-stub.c
target/arm/kvm.c
target/arm/kvm_arm.h

index 34e57fab01182b9fc0fa6d1d74fb2ddfb91dde1e..c93462c5b9b86979a527c0beb45bf4f873c0a342 100644 (file)
@@ -47,6 +47,11 @@ bool kvm_arm_mte_supported(void)
     return false;
 }
 
+bool kvm_arm_el2_supported(void)
+{
+    return false;
+}
+
 /*
  * These functions should never actually be called without KVM support.
  */
index 8ab0d692d36a761f9d00cbb26bd79031f2f19bc6..9fdf354f3bc57092174531f1cd1dc3c6a84a7762 100644 (file)
@@ -1763,6 +1763,11 @@ bool kvm_arm_aarch32_supported(void)
     return kvm_check_extension(kvm_state, KVM_CAP_ARM_EL1_32BIT);
 }
 
+bool kvm_arm_el2_supported(void)
+{
+    return kvm_check_extension(kvm_state, KVM_CAP_ARM_EL2);
+}
+
 bool kvm_arm_sve_supported(void)
 {
     return kvm_check_extension(kvm_state, KVM_CAP_ARM_SVE);
index 7dc83caed5c97c64e4b49f557164c3413373689b..b4cad051551fbf0423aeb9f72adcf67a5bca1a5c 100644 (file)
@@ -191,6 +191,13 @@ bool kvm_arm_sve_supported(void);
  */
 bool kvm_arm_mte_supported(void);
 
+/**
+ * kvm_arm_el2_supported:
+ *
+ * Returns true if KVM can enable EL2 and false otherwise.
+ */
+bool kvm_arm_el2_supported(void);
+
 /**
  * kvm_arm_get_max_vm_ipa_size:
  * @ms: Machine state handle