mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
memory/iommu: Add get_attr()
This adds get_attr() to IOMMUMemoryRegionClass, like iommu_ops::domain_get_attr in the Linux kernel. This defines the first attribute - IOMMU_ATTR_SPAPR_TCE_FD - which will be used between the pSeries machine and VFIO-PCI. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
This commit is contained in:
parent
20e0d439a6
commit
f1334de60b
2 changed files with 35 additions and 0 deletions
13
memory.c
13
memory.c
|
@ -1922,6 +1922,19 @@ void memory_region_notify_iommu(IOMMUMemoryRegion *iommu_mr,
|
|||
}
|
||||
}
|
||||
|
||||
int memory_region_iommu_get_attr(IOMMUMemoryRegion *iommu_mr,
|
||||
enum IOMMUMemoryRegionAttr attr,
|
||||
void *data)
|
||||
{
|
||||
IOMMUMemoryRegionClass *imrc = IOMMU_MEMORY_REGION_GET_CLASS(iommu_mr);
|
||||
|
||||
if (!imrc->get_attr) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return imrc->get_attr(iommu_mr, attr, data);
|
||||
}
|
||||
|
||||
void memory_region_set_log(MemoryRegion *mr, bool log, unsigned client)
|
||||
{
|
||||
uint8_t mask = 1 << client;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue