]> xenbits.xensource.com Git - xen.git/commitdiff
xen/pvshim: fix GNTTABOP_query_size hypercall forwarding with SMAP
authorRoger Pau Monne <roger.pau@citrix.com>
Fri, 26 Jan 2018 15:29:10 +0000 (15:29 +0000)
committerWei Liu <wei.liu2@citrix.com>
Mon, 5 Mar 2018 15:59:29 +0000 (15:59 +0000)
Disable SMAP in the shim before bouncing the hypercall, or else L0
will fail to get the hypercall buffer.

Reported-by: Fatih Acar <fatih.acar@gandi.net>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
(cherry picked from commit 1124a9a26f05439a3aa31eaea227285e50dc94c0)

xen/arch/x86/pv/shim.c

index d5383dcfc743063d7bf5e5f88b15b5745b7ffcd4..eb1ee7d3c4b7869c564ef6af5982f0f96913fbee 100644 (file)
@@ -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: