mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-23 15:13:02 +00:00
hv_vm: Minor fixes to pagetable code
Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
parent
7ff613665b
commit
a664bd5d55
1 changed files with 8 additions and 2 deletions
10
src/hv_vm.c
10
src/hv_vm.c
|
@ -385,13 +385,19 @@ u64 hv_pt_walk(u64 addr)
|
|||
dprintf("hv_pt_walk(0x%lx)\n", addr);
|
||||
|
||||
u64 idx = addr >> VADDR_L2_OFFSET_BITS;
|
||||
assert(idx < ENTRIES_PER_L2_TABLE);
|
||||
|
||||
u64 l2d = hv_L2[idx];
|
||||
|
||||
dprintf(" l2d = 0x%lx\n", l2d);
|
||||
|
||||
if (!L2_IS_TABLE(l2d)) {
|
||||
if (L2_IS_SW_BLOCK(l2d) || L2_IS_HW_BLOCK(l2d))
|
||||
if (L2_IS_SW_BLOCK(l2d))
|
||||
l2d += addr & (VADDR_L2_ALIGN_MASK | VADDR_L3_ALIGN_MASK);
|
||||
if (L2_IS_HW_BLOCK(l2d)) {
|
||||
l2d &= ~PTE_LOWER_ATTRIBUTES;
|
||||
l2d |= addr & (VADDR_L2_ALIGN_MASK | VADDR_L3_ALIGN_MASK);
|
||||
}
|
||||
|
||||
dprintf(" result: 0x%lx\n", l2d);
|
||||
return l2d;
|
||||
|
@ -403,7 +409,7 @@ u64 hv_pt_walk(u64 addr)
|
|||
|
||||
if (!L3_IS_TABLE(l3d)) {
|
||||
if (L3_IS_SW_BLOCK(l3d))
|
||||
l3d |= addr & VADDR_L3_ALIGN_MASK;
|
||||
l3d += addr & VADDR_L3_ALIGN_MASK;
|
||||
if (L3_IS_HW_BLOCK(l3d)) {
|
||||
l3d &= ~PTE_LOWER_ATTRIBUTES;
|
||||
l3d |= addr & VADDR_L3_ALIGN_MASK;
|
||||
|
|
Loading…
Reference in a new issue