mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-19 05:37:54 +00:00
hw: fix section insertion in translation tables
Fixes an alignment problem introduced by commit "hw: map core on demand" where physical address alignment wasn't checked anymore, when inserting a section within the first-level table of ARM's short translation table format. Many thanks to Christian Prochaska for helping to debug the problem.
This commit is contained in:
parent
a42a5995cf
commit
7138b2740a
@ -394,10 +394,10 @@ class Arm::Section_table
|
||||
*/
|
||||
static bool valid(access_t & v) { return type(v) != FAULT; }
|
||||
|
||||
static inline Type align(addr_t vo, size_t size)
|
||||
static inline Type align(addr_t vo, addr_t pa, size_t size)
|
||||
{
|
||||
return ((vo & VIRT_OFFSET_MASK) || size < VIRT_SIZE)
|
||||
? PAGE_TABLE : SECTION;
|
||||
return ((vo & VIRT_OFFSET_MASK) || (pa & VIRT_OFFSET_MASK) ||
|
||||
size < VIRT_SIZE) ? PAGE_TABLE : SECTION;
|
||||
}
|
||||
};
|
||||
|
||||
@ -588,7 +588,7 @@ class Arm::Section_table
|
||||
& Descriptor::VIRT_BASE_MASK;
|
||||
|
||||
/* decide granularity of entry that can be inserted */
|
||||
switch (Descriptor::align(vo, size)) {
|
||||
switch (Descriptor::align(vo, pa, size)) {
|
||||
|
||||
case Descriptor::SECTION:
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user