Merge tag 'for-linus-6.0-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.git] / arch / x86 / xen / enlighten_pv.c
index 70fb2ea85e907468df9500091d9b8f27aa279e7d..0ed2e487a693fa307831e3fd5ed5c8bacc390c05 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/gfp.h>
 #include <linux/edd.h>
 #include <linux/reboot.h>
+#include <linux/virtio_anchor.h>
 
 #include <xen/xen.h>
 #include <xen/events.h>
@@ -109,7 +110,9 @@ static DEFINE_PER_CPU(struct tls_descs, shadow_tls_desc);
 
 static void __init xen_pv_init_platform(void)
 {
-       xen_set_restricted_virtio_memory_access();
+       /* PV guests can't operate virtio devices without grants. */
+       if (IS_ENABLED(CONFIG_XEN_VIRTIO))
+               virtio_set_mem_acc_cb(virtio_require_restricted_mem_acc);
 
        populate_extra_pte(fix_to_virt(FIX_PARAVIRT_BOOTMAP));