* [Qemu-devel] [RFC PATCH] sparc: fix leon3 casa instruction when MMU is disabled
@ 2018-03-01 14:22 KONRAD Frederic
2018-03-01 16:10 ` Richard Henderson
0 siblings, 1 reply; 2+ messages in thread
From: KONRAD Frederic @ 2018-03-01 14:22 UTC (permalink / raw)
To: qemu-devel; +Cc: rth, mark.cave-ayland, KONRAD Frederic
Since the commit af7a06bac7d3abb2da48ef3277d2a415772d2ae8:
`casa [..](10), .., ..` triggers a data access exception when the MMU
is disabled.
This fixes this wrong behavior.
Signed-off-by: KONRAD Frederic <frederic.konrad@adacore.com>
---
Notes:
There is an other way to do that: emiting the instruction with a
MMU_PHYS_IDX when the MMU is disabled. I can switch to that if it's a
prefered method.
target/sparc/mmu_helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/sparc/mmu_helper.c b/target/sparc/mmu_helper.c
index f8886ae..3cebf50 100644
--- a/target/sparc/mmu_helper.c
+++ b/target/sparc/mmu_helper.c
@@ -100,7 +100,7 @@ static int get_physical_address(CPUSPARCState *env, hwaddr *physical,
is_user = mmu_idx == MMU_USER_IDX;
- if (mmu_idx == MMU_PHYS_IDX) {
+ if ((mmu_idx == MMU_PHYS_IDX) || ((env->mmuregs[0] & MMU_E) == 0)) {
*page_size = TARGET_PAGE_SIZE;
/* Boot mode: instruction fetches are taken from PROM */
if (rw == 2 && (env->mmuregs[0] & env->def.mmu_bm)) {
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [RFC PATCH] sparc: fix leon3 casa instruction when MMU is disabled
2018-03-01 14:22 [Qemu-devel] [RFC PATCH] sparc: fix leon3 casa instruction when MMU is disabled KONRAD Frederic
@ 2018-03-01 16:10 ` Richard Henderson
0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 2018-03-01 16:10 UTC (permalink / raw)
To: KONRAD Frederic, qemu-devel; +Cc: mark.cave-ayland
On 03/01/2018 06:22 AM, KONRAD Frederic wrote:
> There is an other way to do that: emiting the instruction with a
> MMU_PHYS_IDX when the MMU is disabled. I can switch to that if it's a
> prefered method.
Yes, that would be preferred.
r~
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-03-01 16:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-01 14:22 [Qemu-devel] [RFC PATCH] sparc: fix leon3 casa instruction when MMU is disabled KONRAD Frederic
2018-03-01 16:10 ` Richard Henderson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.