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

[xen stable-4.18] x86/pv-shim: fix grant table operations for 32-bit guests



commit 880e06fdea401493a3f408deb0f411f7aeccee27
Author:     David Woodhouse <dwmw@xxxxxxxxxxxx>
AuthorDate: Thu Nov 23 12:11:21 2023 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Nov 23 12:11:21 2023 +0100

    x86/pv-shim: fix grant table operations for 32-bit guests
    
    When switching to call the shim functions from the normal handlers, the
    compat_grant_table_op() function was omitted, leaving it calling the
    real grant table operations in !PV_SHIM_EXCLUSIVE builds. This leaves a
    32-bit shim guest failing to set up its real grant table with the parent
    hypervisor.
    
    Fixes: e7db635f4428 ("x86/pv-shim: Don't modify the hypercall table")
    Signed-off-by: David Woodhouse <dwmw@xxxxxxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    master commit: 93ec30bc545f15760039c23ee4b97b80c0b3b3b3
    master date: 2023-10-31 16:10:14 +0000
---
 xen/common/compat/grant_table.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xen/common/compat/grant_table.c b/xen/common/compat/grant_table.c
index e00bc24a34..af98eade17 100644
--- a/xen/common/compat/grant_table.c
+++ b/xen/common/compat/grant_table.c
@@ -63,6 +63,11 @@ int compat_grant_table_op(
     unsigned int i, cmd_op;
     XEN_GUEST_HANDLE_PARAM(void) cnt_uop;
 
+#ifdef CONFIG_PV_SHIM
+    if ( unlikely(pv_shim) )
+        return pv_shim_grant_table_op(cmd, uop, count);
+#endif
+
     set_xen_guest_handle(cnt_uop, NULL);
     cmd_op = cmd & GNTTABOP_CMD_MASK;
     if ( cmd_op != GNTTABOP_cache_flush )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18



 


Rackspace

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