* [Qemu-devel] [PATCH 1/1] ppc: Fix MMU model values needed by PR KVM
@ 2016-07-21 5:55 Sam Bobroff
2016-07-21 7:07 ` Mark Cave-Ayland
0 siblings, 1 reply; 4+ messages in thread
From: Sam Bobroff @ 2016-07-21 5:55 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-ppc
Commit 4322e8c "ppc: Fix 64K pages support in full emulation" added
the POWERPC_MMU_64K flag to the POWERPC_MMU_2_06 and POWERPC_MMU_2_07
definitions but not to their "degraded" variants. When running with PR
KVM, kvm_fixup_page_sizes() removes the POWERPC_MMU_1TSEG flag from
the MMU value then later ppc_tlb_invalidate_all() expects the value to
be one from the list, but it isn't because the POWERPC_MMU_64K bit is
missing from the (otherwise) matching "degraded" entry. This causes
QEMU to exit with "fatal: Unknown MMU model".
This patch adds the POWERPC_MMU_64K flag to the POWERPC_MMU_2_06a and
POWERPC_MMU_2_07a values, preventing the error.
Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
---
I recently discovered that I can't start QEMU with KVM PR for modern
pseries machines:
$ rmmod kvm_hv
$ modprobe kvm-pr
$ qemu-system-ppc64 -nographic -vga none -machine pseries,accel=kvm
qemu: fatal: Unknown MMU model
A quick investigation seems to indicate that it's just a missing flag
in the MMU definition. If it's really that simple then here's a patch
for it.
Cheers,
Sam.
target-ppc/cpu-qom.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/target-ppc/cpu-qom.h b/target-ppc/cpu-qom.h
index 2864105..0f1e011 100644
--- a/target-ppc/cpu-qom.h
+++ b/target-ppc/cpu-qom.h
@@ -71,6 +71,10 @@ enum powerpc_mmu_t {
#define POWERPC_MMU_1TSEG 0x00020000
#define POWERPC_MMU_AMR 0x00040000
#define POWERPC_MMU_64K 0x00080000
+/* Any entry that include POWERPC_MMU_1TSEG must have a matching
+ * entry without it, because it may be removed by
+ * kvm_fixup_page_sizes() and the new value must exist here.
+ * See ppc_tlb_invalidate_*(). */
/* 64 bits PowerPC MMU */
POWERPC_MMU_64B = POWERPC_MMU_64 | 0x00000001,
/* Architecture 2.03 and later (has LPCR) */
@@ -81,6 +85,7 @@ enum powerpc_mmu_t {
| POWERPC_MMU_AMR | 0x00000003,
/* Architecture 2.06 "degraded" (no 1T segments) */
POWERPC_MMU_2_06a = POWERPC_MMU_64 | POWERPC_MMU_AMR
+ | POWERPC_MMU_64K
| 0x00000003,
/* Architecture 2.07 variant */
POWERPC_MMU_2_07 = POWERPC_MMU_64 | POWERPC_MMU_1TSEG
@@ -88,6 +93,7 @@ enum powerpc_mmu_t {
| POWERPC_MMU_AMR | 0x00000004,
/* Architecture 2.07 "degraded" (no 1T segments) */
POWERPC_MMU_2_07a = POWERPC_MMU_64 | POWERPC_MMU_AMR
+ | POWERPC_MMU_64K
| 0x00000004,
};
--
2.1.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] ppc: Fix MMU model values needed by PR KVM
2016-07-21 5:55 [Qemu-devel] [PATCH 1/1] ppc: Fix MMU model values needed by PR KVM Sam Bobroff
@ 2016-07-21 7:07 ` Mark Cave-Ayland
2016-12-02 4:42 ` Sam Bobroff
0 siblings, 1 reply; 4+ messages in thread
From: Mark Cave-Ayland @ 2016-07-21 7:07 UTC (permalink / raw)
To: Sam Bobroff, qemu-devel; +Cc: qemu-ppc, David Gibson
On 21/07/16 06:55, Sam Bobroff wrote:
> Commit 4322e8c "ppc: Fix 64K pages support in full emulation" added
> the POWERPC_MMU_64K flag to the POWERPC_MMU_2_06 and POWERPC_MMU_2_07
> definitions but not to their "degraded" variants. When running with PR
> KVM, kvm_fixup_page_sizes() removes the POWERPC_MMU_1TSEG flag from
> the MMU value then later ppc_tlb_invalidate_all() expects the value to
> be one from the list, but it isn't because the POWERPC_MMU_64K bit is
> missing from the (otherwise) matching "degraded" entry. This causes
> QEMU to exit with "fatal: Unknown MMU model".
>
> This patch adds the POWERPC_MMU_64K flag to the POWERPC_MMU_2_06a and
> POWERPC_MMU_2_07a values, preventing the error.
>
> Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
> ---
> I recently discovered that I can't start QEMU with KVM PR for modern
> pseries machines:
>
> $ rmmod kvm_hv
> $ modprobe kvm-pr
> $ qemu-system-ppc64 -nographic -vga none -machine pseries,accel=kvm
> qemu: fatal: Unknown MMU model
>
> A quick investigation seems to indicate that it's just a missing flag
> in the MMU definition. If it's really that simple then here's a patch
> for it.
>
> Cheers,
> Sam.
>
> target-ppc/cpu-qom.h | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/target-ppc/cpu-qom.h b/target-ppc/cpu-qom.h
> index 2864105..0f1e011 100644
> --- a/target-ppc/cpu-qom.h
> +++ b/target-ppc/cpu-qom.h
> @@ -71,6 +71,10 @@ enum powerpc_mmu_t {
> #define POWERPC_MMU_1TSEG 0x00020000
> #define POWERPC_MMU_AMR 0x00040000
> #define POWERPC_MMU_64K 0x00080000
> +/* Any entry that include POWERPC_MMU_1TSEG must have a matching
> + * entry without it, because it may be removed by
> + * kvm_fixup_page_sizes() and the new value must exist here.
> + * See ppc_tlb_invalidate_*(). */
> /* 64 bits PowerPC MMU */
> POWERPC_MMU_64B = POWERPC_MMU_64 | 0x00000001,
> /* Architecture 2.03 and later (has LPCR) */
> @@ -81,6 +85,7 @@ enum powerpc_mmu_t {
> | POWERPC_MMU_AMR | 0x00000003,
> /* Architecture 2.06 "degraded" (no 1T segments) */
> POWERPC_MMU_2_06a = POWERPC_MMU_64 | POWERPC_MMU_AMR
> + | POWERPC_MMU_64K
> | 0x00000003,
> /* Architecture 2.07 variant */
> POWERPC_MMU_2_07 = POWERPC_MMU_64 | POWERPC_MMU_1TSEG
> @@ -88,6 +93,7 @@ enum powerpc_mmu_t {
> | POWERPC_MMU_AMR | 0x00000004,
> /* Architecture 2.07 "degraded" (no 1T segments) */
> POWERPC_MMU_2_07a = POWERPC_MMU_64 | POWERPC_MMU_AMR
> + | POWERPC_MMU_64K
> | 0x00000004,
> };
>
>
Added David as CC to make sure it gets caught by a PPC maintainer.
ATB,
Mark.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] ppc: Fix MMU model values needed by PR KVM
2016-07-21 7:07 ` Mark Cave-Ayland
@ 2016-12-02 4:42 ` Sam Bobroff
2016-12-02 8:15 ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
0 siblings, 1 reply; 4+ messages in thread
From: Sam Bobroff @ 2016-12-02 4:42 UTC (permalink / raw)
To: Mark Cave-Ayland; +Cc: qemu-devel, qemu-ppc, David Gibson
Ping?
On Thu, Jul 21, 2016 at 08:07:25AM +0100, Mark Cave-Ayland wrote:
> On 21/07/16 06:55, Sam Bobroff wrote:
>
> > Commit 4322e8c "ppc: Fix 64K pages support in full emulation" added
> > the POWERPC_MMU_64K flag to the POWERPC_MMU_2_06 and POWERPC_MMU_2_07
> > definitions but not to their "degraded" variants. When running with PR
> > KVM, kvm_fixup_page_sizes() removes the POWERPC_MMU_1TSEG flag from
> > the MMU value then later ppc_tlb_invalidate_all() expects the value to
> > be one from the list, but it isn't because the POWERPC_MMU_64K bit is
> > missing from the (otherwise) matching "degraded" entry. This causes
> > QEMU to exit with "fatal: Unknown MMU model".
> >
> > This patch adds the POWERPC_MMU_64K flag to the POWERPC_MMU_2_06a and
> > POWERPC_MMU_2_07a values, preventing the error.
> >
> > Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
> > ---
> > I recently discovered that I can't start QEMU with KVM PR for modern
> > pseries machines:
> >
> > $ rmmod kvm_hv
> > $ modprobe kvm-pr
> > $ qemu-system-ppc64 -nographic -vga none -machine pseries,accel=kvm
> > qemu: fatal: Unknown MMU model
> >
> > A quick investigation seems to indicate that it's just a missing flag
> > in the MMU definition. If it's really that simple then here's a patch
> > for it.
> >
> > Cheers,
> > Sam.
> >
> > target-ppc/cpu-qom.h | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/target-ppc/cpu-qom.h b/target-ppc/cpu-qom.h
> > index 2864105..0f1e011 100644
> > --- a/target-ppc/cpu-qom.h
> > +++ b/target-ppc/cpu-qom.h
> > @@ -71,6 +71,10 @@ enum powerpc_mmu_t {
> > #define POWERPC_MMU_1TSEG 0x00020000
> > #define POWERPC_MMU_AMR 0x00040000
> > #define POWERPC_MMU_64K 0x00080000
> > +/* Any entry that include POWERPC_MMU_1TSEG must have a matching
> > + * entry without it, because it may be removed by
> > + * kvm_fixup_page_sizes() and the new value must exist here.
> > + * See ppc_tlb_invalidate_*(). */
> > /* 64 bits PowerPC MMU */
> > POWERPC_MMU_64B = POWERPC_MMU_64 | 0x00000001,
> > /* Architecture 2.03 and later (has LPCR) */
> > @@ -81,6 +85,7 @@ enum powerpc_mmu_t {
> > | POWERPC_MMU_AMR | 0x00000003,
> > /* Architecture 2.06 "degraded" (no 1T segments) */
> > POWERPC_MMU_2_06a = POWERPC_MMU_64 | POWERPC_MMU_AMR
> > + | POWERPC_MMU_64K
> > | 0x00000003,
> > /* Architecture 2.07 variant */
> > POWERPC_MMU_2_07 = POWERPC_MMU_64 | POWERPC_MMU_1TSEG
> > @@ -88,6 +93,7 @@ enum powerpc_mmu_t {
> > | POWERPC_MMU_AMR | 0x00000004,
> > /* Architecture 2.07 "degraded" (no 1T segments) */
> > POWERPC_MMU_2_07a = POWERPC_MMU_64 | POWERPC_MMU_AMR
> > + | POWERPC_MMU_64K
> > | 0x00000004,
> > };
> >
> >
>
> Added David as CC to make sure it gets caught by a PPC maintainer.
>
>
> ATB,
>
> Mark.
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH 1/1] ppc: Fix MMU model values needed by PR KVM
2016-12-02 4:42 ` Sam Bobroff
@ 2016-12-02 8:15 ` Greg Kurz
0 siblings, 0 replies; 4+ messages in thread
From: Greg Kurz @ 2016-12-02 8:15 UTC (permalink / raw)
To: Sam Bobroff; +Cc: Mark Cave-Ayland, qemu-ppc, qemu-devel, David Gibson
On Fri, 2 Dec 2016 15:42:49 +1100
Sam Bobroff <sam.bobroff@au1.ibm.com> wrote:
> Ping?
>
The issue got addressed by this commit:
commit 0d594f5565837fe2886a8aa307ef8abb65eab8f7
Author: Thomas Huth <thuth@redhat.com>
Date: Wed Sep 21 11:42:15 2016 +0200
ppc/kvm: Mark 64kB page size support as disabled if not available
Cheers.
--
Greg
> On Thu, Jul 21, 2016 at 08:07:25AM +0100, Mark Cave-Ayland wrote:
> > On 21/07/16 06:55, Sam Bobroff wrote:
> >
> > > Commit 4322e8c "ppc: Fix 64K pages support in full emulation" added
> > > the POWERPC_MMU_64K flag to the POWERPC_MMU_2_06 and POWERPC_MMU_2_07
> > > definitions but not to their "degraded" variants. When running with PR
> > > KVM, kvm_fixup_page_sizes() removes the POWERPC_MMU_1TSEG flag from
> > > the MMU value then later ppc_tlb_invalidate_all() expects the value to
> > > be one from the list, but it isn't because the POWERPC_MMU_64K bit is
> > > missing from the (otherwise) matching "degraded" entry. This causes
> > > QEMU to exit with "fatal: Unknown MMU model".
> > >
> > > This patch adds the POWERPC_MMU_64K flag to the POWERPC_MMU_2_06a and
> > > POWERPC_MMU_2_07a values, preventing the error.
> > >
> > > Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
> > > ---
> > > I recently discovered that I can't start QEMU with KVM PR for modern
> > > pseries machines:
> > >
> > > $ rmmod kvm_hv
> > > $ modprobe kvm-pr
> > > $ qemu-system-ppc64 -nographic -vga none -machine pseries,accel=kvm
> > > qemu: fatal: Unknown MMU model
> > >
> > > A quick investigation seems to indicate that it's just a missing flag
> > > in the MMU definition. If it's really that simple then here's a patch
> > > for it.
> > >
> > > Cheers,
> > > Sam.
> > >
> > > target-ppc/cpu-qom.h | 6 ++++++
> > > 1 file changed, 6 insertions(+)
> > >
> > > diff --git a/target-ppc/cpu-qom.h b/target-ppc/cpu-qom.h
> > > index 2864105..0f1e011 100644
> > > --- a/target-ppc/cpu-qom.h
> > > +++ b/target-ppc/cpu-qom.h
> > > @@ -71,6 +71,10 @@ enum powerpc_mmu_t {
> > > #define POWERPC_MMU_1TSEG 0x00020000
> > > #define POWERPC_MMU_AMR 0x00040000
> > > #define POWERPC_MMU_64K 0x00080000
> > > +/* Any entry that include POWERPC_MMU_1TSEG must have a matching
> > > + * entry without it, because it may be removed by
> > > + * kvm_fixup_page_sizes() and the new value must exist here.
> > > + * See ppc_tlb_invalidate_*(). */
> > > /* 64 bits PowerPC MMU */
> > > POWERPC_MMU_64B = POWERPC_MMU_64 | 0x00000001,
> > > /* Architecture 2.03 and later (has LPCR) */
> > > @@ -81,6 +85,7 @@ enum powerpc_mmu_t {
> > > | POWERPC_MMU_AMR | 0x00000003,
> > > /* Architecture 2.06 "degraded" (no 1T segments) */
> > > POWERPC_MMU_2_06a = POWERPC_MMU_64 | POWERPC_MMU_AMR
> > > + | POWERPC_MMU_64K
> > > | 0x00000003,
> > > /* Architecture 2.07 variant */
> > > POWERPC_MMU_2_07 = POWERPC_MMU_64 | POWERPC_MMU_1TSEG
> > > @@ -88,6 +93,7 @@ enum powerpc_mmu_t {
> > > | POWERPC_MMU_AMR | 0x00000004,
> > > /* Architecture 2.07 "degraded" (no 1T segments) */
> > > POWERPC_MMU_2_07a = POWERPC_MMU_64 | POWERPC_MMU_AMR
> > > + | POWERPC_MMU_64K
> > > | 0x00000004,
> > > };
> > >
> > >
> >
> > Added David as CC to make sure it gets caught by a PPC maintainer.
> >
> >
> > ATB,
> >
> > Mark.
> >
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-12-02 8:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-21 5:55 [Qemu-devel] [PATCH 1/1] ppc: Fix MMU model values needed by PR KVM Sam Bobroff
2016-07-21 7:07 ` Mark Cave-Ayland
2016-12-02 4:42 ` Sam Bobroff
2016-12-02 8:15 ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
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).