x86/PV: don't zero-map LDT
PATCH 1/1 x86/PV: don't zero-map LDT
This effectvely reverts the LDT related part of commit cf6d39f819 ("x86/PV: properly populate descriptor tables"), which broke demand paged LDT handling in guests.
xen/arch/x86/mm.c +3 -5
@@ -508,7 +508,6 @@ static void invalidate_shadow_ldt(struct {l1_pgentry_t *pl1e;unsigned int i; -unsigned long pfn, zero_pfn =PFN_DOWN (__pa (zero_page));struct page_info *page;BUG_ON (unlikely (in_irq ()));
@@ -523,11 +522,10 @@ static void invalidate_shadow_ldt(structfor ( i =16 ; i <32 ; i++ ) { - pfn =l1e_get_pfn (pl1e[i]); -if ( !(l1e_get_flags (pl1e[i]) & _PAGE_PRESENT) || pfn == zero_pfn ) +if ( !(l1e_get_flags (pl1e[i]) & _PAGE_PRESENT) )continue ; -l1e_write (&pl1e[i],l1e_from_pfn (zero_pfn, __PAGE_HYPERVISOR_RO)); - page =mfn_to_page (pfn); + page =l1e_get_page (pl1e[i]); +l1e_write (&pl1e[i],l1e_empty ());ASSERT_PAGE_IS_TYPE (page, PGT_seg_desc_page);ASSERT_PAGE_IS_DOMAIN (page, v->domain);put_page_and_type (page);
x86/PV: don't zero-map LDT
This effectvely reverts the LDT related part of commit cf6d39f819 ("x86/PV: properly populate descriptor tables"), which broke demand paged LDT handling in guests.
xen/arch/x86/mm.c +3 -5
@@ -508,7 +508,6 @@ static void invalidate_shadow_ldt(struct {l1_pgentry_t *pl1e;unsigned int i; -unsigned long pfn, zero_pfn =PFN_DOWN (__pa (zero_page));struct page_info *page;BUG_ON (unlikely (in_irq ()));
@@ -523,11 +522,10 @@ static void invalidate_shadow_ldt(structfor ( i =16 ; i <32 ; i++ ) { - pfn =l1e_get_pfn (pl1e[i]); -if ( !(l1e_get_flags (pl1e[i]) & _PAGE_PRESENT) || pfn == zero_pfn ) +if ( !(l1e_get_flags (pl1e[i]) & _PAGE_PRESENT) )continue ; -l1e_write (&pl1e[i],l1e_from_pfn (zero_pfn, __PAGE_HYPERVISOR_RO)); - page =mfn_to_page (pfn); + page =l1e_get_page (pl1e[i]); +l1e_write (&pl1e[i],l1e_empty ());ASSERT_PAGE_IS_TYPE (page, PGT_seg_desc_page);ASSERT_PAGE_IS_DOMAIN (page, v->domain);put_page_and_type (page);
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 7 lines · Jan Beulich
This effectvely reverts the LDT related part of commit
cf6d39f819("x86/PV: properly populate descriptor tables"), which broke demand paged LDT handling in guests.Reported-by David Vrabel <[email protected]>Diagnosed-by Andrew Cooper <[email protected]>Signed-off-by Jan Beulich <[email protected]>
Thanks.
David
Quoted 7 lines · Jan Beulich
This effectvely reverts the LDT related part of commit
cf6d39f819("x86/PV: properly populate descriptor tables"), which broke demand paged LDT handling in guests.Reported-by David Vrabel <[email protected]>Diagnosed-by Andrew Cooper <[email protected]>Signed-off-by Jan Beulich <[email protected]>