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.
_______________________________________________
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel