qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] ARM MMU translation - fix small (4k) page acces


From: Justin Fletcher
Subject: Re: [Qemu-devel] [PATCH] ARM MMU translation - fix small (4k) page access
Date: Fri, 2 Feb 2007 09:58:52 +0000 (GMT)

On Fri, 2 Feb 2007, Scott Oom wrote:

Hello,
Found a problem when using small pages and getting permission faults.
This patch corrects the decoding of access permissions for small pages
on ARM, was just off by 2 bits.

I may be confused on this, but it still doesn't seem right to me.

You have...

-                ap = (desc >> (4 + ((address >> 13) & 6))) & 3;
+                ap = (desc >> (4 + ((address >> 11) & 6))) & 3; /* SRO */

For 4K pages, the L2 table is ...
  b0-1 = 2
  b2   = B
  b3   = C
  b4-5 = AP0
  b6-7 = AP1
  b8-9 = AP2
  b10-11=AP3
  b12-31=physical address
(from ARMARM 'D', 3.3.7)

The use of AP0-AP3 is dependant on bits 10 and 11. So, the code should be more like...

                ap = (desc >> (4 + ((address >> 10) & 3) )) & 3;

That is, (address>>10) & 3 => bits 10 and 11
         add on 4 as the offset to the AP fields in the descriptor
         shift down and & 3 to leave just those two bits.

The AP bits haven't been used all that often in my own use of qemu, and I imagine that most uses set all 3 to the same value.

--
Gerph <http://gerph.org/>
... It's only a lifetime.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]