[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 32/36] target/ppc: Don't check UPRT in radix mode whe
From: |
David Gibson |
Subject: |
[Qemu-devel] [PULL 32/36] target/ppc: Don't check UPRT in radix mode when in HV real mode |
Date: |
Fri, 26 Apr 2019 16:06:23 +1000 |
From: Benjamin Herrenschmidt <address@hidden>
It appears that during kexec, we run for a while in hypervisor
real mode with LPCR:HR set and LPCR:UPRT clear, which trips
the assertion in ppc_radix64_handle_mmu_fault().
First this shouldn't be an assertion, it's a guest error.
Then we shouldn't be checking these things in hypervisor real
mode (or in virtual hypervisor guest real mode which is similar)
as the real HW won't use those LPCR bits in those cases anyway,
so technically it's ok to have this discrepancy.
Signed-off-by: Benjamin Herrenschmidt <address@hidden>
Signed-off-by: Cédric Le Goater <address@hidden>
Message-Id: <address@hidden>
[dwg: Fix for 32-bit builds]
Signed-off-by: David Gibson <address@hidden>
---
target/ppc/mmu-radix64.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/target/ppc/mmu-radix64.c b/target/ppc/mmu-radix64.c
index ca1fb2673f..066e324464 100644
--- a/target/ppc/mmu-radix64.c
+++ b/target/ppc/mmu-radix64.c
@@ -228,10 +228,10 @@ int ppc_radix64_handle_mmu_fault(PowerPCCPU *cpu, vaddr
eaddr, int rwx,
ppc_v3_pate_t pate;
assert((rwx == 0) || (rwx == 1) || (rwx == 2));
- assert(ppc64_use_proc_tbl(cpu));
- /* Real Mode Access */
- if (((rwx == 2) && (msr_ir == 0)) || ((rwx != 2) && (msr_dr == 0))) {
+ /* HV or virtual hypervisor Real Mode Access */
+ if ((msr_hv || cpu->vhyp) &&
+ (((rwx == 2) && (msr_ir == 0)) || ((rwx != 2) && (msr_dr == 0)))) {
/* In real mode top 4 effective addr bits (mostly) ignored */
raddr = eaddr & 0x0FFFFFFFFFFFFFFFULL;
@@ -241,6 +241,16 @@ int ppc_radix64_handle_mmu_fault(PowerPCCPU *cpu, vaddr
eaddr, int rwx,
return 0;
}
+ /*
+ * Check UPRT (we avoid the check in real mode to deal with
+ * transitional states during kexec.
+ */
+ if (!ppc64_use_proc_tbl(cpu)) {
+ qemu_log_mask(LOG_GUEST_ERROR,
+ "LPCR:UPRT not set in radix mode ! LPCR="
+ TARGET_FMT_lx "\n", env->spr[SPR_LPCR]);
+ }
+
/* Virtual Mode Access - get the fully qualified address */
if (!ppc_radix64_get_fully_qualified_addr(env, eaddr, &lpid, &pid)) {
ppc_radix64_raise_segi(cpu, rwx, eaddr);
--
2.20.1
- [Qemu-devel] [PULL 23/36] target/ppc: Style fixes for translate.c, (continued)
- [Qemu-devel] [PULL 23/36] target/ppc: Style fixes for translate.c, David Gibson, 2019/04/26
- [Qemu-devel] [PULL 15/36] target/ppc: Style fixes for mem_helper.c, David Gibson, 2019/04/26
- [Qemu-devel] [PULL 19/36] target/ppc: Style fixes for mmu-hash64.[ch], David Gibson, 2019/04/26
- [Qemu-devel] [PULL 24/36] target/ppc: Style fixes for translate/fp-impl.inc.c, David Gibson, 2019/04/26
- [Qemu-devel] [PULL 29/36] spapr: Drop duplicate PCI swizzle code, David Gibson, 2019/04/26
- [Qemu-devel] [PULL 20/36] target/ppc: Style fixes for mmu_helper.c, David Gibson, 2019/04/26
- [Qemu-devel] [PULL 27/36] target/ppc: Style fixes for translate/spe-impl.inc.c, David Gibson, 2019/04/26
- [Qemu-devel] [PULL 28/36] spapr_pci: Get rid of duplicate code for node name creation, David Gibson, 2019/04/26
- [Qemu-devel] [PULL 22/36] target/ppc: Style fixes for translate_init.inc.c, David Gibson, 2019/04/26
- [Qemu-devel] [PULL 34/36] ppc/hash64: Rework R and C bit updates, David Gibson, 2019/04/26
- [Qemu-devel] [PULL 32/36] target/ppc: Don't check UPRT in radix mode when in HV real mode,
David Gibson <=
- [Qemu-devel] [PULL 25/36] target/ppc: Style fixes for translate/vsx-impl.inc.c, David Gibson, 2019/04/26
- [Qemu-devel] [PULL 36/36] target/ppc: improve performance of large BAT invalidations, David Gibson, 2019/04/26
- [Qemu-devel] [PULL 30/36] target/ppc/trace-events: Fix trivial typo, David Gibson, 2019/04/26
- [Qemu-devel] [PULL 35/36] ppc/hash32: Rework R and C bit updates, David Gibson, 2019/04/26
- [Qemu-devel] [PULL 33/36] ppc/spapr: Use proper HPTE accessors for H_READ, David Gibson, 2019/04/26
- [Qemu-devel] [PULL 31/36] target/ppc/kvm: Convert DPRINTF to traces, David Gibson, 2019/04/26
- Re: [Qemu-devel] [PULL 00/36] ppc-for-4.1 queue 20190426, Peter Maydell, 2019/04/28