#define pr_fmt(fmt) …
#define dev_fmt(fmt) …
#include <linux/atomic.h>
#include <linux/bitops.h>
#include <linux/io-pgtable.h>
#include <linux/kernel.h>
#include <linux/sizes.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/dma-mapping.h>
#include <asm/barrier.h>
#include "amd_iommu_types.h"
#include "amd_iommu.h"
#include "../iommu-pages.h"
static void v1_tlb_flush_all(void *cookie)
{ … }
static void v1_tlb_flush_walk(unsigned long iova, size_t size,
size_t granule, void *cookie)
{ … }
static void v1_tlb_add_page(struct iommu_iotlb_gather *gather,
unsigned long iova, size_t granule,
void *cookie)
{ … }
static const struct iommu_flush_ops v1_flush_ops = …;
static u64 *first_pte_l7(u64 *pte, unsigned long *page_size,
unsigned long *count)
{ … }
static void free_pt_page(u64 *pt, struct list_head *freelist)
{ … }
static void free_pt_lvl(u64 *pt, struct list_head *freelist, int lvl)
{ … }
static void free_sub_pt(u64 *root, int mode, struct list_head *freelist)
{ … }
void amd_iommu_domain_set_pgtable(struct protection_domain *domain,
u64 *root, int mode)
{ … }
static bool increase_address_space(struct protection_domain *domain,
unsigned long address,
gfp_t gfp)
{ … }
static u64 *alloc_pte(struct protection_domain *domain,
unsigned long address,
unsigned long page_size,
u64 **pte_page,
gfp_t gfp,
bool *updated)
{ … }
static u64 *fetch_pte(struct amd_io_pgtable *pgtable,
unsigned long address,
unsigned long *page_size)
{ … }
static void free_clear_pte(u64 *pte, u64 pteval, struct list_head *freelist)
{ … }
static int iommu_v1_map_pages(struct io_pgtable_ops *ops, unsigned long iova,
phys_addr_t paddr, size_t pgsize, size_t pgcount,
int prot, gfp_t gfp, size_t *mapped)
{ … }
static unsigned long iommu_v1_unmap_pages(struct io_pgtable_ops *ops,
unsigned long iova,
size_t pgsize, size_t pgcount,
struct iommu_iotlb_gather *gather)
{ … }
static phys_addr_t iommu_v1_iova_to_phys(struct io_pgtable_ops *ops, unsigned long iova)
{ … }
static bool pte_test_and_clear_dirty(u64 *ptep, unsigned long size,
unsigned long flags)
{ … }
static int iommu_v1_read_and_clear_dirty(struct io_pgtable_ops *ops,
unsigned long iova, size_t size,
unsigned long flags,
struct iommu_dirty_bitmap *dirty)
{ … }
static void v1_free_pgtable(struct io_pgtable *iop)
{ … }
static struct io_pgtable *v1_alloc_pgtable(struct io_pgtable_cfg *cfg, void *cookie)
{ … }
struct io_pgtable_init_fns io_pgtable_amd_iommu_v1_init_fns = …;