* [Qemu-devel] [PATCH] target-arm: fix TTBCR write masking
@ 2013-12-10 6:41 Sergey Fedorov
2013-12-10 8:57 ` Peter Maydell
0 siblings, 1 reply; 3+ messages in thread
From: Sergey Fedorov @ 2013-12-10 6:41 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell, a.basov, Sergey Fedorov
Current implementation is not accurate according to ARMv7-AR reference
manual. See "B4.1.153 TTBCR, Translation Table Base Control Register,
VMSA | TTBCR format when using the Long-descriptor translation table
format". When LPAE feature is supported, EAE, bit[31] selects
translation descriptor format and, therefore, TTBCR format.
Signed-off-by: Sergey Fedorov <s.fedorov@samsung.com>
---
target-arm/helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target-arm/helper.c b/target-arm/helper.c
index 3445813..8b1ddce 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -1173,7 +1173,7 @@ static int vmsa_ttbcr_raw_write(CPUARMState *env, const ARMCPRegInfo *ri,
{
int maskshift = extract32(value, 0, 3);
- if (arm_feature(env, ARM_FEATURE_LPAE)) {
+ if (arm_feature(env, ARM_FEATURE_LPAE) && (value & (1 << 31))) {
value &= ~((7 << 19) | (3 << 14) | (0xf << 3));
} else {
value &= 7;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] target-arm: fix TTBCR write masking
2013-12-10 6:41 [Qemu-devel] [PATCH] target-arm: fix TTBCR write masking Sergey Fedorov
@ 2013-12-10 8:57 ` Peter Maydell
2013-12-10 9:03 ` Fedorov Sergey
0 siblings, 1 reply; 3+ messages in thread
From: Peter Maydell @ 2013-12-10 8:57 UTC (permalink / raw)
To: Sergey Fedorov; +Cc: a.basov, QEMU Developers
On 10 December 2013 06:41, Sergey Fedorov <s.fedorov@samsung.com> wrote:
> Current implementation is not accurate according to ARMv7-AR reference
> manual. See "B4.1.153 TTBCR, Translation Table Base Control Register,
> VMSA | TTBCR format when using the Long-descriptor translation table
> format". When LPAE feature is supported, EAE, bit[31] selects
> translation descriptor format and, therefore, TTBCR format.
>
> Signed-off-by: Sergey Fedorov <s.fedorov@samsung.com>
Yeah, when I wrote that I was relying on the fact that all the
valid bits in a short-format descriptor are also valid in the
long-format mask, so correct guest software won't care (the
other bits are UNK/SBZP). However the implementation side
of UNK/SBZP requires us to treat the bits as RAZ/WI, so this
patch is correct.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
thanks
-- PMM
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] target-arm: fix TTBCR write masking
2013-12-10 8:57 ` Peter Maydell
@ 2013-12-10 9:03 ` Fedorov Sergey
0 siblings, 0 replies; 3+ messages in thread
From: Fedorov Sergey @ 2013-12-10 9:03 UTC (permalink / raw)
To: Peter Maydell; +Cc: a.basov, QEMU Developers
This patch is a prerequisite for the following up TrustZone support patches.
Thanks.
Best regards,
Sergey Fedorov
On 12/10/2013 12:57 PM, Peter Maydell wrote:
> On 10 December 2013 06:41, Sergey Fedorov <s.fedorov@samsung.com> wrote:
>> Current implementation is not accurate according to ARMv7-AR reference
>> manual. See "B4.1.153 TTBCR, Translation Table Base Control Register,
>> VMSA | TTBCR format when using the Long-descriptor translation table
>> format". When LPAE feature is supported, EAE, bit[31] selects
>> translation descriptor format and, therefore, TTBCR format.
>>
>> Signed-off-by: Sergey Fedorov <s.fedorov@samsung.com>
> Yeah, when I wrote that I was relying on the fact that all the
> valid bits in a short-format descriptor are also valid in the
> long-format mask, so correct guest software won't care (the
> other bits are UNK/SBZP). However the implementation side
> of UNK/SBZP requires us to treat the bits as RAZ/WI, so this
> patch is correct.
>
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
>
> thanks
> -- PMM
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-12-10 9:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-10 6:41 [Qemu-devel] [PATCH] target-arm: fix TTBCR write masking Sergey Fedorov
2013-12-10 8:57 ` Peter Maydell
2013-12-10 9:03 ` Fedorov Sergey
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.