Skip to content

Commit f08978b

Browse files
tndavedavem330
authored andcommitted
sparc64: Enable sun4v dma ops to use IOMMU v2 APIs
Add Hypervisor IOMMU v2 APIs pci_iotsb_map(), pci_iotsb_demap() and enable sun4v dma ops to use IOMMU v2 API for all PCIe devices with 64bit DMA mask. Signed-off-by: Tushar Dave <tushar.n.dave@oracle.com> Reviewed-by: chris hyser <chris.hyser@oracle.com> Acked-by: Sowmini Varadhan <sowmini.varadhan@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 5116ab4 commit f08978b

4 files changed

Lines changed: 211 additions & 58 deletions

File tree

arch/sparc/include/asm/hypervisor.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2377,6 +2377,12 @@ unsigned long sun4v_vintr_set_target(unsigned long dev_handle,
23772377
* iotsb_index Zero-based IOTTE number within an IOTSB.
23782378
*/
23792379

2380+
/* The index_count argument consists of two fields:
2381+
* bits 63:48 #iottes and bits 47:0 iotsb_index
2382+
*/
2383+
#define HV_PCI_IOTSB_INDEX_COUNT(__iottes, __iotsb_index) \
2384+
(((u64)(__iottes) << 48UL) | ((u64)(__iotsb_index)))
2385+
23802386
/* pci_iotsb_conf()
23812387
* TRAP: HV_FAST_TRAP
23822388
* FUNCTION: HV_FAST_PCI_IOTSB_CONF

0 commit comments

Comments
 (0)