Skip to contentSkip to conversation

intel_iommu: Use the latest fault reasons defined by spec

PATCH In review Zhenzhong Duan 5 participants 25 messages May 17, 2024 – Jul 17, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 intel_iommu: Use the latest fault reasons defined by spec

From: Yu Zhang <[email protected]>

Currently we use only VTD_FR_PASID_TABLE_INV as fault reason. Update with more detailed fault reasons listed in VT-d spec 7.2.3.

---
 hw/i386/intel_iommu_internal.h |  8 +++++++-
 hw/i386/intel_iommu.c          | 25 ++++++++++++++++---------
 2 files changed, 23 insertions(+), 10 deletions(-)
hw/i386/intel_iommu_internal.h +7 -1
index f8cf99bddf..666e2cf2ce 100644
@@ -311,7 +311,13 @@ typedef enum VTDFaultReason {
                                   * request while disabled */
     VTD_FR_IR_SID_ERR = 0x26,   /* Invalid Source-ID */
 
-    VTD_FR_PASID_TABLE_INV = 0x58,  /*Invalid PASID table entry */
+    /* PASID directory entry access failure */
+    VTD_FR_PASID_DIR_ACCESS_ERR = 0x50,
+    /* The Present(P) field of pasid directory entry is 0 */
+    VTD_FR_PASID_DIR_ENTRY_P = 0x51,
+    VTD_FR_PASID_TABLE_ACCESS_ERR = 0x58, /* PASID table entry access failure */
+    VTD_FR_PASID_ENTRY_P = 0x59, /* The Present(P) field of pasidt-entry is 0 */
+    VTD_FR_PASID_TABLE_ENTRY_INV = 0x5b,  /*Invalid PASID table entry */
 
     /* Output address in the interrupt address range for scalable mode */
     VTD_FR_SM_INTERRUPT_ADDR = 0x87,
hw/i386/intel_iommu.c +16 -9
index cc8e59674e..0951ebb71d 100644
@@ -771,7 +771,7 @@ static int vtd_get_pdire_from_pdir_table(dma_addr_t pasid_dir_base,
     addr = pasid_dir_base + index * entry_size;
     if (dma_memory_read(&address_space_memory, addr,
                         pdire, entry_size, MEMTXATTRS_UNSPECIFIED)) {
-        return -VTD_FR_PASID_TABLE_INV;
+        return -VTD_FR_PASID_DIR_ACCESS_ERR;
     }
 
     pdire->val = le64_to_cpu(pdire->val);
@@ -789,6 +789,7 @@ static int vtd_get_pe_in_pasid_leaf_table(IntelIOMMUState *s,
                                           dma_addr_t addr,
                                           VTDPASIDEntry *pe)
 {
+    uint8_t pgtt;
     uint32_t index;
     dma_addr_t entry_size;
     X86IOMMUState *x86_iommu = X86_IOMMU_DEVICE(s);
@@ -798,7 +799,7 @@ static int vtd_get_pe_in_pasid_leaf_table(IntelIOMMUState *s,
     addr = addr + index * entry_size;
     if (dma_memory_read(&address_space_memory, addr,
                         pe, entry_size, MEMTXATTRS_UNSPECIFIED)) {
-        return -VTD_FR_PASID_TABLE_INV;
+        return -VTD_FR_PASID_TABLE_ACCESS_ERR;
     }
     for (size_t i = 0; i < ARRAY_SIZE(pe->val); i++) {
         pe->val[i] = le64_to_cpu(pe->val[i]);
@@ -806,11 +807,13 @@ static int vtd_get_pe_in_pasid_leaf_table(IntelIOMMUState *s,
 
     /* Do translation type check */
     if (!vtd_pe_type_check(x86_iommu, pe)) {
-        return -VTD_FR_PASID_TABLE_INV;
+        return -VTD_FR_PASID_TABLE_ENTRY_INV;
     }
 
-    if (!vtd_is_level_supported(s, VTD_PE_GET_LEVEL(pe))) {
-        return -VTD_FR_PASID_TABLE_INV;
+    pgtt = VTD_PE_GET_TYPE(pe);
+    if (pgtt == VTD_SM_PASID_ENTRY_SLT &&
+        !vtd_is_level_supported(s, VTD_PE_GET_LEVEL(pe))) {
+            return -VTD_FR_PASID_TABLE_ENTRY_INV;
     }
 
     return 0;
@@ -851,7 +854,7 @@ static int vtd_get_pe_from_pasid_table(IntelIOMMUState *s,
     }
 
     if (!vtd_pdire_present(&pdire)) {
-        return -VTD_FR_PASID_TABLE_INV;
+        return -VTD_FR_PASID_DIR_ENTRY_P;
     }
 
     ret = vtd_get_pe_from_pdire(s, pasid, &pdire, pe);
@@ -860,7 +863,7 @@ static int vtd_get_pe_from_pasid_table(IntelIOMMUState *s,
     }
 
     if (!vtd_pe_present(pe)) {
-        return -VTD_FR_PASID_TABLE_INV;
+        return -VTD_FR_PASID_ENTRY_P;
     }
 
     return 0;
@@ -913,7 +916,7 @@ static int vtd_ce_get_pasid_fpd(IntelIOMMUState *s,
     }
 
     if (!vtd_pdire_present(&pdire)) {
-        return -VTD_FR_PASID_TABLE_INV;
+        return -VTD_FR_PASID_DIR_ENTRY_P;
     }
 
     /*
@@ -1770,7 +1773,11 @@ static const bool vtd_qualified_faults[] = {
     [VTD_FR_ROOT_ENTRY_RSVD] = false,
     [VTD_FR_PAGING_ENTRY_RSVD] = true,
     [VTD_FR_CONTEXT_ENTRY_TT] = true,
-    [VTD_FR_PASID_TABLE_INV] = false,
+    [VTD_FR_PASID_DIR_ACCESS_ERR] = false,
+    [VTD_FR_PASID_DIR_ENTRY_P] = true,
+    [VTD_FR_PASID_TABLE_ACCESS_ERR] = false,
+    [VTD_FR_PASID_ENTRY_P] = true,
+    [VTD_FR_PASID_TABLE_ENTRY_INV] = true,
     [VTD_FR_SM_INTERRUPT_ADDR] = true,
     [VTD_FR_MAX] = false,
 };
Signature · 1 line
2.34.1
#1 lore raw

Hi Zhenzhong

Quoted 20 lines · Zhenzhong Duan

Caution: External email. Do not open attachments or click links, unless this email comes from a known sender and you know the content is safe.

From: Yu Zhang <[email protected]>

Currently we use only VTD_FR_PASID_TABLE_INV as fault reason. Update with more detailed fault reasons listed in VT-d spec 7.2.3.

---
  hw/i386/intel_iommu_internal.h |  8 +++++++-
  hw/i386/intel_iommu.c          | 25 ++++++++++++++++---------
  2 files changed, 23 insertions(+), 10 deletions(-)
hw/i386/intel_iommu_internal.h +0 -0
index f8cf99bddf..666e2cf2ce 100644

hw/i386/intel_iommu_internal.h typedef enum VTDFaultReason { · line 319

Quoted 10 lines
hw/i386/intel_iommu_internal.h +6 -1
@@ -311,7 +311,13 @@ typedef enum VTDFaultReason {
                                    * request while disabled */
      VTD_FR_IR_SID_ERR = 0x26,   /* Invalid Source-ID */
 
-    VTD_FR_PASID_TABLE_INV = 0x58,  /*Invalid PASID table entry */
+    /* PASID directory entry access failure */
+    VTD_FR_PASID_DIR_ACCESS_ERR = 0x50,
+    /* The Present(P) field of pasid directory entry is 0 */
+    VTD_FR_PASID_DIR_ENTRY_P = 0x51,
+    VTD_FR_PASID_TABLE_ACCESS_ERR = 0x58, /* PASID table entry access failure */
+    VTD_FR_PASID_ENTRY_P = 0x59, /* The Present(P) field of pasidt-entry is 0 */

s/pasidt/pasid

Quoted 92 lines
hw/i386/intel_iommu_internal.h +1 -0
+    VTD_FR_PASID_TABLE_ENTRY_INV = 0x5b,  /*Invalid PASID table entry */
 
      /* Output address in the interrupt address range for scalable mode */
      VTD_FR_SM_INTERRUPT_ADDR = 0x87,
hw/i386/intel_iommu.c +16 -10
index cc8e59674e..0951ebb71d 100644
@@ -771,7 +771,7 @@ static int vtd_get_pdire_from_pdir_table(dma_addr_t pasid_dir_base,
      addr = pasid_dir_base + index * entry_size;
      if (dma_memory_read(&address_space_memory, addr,
                          pdire, entry_size, MEMTXATTRS_UNSPECIFIED)) {
-        return -VTD_FR_PASID_TABLE_INV;
+        return -VTD_FR_PASID_DIR_ACCESS_ERR;
      }
 
      pdire->val = le64_to_cpu(pdire->val);
@@ -789,6 +789,7 @@ static int vtd_get_pe_in_pasid_leaf_table(IntelIOMMUState *s,
                                            dma_addr_t addr,
                                            VTDPASIDEntry *pe)
  {
+    uint8_t pgtt;
      uint32_t index;
      dma_addr_t entry_size;
      X86IOMMUState *x86_iommu = X86_IOMMU_DEVICE(s);
@@ -798,7 +799,7 @@ static int vtd_get_pe_in_pasid_leaf_table(IntelIOMMUState *s,
      addr = addr + index * entry_size;
      if (dma_memory_read(&address_space_memory, addr,
                          pe, entry_size, MEMTXATTRS_UNSPECIFIED)) {
-        return -VTD_FR_PASID_TABLE_INV;
+        return -VTD_FR_PASID_TABLE_ACCESS_ERR;
      }
      for (size_t i = 0; i < ARRAY_SIZE(pe->val); i++) {
          pe->val[i] = le64_to_cpu(pe->val[i]);
@@ -806,11 +807,13 @@ static int vtd_get_pe_in_pasid_leaf_table(IntelIOMMUState *s,
 
      /* Do translation type check */
      if (!vtd_pe_type_check(x86_iommu, pe)) {
-        return -VTD_FR_PASID_TABLE_INV;
+        return -VTD_FR_PASID_TABLE_ENTRY_INV;
      }
 
-    if (!vtd_is_level_supported(s, VTD_PE_GET_LEVEL(pe))) {
-        return -VTD_FR_PASID_TABLE_INV;
+    pgtt = VTD_PE_GET_TYPE(pe);
+    if (pgtt == VTD_SM_PASID_ENTRY_SLT &&
+        !vtd_is_level_supported(s, VTD_PE_GET_LEVEL(pe))) {
+            return -VTD_FR_PASID_TABLE_ENTRY_INV;
      }
 
      return 0;
@@ -851,7 +854,7 @@ static int vtd_get_pe_from_pasid_table(IntelIOMMUState *s,
      }
 
      if (!vtd_pdire_present(&pdire)) {
-        return -VTD_FR_PASID_TABLE_INV;
+        return -VTD_FR_PASID_DIR_ENTRY_P;
      }
 
      ret = vtd_get_pe_from_pdire(s, pasid, &pdire, pe);
@@ -860,7 +863,7 @@ static int vtd_get_pe_from_pasid_table(IntelIOMMUState *s,
      }
 
      if (!vtd_pe_present(pe)) {
-        return -VTD_FR_PASID_TABLE_INV;
+        return -VTD_FR_PASID_ENTRY_P;
      }
 
      return 0;
@@ -913,7 +916,7 @@ static int vtd_ce_get_pasid_fpd(IntelIOMMUState *s,
      }
 
      if (!vtd_pdire_present(&pdire)) {
-        return -VTD_FR_PASID_TABLE_INV;
+        return -VTD_FR_PASID_DIR_ENTRY_P;
      }
 
      /*
@@ -1770,7 +1773,11 @@ static const bool vtd_qualified_faults[] = {
      [VTD_FR_ROOT_ENTRY_RSVD] = false,
      [VTD_FR_PAGING_ENTRY_RSVD] = true,
      [VTD_FR_CONTEXT_ENTRY_TT] = true,
-    [VTD_FR_PASID_TABLE_INV] = false,
+    [VTD_FR_PASID_DIR_ACCESS_ERR] = false,
+    [VTD_FR_PASID_DIR_ENTRY_P] = true,
+    [VTD_FR_PASID_TABLE_ACCESS_ERR] = false,
+    [VTD_FR_PASID_ENTRY_P] = true,
+    [VTD_FR_PASID_TABLE_ENTRY_INV] = true,
      [VTD_FR_SM_INTERRUPT_ADDR] = true,
      [VTD_FR_MAX] = false,
  };
--
Quoted 3 lines

2.34.1

lgtm

#2 lore raw
Quoted 30 lines

From: CLEMENT MATHIEU--DRIF <[email protected]>
Sent: Friday, May 17, 2024 9:13 PM

Hi Zhenzhong

Quoted 1 line · Zhenzhong Duan

Caution: External email. Do not open attachments or click links, unless this email

comes from a known sender and you know the content is safe.

Quoted 22 lines

From: Yu Zhang <[email protected]>

Currently we use only VTD_FR_PASID_TABLE_INV as fault reason. Update with more detailed fault reasons listed in VT-d spec 7.2.3.

---
  hw/i386/intel_iommu_internal.h |  8 +++++++-
  hw/i386/intel_iommu.c          | 25 ++++++++++++++++---------
  2 files changed, 23 insertions(+), 10 deletions(-)
hw/i386/intel_iommu_internal.h +0 -0
index f8cf99bddf..666e2cf2ce 100644
@@ -311,7 +311,13 @@ typedef enum VTDFaultReason {
                                    * request while disabled */
      VTD_FR_IR_SID_ERR = 0x26,   /* Invalid Source-ID */
 
Quoted 8 lines

hw/i386/intel_iommu_internal.h typedef enum VTDFaultReason { · line 319

Quoted 7 lines
hw/i386/intel_iommu_internal.h +6 -1
-    VTD_FR_PASID_TABLE_INV = 0x58,  /*Invalid PASID table entry */
+    /* PASID directory entry access failure */
+    VTD_FR_PASID_DIR_ACCESS_ERR = 0x50,
+    /* The Present(P) field of pasid directory entry is 0 */
+    VTD_FR_PASID_DIR_ENTRY_P = 0x51,
+    VTD_FR_PASID_TABLE_ACCESS_ERR = 0x58, /* PASID table entry access failure */
+    VTD_FR_PASID_ENTRY_P = 0x59, /* The Present(P) field of pasidt-entry is 0 */

s/pasidt/pasid

Per spec, it is pasid table entry. So Zhenzhong may need to use the same word With the line below. E.g. PASID Table entry.

Regards,
Yi Liu

Quoted 100 lines

hw/i386/intel_iommu.c static int vtd_get_pdire_from_pdir_table(dma_addr_t

Quoted 9 lines
hw/i386/intel_iommu_internal.h +1 -0
+    VTD_FR_PASID_TABLE_ENTRY_INV = 0x5b,  /*Invalid PASID table entry */
 
      /* Output address in the interrupt address range for scalable mode */
      VTD_FR_SM_INTERRUPT_ADDR = 0x87,
hw/i386/intel_iommu.c +0 -0
index cc8e59674e..0951ebb71d 100644
@@ -771,7 +771,7 @@ static int vtd_get_pdire_from_pdir_table(dma_addr_t

pasid_dir_base,

hw/i386/intel_iommu.c static int vtd_get_pe_in_pasid_leaf_table(IntelIOMMUState

Quoted 9 lines
hw/i386/intel_iommu.c +1 -1
      addr = pasid_dir_base + index * entry_size;
      if (dma_memory_read(&address_space_memory, addr,
                          pdire, entry_size, MEMTXATTRS_UNSPECIFIED)) {
-        return -VTD_FR_PASID_TABLE_INV;
+        return -VTD_FR_PASID_DIR_ACCESS_ERR;
      }
 
      pdire->val = le64_to_cpu(pdire->val);
@@ -789,6 +789,7 @@ static int vtd_get_pe_in_pasid_leaf_table(IntelIOMMUState

*s,

hw/i386/intel_iommu.c static int vtd_get_pe_in_pasid_leaf_table(IntelIOMMUState

Quoted 8 lines
hw/i386/intel_iommu.c +1 -0
                                            dma_addr_t addr,
                                            VTDPASIDEntry *pe)
  {
+    uint8_t pgtt;
      uint32_t index;
      dma_addr_t entry_size;
      X86IOMMUState *x86_iommu = X86_IOMMU_DEVICE(s);
@@ -798,7 +799,7 @@ static int vtd_get_pe_in_pasid_leaf_table(IntelIOMMUState

*s,

hw/i386/intel_iommu.c static int vtd_get_pe_in_pasid_leaf_table(IntelIOMMUState

Quoted 9 lines
hw/i386/intel_iommu.c +1 -1
      addr = addr + index * entry_size;
      if (dma_memory_read(&address_space_memory, addr,
                          pe, entry_size, MEMTXATTRS_UNSPECIFIED)) {
-        return -VTD_FR_PASID_TABLE_INV;
+        return -VTD_FR_PASID_TABLE_ACCESS_ERR;
      }
      for (size_t i = 0; i < ARRAY_SIZE(pe->val); i++) {
          pe->val[i] = le64_to_cpu(pe->val[i]);
@@ -806,11 +807,13 @@ static int vtd_get_pe_in_pasid_leaf_table(IntelIOMMUState

*s,

Quoted 57 lines
hw/i386/intel_iommu.c +13 -8
      /* Do translation type check */
      if (!vtd_pe_type_check(x86_iommu, pe)) {
-        return -VTD_FR_PASID_TABLE_INV;
+        return -VTD_FR_PASID_TABLE_ENTRY_INV;
      }
 
-    if (!vtd_is_level_supported(s, VTD_PE_GET_LEVEL(pe))) {
-        return -VTD_FR_PASID_TABLE_INV;
+    pgtt = VTD_PE_GET_TYPE(pe);
+    if (pgtt == VTD_SM_PASID_ENTRY_SLT &&
+        !vtd_is_level_supported(s, VTD_PE_GET_LEVEL(pe))) {
+            return -VTD_FR_PASID_TABLE_ENTRY_INV;
      }
 
      return 0;
@@ -851,7 +854,7 @@ static int vtd_get_pe_from_pasid_table(IntelIOMMUState *s,
      }
 
      if (!vtd_pdire_present(&pdire)) {
-        return -VTD_FR_PASID_TABLE_INV;
+        return -VTD_FR_PASID_DIR_ENTRY_P;
      }
 
      ret = vtd_get_pe_from_pdire(s, pasid, &pdire, pe);
@@ -860,7 +863,7 @@ static int vtd_get_pe_from_pasid_table(IntelIOMMUState *s,
      }
 
      if (!vtd_pe_present(pe)) {
-        return -VTD_FR_PASID_TABLE_INV;
+        return -VTD_FR_PASID_ENTRY_P;
      }
 
      return 0;
@@ -913,7 +916,7 @@ static int vtd_ce_get_pasid_fpd(IntelIOMMUState *s,
      }
 
      if (!vtd_pdire_present(&pdire)) {
-        return -VTD_FR_PASID_TABLE_INV;
+        return -VTD_FR_PASID_DIR_ENTRY_P;
      }
 
      /*
@@ -1770,7 +1773,11 @@ static const bool vtd_qualified_faults[] = {
      [VTD_FR_ROOT_ENTRY_RSVD] = false,
      [VTD_FR_PAGING_ENTRY_RSVD] = true,
      [VTD_FR_CONTEXT_ENTRY_TT] = true,
-    [VTD_FR_PASID_TABLE_INV] = false,
+    [VTD_FR_PASID_DIR_ACCESS_ERR] = false,
+    [VTD_FR_PASID_DIR_ENTRY_P] = true,
+    [VTD_FR_PASID_TABLE_ACCESS_ERR] = false,
+    [VTD_FR_PASID_ENTRY_P] = true,
+    [VTD_FR_PASID_TABLE_ENTRY_INV] = true,
      [VTD_FR_SM_INTERRUPT_ADDR] = true,
      [VTD_FR_MAX] = false,
  };
--
Quoted 3 lines

2.34.1

lgtm

#3 lore raw
Quoted 30 lines

From: CLEMENT MATHIEU--DRIF <[email protected]>
Sent: Friday, May 17, 2024 9:13 PM

Hi Zhenzhong

Quoted 1 line · Zhenzhong Duan

Caution: External email. Do not open attachments or click links, unless this email

comes from a known sender and you know the content is safe.

Quoted 22 lines

From: Yu Zhang <[email protected]>

Currently we use only VTD_FR_PASID_TABLE_INV as fault reason. Update with more detailed fault reasons listed in VT-d spec 7.2.3.

---
  hw/i386/intel_iommu_internal.h |  8 +++++++-
  hw/i386/intel_iommu.c          | 25 ++++++++++++++++---------
  2 files changed, 23 insertions(+), 10 deletions(-)
hw/i386/intel_iommu_internal.h +0 -0
index f8cf99bddf..666e2cf2ce 100644
@@ -311,7 +311,13 @@ typedef enum VTDFaultReason {
                                    * request while disabled */
      VTD_FR_IR_SID_ERR = 0x26,   /* Invalid Source-ID */
 
Quoted 8 lines

hw/i386/intel_iommu_internal.h typedef enum VTDFaultReason { · line 319

Quoted 7 lines
hw/i386/intel_iommu_internal.h +6 -1
-    VTD_FR_PASID_TABLE_INV = 0x58,  /*Invalid PASID table entry */
+    /* PASID directory entry access failure */
+    VTD_FR_PASID_DIR_ACCESS_ERR = 0x50,
+    /* The Present(P) field of pasid directory entry is 0 */
+    VTD_FR_PASID_DIR_ENTRY_P = 0x51,
+    VTD_FR_PASID_TABLE_ACCESS_ERR = 0x58, /* PASID table entry access failure */
+    VTD_FR_PASID_ENTRY_P = 0x59, /* The Present(P) field of pasidt-entry is 0 */

s/pasidt/pasid

Per spec, it is pasid table entry. So Zhenzhong may need to use the same word With the line below. E.g. PASID Table entry.

Regards,
Yi Liu

Ok fine

regards,

Quoted 103 lines

cmd

hw/i386/intel_iommu.c static int vtd_get_pdire_from_pdir_table(dma_addr_t

Quoted 9 lines
hw/i386/intel_iommu_internal.h +1 -0
+    VTD_FR_PASID_TABLE_ENTRY_INV = 0x5b,  /*Invalid PASID table entry */
 
      /* Output address in the interrupt address range for scalable mode */
      VTD_FR_SM_INTERRUPT_ADDR = 0x87,
hw/i386/intel_iommu.c +0 -0
index cc8e59674e..0951ebb71d 100644
@@ -771,7 +771,7 @@ static int vtd_get_pdire_from_pdir_table(dma_addr_t

pasid_dir_base,

hw/i386/intel_iommu.c static int vtd_get_pe_in_pasid_leaf_table(IntelIOMMUState

Quoted 9 lines
hw/i386/intel_iommu.c +1 -1
      addr = pasid_dir_base + index * entry_size;
      if (dma_memory_read(&address_space_memory, addr,
                          pdire, entry_size, MEMTXATTRS_UNSPECIFIED)) {
-        return -VTD_FR_PASID_TABLE_INV;
+        return -VTD_FR_PASID_DIR_ACCESS_ERR;
      }
 
      pdire->val = le64_to_cpu(pdire->val);
@@ -789,6 +789,7 @@ static int vtd_get_pe_in_pasid_leaf_table(IntelIOMMUState

*s,

hw/i386/intel_iommu.c static int vtd_get_pe_in_pasid_leaf_table(IntelIOMMUState

Quoted 8 lines
hw/i386/intel_iommu.c +1 -0
                                            dma_addr_t addr,
                                            VTDPASIDEntry *pe)
  {
+    uint8_t pgtt;
      uint32_t index;
      dma_addr_t entry_size;
      X86IOMMUState *x86_iommu = X86_IOMMU_DEVICE(s);
@@ -798,7 +799,7 @@ static int vtd_get_pe_in_pasid_leaf_table(IntelIOMMUState

*s,

hw/i386/intel_iommu.c static int vtd_get_pe_in_pasid_leaf_table(IntelIOMMUState

Quoted 9 lines
hw/i386/intel_iommu.c +1 -1
      addr = addr + index * entry_size;
      if (dma_memory_read(&address_space_memory, addr,
                          pe, entry_size, MEMTXATTRS_UNSPECIFIED)) {
-        return -VTD_FR_PASID_TABLE_INV;
+        return -VTD_FR_PASID_TABLE_ACCESS_ERR;
      }
      for (size_t i = 0; i < ARRAY_SIZE(pe->val); i++) {
          pe->val[i] = le64_to_cpu(pe->val[i]);
@@ -806,11 +807,13 @@ static int vtd_get_pe_in_pasid_leaf_table(IntelIOMMUState

*s,

Quoted 57 lines
hw/i386/intel_iommu.c +13 -8
      /* Do translation type check */
      if (!vtd_pe_type_check(x86_iommu, pe)) {
-        return -VTD_FR_PASID_TABLE_INV;
+        return -VTD_FR_PASID_TABLE_ENTRY_INV;
      }
 
-    if (!vtd_is_level_supported(s, VTD_PE_GET_LEVEL(pe))) {
-        return -VTD_FR_PASID_TABLE_INV;
+    pgtt = VTD_PE_GET_TYPE(pe);
+    if (pgtt == VTD_SM_PASID_ENTRY_SLT &&
+        !vtd_is_level_supported(s, VTD_PE_GET_LEVEL(pe))) {
+            return -VTD_FR_PASID_TABLE_ENTRY_INV;
      }
 
      return 0;
@@ -851,7 +854,7 @@ static int vtd_get_pe_from_pasid_table(IntelIOMMUState *s,
      }
 
      if (!vtd_pdire_present(&pdire)) {
-        return -VTD_FR_PASID_TABLE_INV;
+        return -VTD_FR_PASID_DIR_ENTRY_P;
      }
 
      ret = vtd_get_pe_from_pdire(s, pasid, &pdire, pe);
@@ -860,7 +863,7 @@ static int vtd_get_pe_from_pasid_table(IntelIOMMUState *s,
      }
 
      if (!vtd_pe_present(pe)) {
-        return -VTD_FR_PASID_TABLE_INV;
+        return -VTD_FR_PASID_ENTRY_P;
      }
 
      return 0;
@@ -913,7 +916,7 @@ static int vtd_ce_get_pasid_fpd(IntelIOMMUState *s,
      }
 
      if (!vtd_pdire_present(&pdire)) {
-        return -VTD_FR_PASID_TABLE_INV;
+        return -VTD_FR_PASID_DIR_ENTRY_P;
      }
 
      /*
@@ -1770,7 +1773,11 @@ static const bool vtd_qualified_faults[] = {
      [VTD_FR_ROOT_ENTRY_RSVD] = false,
      [VTD_FR_PAGING_ENTRY_RSVD] = true,
      [VTD_FR_CONTEXT_ENTRY_TT] = true,
-    [VTD_FR_PASID_TABLE_INV] = false,
+    [VTD_FR_PASID_DIR_ACCESS_ERR] = false,
+    [VTD_FR_PASID_DIR_ENTRY_P] = true,
+    [VTD_FR_PASID_TABLE_ACCESS_ERR] = false,
+    [VTD_FR_PASID_ENTRY_P] = true,
+    [VTD_FR_PASID_TABLE_ENTRY_INV] = true,
      [VTD_FR_SM_INTERRUPT_ADDR] = true,
      [VTD_FR_MAX] = false,
  };
--
Quoted 3 lines

2.34.1

lgtm

#4 lore raw
In reply to Liu, Yi L
Quoted 46 lines

-----Original Message-----
From: Liu, Yi L <[email protected]>
Subject: RE: [PATCH] intel_iommu: Use the latest fault reasons defined by spec

Quoted 7 lines

From: CLEMENT MATHIEU--DRIF <[email protected]>
Sent: Friday, May 17, 2024 9:13 PM

Hi Zhenzhong

Quoted 1 line · Zhenzhong Duan

Caution: External email. Do not open attachments or click links, unless

this email

Quoted 8 lines

comes from a known sender and you know the content is safe.

Quoted 7 lines

From: Yu Zhang <[email protected]>

Currently we use only VTD_FR_PASID_TABLE_INV as fault reason. Update with more detailed fault reasons listed in VT-d spec 7.2.3.

Quoted 8 lines

Review

Quoted 8 lines
---
  hw/i386/intel_iommu_internal.h |  8 +++++++-
  hw/i386/intel_iommu.c          | 25 ++++++++++++++++---------
  2 files changed, 23 insertions(+), 10 deletions(-)
(quoted diff) +0 -0

b/hw/i386/intel_iommu_internal.h

Quoted 7 lines
Quoted 7 lines

index f8cf99bddf..666e2cf2ce 100644

hw/i386/intel_iommu_internal.h +0 -0
@@ -311,7 +311,13 @@ typedef enum VTDFaultReason {
                                    * request while disabled */
      VTD_FR_IR_SID_ERR = 0x26,   /* Invalid Source-ID */
 
Quoted 6 lines

hw/i386/intel_iommu_internal.h typedef enum VTDFaultReason {

Quoted 6 lines
hw/i386/intel_iommu_internal.h +5 -1
-    VTD_FR_PASID_TABLE_INV = 0x58,  /*Invalid PASID table entry */
+    /* PASID directory entry access failure */
+    VTD_FR_PASID_DIR_ACCESS_ERR = 0x50,
+    /* The Present(P) field of pasid directory entry is 0 */
+    VTD_FR_PASID_DIR_ENTRY_P = 0x51,
+    VTD_FR_PASID_TABLE_ACCESS_ERR = 0x58, /* PASID table entry

access failure */

Quoted 7 lines
Quoted 1 line

hw/i386/intel_iommu_internal.h typedef enum VTDFaultReason { · line 319

Quoted 1 line
hw/i386/intel_iommu_internal.h +1 -0
+    VTD_FR_PASID_ENTRY_P = 0x59, /* The Present(P) field of pasidt-

entry is 0 */

Quoted 1 line

s/pasidt/pasid

Per spec, it is pasid table entry. So Zhenzhong may need to use the same word
With the line below. E.g. PASID Table entry.

Yes, will fix.

Thanks
Zhenzhong

Quoted 113 lines

Regards,
Yi Liu

Quoted 1 line

hw/i386/intel_iommu_internal.h typedef enum VTDFaultReason { · line 320

Quoted 1 line
hw/i386/intel_iommu_internal.h +1 -0
+    VTD_FR_PASID_TABLE_ENTRY_INV = 0x5b,  /*Invalid PASID table

entry */

Quoted 2 lines

hw/i386/intel_iommu_internal.h typedef enum VTDFaultReason { · line 321

Quoted 2 lines
hw/i386/intel_iommu_internal.h +0 -0
      /* Output address in the interrupt address range for scalable mode

*/

Quoted 6 lines

hw/i386/intel_iommu.c static int

Quoted 6 lines
hw/i386/intel_iommu_internal.h +0 -0
      VTD_FR_SM_INTERRUPT_ADDR = 0x87,
hw/i386/intel_iommu.c +0 -0
index cc8e59674e..0951ebb71d 100644
@@ -771,7 +771,7 @@ static int

vtd_get_pdire_from_pdir_table(dma_addr_t

Quoted 10 lines

pasid_dir_base,

hw/i386/intel_iommu.c static int

Quoted 9 lines
hw/i386/intel_iommu.c +1 -1
      addr = pasid_dir_base + index * entry_size;
      if (dma_memory_read(&address_space_memory, addr,
                          pdire, entry_size, MEMTXATTRS_UNSPECIFIED)) {
-        return -VTD_FR_PASID_TABLE_INV;
+        return -VTD_FR_PASID_DIR_ACCESS_ERR;
      }
 
      pdire->val = le64_to_cpu(pdire->val);
@@ -789,6 +789,7 @@ static int

vtd_get_pe_in_pasid_leaf_table(IntelIOMMUState

Quoted 9 lines

*s,

hw/i386/intel_iommu.c static int

Quoted 8 lines
hw/i386/intel_iommu.c +1 -0
                                            dma_addr_t addr,
                                            VTDPASIDEntry *pe)
  {
+    uint8_t pgtt;
      uint32_t index;
      dma_addr_t entry_size;
      X86IOMMUState *x86_iommu = X86_IOMMU_DEVICE(s);
@@ -798,7 +799,7 @@ static int

vtd_get_pe_in_pasid_leaf_table(IntelIOMMUState

Quoted 10 lines

*s,

hw/i386/intel_iommu.c static int

Quoted 9 lines
hw/i386/intel_iommu.c +1 -1
      addr = addr + index * entry_size;
      if (dma_memory_read(&address_space_memory, addr,
                          pe, entry_size, MEMTXATTRS_UNSPECIFIED)) {
-        return -VTD_FR_PASID_TABLE_INV;
+        return -VTD_FR_PASID_TABLE_ACCESS_ERR;
      }
      for (size_t i = 0; i < ARRAY_SIZE(pe->val); i++) {
          pe->val[i] = le64_to_cpu(pe->val[i]);
@@ -806,11 +807,13 @@ static int

vtd_get_pe_in_pasid_leaf_table(IntelIOMMUState

Quoted 16 lines

*s,

Quoted 15 lines
hw/i386/intel_iommu.c +5 -3
      /* Do translation type check */
      if (!vtd_pe_type_check(x86_iommu, pe)) {
-        return -VTD_FR_PASID_TABLE_INV;
+        return -VTD_FR_PASID_TABLE_ENTRY_INV;
      }
 
-    if (!vtd_is_level_supported(s, VTD_PE_GET_LEVEL(pe))) {
-        return -VTD_FR_PASID_TABLE_INV;
+    pgtt = VTD_PE_GET_TYPE(pe);
+    if (pgtt == VTD_SM_PASID_ENTRY_SLT &&
+        !vtd_is_level_supported(s, VTD_PE_GET_LEVEL(pe))) {
+            return -VTD_FR_PASID_TABLE_ENTRY_INV;
      }
 
Quoted 2 lines

hw/i386/intel_iommu.c static int

Quoted 2 lines
hw/i386/intel_iommu.c +0 -0
      return 0;
@@ -851,7 +854,7 @@ static int

vtd_get_pe_from_pasid_table(IntelIOMMUState *s,

Quoted 9 lines

hw/i386/intel_iommu.c static int

Quoted 9 lines
hw/i386/intel_iommu.c +1 -1
      }
 
      if (!vtd_pdire_present(&pdire)) {
-        return -VTD_FR_PASID_TABLE_INV;
+        return -VTD_FR_PASID_DIR_ENTRY_P;
      }
 
      ret = vtd_get_pe_from_pdire(s, pasid, &pdire, pe);
@@ -860,7 +863,7 @@ static int

vtd_get_pe_from_pasid_table(IntelIOMMUState *s,

Quoted 9 lines

hw/i386/intel_iommu.c static int

Quoted 9 lines
hw/i386/intel_iommu.c +1 -1
      }
 
      if (!vtd_pe_present(pe)) {
-        return -VTD_FR_PASID_TABLE_INV;
+        return -VTD_FR_PASID_ENTRY_P;
      }
 
      return 0;
@@ -913,7 +916,7 @@ static int

vtd_ce_get_pasid_fpd(IntelIOMMUState *s,

Quoted 26 lines
Quoted 22 lines
hw/i386/intel_iommu.c +6 -3
      }
 
      if (!vtd_pdire_present(&pdire)) {
-        return -VTD_FR_PASID_TABLE_INV;
+        return -VTD_FR_PASID_DIR_ENTRY_P;
      }
 
      /*
@@ -1770,7 +1773,11 @@ static const bool vtd_qualified_faults[] = {
      [VTD_FR_ROOT_ENTRY_RSVD] = false,
      [VTD_FR_PAGING_ENTRY_RSVD] = true,
      [VTD_FR_CONTEXT_ENTRY_TT] = true,
-    [VTD_FR_PASID_TABLE_INV] = false,
+    [VTD_FR_PASID_DIR_ACCESS_ERR] = false,
+    [VTD_FR_PASID_DIR_ENTRY_P] = true,
+    [VTD_FR_PASID_TABLE_ACCESS_ERR] = false,
+    [VTD_FR_PASID_ENTRY_P] = true,
+    [VTD_FR_PASID_TABLE_ENTRY_INV] = true,
      [VTD_FR_SM_INTERRUPT_ADDR] = true,
      [VTD_FR_MAX] = false,
  };
--
Quoted 3 lines

2.34.1

lgtm

#5 lore raw
In reply to Zhenzhong Duan
Quoted 9 lines · Zhenzhong Duan

From: Yu Zhang <[email protected]>

Currently we use only VTD_FR_PASID_TABLE_INV as fault reason. Update with more detailed fault reasons listed in VT-d spec 7.2.3.

---

I wonder if this could be noticed by the guest or not. If yes should we consider starting to add thing like version to vtd emulation code?

Thanks

#6 lore raw
Quoted 22 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Sent: Monday, May 20, 2024 8:44 AM
To: Duan, Zhenzhong <[email protected]>
Cc: [email protected]; Liu, Yi L <[email protected]>; Peng, Chao P <[email protected]>; Yu Zhang <[email protected]>; Michael S. Tsirkin <[email protected]>; Paolo Bonzini <[email protected]>; Richard Henderson <[email protected]>; Eduardo Habkost <[email protected]>; Marcel Apfelbaum <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined by spec

Quoted 6 lines · Zhenzhong Duan

From: Yu Zhang <[email protected]>

Currently we use only VTD_FR_PASID_TABLE_INV as fault reason. Update with more detailed fault reasons listed in VT-d spec 7.2.3.

Quoted 6 lines
Quoted 3 lines

---

I wonder if this could be noticed by the guest or not. If yes should we consider starting to add thing like version to vtd emulation code?

Kernel only dumps the reason like below:

DMAR: [DMA Write NO_PASID] Request device [20:00.0] fault addr 0x1234600000 [fault reason 0x71] SM: Present bit in first-level paging entry is clear

Maybe bump 1.0 -> 1.1?
My understanding version number is only informational and is far from accurate to mark if a feature supported. Driver should check cap/ecap bits instead.

Thanks
Zhenzhong

#7 lore raw
Quoted 29 lines

From: Duan, Zhenzhong <[email protected]>
Sent: Monday, May 20, 2024 11:41 AM

Quoted 24 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Sent: Monday, May 20, 2024 8:44 AM
To: Duan, Zhenzhong <[email protected]>
Cc: [email protected]; Liu, Yi L <[email protected]>; Peng, Chao P <[email protected]>; Yu Zhang <[email protected]>; Michael S. Tsirkin <[email protected]>; Paolo Bonzini <[email protected]>; Richard Henderson <[email protected]>; Eduardo Habkost <[email protected]>; Marcel Apfelbaum <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined by spec

Quoted 9 lines · Zhenzhong Duan

From: Yu Zhang <[email protected]>

Currently we use only VTD_FR_PASID_TABLE_INV as fault reason. Update with more detailed fault reasons listed in VT-d spec 7.2.3.

---

Quoted 7 lines
Quoted 2 lines

I wonder if this could be noticed by the guest or not. If yes should we consider starting to add thing like version to vtd emulation code?

Kernel only dumps the reason like below:

DMAR: [DMA Write NO_PASID] Request device [20:00.0] fault addr 0x1234600000 [fault reason 0x71] SM: Present bit in first-level paging entry is clear

Yes, guest kernel would notice it as the fault would be injected to vm.

Quoted 4 lines

Maybe bump 1.0 -> 1.1?
My understanding version number is only informational and is far from accurate to mark if a feature supported. Driver should check cap/ecap bits instead.

Should the version ID here be aligned with VT-d spec? If yes, it should be 3.0 as the scalable mode was introduced in spec 3.0. And the fault code was redefined together with the introduction of this translation mode. Below is the a snippet from the change log of VT-d spec.

June 2018 3.0
• Removed all text related to Extended-Mode.
• Added support for scalable-mode translation for DMA Remapping, that enables PASIDgranular first-level, second-level, nested and pass-through translation functions.
• Widen invalidation queue descriptors and page request queue descriptors from 128 bits
to 256 bits and redefined page-request and page-response descriptors.
• Listed all fault conditions in a unified table and described DMA Remapping hardware
behavior under each condition. Assigned new code for each fault condition in scalablemode operation.
• Added support for Accessed/Dirty (A/D) bits in second-level translation.
• Added support for submitting commands and receiving response from virtual DMA
Remapping hardware.
• Added a table on snooping behavior and memory type of hardware access to various
remapping structures as appendix.
• Move Page Request Overflow (PRO) fault reporting from Fault Status register
(FSTS_REG) to Page Request Status register (PRS_REG).

Regards.
Yi Liu

#8 lore raw
Quoted 54 lines

-----Original Message-----
From: Liu, Yi L <[email protected]>
Subject: RE: [PATCH] intel_iommu: Use the latest fault reasons defined by spec

Quoted 11 lines

From: Duan, Zhenzhong <[email protected]>
Sent: Monday, May 20, 2024 11:41 AM

Quoted 6 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Sent: Monday, May 20, 2024 8:44 AM
To: Duan, Zhenzhong <[email protected]>
Cc: [email protected]; Liu, Yi L <[email protected]>; Peng, Chao P <[email protected]>; Yu Zhang <[email protected]>;

Michael

Quoted 3 lines
Quoted 3 lines

S. Tsirkin <[email protected]>; Paolo Bonzini <[email protected]>; Richard Henderson <[email protected]>; Eduardo Habkost <[email protected]>; Marcel Apfelbaum

<[email protected]>

Quoted 15 lines
Quoted 15 lines

Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined by spec

Quoted 9 lines · Zhenzhong Duan

From: Yu Zhang <[email protected]>

Currently we use only VTD_FR_PASID_TABLE_INV as fault reason. Update with more detailed fault reasons listed in VT-d spec 7.2.3.

---

Quoted 6 lines
Quoted 2 lines

I wonder if this could be noticed by the guest or not. If yes should we consider starting to add thing like version to vtd emulation code?

Kernel only dumps the reason like below:

DMAR: [DMA Write NO_PASID] Request device [20:00.0] fault addr

0x1234600000

Quoted 1 line

[fault reason 0x71] SM: Present bit in first-level paging entry is clear

Yes, guest kernel would notice it as the fault would be injected to vm.

Quoted 4 lines

Maybe bump 1.0 -> 1.1?
My understanding version number is only informational and is far from accurate to mark if a feature supported. Driver should check cap/ecap bits instead.

Quoted 4 lines

Should the version ID here be aligned with VT-d spec? If yes, it should be 3.0 as the scalable mode was introduced in spec 3.0. And the fault code was redefined together with the introduction of this translation mode. Below is the a snippet from the change log of VT-d spec.

OK, then 3.0 is a better choice. Will update version. For Jason's question, even though more fault reasons are added, but the reason numbers are still backward compatible, so no need to define reasons per version.

Thanks
Zhenzhong

Quoted 26 lines

June 2018 3.0
• Removed all text related to Extended-Mode.
• Added support for scalable-mode translation for DMA Remapping, that enables PASIDgranular first-level, second-level, nested and pass-through translation functions.
• Widen invalidation queue descriptors and page request queue descriptors from 128 bits
to 256 bits and redefined page-request and page-response descriptors.
• Listed all fault conditions in a unified table and described DMA Remapping hardware
behavior under each condition. Assigned new code for each fault condition in scalablemode operation.
• Added support for Accessed/Dirty (A/D) bits in second-level translation.
• Added support for submitting commands and receiving response from virtual DMA
Remapping hardware.
• Added a table on snooping behavior and memory type of hardware access to various
remapping structures as appendix.
• Move Page Request Overflow (PRO) fault reporting from Fault Status register
(FSTS_REG) to Page Request Status register (PRS_REG).

Regards.
Yi Liu

#9 lore raw
In reply to Liu, Yi L
Quoted 38 lines · Yi L
Quoted 30 lines

From: Duan, Zhenzhong <[email protected]>
Sent: Monday, May 20, 2024 11:41 AM

Quoted 24 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Sent: Monday, May 20, 2024 8:44 AM
To: Duan, Zhenzhong <[email protected]>
Cc: [email protected]; Liu, Yi L <[email protected]>; Peng, Chao P <[email protected]>; Yu Zhang <[email protected]>; Michael S. Tsirkin <[email protected]>; Paolo Bonzini <[email protected]>; Richard Henderson <[email protected]>; Eduardo Habkost <[email protected]>; Marcel Apfelbaum <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined by spec

Quoted 9 lines · Zhenzhong Duan

From: Yu Zhang <[email protected]>

Currently we use only VTD_FR_PASID_TABLE_INV as fault reason. Update with more detailed fault reasons listed in VT-d spec 7.2.3.

---

Quoted 7 lines
Quoted 2 lines

I wonder if this could be noticed by the guest or not. If yes should we consider starting to add thing like version to vtd emulation code?

Kernel only dumps the reason like below:

DMAR: [DMA Write NO_PASID] Request device [20:00.0] fault addr 0x1234600000 [fault reason 0x71] SM: Present bit in first-level paging entry is clear

Quoted 8 lines

Yes, guest kernel would notice it as the fault would be injected to vm.

Quoted 4 lines

Maybe bump 1.0 -> 1.1?
My understanding version number is only informational and is far from accurate to mark if a feature supported. Driver should check cap/ecap bits instead.

Should the version ID here be aligned with VT-d spec?

Probably, this might be something that could be noticed by the management to migration compatibility.

Quoted 20 lines

If yes, it should
be 3.0 as the scalable mode was introduced in spec 3.0. And the fault code was redefined together with the introduction of this translation mode. Below is the a snippet from the change log of VT-d spec.

June 2018 3.0
• Removed all text related to Extended-Mode.
• Added support for scalable-mode translation for DMA Remapping, that enables PASIDgranular first-level, second-level, nested and pass-through translation functions.
• Widen invalidation queue descriptors and page request queue descriptors from 128 bits
to 256 bits and redefined page-request and page-response descriptors.
• Listed all fault conditions in a unified table and described DMA Remapping hardware
behavior under each condition. Assigned new code for each fault condition in scalablemode operation.
• Added support for Accessed/Dirty (A/D) bits in second-level translation.
• Added support for submitting commands and receiving response from virtual DMA
Remapping hardware.
• Added a table on snooping behavior and memory type of hardware access to various
remapping structures as appendix.
• Move Page Request Overflow (PRO) fault reporting from Fault Status register
(FSTS_REG) to Page Request Status register (PRS_REG).

Quoted 2 lines

Regards.
Yi Liu

Thanks

#10 lore raw
Quoted 58 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined by spec

Quoted 11 lines · Yi L
Quoted 11 lines

From: Duan, Zhenzhong <[email protected]>
Sent: Monday, May 20, 2024 11:41 AM

Quoted 5 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Sent: Monday, May 20, 2024 8:44 AM
To: Duan, Zhenzhong <[email protected]>
Cc: [email protected]; Liu, Yi L <[email protected]>; Peng, Chao

P

Quoted 1 line
Quoted 1 line
Quoted 1 line

<[email protected]>; Yu Zhang <[email protected]>;

Michael

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

S. Tsirkin <[email protected]>; Paolo Bonzini <[email protected]>; Richard Henderson <[email protected]>; Eduardo Habkost <[email protected]>; Marcel Apfelbaum

<[email protected]>

Quoted 1 line
Quoted 1 line
Quoted 1 line

Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined

by

Quoted 14 lines
Quoted 14 lines
Quoted 14 lines

spec

Quoted 9 lines · Zhenzhong Duan

From: Yu Zhang <[email protected]>

Currently we use only VTD_FR_PASID_TABLE_INV as fault reason. Update with more detailed fault reasons listed in VT-d spec 7.2.3.

---

Quoted 6 lines
Quoted 6 lines
Quoted 2 lines

I wonder if this could be noticed by the guest or not. If yes should we consider starting to add thing like version to vtd emulation code?

Kernel only dumps the reason like below:

DMAR: [DMA Write NO_PASID] Request device [20:00.0] fault addr

0x1234600000

Quoted 9 lines
Quoted 1 line

[fault reason 0x71] SM: Present bit in first-level paging entry is clear

Yes, guest kernel would notice it as the fault would be injected to vm.

Quoted 4 lines

Maybe bump 1.0 -> 1.1?
My understanding version number is only informational and is far from accurate to mark if a feature supported. Driver should check cap/ecap bits instead.

Quoted 4 lines
Quoted 1 line

Should the version ID here be aligned with VT-d spec?

Probably, this might be something that could be noticed by the management to migration compatibility.

Could you elaborate what we need to do for migration compatibility? I see version is already exported so libvirt can query it, see:

DEFINE_PROP_UINT32("version", IntelIOMMUState, version, 0),

Thanks
Zhenzhong

Quoted 33 lines
Quoted 9 lines

If yes, it should
be 3.0 as the scalable mode was introduced in spec 3.0. And the fault code was redefined together with the introduction of this translation mode. Below is the a snippet from the change log of VT-d spec.

June 2018 3.0
• Removed all text related to Extended-Mode.
• Added support for scalable-mode translation for DMA Remapping, that

enables PASIDgranular first-level, second-level, nested and pass-through translation functions.

Quoted 1 line

• Widen invalidation queue descriptors and page request queue

descriptors from 128 bits

Quoted 2 lines

to 256 bits and redefined page-request and page-response descriptors.
• Listed all fault conditions in a unified table and described DMA

Remapping hardware

Quoted 1 line

behavior under each condition. Assigned new code for each fault condition

in scalablemode operation.

Quoted 2 lines

• Added support for Accessed/Dirty (A/D) bits in second-level translation.
• Added support for submitting commands and receiving response from

virtual DMA

Quoted 2 lines

Remapping hardware.
• Added a table on snooping behavior and memory type of hardware

access to various

Quoted 2 lines

remapping structures as appendix.
• Move Page Request Overflow (PRO) fault reporting from Fault Status

register

Quoted 4 lines

(FSTS_REG) to Page Request Status register (PRS_REG).

Regards.
Yi Liu

Thanks

#11 lore raw
Quoted 61 lines · Zhenzhong
Quoted 61 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined by spec

Quoted 11 lines · Yi L
Quoted 11 lines

From: Duan, Zhenzhong <[email protected]>
Sent: Monday, May 20, 2024 11:41 AM

Quoted 5 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Sent: Monday, May 20, 2024 8:44 AM
To: Duan, Zhenzhong <[email protected]>
Cc: [email protected]; Liu, Yi L <[email protected]>; Peng, Chao

P

Quoted 1 line
Quoted 1 line
Quoted 1 line

<[email protected]>; Yu Zhang <[email protected]>;

Michael

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

S. Tsirkin <[email protected]>; Paolo Bonzini <[email protected]>; Richard Henderson <[email protected]>; Eduardo Habkost <[email protected]>; Marcel Apfelbaum

<[email protected]>

Quoted 1 line
Quoted 1 line
Quoted 1 line

Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined

by

Quoted 14 lines
Quoted 14 lines
Quoted 14 lines

spec

Quoted 9 lines · Zhenzhong Duan

From: Yu Zhang <[email protected]>

Currently we use only VTD_FR_PASID_TABLE_INV as fault reason. Update with more detailed fault reasons listed in VT-d spec 7.2.3.

---

Quoted 6 lines
Quoted 6 lines
Quoted 2 lines

I wonder if this could be noticed by the guest or not. If yes should we consider starting to add thing like version to vtd emulation code?

Kernel only dumps the reason like below:

DMAR: [DMA Write NO_PASID] Request device [20:00.0] fault addr

0x1234600000

Quoted 10 lines
Quoted 1 line

[fault reason 0x71] SM: Present bit in first-level paging entry is clear

Yes, guest kernel would notice it as the fault would be injected to vm.

Quoted 4 lines

Maybe bump 1.0 -> 1.1?
My understanding version number is only informational and is far from accurate to mark if a feature supported. Driver should check cap/ecap bits instead.

Should the version ID here be aligned with VT-d spec?

Quoted 7 lines
Quoted 2 lines

Probably, this might be something that could be noticed by the management to migration compatibility.

Could you elaborate what we need to do for migration compatibility? I see version is already exported so libvirt can query it, see:

DEFINE_PROP_UINT32("version", IntelIOMMUState, version, 0),

It is the Qemu command line parameters not the version of the vmstate.

For example -device intel-iommu,version=3.0

Qemu then knows it should behave as 3.0.

Thanks

Quoted 38 lines

Thanks
Zhenzhong

Quoted 33 lines
Quoted 9 lines

If yes, it should
be 3.0 as the scalable mode was introduced in spec 3.0. And the fault code was redefined together with the introduction of this translation mode. Below is the a snippet from the change log of VT-d spec.

June 2018 3.0
• Removed all text related to Extended-Mode.
• Added support for scalable-mode translation for DMA Remapping, that

enables PASIDgranular first-level, second-level, nested and pass-through translation functions.

Quoted 1 line

• Widen invalidation queue descriptors and page request queue

descriptors from 128 bits

Quoted 2 lines

to 256 bits and redefined page-request and page-response descriptors.
• Listed all fault conditions in a unified table and described DMA

Remapping hardware

Quoted 1 line

behavior under each condition. Assigned new code for each fault condition

in scalablemode operation.

Quoted 2 lines

• Added support for Accessed/Dirty (A/D) bits in second-level translation.
• Added support for submitting commands and receiving response from

virtual DMA

Quoted 2 lines

Remapping hardware.
• Added a table on snooping behavior and memory type of hardware

access to various

Quoted 2 lines

remapping structures as appendix.
• Move Page Request Overflow (PRO) fault reporting from Fault Status

register

Quoted 4 lines

(FSTS_REG) to Page Request Status register (PRS_REG).

Regards.
Yi Liu

Thanks

#12 lore raw
Quoted 81 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined by spec

Quoted 15 lines · Zhenzhong
Quoted 15 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined by spec

Quoted 6 lines · Yi L
Quoted 6 lines

From: Duan, Zhenzhong <[email protected]>
Sent: Monday, May 20, 2024 11:41 AM

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Sent: Monday, May 20, 2024 8:44 AM
To: Duan, Zhenzhong <[email protected]>
Cc: [email protected]; Liu, Yi L <[email protected]>; Peng,

Chao

Quoted 4 lines
Quoted 4 lines

P

Quoted 1 line
Quoted 1 line
Quoted 1 line

<[email protected]>; Yu Zhang <[email protected]>;

Michael

Quoted 1 line
Quoted 1 line
Quoted 1 line

S. Tsirkin <[email protected]>; Paolo Bonzini

<[email protected]>;

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Richard Henderson <[email protected]>; Eduardo

Habkost

Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

<[email protected]>; Marcel Apfelbaum

<[email protected]>

Quoted 1 line
Quoted 1 line
Quoted 1 line

Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons

defined

Quoted 20 lines
Quoted 20 lines

by

Quoted 19 lines
Quoted 19 lines
Quoted 10 lines

spec

Quoted 6 lines · Zhenzhong Duan

From: Yu Zhang <[email protected]>

Currently we use only VTD_FR_PASID_TABLE_INV as fault reason. Update with more detailed fault reasons listed in VT-d spec 7.2.3.

Quoted 6 lines
Quoted 3 lines

---

I wonder if this could be noticed by the guest or not. If yes should we consider starting to add thing like version to vtd emulation code?

Kernel only dumps the reason like below:

Quoted 8 lines
Quoted 8 lines
Quoted 1 line
Quoted 1 line

DMAR: [DMA Write NO_PASID] Request device [20:00.0] fault addr

0x1234600000

Quoted 6 lines
Quoted 1 line

[fault reason 0x71] SM: Present bit in first-level paging entry is clear

Yes, guest kernel would notice it as the fault would be injected to vm.

Quoted 2 lines

Maybe bump 1.0 -> 1.1?
My understanding version number is only informational and is far

from

Quoted 11 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

accurate to mark if a feature supported. Driver should check cap/ecap bits instead.

Should the version ID here be aligned with VT-d spec?

Probably, this might be something that could be noticed by the management to migration compatibility.

Could you elaborate what we need to do for migration compatibility? I see version is already exported so libvirt can query it, see:

Quoted 7 lines
Quoted 1 line

DEFINE_PROP_UINT32("version", IntelIOMMUState, version, 0),

It is the Qemu command line parameters not the version of the vmstate.

For example -device intel-iommu,version=3.0

Qemu then knows it should behave as 3.0.

So you want to bump vtd_vmstate.version?

In fact, this series change intel_iommu property from x-scalable-mode=["on"|"off"]" to x-scalable-mode=["legacy"|"modern"|"off"]".

My understanding management app should use same qemu cmdline in source and destination, so compatibility is already guaranteed even if we don't bump vtd_vmstate.version.

Thanks
Zhenzhong

#13 lore raw
Quoted 84 lines · Zhenzhong
Quoted 84 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined by spec

Quoted 15 lines · Zhenzhong
Quoted 15 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined by spec

Quoted 6 lines · Yi L
Quoted 6 lines

From: Duan, Zhenzhong <[email protected]>
Sent: Monday, May 20, 2024 11:41 AM

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Sent: Monday, May 20, 2024 8:44 AM
To: Duan, Zhenzhong <[email protected]>
Cc: [email protected]; Liu, Yi L <[email protected]>; Peng,

Chao

Quoted 4 lines
Quoted 4 lines

P

Quoted 1 line
Quoted 1 line
Quoted 1 line

<[email protected]>; Yu Zhang <[email protected]>;

Michael

Quoted 1 line
Quoted 1 line
Quoted 1 line

S. Tsirkin <[email protected]>; Paolo Bonzini

<[email protected]>;

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Richard Henderson <[email protected]>; Eduardo

Habkost

Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

<[email protected]>; Marcel Apfelbaum

<[email protected]>

Quoted 1 line
Quoted 1 line
Quoted 1 line

Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons

defined

Quoted 20 lines
Quoted 20 lines

by

Quoted 19 lines
Quoted 19 lines
Quoted 10 lines

spec

Quoted 6 lines · Zhenzhong Duan

From: Yu Zhang <[email protected]>

Currently we use only VTD_FR_PASID_TABLE_INV as fault reason. Update with more detailed fault reasons listed in VT-d spec 7.2.3.

Quoted 6 lines
Quoted 3 lines

---

I wonder if this could be noticed by the guest or not. If yes should we consider starting to add thing like version to vtd emulation code?

Kernel only dumps the reason like below:

Quoted 8 lines
Quoted 8 lines
Quoted 1 line
Quoted 1 line

DMAR: [DMA Write NO_PASID] Request device [20:00.0] fault addr

0x1234600000

Quoted 6 lines
Quoted 1 line

[fault reason 0x71] SM: Present bit in first-level paging entry is clear

Yes, guest kernel would notice it as the fault would be injected to vm.

Quoted 2 lines

Maybe bump 1.0 -> 1.1?
My understanding version number is only informational and is far

from

Quoted 12 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

accurate to mark if a feature supported. Driver should check cap/ecap bits instead.

Should the version ID here be aligned with VT-d spec?

Probably, this might be something that could be noticed by the management to migration compatibility.

Could you elaborate what we need to do for migration compatibility? I see version is already exported so libvirt can query it, see:

DEFINE_PROP_UINT32("version", IntelIOMMUState, version, 0),

Quoted 7 lines
Quoted 5 lines

It is the Qemu command line parameters not the version of the vmstate.

For example -device intel-iommu,version=3.0

Qemu then knows it should behave as 3.0.

So you want to bump vtd_vmstate.version?

Well, as I said, it's not a direct bumping.

Quoted 7 lines

In fact, this series change intel_iommu property from x-scalable-mode=["on"|"off"]" to x-scalable-mode=["legacy"|"modern"|"off"]".

My understanding management app should use same qemu cmdline in source and destination, so compatibility is already guaranteed even if we don't bump vtd_vmstate.version.

Exactly, so the point is to

vtd=3.0, the device works exactly as vtd spec 3.0. vtd=3.3, the device works exactly as vtd spec 3.3.

When migration to the old qemu, mgmt can specify e.g vtd=3.0 for backward migration compatibility.

Thanks

Quoted 3 lines

Thanks
Zhenzhong

#14 lore raw
Quoted 116 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined by spec

Quoted 8 lines · Zhenzhong
Quoted 8 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined by spec

Quoted 8 lines
Quoted 8 lines
Quoted 6 lines · Zhenzhong
Quoted 6 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined

by

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

spec

On Mon, May 20, 2024 at 12:15 PM Liu, Yi L <[email protected]>

Quoted 6 lines · wrote:
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

From: Duan, Zhenzhong <[email protected]>
Sent: Monday, May 20, 2024 11:41 AM

Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Sent: Monday, May 20, 2024 8:44 AM
To: Duan, Zhenzhong <[email protected]>
Cc: [email protected]; Liu, Yi L <[email protected]>; Peng,

Chao

Quoted 2 lines
Quoted 2 lines

P

Quoted 1 line
Quoted 1 line
Quoted 1 line

<[email protected]>; Yu Zhang

<[email protected]>;

Quoted 10 lines
Quoted 10 lines
Quoted 2 lines
Quoted 2 lines

Michael

Quoted 1 line
Quoted 1 line
Quoted 1 line

S. Tsirkin <[email protected]>; Paolo Bonzini

<[email protected]>;

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Richard Henderson <[email protected]>; Eduardo

Habkost

Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

<[email protected]>; Marcel Apfelbaum

<[email protected]>

Quoted 1 line
Quoted 1 line
Quoted 1 line

Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons

defined

Quoted 1 line
Quoted 1 line

by

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

spec

Quoted 4 lines · Zhenzhong Duan

From: Yu Zhang <[email protected]>

Currently we use only VTD_FR_PASID_TABLE_INV as fault

reason.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Update with more detailed fault reasons listed in VT-d spec

7.2.3.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

---

I wonder if this could be noticed by the guest or not. If yes should we consider starting to add thing like version to vtd emulation

code?

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
Quoted 4 lines

Kernel only dumps the reason like below:

DMAR: [DMA Write NO_PASID] Request device [20:00.0] fault addr

0x1234600000

Quoted 1 line
Quoted 1 line

[fault reason 0x71] SM: Present bit in first-level paging entry is

clear

Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

Yes, guest kernel would notice it as the fault would be injected to vm.

Quoted 2 lines

Maybe bump 1.0 -> 1.1?
My understanding version number is only informational and is far

from

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

accurate to mark if a feature supported. Driver should check

cap/ecap

Quoted 12 lines
Quoted 12 lines
Quoted 11 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

bits instead.

Should the version ID here be aligned with VT-d spec?

Probably, this might be something that could be noticed by the management to migration compatibility.

Could you elaborate what we need to do for migration compatibility? I see version is already exported so libvirt can query it, see:

DEFINE_PROP_UINT32("version", IntelIOMMUState, version, 0),

Quoted 7 lines
Quoted 5 lines

It is the Qemu command line parameters not the version of the vmstate.

For example -device intel-iommu,version=3.0

Qemu then knows it should behave as 3.0.

So you want to bump vtd_vmstate.version?

Well, as I said, it's not a direct bumping.

Quoted 2 lines

In fact, this series change intel_iommu property from x-scalable-

mode=["on"|"off"]"

Quoted 2 lines

to x-scalable-mode=["legacy"|"modern"|"off"]".

Quoted 8 lines
Quoted 3 lines

My understanding management app should use same qemu cmdline in source and destination, so compatibility is already guaranteed even if we don't bump vtd_vmstate.version.

Exactly, so the point is to

vtd=3.0, the device works exactly as vtd spec 3.0. vtd=3.3, the device works exactly as vtd spec 3.3.

Get your point. But I have some concerns about this:
1.Exact version matching will bring vast of version check in the code,
especially when we support more versions.
2. There are some missed features before we can update version number to 3.0, i.e., nested translation, Accessed/Dirty (A/D) bits, 5 level page table, etc.
3. Some features are removed in future versions, but we still need to implement them for intermediate version,
i.e., ExecuteRequested (ER), Advanced Fault Logging, etc.

Quoted 3 lines

When migration to the old qemu, mgmt can specify e.g vtd=3.0 for backward migration compatibility.

Yes, that makes sense for such migration.
But I'm not sure if there is a real scenario migrating to old qemu, why not just update qemu on destination?

Thanks
Zhenzhong

#15 lore raw
Quoted 86 lines · Zhenzhong
Quoted 86 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined by spec

Quoted 8 lines · Zhenzhong
Quoted 8 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined by spec

Quoted 8 lines
Quoted 8 lines
Quoted 6 lines · Zhenzhong
Quoted 6 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined

by

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

spec

On Mon, May 20, 2024 at 12:15 PM Liu, Yi L <[email protected]>

Quoted 6 lines · wrote:
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

From: Duan, Zhenzhong <[email protected]>
Sent: Monday, May 20, 2024 11:41 AM

Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Sent: Monday, May 20, 2024 8:44 AM
To: Duan, Zhenzhong <[email protected]>
Cc: [email protected]; Liu, Yi L <[email protected]>; Peng,

Chao

Quoted 2 lines
Quoted 2 lines

P

Quoted 1 line
Quoted 1 line
Quoted 1 line

<[email protected]>; Yu Zhang

<[email protected]>;

Quoted 10 lines
Quoted 10 lines
Quoted 2 lines
Quoted 2 lines

Michael

Quoted 1 line
Quoted 1 line
Quoted 1 line

S. Tsirkin <[email protected]>; Paolo Bonzini

<[email protected]>;

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Richard Henderson <[email protected]>; Eduardo

Habkost

Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

<[email protected]>; Marcel Apfelbaum

<[email protected]>

Quoted 1 line
Quoted 1 line
Quoted 1 line

Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons

defined

Quoted 1 line
Quoted 1 line

by

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

spec

Quoted 4 lines · Zhenzhong Duan

From: Yu Zhang <[email protected]>

Currently we use only VTD_FR_PASID_TABLE_INV as fault

reason.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Update with more detailed fault reasons listed in VT-d spec

7.2.3.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

---

I wonder if this could be noticed by the guest or not. If yes should we consider starting to add thing like version to vtd emulation

code?

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
Quoted 4 lines

Kernel only dumps the reason like below:

DMAR: [DMA Write NO_PASID] Request device [20:00.0] fault addr

0x1234600000

Quoted 1 line
Quoted 1 line

[fault reason 0x71] SM: Present bit in first-level paging entry is

clear

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

Yes, guest kernel would notice it as the fault would be injected to vm.

Quoted 2 lines

Maybe bump 1.0 -> 1.1?
My understanding version number is only informational and is far

Quoted 7 lines
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines

from

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

accurate to mark if a feature supported. Driver should check

cap/ecap

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 1 line

bits instead.

Should the version ID here be aligned with VT-d spec?

Folks, looks like it's not necessary to be aligned with spec version. e.g. I can see something like below. This is an old machine which is not possible to be built according to vt-d spec 4.0. Let me check more machines as well to confirm this.Perhaps virtual VT-d implementation can have its own version policy? @Jason, how about your idea?

cat /sys/class/iommu/dmar0/intel-iommu/version
4:0

Quoted 32 lines
Quoted 23 lines
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 2 lines

Probably, this might be something that could be noticed by the management to migration compatibility.

Could you elaborate what we need to do for migration compatibility? I see version is already exported so libvirt can query it, see:

DEFINE_PROP_UINT32("version", IntelIOMMUState, version, 0),

Quoted 7 lines
Quoted 5 lines

It is the Qemu command line parameters not the version of the vmstate.

For example -device intel-iommu,version=3.0

Qemu then knows it should behave as 3.0.

So you want to bump vtd_vmstate.version?

Well, as I said, it's not a direct bumping.

Quoted 2 lines

In fact, this series change intel_iommu property from x-scalable-

mode=["on"|"off"]"

Quoted 2 lines

to x-scalable-mode=["legacy"|"modern"|"off"]".

Quoted 8 lines
Quoted 3 lines

My understanding management app should use same qemu cmdline in source and destination, so compatibility is already guaranteed even if we don't bump vtd_vmstate.version.

Exactly, so the point is to

vtd=3.0, the device works exactly as vtd spec 3.0. vtd=3.3, the device works exactly as vtd spec 3.3.

Quoted 8 lines

Get your point. But I have some concerns about this:
1.Exact version matching will bring vast of version check in the code,
especially when we support more versions.
2. There are some missed features before we can update version number to 3.0, i.e., nested translation, Accessed/Dirty (A/D) bits, 5 level page table, etc.
3. Some features are removed in future versions, but we still need to implement them for intermediate version,
i.e., ExecuteRequested (ER), Advanced Fault Logging, etc.

Even the hw follows vtd spec 3.0, it is not required to implement all of them. So it should be fine to implement part of the capabilities. :)

Quoted 11 lines
Quoted 3 lines

When migration to the old qemu, mgmt can specify e.g vtd=3.0 for backward migration compatibility.

Yes, that makes sense for such migration.
But I'm not sure if there is a real scenario migrating to old qemu, why not just update qemu on destination?

Thanks
Zhenzhong

Signature · 2 lines
Regards,
Yi Liu
#16 lore raw
Quoted 4 lines · Yi Liu

Folks, looks like it's not necessary to be aligned with spec version. e.g. I can see something like below. This is an old machine which is not possible to be built according to vt-d spec 4.0. Let me check more machines as well to confirm this.

Aligning to a spec version is preferable. We don't *have* to force users to do it if we don't want to, but you never know what assumptions will guests make.

Quoted 5 lines

Perhaps virtual VT-d implementation
can have its own version policy? @Jason, how about your idea?

cat /sys/class/iommu/dmar0/intel-iommu/version
4:0

This is PV, really best avoided if we can.

Quoted 41 lines
Quoted 32 lines
Quoted 23 lines
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 2 lines

Probably, this might be something that could be noticed by the management to migration compatibility.

Could you elaborate what we need to do for migration compatibility? I see version is already exported so libvirt can query it, see:

DEFINE_PROP_UINT32("version", IntelIOMMUState, version, 0),

Quoted 7 lines
Quoted 5 lines

It is the Qemu command line parameters not the version of the vmstate.

For example -device intel-iommu,version=3.0

Qemu then knows it should behave as 3.0.

So you want to bump vtd_vmstate.version?

Well, as I said, it's not a direct bumping.

Quoted 2 lines

In fact, this series change intel_iommu property from x-scalable-

mode=["on"|"off"]"

Quoted 2 lines

to x-scalable-mode=["legacy"|"modern"|"off"]".

Quoted 8 lines
Quoted 3 lines

My understanding management app should use same qemu cmdline in source and destination, so compatibility is already guaranteed even if we don't bump vtd_vmstate.version.

Exactly, so the point is to

vtd=3.0, the device works exactly as vtd spec 3.0. vtd=3.3, the device works exactly as vtd spec 3.3.

Quoted 8 lines

Get your point. But I have some concerns about this:
1.Exact version matching will bring vast of version check in the code,
especially when we support more versions.
2. There are some missed features before we can update version number to 3.0, i.e., nested translation, Accessed/Dirty (A/D) bits, 5 level page table, etc.
3. Some features are removed in future versions, but we still need to implement them for intermediate version,
i.e., ExecuteRequested (ER), Advanced Fault Logging, etc.

Quoted 2 lines

Even the hw follows vtd spec 3.0, it is not required to implement all of them. So it should be fine to implement part of the capabilities. :)

Yes, that's better.
Specifying version # explicitly is really annoying for both qemu and management.
I think normally we should just start with capabilities and make the best decision we can wrt guest support etc.

Being concervative is usually a good idea, if a new version gives no useful functionality adding that is just churn.
So i.e. we have a set of capabilities we want and select the earliest version that supports them.

We can let user override that and I am not sure we need to bother actually checking it's consistent with capabilities if we do not want to.

Quoted 15 lines
Quoted 11 lines
Quoted 3 lines

When migration to the old qemu, mgmt can specify e.g vtd=3.0 for backward migration compatibility.

Yes, that makes sense for such migration.
But I'm not sure if there is a real scenario migrating to old qemu, why not just update qemu on destination?

Thanks
Zhenzhong

Signature · 2 lines
Regards,
Yi Liu
#17 lore raw
In reply to Duan, Zhenzhong

Hi Jason,

Quoted 89 lines

-----Original Message-----
From: Duan, Zhenzhong
Subject: RE: [PATCH] intel_iommu: Use the latest fault reasons defined by spec

Quoted 5 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined by spec

Quoted 8 lines
Quoted 6 lines · Zhenzhong
Quoted 6 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined

by

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

spec

Quoted 6 lines · Zhenzhong
Quoted 6 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons

defined

Quoted 35 lines

by

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

spec

On Mon, May 20, 2024 at 12:15 PM Liu, Yi L <[email protected]>

Quoted 6 lines · wrote:
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

From: Duan, Zhenzhong <[email protected]>
Sent: Monday, May 20, 2024 11:41 AM

Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Sent: Monday, May 20, 2024 8:44 AM
To: Duan, Zhenzhong <[email protected]>
Cc: [email protected]; Liu, Yi L <[email protected]>; Peng,

Chao

Quoted 2 lines
Quoted 2 lines

P

Quoted 1 line
Quoted 1 line
Quoted 1 line

<[email protected]>; Yu Zhang

<[email protected]>;

Quoted 15 lines
Quoted 15 lines
Quoted 2 lines
Quoted 2 lines

Michael

Quoted 1 line
Quoted 1 line
Quoted 1 line

S. Tsirkin <[email protected]>; Paolo Bonzini

<[email protected]>;

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Richard Henderson <[email protected]>; Eduardo

Habkost

Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

<[email protected]>; Marcel Apfelbaum

<[email protected]>

Quoted 1 line
Quoted 1 line
Quoted 1 line

Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons

defined

Quoted 6 lines
Quoted 6 lines

by

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

spec

Quoted 1 line · Zhenzhong Duan
Quoted 12 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

From: Yu Zhang <[email protected]>

Currently we use only VTD_FR_PASID_TABLE_INV as fault

reason.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Update with more detailed fault reasons listed in VT-d spec

7.2.3.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

---

I wonder if this could be noticed by the guest or not. If yes

should

Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

we consider starting to add thing like version to vtd emulation

code?

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Kernel only dumps the reason like below:

DMAR: [DMA Write NO_PASID] Request device [20:00.0] fault

addr

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

0x1234600000

Quoted 1 line
Quoted 1 line

[fault reason 0x71] SM: Present bit in first-level paging entry is

Quoted 46 lines
Quoted 3 lines

clear

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Yes, guest kernel would notice it as the fault would be injected to

vm.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Maybe bump 1.0 -> 1.1?
My understanding version number is only informational and is

far

Quoted 38 lines
Quoted 2 lines
Quoted 2 lines

from

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

accurate to mark if a feature supported. Driver should check

cap/ecap

Quoted 12 lines
Quoted 12 lines
Quoted 11 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

bits instead.

Should the version ID here be aligned with VT-d spec?

Probably, this might be something that could be noticed by the management to migration compatibility.

Could you elaborate what we need to do for migration compatibility? I see version is already exported so libvirt can query it, see:

DEFINE_PROP_UINT32("version", IntelIOMMUState, version, 0),

Quoted 7 lines
Quoted 5 lines

It is the Qemu command line parameters not the version of the vmstate.

For example -device intel-iommu,version=3.0

Qemu then knows it should behave as 3.0.

So you want to bump vtd_vmstate.version?

Well, as I said, it's not a direct bumping.

Quoted 2 lines

In fact, this series change intel_iommu property from x-scalable-

mode=["on"|"off"]"

Quoted 5 lines

to x-scalable-mode=["legacy"|"modern"|"off"]".

My understanding management app should use same qemu cmdline in source and destination, so compatibility is already guaranteed even if we don't bump vtd_vmstate.version.

Exactly, so the point is to

vtd=3.0, the device works exactly as vtd spec 3.0. vtd=3.3, the device works exactly as vtd spec 3.3.

Yi just found version ID stored in VT-d VER_REG is not aligned with the VT-d spec version. For example, we see a local hw with vtd version 6.0 which is beyond VT-d spec version. We are asking VTD arch, will get back soon.

Or will you plan qemu vVT-d having its own version policy?

Thanks
Zhenzhong

Quoted 21 lines

Get your point. But I have some concerns about this:
1.Exact version matching will bring vast of version check in the code,
especially when we support more versions.
2. There are some missed features before we can update version number to 3.0,
i.e., nested translation, Accessed/Dirty (A/D) bits, 5 level page table, etc.
3. Some features are removed in future versions, but we still need to implement them for intermediate version,
i.e., ExecuteRequested (ER), Advanced Fault Logging, etc.

Quoted 3 lines

When migration to the old qemu, mgmt can specify e.g vtd=3.0 for backward migration compatibility.

Yes, that makes sense for such migration.
But I'm not sure if there is a real scenario migrating to old qemu, why not just update qemu on destination?

Thanks
Zhenzhong

#18 lore raw
Quoted 138 lines · Zhenzhong

Hi Jason,

Quoted 89 lines

-----Original Message-----
From: Duan, Zhenzhong
Subject: RE: [PATCH] intel_iommu: Use the latest fault reasons defined by spec

Quoted 5 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined by spec

Quoted 8 lines
Quoted 6 lines · Zhenzhong
Quoted 6 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined

by

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

spec

Quoted 6 lines · Zhenzhong
Quoted 6 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons

defined

Quoted 35 lines

by

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

spec

On Mon, May 20, 2024 at 12:15 PM Liu, Yi L <[email protected]>

Quoted 6 lines · wrote:
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

From: Duan, Zhenzhong <[email protected]>
Sent: Monday, May 20, 2024 11:41 AM

Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Sent: Monday, May 20, 2024 8:44 AM
To: Duan, Zhenzhong <[email protected]>
Cc: [email protected]; Liu, Yi L <[email protected]>; Peng,

Chao

Quoted 2 lines
Quoted 2 lines

P

Quoted 1 line
Quoted 1 line
Quoted 1 line

<[email protected]>; Yu Zhang

<[email protected]>;

Quoted 15 lines
Quoted 15 lines
Quoted 2 lines
Quoted 2 lines

Michael

Quoted 1 line
Quoted 1 line
Quoted 1 line

S. Tsirkin <[email protected]>; Paolo Bonzini

<[email protected]>;

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Richard Henderson <[email protected]>; Eduardo

Habkost

Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

<[email protected]>; Marcel Apfelbaum

<[email protected]>

Quoted 1 line
Quoted 1 line
Quoted 1 line

Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons

defined

Quoted 6 lines
Quoted 6 lines

by

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

spec

Quoted 1 line · Zhenzhong Duan
Quoted 12 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

From: Yu Zhang <[email protected]>

Currently we use only VTD_FR_PASID_TABLE_INV as fault

reason.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Update with more detailed fault reasons listed in VT-d spec

7.2.3.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

---

I wonder if this could be noticed by the guest or not. If yes

should

Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

we consider starting to add thing like version to vtd emulation

code?

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Kernel only dumps the reason like below:

DMAR: [DMA Write NO_PASID] Request device [20:00.0] fault

addr

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

0x1234600000

Quoted 1 line
Quoted 1 line

[fault reason 0x71] SM: Present bit in first-level paging entry is

Quoted 46 lines
Quoted 3 lines

clear

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Yes, guest kernel would notice it as the fault would be injected to

vm.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Maybe bump 1.0 -> 1.1?
My understanding version number is only informational and is

far

Quoted 38 lines
Quoted 2 lines
Quoted 2 lines

from

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

accurate to mark if a feature supported. Driver should check

cap/ecap

Quoted 12 lines
Quoted 12 lines
Quoted 11 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

bits instead.

Should the version ID here be aligned with VT-d spec?

Probably, this might be something that could be noticed by the management to migration compatibility.

Could you elaborate what we need to do for migration compatibility? I see version is already exported so libvirt can query it, see:

DEFINE_PROP_UINT32("version", IntelIOMMUState, version, 0),

Quoted 7 lines
Quoted 5 lines

It is the Qemu command line parameters not the version of the vmstate.

For example -device intel-iommu,version=3.0

Qemu then knows it should behave as 3.0.

So you want to bump vtd_vmstate.version?

Well, as I said, it's not a direct bumping.

Quoted 2 lines

In fact, this series change intel_iommu property from x-scalable-

mode=["on"|"off"]"

Quoted 5 lines

to x-scalable-mode=["legacy"|"modern"|"off"]".

My understanding management app should use same qemu cmdline in source and destination, so compatibility is already guaranteed even if we don't bump vtd_vmstate.version.

Exactly, so the point is to

vtd=3.0, the device works exactly as vtd spec 3.0. vtd=3.3, the device works exactly as vtd spec 3.3.

Quoted 8 lines

Yi just found version ID stored in VT-d VER_REG is not aligned with the VT-d spec version. For example, we see a local hw with vtd version 6.0 which is beyond VT-d spec version. We are asking VTD arch, will get back soon.

Or will you plan qemu vVT-d having its own version policy?

Thanks
Zhenzhong

Not unless there's a good reason to do this.

Quoted 22 lines
Quoted 21 lines

Get your point. But I have some concerns about this:
1.Exact version matching will bring vast of version check in the code,
especially when we support more versions.
2. There are some missed features before we can update version number to 3.0,
i.e., nested translation, Accessed/Dirty (A/D) bits, 5 level page table, etc.
3. Some features are removed in future versions, but we still need to implement them for intermediate version,
i.e., ExecuteRequested (ER), Advanced Fault Logging, etc.

Quoted 3 lines

When migration to the old qemu, mgmt can specify e.g vtd=3.0 for backward migration compatibility.

Yes, that makes sense for such migration.
But I'm not sure if there is a real scenario migrating to old qemu, why not just update qemu on destination?

Thanks
Zhenzhong

#19 lore raw
Quoted 144 lines · Michael S. Tsirkin
Quoted 142 lines · Zhenzhong

Hi Jason,

Quoted 89 lines

-----Original Message-----
From: Duan, Zhenzhong
Subject: RE: [PATCH] intel_iommu: Use the latest fault reasons defined by spec

Quoted 5 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined by spec

Quoted 8 lines
Quoted 6 lines · Zhenzhong
Quoted 6 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined

by

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

spec

Quoted 6 lines · Zhenzhong
Quoted 6 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons

defined

Quoted 35 lines

by

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

spec

On Mon, May 20, 2024 at 12:15 PM Liu, Yi L <[email protected]>

Quoted 6 lines · wrote:
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

From: Duan, Zhenzhong <[email protected]>
Sent: Monday, May 20, 2024 11:41 AM

Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Sent: Monday, May 20, 2024 8:44 AM
To: Duan, Zhenzhong <[email protected]>
Cc: [email protected]; Liu, Yi L <[email protected]>; Peng,

Chao

Quoted 2 lines
Quoted 2 lines

P

Quoted 1 line
Quoted 1 line
Quoted 1 line

<[email protected]>; Yu Zhang

<[email protected]>;

Quoted 15 lines
Quoted 15 lines
Quoted 2 lines
Quoted 2 lines

Michael

Quoted 1 line
Quoted 1 line
Quoted 1 line

S. Tsirkin <[email protected]>; Paolo Bonzini

<[email protected]>;

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Richard Henderson <[email protected]>; Eduardo

Habkost

Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

<[email protected]>; Marcel Apfelbaum

<[email protected]>

Quoted 1 line
Quoted 1 line
Quoted 1 line

Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons

defined

Quoted 6 lines
Quoted 6 lines

by

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

spec

Quoted 1 line · Zhenzhong Duan
Quoted 12 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

From: Yu Zhang <[email protected]>

Currently we use only VTD_FR_PASID_TABLE_INV as fault

reason.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Update with more detailed fault reasons listed in VT-d spec

7.2.3.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

---

I wonder if this could be noticed by the guest or not. If yes

should

Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

we consider starting to add thing like version to vtd emulation

code?

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Kernel only dumps the reason like below:

DMAR: [DMA Write NO_PASID] Request device [20:00.0] fault

addr

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

0x1234600000

Quoted 1 line
Quoted 1 line

[fault reason 0x71] SM: Present bit in first-level paging entry is

Quoted 46 lines
Quoted 3 lines

clear

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Yes, guest kernel would notice it as the fault would be injected to

vm.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Maybe bump 1.0 -> 1.1?
My understanding version number is only informational and is

far

Quoted 38 lines
Quoted 2 lines
Quoted 2 lines

from

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

accurate to mark if a feature supported. Driver should check

cap/ecap

Quoted 12 lines
Quoted 12 lines
Quoted 11 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

bits instead.

Should the version ID here be aligned with VT-d spec?

Probably, this might be something that could be noticed by the management to migration compatibility.

Could you elaborate what we need to do for migration compatibility? I see version is already exported so libvirt can query it, see:

DEFINE_PROP_UINT32("version", IntelIOMMUState, version, 0),

Quoted 7 lines
Quoted 5 lines

It is the Qemu command line parameters not the version of the vmstate.

For example -device intel-iommu,version=3.0

Qemu then knows it should behave as 3.0.

So you want to bump vtd_vmstate.version?

Well, as I said, it's not a direct bumping.

Quoted 2 lines

In fact, this series change intel_iommu property from x-scalable-

mode=["on"|"off"]"

Quoted 5 lines

to x-scalable-mode=["legacy"|"modern"|"off"]".

My understanding management app should use same qemu cmdline in source and destination, so compatibility is already guaranteed even if we don't bump vtd_vmstate.version.

Exactly, so the point is to

vtd=3.0, the device works exactly as vtd spec 3.0. vtd=3.3, the device works exactly as vtd spec 3.3.

Yi just found version ID stored in VT-d VER_REG is not aligned with the VT-d spec version. For example, we see a local hw with vtd version 6.0 which is beyond VT-d spec version. We are asking VTD arch, will get back soon.

Quoted 6 lines
Quoted 4 lines

Or will you plan qemu vVT-d having its own version policy?

Thanks
Zhenzhong

Not unless there's a good reason to do this.

+1

Thanks

#20 lore raw

Hi Michael, Jason,

Quoted 145 lines · Jason Wang
Quoted 144 lines · Michael S. Tsirkin
Quoted 142 lines · Zhenzhong

Hi Jason,

Quoted 89 lines

-----Original Message-----
From: Duan, Zhenzhong
Subject: RE: [PATCH] intel_iommu: Use the latest fault reasons defined by spec

Quoted 5 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined by spec

Quoted 8 lines
Quoted 6 lines · Zhenzhong
Quoted 6 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined

by

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

spec

Quoted 6 lines · Zhenzhong
Quoted 6 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons

defined

Quoted 35 lines

by

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

spec

On Mon, May 20, 2024 at 12:15 PM Liu, Yi L <[email protected]>

Quoted 6 lines · wrote:
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

From: Duan, Zhenzhong <[email protected]>
Sent: Monday, May 20, 2024 11:41 AM

Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Sent: Monday, May 20, 2024 8:44 AM
To: Duan, Zhenzhong <[email protected]>
Cc: [email protected]; Liu, Yi L <[email protected]>; Peng,

Chao

Quoted 2 lines
Quoted 2 lines

P

Quoted 1 line
Quoted 1 line
Quoted 1 line

<[email protected]>; Yu Zhang

<[email protected]>;

Quoted 15 lines
Quoted 15 lines
Quoted 2 lines
Quoted 2 lines

Michael

Quoted 1 line
Quoted 1 line
Quoted 1 line

S. Tsirkin <[email protected]>; Paolo Bonzini

<[email protected]>;

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Richard Henderson <[email protected]>; Eduardo

Habkost

Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

<[email protected]>; Marcel Apfelbaum

<[email protected]>

Quoted 1 line
Quoted 1 line
Quoted 1 line

Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons

defined

Quoted 6 lines
Quoted 6 lines

by

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

spec

Quoted 1 line · Zhenzhong Duan
Quoted 12 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

From: Yu Zhang <[email protected]>

Currently we use only VTD_FR_PASID_TABLE_INV as fault

reason.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Update with more detailed fault reasons listed in VT-d spec

7.2.3.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

Signed-off-by: Yu Zhang <[email protected]>
Signed-off-by: Zhenzhong Duan <[email protected]>
---

I wonder if this could be noticed by the guest or not. If yes

should

Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

we consider starting to add thing like version to vtd emulation

code?

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Kernel only dumps the reason like below:

DMAR: [DMA Write NO_PASID] Request device [20:00.0] fault

addr

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

0x1234600000

Quoted 1 line
Quoted 1 line

[fault reason 0x71] SM: Present bit in first-level paging entry is

Quoted 46 lines
Quoted 3 lines

clear

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Yes, guest kernel would notice it as the fault would be injected to

vm.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Maybe bump 1.0 -> 1.1?
My understanding version number is only informational and is

far

Quoted 38 lines
Quoted 2 lines
Quoted 2 lines

from

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

accurate to mark if a feature supported. Driver should check

cap/ecap

Quoted 12 lines
Quoted 12 lines
Quoted 11 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

bits instead.

Should the version ID here be aligned with VT-d spec?

Probably, this might be something that could be noticed by the management to migration compatibility.

Could you elaborate what we need to do for migration compatibility? I see version is already exported so libvirt can query it, see:

DEFINE_PROP_UINT32("version", IntelIOMMUState, version, 0),

Quoted 7 lines
Quoted 5 lines

It is the Qemu command line parameters not the version of the vmstate.

For example -device intel-iommu,version=3.0

Qemu then knows it should behave as 3.0.

So you want to bump vtd_vmstate.version?

Well, as I said, it's not a direct bumping.

Quoted 2 lines

In fact, this series change intel_iommu property from x-scalable-

mode=["on"|"off"]"

Quoted 5 lines

to x-scalable-mode=["legacy"|"modern"|"off"]".

My understanding management app should use same qemu cmdline in source and destination, so compatibility is already guaranteed even if we don't bump vtd_vmstate.version.

Exactly, so the point is to

vtd=3.0, the device works exactly as vtd spec 3.0. vtd=3.3, the device works exactly as vtd spec 3.3.

Yi just found version ID stored in VT-d VER_REG is not aligned with the VT-d spec version. For example, we see a local hw with vtd version 6.0 which is beyond VT-d spec version. We are asking VTD arch, will get back soon.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

Or will you plan qemu vVT-d having its own version policy?

Thanks
Zhenzhong

Not unless there's a good reason to do this.

+1

Had more studying in the spec. Bumping up to 3.0 might not be trivial. :(

The VT-d spec has some requirements based on the version number. Below is a list of it. Although they are defined for hardware, but vVT-d may need to respect it as the same iommu driver runs for both the vVT-d and the hw VT-d. Per 1), if bumping up the major value to be 6 or higher, the vVT-d needs to ensure the register-based invalidation interface is not available. Per 2), if bump up the major version to be 2 or higher, the vVT-d needs to by default drain write and read requests no matter the software requests it or not.

1) Chapter 6.5 Invalidation of Translation Caches

For software to invalidate the various caching structures, the architecture supports the following two types of invalidation interfaces:
• Register-based invalidation interface: A legacy invalidation interface with limited capabilities. This interface is supported by hardware implementations of this architecture with Major Version 5 or lower (VER_REG). In all other hardware implementations, all requests are treated as invalid requests and will be ignored (for details see the CAIG field in the Context Command Register and the IAIG field in the IOTLB Invalidate Register).

2) Chapter 6.5.2.3 IOTLB Invalidate
• Drain Reads (DR): Software sets this flag to indicate hardware must drain read requests that are
already processed by the remapping hardware, but queued within the Root-Complex to be
completed. When the value of this flag is 1, hardware must drain the relevant reads before the
next Invalidation Wait Descriptor (see Section 6.5.2.8) is completed. Section 6.5.4 describes
hardware support for draining. Hardware implementations with Major Version 2 or higher
(VER_REG) will ignore this flag and always drain relevant reads before the next Invalidation Wait
Descriptor is completed.
• Drain Writes (DW): Software sets this flag to indicate hardware must drain relevant write
requests that are already processed by the remapping hardware, but queued within the RootComplex to be completed. When the value of this flag is 1, hardware must drain the relevant writes before the next Invalidation Wait Descriptor is completed. Section 6.5.4 describes
hardware support for draining. Hardware implementations with Major Version 2 or higher
(VER_REG) will ignore this flag and always drain relevant writes before the next Invalidation Wait
Descriptor is completed.

3) Chapter 11.4.2 Capability Register
Hardware implementations with Major Version 6 or higher (VER_REG) reporting the second-stage translation support (SSTS) field as Clear also report this field as 0.

4) Chapter 11.4.8.1 Protected Memory Enable Register
• Hardware implementations with Major Version 2 or higher (VER_REG) block all DMA requests accessing protected memory regions whether or not DMA remapping is enabled.

Also, as replied in the prior email, the VT-d architecture reports capability via the cap/ecap registers. The new fault reasons in this patch is meaningful only when the ecap.SMTS bit is set. So bumping version does not mean too much about the introduction of new capabilities. @Jason, given the above statements, can we reconsider if it is necessary to bump up the version number?

Signature · 2 lines
Regards,
Yi Liu
#21 lore raw

Hi Michael, Jason,

Based on Yi's analysis, is keeping current VERSION value acceptable for you? Look forward to your comments, currently this open blocks us from sending the next version.

Thanks
Zhenzhong

Quoted 256 lines

-----Original Message-----
From: Liu, Yi L <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined by spec

Hi Michael, Jason,

Quoted 1 line · Jason Wang

On Mon, May 27, 2024 at 2:50 PM Michael S. Tsirkin <[email protected]>

Quoted 7 lines · wrote:
Quoted 7 lines · Zhenzhong
Quoted 5 lines

Hi Jason,

Quoted 3 lines

-----Original Message-----
From: Duan, Zhenzhong
Subject: RE: [PATCH] intel_iommu: Use the latest fault reasons defined

by

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

spec

Quoted 3 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons

defined by

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

spec

Quoted 6 lines · Zhenzhong
Quoted 6 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons

defined

Quoted 23 lines
Quoted 23 lines
Quoted 23 lines
Quoted 23 lines

by

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

spec

Quoted 6 lines · Zhenzhong
Quoted 6 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons

defined

Quoted 11 lines

by

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

spec

On Mon, May 20, 2024 at 12:15 PM Liu, Yi L <[email protected]>

Quoted 6 lines · wrote:
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

From: Duan, Zhenzhong <[email protected]>
Sent: Monday, May 20, 2024 11:41 AM

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Sent: Monday, May 20, 2024 8:44 AM
To: Duan, Zhenzhong <[email protected]>
Cc: [email protected]; Liu, Yi L <[email protected]>;

Peng,

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines

Chao

Quoted 2 lines
Quoted 2 lines

P

Quoted 1 line
Quoted 1 line
Quoted 1 line

<[email protected]>; Yu Zhang

<[email protected]>;

Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines

Michael

Quoted 1 line
Quoted 1 line
Quoted 1 line

S. Tsirkin <[email protected]>; Paolo Bonzini

<[email protected]>;

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Richard Henderson <[email protected]>;

Eduardo

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Habkost

Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

<[email protected]>; Marcel Apfelbaum

<[email protected]>

Quoted 1 line
Quoted 1 line
Quoted 1 line

Subject: Re: [PATCH] intel_iommu: Use the latest fault

reasons

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

defined

Quoted 8 lines
Quoted 8 lines

by

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

spec

On Fri, May 17, 2024 at 6:26 PM Zhenzhong Duan
<[email protected]> wrote:

From: Yu Zhang <[email protected]>

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Currently we use only VTD_FR_PASID_TABLE_INV as fault

reason.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Update with more detailed fault reasons listed in VT-d spec

7.2.3.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Signed-off-by: Yu Zhang <[email protected]>
Signed-off-by: Zhenzhong Duan

<[email protected]>

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

---

I wonder if this could be noticed by the guest or not. If yes

should

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

we consider starting to add thing like version to vtd

emulation

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

code?

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Kernel only dumps the reason like below:

DMAR: [DMA Write NO_PASID] Request device [20:00.0] fault

addr

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

0x1234600000

Quoted 1 line
Quoted 1 line

[fault reason 0x71] SM: Present bit in first-level paging entry

is

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

clear

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Yes, guest kernel would notice it as the fault would be injected

to

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

vm.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Maybe bump 1.0 -> 1.1?
My understanding version number is only informational and

is

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

far

Quoted 3 lines
Quoted 2 lines
Quoted 2 lines

from

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

accurate to mark if a feature supported. Driver should check

cap/ecap

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

bits instead.

Should the version ID here be aligned with VT-d spec?

Probably, this might be something that could be noticed by the management to migration compatibility.

Could you elaborate what we need to do for migration

compatibility?

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

I see version is already exported so libvirt can query it, see:

DEFINE_PROP_UINT32("version", IntelIOMMUState, version, 0),

It is the Qemu command line parameters not the version of the

vmstate.

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 6 lines
Quoted 4 lines

For example -device intel-iommu,version=3.0

Qemu then knows it should behave as 3.0.

So you want to bump vtd_vmstate.version?

Well, as I said, it's not a direct bumping.

Quoted 1 line
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line

In fact, this series change intel_iommu property from x-scalable-

mode=["on"|"off"]"

Quoted 4 lines

to x-scalable-mode=["legacy"|"modern"|"off"]".

My understanding management app should use same qemu cmdline in source and destination, so compatibility is already guaranteed

even if

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line

we don't bump vtd_vmstate.version.

Exactly, so the point is to

vtd=3.0, the device works exactly as vtd spec 3.0. vtd=3.3, the device works exactly as vtd spec 3.3.

Yi just found version ID stored in VT-d VER_REG is not aligned with the

VT-d spec version.

Quoted 1 line
Quoted 1 line
Quoted 1 line

For example, we see a local hw with vtd version 6.0 which is beyond VT-

d spec version.

Quoted 10 lines
Quoted 8 lines
Quoted 6 lines

We are asking VTD arch, will get back soon.

Or will you plan qemu vVT-d having its own version policy?

Thanks
Zhenzhong

Not unless there's a good reason to do this.

+1

Had more studying in the spec. Bumping up to 3.0 might not be trivial. :(

The VT-d spec has some requirements based on the version number. Below is a
list of it. Although they are defined for hardware, but vVT-d may need to respect it as the same iommu driver runs for both the vVT-d and the hw VT-d. Per 1), if bumping up the major value to be 6 or higher, the vVT-d needs to ensure the register-based invalidation interface is not available. Per 2), if bump up the major version to be 2 or higher, the vVT-d needs to by default drain write and read requests no matter the software requests it or not.

1) Chapter 6.5 Invalidation of Translation Caches

For software to invalidate the various caching structures, the architecture supports the following two
types of invalidation interfaces:
• Register-based invalidation interface: A legacy invalidation interface with limited capabilities.
This interface is supported by hardware implementations of this architecture with Major Version 5
or lower (VER_REG). In all other hardware implementations, all requests are treated as invalid
requests and will be ignored (for details see the CAIG field in the Context Command Register and
the IAIG field in the IOTLB Invalidate Register).

2) Chapter 6.5.2.3 IOTLB Invalidate
• Drain Reads (DR): Software sets this flag to indicate hardware must drain read requests that are
already processed by the remapping hardware, but queued within the Root-Complex to be
completed. When the value of this flag is 1, hardware must drain the relevant reads before the
next Invalidation Wait Descriptor (see Section 6.5.2.8) is completed. Section 6.5.4 describes
hardware support for draining. Hardware implementations with Major Version
2 or higher
(VER_REG) will ignore this flag and always drain relevant reads before the next Invalidation Wait
Descriptor is completed.
• Drain Writes (DW): Software sets this flag to indicate hardware must drain relevant write
requests that are already processed by the remapping hardware, but queued within the RootComplex to be completed. When the value of this flag is 1, hardware must drain the relevant
writes before the next Invalidation Wait Descriptor is completed. Section 6.5.4 describes
hardware support for draining. Hardware implementations with Major Version
2 or higher
(VER_REG) will ignore this flag and always drain relevant writes before the next Invalidation Wait
Descriptor is completed.

3) Chapter 11.4.2 Capability Register
Hardware implementations with Major Version 6 or higher (VER_REG) reporting the second-stage translation support (SSTS) field as Clear also report this field as 0.

4) Chapter 11.4.8.1 Protected Memory Enable Register
• Hardware implementations with Major Version 2 or higher (VER_REG) block all DMA requests accessing protected memory regions whether or not DMA remapping is enabled.

Also, as replied in the prior email, the VT-d architecture reports capability via the cap/ecap registers. The new fault reasons in this patch is meaningful only when the ecap.SMTS bit is set. So bumping version does not mean too much about the introduction of new capabilities. @Jason, given the above statements, can we reconsider if it is necessary to bump up the version number?

--
Regards,
Yi Liu

#22 lore raw
Quoted 4 lines · Zhenzhong

Hi Michael, Jason,

Based on Yi's analysis, is keeping current VERSION value acceptable for you?

Fine with me.

Quoted 4 lines

Look forward to your comments, currently this open blocks us from sending the next version.

Thanks
Zhenzhong

Thanks

Quoted 257 lines
Quoted 257 lines

-----Original Message-----
From: Liu, Yi L <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined by spec

Hi Michael, Jason,

Quoted 1 line · Jason Wang

On Mon, May 27, 2024 at 2:50 PM Michael S. Tsirkin <[email protected]>

Quoted 7 lines · wrote:
Quoted 7 lines · Zhenzhong
Quoted 5 lines

Hi Jason,

Quoted 3 lines

-----Original Message-----
From: Duan, Zhenzhong
Subject: RE: [PATCH] intel_iommu: Use the latest fault reasons defined

by

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

spec

Quoted 3 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons

defined by

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

spec

Quoted 6 lines · Zhenzhong
Quoted 6 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons

defined

Quoted 23 lines
Quoted 23 lines
Quoted 23 lines
Quoted 23 lines

by

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

spec

Quoted 6 lines · Zhenzhong
Quoted 6 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons

defined

Quoted 11 lines

by

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

spec

On Mon, May 20, 2024 at 12:15 PM Liu, Yi L <[email protected]>

Quoted 6 lines · wrote:
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

From: Duan, Zhenzhong <[email protected]>
Sent: Monday, May 20, 2024 11:41 AM

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Sent: Monday, May 20, 2024 8:44 AM
To: Duan, Zhenzhong <[email protected]>
Cc: [email protected]; Liu, Yi L <[email protected]>;

Peng,

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines

Chao

Quoted 2 lines
Quoted 2 lines

P

Quoted 1 line
Quoted 1 line

<[email protected]>; Yu Zhang

<[email protected]>;

Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines

Michael

Quoted 1 line
Quoted 1 line

S. Tsirkin <[email protected]>; Paolo Bonzini

<[email protected]>;

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Richard Henderson <[email protected]>;

Eduardo

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Habkost

Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line

<[email protected]>; Marcel Apfelbaum

<[email protected]>

Quoted 1 line
Quoted 1 line

Subject: Re: [PATCH] intel_iommu: Use the latest fault

reasons

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

defined

Quoted 8 lines
Quoted 8 lines

by

Quoted 7 lines
Quoted 7 lines

spec

On Fri, May 17, 2024 at 6:26 PM Zhenzhong Duan
<[email protected]> wrote:

From: Yu Zhang <[email protected]>

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Currently we use only VTD_FR_PASID_TABLE_INV as fault

reason.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Update with more detailed fault reasons listed in VT-d spec

7.2.3.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Signed-off-by: Yu Zhang <[email protected]>
Signed-off-by: Zhenzhong Duan

<[email protected]>

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

---

I wonder if this could be noticed by the guest or not. If yes

should

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

we consider starting to add thing like version to vtd

emulation

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

code?

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Kernel only dumps the reason like below:

DMAR: [DMA Write NO_PASID] Request device [20:00.0] fault

addr

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

0x1234600000

Quoted 1 line
Quoted 1 line

[fault reason 0x71] SM: Present bit in first-level paging entry

is

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

clear

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Yes, guest kernel would notice it as the fault would be injected

to

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

vm.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Maybe bump 1.0 -> 1.1?
My understanding version number is only informational and

is

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

far

Quoted 3 lines
Quoted 2 lines
Quoted 2 lines

from

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

accurate to mark if a feature supported. Driver should check

cap/ecap

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

bits instead.

Should the version ID here be aligned with VT-d spec?

Probably, this might be something that could be noticed by the management to migration compatibility.

Could you elaborate what we need to do for migration

compatibility?

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

I see version is already exported so libvirt can query it, see:

DEFINE_PROP_UINT32("version", IntelIOMMUState, version, 0),

It is the Qemu command line parameters not the version of the

vmstate.

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 6 lines
Quoted 4 lines

For example -device intel-iommu,version=3.0

Qemu then knows it should behave as 3.0.

So you want to bump vtd_vmstate.version?

Well, as I said, it's not a direct bumping.

Quoted 1 line
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line

In fact, this series change intel_iommu property from x-scalable-

mode=["on"|"off"]"

Quoted 4 lines

to x-scalable-mode=["legacy"|"modern"|"off"]".

My understanding management app should use same qemu cmdline in source and destination, so compatibility is already guaranteed

even if

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line

we don't bump vtd_vmstate.version.

Exactly, so the point is to

vtd=3.0, the device works exactly as vtd spec 3.0. vtd=3.3, the device works exactly as vtd spec 3.3.

Yi just found version ID stored in VT-d VER_REG is not aligned with the

VT-d spec version.

Quoted 1 line
Quoted 1 line
Quoted 1 line

For example, we see a local hw with vtd version 6.0 which is beyond VT-

d spec version.

Quoted 10 lines
Quoted 8 lines
Quoted 6 lines

We are asking VTD arch, will get back soon.

Or will you plan qemu vVT-d having its own version policy?

Thanks
Zhenzhong

Not unless there's a good reason to do this.

+1

Had more studying in the spec. Bumping up to 3.0 might not be trivial. :(

The VT-d spec has some requirements based on the version number. Below is a
list of it. Although they are defined for hardware, but vVT-d may need to respect it as the same iommu driver runs for both the vVT-d and the hw VT-d. Per 1), if bumping up the major value to be 6 or higher, the vVT-d needs to ensure the register-based invalidation interface is not available. Per 2), if bump up the major version to be 2 or higher, the vVT-d needs to by default drain write and read requests no matter the software requests it or not.

1) Chapter 6.5 Invalidation of Translation Caches

For software to invalidate the various caching structures, the architecture supports the following two
types of invalidation interfaces:
• Register-based invalidation interface: A legacy invalidation interface with limited capabilities.
This interface is supported by hardware implementations of this architecture with Major Version 5
or lower (VER_REG). In all other hardware implementations, all requests are treated as invalid
requests and will be ignored (for details see the CAIG field in the Context Command Register and
the IAIG field in the IOTLB Invalidate Register).

2) Chapter 6.5.2.3 IOTLB Invalidate
• Drain Reads (DR): Software sets this flag to indicate hardware must drain read requests that are
already processed by the remapping hardware, but queued within the Root-Complex to be
completed. When the value of this flag is 1, hardware must drain the relevant reads before the
next Invalidation Wait Descriptor (see Section 6.5.2.8) is completed. Section 6.5.4 describes
hardware support for draining. Hardware implementations with Major Version
2 or higher
(VER_REG) will ignore this flag and always drain relevant reads before the next Invalidation Wait
Descriptor is completed.
• Drain Writes (DW): Software sets this flag to indicate hardware must drain relevant write
requests that are already processed by the remapping hardware, but queued within the RootComplex to be completed. When the value of this flag is 1, hardware must drain the relevant
writes before the next Invalidation Wait Descriptor is completed. Section 6.5.4 describes
hardware support for draining. Hardware implementations with Major Version
2 or higher
(VER_REG) will ignore this flag and always drain relevant writes before the next Invalidation Wait
Descriptor is completed.

3) Chapter 11.4.2 Capability Register
Hardware implementations with Major Version 6 or higher (VER_REG) reporting the second-stage translation support (SSTS) field as Clear also report this field as 0.

4) Chapter 11.4.8.1 Protected Memory Enable Register
• Hardware implementations with Major Version 2 or higher (VER_REG) block all DMA requests accessing protected memory regions whether or not DMA remapping is enabled.

Also, as replied in the prior email, the VT-d architecture reports capability via the cap/ecap registers. The new fault reasons in this patch is meaningful only when the ecap.SMTS bit is set. So bumping version does not mean too much about the introduction of new capabilities. @Jason, given the above statements, can we reconsider if it is necessary to bump up the version number?

--
Regards,
Yi Liu

#23 lore raw
In reply to Duan, Zhenzhong
Quoted 3 lines · Zhenzhong

Hi Michael, Jason,

Based on Yi's analysis, is keeping current VERSION value acceptable for you?

I think it's fine.

Quoted 261 lines

Look forward to your comments, currently this open blocks us from sending the next version.

Thanks
Zhenzhong

Quoted 256 lines

-----Original Message-----
From: Liu, Yi L <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined by spec

Hi Michael, Jason,

Quoted 1 line · Jason Wang

On Mon, May 27, 2024 at 2:50 PM Michael S. Tsirkin <[email protected]>

Quoted 7 lines · wrote:
Quoted 7 lines · Zhenzhong
Quoted 5 lines

Hi Jason,

Quoted 3 lines

-----Original Message-----
From: Duan, Zhenzhong
Subject: RE: [PATCH] intel_iommu: Use the latest fault reasons defined

by

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

spec

Quoted 3 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons

defined by

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

spec

Quoted 6 lines · Zhenzhong
Quoted 6 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons

defined

Quoted 23 lines
Quoted 23 lines
Quoted 23 lines
Quoted 23 lines

by

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

spec

Quoted 6 lines · Zhenzhong
Quoted 6 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons

defined

Quoted 11 lines

by

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

spec

On Mon, May 20, 2024 at 12:15 PM Liu, Yi L <[email protected]>

Quoted 6 lines · wrote:
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

From: Duan, Zhenzhong <[email protected]>
Sent: Monday, May 20, 2024 11:41 AM

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

-----Original Message-----
From: Jason Wang <[email protected]>
Sent: Monday, May 20, 2024 8:44 AM
To: Duan, Zhenzhong <[email protected]>
Cc: [email protected]; Liu, Yi L <[email protected]>;

Peng,

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines

Chao

Quoted 2 lines
Quoted 2 lines

P

Quoted 1 line
Quoted 1 line

<[email protected]>; Yu Zhang

<[email protected]>;

Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines

Michael

Quoted 1 line
Quoted 1 line

S. Tsirkin <[email protected]>; Paolo Bonzini

<[email protected]>;

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Richard Henderson <[email protected]>;

Eduardo

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Habkost

Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line

<[email protected]>; Marcel Apfelbaum

<[email protected]>

Quoted 1 line
Quoted 1 line

Subject: Re: [PATCH] intel_iommu: Use the latest fault

reasons

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

defined

Quoted 8 lines
Quoted 8 lines

by

Quoted 7 lines
Quoted 7 lines

spec

On Fri, May 17, 2024 at 6:26 PM Zhenzhong Duan
<[email protected]> wrote:

From: Yu Zhang <[email protected]>

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Currently we use only VTD_FR_PASID_TABLE_INV as fault

reason.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Update with more detailed fault reasons listed in VT-d spec

7.2.3.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Signed-off-by: Yu Zhang <[email protected]>
Signed-off-by: Zhenzhong Duan

<[email protected]>

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

---

I wonder if this could be noticed by the guest or not. If yes

should

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

we consider starting to add thing like version to vtd

emulation

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

code?

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Kernel only dumps the reason like below:

DMAR: [DMA Write NO_PASID] Request device [20:00.0] fault

addr

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

0x1234600000

Quoted 1 line
Quoted 1 line

[fault reason 0x71] SM: Present bit in first-level paging entry

is

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

clear

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Yes, guest kernel would notice it as the fault would be injected

to

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

vm.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Maybe bump 1.0 -> 1.1?
My understanding version number is only informational and

is

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

far

Quoted 3 lines
Quoted 2 lines
Quoted 2 lines

from

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

accurate to mark if a feature supported. Driver should check

cap/ecap

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

bits instead.

Should the version ID here be aligned with VT-d spec?

Probably, this might be something that could be noticed by the management to migration compatibility.

Could you elaborate what we need to do for migration

compatibility?

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

I see version is already exported so libvirt can query it, see:

DEFINE_PROP_UINT32("version", IntelIOMMUState, version, 0),

It is the Qemu command line parameters not the version of the

vmstate.

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 6 lines
Quoted 4 lines

For example -device intel-iommu,version=3.0

Qemu then knows it should behave as 3.0.

So you want to bump vtd_vmstate.version?

Well, as I said, it's not a direct bumping.

Quoted 1 line
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line

In fact, this series change intel_iommu property from x-scalable-

mode=["on"|"off"]"

Quoted 4 lines

to x-scalable-mode=["legacy"|"modern"|"off"]".

My understanding management app should use same qemu cmdline in source and destination, so compatibility is already guaranteed

even if

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line

we don't bump vtd_vmstate.version.

Exactly, so the point is to

vtd=3.0, the device works exactly as vtd spec 3.0. vtd=3.3, the device works exactly as vtd spec 3.3.

Yi just found version ID stored in VT-d VER_REG is not aligned with the

VT-d spec version.

Quoted 1 line
Quoted 1 line
Quoted 1 line

For example, we see a local hw with vtd version 6.0 which is beyond VT-

d spec version.

Quoted 10 lines
Quoted 8 lines
Quoted 6 lines

We are asking VTD arch, will get back soon.

Or will you plan qemu vVT-d having its own version policy?

Thanks
Zhenzhong

Not unless there's a good reason to do this.

+1

Had more studying in the spec. Bumping up to 3.0 might not be trivial. :(

The VT-d spec has some requirements based on the version number. Below is a
list of it. Although they are defined for hardware, but vVT-d may need to respect it as the same iommu driver runs for both the vVT-d and the hw VT-d. Per 1), if bumping up the major value to be 6 or higher, the vVT-d needs to ensure the register-based invalidation interface is not available. Per 2), if bump up the major version to be 2 or higher, the vVT-d needs to by default drain write and read requests no matter the software requests it or not.

1) Chapter 6.5 Invalidation of Translation Caches

For software to invalidate the various caching structures, the architecture supports the following two
types of invalidation interfaces:
• Register-based invalidation interface: A legacy invalidation interface with limited capabilities.
This interface is supported by hardware implementations of this architecture with Major Version 5
or lower (VER_REG). In all other hardware implementations, all requests are treated as invalid
requests and will be ignored (for details see the CAIG field in the Context Command Register and
the IAIG field in the IOTLB Invalidate Register).

2) Chapter 6.5.2.3 IOTLB Invalidate
• Drain Reads (DR): Software sets this flag to indicate hardware must drain read requests that are
already processed by the remapping hardware, but queued within the Root-Complex to be
completed. When the value of this flag is 1, hardware must drain the relevant reads before the
next Invalidation Wait Descriptor (see Section 6.5.2.8) is completed. Section 6.5.4 describes
hardware support for draining. Hardware implementations with Major Version
2 or higher
(VER_REG) will ignore this flag and always drain relevant reads before the next Invalidation Wait
Descriptor is completed.
• Drain Writes (DW): Software sets this flag to indicate hardware must drain relevant write
requests that are already processed by the remapping hardware, but queued within the RootComplex to be completed. When the value of this flag is 1, hardware must drain the relevant
writes before the next Invalidation Wait Descriptor is completed. Section 6.5.4 describes
hardware support for draining. Hardware implementations with Major Version
2 or higher
(VER_REG) will ignore this flag and always drain relevant writes before the next Invalidation Wait
Descriptor is completed.

3) Chapter 11.4.2 Capability Register
Hardware implementations with Major Version 6 or higher (VER_REG) reporting the second-stage translation support (SSTS) field as Clear also report this field as 0.

4) Chapter 11.4.8.1 Protected Memory Enable Register
• Hardware implementations with Major Version 2 or higher (VER_REG) block all DMA requests accessing protected memory regions whether or not DMA remapping is enabled.

Also, as replied in the prior email, the VT-d architecture reports capability via the cap/ecap registers. The new fault reasons in this patch is meaningful only when the ecap.SMTS bit is set. So bumping version does not mean too much about the introduction of new capabilities. @Jason, given the above statements, can we reconsider if it is necessary to bump up the version number?

--
Regards,
Yi Liu

#24 lore raw
In reply to Duan, Zhenzhong
Quoted 2 lines · Zhenzhong

But I'm not sure if there is a real scenario migrating to old qemu, why not just update qemu on destination?

Because you can not just update a huge cluster atomically.

Signature · 1 line
MST