Re: [PATCH v9 15/19] KVM: selftests: Hook TDX support to vm and vcpu creation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 26, 2025, Sagi Shahar wrote:
> On Tue, Aug 26, 2025 at 3:29 PM Sagi Shahar <sagis@xxxxxxxxxx> wrote:
> >
> > On Tue, Aug 26, 2025 at 3:14 PM Ira Weiny <ira.weiny@xxxxxxxxx> wrote:
> > >
> > > Sean Christopherson wrote:
> > > > Ugh.  IMO, this is a KVM bug.  Allowing KVM_CREATE_IRQCHIP for a TDX VM is simply
> > > > wrong.  It _can't_ work.  Waiting until KVM_CREATE_VCPU to fail setup is terrible
> > > > ABI.
> > > >
> > > > If we stretch the meaning of ENOTTY a bit and return that when trying to create
> > > > a fully in-kernel IRQCHIP for a TDX VM, then the selftests code Just Works thanks
> > > > to the code below, which handles the scenario where KVM was be built without
> > >          ^^^^^^^^^^
> > >
> > > I'm not following.  Was there supposed to be a patch attached?
> > >
> >
> > I think Sean refers to the original implementation which was out of
> > the scope for the git diff so it was left out of the patch:

Yep, exactly.

> /*
>  * Allocate a fully in-kernel IRQ chip by default, but fall back to a
>  * split model (x86 only) if that fails (KVM x86 allows compiling out
>  * support for KVM_CREATE_IRQCHIP).
>  */
> r = __vm_ioctl(vm, KVM_CREATE_IRQCHIP, NULL);
> if (r && errno == ENOTTY && kvm_has_cap(KVM_CAP_SPLIT_IRQCHIP))
>         vm_enable_cap(vm, KVM_CAP_SPLIT_IRQCHIP, 24);
> else
>         TEST_ASSERT_VM_VCPU_IOCTL(!r, KVM_CREATE_IRQCHIP, r, vm);





[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux