* [Qemu-devel] [PATCH] sparc64: mmu bypass mode correction
@ 2009-07-11 22:35 Igor Kovalenko
2009-07-11 22:37 ` Igor Kovalenko
0 siblings, 1 reply; 2+ messages in thread
From: Igor Kovalenko @ 2009-07-11 22:35 UTC (permalink / raw)
To: qemu-devel
This Implement physical address truncation in mmu bypass mode.
IMMU bypass is also active when cpu enters RED_STATE
Signed-off-by: igor.v.kovalenko@gmail.com
--
Kind regards,
Igor V. Kovalenko
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Qemu-devel] [PATCH] sparc64: mmu bypass mode correction
2009-07-11 22:35 [Qemu-devel] [PATCH] sparc64: mmu bypass mode correction Igor Kovalenko
@ 2009-07-11 22:37 ` Igor Kovalenko
0 siblings, 0 replies; 2+ messages in thread
From: Igor Kovalenko @ 2009-07-11 22:37 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 196 bytes --]
This Implement physical address truncation in mmu bypass mode.
IMMU bypass is also active when cpu enters RED_STATE
Signed-off-by: igor.v.kovalenko@gmail.com
--
Kind regards,
Igor V. Kovalenko
[-- Attachment #2: sparc64-immu-bypass --]
[-- Type: application/octet-stream, Size: 1185 bytes --]
Index: qemu-trunk/target-sparc/helper.c
===================================================================
--- qemu-trunk.orig/target-sparc/helper.c
+++ qemu-trunk/target-sparc/helper.c
@@ -369,6 +369,13 @@ void dump_mmu(CPUState *env)
#endif /* DEBUG_MMU */
#else /* !TARGET_SPARC64 */
+
+// 41 bit physical address space
+static inline target_phys_addr_t ultrasparc_truncate_physical(uint64_t x)
+{
+ return x & 0x1ffffffffffULL;
+}
+
/*
* UltraSparc IIi I/DMMUs
*/
@@ -380,7 +387,7 @@ static int get_physical_address_data(CPU
unsigned int i;
if ((env->lsu & DMMU_E) == 0) { /* DMMU disabled */
- *physical = address;
+ *physical = ultrasparc_truncate_physical(address);
*prot = PAGE_READ | PAGE_WRITE;
return 0;
}
@@ -442,8 +449,9 @@ static int get_physical_address_code(CPU
target_ulong mask;
unsigned int i;
- if ((env->lsu & IMMU_E) == 0) { /* IMMU disabled */
- *physical = address;
+ if ((env->lsu & IMMU_E) == 0 || (env->pstate & PS_RED) != 0) {
+ /* IMMU disabled */
+ *physical = ultrasparc_truncate_physical(address);
*prot = PAGE_EXEC;
return 0;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-07-11 22:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-11 22:35 [Qemu-devel] [PATCH] sparc64: mmu bypass mode correction Igor Kovalenko
2009-07-11 22:37 ` Igor Kovalenko
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).