All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen: Fix {set,clear}_foreign_p2m_mapping on autotranslating guests
@ 2018-02-07 20:47 Simon Gaiser
  2018-02-08  9:42 ` Juergen Gross
  2018-02-08  9:42 ` [PATCH] xen: Fix {set, clear}_foreign_p2m_mapping " Juergen Gross
  0 siblings, 2 replies; 4+ messages in thread
From: Simon Gaiser @ 2018-02-07 20:47 UTC (permalink / raw)
  To: xen-devel
  Cc: Simon Gaiser, stable, Boris Ostrovsky, Juergen Gross,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, linux-kernel

Commit 82616f9599a7 ("xen: remove tests for pvh mode in pure pv paths")
removed the check for autotranslation from {set,clear}_foreign_p2m_mapping
but those are called by grant-table.c also on PVH/HVM guests.

Cc: <stable@vger.kernel.org> # 4.14
Fixes: 82616f9599a7 ("xen: remove tests for pvh mode in pure pv paths")
Signed-off-by: Simon Gaiser <simon@invisiblethingslab.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/xen/p2m.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
index 13b4f19b9131..159a897151d6 100644
--- a/arch/x86/xen/p2m.c
+++ b/arch/x86/xen/p2m.c
@@ -694,6 +694,9 @@ int set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops,
 	int i, ret = 0;
 	pte_t *pte;
 
+	if (xen_feature(XENFEAT_auto_translated_physmap))
+		return 0;
+
 	if (kmap_ops) {
 		ret = HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref,
 						kmap_ops, count);
@@ -736,6 +739,9 @@ int clear_foreign_p2m_mapping(struct gnttab_unmap_grant_ref *unmap_ops,
 {
 	int i, ret = 0;
 
+	if (xen_feature(XENFEAT_auto_translated_physmap))
+		return 0;
+
 	for (i = 0; i < count; i++) {
 		unsigned long mfn = __pfn_to_mfn(page_to_pfn(pages[i]));
 		unsigned long pfn = page_to_pfn(pages[i]);
-- 
2.15.1

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

* Re: [PATCH] xen: Fix {set,clear}_foreign_p2m_mapping on autotranslating guests
  2018-02-07 20:47 [PATCH] xen: Fix {set,clear}_foreign_p2m_mapping on autotranslating guests Simon Gaiser
@ 2018-02-08  9:42 ` Juergen Gross
  2018-02-08  9:42 ` [PATCH] xen: Fix {set, clear}_foreign_p2m_mapping " Juergen Gross
  1 sibling, 0 replies; 4+ messages in thread
From: Juergen Gross @ 2018-02-08  9:42 UTC (permalink / raw)
  To: Simon Gaiser, xen-devel
  Cc: stable, Boris Ostrovsky, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin, x86, linux-kernel

On 07/02/18 21:47, Simon Gaiser wrote:
> Commit 82616f9599a7 ("xen: remove tests for pvh mode in pure pv paths")
> removed the check for autotranslation from {set,clear}_foreign_p2m_mapping
> but those are called by grant-table.c also on PVH/HVM guests.
> 
> Cc: <stable@vger.kernel.org> # 4.14
> Fixes: 82616f9599a7 ("xen: remove tests for pvh mode in pure pv paths")
> Signed-off-by: Simon Gaiser <simon@invisiblethingslab.com>
> Reviewed-by: Juergen Gross <jgross@suse.com>

Committed to xen.tip for-linus-4.16


Juergen

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

* Re: [PATCH] xen: Fix {set, clear}_foreign_p2m_mapping on autotranslating guests
  2018-02-07 20:47 [PATCH] xen: Fix {set,clear}_foreign_p2m_mapping on autotranslating guests Simon Gaiser
  2018-02-08  9:42 ` Juergen Gross
@ 2018-02-08  9:42 ` Juergen Gross
  1 sibling, 0 replies; 4+ messages in thread
From: Juergen Gross @ 2018-02-08  9:42 UTC (permalink / raw)
  To: Simon Gaiser, xen-devel
  Cc: x86, linux-kernel, stable, Ingo Molnar, H. Peter Anvin,
	Boris Ostrovsky, Thomas Gleixner

On 07/02/18 21:47, Simon Gaiser wrote:
> Commit 82616f9599a7 ("xen: remove tests for pvh mode in pure pv paths")
> removed the check for autotranslation from {set,clear}_foreign_p2m_mapping
> but those are called by grant-table.c also on PVH/HVM guests.
> 
> Cc: <stable@vger.kernel.org> # 4.14
> Fixes: 82616f9599a7 ("xen: remove tests for pvh mode in pure pv paths")
> Signed-off-by: Simon Gaiser <simon@invisiblethingslab.com>
> Reviewed-by: Juergen Gross <jgross@suse.com>

Committed to xen.tip for-linus-4.16


Juergen

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* [PATCH] xen: Fix {set, clear}_foreign_p2m_mapping on autotranslating guests
@ 2018-02-07 20:47 Simon Gaiser
  0 siblings, 0 replies; 4+ messages in thread
From: Simon Gaiser @ 2018-02-07 20:47 UTC (permalink / raw)
  To: xen-devel
  Cc: Juergen Gross, x86, linux-kernel, stable, Simon Gaiser,
	Ingo Molnar, H. Peter Anvin, Boris Ostrovsky, Thomas Gleixner

Commit 82616f9599a7 ("xen: remove tests for pvh mode in pure pv paths")
removed the check for autotranslation from {set,clear}_foreign_p2m_mapping
but those are called by grant-table.c also on PVH/HVM guests.

Cc: <stable@vger.kernel.org> # 4.14
Fixes: 82616f9599a7 ("xen: remove tests for pvh mode in pure pv paths")
Signed-off-by: Simon Gaiser <simon@invisiblethingslab.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/xen/p2m.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
index 13b4f19b9131..159a897151d6 100644
--- a/arch/x86/xen/p2m.c
+++ b/arch/x86/xen/p2m.c
@@ -694,6 +694,9 @@ int set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops,
 	int i, ret = 0;
 	pte_t *pte;
 
+	if (xen_feature(XENFEAT_auto_translated_physmap))
+		return 0;
+
 	if (kmap_ops) {
 		ret = HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref,
 						kmap_ops, count);
@@ -736,6 +739,9 @@ int clear_foreign_p2m_mapping(struct gnttab_unmap_grant_ref *unmap_ops,
 {
 	int i, ret = 0;
 
+	if (xen_feature(XENFEAT_auto_translated_physmap))
+		return 0;
+
 	for (i = 0; i < count; i++) {
 		unsigned long mfn = __pfn_to_mfn(page_to_pfn(pages[i]));
 		unsigned long pfn = page_to_pfn(pages[i]);
-- 
2.15.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

end of thread, other threads:[~2018-02-08  9:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-07 20:47 [PATCH] xen: Fix {set,clear}_foreign_p2m_mapping on autotranslating guests Simon Gaiser
2018-02-08  9:42 ` Juergen Gross
2018-02-08  9:42 ` [PATCH] xen: Fix {set, clear}_foreign_p2m_mapping " Juergen Gross
2018-02-07 20:47 Simon Gaiser

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.