mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-19 04:02:05 +00:00
HV: Enable CR0.WP
Page fault could be raised if writing to read-only pages. This is useful for debugging. Signed-off-by: Zide Chen <zide.chen@intel.com>
This commit is contained in:
parent
c53a04f56c
commit
6f97a14398
@ -485,6 +485,12 @@ uint64_t get_paging_pml4(void)
|
|||||||
|
|
||||||
void enable_paging(uint64_t pml4_base_addr)
|
void enable_paging(uint64_t pml4_base_addr)
|
||||||
{
|
{
|
||||||
|
uint64_t tmp64 = 0;
|
||||||
|
|
||||||
|
/* Enable Write Protect, inhibiting writing to read-only pages */
|
||||||
|
CPU_CR_READ(cr0, &tmp64);
|
||||||
|
CPU_CR_WRITE(cr0, tmp64 | CR0_WP);
|
||||||
|
|
||||||
CPU_CR_WRITE(cr3, pml4_base_addr);
|
CPU_CR_WRITE(cr3, pml4_base_addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user