@samitouri / QOSamiQemu / commits / c935db70ee

hw/i386/iommu: Remove IntelIOMMUState::dma_drain field

The IntelIOMMUState::dma_drain boolean was only set in the pc_compat_3_1[] array, via the 'dma-drain=off' property. We removed all machines using that array, lets remove that property and all the code around it. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20260307152635.83893-7-philmd@linaro.org>

Philippe Mathieu-Daudé committed Apr 29, 2025 at 17:50 UTC c935db70ee6077e72b3d3d45a0449897019fa70e
2 files changed +1 -11
hw/i386/intel_iommu.c
+1 -10
@@ -4205,7 +4205,6 @@ static const Property vtd_properties[] = {
4205 DEFINE_PROP_BOOL("snoop-control", IntelIOMMUState, snoop_control, false),
4206 DEFINE_PROP_BOOL("x-pasid-mode", IntelIOMMUState, pasid, false),
4207 DEFINE_PROP_BOOL("svm", IntelIOMMUState, svm, false),
4208 - DEFINE_PROP_BOOL("dma-drain", IntelIOMMUState, dma_drain, true),
4208 DEFINE_PROP_BOOL("stale-tm", IntelIOMMUState, stale_tm, false),
4209 DEFINE_PROP_BOOL("fs1gp", IntelIOMMUState, fs1gp, true),
4210 };
@@ -5000,11 +4999,8 @@ static void vtd_cap_init(IntelIOMMUState *s)
4999 X86IOMMUState *x86_iommu = X86_IOMMU_DEVICE(s);
5000
5001 s->cap = VTD_CAP_FRO | VTD_CAP_NFR | VTD_CAP_ND | VTD_ECAP_PT |
5003 - VTD_CAP_MAMV | VTD_CAP_PSI | VTD_CAP_SSLPS |
5002 + VTD_CAP_MAMV | VTD_CAP_PSI | VTD_CAP_SSLPS | VTD_CAP_DRAIN |
5003 VTD_CAP_ESRTPS | VTD_CAP_MGAW(s->aw_bits);
5005 - if (s->dma_drain) {
5006 - s->cap |= VTD_CAP_DRAIN;
5007 - }
5004 if (x86_iommu->dma_translation) {
5005 if (s->aw_bits >= VTD_HOST_AW_39BIT) {
5006 s->cap |= VTD_CAP_SAGAW_39bit;
@@ -5582,11 +5578,6 @@ static bool vtd_decide_config(IntelIOMMUState *s, Error **errp)
5578 return false;
5579 }
5580
5585 - if (s->scalable_mode && !s->dma_drain) {
5586 - error_setg(errp, "Need to set dma_drain for scalable mode");
5587 - return false;
5588 - }
5589 -
5581 if (s->pasid && !s->scalable_mode) {
5582 error_setg(errp, "Need to set scalable mode for PASID");
5583 return false;
include/hw/i386/intel_iommu.h
-1
@@ -314,7 +314,6 @@ struct IntelIOMMUState {
314 bool intr_eime; /* Extended interrupt mode enabled */
315 OnOffAuto intr_eim; /* Toggle for EIM cabability */
316 uint8_t aw_bits; /* Host/IOVA address width (in bits) */
317 - bool dma_drain; /* Whether DMA r/w draining enabled */
317 bool pasid; /* Whether to support PASID */
318 bool fs1gp; /* First Stage 1-GByte Page Support */
319