Thread (90 messages) 90 messages, 5 authors, 2025-02-10

Re: [PATCH v6 25/43] arm64: Don't expose stolen time for realm guests

From: Gavin Shan <hidden>
Date: 2025-02-02 02:16:03
Also in: kvm, kvmarm, linux-coco, lkml

On 12/13/24 1:55 AM, Steven Price wrote:
quoted hunk ↗ jump to hunk
It doesn't make much sense as a realm guest wouldn't want to trust the
host. It will also need some extra work to ensure that KVM will only
attempt to write into a shared memory region. So for now just disable
it.

Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Steven Price <steven.price@arm.com>
---
  arch/arm64/kvm/arm.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
index eff1a4ec892b..134acb4ee26f 100644
--- a/arch/arm64/kvm/arm.c
+++ b/arch/arm64/kvm/arm.c
@@ -432,7 +432,10 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
  		r = system_supports_mte();
  		break;
  	case KVM_CAP_STEAL_TIME:
-		r = kvm_arm_pvtime_supported();
+		if (kvm_is_realm(kvm))
+			r = 0;
+		else
+			r = kvm_arm_pvtime_supported();
  		break;
kvm_vm_ioctl_check_extension() can be called on the file descriptor of "/dev/kvm".
'kvm' is NULL and kvm_is_realm() returns false, which is the missed corner case.
  	case KVM_CAP_ARM_EL1_32BIT:
  		r = cpus_have_final_cap(ARM64_HAS_32BIT_EL1);
Thanks,
Gavin

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help