mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-09-01 06:21:52 -06:00
target-i386: introduce do_check_protect label
This will help adding 1GB page support in the next patch. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
870a706735
commit
b052e4509b
1 changed files with 39 additions and 37 deletions
|
@ -636,7 +636,8 @@ int x86_cpu_handle_mmu_fault(CPUState *cs, vaddr addr,
|
||||||
page_size = 2048 * 1024;
|
page_size = 2048 * 1024;
|
||||||
pte_addr = pde_addr;
|
pte_addr = pde_addr;
|
||||||
pte = pde;
|
pte = pde;
|
||||||
} else {
|
goto do_check_protect;
|
||||||
|
}
|
||||||
/* 4 KB page */
|
/* 4 KB page */
|
||||||
if (!(pde & PG_ACCESSED_MASK)) {
|
if (!(pde & PG_ACCESSED_MASK)) {
|
||||||
pde |= PG_ACCESSED_MASK;
|
pde |= PG_ACCESSED_MASK;
|
||||||
|
@ -656,7 +657,6 @@ int x86_cpu_handle_mmu_fault(CPUState *cs, vaddr addr,
|
||||||
/* combine pde and pte nx, user and rw protections */
|
/* combine pde and pte nx, user and rw protections */
|
||||||
ptep &= pte ^ PG_NX_MASK;
|
ptep &= pte ^ PG_NX_MASK;
|
||||||
page_size = 4096;
|
page_size = 4096;
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
uint32_t pde;
|
uint32_t pde;
|
||||||
|
|
||||||
|
@ -675,7 +675,9 @@ int x86_cpu_handle_mmu_fault(CPUState *cs, vaddr addr,
|
||||||
page_size = 4096 * 1024;
|
page_size = 4096 * 1024;
|
||||||
pte_addr = pde_addr;
|
pte_addr = pde_addr;
|
||||||
pte = pde;
|
pte = pde;
|
||||||
} else {
|
goto do_check_protect;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(pde & PG_ACCESSED_MASK)) {
|
if (!(pde & PG_ACCESSED_MASK)) {
|
||||||
pde |= PG_ACCESSED_MASK;
|
pde |= PG_ACCESSED_MASK;
|
||||||
stl_phys_notdirty(cs->as, pde_addr, pde);
|
stl_phys_notdirty(cs->as, pde_addr, pde);
|
||||||
|
@ -693,8 +695,8 @@ int x86_cpu_handle_mmu_fault(CPUState *cs, vaddr addr,
|
||||||
ptep &= pte | PG_NX_MASK;
|
ptep &= pte | PG_NX_MASK;
|
||||||
page_size = 4096;
|
page_size = 4096;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
do_check_protect:
|
||||||
ptep ^= PG_NX_MASK;
|
ptep ^= PG_NX_MASK;
|
||||||
if ((ptep & PG_NX_MASK) && is_write1 == 2) {
|
if ((ptep & PG_NX_MASK) && is_write1 == 2) {
|
||||||
goto do_fault_protect;
|
goto do_fault_protect;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue