}
/* return value determine if we need a write buffer flush */
-static int flush_context_reg(
- void *_iommu,
- u16 did, u16 source_id, u8 function_mask, u64 type,
- int flush_non_present_entry)
+static int __must_check flush_context_reg(void *_iommu, u16 did, u16 source_id,
+ u8 function_mask, u64 type,
+ bool_t flush_non_present_entry)
{
struct iommu *iommu = (struct iommu *) _iommu;
u64 val = 0;
}
static int __must_check iommu_flush_context_global(struct iommu *iommu,
- int flush_non_present_entry)
+ bool_t flush_non_present_entry)
{
struct iommu_flush *flush = iommu_get_flush(iommu);
return flush->context(iommu, 0, 0, 0, DMA_CCMD_GLOBAL_INVL,
static int __must_check iommu_flush_context_device(struct iommu *iommu,
u16 did, u16 source_id,
u8 function_mask,
- int flush_non_present_entry)
+ bool_t flush_non_present_entry)
{
struct iommu_flush *flush = iommu_get_flush(iommu);
return flush->context(iommu, did, source_id, function_mask,
}
/* return value determine if we need a write buffer flush */
-static int flush_iotlb_reg(void *_iommu, u16 did,
- u64 addr, unsigned int size_order, u64 type,
- int flush_non_present_entry, int flush_dev_iotlb)
+static int __must_check flush_iotlb_reg(void *_iommu, u16 did, u64 addr,
+ unsigned int size_order, u64 type,
+ bool_t flush_non_present_entry,
+ bool_t flush_dev_iotlb)
{
struct iommu *iommu = (struct iommu *) _iommu;
int tlb_offset = ecap_iotlb_offset(iommu->ecap);
}
static int __must_check iommu_flush_iotlb_global(struct iommu *iommu,
- int flush_non_present_entry,
- int flush_dev_iotlb)
+ bool_t flush_non_present_entry,
+ bool_t flush_dev_iotlb)
{
struct iommu_flush *flush = iommu_get_flush(iommu);
int status;
}
static int __must_check iommu_flush_iotlb_dsi(struct iommu *iommu, u16 did,
- int flush_non_present_entry,
- int flush_dev_iotlb)
+ bool_t flush_non_present_entry,
+ bool_t flush_dev_iotlb)
{
struct iommu_flush *flush = iommu_get_flush(iommu);
int status;
static int __must_check iommu_flush_iotlb_psi(struct iommu *iommu, u16 did,
u64 addr, unsigned int order,
- int flush_non_present_entry,
- int flush_dev_iotlb)
+ bool_t flush_non_present_entry,
+ bool_t flush_dev_iotlb)
{
struct iommu_flush *flush = iommu_get_flush(iommu);
int status;
{
struct acpi_drhd_unit *drhd;
struct iommu *iommu;
- int flush_dev_iotlb;
+ bool_t flush_dev_iotlb;
int rc = 0;
flush_all_cache();
iommu = drhd->iommu;
context_rc = iommu_flush_context_global(iommu, 0);
- flush_dev_iotlb = find_ats_dev_drhd(iommu) ? 1 : 0;
+ flush_dev_iotlb = !!find_ats_dev_drhd(iommu);
iotlb_rc = iommu_flush_iotlb_global(iommu, 0, flush_dev_iotlb);
/*
struct domain_iommu *hd = dom_iommu(d);
struct acpi_drhd_unit *drhd;
struct iommu *iommu;
- int flush_dev_iotlb;
+ bool_t flush_dev_iotlb;
int iommu_domid;
int rc = 0;
if ( !test_bit(iommu->index, &hd->arch.iommu_bitmap) )
continue;
- flush_dev_iotlb = find_ats_dev_drhd(iommu) ? 1 : 0;
+ flush_dev_iotlb = !!find_ats_dev_drhd(iommu);
iommu_domid= domain_iommu_domid(d, iommu);
if ( iommu_domid == -1 )
continue;
u64 maddr, pgd_maddr;
u16 seg = iommu->intel->drhd->segment;
int agaw, rc, ret;
- int flush_dev_iotlb;
+ bool_t flush_dev_iotlb;
ASSERT(pcidevs_locked());
spin_lock(&iommu->lock);
/* Context entry was previously non-present (with domid 0). */
rc = iommu_flush_context_device(iommu, 0, PCI_BDF2(bus, devfn),
DMA_CCMD_MASK_NOBIT, 1);
- flush_dev_iotlb = find_ats_dev_drhd(iommu) ? 1 : 0;
+ flush_dev_iotlb = !!find_ats_dev_drhd(iommu);
ret = iommu_flush_iotlb_dsi(iommu, 0, 1, flush_dev_iotlb);
/*
struct context_entry *context, *context_entries;
u64 maddr;
int iommu_domid, rc, ret;
- int flush_dev_iotlb;
+ bool_t flush_dev_iotlb;
ASSERT(pcidevs_locked());
spin_lock(&iommu->lock);
PCI_BDF2(bus, devfn),
DMA_CCMD_MASK_NOBIT, 0);
- flush_dev_iotlb = find_ats_dev_drhd(iommu) ? 1 : 0;
+ flush_dev_iotlb = !!find_ats_dev_drhd(iommu);
ret = iommu_flush_iotlb_dsi(iommu, iommu_domid, 0, flush_dev_iotlb);
/*
struct acpi_drhd_unit *drhd;
struct iommu *iommu = NULL;
struct domain_iommu *hd = dom_iommu(d);
- int flush_dev_iotlb;
+ bool_t flush_dev_iotlb;
int iommu_domid;
int rc = 0;
if ( !test_bit(iommu->index, &hd->arch.iommu_bitmap) )
continue;
- flush_dev_iotlb = find_ats_dev_drhd(iommu) ? 1 : 0;
+ flush_dev_iotlb = !!find_ats_dev_drhd(iommu);
iommu_domid= domain_iommu_domid(d, iommu);
if ( iommu_domid == -1 )
continue;
return __iommu_flush_iec(iommu, IEC_INDEX_INVL, im, iidx);
}
-static int flush_context_qi(
- void *_iommu, u16 did, u16 sid, u8 fm, u64 type,
- int flush_non_present_entry)
+static int __must_check flush_context_qi(void *_iommu, u16 did,
+ u16 sid, u8 fm, u64 type,
+ bool_t flush_non_present_entry)
{
int ret = 0;
struct iommu *iommu = (struct iommu *)_iommu;
return ret;
}
-static int flush_iotlb_qi(
- void *_iommu, u16 did,
- u64 addr, unsigned int size_order, u64 type,
- int flush_non_present_entry, int flush_dev_iotlb)
+static int __must_check flush_iotlb_qi(void *_iommu, u16 did, u64 addr,
+ unsigned int size_order, u64 type,
+ bool_t flush_non_present_entry,
+ bool_t flush_dev_iotlb)
{
u8 dr = 0, dw = 0;
int ret = 0;