xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/mm: make {set, clear}_identity_p2m_mapping() work for PV guests
@ 2015-08-28 16:10 Jan Beulich
  2015-08-28 16:13 ` Andrew Cooper
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jan Beulich @ 2015-08-28 16:10 UTC (permalink / raw)
  To: xen-devel
  Cc: George Dunlap, Andrew Cooper, Malcolm Crossley, Keir Fraser,
	tiejun.chen@intel.com

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

Namely Dom0 suffers from commit 5ae03990c1 ("xen/vtd: create RMRR
mapping") having removed the creation of such mappings for non-
translated guests.

Reported-by: Malcolm Crossley <malcolm.crossley@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -957,7 +957,11 @@ int set_identity_p2m_entry(struct domain
     int ret;
 
     if ( !paging_mode_translate(p2m->domain) )
-        return 0;
+    {
+        if ( !need_iommu(d) )
+            return 0;
+        return iommu_map_page(d, gfn, gfn, IOMMUF_readable|IOMMUF_writable);
+    }
 
     gfn_lock(p2m, gfn, 0);
 
@@ -1028,7 +1032,11 @@ int clear_identity_p2m_entry(struct doma
     int ret;
 
     if ( !paging_mode_translate(d) )
-        return 0;
+    {
+        if ( !need_iommu(d) )
+            return 0;
+        return iommu_unmap_page(d, gfn);
+    }
 
     gfn_lock(p2m, gfn, 0);
 




[-- Attachment #2: x86-PV-IOMMU-identmap.patch --]
[-- Type: text/plain, Size: 1021 bytes --]

x86/mm: make {set,clear}_identity_p2m_mapping() work for PV guests

Namely Dom0 suffers from commit 5ae03990c1 ("xen/vtd: create RMRR
mapping") having removed the creation of such mappings for non-
translated guests.

Reported-by: Malcolm Crossley <malcolm.crossley@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -957,7 +957,11 @@ int set_identity_p2m_entry(struct domain
     int ret;
 
     if ( !paging_mode_translate(p2m->domain) )
-        return 0;
+    {
+        if ( !need_iommu(d) )
+            return 0;
+        return iommu_map_page(d, gfn, gfn, IOMMUF_readable|IOMMUF_writable);
+    }
 
     gfn_lock(p2m, gfn, 0);
 
@@ -1028,7 +1032,11 @@ int clear_identity_p2m_entry(struct doma
     int ret;
 
     if ( !paging_mode_translate(d) )
-        return 0;
+    {
+        if ( !need_iommu(d) )
+            return 0;
+        return iommu_unmap_page(d, gfn);
+    }
 
     gfn_lock(p2m, gfn, 0);
 

[-- 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] 5+ messages in thread

* Re: [PATCH] x86/mm: make {set, clear}_identity_p2m_mapping() work for PV guests
  2015-08-28 16:10 [PATCH] x86/mm: make {set, clear}_identity_p2m_mapping() work for PV guests Jan Beulich
@ 2015-08-28 16:13 ` Andrew Cooper
  2015-09-01 13:45 ` George Dunlap
  2015-09-01 13:53 ` Jan Beulich
  2 siblings, 0 replies; 5+ messages in thread
From: Andrew Cooper @ 2015-08-28 16:13 UTC (permalink / raw)
  To: Jan Beulich, xen-devel
  Cc: George Dunlap, tiejun.chen@intel.com, Malcolm Crossley,
	Keir Fraser

On 28/08/15 17:10, Jan Beulich wrote:
> Namely Dom0 suffers from commit 5ae03990c1 ("xen/vtd: create RMRR
> mapping") having removed the creation of such mappings for non-
> translated guests.
>
> Reported-by: Malcolm Crossley <malcolm.crossley@citrix.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

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

I will get this into testing ASAP to confirm that it fixes the original
issue.

~Andrew

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

* Re: [PATCH] x86/mm: make {set, clear}_identity_p2m_mapping() work for PV guests
  2015-08-28 16:10 [PATCH] x86/mm: make {set, clear}_identity_p2m_mapping() work for PV guests Jan Beulich
  2015-08-28 16:13 ` Andrew Cooper
@ 2015-09-01 13:45 ` George Dunlap
  2015-09-01 13:53 ` Jan Beulich
  2 siblings, 0 replies; 5+ messages in thread
From: George Dunlap @ 2015-09-01 13:45 UTC (permalink / raw)
  To: Jan Beulich
  Cc: xen-devel, Malcolm Crossley, tiejun.chen@intel.com, Keir Fraser,
	Andrew Cooper

On Fri, Aug 28, 2015 at 5:10 PM, Jan Beulich <JBeulich@suse.com> wrote:
> Namely Dom0 suffers from commit 5ae03990c1 ("xen/vtd: create RMRR
> mapping") having removed the creation of such mappings for non-
> translated guests.
>
> Reported-by: Malcolm Crossley <malcolm.crossley@citrix.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

This is logically an IOMMU thing; so on the basis that it was
submitted by the vendor-independent IOMMU maintainer, after having
taken a look and verified the claims in the changelog:

Acked-by: George Dunlap <george.dunlap@citrix.com>

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

* Re: [PATCH] x86/mm: make {set, clear}_identity_p2m_mapping() work for PV guests
  2015-08-28 16:10 [PATCH] x86/mm: make {set, clear}_identity_p2m_mapping() work for PV guests Jan Beulich
  2015-08-28 16:13 ` Andrew Cooper
  2015-09-01 13:45 ` George Dunlap
@ 2015-09-01 13:53 ` Jan Beulich
  2015-09-01 14:01   ` Wei Liu
  2 siblings, 1 reply; 5+ messages in thread
From: Jan Beulich @ 2015-09-01 13:53 UTC (permalink / raw)
  To: Wei Liu
  Cc: Keir Fraser, George Dunlap, Andrew Cooper, tiejun.chen@intel.com,
	xen-devel, Malcolm Crossley

>>> On 28.08.15 at 18:10, <JBeulich@suse.com> wrote:
> Namely Dom0 suffers from commit 5ae03990c1 ("xen/vtd: create RMRR
> mapping") having removed the creation of such mappings for non-
> translated guests.
> 
> Reported-by: Malcolm Crossley <malcolm.crossley@citrix.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Wei,

looks like I forgot to Cc you on the original submission.

Jan

> --- a/xen/arch/x86/mm/p2m.c
> +++ b/xen/arch/x86/mm/p2m.c
> @@ -957,7 +957,11 @@ int set_identity_p2m_entry(struct domain
>      int ret;
>  
>      if ( !paging_mode_translate(p2m->domain) )
> -        return 0;
> +    {
> +        if ( !need_iommu(d) )
> +            return 0;
> +        return iommu_map_page(d, gfn, gfn, IOMMUF_readable|IOMMUF_writable);
> +    }
>  
>      gfn_lock(p2m, gfn, 0);
>  
> @@ -1028,7 +1032,11 @@ int clear_identity_p2m_entry(struct doma
>      int ret;
>  
>      if ( !paging_mode_translate(d) )
> -        return 0;
> +    {
> +        if ( !need_iommu(d) )
> +            return 0;
> +        return iommu_unmap_page(d, gfn);
> +    }
>  
>      gfn_lock(p2m, gfn, 0);
>  

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

* Re: [PATCH] x86/mm: make {set, clear}_identity_p2m_mapping() work for PV guests
  2015-09-01 13:53 ` Jan Beulich
@ 2015-09-01 14:01   ` Wei Liu
  0 siblings, 0 replies; 5+ messages in thread
From: Wei Liu @ 2015-09-01 14:01 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Wei Liu, George Dunlap, Andrew Cooper, tiejun.chen@intel.com,
	xen-devel, Malcolm Crossley, Keir Fraser

On Tue, Sep 01, 2015 at 07:53:40AM -0600, Jan Beulich wrote:
> >>> On 28.08.15 at 18:10, <JBeulich@suse.com> wrote:
> > Namely Dom0 suffers from commit 5ae03990c1 ("xen/vtd: create RMRR
> > mapping") having removed the creation of such mappings for non-
> > translated guests.
> > 
> > Reported-by: Malcolm Crossley <malcolm.crossley@citrix.com>
> > Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 

Release-acked-by: Wei Liu <wei.liu2@citrix.com>

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

end of thread, other threads:[~2015-09-01 14:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-28 16:10 [PATCH] x86/mm: make {set, clear}_identity_p2m_mapping() work for PV guests Jan Beulich
2015-08-28 16:13 ` Andrew Cooper
2015-09-01 13:45 ` George Dunlap
2015-09-01 13:53 ` Jan Beulich
2015-09-01 14:01   ` Wei Liu

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).