File tree Expand file tree Collapse file tree 4 files changed +19
-3
lines changed Expand file tree Collapse file tree 4 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -212,7 +212,7 @@ static void __init xen_hvm_guest_init(void)
212
212
return ;
213
213
214
214
if (IS_ENABLED (CONFIG_XEN_VIRTIO_FORCE_GRANT ))
215
- virtio_set_mem_acc_cb (virtio_require_restricted_mem_acc );
215
+ virtio_set_mem_acc_cb (xen_virtio_restricted_mem_acc );
216
216
217
217
init_hvm_pv_info ();
218
218
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ static void __init xen_pv_init_platform(void)
112
112
{
113
113
/* PV guests can't operate virtio devices without grants. */
114
114
if (IS_ENABLED (CONFIG_XEN_VIRTIO ))
115
- virtio_set_mem_acc_cb (virtio_require_restricted_mem_acc );
115
+ virtio_set_mem_acc_cb (xen_virtio_restricted_mem_acc );
116
116
117
117
populate_extra_pte (fix_to_virt (FIX_PARAVIRT_BOOTMAP ));
118
118
Original file line number Diff line number Diff line change @@ -313,7 +313,7 @@ bool xen_is_grant_dma_device(struct device *dev)
313
313
314
314
bool xen_virtio_mem_acc (struct virtio_device * dev )
315
315
{
316
- if (IS_ENABLED (CONFIG_XEN_VIRTIO_FORCE_GRANT ))
316
+ if (IS_ENABLED (CONFIG_XEN_VIRTIO_FORCE_GRANT ) || xen_pv_domain () )
317
317
return true;
318
318
319
319
return xen_is_grant_dma_device (dev -> dev .parent );
@@ -387,6 +387,16 @@ void xen_grant_setup_dma_ops(struct device *dev)
387
387
dev_err (dev , "Cannot set up Xen grant DMA ops, retain platform DMA ops\n" );
388
388
}
389
389
390
+ bool xen_virtio_restricted_mem_acc (struct virtio_device * dev )
391
+ {
392
+ bool ret = xen_virtio_mem_acc (dev );
393
+
394
+ if (ret )
395
+ xen_grant_setup_dma_ops (dev -> dev .parent );
396
+
397
+ return ret ;
398
+ }
399
+
390
400
MODULE_DESCRIPTION ("Xen grant DMA-mapping layer" );
391
401
MODULE_AUTHOR (
"Juergen Gross <[email protected] >" );
392
402
MODULE_LICENSE ("GPL" );
Original file line number Diff line number Diff line change @@ -219,6 +219,7 @@ static inline void xen_preemptible_hcall_end(void) { }
219
219
void xen_grant_setup_dma_ops (struct device * dev );
220
220
bool xen_is_grant_dma_device (struct device * dev );
221
221
bool xen_virtio_mem_acc (struct virtio_device * dev );
222
+ bool xen_virtio_restricted_mem_acc (struct virtio_device * dev );
222
223
#else
223
224
static inline void xen_grant_setup_dma_ops (struct device * dev )
224
225
{
@@ -234,6 +235,11 @@ static inline bool xen_virtio_mem_acc(struct virtio_device *dev)
234
235
{
235
236
return false;
236
237
}
238
+
239
+ static inline bool xen_virtio_restricted_mem_acc (struct virtio_device * dev )
240
+ {
241
+ return false;
242
+ }
237
243
#endif /* CONFIG_XEN_GRANT_DMA_OPS */
238
244
239
245
#endif /* INCLUDE_XEN_OPS_H */
You can’t perform that action at this time.
0 commit comments