[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 71/72] PPC: BookE: Support 32 and 64 bit wide MAS2
From: |
Alexander Graf |
Subject: |
[Qemu-ppc] [PATCH 71/72] PPC: BookE: Support 32 and 64 bit wide MAS2 |
Date: |
Sun, 24 Jun 2012 01:07:35 +0200 |
The MAS registers on BookE are all 32 bit wide, except for MAS2, which
can hold up to 64 bit on 64 bit capable CPUs. Reflect this in the SPR
setting code, so that the guest can never write invalid values in them.
Signed-off-by: Alexander Graf <address@hidden>
---
target-ppc/translate_init.c | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)
diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index 8ff47ae..e6580ff 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -86,6 +86,19 @@ static void spr_write_generic (void *opaque, int sprn, int
gprn)
}
#if !defined(CONFIG_USER_ONLY)
+static void spr_write_generic32(void *opaque, int sprn, int gprn)
+{
+#ifdef TARGET_PPC64
+ TCGv t0 = tcg_temp_new();
+ tcg_gen_ext32u_tl(t0, cpu_gpr[gprn]);
+ gen_store_spr(sprn, t0);
+ tcg_temp_free(t0);
+ spr_store_dump_spr(sprn);
+#else
+ spr_write_generic(opaque, sprn, gprn);
+#endif
+}
+
static void spr_write_clear (void *opaque, int sprn, int gprn)
{
TCGv t0 = tcg_temp_new();
@@ -1597,10 +1610,14 @@ static void gen_spr_BookE206(CPUPPCState *env, uint32_t
mas_mask,
/* TLB assist registers */
/* XXX : not implemented */
for (i = 0; i < 8; i++) {
+ void (*uea_write)(void *o, int sprn, int gprn) = &spr_write_generic32;
+ if (i == 2 && (mas_mask & (1 << i)) && (env->insns_flags & PPC_64B)) {
+ uea_write = &spr_write_generic;
+ }
if (mas_mask & (1 << i)) {
spr_register(env, mas_sprn[i], mas_names[i],
SPR_NOACCESS, SPR_NOACCESS,
- &spr_read_generic, &spr_write_generic,
+ &spr_read_generic, uea_write,
0x00000000);
}
}
--
1.6.0.2
- [Qemu-ppc] [PATCH 60/72] dt: Add global option to set phandle start offset, (continued)
- [Qemu-ppc] [PATCH 60/72] dt: Add global option to set phandle start offset, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 58/72] PPC: e500: Define addresses as always 64bit, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 39/72] PPC: e500: require libfdt, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 42/72] PPC: e500: dt: create /hypervisor node dynamically, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 35/72] dt: add helper for phandle enumeration, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 50/72] PPC: e500: dt: start with empty device tree, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 30/72] raw-posix: Fix build without is_allocated support, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 68/72] PPC: BookE: Make ivpr selectable by CPU type, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 47/72] PPC: e500: dt: create mpic node dynamically, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 72/72] PPC: BookE206: Bump MAS2 to 64bit, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 71/72] PPC: BookE: Support 32 and 64 bit wide MAS2,
Alexander Graf <=
- [Qemu-ppc] [PATCH 07/72] ppc: Avoid AREG0 for FPU and SPE helpers, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 63/72] PPC: e500: allow users to set the /compatible property via -machine, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 66/72] PPC: Add support for MSR_CM, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 70/72] PPC: Extract SPR dump generation into its own function, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 52/72] PPC: e500: dt: use 64bit cell helper, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 10/72] ppc: Split MMU etc. helpers from op_helper.c, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 33/72] dt: add helper for phandle references, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 44/72] PPC: e500: dt: create /chosen node dynamically, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 32/72] dt: add helpers for multi-cell adds, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 29/72] spapr: Add "memop" hypercall, Alexander Graf, 2012/06/23