[PATCH v3 01/14] KVM: Allow architectures to disallow pre-fault
Fuad Tabba
fuad.tabba at linux.dev
Wed Sep 23 03:54:15 PDT 2026
Hi Lorenzo,
On Tue, 22 Sep 2026 19:07:53 +0100, Oliver Upton <oupton at kernel.org> 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.
[...]
> diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
[...]
> +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
More information about the linux-arm-kernel
mailing list