All of lore.kernel.org
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH] x86: efi: Fix pagetable creation
@ 2022-04-06 12:33 Varad Gautam
  2022-04-13 21:00 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Varad Gautam @ 2022-04-06 12:33 UTC (permalink / raw)
  To: kvm; +Cc: pbonzini, drjones, marcorr, zxwang42, jroedel

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@suse.com>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-13 21:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-06 12:33 [kvm-unit-tests PATCH] x86: efi: Fix pagetable creation Varad Gautam
2022-04-13 21:00 ` Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.