From: Jason Wang <jasowang@redhat.com>
To: "Tian, Kevin" <kevin.tian@intel.com>
Cc: "Liu, Yi L" <yi.l.liu@intel.com>,
"yi.y.sun@linux.intel.com" <yi.y.sun@linux.intel.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"peterx@redhat.com" <peterx@redhat.com>,
"mst@redhat.com" <mst@redhat.com>
Subject: Re: [PATCH V2 1/4] intel-iommu: don't warn guest errors when getting rid2pasid entry
Date: Mon, 28 Mar 2022 10:27:01 +0800 [thread overview]
Message-ID: <CACGkMEsKJjnBb0qPM8oZvSHt326pMF8JCN8Fu1Qqjeu5pmdfMg@mail.gmail.com> (raw)
In-Reply-To: <BN9PR11MB52769DCA64DCF7B107FD244B8C199@BN9PR11MB5276.namprd11.prod.outlook.com>
On Thu, Mar 24, 2022 at 4:21 PM Tian, Kevin <kevin.tian@intel.com> wrote:
>
> > From: Jason Wang
> > Sent: Monday, March 21, 2022 1:54 PM
> >
> > 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.
> >
> > Signed-off-by: Jason Wang <jasowang@redhat.com>
> > ---
> > hw/i386/intel_iommu.c | 6 ++++--
> > 1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
> > index 874d01c162..90964b201c 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.
> > + */
>
> suppose a VT-d fault should be queued in this case besides returning false:
>
> SPD.1: A hardware attempt to access the scalable-mode PASID-directory
> entry referenced through the PASIDDIRPTR field in scalable-mode
> context-entry resulted in an error
>
> SPT.1: A hardware attempt to access a scalable-mode PASID-table entry
> referenced through the SMPTBLPTR field in a scalable-mode PASID-directory
> entry resulted in an error.
Probably, but this issue is not introduced in this patch. We can fix
it on top if necessary.
>
> Currently the implementation of vtd_ce_get_rid2pasid_entry() is also
> problematic. According to VT-d spec, RID2PASID field is effective only
> when ecap.rps is true otherwise PASID#0 is used for RID2PASID. I didn't
> see ecap.rps is set, neither is it checked in that function. It works possibly
> just because Linux currently programs 0 to RID2PASID...
This seems to be another issue since the introduction of scalable mode.
Thanks
>
> > return false;
> > }
> > return (VTD_PE_GET_TYPE(&pe) == VTD_SM_PASID_ENTRY_PT);
> > --
> > 2.25.1
> >
>
next prev parent reply other threads:[~2022-03-28 2:28 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-21 5:54 [PATCH V2 0/4] PASID support for Intel IOMMU Jason Wang
2022-03-21 5:54 ` [PATCH V2 1/4] intel-iommu: don't warn guest errors when getting rid2pasid entry Jason Wang
2022-03-24 8:21 ` Tian, Kevin
2022-03-28 2:27 ` Jason Wang [this message]
2022-03-28 8:53 ` Yi Liu
2022-03-29 4:52 ` Jason Wang
2022-03-30 8:16 ` Tian, Kevin
2022-03-30 8:36 ` Jason Wang
2022-04-02 7:33 ` Tian, Kevin
2022-04-06 3:33 ` Jason Wang
2022-04-06 3:41 ` Tian, Kevin
2022-04-22 0:13 ` Peter Xu
2022-04-22 6:24 ` Jason Wang
2022-04-22 7:57 ` Michael S. Tsirkin
2022-03-21 5:54 ` [PATCH V2 2/4] intel-iommu: drop VTDBus Jason Wang
2022-04-22 1:17 ` Peter Xu
2022-04-22 6:26 ` Jason Wang
2022-04-22 12:55 ` Peter Xu
2022-03-21 5:54 ` [PATCH V2 3/4] intel-iommu: convert VTD_PE_GET_FPD_ERR() to be a function Jason Wang
2022-03-24 8:26 ` Tian, Kevin
2022-03-28 2:27 ` Jason Wang
2022-04-22 13:08 ` Peter Xu
2022-03-21 5:54 ` [PATCH V2 4/4] intel-iommu: PASID support Jason Wang
2022-03-24 8:53 ` Tian, Kevin
2022-03-28 2:31 ` Jason Wang
2022-03-28 6:47 ` Tian, Kevin
2022-03-29 4:46 ` Jason Wang
2022-03-30 8:00 ` Tian, Kevin
2022-03-30 8:32 ` Jason Wang
2022-04-02 7:27 ` Tian, Kevin
2022-04-06 3:31 ` Jason Wang
2022-04-22 15:03 ` Peter Xu
2022-04-23 16:51 ` Michael S. Tsirkin
2022-03-28 7:03 ` Tian, Kevin
2022-03-29 4:48 ` Jason Wang
2022-03-30 8:02 ` Tian, Kevin
2022-03-30 8:31 ` Jason Wang
2022-04-02 7:24 ` Tian, Kevin
2022-04-06 3:31 ` Jason Wang
2022-03-28 8:45 ` Yi Liu
2022-03-29 4:54 ` Jason Wang
2022-04-01 13:42 ` Yi Liu
2022-04-02 1:52 ` 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=CACGkMEsKJjnBb0qPM8oZvSHt326pMF8JCN8Fu1Qqjeu5pmdfMg@mail.gmail.com \
--to=jasowang@redhat.com \
--cc=kevin.tian@intel.com \
--cc=mst@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=yi.l.liu@intel.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).