aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2009-01-12 21:12:22 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2009-01-12 21:12:22 +0000
commitafdf8109e3c5c30d312a844436c658f7506e4189 (patch)
tree6f254f4a60f6321ae8a0632abf6f50a35576c1a1
parent164ef2e00299b8e536769a6f4c0c72b761e24087 (diff)
Fix TLB access (Jakub Jermar)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6274 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r--target-sparc/helper.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/target-sparc/helper.c b/target-sparc/helper.c
index 7943e12bf4..d2865ee7d5 100644
--- a/target-sparc/helper.c
+++ b/target-sparc/helper.c
@@ -402,12 +402,12 @@ static int get_physical_address_data(CPUState *env,
mask = 0xffffffffffc00000ULL;
break;
}
- // ctx match, vaddr match?
+ // ctx match, vaddr match, valid?
if (env->dmmuregs[1] == (env->dtlb_tag[i] & 0x1fff) &&
- (address & mask) == (env->dtlb_tag[i] & ~0x1fffULL)) {
- // valid, access ok?
- if ((env->dtlb_tte[i] & 0x8000000000000000ULL) == 0 ||
- ((env->dtlb_tte[i] & 0x4) && is_user) ||
+ (address & mask) == (env->dtlb_tag[i] & ~0x1fffULL) &&
+ (env->dtlb_tte[i] & 0x8000000000000000ULL)) {
+ // access ok?
+ if (((env->dtlb_tte[i] & 0x4) && is_user) ||
(!(env->dtlb_tte[i] & 0x2) && (rw == 1))) {
if (env->dmmuregs[3]) /* Fault status register */
env->dmmuregs[3] = 2; /* overflow (not read before
@@ -465,12 +465,12 @@ static int get_physical_address_code(CPUState *env,
mask = 0xffffffffffc00000ULL;
break;
}
- // ctx match, vaddr match?
+ // ctx match, vaddr match, valid?
if (env->dmmuregs[1] == (env->itlb_tag[i] & 0x1fff) &&
- (address & mask) == (env->itlb_tag[i] & ~0x1fffULL)) {
- // valid, access ok?
- if ((env->itlb_tte[i] & 0x8000000000000000ULL) == 0 ||
- ((env->itlb_tte[i] & 0x4) && is_user)) {
+ (address & mask) == (env->itlb_tag[i] & ~0x1fffULL) &&
+ (env->itlb_tte[i] & 0x8000000000000000ULL)) {
+ // access ok?
+ if ((env->itlb_tte[i] & 0x4) && is_user) {
if (env->immuregs[3]) /* Fault status register */
env->immuregs[3] = 2; /* overflow (not read before
another fault) */