render / rpms / qemu

Forked from rpms/qemu 5 months ago
Clone

Blame 0014-ppc-kvm-Mark-64kB-page-size-support-as-disabled-if-n.patch

cf8164
From: Thomas Huth <thuth@redhat.com>
cf8164
Date: Wed, 21 Sep 2016 11:42:15 +0200
cf8164
Subject: [PATCH] ppc/kvm: Mark 64kB page size support as disabled if not
cf8164
 available
cf8164
cf8164
QEMU currently refuses to start with KVM-PR and only prints out
cf8164
cf8164
	qemu: fatal: Unknown MMU model 851972
cf8164
cf8164
when being started there. This is because commit 4322e8ced5aaac719
cf8164
("ppc: Fix 64K pages support in full emulation") introduced a new
cf8164
POWERPC_MMU_64K bit to indicate support for this page size, but
cf8164
it never gets cleared on KVM-PR if the host kernel does not support
cf8164
this. Thus we've got to turn off this bit in the mmu_model for KVM-PR.
cf8164
cf8164
Signed-off-by: Thomas Huth <thuth@redhat.com>
cf8164
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
cf8164
(cherry picked from commit 0d594f5565837fe2886a8aa307ef8abb65eab8f7)
cf8164
---
cf8164
 target-ppc/kvm.c | 7 +++++++
cf8164
 1 file changed, 7 insertions(+)
cf8164
cf8164
diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
cf8164
index dcb68b9..6bdc804 100644
cf8164
--- a/target-ppc/kvm.c
cf8164
+++ b/target-ppc/kvm.c
cf8164
@@ -427,6 +427,7 @@ static void kvm_fixup_page_sizes(PowerPCCPU *cpu)
cf8164
     CPUPPCState *env = &cpu->env;
cf8164
     long rampagesize;
cf8164
     int iq, ik, jq, jk;
cf8164
+    bool has_64k_pages = false;
cf8164
 
cf8164
     /* We only handle page sizes for 64-bit server guests for now */
cf8164
     if (!(env->mmu_model & POWERPC_MMU_64)) {
cf8164
@@ -470,6 +471,9 @@ static void kvm_fixup_page_sizes(PowerPCCPU *cpu)
cf8164
                                      ksps->enc[jk].page_shift)) {
cf8164
                 continue;
cf8164
             }
cf8164
+            if (ksps->enc[jk].page_shift == 16) {
cf8164
+                has_64k_pages = true;
cf8164
+            }
cf8164
             qsps->enc[jq].page_shift = ksps->enc[jk].page_shift;
cf8164
             qsps->enc[jq].pte_enc = ksps->enc[jk].pte_enc;
cf8164
             if (++jq >= PPC_PAGE_SIZES_MAX_SZ) {
cf8164
@@ -484,6 +488,9 @@ static void kvm_fixup_page_sizes(PowerPCCPU *cpu)
cf8164
     if (!(smmu_info.flags & KVM_PPC_1T_SEGMENTS)) {
cf8164
         env->mmu_model &= ~POWERPC_MMU_1TSEG;
cf8164
     }
cf8164
+    if (!has_64k_pages) {
cf8164
+        env->mmu_model &= ~POWERPC_MMU_64K;
cf8164
+    }
cf8164
 }
cf8164
 #else /* defined (TARGET_PPC64) */
cf8164