[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 05/29] PPC: Fix L2CR write accesses
From: |
Alexander Graf |
Subject: |
[Qemu-ppc] [PULL 05/29] PPC: Fix L2CR write accesses |
Date: |
Fri, 25 Oct 2013 23:27:30 +0200 |
Commit 2345f1c01 was supposed to render L2CR writes into noops. Instead,
it made them illegal instruction traps which apparently didn't confuse
XNU, but can easily confuse other OSs.
Fix it up by actually doing nothing when we write to L2CR.
Reported-by: Julio Guerra <address@hidden>
Signed-off-by: Alexander Graf <address@hidden>
Tested-by: Julio Guerra <address@hidden>
---
target-ppc/translate_init.c | 29 +++++++++++++++++------------
1 file changed, 17 insertions(+), 12 deletions(-)
diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index 651da6b..807dab3 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -108,6 +108,11 @@ static void spr_write_clear (void *opaque, int sprn, int
gprn)
tcg_temp_free(t0);
tcg_temp_free(t1);
}
+
+static void spr_access_nop(void *opaque, int sprn, int gprn)
+{
+}
+
#endif
/* SPR common to all PowerPC */
@@ -1382,7 +1387,7 @@ static void gen_spr_74xx (CPUPPCState *env)
/* XXX : not implemented */
spr_register(env, SPR_L2CR, "L2CR",
SPR_NOACCESS, SPR_NOACCESS,
- &spr_read_generic, NULL,
+ &spr_read_generic, spr_access_nop,
0x00000000);
/* Not strictly an SPR */
vscr_init(env, 0x00010000);
@@ -5170,7 +5175,7 @@ static void init_proc_750 (CPUPPCState *env)
/* XXX : not implemented */
spr_register(env, SPR_L2CR, "L2CR",
SPR_NOACCESS, SPR_NOACCESS,
- &spr_read_generic, NULL,
+ &spr_read_generic, spr_access_nop,
0x00000000);
/* Time base */
gen_tbl(env);
@@ -5233,7 +5238,7 @@ static void init_proc_750cl (CPUPPCState *env)
/* XXX : not implemented */
spr_register(env, SPR_L2CR, "L2CR",
SPR_NOACCESS, SPR_NOACCESS,
- &spr_read_generic, NULL,
+ &spr_read_generic, spr_access_nop,
0x00000000);
/* Time base */
gen_tbl(env);
@@ -5419,7 +5424,7 @@ static void init_proc_750cx (CPUPPCState *env)
/* XXX : not implemented */
spr_register(env, SPR_L2CR, "L2CR",
SPR_NOACCESS, SPR_NOACCESS,
- &spr_read_generic, NULL,
+ &spr_read_generic, spr_access_nop,
0x00000000);
/* Time base */
gen_tbl(env);
@@ -5486,7 +5491,7 @@ static void init_proc_750fx (CPUPPCState *env)
/* XXX : not implemented */
spr_register(env, SPR_L2CR, "L2CR",
SPR_NOACCESS, SPR_NOACCESS,
- &spr_read_generic, NULL,
+ &spr_read_generic, spr_access_nop,
0x00000000);
/* Time base */
gen_tbl(env);
@@ -5558,7 +5563,7 @@ static void init_proc_750gx (CPUPPCState *env)
/* XXX : not implemented (XXX: different from 750fx) */
spr_register(env, SPR_L2CR, "L2CR",
SPR_NOACCESS, SPR_NOACCESS,
- &spr_read_generic, NULL,
+ &spr_read_generic, spr_access_nop,
0x00000000);
/* Time base */
gen_tbl(env);
@@ -5694,7 +5699,7 @@ static void init_proc_755 (CPUPPCState *env)
/* XXX : not implemented */
spr_register(env, SPR_L2CR, "L2CR",
SPR_NOACCESS, SPR_NOACCESS,
- &spr_read_generic, NULL,
+ &spr_read_generic, spr_access_nop,
0x00000000);
/* XXX : not implemented */
spr_register(env, SPR_L2PMCR, "L2PMCR",
@@ -6650,7 +6655,7 @@ static void init_proc_970 (CPUPPCState *env)
/* XXX : not implemented */
spr_register(env, SPR_L2CR, "L2CR",
SPR_NOACCESS, SPR_NOACCESS,
- &spr_read_generic, NULL,
+ &spr_read_generic, spr_access_nop,
0x00000000);
/* Memory management */
/* XXX: not correct */
@@ -6750,7 +6755,7 @@ static void init_proc_970FX (CPUPPCState *env)
/* XXX : not implemented */
spr_register(env, SPR_L2CR, "L2CR",
SPR_NOACCESS, SPR_NOACCESS,
- &spr_read_generic, NULL,
+ &spr_read_generic, spr_access_nop,
0x00000000);
/* Memory management */
/* XXX: not correct */
@@ -6862,7 +6867,7 @@ static void init_proc_970GX (CPUPPCState *env)
/* XXX : not implemented */
spr_register(env, SPR_L2CR, "L2CR",
SPR_NOACCESS, SPR_NOACCESS,
- &spr_read_generic, NULL,
+ &spr_read_generic, spr_access_nop,
0x00000000);
/* Memory management */
/* XXX: not correct */
@@ -6962,7 +6967,7 @@ static void init_proc_970MP (CPUPPCState *env)
/* XXX : not implemented */
spr_register(env, SPR_L2CR, "L2CR",
SPR_NOACCESS, SPR_NOACCESS,
- &spr_read_generic, NULL,
+ &spr_read_generic, spr_access_nop,
0x00000000);
/* Memory management */
/* XXX: not correct */
@@ -7054,7 +7059,7 @@ static void init_proc_power5plus(CPUPPCState *env)
/* XXX : not implemented */
spr_register(env, SPR_L2CR, "L2CR",
SPR_NOACCESS, SPR_NOACCESS,
- &spr_read_generic, NULL,
+ &spr_read_generic, spr_access_nop,
0x00000000);
/* Memory management */
/* XXX: not correct */
--
1.8.1.4
- [Qemu-ppc] [PULL 00/29] ppc patch queue 2013-10-25, Alexander Graf, 2013/10/25
- [Qemu-ppc] [PULL 07/29] spapr: Add ibm, purr property on power7 and newer, Alexander Graf, 2013/10/25
- [Qemu-ppc] [PULL 02/29] pseries: Fix loading of little endian kernels, Alexander Graf, 2013/10/25
- [Qemu-ppc] [PULL 04/29] target-ppc: Little Endian Correction to Load/Store Vector Element, Alexander Graf, 2013/10/25
- [Qemu-ppc] [PULL 03/29] ppc: Add CFAR, DAR and DSISR to the dictionary of printable registers, Alexander Graf, 2013/10/25
- [Qemu-ppc] [PULL 19/29] xics: Implement H_IPOLL, Alexander Graf, 2013/10/25
- [Qemu-ppc] [PULL 11/29] spapr: move cpu_setup after kvmppc_set_papr, Alexander Graf, 2013/10/25
- [Qemu-ppc] [PULL 20/29] xics: Implement H_XIRR_X, Alexander Graf, 2013/10/25
- [Qemu-ppc] [PULL 10/29] xics: move reset and cpu_setup, Alexander Graf, 2013/10/25
- [Qemu-ppc] [PULL 05/29] PPC: Fix L2CR write accesses,
Alexander Graf <=
- [Qemu-ppc] [PULL 08/29] spapr-rtas: fix h_rtas parameters reading, Alexander Graf, 2013/10/25
- [Qemu-ppc] [PULL 15/29] xics: add missing const specifiers to TypeInfo, Alexander Graf, 2013/10/25
- [Qemu-ppc] [PULL 12/29] xics: replace fprintf with error_report, Alexander Graf, 2013/10/25
- [Qemu-ppc] [PULL 21/29] xics-kvm: enable irqfd for MSI, Alexander Graf, 2013/10/25
- [Qemu-ppc] [PULL 22/29] spapr-pci: enable irqfd for INTx, Alexander Graf, 2013/10/25
- [Qemu-ppc] [PULL 09/29] target-ppc: Add helper for KVM_PPC_RTAS_DEFINE_TOKEN, Alexander Graf, 2013/10/25
- [Qemu-ppc] [PULL 13/29] xics: add pre_save/post_load dispatchers, Alexander Graf, 2013/10/25
- [Qemu-ppc] [PULL 14/29] xics: convert init() to realize(), Alexander Graf, 2013/10/25
- [Qemu-ppc] [PULL 18/29] xics-kvm: Support for in-kernel XICS interrupt controller, Alexander Graf, 2013/10/25
- [Qemu-ppc] [PULL 17/29] xics: add cpu_setup callback, Alexander Graf, 2013/10/25