qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH V5 1/4] intel-iommu: don't warn guest errors when getting rid


From: Yi Liu
Subject: Re: [PATCH V5 1/4] intel-iommu: don't warn guest errors when getting rid2pasid entry
Date: Fri, 28 Oct 2022 21:43:50 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.11.0

On 2022/10/28 14:14, Jason Wang wrote:
We use to warn on wrong rid2pasid entry. But this error could be
triggered by the guest and could happens during initialization. So
let's don't warn in this case.

Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
Changes since v4:
- Tweak the code to avoid using ret variable
---
  hw/i386/intel_iommu.c | 12 ++++++------
  1 file changed, 6 insertions(+), 6 deletions(-)
Reviewed-by: Yi Liu <yi.l.liu@intel.com>

diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 6524c2ee32..271de995be 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -1554,8 +1554,10 @@ static bool vtd_dev_pt_enabled(IntelIOMMUState *s, 
VTDContextEntry *ce)
      if (s->root_scalable) {
          ret = vtd_ce_get_rid2pasid_entry(s, ce, &pe);
          if (ret) {
-            error_report_once("%s: vtd_ce_get_rid2pasid_entry error: %"PRId32,
-                              __func__, ret);
+            /*
+             * This error is guest triggerable. We should assumt PT
+             * not enabled for safety.
+             */
              return false;
          }
          return (VTD_PE_GET_TYPE(&pe) == VTD_SM_PASID_ENTRY_PT);
@@ -1569,14 +1571,12 @@ static bool vtd_as_pt_enabled(VTDAddressSpace *as)
  {
      IntelIOMMUState *s;
      VTDContextEntry ce;
-    int ret;
assert(as); s = as->iommu_state;
-    ret = vtd_dev_to_context_entry(s, pci_bus_num(as->bus),
-                                   as->devfn, &ce);
-    if (ret) {
+    if (vtd_dev_to_context_entry(s, pci_bus_num(as->bus), as->devfn,
+                                 &ce)) {
          /*
           * Possibly failed to parse the context entry for some reason
           * (e.g., during init, or any guest configuration errors on
--
Regards,
Yi Liu



reply via email to

[Prev in Thread] Current Thread [Next in Thread]