mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
kvm: Create non-coherent DMA registeration
We currently use some ad-hoc arch variables tied to legacy KVM device assignment to manage emulation of instructions that depend on whether non-coherent DMA is present. Create an interface for this, adapting legacy KVM device assignment and adding VFIO via the KVM-VFIO device. For now we assume that non-coherent DMA is possible any time we have a VFIO group. Eventually an interface can be developed as part of the VFIO external user interface to query the coherency of a group. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
d96eb2c6f4
commit
e0f0bbc527
6 changed files with 92 additions and 4 deletions
|
@ -670,6 +670,25 @@ static inline void kvm_arch_free_vm(struct kvm *kvm)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef __KVM_HAVE_ARCH_NONCOHERENT_DMA
|
||||
void kvm_arch_register_noncoherent_dma(struct kvm *kvm);
|
||||
void kvm_arch_unregister_noncoherent_dma(struct kvm *kvm);
|
||||
bool kvm_arch_has_noncoherent_dma(struct kvm *kvm);
|
||||
#else
|
||||
static inline void kvm_arch_register_noncoherent_dma(struct kvm *kvm)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void kvm_arch_unregister_noncoherent_dma(struct kvm *kvm)
|
||||
{
|
||||
}
|
||||
|
||||
static inline bool kvm_arch_has_noncoherent_dma(struct kvm *kvm)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline wait_queue_head_t *kvm_arch_vcpu_wq(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
#ifdef __KVM_HAVE_ARCH_WQP
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue