Lines Matching refs:gcr3_info

1431 		u16 domid = dev_data->gcr3_info.domid;  in domain_flush_pages_v2()
1559 dev_data->gcr3_info.domid, pasid, true); in amd_iommu_dev_flush_pasid_pages()
1700 static void free_gcr3_table(struct gcr3_tbl_info *gcr3_info) in free_gcr3_table() argument
1702 if (gcr3_info->glx == 2) in free_gcr3_table()
1703 free_gcr3_tbl_level2(gcr3_info->gcr3_tbl); in free_gcr3_table()
1704 else if (gcr3_info->glx == 1) in free_gcr3_table()
1705 free_gcr3_tbl_level1(gcr3_info->gcr3_tbl); in free_gcr3_table()
1707 WARN_ON_ONCE(gcr3_info->glx != 0); in free_gcr3_table()
1709 gcr3_info->glx = 0; in free_gcr3_table()
1712 domain_id_free(gcr3_info->domid); in free_gcr3_table()
1714 iommu_free_page(gcr3_info->gcr3_tbl); in free_gcr3_table()
1715 gcr3_info->gcr3_tbl = NULL; in free_gcr3_table()
1734 static int setup_gcr3_table(struct gcr3_tbl_info *gcr3_info, in setup_gcr3_table() argument
1743 if (gcr3_info->gcr3_tbl) in setup_gcr3_table()
1747 gcr3_info->domid = domain_id_alloc(); in setup_gcr3_table()
1749 gcr3_info->gcr3_tbl = iommu_alloc_page_node(nid, GFP_ATOMIC); in setup_gcr3_table()
1750 if (gcr3_info->gcr3_tbl == NULL) { in setup_gcr3_table()
1751 domain_id_free(gcr3_info->domid); in setup_gcr3_table()
1755 gcr3_info->glx = levels; in setup_gcr3_table()
1760 static u64 *__get_gcr3_pte(struct gcr3_tbl_info *gcr3_info, in __get_gcr3_pte() argument
1765 u64 *root = gcr3_info->gcr3_tbl; in __get_gcr3_pte()
1766 int level = gcr3_info->glx; in __get_gcr3_pte()
1798 struct gcr3_tbl_info *gcr3_info = &dev_data->gcr3_info; in update_gcr3() local
1801 pte = __get_gcr3_pte(gcr3_info, pasid, true); in update_gcr3()
1817 struct gcr3_tbl_info *gcr3_info = &dev_data->gcr3_info; in amd_iommu_set_gcr3() local
1826 gcr3_info->pasid_cnt++; in amd_iommu_set_gcr3()
1832 struct gcr3_tbl_info *gcr3_info = &dev_data->gcr3_info; in amd_iommu_clear_gcr3() local
1841 gcr3_info->pasid_cnt--; in amd_iommu_clear_gcr3()
1855 struct gcr3_tbl_info *gcr3_info = &dev_data->gcr3_info; in set_dte_entry() local
1857 if (gcr3_info && gcr3_info->gcr3_tbl) in set_dte_entry()
1858 domid = dev_data->gcr3_info.domid; in set_dte_entry()
1888 if (gcr3_info && gcr3_info->gcr3_tbl) { in set_dte_entry()
1889 u64 gcr3 = iommu_virt_to_phys(gcr3_info->gcr3_tbl); in set_dte_entry()
1890 u64 glx = gcr3_info->glx; in set_dte_entry()
1992 ret = setup_gcr3_table(&dev_data->gcr3_info, iommu, in init_gcr3_table()
2003 free_gcr3_table(&dev_data->gcr3_info); in init_gcr3_table()
2011 struct gcr3_tbl_info *gcr3_info = &dev_data->gcr3_info; in destroy_gcr3_table() local
2016 if (gcr3_info->gcr3_tbl == NULL) in destroy_gcr3_table()
2019 free_gcr3_table(gcr3_info); in destroy_gcr3_table()