diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-06 16:28:28 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-06 16:28:28 -0400 |
commit | d90dcc1f14555c62a32bc15c86c66d1d5444b5cb (patch) | |
tree | dd3d7befcd7d9fcc484a8639dc5add1f213a40ca | |
parent | 2c6a392cddacde153865b15e8295ad0a35ed3c02 (diff) | |
parent | 02562d0ca1084a688ac5c92e0e92947f62f13093 (diff) |
Merge branch 'efi-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull EFI updates from Ingo Molnar:
"The changes in this cycle were:
- Squash a spurious warning when using the EFI framebuffer on a
non-EFI boot
- Use DMI data to annotate RAS memory errors on ARM just like we do
on Intel
- Followup cleanups for DMI
- libstub Makefile cleanups"
* 'efi-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
efi/libstub/arm: Omit unneeded stripping of ksymtab/kcrctab sections
efi: Unify DMI setup code over the arm/arm64, ia64 and x86 architectures
efi/arm: Show SMBIOS bank/device location in CPER and GHES error logs
efifb: Omit memory map check on legacy boot
efi/libstub: Refactor the cmd_stubcopy Makefile command
-rw-r--r-- | arch/ia64/kernel/setup.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/setup.c | 6 | ||||
-rw-r--r-- | drivers/firmware/dmi_scan.c | 28 | ||||
-rw-r--r-- | drivers/firmware/efi/arm-runtime.c | 6 | ||||
-rw-r--r-- | drivers/firmware/efi/libstub/Makefile | 14 | ||||
-rw-r--r-- | drivers/video/fbdev/efifb.c | 3 | ||||
-rw-r--r-- | include/linux/dmi.h | 8 |
7 files changed, 31 insertions, 38 deletions
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c index 583a3746d70b..c9cfa760cd57 100644 --- a/arch/ia64/kernel/setup.c +++ b/arch/ia64/kernel/setup.c | |||
@@ -1058,9 +1058,7 @@ check_bugs (void) | |||
1058 | 1058 | ||
1059 | static int __init run_dmi_scan(void) | 1059 | static int __init run_dmi_scan(void) |
1060 | { | 1060 | { |
1061 | dmi_scan_machine(); | 1061 | dmi_setup(); |
1062 | dmi_memdev_walk(); | ||
1063 | dmi_set_dump_stack_arch_desc(); | ||
1064 | return 0; | 1062 | return 0; |
1065 | } | 1063 | } |
1066 | core_initcall(run_dmi_scan); | 1064 | core_initcall(run_dmi_scan); |
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 3d872a527cd9..3773905cd2c1 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -1005,13 +1005,11 @@ void __init setup_arch(char **cmdline_p) | |||
1005 | if (efi_enabled(EFI_BOOT)) | 1005 | if (efi_enabled(EFI_BOOT)) |
1006 | efi_init(); | 1006 | efi_init(); |
1007 | 1007 | ||
1008 | dmi_scan_machine(); | 1008 | dmi_setup(); |
1009 | dmi_memdev_walk(); | ||
1010 | dmi_set_dump_stack_arch_desc(); | ||
1011 | 1009 | ||
1012 | /* | 1010 | /* |
1013 | * VMware detection requires dmi to be available, so this | 1011 | * VMware detection requires dmi to be available, so this |
1014 | * needs to be done after dmi_scan_machine(), for the boot CPU. | 1012 | * needs to be done after dmi_setup(), for the boot CPU. |
1015 | */ | 1013 | */ |
1016 | init_hypervisor_platform(); | 1014 | init_hypervisor_platform(); |
1017 | 1015 | ||
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c index 099d83e4e910..fae2d5c43314 100644 --- a/drivers/firmware/dmi_scan.c +++ b/drivers/firmware/dmi_scan.c | |||
@@ -416,11 +416,8 @@ static void __init save_mem_devices(const struct dmi_header *dm, void *v) | |||
416 | nr++; | 416 | nr++; |
417 | } | 417 | } |
418 | 418 | ||
419 | void __init dmi_memdev_walk(void) | 419 | static void __init dmi_memdev_walk(void) |
420 | { | 420 | { |
421 | if (!dmi_available) | ||
422 | return; | ||
423 | |||
424 | if (dmi_walk_early(count_mem_devices) == 0 && dmi_memdev_nr) { | 421 | if (dmi_walk_early(count_mem_devices) == 0 && dmi_memdev_nr) { |
425 | dmi_memdev = dmi_alloc(sizeof(*dmi_memdev) * dmi_memdev_nr); | 422 | dmi_memdev = dmi_alloc(sizeof(*dmi_memdev) * dmi_memdev_nr); |
426 | if (dmi_memdev) | 423 | if (dmi_memdev) |
@@ -614,7 +611,7 @@ static int __init dmi_smbios3_present(const u8 *buf) | |||
614 | return 1; | 611 | return 1; |
615 | } | 612 | } |
616 | 613 | ||
617 | void __init dmi_scan_machine(void) | 614 | static void __init dmi_scan_machine(void) |
618 | { | 615 | { |
619 | char __iomem *p, *q; | 616 | char __iomem *p, *q; |
620 | char buf[32]; | 617 | char buf[32]; |
@@ -769,15 +766,20 @@ static int __init dmi_init(void) | |||
769 | subsys_initcall(dmi_init); | 766 | subsys_initcall(dmi_init); |
770 | 767 | ||
771 | /** | 768 | /** |
772 | * dmi_set_dump_stack_arch_desc - set arch description for dump_stack() | 769 | * dmi_setup - scan and setup DMI system information |
773 | * | 770 | * |
774 | * Invoke dump_stack_set_arch_desc() with DMI system information so that | 771 | * Scan the DMI system information. This setups DMI identifiers |
775 | * DMI identifiers are printed out on task dumps. Arch boot code should | 772 | * (dmi_system_id) for printing it out on task dumps and prepares |
776 | * call this function after dmi_scan_machine() if it wants to print out DMI | 773 | * DIMM entry information (dmi_memdev_info) from the SMBIOS table |
777 | * identifiers on task dumps. | 774 | * for using this when reporting memory errors. |
778 | */ | 775 | */ |
779 | void __init dmi_set_dump_stack_arch_desc(void) | 776 | void __init dmi_setup(void) |
780 | { | 777 | { |
778 | dmi_scan_machine(); | ||
779 | if (!dmi_available) | ||
780 | return; | ||
781 | |||
782 | dmi_memdev_walk(); | ||
781 | dump_stack_set_arch_desc("%s", dmi_ids_string); | 783 | dump_stack_set_arch_desc("%s", dmi_ids_string); |
782 | } | 784 | } |
783 | 785 | ||
@@ -841,7 +843,7 @@ static bool dmi_is_end_of_table(const struct dmi_system_id *dmi) | |||
841 | * returns non zero or we hit the end. Callback function is called for | 843 | * returns non zero or we hit the end. Callback function is called for |
842 | * each successful match. Returns the number of matches. | 844 | * each successful match. Returns the number of matches. |
843 | * | 845 | * |
844 | * dmi_scan_machine must be called before this function is called. | 846 | * dmi_setup must be called before this function is called. |
845 | */ | 847 | */ |
846 | int dmi_check_system(const struct dmi_system_id *list) | 848 | int dmi_check_system(const struct dmi_system_id *list) |
847 | { | 849 | { |
@@ -871,7 +873,7 @@ EXPORT_SYMBOL(dmi_check_system); | |||
871 | * Walk the blacklist table until the first match is found. Return the | 873 | * Walk the blacklist table until the first match is found. Return the |
872 | * pointer to the matching entry or NULL if there's no match. | 874 | * pointer to the matching entry or NULL if there's no match. |
873 | * | 875 | * |
874 | * dmi_scan_machine must be called before this function is called. | 876 | * dmi_setup must be called before this function is called. |
875 | */ | 877 | */ |
876 | const struct dmi_system_id *dmi_first_match(const struct dmi_system_id *list) | 878 | const struct dmi_system_id *dmi_first_match(const struct dmi_system_id *list) |
877 | { | 879 | { |
diff --git a/drivers/firmware/efi/arm-runtime.c b/drivers/firmware/efi/arm-runtime.c index 0c1af675c338..e2ac5fa5531b 100644 --- a/drivers/firmware/efi/arm-runtime.c +++ b/drivers/firmware/efi/arm-runtime.c | |||
@@ -162,13 +162,11 @@ void efi_virtmap_unload(void) | |||
162 | static int __init arm_dmi_init(void) | 162 | static int __init arm_dmi_init(void) |
163 | { | 163 | { |
164 | /* | 164 | /* |
165 | * On arm64/ARM, DMI depends on UEFI, and dmi_scan_machine() needs to | 165 | * On arm64/ARM, DMI depends on UEFI, and dmi_setup() needs to |
166 | * be called early because dmi_id_init(), which is an arch_initcall | 166 | * be called early because dmi_id_init(), which is an arch_initcall |
167 | * itself, depends on dmi_scan_machine() having been called already. | 167 | * itself, depends on dmi_scan_machine() having been called already. |
168 | */ | 168 | */ |
169 | dmi_scan_machine(); | 169 | dmi_setup(); |
170 | if (dmi_available) | ||
171 | dmi_set_dump_stack_arch_desc(); | ||
172 | return 0; | 170 | return 0; |
173 | } | 171 | } |
174 | core_initcall(arm_dmi_init); | 172 | core_initcall(arm_dmi_init); |
diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile index b0103e16fc1b..b1f7b64652db 100644 --- a/drivers/firmware/efi/libstub/Makefile +++ b/drivers/firmware/efi/libstub/Makefile | |||
@@ -71,7 +71,6 @@ CFLAGS_arm64-stub.o := -DTEXT_OFFSET=$(TEXT_OFFSET) | |||
71 | extra-$(CONFIG_EFI_ARMSTUB) := $(lib-y) | 71 | extra-$(CONFIG_EFI_ARMSTUB) := $(lib-y) |
72 | lib-$(CONFIG_EFI_ARMSTUB) := $(patsubst %.o,%.stub.o,$(lib-y)) | 72 | lib-$(CONFIG_EFI_ARMSTUB) := $(patsubst %.o,%.stub.o,$(lib-y)) |
73 | 73 | ||
74 | STUBCOPY_RM-y := -R *ksymtab* -R *kcrctab* | ||
75 | STUBCOPY_FLAGS-$(CONFIG_ARM64) += --prefix-alloc-sections=.init \ | 74 | STUBCOPY_FLAGS-$(CONFIG_ARM64) += --prefix-alloc-sections=.init \ |
76 | --prefix-symbols=__efistub_ | 75 | --prefix-symbols=__efistub_ |
77 | STUBCOPY_RELOC-$(CONFIG_ARM64) := R_AARCH64_ABS | 76 | STUBCOPY_RELOC-$(CONFIG_ARM64) := R_AARCH64_ABS |
@@ -86,12 +85,13 @@ $(obj)/%.stub.o: $(obj)/%.o FORCE | |||
86 | # this time, use objcopy and leave all sections in place. | 85 | # this time, use objcopy and leave all sections in place. |
87 | # | 86 | # |
88 | quiet_cmd_stubcopy = STUBCPY $@ | 87 | quiet_cmd_stubcopy = STUBCPY $@ |
89 | cmd_stubcopy = if $(STRIP) --strip-debug $(STUBCOPY_RM-y) -o $@ $<; \ | 88 | cmd_stubcopy = \ |
90 | then if $(OBJDUMP) -r $@ | grep $(STUBCOPY_RELOC-y); \ | 89 | $(STRIP) --strip-debug -o $@ $<; \ |
91 | then (echo >&2 "$@: absolute symbol references not allowed in the EFI stub"; \ | 90 | if $(OBJDUMP) -r $@ | grep $(STUBCOPY_RELOC-y); then \ |
92 | rm -f $@; /bin/false); \ | 91 | echo "$@: absolute symbol references not allowed in the EFI stub" >&2; \ |
93 | else $(OBJCOPY) $(STUBCOPY_FLAGS-y) $< $@; fi \ | 92 | /bin/false; \ |
94 | else /bin/false; fi | 93 | fi; \ |
94 | $(OBJCOPY) $(STUBCOPY_FLAGS-y) $< $@ | ||
95 | 95 | ||
96 | # | 96 | # |
97 | # ARM discards the .data section because it disallows r/w data in the | 97 | # ARM discards the .data section because it disallows r/w data in the |
diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c index ba906876cc45..9e529cc2b4ff 100644 --- a/drivers/video/fbdev/efifb.c +++ b/drivers/video/fbdev/efifb.c | |||
@@ -464,7 +464,8 @@ static int efifb_probe(struct platform_device *dev) | |||
464 | info->apertures->ranges[0].base = efifb_fix.smem_start; | 464 | info->apertures->ranges[0].base = efifb_fix.smem_start; |
465 | info->apertures->ranges[0].size = size_remap; | 465 | info->apertures->ranges[0].size = size_remap; |
466 | 466 | ||
467 | if (!efi_mem_desc_lookup(efifb_fix.smem_start, &md)) { | 467 | if (efi_enabled(EFI_BOOT) && |
468 | !efi_mem_desc_lookup(efifb_fix.smem_start, &md)) { | ||
468 | if ((efifb_fix.smem_start + efifb_fix.smem_len) > | 469 | if ((efifb_fix.smem_start + efifb_fix.smem_len) > |
469 | (md.phys_addr + (md.num_pages << EFI_PAGE_SHIFT))) { | 470 | (md.phys_addr + (md.num_pages << EFI_PAGE_SHIFT))) { |
470 | pr_err("efifb: video memory @ 0x%lx spans multiple EFI memory regions\n", | 471 | pr_err("efifb: video memory @ 0x%lx spans multiple EFI memory regions\n", |
diff --git a/include/linux/dmi.h b/include/linux/dmi.h index c46fdb36700b..8de8c4f15163 100644 --- a/include/linux/dmi.h +++ b/include/linux/dmi.h | |||
@@ -102,9 +102,7 @@ const struct dmi_system_id *dmi_first_match(const struct dmi_system_id *list); | |||
102 | extern const char * dmi_get_system_info(int field); | 102 | extern const char * dmi_get_system_info(int field); |
103 | extern const struct dmi_device * dmi_find_device(int type, const char *name, | 103 | extern const struct dmi_device * dmi_find_device(int type, const char *name, |
104 | const struct dmi_device *from); | 104 | const struct dmi_device *from); |
105 | extern void dmi_scan_machine(void); | 105 | extern void dmi_setup(void); |
106 | extern void dmi_memdev_walk(void); | ||
107 | extern void dmi_set_dump_stack_arch_desc(void); | ||
108 | extern bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp); | 106 | extern bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp); |
109 | extern int dmi_get_bios_year(void); | 107 | extern int dmi_get_bios_year(void); |
110 | extern int dmi_name_in_vendors(const char *str); | 108 | extern int dmi_name_in_vendors(const char *str); |
@@ -122,9 +120,7 @@ static inline int dmi_check_system(const struct dmi_system_id *list) { return 0; | |||
122 | static inline const char * dmi_get_system_info(int field) { return NULL; } | 120 | static inline const char * dmi_get_system_info(int field) { return NULL; } |
123 | static inline const struct dmi_device * dmi_find_device(int type, const char *name, | 121 | static inline const struct dmi_device * dmi_find_device(int type, const char *name, |
124 | const struct dmi_device *from) { return NULL; } | 122 | const struct dmi_device *from) { return NULL; } |
125 | static inline void dmi_scan_machine(void) { return; } | 123 | static inline void dmi_setup(void) { } |
126 | static inline void dmi_memdev_walk(void) { } | ||
127 | static inline void dmi_set_dump_stack_arch_desc(void) { } | ||
128 | static inline bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp) | 124 | static inline bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp) |
129 | { | 125 | { |
130 | if (yearp) | 126 | if (yearp) |