Revert "Always set WP in CR0."
This reverts SVN r18960 / git commit
8e496a7abc
.
The patch series had been fully reviewed on edk2-devel, but it got
committed as a single squashed patch. Revert it for now.
Link: http://thread.gmane.org/gmane.comp.bios.edk2.devel/4951
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18977 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -557,9 +557,9 @@ InitPaging (
|
||||
|
||||
// Split it
|
||||
for (Level4 = 0; Level4 < SIZE_4KB / sizeof(*Pt); Level4++) {
|
||||
Pt[Level4] = Address + ((Level4 << 12) | PAGE_ATTRIBUTE_BITS);
|
||||
Pt[Level4] = Address + ((Level4 << 12) | IA32_PG_RW | IA32_PG_P);
|
||||
} // end for PT
|
||||
*Pte = (UINTN)Pt | PAGE_ATTRIBUTE_BITS;
|
||||
*Pte = (UINTN)Pt | IA32_PG_RW | IA32_PG_P;
|
||||
} // end if IsAddressSplit
|
||||
} // end for PTE
|
||||
} // end for PDE
|
||||
@@ -608,7 +608,7 @@ InitPaging (
|
||||
//
|
||||
// Patch to remove Present flag and RW flag
|
||||
//
|
||||
*Pte = *Pte & (INTN)(INT32)(~PAGE_ATTRIBUTE_BITS);
|
||||
*Pte = *Pte & (INTN)(INT32)(~(IA32_PG_RW | IA32_PG_P));
|
||||
}
|
||||
if (Nx && mXdSupported) {
|
||||
*Pte = *Pte | IA32_PG_NX;
|
||||
@@ -621,7 +621,7 @@ InitPaging (
|
||||
}
|
||||
for (Level4 = 0; Level4 < SIZE_4KB / sizeof(*Pt); Level4++, Pt++) {
|
||||
if (!IsAddressValid (Address, &Nx)) {
|
||||
*Pt = *Pt & (INTN)(INT32)(~PAGE_ATTRIBUTE_BITS);
|
||||
*Pt = *Pt & (INTN)(INT32)(~(IA32_PG_RW | IA32_PG_P));
|
||||
}
|
||||
if (Nx && mXdSupported) {
|
||||
*Pt = *Pt | IA32_PG_NX;
|
||||
@@ -1244,7 +1244,7 @@ RestorePageTableBelow4G (
|
||||
//
|
||||
PageTable[PTIndex] = (PFAddress & ~((1ull << 21) - 1));
|
||||
PageTable[PTIndex] |= (UINT64)IA32_PG_PS;
|
||||
PageTable[PTIndex] |= (UINT64)PAGE_ATTRIBUTE_BITS;
|
||||
PageTable[PTIndex] |= (UINT64)(IA32_PG_RW | IA32_PG_P);
|
||||
if ((ErrorCode & IA32_PF_EC_ID) != 0) {
|
||||
PageTable[PTIndex] &= ~IA32_PG_NX;
|
||||
}
|
||||
@@ -1277,7 +1277,7 @@ RestorePageTableBelow4G (
|
||||
// Set new entry
|
||||
//
|
||||
PageTable[PTIndex] = (PFAddress & ~((1ull << 12) - 1));
|
||||
PageTable[PTIndex] |= (UINT64)PAGE_ATTRIBUTE_BITS;
|
||||
PageTable[PTIndex] |= (UINT64)(IA32_PG_RW | IA32_PG_P);
|
||||
if ((ErrorCode & IA32_PF_EC_ID) != 0) {
|
||||
PageTable[PTIndex] &= ~IA32_PG_NX;
|
||||
}
|
||||
|
Reference in New Issue
Block a user