qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] target/ppc: fix Hash64 MMU update of PTE bit R
@ 2021-11-24 12:00 Leandro Lupori
  2021-11-24 13:40 ` Daniel Henrique Barboza
  2021-11-25  3:03 ` David Gibson
  0 siblings, 2 replies; 10+ messages in thread
From: Leandro Lupori @ 2021-11-24 12:00 UTC (permalink / raw)
  To: qemu-devel, qemu-ppc; +Cc: groug, danielhb413, Leandro Lupori, clg, david

When updating the R bit of a PTE, the Hash64 MMU was using a wrong byte
offset, causing the first byte of the adjacent PTE to be corrupted.
This caused a panic when booting FreeBSD, using the Hash MMU.

Signed-off-by: Leandro Lupori <leandro.lupori@eldorado.org.br>
---
 target/ppc/mmu-hash64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/ppc/mmu-hash64.c b/target/ppc/mmu-hash64.c
index 19832c4b46..f165ac691a 100644
--- a/target/ppc/mmu-hash64.c
+++ b/target/ppc/mmu-hash64.c
@@ -786,7 +786,7 @@ static void ppc_hash64_set_dsi(CPUState *cs, int mmu_idx, uint64_t dar, uint64_t
 
 static void ppc_hash64_set_r(PowerPCCPU *cpu, hwaddr ptex, uint64_t pte1)
 {
-    hwaddr base, offset = ptex * HASH_PTE_SIZE_64 + 16;
+    hwaddr base, offset = ptex * HASH_PTE_SIZE_64 + 14;
 
     if (cpu->vhyp) {
         PPCVirtualHypervisorClass *vhc =
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-11-25  3:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-24 12:00 [PATCH] target/ppc: fix Hash64 MMU update of PTE bit R Leandro Lupori
2021-11-24 13:40 ` Daniel Henrique Barboza
2021-11-24 18:42   ` Cédric Le Goater
2021-11-24 19:02     ` Daniel Henrique Barboza
2021-11-24 19:17     ` Leandro Lupori
2021-11-24 19:42       ` Daniel Henrique Barboza
2021-11-24 20:09         ` Cédric Le Goater
2021-11-24 19:52       ` Cédric Le Goater
2021-11-24 21:12         ` Leandro Lupori
2021-11-25  3:03 ` David Gibson

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).