[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for 2.8 06/11] intel_iommu: support device iotlb
From: |
Peter Xu |
Subject: |
Re: [Qemu-devel] [PATCH for 2.8 06/11] intel_iommu: support device iotlb descriptor |
Date: |
Tue, 30 Aug 2016 21:16:11 +0800 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
On Tue, Aug 30, 2016 at 11:06:54AM +0800, Jason Wang wrote:
> This patch enables device IOTLB support for intel iommu. The major
> work is to implement QI device IOTLB descriptor processing and notify
> the device through iommu notifier.
IMHO it'll be nicer if we can mention the new bit in the commit
message, like:
One new property "device-iotlb" is introduced to enable device
IOTLB capability for VT-d IOMMU device. By default, it is turned
off. To enable it:
-device intel-iommu,device-iotlb=on
[...]
> +static bool vtd_process_device_iotlb_desc(IntelIOMMUState *s,
> + VTDInvDesc *inv_desc)
> +{
[...]
> + entry.target_as = &vtd_dev_as->as;
> + entry.addr_mask = sz - 1;
> + entry.iova = addr;
Do we need to setup translated_addr and perm fields as well?
[...]
> diff --git a/hw/i386/x86-iommu.c b/hw/i386/x86-iommu.c
> index ce26b2a..a70a363 100644
> --- a/hw/i386/x86-iommu.c
> +++ b/hw/i386/x86-iommu.c
> @@ -100,6 +100,18 @@ static void x86_iommu_intremap_prop_set(Object *o, bool
> value, Error **errp)
> s->intr_supported = value;
> }
>
> +static bool x86_iommu_device_iotlb_prop_get(Object *o, Error **errp)
> +{
> + X86IOMMUState *s = X86_IOMMU_DEVICE(o);
> + return s->dt_supported;
> +}
> +
> +static void x86_iommu_device_iotlb_prop_set(Object *o, bool value, Error
> **errp)
> +{
> + X86IOMMUState *s = X86_IOMMU_DEVICE(o);
> + s->dt_supported = value;
> +}
> +
> static void x86_iommu_instance_init(Object *o)
> {
> X86IOMMUState *s = X86_IOMMU_DEVICE(o);
> @@ -108,6 +120,11 @@ static void x86_iommu_instance_init(Object *o)
> s->intr_supported = false;
> object_property_add_bool(o, "intremap", x86_iommu_intremap_prop_get,
> x86_iommu_intremap_prop_set, NULL);
> + s->dt_supported = false;
> + object_property_add_bool(o, "device_iotlb",
> + x86_iommu_device_iotlb_prop_get,
> + x86_iommu_device_iotlb_prop_set,
> + NULL);
Nit 1: use "device-iotlb" instead of "device_iotlb"?
Nit 2: use Property bit (like vtd_properties)?
Thanks,
-- peterx
- Re: [Qemu-devel] [PATCH for 2.8 02/11] virtio: convert to use DMA api, (continued)
- Re: [Qemu-devel] [PATCH for 2.8 02/11] virtio: convert to use DMA api, Michael S. Tsirkin, 2016/08/30
- Re: [Qemu-devel] [PATCH for 2.8 02/11] virtio: convert to use DMA api, Michael S. Tsirkin, 2016/08/30
- [Qemu-devel] qom and debug (was: [PATCH for 2.8 02/11] virtio: convert to use DMA api), Cornelia Huck, 2016/08/30
- Re: [Qemu-devel] qom and debug (was: [PATCH for 2.8 02/11] virtio: convert to use DMA api), Michael S. Tsirkin, 2016/08/30
- Re: [Qemu-devel] qom and debug, Cornelia Huck, 2016/08/30
- Re: [Qemu-devel] qom and debug, Michael S. Tsirkin, 2016/08/30
- Re: [Qemu-devel] [PATCH for 2.8 02/11] virtio: convert to use DMA api, Jason Wang, 2016/08/30
[Qemu-devel] [PATCH for 2.8 04/11] intel_iommu: allocate new key when creating new address space, Jason Wang, 2016/08/29
[Qemu-devel] [PATCH for 2.8 05/11] exec: introduce address_space_get_iotlb_entry(), Jason Wang, 2016/08/29
[Qemu-devel] [PATCH for 2.8 06/11] intel_iommu: support device iotlb descriptor, Jason Wang, 2016/08/29
- Re: [Qemu-devel] [PATCH for 2.8 06/11] intel_iommu: support device iotlb descriptor,
Peter Xu <=
[Qemu-devel] [PATCH for 2.8 07/11] virtio-pci: address space translation service (ATS) support, Jason Wang, 2016/08/29
[Qemu-devel] [PATCH for 2.8 09/11] memory: handle alias for iommu notifier, Jason Wang, 2016/08/29
[Qemu-devel] [PATCH for 2.8 08/11] acpi: add ATSR for q35, Jason Wang, 2016/08/29
[Qemu-devel] [PATCH for 2.8 10/11] Revert "intel_iommu: Throw hw_error on notify_started", Jason Wang, 2016/08/29