[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v10 09/10] virtio-iommu: Set supported page size mask
From: |
Peter Xu |
Subject: |
Re: [PATCH v10 09/10] virtio-iommu: Set supported page size mask |
Date: |
Thu, 22 Oct 2020 16:56:16 -0400 |
On Thu, Oct 22, 2020 at 06:39:37PM +0200, Jean-Philippe Brucker wrote:
> So what I'd like to do for next version:
>
> * Set qemu_real_host_page_mask as the default page mask, instead of the
> rather arbitrary TARGET_PAGE_MASK.
Oh, I thought TARGET_PAGE_MASK was intended - kernel committ 39b3b3c9cac1
("iommu/virtio: Reject IOMMU page granule larger than PAGE_SIZE", 2020-03-27)
explicitly introduced a check that virtio-iommu kernel driver will fail
directly if this psize is bigger than PAGE_SIZE in the guest. So it sounds
reasonable to have the default value as PAGE_SIZE (if it's the same as
TARGET_PAGE_SIZE in QEMU, which seems true?).
For example, I'm thinking whether qemu_real_host_page_mask could be bigger than
PAGE_SIZE in the guest in some environments, then it seems virtio-iommu won't
boot anymore without assigned devices, because that extra check above will
always fail.
> Otherwise we cannot hotplug assigned
> devices on a 64kB host, since TARGET_PAGE_MASK is pretty much always
> 4kB.
>
> * Disallow changing the page size. It's simpler and works in
> practice if we default to qemu_real_host_page_mask.
>
> * For non-hotplug devices, allow changing the rest of the mask. For
> hotplug devices, only warn about it.
Could I ask what's "the rest of the mask"? On the driver side, I see that
viommu_domain_finalise() will pick the largest supported page size to use, if
so then we seem to be quite restricted on what page size we can use.
I'm also a bit curious about what scenario we plan to support in this initial
version, especially for ARM. For x86, I think it's probably always 4k
everywhere so it's fairly simple. Know little on ARM side...
Thanks,
--
Peter Xu
- Re: [PATCH v10 06/10] virtio-iommu: Add notify_flag_changed() memory region callback, (continued)
- [PATCH v10 07/10] memory: Add interface to set iommu page size mask, Jean-Philippe Brucker, 2020/10/08
- [PATCH v10 09/10] virtio-iommu: Set supported page size mask, Jean-Philippe Brucker, 2020/10/08
- Re: [PATCH v10 09/10] virtio-iommu: Set supported page size mask, Auger Eric, 2020/10/16
- Re: [PATCH v10 09/10] virtio-iommu: Set supported page size mask, Peter Xu, 2020/10/19
- Re: [PATCH v10 09/10] virtio-iommu: Set supported page size mask, Jean-Philippe Brucker, 2020/10/22
- Re: [PATCH v10 09/10] virtio-iommu: Set supported page size mask,
Peter Xu <=
- Re: [PATCH v10 09/10] virtio-iommu: Set supported page size mask, Jean-Philippe Brucker, 2020/10/23
- Re: [PATCH v10 09/10] virtio-iommu: Set supported page size mask, Peter Xu, 2020/10/23
- Re: [PATCH v10 09/10] virtio-iommu: Set supported page size mask, Jean-Philippe Brucker, 2020/10/27
- Re: [PATCH v10 09/10] virtio-iommu: Set supported page size mask, Michael S. Tsirkin, 2020/10/30
[PATCH v10 08/10] vfio: Set IOMMU page size as per host supported page size, Jean-Philippe Brucker, 2020/10/08
Re: [PATCH v10 08/10] vfio: Set IOMMU page size as per host supported page size, Auger Eric, 2020/10/16
[PATCH v10 10/10] vfio: Don't issue full 2^64 unmap, Jean-Philippe Brucker, 2020/10/08