[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] xen/pvshim: fix GNTTABOP_query_size hypercall forwarding with SMAP



Disable SMAP in the shim before bouncing the hypercall, or else L0
will fail to get the hypercall buffer.

Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
Reported-by: Fatih Acar <fatih.acar@xxxxxxxxx>
---
Cc: Jan Beulich <jbeulich@xxxxxxxx>
Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Cc: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Cc: Wei Liu <wei.liu2@xxxxxxxxxx>
---
Needs to be backported to the 4.10.0-shim-comet branch.
---
 xen/arch/x86/pv/shim.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/arch/x86/pv/shim.c b/xen/arch/x86/pv/shim.c
index d5383dcfc7..eb1ee7d3c4 100644
--- a/xen/arch/x86/pv/shim.c
+++ b/xen/arch/x86/pv/shim.c
@@ -748,7 +748,10 @@ static long pv_shim_grant_table_op(unsigned int cmd,
     }
 
     case GNTTABOP_query_size:
+        /* Disable SMAP so L0 can access the buffer. */
+        stac();
         rc = xen_hypercall_grant_table_op(GNTTABOP_query_size, uop.p, count);
+        clac();
         break;
 
     default:
-- 
2.15.1


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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.