Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\amd_gart_64.c Create Date:2022-07-28 08:52:39
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:gart_iommu_init

Proto:int __init gart_iommu_init(void)

Type:int

Parameter:Nothing

716  If Not amd_nb_has_feature(AMD_NB_GART) Then Return 0
720  no_agp = 1
729  If no_iommu || Not force_iommu && duplicated to the one in bootmem.h <= 4GB broken PCI/AGP hardware bus master zone || Not gart_iommu_aperture || no_agp && Private Northbridge GATT initialization in case we cannot use the* AGP driver for some reason. < 0 Then
734  pr_warn("More than 4GB of memory but GART IOMMU not available.\n")
735  pr_warn("falling back to iommu=soft.\n")
737  Return 0
741  aper_size = aper_size << 20
742  aper_base = aper_base
743  end_pfn = (aper_base >> PAGE_SHIFT determines the page size ) + (aper_size >> PAGE_SHIFT determines the page size )
745  start_pfn = PFN_DOWN(aper_base)
746  If Not pfn_range_is_mapped(start_pfn, end_pfn) Then init_memory_mapping(start_pfn << PAGE_SHIFT determines the page size , end_pfn << PAGE_SHIFT determines the page size )
749  pr_info("PCI-DMA: using GART IOMMU.\n")
750  size of remapping area bytes = check_iommu_size(aper_base, aper_size)
751  .. and in pages = size of remapping area bytes >> PAGE_SHIFT determines the page size
753  Guarded by iommu_bitmap_lock: = __get_free_pages(GFP_KERNEL | __GFP_ZERO, get_order - Determine the allocation order of a memory size*@size: The size for which to get the order* Determine the allocation order of a particular sized block of memory)
755  If Not Guarded by iommu_bitmap_lock: Then panic - halt the system*@fmt: The text string to print* Display a message, then perform cleanups.* This function never returns.
758  pr_info("PCI-DMA: Reserving %luMB of IOMMU area in the AGP aperture\n", size of remapping area bytes >> 20)
761  ackdoor interface to AGP driver = size of remapping area bytes
762  iommu_start = aper_size - size of remapping area bytes
763  GART remapping area (physical) = aper_base + iommu_start
764  Remapping table = agp_gatt_table + (iommu_start >> PAGE_SHIFT determines the page size )
775  set_memory_np((unsignedlong)__va(GART remapping area (physical) ), size of remapping area bytes >> PAGE_SHIFT determines the page size )
785  wbinvd()
793  enable_gart_translations()
801  scratch = get_zeroed_page(GFP_KERNEL)
802  If Not scratch Then panic - halt the system*@fmt: The text string to print* Display a message, then perform cleanups.* This function never returns.
804  gart_unmapped_entry = GPTE_ENCODE(__pa(scratch))
806  Use global flush state to avoid races with multiple flushers.
807  dma_ops = gart_dma_ops
808  iommu_shutdown = gart_iommu_shutdown
809  swiotlb = 0
811  Return 0