[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 09/67] target/ppc: Fix VRMA to not check virtual page class key pr
From: |
Nicholas Piggin |
Subject: |
[PULL 09/67] target/ppc: Fix VRMA to not check virtual page class key protection |
Date: |
Mon, 4 Nov 2024 10:17:58 +1000 |
Hash virtual real mode addressing is defined by the architecture
to not perform virtual page class key protection checks.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
target/ppc/mmu-hash64.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/target/ppc/mmu-hash64.c b/target/ppc/mmu-hash64.c
index 5e1983e334..c8c2f8910a 100644
--- a/target/ppc/mmu-hash64.c
+++ b/target/ppc/mmu-hash64.c
@@ -993,6 +993,7 @@ bool ppc_hash64_xlate(PowerPCCPU *cpu, vaddr eaddr,
MMUAccessType access_type,
int exec_prot, pp_prot, amr_prot, prot;
int need_prot;
hwaddr raddr;
+ bool vrma = false;
/*
* Note on LPCR usage: 970 uses HID4, but our special variant of
@@ -1022,6 +1023,7 @@ bool ppc_hash64_xlate(PowerPCCPU *cpu, vaddr eaddr,
MMUAccessType access_type,
}
} else if (ppc_hash64_use_vrma(env)) {
/* Emulated VRMA mode */
+ vrma = true;
slb = &vrma_slbe;
if (build_vrma_slbe(cpu, slb) != 0) {
/* Invalid VRMA setup, machine check */
@@ -1136,7 +1138,12 @@ bool ppc_hash64_xlate(PowerPCCPU *cpu, vaddr eaddr,
MMUAccessType access_type,
exec_prot = ppc_hash64_pte_noexec_guard(cpu, pte);
pp_prot = ppc_hash64_pte_prot(mmu_idx, slb, pte);
- amr_prot = ppc_hash64_amr_prot(cpu, pte);
+ if (vrma) {
+ /* VRMA does not check keys */
+ amr_prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC;
+ } else {
+ amr_prot = ppc_hash64_amr_prot(cpu, pte);
+ }
prot = exec_prot & pp_prot & amr_prot;
need_prot = check_prot_access_type(PAGE_RWX, access_type);
--
2.45.2
- Re: [PULL 02/67] target/ppc: Make divd[u] handler method decodetree compatible, (continued)
[PULL 03/67] ppc/pnv: Fix LPC serirq routing calculation, Nicholas Piggin, 2024/11/03
[PULL 04/67] ppc/pnv: Fix LPC POWER8 register sanity check, Nicholas Piggin, 2024/11/03
[PULL 05/67] target/ppc: Fix mtDPDES targeting SMT siblings, Nicholas Piggin, 2024/11/03
[PULL 06/67] target/ppc: PMIs are level triggered, Nicholas Piggin, 2024/11/03
[PULL 07/67] target/ppc: Fix doorbell delivery to threads in powersave, Nicholas Piggin, 2024/11/03
[PULL 08/67] target/ppc: Fix HFSCR facility checks, Nicholas Piggin, 2024/11/03
[PULL 09/67] target/ppc: Fix VRMA to not check virtual page class key protection,
Nicholas Piggin <=
[PULL 10/67] ppc/pnv: ADU fix possible buffer overrun with invalid size, Nicholas Piggin, 2024/11/03
[PULL 11/67] MAINTAINERS: Cover PowerPC SPI model in PowerNV section, Nicholas Piggin, 2024/11/03
[PULL 12/67] hw/ssi/pnv_spi: Match _xfer_buffer_free() with _xfer_buffer_new(), Nicholas Piggin, 2024/11/03
[PULL 13/67] hw/ssi/pnv_spi: Return early in transfer(), Nicholas Piggin, 2024/11/03
[PULL 14/67] hw/ssi/pnv_spi: Fixes Coverity CID 1558831, Nicholas Piggin, 2024/11/03
[PULL 15/67] tests/tcg: Replace -mpower8-vector with -mcpu=power8, Nicholas Piggin, 2024/11/03
[PULL 16/67] hw/ppc: fix decrementer with BookE timers, Nicholas Piggin, 2024/11/03
[PULL 17/67] ppc/spapr: remove deprecated machine pseries-2.1, Nicholas Piggin, 2024/11/03
[PULL 18/67] ppc/spapr: remove deprecated machine pseries-2.2, Nicholas Piggin, 2024/11/03
[PULL 23/67] ppc/spapr: remove deprecated machine pseries-2.7, Nicholas Piggin, 2024/11/03