[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <DS0PR11MB63738FD0112507F78AEDC3CFDCEA9@DS0PR11MB6373.namprd11.prod.outlook.com>
Date: Tue, 20 Dec 2022 01:34:41 +0000
From: "Wang, Wei W" <wei.w.wang@...el.com>
To: "Christopherson,, Sean" <seanjc@...gle.com>
CC: "pbonzini@...hat.com" <pbonzini@...hat.com>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v1] KVM: x86: add KVM_CAP_DEVICE_CTRL
On Tuesday, December 20, 2022 4:36 AM, Sean Christopherson wrote:
> > Yes, it looks better to move it to the generic check, but I'm not sure
> > if it would be necessary to do the per-device check here either via
> > CONFIG_KVM_VFIO (for example, if more non-arch-specific usages are
> > added, we would end up with lots of such #ifdef to be added, which
> > doesn't seem nice) or kvm_device_ops_table.
> >
> > I think fundamentally KVM_CAP_DEVICE_CTRL is used to check if the
> > generic kvm_device framework (e.g. KVM_CREATE_DEVICE) is supported by
> > KVM (older KVM before 2013 doesn't have it). The per-device type
> > (KVM_DEV_TYPE_VFIO, KVM_DEV_TYPE_ARM_PV_TIME etc.) support can be
> > checked via KVM_CREATE_DEVICE, which reports -ENODEV if the device
> > type doesn't have an entry in kvm_device_ops_table.
>
> If that's how we want to retroactively define things, then KVM should
> unconditionally return 1/true for KVM_CAP_DEVICE_CTRL since
> KVM_CREATE_DEVICE is provided by generic code.
Yes. Also, since we have KVM_DEV_TYPE_VFIO the generic use case, it should be better
to move the CAP check to the generic kvm_vm_ioctl_check_extension_generic.
Powered by blists - more mailing lists