From: David Gibson <david@gibson.dropbear.id.au>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
Alex Williamson <alex.williamson@redhat.com>,
Reza Arbab <arbab@linux.ibm.com>,
Piotr Jaroszynski <pjaroszynski@nvidia.com>,
Jose Ricardo Ziviani <joserz@linux.ibm.com>,
Daniel Henrique Barboza <danielhb413@gmail.com>
Subject: Re: [Qemu-devel] [PATCH qemu v2 2/4] vfio/spapr: Rename local systempagesize variable
Date: Fri, 15 Feb 2019 14:57:19 +1100 [thread overview]
Message-ID: <20190215035718.GJ4573@umbus.fritz.box> (raw)
In-Reply-To: <50c941bc-8705-2519-737b-b688edfde395@ozlabs.ru>
[-- Attachment #1: Type: text/plain, Size: 2763 bytes --]
On Fri, Feb 15, 2019 at 02:37:55PM +1100, Alexey Kardashevskiy wrote:
>
>
> On 15/02/2019 14:32, David Gibson wrote:
> > On Thu, Feb 14, 2019 at 04:21:42PM +1100, Alexey Kardashevskiy wrote:
> >> The "systempagesize" name suggests that it is the host system page size
> >> while it is the smallest page size of memory backing the guest RAM so
> >> let's rename it to stop confusion. This should cause no behavioral change.
> >>
> >> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> >> ---
> >> hw/vfio/spapr.c | 6 +++---
> >> 1 file changed, 3 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/hw/vfio/spapr.c b/hw/vfio/spapr.c
> >> index 302d6b0..1498fee 100644
> >> --- a/hw/vfio/spapr.c
> >> +++ b/hw/vfio/spapr.c
> >> @@ -148,14 +148,14 @@ int vfio_spapr_create_window(VFIOContainer *container,
> >> uint64_t pagesize = memory_region_iommu_get_min_page_size(iommu_mr);
> >> unsigned entries, bits_total, bits_per_level, max_levels;
> >> struct vfio_iommu_spapr_tce_create create = { .argsz = sizeof(create) };
> >> - long systempagesize = qemu_getrampagesize();
> >> + long minpagesize = qemu_getrampagesize();
> >
> > I'd prefer "rampagesize" or "minrampagesize" here. "minpagesize"
> > doesn't make it clear what it's the minimum of, whereas rampagesize at
> > least makes it clear it's the same thing that qemu_getrampagesize() is
> > working with.
>
> In my mind "ram" in this context is a guest RAM but here is it not (is
> is backend)
Well.. it is guest RAM, in that we're only considering the backing
page size for memory mapped into the guest as RAM. I guess it is a
host page size, but then guest page sizes don't really exist until the
guest starts mapping things (and may not be unique, since it could
map the same memory in multiple ways).
> so I just avoided using any specifics in the name (system,
> ram) to make the reader of this code look around where the value comes
> from which is the qemu_getrampagesize() helper (more descriptive name).
>
>
>
> >
> >> /*
> >> * The host might not support the guest supported IOMMU page size,
> >> * so we will use smaller physical IOMMU pages to back them.
> >> */
> >> - if (pagesize > systempagesize) {
> >> - pagesize = systempagesize;
> >> + if (pagesize > minpagesize) {
> >> + pagesize = minpagesize;
> >> }
> >> pagesize = 1ULL << (63 - clz64(container->pgsizes &
> >> (pagesize | (pagesize - 1))));
> >
>
--
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: 833 bytes --]
next prev parent reply other threads:[~2019-02-15 4:05 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-14 5:21 [Qemu-devel] [PATCH qemu v2 0/4] spapr_pci, vfio: NVIDIA V100 + POWER9 passthrough Alexey Kardashevskiy
2019-02-14 5:21 ` [Qemu-devel] [PATCH qemu v2 1/4] vfio/spapr: Fix indirect levels calculation Alexey Kardashevskiy
2019-02-15 1:03 ` David Gibson
2019-02-14 5:21 ` [Qemu-devel] [PATCH qemu v2 2/4] vfio/spapr: Rename local systempagesize variable Alexey Kardashevskiy
2019-02-15 3:32 ` David Gibson
2019-02-15 3:37 ` Alexey Kardashevskiy
2019-02-15 3:57 ` David Gibson [this message]
2019-02-15 4:47 ` Alexey Kardashevskiy
2019-02-14 5:21 ` [Qemu-devel] [PATCH qemu v2 3/4] vfio: Make vfio_get_region_info_cap public Alexey Kardashevskiy
2019-02-14 5:21 ` [Qemu-devel] [PATCH qemu v2 4/4] spapr: Support NVIDIA V100 GPU with NVLink2 Alexey Kardashevskiy
2019-02-15 3:22 ` David Gibson
2019-02-15 4:42 ` Alexey Kardashevskiy
2019-02-15 5:30 ` David Gibson
2019-02-19 0:52 ` Alexey Kardashevskiy
2019-02-14 23:37 ` [Qemu-devel] [PATCH qemu v2 0/4] spapr_pci, vfio: NVIDIA V100 + POWER9 passthrough Alex Williamson
2019-02-15 0:35 ` Alexey Kardashevskiy
2019-02-15 3:24 ` David Gibson
2019-02-15 3:32 ` Alexey Kardashevskiy
2019-02-15 3:54 ` David Gibson
2019-02-15 4:34 ` Alexey Kardashevskiy
2019-02-15 5:21 ` David Gibson
2019-02-25 6:39 ` Alexey Kardashevskiy
2019-02-28 2:21 ` David Gibson
2019-02-15 3:22 ` 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=20190215035718.GJ4573@umbus.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=aik@ozlabs.ru \
--cc=alex.williamson@redhat.com \
--cc=arbab@linux.ibm.com \
--cc=danielhb413@gmail.com \
--cc=joserz@linux.ibm.com \
--cc=pjaroszynski@nvidia.com \
--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).