From: David Gibson <david@gibson.dropbear.id.au>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org
Subject: Re: [Qemu-devel] [PATCH qemu 2/2] spapr_pci: Advertise 16M IOMMU pages when available
Date: Tue, 3 Jan 2017 10:41:28 +1100 [thread overview]
Message-ID: <20170102234128.GI12761@umbus.fritz.box> (raw)
In-Reply-To: <20161222052212.49006-3-aik@ozlabs.ru>
[-- Attachment #1: Type: text/plain, Size: 1833 bytes --]
On Thu, Dec 22, 2016 at 04:22:12PM +1100, Alexey Kardashevskiy wrote:
> On sPAPR, IOMMU page size varies and if QEMU is running with RAM
> backed with hugepages, we can advertise this to the guest so does
> this patch.
>
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
> hw/ppc/spapr_pci.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
> index fd6fc1d953..09244056fc 100644
> --- a/hw/ppc/spapr_pci.c
> +++ b/hw/ppc/spapr_pci.c
> @@ -1505,6 +1505,9 @@ static void spapr_phb_realize(DeviceState *dev, Error **errp)
> }
>
> /* DMA setup */
> + /* This allows huge pages for IOMMU when guest is backed with huge pages */
> + sphb->page_size_mask |= qemu_getrampagesize();
This doesn't look right - you're unconditionally enabling the host ram
page size, regardless of anything else. Instead the backing page size
should be used to filter out those sizes which are possible from the
list of those supported by the guest hardware. This patch will give
particularly odd results if you ran it on x86 with hugepages for
example: it would advertise a 2M IOMMU page size, which could never
exist on native POWER.
Except... come to think of it, why is the backing RAM page size
relevant at all? Or rather.. I think VFIO should be able to cope with
any guest IOMMU page size which is larger than the host ram page size
(although if it's much larger it could get expensive in the host
tables). This case would already be routine for ppc64 on x86, where
the guest IOMMU page size is 64kiB, but the host page size is 4 kiB.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2017-01-02 23:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-22 5:22 [Qemu-devel] [PATCH qemu 0/2] exec, spapr_pci: Advertise huge IOMMU pages Alexey Kardashevskiy
2016-12-22 5:22 ` [Qemu-devel] [PATCH qemu 1/2] exec, kvm, target-ppc: Move getrampagesize() to common code Alexey Kardashevskiy
2017-01-02 23:34 ` David Gibson
2017-02-09 5:43 ` Alexey Kardashevskiy
2017-02-09 11:48 ` Paolo Bonzini
2017-02-10 0:41 ` David Gibson
2017-02-28 8:12 ` Alexey Kardashevskiy
2017-03-01 1:06 ` David Gibson
2017-03-01 2:52 ` David Gibson
2016-12-22 5:22 ` [Qemu-devel] [PATCH qemu 2/2] spapr_pci: Advertise 16M IOMMU pages when available Alexey Kardashevskiy
2017-01-02 23:41 ` David Gibson [this message]
2017-01-09 2:06 ` Alexey Kardashevskiy
2017-01-12 5:09 ` David Gibson
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=20170102234128.GI12761@umbus.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=aik@ozlabs.ru \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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 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).