From: David Gibson <david@gibson.dropbear.id.au>
To: Thomas Huth <thuth@redhat.com>
Cc: qemu-ppc@nongnu.org, "Alexander Graf" <agraf@suse.de>,
qemu-devel@nongnu.org, "Cédric Le Goater" <clg@kaod.org>
Subject: Re: [Qemu-devel] [PATCH] ppc/kvm: Mark 64kB page size support as disabled if not available
Date: Wed, 21 Sep 2016 20:14:03 +1000 [thread overview]
Message-ID: <20160921101403.GE1809@umbus.fritz.box> (raw)
In-Reply-To: <1474450935-30812-1-git-send-email-thuth@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2179 bytes --]
On Wed, Sep 21, 2016 at 11:42:15AM +0200, Thomas Huth wrote:
> QEMU currently refuses to start with KVM-PR and only prints out
>
> qemu: fatal: Unknown MMU model 851972
>
> when being started there. This is because commit 4322e8ced5aaac719
> ("ppc: Fix 64K pages support in full emulation") introduced a new
> POWERPC_MMU_64K bit to indicate support for this page size, but
> it never gets cleared on KVM-PR if the host kernel does not support
> this. Thus we've got to turn off this bit in the mmu_model for KVM-PR.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
Applied to ppc-for-2.8, thanks.
> ---
> target-ppc/kvm.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
> index dcb68b9..6bdc804 100644
> --- a/target-ppc/kvm.c
> +++ b/target-ppc/kvm.c
> @@ -427,6 +427,7 @@ static void kvm_fixup_page_sizes(PowerPCCPU *cpu)
> CPUPPCState *env = &cpu->env;
> long rampagesize;
> int iq, ik, jq, jk;
> + bool has_64k_pages = false;
>
> /* We only handle page sizes for 64-bit server guests for now */
> if (!(env->mmu_model & POWERPC_MMU_64)) {
> @@ -470,6 +471,9 @@ static void kvm_fixup_page_sizes(PowerPCCPU *cpu)
> ksps->enc[jk].page_shift)) {
> continue;
> }
> + if (ksps->enc[jk].page_shift == 16) {
> + has_64k_pages = true;
> + }
> qsps->enc[jq].page_shift = ksps->enc[jk].page_shift;
> qsps->enc[jq].pte_enc = ksps->enc[jk].pte_enc;
> if (++jq >= PPC_PAGE_SIZES_MAX_SZ) {
> @@ -484,6 +488,9 @@ static void kvm_fixup_page_sizes(PowerPCCPU *cpu)
> if (!(smmu_info.flags & KVM_PPC_1T_SEGMENTS)) {
> env->mmu_model &= ~POWERPC_MMU_1TSEG;
> }
> + if (!has_64k_pages) {
> + env->mmu_model &= ~POWERPC_MMU_64K;
> + }
> }
> #else /* defined (TARGET_PPC64) */
>
--
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:[~2016-09-21 10:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-21 9:42 [Qemu-devel] [PATCH] ppc/kvm: Mark 64kB page size support as disabled if not available Thomas Huth
2016-09-21 10:14 ` David Gibson [this message]
2016-10-17 17:50 ` Michael Roth
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=20160921101403.GE1809@umbus.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=agraf@suse.de \
--cc=clg@kaod.org \
--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 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).