qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Sam Bobroff <sam.bobroff@au1.ibm.com>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, sjitindarsingh@gmail.com
Subject: Re: [Qemu-devel] [RFC PATCH v2 10/12] spapr: move spapr_populate_pa_features()
Date: Tue, 28 Feb 2017 11:29:14 +1100	[thread overview]
Message-ID: <20170228002914.GE17615@umbus.fritz.box> (raw)
In-Reply-To: <ac9e5c1e3b571f0286a2ebcd955abfd7be5d7ac7.1487829585.git.sam.bobroff@au1.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 4595 bytes --]

On Thu, Feb 23, 2017 at 05:00:03PM +1100, Sam Bobroff wrote:
> In the next patch, spapr_fixup_cpu_dt() will need to call
> spapr_populate_pa_features() so move it's definition up without making
> any other changes.

s/it's/its/

> 
> Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
> ---
>  hw/ppc/spapr.c | 86 +++++++++++++++++++++++++++++-----------------------------
>  1 file changed, 43 insertions(+), 43 deletions(-)
> 
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index dfee0f685f..0c0782b558 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -194,6 +194,49 @@ static int spapr_fixup_cpu_numa_dt(void *fdt, int offset, CPUState *cs)
>      return ret;
>  }
>  
> +/* Populate the "ibm,pa-features" property */
> +static void spapr_populate_pa_features(CPUPPCState *env, void *fdt, int offset)
> +{
> +    uint8_t pa_features_206[] = { 6, 0,
> +        0xf6, 0x1f, 0xc7, 0x00, 0x80, 0xc0 };
> +    uint8_t pa_features_207[] = { 24, 0,
> +        0xf6, 0x1f, 0xc7, 0xc0, 0x80, 0xf0,
> +        0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
> +        0x00, 0x00, 0x00, 0x00, 0x80, 0x00,
> +        0x80, 0x00, 0x80, 0x00, 0x00, 0x00 };
> +    uint8_t *pa_features;
> +    size_t pa_size;
> +
> +    switch (POWERPC_MMU_VER(env->mmu_model)) {
> +    case POWERPC_MMU_VER_2_06:
> +        pa_features = pa_features_206;
> +        pa_size = sizeof(pa_features_206);
> +        break;
> +    case POWERPC_MMU_VER_2_07:
> +        pa_features = pa_features_207;
> +        pa_size = sizeof(pa_features_207);
> +        break;
> +    default:
> +        return;
> +    }
> +
> +    if (env->ci_large_pages) {
> +        /*
> +         * Note: we keep CI large pages off by default because a 64K capable
> +         * guest provisioned with large pages might otherwise try to map a qemu
> +         * framebuffer (or other kind of memory mapped PCI BAR) using 64K pages
> +         * even if that qemu runs on a 4k host.
> +         * We dd this bit back here if we are confident this is not an issue
> +         */
> +        pa_features[3] |= 0x20;
> +    }
> +    if (kvmppc_has_cap_htm() && pa_size > 24) {
> +        pa_features[24] |= 0x80;    /* Transactional memory support */
> +    }
> +
> +    _FDT((fdt_setprop(fdt, offset, "ibm,pa-features", pa_features, pa_size)));
> +}
> +
>  static int spapr_fixup_cpu_dt(void *fdt, sPAPRMachineState *spapr)
>  {
>      int ret = 0, offset, cpus_offset;
> @@ -346,49 +389,6 @@ static int spapr_populate_memory(sPAPRMachineState *spapr, void *fdt)
>      return 0;
>  }
>  
> -/* Populate the "ibm,pa-features" property */
> -static void spapr_populate_pa_features(CPUPPCState *env, void *fdt, int offset)
> -{
> -    uint8_t pa_features_206[] = { 6, 0,
> -        0xf6, 0x1f, 0xc7, 0x00, 0x80, 0xc0 };
> -    uint8_t pa_features_207[] = { 24, 0,
> -        0xf6, 0x1f, 0xc7, 0xc0, 0x80, 0xf0,
> -        0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
> -        0x00, 0x00, 0x00, 0x00, 0x80, 0x00,
> -        0x80, 0x00, 0x80, 0x00, 0x00, 0x00 };
> -    uint8_t *pa_features;
> -    size_t pa_size;
> -
> -    switch (POWERPC_MMU_VER(env->mmu_model)) {
> -    case POWERPC_MMU_VER_2_06:
> -        pa_features = pa_features_206;
> -        pa_size = sizeof(pa_features_206);
> -        break;
> -    case POWERPC_MMU_VER_2_07:
> -        pa_features = pa_features_207;
> -        pa_size = sizeof(pa_features_207);
> -        break;
> -    default:
> -        return;
> -    }
> -
> -    if (env->ci_large_pages) {
> -        /*
> -         * Note: we keep CI large pages off by default because a 64K capable
> -         * guest provisioned with large pages might otherwise try to map a qemu
> -         * framebuffer (or other kind of memory mapped PCI BAR) using 64K pages
> -         * even if that qemu runs on a 4k host.
> -         * We dd this bit back here if we are confident this is not an issue
> -         */
> -        pa_features[3] |= 0x20;
> -    }
> -    if (kvmppc_has_cap_htm() && pa_size > 24) {
> -        pa_features[24] |= 0x80;    /* Transactional memory support */
> -    }
> -
> -    _FDT((fdt_setprop(fdt, offset, "ibm,pa-features", pa_features, pa_size)));
> -}
> -
>  static void spapr_populate_cpu_dt(CPUState *cs, void *fdt, int offset,
>                                    sPAPRMachineState *spapr)
>  {

-- 
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 --]

  reply	other threads:[~2017-02-28  0:36 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-23  5:59 [Qemu-devel] [RFC PATCH v2 00/12] ISA 3.00 KVM guest support Sam Bobroff
2017-02-23  5:59 ` [Qemu-devel] [RFC PATCH v2 01/12] spapr: Small cleanup of PPC MMU enums Sam Bobroff
2017-02-27  6:22   ` David Gibson
2017-02-23  5:59 ` [Qemu-devel] [RFC PATCH v2 02/12] scripts/update-linux-headers.sh: refactor extra files Sam Bobroff
2017-02-27  6:24   ` David Gibson
2017-02-23  5:59 ` [Qemu-devel] [RFC PATCH v2 03/12] scripts/update-linux-headers.sh: add new files for ARM Sam Bobroff
2017-02-23  5:59 ` [Qemu-devel] [RFC PATCH v2 04/12] Move virtio_mmio.h to fix update-linux-headers.sh Sam Bobroff
2017-02-24 16:40   ` Michael S. Tsirkin
2017-02-24 16:47   ` Michael S. Tsirkin
2017-02-28  2:23     ` Sam Bobroff
2017-02-23  5:59 ` [Qemu-devel] [RFC PATCH v2 05/12] Update headers using update-linux-headers.sh Sam Bobroff
2017-02-23  5:59 ` [Qemu-devel] [RFC PATCH v2 06/12] spapr: Add ibm, processor-radix-AP-encodings to the device tree Sam Bobroff
2017-02-28  0:12   ` David Gibson
2017-02-28  2:27     ` Suraj Jitindar Singh
2017-02-23  6:00 ` [Qemu-devel] [RFC PATCH v2 07/12] target-ppc: support KVM_CAP_PPC_MMU_RADIX, KVM_CAP_PPC_MMU_HASH_V3 Sam Bobroff
2017-02-28  0:13   ` David Gibson
2017-02-23  6:00 ` [Qemu-devel] [RFC PATCH v2 08/12] spapr: Only setup HTP if necessary Sam Bobroff
2017-02-28  0:28   ` David Gibson
2017-02-28  2:25     ` Suraj Jitindar Singh
2017-02-28  3:19       ` David Gibson
2017-03-01  5:17         ` Suraj Jitindar Singh
2017-03-03  5:04           ` David Gibson
2017-02-23  6:00 ` [Qemu-devel] [RFC PATCH v2 09/12] spapr: Add h_register_process_table() hypercall Sam Bobroff
2017-02-23  6:00 ` [Qemu-devel] [RFC PATCH v2 10/12] spapr: move spapr_populate_pa_features() Sam Bobroff
2017-02-28  0:29   ` David Gibson [this message]
2017-02-23  6:00 ` [Qemu-devel] [RFC PATCH v2 11/12] spapr: Enable ISA 3.0 MMU mode selection via CAS Sam Bobroff
2017-02-23  6:00 ` [Qemu-devel] [RFC PATCH v2 12/12] spapr: Workaround for broken radix guests Sam Bobroff
2017-02-28  0:36   ` 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=20170228002914.GE17615@umbus.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=sam.bobroff@au1.ibm.com \
    --cc=sjitindarsingh@gmail.com \
    /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).