Lines Matching refs:md
62 efi_memory_desc_t *md; in early_code_mapping_set_exec() local
68 for_each_efi_memory_desc(md) { in early_code_mapping_set_exec()
69 if (md->type == EFI_RUNTIME_SERVICES_CODE || in early_code_mapping_set_exec()
70 md->type == EFI_BOOT_SERVICES_CODE) in early_code_mapping_set_exec()
71 efi_set_executable(md, executable); in early_code_mapping_set_exec()
411 static void __init __map_region(efi_memory_desc_t *md, u64 va) in __map_region() argument
417 if (!(md->attribute & EFI_MEMORY_WB)) in __map_region()
420 if (sev_active() && md->type != EFI_MEMORY_MAPPED_IO) in __map_region()
423 pfn = md->phys_addr >> PAGE_SHIFT; in __map_region()
424 if (kernel_map_pages_in_pgd(pgd, pfn, va, md->num_pages, flags)) in __map_region()
426 md->phys_addr, va); in __map_region()
429 void __init efi_map_region(efi_memory_desc_t *md) in efi_map_region() argument
431 unsigned long size = md->num_pages << PAGE_SHIFT; in efi_map_region()
432 u64 pa = md->phys_addr; in efi_map_region()
435 return old_map_region(md); in efi_map_region()
442 __map_region(md, md->phys_addr); in efi_map_region()
450 md->virt_addr = md->phys_addr; in efi_map_region()
476 __map_region(md, efi_va); in efi_map_region()
477 md->virt_addr = efi_va; in efi_map_region()
485 void __init efi_map_region_fixed(efi_memory_desc_t *md) in efi_map_region_fixed() argument
487 __map_region(md, md->phys_addr); in efi_map_region_fixed()
488 __map_region(md, md->virt_addr); in efi_map_region_fixed()
516 static int __init efi_update_mappings(efi_memory_desc_t *md, unsigned long pf) in efi_update_mappings() argument
523 pfn = md->phys_addr >> PAGE_SHIFT; in efi_update_mappings()
524 err1 = kernel_map_pages_in_pgd(pgd, pfn, md->phys_addr, md->num_pages, pf); in efi_update_mappings()
527 md->phys_addr, md->virt_addr); in efi_update_mappings()
530 err2 = kernel_map_pages_in_pgd(pgd, pfn, md->virt_addr, md->num_pages, pf); in efi_update_mappings()
533 md->phys_addr, md->virt_addr); in efi_update_mappings()
539 static int __init efi_update_mem_attr(struct mm_struct *mm, efi_memory_desc_t *md) in efi_update_mem_attr() argument
543 if (md->attribute & EFI_MEMORY_XP) in efi_update_mem_attr()
546 if (!(md->attribute & EFI_MEMORY_RO)) in efi_update_mem_attr()
552 return efi_update_mappings(md, pf); in efi_update_mem_attr()
557 efi_memory_desc_t *md; in efi_runtime_update_mappings() local
586 for_each_efi_memory_desc(md) { in efi_runtime_update_mappings()
589 if (!(md->attribute & EFI_MEMORY_RUNTIME)) in efi_runtime_update_mappings()
592 if (!(md->attribute & EFI_MEMORY_WB)) in efi_runtime_update_mappings()
595 if ((md->attribute & EFI_MEMORY_XP) || in efi_runtime_update_mappings()
596 (md->type == EFI_RUNTIME_SERVICES_DATA)) in efi_runtime_update_mappings()
599 if (!(md->attribute & EFI_MEMORY_RO) && in efi_runtime_update_mappings()
600 (md->type != EFI_RUNTIME_SERVICES_CODE)) in efi_runtime_update_mappings()
606 efi_update_mappings(md, pf); in efi_runtime_update_mappings()