[PATCH 4/8] KVM: PVDMA: Introduce is_pv_device() dma operation

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Amit Shah
Date: Wednesday, November 7, 2007 - 7:21 am

A guest can call dma_ops->is_pv_device() to find out
if a device is a passthrough'ed device (device passed
on to a guest by the host). If this is true, a hypercall
will be made to translate DMA mapping operations.

This function can be done away with and just a
kvm_is_pv_device() call can be added, which can be no-op
on a non-pv guest (or on the host).

Signed-off-by: Amit Shah <amit.shah@qumranet.com>
---
 include/asm-x86/dma-mapping_64.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/asm-x86/dma-mapping_64.h b/include/asm-x86/dma-mapping_64.h
index ecd0f61..3943edd 100644
--- a/include/asm-x86/dma-mapping_64.h
+++ b/include/asm-x86/dma-mapping_64.h
@@ -48,6 +48,8 @@ struct dma_mapping_ops {
 				int direction);
 	int             (*dma_supported)(struct device *hwdev, u64 mask);
 	int		is_phys;
+	/* Is this a physical device in a paravirtualized guest? */
+	int		(*is_pv_device)(struct device *hwdev, const char *name);
 };
 
 extern dma_addr_t bad_dma_address;
-- 
1.5.3

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
RFC: Paravirtualized DMA accesses for KVM, Amit Shah, (Wed Nov 7, 7:21 am)
[PATCH 4/8] KVM: PVDMA: Introduce is_pv_device() dma operation, Amit Shah, (Wed Nov 7, 7:21 am)
[PATCH 6/8] KVM: PVDMA Guest: Add Makefile rule, Amit Shah, (Wed Nov 7, 7:21 am)