]> git.dujemihanovic.xyz Git - linux.git/commitdiff
x86/boot: Centralize __pa()/__va() definitions
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Thu, 30 Mar 2023 11:49:43 +0000 (14:49 +0300)
committerDave Hansen <dave.hansen@linux.intel.com>
Tue, 4 Apr 2023 20:42:37 +0000 (13:42 -0700)
Replace multiple __pa()/__va() definitions with a single one in misc.h.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Mike Rapoport <rppt@linux.ibm.com>
Reviewed-by: Dave Hansen <dave.hansen@linux.intel.com>
Link: https://lore.kernel.org/all/20230330114956.20342-2-kirill.shutemov%40linux.intel.com
arch/x86/boot/compressed/ident_map_64.c
arch/x86/boot/compressed/misc.h
arch/x86/boot/compressed/sev.c

index 321a5011042d40f51120ff910786f6c17e80aaef..bcc956c17872bbd3939b33c59889d39cfb3641ac 100644 (file)
@@ -8,14 +8,6 @@
  * Copyright (C)      2016  Kees Cook
  */
 
-/*
- * Since we're dealing with identity mappings, physical and virtual
- * addresses are the same, so override these defines which are ultimately
- * used by the headers in misc.h.
- */
-#define __pa(x)  ((unsigned long)(x))
-#define __va(x)  ((void *)((unsigned long)(x)))
-
 /* No PAGE_TABLE_ISOLATION support needed either: */
 #undef CONFIG_PAGE_TABLE_ISOLATION
 
index 20118fb7c53bbbec630a87cac129096a311ebef0..2f155a0e3041bb1561c73fe37d410724b84e1bde 100644 (file)
 /* cpu_feature_enabled() cannot be used this early */
 #define USE_EARLY_PGTABLE_L5
 
+/*
+ * Boot stub deals with identity mappings, physical and virtual addresses are
+ * the same, so override these defines.
+ *
+ * <asm/page.h> will not define them if they are already defined.
+ */
+#define __pa(x)  ((unsigned long)(x))
+#define __va(x)  ((void *)((unsigned long)(x)))
+
 #include <linux/linkage.h>
 #include <linux/screen_info.h>
 #include <linux/elf.h>
index d63ad8f99f83a3c616f3560cd12f3ea03acbe049..014b89c890887b9a881f698f8a4b83b7f75823e4 100644 (file)
@@ -104,9 +104,7 @@ static enum es_result vc_read_mem(struct es_em_ctxt *ctxt,
 }
 
 #undef __init
-#undef __pa
 #define __init
-#define __pa(x)        ((unsigned long)(x))
 
 #define __BOOT_COMPRESSED