[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/2] virtio-iommu: Rework the trace in virtio_iommu_set_page_size
From: |
Eric Auger |
Subject: |
[PATCH 2/2] virtio-iommu: Rework the trace in virtio_iommu_set_page_size_mask() |
Date: |
Tue, 4 Jul 2023 13:15:27 +0200 |
The current error messages in virtio_iommu_set_page_size_mask()
sound quite similar for different situations and miss the IOMMU
memory region that causes the issue.
Clarify them and rework the comment.
Also remove the trace when the new page_size_mask is not applied as
the current frozen granule is kept. This message is rather confusing
for the end user and anyway the current granule would have been used
by the driver
Signed-off-by: Eric Auger <eric.auger@redhat.com>
---
hw/virtio/virtio-iommu.c | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/hw/virtio/virtio-iommu.c b/hw/virtio/virtio-iommu.c
index 1eaf81bab5..0d9f7196fe 100644
--- a/hw/virtio/virtio-iommu.c
+++ b/hw/virtio/virtio-iommu.c
@@ -1101,29 +1101,24 @@ static int
virtio_iommu_set_page_size_mask(IOMMUMemoryRegion *mr,
new_mask);
if ((cur_mask & new_mask) == 0) {
- error_setg(errp, "virtio-iommu page mask 0x%"PRIx64
- " is incompatible with mask 0x%"PRIx64, cur_mask, new_mask);
+ error_setg(errp, "virtio-iommu %s reports a page size mask 0x%"PRIx64
+ " incompatible with currently supported mask 0x%"PRIx64,
+ mr->parent_obj.name, new_mask, cur_mask);
return -1;
}
/*
* Once the granule is frozen we can't change the mask anymore. If by
* chance the hotplugged device supports the same granule, we can still
- * accept it. Having a different masks is possible but the guest will use
- * sub-optimal block sizes, so warn about it.
+ * accept it.
*/
if (s->granule_frozen) {
- int new_granule = ctz64(new_mask);
int cur_granule = ctz64(cur_mask);
- if (new_granule != cur_granule) {
- error_setg(errp, "virtio-iommu page mask 0x%"PRIx64
- " is incompatible with mask 0x%"PRIx64, cur_mask,
- new_mask);
+ if (!(BIT(cur_granule) & new_mask)) {
+ error_setg(errp, "virtio-iommu %s does not support frozen granule
0x%"PRIx64,
+ mr->parent_obj.name, BIT(cur_granule));
return -1;
- } else if (new_mask != cur_mask) {
- warn_report("virtio-iommu page mask 0x%"PRIx64
- " does not match 0x%"PRIx64, cur_mask, new_mask);
}
return 0;
}
--
2.38.1
- [PATCH 0/2] VIRTIO-IOMMU/VFIO page size related fixes, Eric Auger, 2023/07/04
- [PATCH 1/2] virtio-iommu: Fix 64kB host page size VFIO device assignment, Eric Auger, 2023/07/04
- RE: [PATCH 1/2] virtio-iommu: Fix 64kB host page size VFIO device assignment, Duan, Zhenzhong, 2023/07/05
- Re: [PATCH 1/2] virtio-iommu: Fix 64kB host page size VFIO device assignment, Jean-Philippe Brucker, 2023/07/05
- RE: [PATCH 1/2] virtio-iommu: Fix 64kB host page size VFIO device assignment, Duan, Zhenzhong, 2023/07/05
- Re: [PATCH 1/2] virtio-iommu: Fix 64kB host page size VFIO device assignment, Jean-Philippe Brucker, 2023/07/05
- RE: [PATCH 1/2] virtio-iommu: Fix 64kB host page size VFIO device assignment, Duan, Zhenzhong, 2023/07/06
[PATCH 2/2] virtio-iommu: Rework the trace in virtio_iommu_set_page_size_mask(),
Eric Auger <=
- RE: [PATCH 2/2] virtio-iommu: Rework the trace in virtio_iommu_set_page_size_mask(), Duan, Zhenzhong, 2023/07/05
- RE: [PATCH 2/2] virtio-iommu: Rework the trace in virtio_iommu_set_page_size_mask(), Duan, Zhenzhong, 2023/07/05
- Re: [PATCH 2/2] virtio-iommu: Rework the trace in virtio_iommu_set_page_size_mask(), Eric Auger, 2023/07/05
- RE: [PATCH 2/2] virtio-iommu: Rework the trace in virtio_iommu_set_page_size_mask(), Duan, Zhenzhong, 2023/07/06
- Re: [PATCH 2/2] virtio-iommu: Rework the trace in virtio_iommu_set_page_size_mask(), Jean-Philippe Brucker, 2023/07/06
- Re: [PATCH 2/2] virtio-iommu: Rework the trace in virtio_iommu_set_page_size_mask(), Eric Auger, 2023/07/06
- RE: [PATCH 2/2] virtio-iommu: Rework the trace in virtio_iommu_set_page_size_mask(), Duan, Zhenzhong, 2023/07/06
- Re: [PATCH 2/2] virtio-iommu: Rework the trace in virtio_iommu_set_page_size_mask(), Michael S. Tsirkin, 2023/07/06