xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/PV: don't zero-map LDT
@ 2015-10-26 16:14 Jan Beulich
  2015-10-26 16:39 ` David Vrabel
  2015-10-27 13:24 ` Andrew Cooper
  0 siblings, 2 replies; 3+ messages in thread
From: Jan Beulich @ 2015-10-26 16:14 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper, Keir Fraser, David Vrabel

[-- Attachment #1: Type: text/plain, Size: 1274 bytes --]

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 <david.vrabel@citrix.com>
Diagnosed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -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(struct
 
     for ( 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);




[-- Attachment #2: x86-PV-dont-zero-map-LDT.patch --]
[-- Type: text/plain, Size: 1298 bytes --]

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.

Reported-by: David Vrabel <david.vrabel@citrix.com>
Diagnosed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -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(struct
 
     for ( 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);

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [PATCH] x86/PV: don't zero-map LDT
  2015-10-26 16:14 [PATCH] x86/PV: don't zero-map LDT Jan Beulich
@ 2015-10-26 16:39 ` David Vrabel
  2015-10-27 13:24 ` Andrew Cooper
  1 sibling, 0 replies; 3+ messages in thread
From: David Vrabel @ 2015-10-26 16:39 UTC (permalink / raw)
  To: Jan Beulich, xen-devel; +Cc: Andrew Cooper, Keir Fraser, David Vrabel

On 26/10/15 16:14, Jan Beulich wrote:
> 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 <david.vrabel@citrix.com>
> Diagnosed-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Tested-by: David Vrabel <david.vrabel@citrix.com>

Thanks.

David

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

* Re: [PATCH] x86/PV: don't zero-map LDT
  2015-10-26 16:14 [PATCH] x86/PV: don't zero-map LDT Jan Beulich
  2015-10-26 16:39 ` David Vrabel
@ 2015-10-27 13:24 ` Andrew Cooper
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Cooper @ 2015-10-27 13:24 UTC (permalink / raw)
  To: Jan Beulich, xen-devel; +Cc: Keir Fraser, David Vrabel

On 26/10/15 16:14, Jan Beulich wrote:
> 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 <david.vrabel@citrix.com>
> Diagnosed-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

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

end of thread, other threads:[~2015-10-27 13:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-26 16:14 [PATCH] x86/PV: don't zero-map LDT Jan Beulich
2015-10-26 16:39 ` David Vrabel
2015-10-27 13:24 ` Andrew Cooper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).