* [Qemu-devel] [PATCH] target-arm: Fix incorrect arithmetic constructing short-form PAR for ATS ops
@ 2014-02-17 17:52 Peter Maydell
0 siblings, 0 replies; only message in thread
From: Peter Maydell @ 2014-02-17 17:52 UTC (permalink / raw)
To: qemu-devel; +Cc: patches
Correct some obviously nonsensical bit manipulation spotted by Coverity
when constructing the short-form PAR value for ATS operations.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
Presumably most guests don't actually care what the exact cause
of a fault was when the v-to-p translation they asked for comes
back "nope"...
target-arm/helper.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/target-arm/helper.c b/target-arm/helper.c
index 5ae08c9..eb5f521 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -1082,8 +1082,8 @@ static int ats_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value)
env->cp15.c7_par = phys_addr & 0xfffff000;
}
} else {
- env->cp15.c7_par = ((ret & (10 << 1)) >> 5) |
- ((ret & (12 << 1)) >> 6) |
+ env->cp15.c7_par = ((ret & (1 << 10)) >> 5) |
+ ((ret & (1 << 12)) >> 6) |
((ret & 0xf) << 1) | 1;
}
env->cp15.c7_par_hi = 0;
--
1.8.5
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-02-17 17:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-17 17:52 [Qemu-devel] [PATCH] target-arm: Fix incorrect arithmetic constructing short-form PAR for ATS ops Peter Maydell
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).