[kvm-unit-tests PATCH] x86: efi: Fix pagetable creation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



setup_page_table() ends up filling invalid page table entries
at ptl2 due to improper typecasting. This sometimes leads to
unhandled pagefaults when writing to APIC registers. Fix it.

Fixes: e6f65fa464 ("x86 UEFI: Set up page tables")
Signed-off-by: Varad Gautam <varad.gautam@xxxxxxxx>
---
 lib/x86/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/x86/setup.c b/lib/x86/setup.c
index bbd3468..7bc7c93 100644
--- a/lib/x86/setup.c
+++ b/lib/x86/setup.c
@@ -258,7 +258,7 @@ static void setup_page_table(void)
 	curr_pt = (pgd_t *)&ptl2;
 	flags |= PT_ACCESSED_MASK | PT_DIRTY_MASK | PT_PAGE_SIZE_MASK | PT_GLOBAL_MASK;
 	for (i = 0; i < 4 * 512; i++)	{
-		curr_pt[i] = ((phys_addr_t)(i << 21)) | flags;
+		curr_pt[i] = ((phys_addr_t) i << 21) | flags;
 	}
 
 	if (amd_sev_es_enabled()) {
-- 
2.32.0




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux