From: Peter Xu <peterx@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: qemu-devel@nongnu.org, kevin.tian@intel.com, famz@redhat.com,
jasowang@redhat.com, alex.williamson@redhat.com
Subject: Re: [Qemu-devel] [PATCH v3 1/2] intel_iommu: check validity for GAW bits in CE
Date: Wed, 14 Dec 2016 10:53:43 +0800 [thread overview]
Message-ID: <20161214025343.GG32222@pxdev.xzpeter.org> (raw)
In-Reply-To: <20161214044741-mutt-send-email-mst@kernel.org>
On Wed, Dec 14, 2016 at 04:48:42AM +0200, Michael S. Tsirkin wrote:
> On Wed, Dec 14, 2016 at 10:09:04AM +0800, Peter Xu wrote:
> > Currently vt-d Context Entry (CE) only allows 39/48 bits address width.
> > If guest software configured more than that, we complain and report.
> >
> > Signed-off-by: Peter Xu <peterx@redhat.com>
> > ---
> > hw/i386/intel_iommu.c | 17 ++++++++++++++++-
> > hw/i386/intel_iommu_internal.h | 2 ++
> > 2 files changed, 18 insertions(+), 1 deletion(-)
> >
> > diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
> > index 5f3e351..517a2a3 100644
> > --- a/hw/i386/intel_iommu.c
> > +++ b/hw/i386/intel_iommu.c
> > @@ -599,9 +599,19 @@ static inline uint32_t vtd_get_level_from_context_entry(VTDContextEntry *ce)
> > return 2 + (ce->hi & VTD_CONTEXT_ENTRY_AW);
> > }
> >
> > +/* Return 0 if failed to fetch valid aw */
> > static inline uint32_t vtd_get_agaw_from_context_entry(VTDContextEntry *ce)
> > {
> > - return 30 + (ce->hi & VTD_CONTEXT_ENTRY_AW) * 9;
> > + uint8_t aw = (ce->hi & VTD_CONTEXT_ENTRY_AW);
> > + /*
> > + * According to vt-d spec 10.4.2 bits 12:8, SAGAW only allows
> > + * 39/48 bits.
> > + */
> > + if (aw > VTD_CE_AW_48BIT) {
>
> 5-level is almost sure to allow more. I don't see the point of this test.
Please check above comment - spec only allow 3/4 level page table.
My version of vt-d spec is 2016 Oct. I suppose that's new enough...
-- peterx
next prev parent reply other threads:[~2016-12-14 2:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-14 2:09 [Qemu-devel] [PATCH v3 0/2] VT-d supports 48 bits address width Peter Xu
2016-12-14 2:09 ` [Qemu-devel] [PATCH v3 1/2] intel_iommu: check validity for GAW bits in CE Peter Xu
2016-12-14 2:48 ` Michael S. Tsirkin
2016-12-14 2:53 ` Peter Xu [this message]
2016-12-16 2:28 ` Tian, Kevin
2016-12-14 2:09 ` [Qemu-devel] [PATCH v3 2/2] intel_iommu: provide "x-aw-bits" parameter Peter Xu
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=20161214025343.GG32222@pxdev.xzpeter.org \
--to=peterx@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=famz@redhat.com \
--cc=jasowang@redhat.com \
--cc=kevin.tian@intel.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/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.