Thread (40 messages) 40 messages, 4 authors, 12d ago

Re: [PATCH v3 01/14] KVM: Allow architectures to disallow pre-fault

From: Fuad Tabba <fuad.tabba@linux.dev>
Date: 2026-09-23 10:54:58
Also in: kvm, kvmarm, linux-doc, linux-kselftest, lkml

Hi Lorenzo,

On Tue, 22 Sep 2026 19:07:53 +0100, Oliver Upton [off-list ref] wrote:
[...]
I'd favor doing something like below and sticking the comment inline in
the ioctl handler. Unless I'm missing something blatantly obvious, I
don't see why the x86 or s390 pre-conditions can't be tested early too.
[...]
quoted hunk ↗ jump to hunk
diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
[...]
quoted hunk ↗ jump to hunk
+int kvm_arch_pre_fault_allowed(struct kvm_vcpu *vcpu)
+{
+        if (!kvm_vcpu_initialized(vcpu))
+                return -ENOEXEC;
+
+        return 0;
+}
The same goes for arm64's pKVM check: kvm_arch_vcpu_pre_fault_memory()
returns -EOPNOTSUPP for is_protected_kvm_enabled() only after
vcpu_load(), so on a pKVM host the ioctl loads a vCPU the hypervisor
may not have created yet before rejecting it. Could that check move
into kvm_arch_pre_fault_allowed() as well?

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