From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: "Cédric Le Goater" <clg@kaod.org>, "Anton Blanchard" <anton@samba.org>
Cc: David Gibson <david@gibson.dropbear.id.au>,
qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/2] ppc: Fix 64K pages support in full emulation
Date: Fri, 01 Jul 2016 08:13:47 +1000 [thread overview]
Message-ID: <1467324827.7422.28.camel@kernel.crashing.org> (raw)
In-Reply-To: <e8488ee4-396c-02b0-5e28-39513c5f2b37@kaod.org>
On Thu, 2016-06-30 at 18:01 +0200, Cédric Le Goater wrote:
> +static uint32_t ppc_hash64_pte_size_decode(PowerPCCPU *cpu, uint64_t
> pte0,
> + uint64_t pte1, uint32_t
> slb_pshift)
> {
> - switch (slb_pshift) {
> - case 12:
> - return 12;
> - case 16:
> - if ((pte1 & 0xf000) == 0x1000) {
> - return 16;
> - }
> - return 0;
> - case 24:
> - if ((pte1 & 0xff000) == 0) {
> - return 24;
> - }
> - return 0;
> - }
> - return 0;
> + unsigned spshift;
> +
> + return ppc_hash64_hpte_page_shift_noslb(cpu, pte0, pte1,
> &spshift);
> }
Why not call ppc_hash64_hpte_page_shift_noslb() directly from the call
site ? That or rename it to ppc_hash64_pte_size_decode :-)
Otherwise yes, your patch looks correct as in what
doesppc_hash64_hpte_page_shift_noslb() is definitely more correct than
what ppc_hash64_pte_size_decode() is doing.
Cheers,
Ben.
next prev parent reply other threads:[~2016-06-30 22:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-28 6:48 [Qemu-devel] [PATCH 0/2] pnv: handle real mode addressing in HV mode Cédric Le Goater
2016-06-28 6:48 ` [Qemu-devel] [PATCH 1/2] ppc: Add proper real mode translation support Cédric Le Goater
2016-06-29 2:41 ` David Gibson
2016-06-29 2:59 ` Benjamin Herrenschmidt
2016-06-29 3:05 ` David Gibson
2016-06-28 6:48 ` [Qemu-devel] [PATCH 2/2] ppc: Fix 64K pages support in full emulation Cédric Le Goater
2016-06-29 2:22 ` David Gibson
2016-06-30 10:56 ` Anton Blanchard
2016-06-30 11:08 ` Benjamin Herrenschmidt
2016-06-30 16:01 ` Cédric Le Goater
2016-06-30 22:13 ` Benjamin Herrenschmidt [this message]
2016-06-30 23:56 ` David Gibson
2016-07-01 6:06 ` Cédric Le Goater
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=1467324827.7422.28.camel@kernel.crashing.org \
--to=benh@kernel.crashing.org \
--cc=anton@samba.org \
--cc=clg@kaod.org \
--cc=david@gibson.dropbear.id.au \
--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).