All of lore.kernel.org
 help / color / mirror / Atom feed
* A question about "CONFIG_KVM_DEVICE_ASSIGNMENT" configuration
@ 2015-09-10 10:22 Nan Xiao
  2015-09-10 15:08 ` Alex Williamson
  0 siblings, 1 reply; 6+ messages in thread
From: Nan Xiao @ 2015-09-10 10:22 UTC (permalink / raw)
  To: kvm

Hi all,

When building kernel, it prompts "CONFIG_KVM_DEVICE_ASSIGNMENT" is "deprecated".
But it is still used in kernel code. E.g.:
"kvm_vm_ioctl_check_extension" function:
{
    ...
#ifdef CONFIG_KVM_DEVICE_ASSIGNMENT
case KVM_CAP_ASSIGN_DEV_IRQ:
case KVM_CAP_PCI_2_3:
#endif
r = 1;
break;
   ...
#ifdef CONFIG_KVM_DEVICE_ASSIGNMENT
case KVM_CAP_IOMMU:
r = iommu_present(&pci_bus_type);
break;
#endif
   ...
}

If not configure this option, the following code will execute failed:

    ret = ioctl(dev, KVM_CHECK_EXTENSION, KVM_CAP_IOMMU);

So does it mean to use KVM assigned device feature, the
"CONFIG_KVM_DEVICE_ASSIGNMENT"
is not "deprecated"?

Thanks very much in advance!
Best Regards
Nan Xiao

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: A question about "CONFIG_KVM_DEVICE_ASSIGNMENT" configuration
  2015-09-10 10:22 A question about "CONFIG_KVM_DEVICE_ASSIGNMENT" configuration Nan Xiao
@ 2015-09-10 15:08 ` Alex Williamson
  2015-09-10 23:58   ` Nan Xiao
  2015-09-11  0:55   ` Chen, Tiejun
  0 siblings, 2 replies; 6+ messages in thread
From: Alex Williamson @ 2015-09-10 15:08 UTC (permalink / raw)
  To: Nan Xiao; +Cc: kvm

On Thu, 2015-09-10 at 18:22 +0800, Nan Xiao wrote:
> Hi all,
> 
> When building kernel, it prompts "CONFIG_KVM_DEVICE_ASSIGNMENT" is "deprecated".
> But it is still used in kernel code. E.g.:
> "kvm_vm_ioctl_check_extension" function:
> {
>     ...
> #ifdef CONFIG_KVM_DEVICE_ASSIGNMENT
> case KVM_CAP_ASSIGN_DEV_IRQ:
> case KVM_CAP_PCI_2_3:
> #endif
> r = 1;
> break;
>    ...
> #ifdef CONFIG_KVM_DEVICE_ASSIGNMENT
> case KVM_CAP_IOMMU:
> r = iommu_present(&pci_bus_type);
> break;
> #endif
>    ...
> }
> 
> If not configure this option, the following code will execute failed:
> 
>     ret = ioctl(dev, KVM_CHECK_EXTENSION, KVM_CAP_IOMMU);
> 
> So does it mean to use KVM assigned device feature, the
> "CONFIG_KVM_DEVICE_ASSIGNMENT"
> is not "deprecated"?

Legacy KVM device assignment is deprecated, it is fully replaced by
VFIO-based device assignment.  The intention is to deprecate legacy KVM
device assignment now, so all users can transition away from it and at
some point remove it from the kernel.  When using QEMU and libvirt, the
default is already to use VFIO instead of legacy KVM device assignment.
Thanks,

Alex




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: A question about "CONFIG_KVM_DEVICE_ASSIGNMENT" configuration
  2015-09-10 15:08 ` Alex Williamson
@ 2015-09-10 23:58   ` Nan Xiao
  2015-09-11  0:18     ` Alex Williamson
  2015-09-11  0:55   ` Chen, Tiejun
  1 sibling, 1 reply; 6+ messages in thread
From: Nan Xiao @ 2015-09-10 23:58 UTC (permalink / raw)
  To: Alex Williamson; +Cc: kvm

Hi Alex,

Thanks very much for your response! so for assigning PCI device in QEMU.
The following method is deprecated:

    qemu-system-x86_64 ... -device pci-assign,host=0000:21:00.1

I should use this one instead:

    qemu-system-x86_64 ... -device vfio-pci,host=0000:21:00.1

right?

Thanks in advance!
Best Regards
Nan Xiao


On Thu, Sep 10, 2015 at 11:08 PM, Alex Williamson
<alex.williamson@redhat.com> wrote:
> On Thu, 2015-09-10 at 18:22 +0800, Nan Xiao wrote:
>> Hi all,
>>
>> When building kernel, it prompts "CONFIG_KVM_DEVICE_ASSIGNMENT" is "deprecated".
>> But it is still used in kernel code. E.g.:
>> "kvm_vm_ioctl_check_extension" function:
>> {
>>     ...
>> #ifdef CONFIG_KVM_DEVICE_ASSIGNMENT
>> case KVM_CAP_ASSIGN_DEV_IRQ:
>> case KVM_CAP_PCI_2_3:
>> #endif
>> r = 1;
>> break;
>>    ...
>> #ifdef CONFIG_KVM_DEVICE_ASSIGNMENT
>> case KVM_CAP_IOMMU:
>> r = iommu_present(&pci_bus_type);
>> break;
>> #endif
>>    ...
>> }
>>
>> If not configure this option, the following code will execute failed:
>>
>>     ret = ioctl(dev, KVM_CHECK_EXTENSION, KVM_CAP_IOMMU);
>>
>> So does it mean to use KVM assigned device feature, the
>> "CONFIG_KVM_DEVICE_ASSIGNMENT"
>> is not "deprecated"?
>
> Legacy KVM device assignment is deprecated, it is fully replaced by
> VFIO-based device assignment.  The intention is to deprecate legacy KVM
> device assignment now, so all users can transition away from it and at
> some point remove it from the kernel.  When using QEMU and libvirt, the
> default is already to use VFIO instead of legacy KVM device assignment.
> Thanks,
>
> Alex
>
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: A question about "CONFIG_KVM_DEVICE_ASSIGNMENT" configuration
  2015-09-10 23:58   ` Nan Xiao
@ 2015-09-11  0:18     ` Alex Williamson
  2015-09-11  0:42       ` Nan Xiao
  0 siblings, 1 reply; 6+ messages in thread
From: Alex Williamson @ 2015-09-11  0:18 UTC (permalink / raw)
  To: Nan Xiao; +Cc: kvm

On Fri, 2015-09-11 at 07:58 +0800, Nan Xiao wrote:
> Hi Alex,
> 
> Thanks very much for your response! so for assigning PCI device in QEMU.
> The following method is deprecated:
> 
>     qemu-system-x86_64 ... -device pci-assign,host=0000:21:00.1
> 
> I should use this one instead:
> 
>     qemu-system-x86_64 ... -device vfio-pci,host=0000:21:00.1
> 
> right?

Yes, and the device needs to be bound to the vfio_pci driver in the host
rather than pci-stub (and you may or may not need to care about IOMMU
groups[1]).  Thanks,

Alex

[1] http://vfio.blogspot.com/2014/08/iommu-groups-inside-and-out.html

> On Thu, Sep 10, 2015 at 11:08 PM, Alex Williamson
> <alex.williamson@redhat.com> wrote:
> > On Thu, 2015-09-10 at 18:22 +0800, Nan Xiao wrote:
> >> Hi all,
> >>
> >> When building kernel, it prompts "CONFIG_KVM_DEVICE_ASSIGNMENT" is "deprecated".
> >> But it is still used in kernel code. E.g.:
> >> "kvm_vm_ioctl_check_extension" function:
> >> {
> >>     ...
> >> #ifdef CONFIG_KVM_DEVICE_ASSIGNMENT
> >> case KVM_CAP_ASSIGN_DEV_IRQ:
> >> case KVM_CAP_PCI_2_3:
> >> #endif
> >> r = 1;
> >> break;
> >>    ...
> >> #ifdef CONFIG_KVM_DEVICE_ASSIGNMENT
> >> case KVM_CAP_IOMMU:
> >> r = iommu_present(&pci_bus_type);
> >> break;
> >> #endif
> >>    ...
> >> }
> >>
> >> If not configure this option, the following code will execute failed:
> >>
> >>     ret = ioctl(dev, KVM_CHECK_EXTENSION, KVM_CAP_IOMMU);
> >>
> >> So does it mean to use KVM assigned device feature, the
> >> "CONFIG_KVM_DEVICE_ASSIGNMENT"
> >> is not "deprecated"?
> >
> > Legacy KVM device assignment is deprecated, it is fully replaced by
> > VFIO-based device assignment.  The intention is to deprecate legacy KVM
> > device assignment now, so all users can transition away from it and at
> > some point remove it from the kernel.  When using QEMU and libvirt, the
> > default is already to use VFIO instead of legacy KVM device assignment.
> > Thanks,
> >
> > Alex
> >
> >
> >
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: A question about "CONFIG_KVM_DEVICE_ASSIGNMENT" configuration
  2015-09-11  0:18     ` Alex Williamson
@ 2015-09-11  0:42       ` Nan Xiao
  0 siblings, 0 replies; 6+ messages in thread
From: Nan Xiao @ 2015-09-11  0:42 UTC (permalink / raw)
  To: Alex Williamson; +Cc: kvm

Hi Alex,

Thanks very much for your time and answer!
Best Regards
Nan Xiao


On Fri, Sep 11, 2015 at 8:18 AM, Alex Williamson
<alex.williamson@redhat.com> wrote:
> On Fri, 2015-09-11 at 07:58 +0800, Nan Xiao wrote:
>> Hi Alex,
>>
>> Thanks very much for your response! so for assigning PCI device in QEMU.
>> The following method is deprecated:
>>
>>     qemu-system-x86_64 ... -device pci-assign,host=0000:21:00.1
>>
>> I should use this one instead:
>>
>>     qemu-system-x86_64 ... -device vfio-pci,host=0000:21:00.1
>>
>> right?
>
> Yes, and the device needs to be bound to the vfio_pci driver in the host
> rather than pci-stub (and you may or may not need to care about IOMMU
> groups[1]).  Thanks,
>
> Alex
>
> [1] http://vfio.blogspot.com/2014/08/iommu-groups-inside-and-out.html
>
>> On Thu, Sep 10, 2015 at 11:08 PM, Alex Williamson
>> <alex.williamson@redhat.com> wrote:
>> > On Thu, 2015-09-10 at 18:22 +0800, Nan Xiao wrote:
>> >> Hi all,
>> >>
>> >> When building kernel, it prompts "CONFIG_KVM_DEVICE_ASSIGNMENT" is "deprecated".
>> >> But it is still used in kernel code. E.g.:
>> >> "kvm_vm_ioctl_check_extension" function:
>> >> {
>> >>     ...
>> >> #ifdef CONFIG_KVM_DEVICE_ASSIGNMENT
>> >> case KVM_CAP_ASSIGN_DEV_IRQ:
>> >> case KVM_CAP_PCI_2_3:
>> >> #endif
>> >> r = 1;
>> >> break;
>> >>    ...
>> >> #ifdef CONFIG_KVM_DEVICE_ASSIGNMENT
>> >> case KVM_CAP_IOMMU:
>> >> r = iommu_present(&pci_bus_type);
>> >> break;
>> >> #endif
>> >>    ...
>> >> }
>> >>
>> >> If not configure this option, the following code will execute failed:
>> >>
>> >>     ret = ioctl(dev, KVM_CHECK_EXTENSION, KVM_CAP_IOMMU);
>> >>
>> >> So does it mean to use KVM assigned device feature, the
>> >> "CONFIG_KVM_DEVICE_ASSIGNMENT"
>> >> is not "deprecated"?
>> >
>> > Legacy KVM device assignment is deprecated, it is fully replaced by
>> > VFIO-based device assignment.  The intention is to deprecate legacy KVM
>> > device assignment now, so all users can transition away from it and at
>> > some point remove it from the kernel.  When using QEMU and libvirt, the
>> > default is already to use VFIO instead of legacy KVM device assignment.
>> > Thanks,
>> >
>> > Alex
>> >
>> >
>> >
>> --
>> To unsubscribe from this list: send the line "unsubscribe kvm" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: A question about "CONFIG_KVM_DEVICE_ASSIGNMENT" configuration
  2015-09-10 15:08 ` Alex Williamson
  2015-09-10 23:58   ` Nan Xiao
@ 2015-09-11  0:55   ` Chen, Tiejun
  1 sibling, 0 replies; 6+ messages in thread
From: Chen, Tiejun @ 2015-09-11  0:55 UTC (permalink / raw)
  To: Alex Williamson, Nan Xiao; +Cc: kvm

On 9/10/2015 11:08 PM, Alex Williamson wrote:
> On Thu, 2015-09-10 at 18:22 +0800, Nan Xiao wrote:
>> Hi all,
>>
>> When building kernel, it prompts "CONFIG_KVM_DEVICE_ASSIGNMENT" is "deprecated".
>> But it is still used in kernel code. E.g.:
>> "kvm_vm_ioctl_check_extension" function:
>> {
>>     ...
>> #ifdef CONFIG_KVM_DEVICE_ASSIGNMENT
>> case KVM_CAP_ASSIGN_DEV_IRQ:
>> case KVM_CAP_PCI_2_3:
>> #endif
>> r = 1;
>> break;
>>    ...
>> #ifdef CONFIG_KVM_DEVICE_ASSIGNMENT
>> case KVM_CAP_IOMMU:
>> r = iommu_present(&pci_bus_type);
>> break;
>> #endif
>>    ...
>> }
>>
>> If not configure this option, the following code will execute failed:
>>
>>     ret = ioctl(dev, KVM_CHECK_EXTENSION, KVM_CAP_IOMMU);
>>
>> So does it mean to use KVM assigned device feature, the
>> "CONFIG_KVM_DEVICE_ASSIGNMENT"
>> is not "deprecated"?
>
> Legacy KVM device assignment is deprecated, it is fully replaced by

Why do we remove this legacy assignment completely? Its always leading 
to this confusion :)

Thanks
Tiejun

> VFIO-based device assignment.  The intention is to deprecate legacy KVM
> device assignment now, so all users can transition away from it and at
> some point remove it from the kernel.  When using QEMU and libvirt, the
> default is already to use VFIO instead of legacy KVM device assignment.
> Thanks,
>
> Alex

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-09-11  0:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-10 10:22 A question about "CONFIG_KVM_DEVICE_ASSIGNMENT" configuration Nan Xiao
2015-09-10 15:08 ` Alex Williamson
2015-09-10 23:58   ` Nan Xiao
2015-09-11  0:18     ` Alex Williamson
2015-09-11  0:42       ` Nan Xiao
2015-09-11  0:55   ` Chen, Tiejun

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.