All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: mst@redhat.com, peterx@redhat.com
Cc: qemu-devel@nongnu.org, yi.y.sun@linux.intel.com,
	eperezma@redhat.com, lulu@redhat.com,
	Jason Wang <jasowang@redhat.com>
Subject: [PATCH V5 1/4] intel-iommu: don't warn guest errors when getting rid2pasid entry
Date: Fri, 28 Oct 2022 14:14:33 +0800	[thread overview]
Message-ID: <20221028061436.30093-2-jasowang@redhat.com> (raw)
In-Reply-To: <20221028061436.30093-1-jasowang@redhat.com>

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(-)

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
-- 
2.25.1



  reply	other threads:[~2022-10-28  6:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-28  6:14 [PATCH V5 0/4] PASID support for Intel IOMMU Jason Wang
2022-10-28  6:14 ` Jason Wang [this message]
2022-10-28 13:43   ` [PATCH V5 1/4] intel-iommu: don't warn guest errors when getting rid2pasid entry Yi Liu
2022-10-28  6:14 ` [PATCH V5 2/4] intel-iommu: drop VTDBus Jason Wang
2022-10-30 10:39   ` Yi Liu
2022-11-01  2:05     ` Jason Wang
2022-11-05 17:37   ` Michael S. Tsirkin
2022-11-07  7:00     ` Jason Wang
2022-10-28  6:14 ` [PATCH V5 3/4] intel-iommu: convert VTD_PE_GET_FPD_ERR() to be a function Jason Wang
2022-10-28 13:45   ` Yi Liu
2022-10-28  6:14 ` [PATCH V5 4/4] intel-iommu: PASID support Jason Wang
2022-10-28 13:49   ` Yi Liu
2022-10-31  6:43     ` Michael S. Tsirkin
2022-10-31  9:15       ` Jason Wang
2022-10-31  9:28         ` Yi Liu
2022-11-01  1:55           ` Jason Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221028061436.30093-2-jasowang@redhat.com \
    --to=jasowang@redhat.com \
    --cc=eperezma@redhat.com \
    --cc=lulu@redhat.com \
    --cc=mst@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yi.y.sun@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.