From: "Michael S. Tsirkin" <mst@redhat.com>
To: Peter Xu <peterx@redhat.com>
Cc: qemu-devel@nongnu.org, jasowang@redhat.com, famz@redhat.com
Subject: Re: [Qemu-devel] [PATCH for-2.9 2/2] intel_iommu: extend supported guest aw to 48 bits
Date: Sun, 11 Dec 2016 05:13:45 +0200 [thread overview]
Message-ID: <20161211051011-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <1481089965-3888-3-git-send-email-peterx@redhat.com>
On Wed, Dec 07, 2016 at 01:52:45PM +0800, Peter Xu wrote:
> Previously vt-d codes only supports 39 bits iova address width. It won't
> be hard to extend it to 48 bits.
>
> After enabling this, we should be able to map larger iova addresses.
>
> To check whether 48 bits aw is enabled, we can grep in the guest dmesg
> with line: "dmar: Host address width 48" (previously it was 39).
>
> Signed-off-by: Peter Xu <peterx@redhat.com>
I suspect we can't do this for old machine types.
Need to behave in compatible ways.
Also, is 48 always enough? 5 level with 57 bits
is just around the corner.
And is it always supported? for things like vfio
to work, don't we need to check what does host support?
> ---
> hw/i386/intel_iommu_internal.h | 5 +++--
> include/hw/i386/intel_iommu.h | 2 +-
> 2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386/intel_iommu_internal.h
> index e808c67..00e1e16 100644
> --- a/hw/i386/intel_iommu_internal.h
> +++ b/hw/i386/intel_iommu_internal.h
> @@ -195,7 +195,7 @@
> #define VTD_DOMAIN_ID_SHIFT 16 /* 16-bit domain id for 64K domains */
> #define VTD_DOMAIN_ID_MASK ((1UL << VTD_DOMAIN_ID_SHIFT) - 1)
> #define VTD_CAP_ND (((VTD_DOMAIN_ID_SHIFT - 4) / 2) & 7ULL)
> -#define VTD_MGAW 39 /* Maximum Guest Address Width */
> +#define VTD_MGAW 48 /* Maximum Guest Address Width */
> #define VTD_CAP_MGAW (((VTD_MGAW - 1) & 0x3fULL) << 16)
> #define VTD_MAMV 18ULL
> #define VTD_CAP_MAMV (VTD_MAMV << 48)
> @@ -209,7 +209,8 @@
> #define VTD_CAP_SAGAW_39bit (0x2ULL << VTD_CAP_SAGAW_SHIFT)
> /* 48-bit AGAW, 4-level page-table */
> #define VTD_CAP_SAGAW_48bit (0x4ULL << VTD_CAP_SAGAW_SHIFT)
> -#define VTD_CAP_SAGAW VTD_CAP_SAGAW_39bit
> +#define VTD_CAP_SAGAW (VTD_CAP_SAGAW_39bit | \
> + VTD_CAP_SAGAW_48bit)
>
> /* IQT_REG */
> #define VTD_IQT_QT(val) (((val) >> 4) & 0x7fffULL)
> diff --git a/include/hw/i386/intel_iommu.h b/include/hw/i386/intel_iommu.h
> index 405c9d1..8e0fe65 100644
> --- a/include/hw/i386/intel_iommu.h
> +++ b/include/hw/i386/intel_iommu.h
> @@ -44,7 +44,7 @@
> #define VTD_SID_TO_DEVFN(sid) ((sid) & 0xff)
>
> #define DMAR_REG_SIZE 0x230
> -#define VTD_HOST_ADDRESS_WIDTH 39
> +#define VTD_HOST_ADDRESS_WIDTH 48
> #define VTD_HAW_MASK ((1ULL << VTD_HOST_ADDRESS_WIDTH) - 1)
>
> #define DMAR_REPORT_F_INTR (1)
> --
> 2.7.4
next prev parent reply other threads:[~2016-12-11 3:13 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-07 5:52 [Qemu-devel] [PATCH for-2.9 0/2] VT-d extend GAW to 48 bits Peter Xu
2016-12-07 5:52 ` [Qemu-devel] [PATCH for-2.9 1/2] intel_iommu: check validity for GAW bits in CE Peter Xu
2016-12-08 2:02 ` Jason Wang
2016-12-08 2:16 ` Peter Xu
2016-12-08 2:21 ` Jason Wang
2016-12-12 1:47 ` Peter Xu
2016-12-07 5:52 ` [Qemu-devel] [PATCH for-2.9 2/2] intel_iommu: extend supported guest aw to 48 bits Peter Xu
2016-12-08 2:00 ` Jason Wang
2016-12-11 3:13 ` Michael S. Tsirkin [this message]
2016-12-12 2:01 ` Peter Xu
2016-12-12 19:35 ` Alex Williamson
2016-12-13 3:33 ` Peter Xu
2016-12-13 3:51 ` Alex Williamson
2016-12-13 5:24 ` Peter Xu
2016-12-13 5:48 ` Alex Williamson
2016-12-13 6:12 ` Peter Xu
2016-12-13 13:17 ` Alex Williamson
2016-12-13 14:38 ` Michael S. Tsirkin
2016-12-13 5:00 ` Tian, Kevin
2016-12-13 5:31 ` Alex Williamson
2016-12-07 8:40 ` [Qemu-devel] [PATCH for-2.9 0/2] VT-d extend GAW " Fam Zheng
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=20161211051011-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=famz@redhat.com \
--cc=jasowang@redhat.com \
--cc=peterx@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.