All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: lvivier@redhat.com, thuth@redhat.com, aik@ozlabs.ru,
	agraf@suse.de, qemu-devel@nongnu.org, qemu-ppc@nongnu.org
Subject: Re: [Qemu-devel] [PATCHv2 10/10] target-ppc: Allow more page sizes for POWER7 & POWER8 in TCG
Date: Thu, 28 Jan 2016 15:36:11 +1100	[thread overview]
Message-ID: <1453955771.3148.58.camel@kernel.crashing.org> (raw)
In-Reply-To: <1453889591-30968-11-git-send-email-david@gibson.dropbear.id.au>

On Wed, 2016-01-27 at 21:13 +1100, David Gibson wrote:
> Now that the TCG and spapr code has been extended to allow (semi-)
> arbitrary page encodings in the CPU's 'sps' table, we can add the
> many
> page sizes supported by real POWER7 and POWER8 hardware that we
> previously
> didn't support in TCG.
> 
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

> ---
>  target-ppc/mmu-hash64.h     |  2 ++
>  target-ppc/translate_init.c | 32 ++++++++++++++++++++++++++++++++
>  2 files changed, 34 insertions(+)
> 
> diff --git a/target-ppc/mmu-hash64.h b/target-ppc/mmu-hash64.h
> index 34cf975..ab0f86b 100644
> --- a/target-ppc/mmu-hash64.h
> +++ b/target-ppc/mmu-hash64.h
> @@ -48,6 +48,8 @@ unsigned
> ppc_hash64_hpte_page_shift_noslb(PowerPCCPU *cpu,
>  #define SLB_VSID_LLP_MASK       (SLB_VSID_L | SLB_VSID_LP)
>  #define SLB_VSID_4K             0x0000000000000000ULL
>  #define SLB_VSID_64K            0x0000000000000110ULL
> +#define SLB_VSID_16M            0x0000000000000100ULL
> +#define SLB_VSID_16G            0x0000000000000120ULL
>  
>  /*
>   * Hash page table definitions
> diff --git a/target-ppc/translate_init.c b/target-
> ppc/translate_init.c
> index f6babd2..32b3679 100644
> --- a/target-ppc/translate_init.c
> +++ b/target-ppc/translate_init.c
> @@ -8104,6 +8104,36 @@ static Property powerpc_servercpu_properties[]
> = {
>      DEFINE_PROP_END_OF_LIST(),
>  };
>  
> +#ifdef CONFIG_SOFTMMU
> +static const struct ppc_segment_page_sizes POWER7_POWER8_sps = {
> +    .sps = {
> +        {
> +            .page_shift = 12, /* 4K */
> +            .slb_enc = 0,
> +            .enc = { { .page_shift = 12, .pte_enc = 0 },
> +                     { .page_shift = 16, .pte_enc = 0x7 },
> +                     { .page_shift = 24, .pte_enc = 0x38 }, },
> +        },
> +        {
> +            .page_shift = 16, /* 64K */
> +            .slb_enc = SLB_VSID_64K,
> +            .enc = { { .page_shift = 16, .pte_enc = 0x1 },
> +                     { .page_shift = 24, .pte_enc = 0x8 }, },
> +        },
> +        {
> +            .page_shift = 24, /* 16M */
> +            .slb_enc = SLB_VSID_16M,
> +            .enc = { { .page_shift = 24, .pte_enc = 0 }, },
> +        },
> +        {
> +            .page_shift = 34, /* 16G */
> +            .slb_enc = SLB_VSID_16G,
> +            .enc = { { .page_shift = 34, .pte_enc = 0x3 }, },
> +        },
> +    }
> +};
>
> +#endif /* CONFIG_SOFTMMU */
> +
>  static void init_proc_POWER7 (CPUPPCState *env)
>  {
>      init_proc_book3s_64(env, BOOK3S_CPU_POWER7);
> @@ -8167,6 +8197,7 @@ POWERPC_FAMILY(POWER7)(ObjectClass *oc, void
> *data)
>      pcc->mmu_model = POWERPC_MMU_2_06;
>  #if defined(CONFIG_SOFTMMU)
>      pcc->handle_mmu_fault = ppc_hash64_handle_mmu_fault;
> +    pcc->sps = &POWER7_POWER8_sps;
>  #endif
>      pcc->excp_model = POWERPC_EXCP_POWER7;
>      pcc->bus_model = PPC_FLAGS_INPUT_POWER7;
> @@ -8247,6 +8278,7 @@ POWERPC_FAMILY(POWER8)(ObjectClass *oc, void
> *data)
>      pcc->mmu_model = POWERPC_MMU_2_07;
>  #if defined(CONFIG_SOFTMMU)
>      pcc->handle_mmu_fault = ppc_hash64_handle_mmu_fault;
> +    pcc->sps = &POWER7_POWER8_sps;
>  #endif
>      pcc->excp_model = POWERPC_EXCP_POWER7;
>      pcc->bus_model = PPC_FLAGS_INPUT_POWER7;

  reply	other threads:[~2016-01-28  4:36 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-27 10:13 [Qemu-devel] [PATCHv2 00/10] Clean up page size handling for ppc 64-bit hash MMUs with TCG David Gibson
2016-01-27 10:13 ` [Qemu-devel] [PATCHv2 01/10] target-ppc: Remove unused kvmppc_read_segment_page_sizes() stub David Gibson
2016-01-27 12:16   ` Thomas Huth
2016-01-27 12:55   ` Laurent Vivier
2016-01-27 10:13 ` [Qemu-devel] [PATCHv2 02/10] target-ppc: Convert mmu-hash{32, 64}.[ch] from CPUPPCState to PowerPCCPU David Gibson
2016-01-27 14:11   ` Laurent Vivier
2016-01-27 10:13 ` [Qemu-devel] [PATCHv2 03/10] target-ppc: Rework ppc_store_slb David Gibson
2016-01-27 17:21   ` Laurent Vivier
2016-01-28  4:16   ` Benjamin Herrenschmidt
2016-01-27 10:13 ` [Qemu-devel] [PATCHv2 04/10] target-ppc: Rework SLB page size lookup David Gibson
2016-01-28  4:17   ` Benjamin Herrenschmidt
2016-01-27 10:13 ` [Qemu-devel] [PATCHv2 05/10] target-ppc: Use actual page size encodings from HPTE David Gibson
2016-01-28  4:18   ` Benjamin Herrenschmidt
2016-01-27 10:13 ` [Qemu-devel] [PATCHv2 06/10] target-ppc: Remove unused mmu models from ppc_tlb_invalidate_one David Gibson
2016-01-27 18:06   ` Laurent Vivier
2016-01-27 23:47     ` David Gibson
2016-01-28  4:20   ` Benjamin Herrenschmidt
2016-01-28  5:55     ` David Gibson
2016-01-28 15:45   ` Thomas Huth
2016-01-29  2:31     ` David Gibson
2016-01-27 10:13 ` [Qemu-devel] [PATCHv2 07/10] target-ppc: Split 44x tlbiva from ppc_tlb_invalidate_one() David Gibson
2016-01-27 17:58   ` Laurent Vivier
2016-01-27 23:31     ` David Gibson
2016-01-28  4:20   ` Benjamin Herrenschmidt
2016-01-27 10:13 ` [Qemu-devel] [PATCHv2 08/10] target-ppc: Add new TLB invalidate by HPTE call for hash64 MMUs David Gibson
2016-01-28  4:33   ` Benjamin Herrenschmidt
2016-01-28  5:57     ` David Gibson
2016-01-27 10:13 ` [Qemu-devel] [PATCHv2 09/10] target-ppc: Helper to determine page size information from hpte alone David Gibson
2016-01-28  4:33   ` Benjamin Herrenschmidt
2016-01-27 10:13 ` [Qemu-devel] [PATCHv2 10/10] target-ppc: Allow more page sizes for POWER7 & POWER8 in TCG David Gibson
2016-01-28  4:36   ` Benjamin Herrenschmidt [this message]
2016-01-28 20:44 ` [Qemu-devel] [PATCHv2 00/10] Clean up page size handling for ppc 64-bit hash MMUs with TCG Alexander Graf
2016-01-29  2: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=1453955771.3148.58.camel@kernel.crashing.org \
    --to=benh@kernel.crashing.org \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=david@gibson.dropbear.id.au \
    --cc=lvivier@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=thuth@redhat.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 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.