On Wed, Sep 23, 2026 at 11:54:15AM +0100, Fuad Tabba wrote: > Hi Lorenzo, > > On Tue, 22 Sep 2026 19:07:53 +0100, Oliver Upton <[email protected]> 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?
Ack yeah that sounds good, will do for v4! > > Cheers, > /fuad -- Cheers, Lorenzo

