* [PATCH v3 0/5] x86: efi: cleanups and basic 32/64 bit support
@ 2012-01-03 17:11 Olof Johansson
2012-01-03 17:11 ` [PATCH 1/5] x86: efi: refactor efi_init() a bit Olof Johansson
` (5 more replies)
0 siblings, 6 replies; 27+ messages in thread
From: Olof Johansson @ 2012-01-03 17:11 UTC (permalink / raw)
To: H. Peter Anvin, Matthew Garrett
Cc: linux-kernel, Ingo Molnar, Thomas Gleixner, x86, Matt Fleming
Here's a refactored series of cleanups with the 32/64-bit enablement at
the end. It should hopefully be significantly easier to review.
Changelog to the 32/64-bit patch is:
v3:
* Reorganized to a series of patches to make it easier to review, and
do some of the cleanups I had left out before.
v2:
* Added graceful error handling for 32-bit kernel that gets passed
EFI data above 4GB.
* Removed some warnings that were missed in first version.
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 1/5] x86: efi: refactor efi_init() a bit
2012-01-03 17:11 [PATCH v3 0/5] x86: efi: cleanups and basic 32/64 bit support Olof Johansson
@ 2012-01-03 17:11 ` Olof Johansson
2012-01-05 11:22 ` Matt Fleming
2012-01-05 18:17 ` Matthew Garrett
2012-01-03 17:11 ` [PATCH 2/5] x86: efi: convert printk to pr_*() Olof Johansson
` (4 subsequent siblings)
5 siblings, 2 replies; 27+ messages in thread
From: Olof Johansson @ 2012-01-03 17:11 UTC (permalink / raw)
To: H. Peter Anvin, Matthew Garrett
Cc: linux-kernel, Ingo Molnar, Thomas Gleixner, x86, Matt Fleming,
Olof Johansson
Break out some of the init steps into helper functions.
No code changes at all, identical execution flow.
Signed-off-by: Olof Johansson <olof@lixom.net>
---
arch/x86/platform/efi/efi.c | 89 +++++++++++++++++++++++++++----------------
1 files changed, 56 insertions(+), 33 deletions(-)
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index 4cf9bd0..0c9ba03 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -429,23 +429,8 @@ static void __init efi_free_boot_services(void)
}
}
-void __init efi_init(void)
+static void __init efi_systab_init(void *phys)
{
- efi_config_table_t *config_tables;
- efi_runtime_services_t *runtime;
- efi_char16_t *c16;
- char vendor[100] = "unknown";
- int i = 0;
- void *tmp;
-
-#ifdef CONFIG_X86_32
- efi_phys.systab = (efi_system_table_t *)boot_params.efi_info.efi_systab;
-#else
- efi_phys.systab = (efi_system_table_t *)
- (boot_params.efi_info.efi_systab |
- ((__u64)boot_params.efi_info.efi_systab_hi<<32));
-#endif
-
efi.systab = early_ioremap((unsigned long)efi_phys.systab,
sizeof(efi_system_table_t));
if (efi.systab == NULL)
@@ -464,22 +449,12 @@ void __init efi_init(void)
"%d.%02d, expected 1.00 or greater!\n",
efi.systab->hdr.revision >> 16,
efi.systab->hdr.revision & 0xffff);
+}
- /*
- * Show what we know for posterity
- */
- c16 = tmp = early_ioremap(efi.systab->fw_vendor, 2);
- if (c16) {
- for (i = 0; i < sizeof(vendor) - 1 && *c16; ++i)
- vendor[i] = *c16++;
- vendor[i] = '\0';
- } else
- printk(KERN_ERR PFX "Could not map the firmware vendor!\n");
- early_iounmap(tmp, 2);
-
- printk(KERN_INFO "EFI v%u.%.02u by %s\n",
- efi.systab->hdr.revision >> 16,
- efi.systab->hdr.revision & 0xffff, vendor);
+static void __init efi_config_init(u64 tables, int nr_tables)
+{
+ efi_config_table_t *config_tables;
+ int i;
/*
* Let's see what config tables the firmware passed to us.
@@ -526,6 +501,11 @@ void __init efi_init(void)
printk("\n");
early_iounmap(config_tables,
efi.systab->nr_tables * sizeof(efi_config_table_t));
+}
+
+static void __init efi_runtime_init(void)
+{
+ efi_runtime_services_t *runtime;
/*
* Check out the runtime services table. We need to map
@@ -554,7 +534,10 @@ void __init efi_init(void)
printk(KERN_ERR "Could not map the EFI runtime service "
"table!\n");
early_iounmap(runtime, sizeof(efi_runtime_services_t));
+}
+static void __init efi_memmap_init(void)
+{
/* Map the EFI memory map */
memmap.map = early_ioremap((unsigned long)memmap.phys_map,
memmap.nr_map * memmap.desc_size);
@@ -563,11 +546,51 @@ void __init efi_init(void)
memmap.map_end = memmap.map + (memmap.nr_map * memmap.desc_size);
if (memmap.desc_size != sizeof(efi_memory_desc_t))
- printk(KERN_WARNING
- "Kernel-defined memdesc doesn't match the one from EFI!\n");
+ printk(KERN_WARNING "Kernel-defined memdesc doesn't match the "
+ "one from EFI!\n");
if (add_efi_memmap)
do_add_efi_memmap();
+}
+
+void __init efi_init(void)
+{
+ efi_char16_t *c16;
+ char vendor[100] = "unknown";
+ int i = 0;
+ void *tmp;
+
+#ifdef CONFIG_X86_32
+ efi_phys.systab = (efi_system_table_t *)boot_params.efi_info.efi_systab;
+#else
+ efi_phys.systab = (efi_system_table_t *)
+ (boot_params.efi_info.efi_systab |
+ ((__u64)boot_params.efi_info.efi_systab_hi<<32));
+#endif
+
+ efi_systab_init(efi_phys.systab);
+
+ /*
+ * Show what we know for posterity
+ */
+ c16 = tmp = early_ioremap(efi.systab->fw_vendor, 2);
+ if (c16) {
+ for (i = 0; i < sizeof(vendor) - 1 && *c16; ++i)
+ vendor[i] = *c16++;
+ vendor[i] = '\0';
+ } else
+ printk(KERN_ERR PFX "Could not map the firmware vendor!\n");
+ early_iounmap(tmp, 2);
+
+ printk(KERN_INFO "EFI v%u.%.02u by %s\n",
+ efi.systab->hdr.revision >> 16,
+ efi.systab->hdr.revision & 0xffff, vendor);
+
+ efi_config_init(efi.systab->tables, efi.systab->nr_tables);
+
+ efi_runtime_init();
+
+ efi_memmap_init();
#ifdef CONFIG_X86_32
x86_platform.get_wallclock = efi_get_time;
--
1.7.8.GIT
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 2/5] x86: efi: convert printk to pr_*()
2012-01-03 17:11 [PATCH v3 0/5] x86: efi: cleanups and basic 32/64 bit support Olof Johansson
2012-01-03 17:11 ` [PATCH 1/5] x86: efi: refactor efi_init() a bit Olof Johansson
@ 2012-01-03 17:11 ` Olof Johansson
2012-01-04 5:26 ` Joe Perches
2012-01-03 17:11 ` [PATCH 3/5] x86: efi: cleanup config table walking Olof Johansson
` (3 subsequent siblings)
5 siblings, 1 reply; 27+ messages in thread
From: Olof Johansson @ 2012-01-03 17:11 UTC (permalink / raw)
To: H. Peter Anvin, Matthew Garrett
Cc: linux-kernel, Ingo Molnar, Thomas Gleixner, x86, Matt Fleming,
Olof Johansson
Alright, I guess I'll go through and convert them, even though
there's no net gain to speak of.
Signed-off-by: Olof Johansson <olof@lixom.net>
---
arch/x86/platform/efi/efi.c | 54 +++++++++++++++++++++---------------------
1 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index 0c9ba03..965b155 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -254,7 +254,7 @@ int efi_set_rtc_mmss(unsigned long nowtime)
status = efi.get_time(&eft, &cap);
if (status != EFI_SUCCESS) {
- printk(KERN_ERR "Oops: efitime: can't read time!\n");
+ pr_err("Oops: efitime: can't read time!\n");
return -1;
}
@@ -268,7 +268,7 @@ int efi_set_rtc_mmss(unsigned long nowtime)
status = efi.set_time(&eft);
if (status != EFI_SUCCESS) {
- printk(KERN_ERR "Oops: efitime: can't write time!\n");
+ pr_err("Oops: efitime: can't write time!\n");
return -1;
}
return 0;
@@ -282,7 +282,7 @@ unsigned long efi_get_time(void)
status = efi.get_time(&eft, &cap);
if (status != EFI_SUCCESS)
- printk(KERN_ERR "Oops: efitime: can't read time!\n");
+ pr_err("Oops: efitime: can't read time!\n");
return mktime(eft.year, eft.month, eft.day, eft.hour,
eft.minute, eft.second);
@@ -367,7 +367,7 @@ static void __init print_efi_memmap(void)
p < memmap.map_end;
p += memmap.desc_size, i++) {
md = p;
- printk(KERN_INFO PFX "mem%02u: type=%u, attr=0x%llx, "
+ pr_info(PFX "mem%02u: type=%u, attr=0x%llx, "
"range=[0x%016llx-0x%016llx) (%lluMB)\n",
i, md->type, md->attribute, md->phys_addr,
md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT),
@@ -434,7 +434,7 @@ static void __init efi_systab_init(void *phys)
efi.systab = early_ioremap((unsigned long)efi_phys.systab,
sizeof(efi_system_table_t));
if (efi.systab == NULL)
- printk(KERN_ERR "Couldn't map the EFI system table!\n");
+ pr_err("Couldn't map the EFI system table!\n");
memcpy(&efi_systab, efi.systab, sizeof(efi_system_table_t));
early_iounmap(efi.systab, sizeof(efi_system_table_t));
efi.systab = &efi_systab;
@@ -443,9 +443,9 @@ static void __init efi_systab_init(void *phys)
* Verify the EFI Table
*/
if (efi.systab->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE)
- printk(KERN_ERR "EFI system table signature incorrect!\n");
+ pr_err("EFI system table signature incorrect!\n");
if ((efi.systab->hdr.revision >> 16) == 0)
- printk(KERN_ERR "Warning: EFI system table version "
+ pr_err("Warning: EFI system table version "
"%d.%02d, expected 1.00 or greater!\n",
efi.systab->hdr.revision >> 16,
efi.systab->hdr.revision & 0xffff);
@@ -463,42 +463,42 @@ static void __init efi_config_init(u64 tables, int nr_tables)
efi.systab->tables,
efi.systab->nr_tables * sizeof(efi_config_table_t));
if (config_tables == NULL)
- printk(KERN_ERR "Could not map EFI Configuration Table!\n");
+ pr_err("Could not map EFI Configuration Table!\n");
- printk(KERN_INFO);
+ pr_info("");
for (i = 0; i < efi.systab->nr_tables; i++) {
if (!efi_guidcmp(config_tables[i].guid, MPS_TABLE_GUID)) {
efi.mps = config_tables[i].table;
- printk(" MPS=0x%lx ", config_tables[i].table);
+ pr_cont(" MPS=0x%lx ", config_tables[i].table);
} else if (!efi_guidcmp(config_tables[i].guid,
ACPI_20_TABLE_GUID)) {
efi.acpi20 = config_tables[i].table;
- printk(" ACPI 2.0=0x%lx ", config_tables[i].table);
+ pr_cont(" ACPI 2.0=0x%lx ", config_tables[i].table);
} else if (!efi_guidcmp(config_tables[i].guid,
ACPI_TABLE_GUID)) {
efi.acpi = config_tables[i].table;
- printk(" ACPI=0x%lx ", config_tables[i].table);
+ pr_cont(" ACPI=0x%lx ", config_tables[i].table);
} else if (!efi_guidcmp(config_tables[i].guid,
SMBIOS_TABLE_GUID)) {
efi.smbios = config_tables[i].table;
- printk(" SMBIOS=0x%lx ", config_tables[i].table);
+ pr_cont(" SMBIOS=0x%lx ", config_tables[i].table);
#ifdef CONFIG_X86_UV
} else if (!efi_guidcmp(config_tables[i].guid,
UV_SYSTEM_TABLE_GUID)) {
efi.uv_systab = config_tables[i].table;
- printk(" UVsystab=0x%lx ", config_tables[i].table);
+ pr_cont(" UVsystab=0x%lx ", config_tables[i].table);
#endif
} else if (!efi_guidcmp(config_tables[i].guid,
HCDP_TABLE_GUID)) {
efi.hcdp = config_tables[i].table;
- printk(" HCDP=0x%lx ", config_tables[i].table);
+ pr_cont(" HCDP=0x%lx ", config_tables[i].table);
} else if (!efi_guidcmp(config_tables[i].guid,
UGA_IO_PROTOCOL_GUID)) {
efi.uga = config_tables[i].table;
- printk(" UGA=0x%lx ", config_tables[i].table);
+ pr_cont(" UGA=0x%lx ", config_tables[i].table);
}
}
- printk("\n");
+ pr_cont("\n");
early_iounmap(config_tables,
efi.systab->nr_tables * sizeof(efi_config_table_t));
}
@@ -531,7 +531,7 @@ static void __init efi_runtime_init(void)
*/
efi.get_time = phys_efi_get_time;
} else
- printk(KERN_ERR "Could not map the EFI runtime service "
+ pr_err("Could not map the EFI runtime service "
"table!\n");
early_iounmap(runtime, sizeof(efi_runtime_services_t));
}
@@ -542,12 +542,12 @@ static void __init efi_memmap_init(void)
memmap.map = early_ioremap((unsigned long)memmap.phys_map,
memmap.nr_map * memmap.desc_size);
if (memmap.map == NULL)
- printk(KERN_ERR "Could not map the EFI memory map!\n");
+ pr_err("Could not map the EFI memory map!\n");
memmap.map_end = memmap.map + (memmap.nr_map * memmap.desc_size);
if (memmap.desc_size != sizeof(efi_memory_desc_t))
- printk(KERN_WARNING "Kernel-defined memdesc doesn't match the "
- "one from EFI!\n");
+ pr_warn("Kernel-defined memdesc doesn't match the one "
+ "from EFI!\n");
if (add_efi_memmap)
do_add_efi_memmap();
@@ -579,12 +579,12 @@ void __init efi_init(void)
vendor[i] = *c16++;
vendor[i] = '\0';
} else
- printk(KERN_ERR PFX "Could not map the firmware vendor!\n");
+ pr_err(PFX "Could not map the firmware vendor!\n");
early_iounmap(tmp, 2);
- printk(KERN_INFO "EFI v%u.%.02u by %s\n",
- efi.systab->hdr.revision >> 16,
- efi.systab->hdr.revision & 0xffff, vendor);
+ pr_info("EFI v%u.%.02u by %s\n",
+ efi.systab->hdr.revision >> 16,
+ efi.systab->hdr.revision & 0xffff, vendor);
efi_config_init(efi.systab->tables, efi.systab->nr_tables);
@@ -700,7 +700,7 @@ void __init efi_enter_virtual_mode(void)
md->virt_addr = (u64) (unsigned long) va;
if (!va) {
- printk(KERN_ERR PFX "ioremap of 0x%llX failed!\n",
+ pr_err(PFX "ioremap of 0x%llX failed!\n",
(unsigned long long)md->phys_addr);
continue;
}
@@ -734,7 +734,7 @@ void __init efi_enter_virtual_mode(void)
(efi_memory_desc_t *)__pa(new_memmap));
if (status != EFI_SUCCESS) {
- printk(KERN_ALERT "Unable to switch EFI into virtual mode "
+ pr_alert("Unable to switch EFI into virtual mode "
"(status=%lx)!\n", status);
panic("EFI call to SetVirtualAddressMap() failed!");
}
--
1.7.8.GIT
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 3/5] x86: efi: cleanup config table walking
2012-01-03 17:11 [PATCH v3 0/5] x86: efi: cleanups and basic 32/64 bit support Olof Johansson
2012-01-03 17:11 ` [PATCH 1/5] x86: efi: refactor efi_init() a bit Olof Johansson
2012-01-03 17:11 ` [PATCH 2/5] x86: efi: convert printk to pr_*() Olof Johansson
@ 2012-01-03 17:11 ` Olof Johansson
2012-01-05 11:22 ` Matt Fleming
2012-01-03 17:11 ` [PATCH 4/5] x86: efi: add basic error handling Olof Johansson
` (2 subsequent siblings)
5 siblings, 1 reply; 27+ messages in thread
From: Olof Johansson @ 2012-01-03 17:11 UTC (permalink / raw)
To: H. Peter Anvin, Matthew Garrett
Cc: linux-kernel, Ingo Molnar, Thomas Gleixner, x86, Matt Fleming,
Olof Johansson
Trivial cleanup, move guid and table pointers to local copies to
make the code cleaner.
Signed-off-by: Olof Johansson <olof@lixom.net>
---
arch/x86/platform/efi/efi.c | 61 +++++++++++++++++++-----------------------
1 files changed, 28 insertions(+), 33 deletions(-)
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index 965b155..5d6696b 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -454,53 +454,48 @@ static void __init efi_systab_init(void *phys)
static void __init efi_config_init(u64 tables, int nr_tables)
{
efi_config_table_t *config_tables;
- int i;
+ int i, sz = sizeof(efi_config_table_t);
/*
* Let's see what config tables the firmware passed to us.
*/
- config_tables = early_ioremap(
- efi.systab->tables,
- efi.systab->nr_tables * sizeof(efi_config_table_t));
+ config_tables = early_ioremap(efi.systab->tables,
+ efi.systab->nr_tables * sz);
if (config_tables == NULL)
pr_err("Could not map EFI Configuration Table!\n");
pr_info("");
for (i = 0; i < efi.systab->nr_tables; i++) {
- if (!efi_guidcmp(config_tables[i].guid, MPS_TABLE_GUID)) {
- efi.mps = config_tables[i].table;
- pr_cont(" MPS=0x%lx ", config_tables[i].table);
- } else if (!efi_guidcmp(config_tables[i].guid,
- ACPI_20_TABLE_GUID)) {
- efi.acpi20 = config_tables[i].table;
- pr_cont(" ACPI 2.0=0x%lx ", config_tables[i].table);
- } else if (!efi_guidcmp(config_tables[i].guid,
- ACPI_TABLE_GUID)) {
- efi.acpi = config_tables[i].table;
- pr_cont(" ACPI=0x%lx ", config_tables[i].table);
- } else if (!efi_guidcmp(config_tables[i].guid,
- SMBIOS_TABLE_GUID)) {
- efi.smbios = config_tables[i].table;
- pr_cont(" SMBIOS=0x%lx ", config_tables[i].table);
+ efi_guid_t guid = config_tables[i].guid;
+ unsigned long table = config_tables[i].table;
+
+ if (!efi_guidcmp(guid, MPS_TABLE_GUID)) {
+ efi.mps = table;
+ pr_cont(" MPS=0x%lx ", table);
+ } else if (!efi_guidcmp(guid, ACPI_20_TABLE_GUID)) {
+ efi.acpi20 = table;
+ pr_cont(" ACPI 2.0=0x%lx ", table);
+ } else if (!efi_guidcmp(guid, ACPI_TABLE_GUID)) {
+ efi.acpi = table;
+ pr_cont(" ACPI=0x%lx ", table);
+ } else if (!efi_guidcmp(guid, SMBIOS_TABLE_GUID)) {
+ efi.smbios = table;
+ pr_cont(" SMBIOS=0x%lx ", table);
#ifdef CONFIG_X86_UV
- } else if (!efi_guidcmp(config_tables[i].guid,
- UV_SYSTEM_TABLE_GUID)) {
- efi.uv_systab = config_tables[i].table;
- pr_cont(" UVsystab=0x%lx ", config_tables[i].table);
+ } else if (!efi_guidcmp(guid, UV_SYSTEM_TABLE_GUID)) {
+ efi.uv_systab = table;
+ pr_cont(" UVsystab=0x%lx ", table);
#endif
- } else if (!efi_guidcmp(config_tables[i].guid,
- HCDP_TABLE_GUID)) {
- efi.hcdp = config_tables[i].table;
- pr_cont(" HCDP=0x%lx ", config_tables[i].table);
- } else if (!efi_guidcmp(config_tables[i].guid,
- UGA_IO_PROTOCOL_GUID)) {
- efi.uga = config_tables[i].table;
- pr_cont(" UGA=0x%lx ", config_tables[i].table);
+ } else if (!efi_guidcmp(guid, HCDP_TABLE_GUID)) {
+ efi.hcdp = table;
+ pr_cont(" HCDP=0x%lx ", table);
+ } else if (!efi_guidcmp(guid, UGA_IO_PROTOCOL_GUID)) {
+ efi.uga = table;
+ pr_cont(" UGA=0x%lx ", table);
}
}
pr_cont("\n");
- early_iounmap(config_tables,
- efi.systab->nr_tables * sizeof(efi_config_table_t));
+ early_iounmap(config_tables, efi.systab->nr_tables * sz);
}
static void __init efi_runtime_init(void)
--
1.7.8.GIT
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 4/5] x86: efi: add basic error handling
2012-01-03 17:11 [PATCH v3 0/5] x86: efi: cleanups and basic 32/64 bit support Olof Johansson
` (2 preceding siblings ...)
2012-01-03 17:11 ` [PATCH 3/5] x86: efi: cleanup config table walking Olof Johansson
@ 2012-01-03 17:11 ` Olof Johansson
2012-01-05 11:21 ` Matt Fleming
2012-01-03 17:11 ` [PATCH 5/5] x86: efi: allow basic init with mixed 32/64-bit efi/kernel Olof Johansson
2012-01-05 21:02 ` [PATCH v4 0/5] x86: efi: cleanups and basic 32/64 bit support Olof Johansson
5 siblings, 1 reply; 27+ messages in thread
From: Olof Johansson @ 2012-01-03 17:11 UTC (permalink / raw)
To: H. Peter Anvin, Matthew Garrett
Cc: linux-kernel, Ingo Molnar, Thomas Gleixner, x86, Matt Fleming,
Olof Johansson
It's not perfect, but way better than before. Mark efi_enabled as false in
case of error and at least stop dereferencing pointers that are known to
be invalid.
The only significant missing piece is the lack of undoing the
memblock_reserve of the memory that efi marks as in use. On the other
hand, it's not a large amount of memory, and leaving it unavailable for
system use should be the safer choice anyway.
Signed-off-by: Olof Johansson <olof@lixom.net>
---
arch/x86/platform/efi/efi.c | 89 ++++++++++++++++++++++++++++--------------
1 files changed, 59 insertions(+), 30 deletions(-)
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index 5d6696b..e5ec213 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -429,12 +429,14 @@ static void __init efi_free_boot_services(void)
}
}
-static void __init efi_systab_init(void *phys)
+static int __init efi_systab_init(void *phys)
{
efi.systab = early_ioremap((unsigned long)efi_phys.systab,
sizeof(efi_system_table_t));
- if (efi.systab == NULL)
+ if (efi.systab == NULL) {
pr_err("Couldn't map the EFI system table!\n");
+ return -ENOMEM;
+ }
memcpy(&efi_systab, efi.systab, sizeof(efi_system_table_t));
early_iounmap(efi.systab, sizeof(efi_system_table_t));
efi.systab = &efi_systab;
@@ -442,16 +444,20 @@ static void __init efi_systab_init(void *phys)
/*
* Verify the EFI Table
*/
- if (efi.systab->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE)
+ if (efi.systab->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE) {
pr_err("EFI system table signature incorrect!\n");
+ return -EINVAL;
+ }
if ((efi.systab->hdr.revision >> 16) == 0)
pr_err("Warning: EFI system table version "
"%d.%02d, expected 1.00 or greater!\n",
efi.systab->hdr.revision >> 16,
efi.systab->hdr.revision & 0xffff);
+
+ return 0;
}
-static void __init efi_config_init(u64 tables, int nr_tables)
+static int __init efi_config_init(u64 tables, int nr_tables)
{
efi_config_table_t *config_tables;
int i, sz = sizeof(efi_config_table_t);
@@ -461,8 +467,10 @@ static void __init efi_config_init(u64 tables, int nr_tables)
*/
config_tables = early_ioremap(efi.systab->tables,
efi.systab->nr_tables * sz);
- if (config_tables == NULL)
+ if (config_tables == NULL) {
pr_err("Could not map EFI Configuration Table!\n");
+ return -ENOMEM;
+ }
pr_info("");
for (i = 0; i < efi.systab->nr_tables; i++) {
@@ -496,9 +504,11 @@ static void __init efi_config_init(u64 tables, int nr_tables)
}
pr_cont("\n");
early_iounmap(config_tables, efi.systab->nr_tables * sz);
+
+ return 0;
}
-static void __init efi_runtime_init(void)
+static int __init efi_runtime_init(void)
{
efi_runtime_services_t *runtime;
@@ -510,34 +520,39 @@ static void __init efi_runtime_init(void)
*/
runtime = early_ioremap((unsigned long)efi.systab->runtime,
sizeof(efi_runtime_services_t));
- if (runtime != NULL) {
- /*
- * We will only need *early* access to the following
- * two EFI runtime services before set_virtual_address_map
- * is invoked.
- */
- efi_phys.get_time = (efi_get_time_t *)runtime->get_time;
- efi_phys.set_virtual_address_map =
- (efi_set_virtual_address_map_t *)
- runtime->set_virtual_address_map;
- /*
- * Make efi_get_time can be called before entering
- * virtual mode.
- */
- efi.get_time = phys_efi_get_time;
- } else
- pr_err("Could not map the EFI runtime service "
- "table!\n");
+
+ if (!runtime) {
+ pr_err("Could not map the EFI runtime service table!\n");
+ return -ENOMEM;
+ }
+ /*
+ * We will only need *early* access to the following
+ * two EFI runtime services before set_virtual_address_map
+ * is invoked.
+ */
+ efi_phys.get_time = (efi_get_time_t *)runtime->get_time;
+ efi_phys.set_virtual_address_map =
+ (efi_set_virtual_address_map_t *)
+ runtime->set_virtual_address_map;
+ /*
+ * Make efi_get_time can be called before entering
+ * virtual mode.
+ */
+ efi.get_time = phys_efi_get_time;
early_iounmap(runtime, sizeof(efi_runtime_services_t));
+
+ return 0;
}
-static void __init efi_memmap_init(void)
+static int __init efi_memmap_init(void)
{
/* Map the EFI memory map */
memmap.map = early_ioremap((unsigned long)memmap.phys_map,
memmap.nr_map * memmap.desc_size);
- if (memmap.map == NULL)
+ if (memmap.map == NULL) {
pr_err("Could not map the EFI memory map!\n");
+ return -ENOMEM;
+ }
memmap.map_end = memmap.map + (memmap.nr_map * memmap.desc_size);
if (memmap.desc_size != sizeof(efi_memory_desc_t))
@@ -546,6 +561,8 @@ static void __init efi_memmap_init(void)
if (add_efi_memmap)
do_add_efi_memmap();
+
+ return 0;
}
void __init efi_init(void)
@@ -563,7 +580,10 @@ void __init efi_init(void)
((__u64)boot_params.efi_info.efi_systab_hi<<32));
#endif
- efi_systab_init(efi_phys.systab);
+ if (efi_systab_init(efi_phys.systab)) {
+ efi_enabled = 0;
+ return;
+ }
/*
* Show what we know for posterity
@@ -581,11 +601,20 @@ void __init efi_init(void)
efi.systab->hdr.revision >> 16,
efi.systab->hdr.revision & 0xffff, vendor);
- efi_config_init(efi.systab->tables, efi.systab->nr_tables);
+ if (efi_config_init(efi.systab->tables, efi.systab->nr_tables)) {
+ efi_enabled = 0;
+ return;
+ }
- efi_runtime_init();
+ if (efi_runtime_init()) {
+ efi_enabled = 0;
+ return;
+ }
- efi_memmap_init();
+ if (efi_memmap_init()) {
+ efi_enabled = 0;
+ return;
+ }
#ifdef CONFIG_X86_32
x86_platform.get_wallclock = efi_get_time;
--
1.7.8.GIT
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 5/5] x86: efi: allow basic init with mixed 32/64-bit efi/kernel
2012-01-03 17:11 [PATCH v3 0/5] x86: efi: cleanups and basic 32/64 bit support Olof Johansson
` (3 preceding siblings ...)
2012-01-03 17:11 ` [PATCH 4/5] x86: efi: add basic error handling Olof Johansson
@ 2012-01-03 17:11 ` Olof Johansson
2012-01-05 11:21 ` Matt Fleming
2012-01-05 18:21 ` Matthew Garrett
2012-01-05 21:02 ` [PATCH v4 0/5] x86: efi: cleanups and basic 32/64 bit support Olof Johansson
5 siblings, 2 replies; 27+ messages in thread
From: Olof Johansson @ 2012-01-03 17:11 UTC (permalink / raw)
To: H. Peter Anvin, Matthew Garrett
Cc: linux-kernel, Ingo Molnar, Thomas Gleixner, x86, Matt Fleming,
Olof Johansson
Traditionally the kernel has refused to setup EFI at all if there's been
a mismatch in 32/64-bit mode between EFI and the kernel.
On some platforms that boot natively through EFI (Chrome OS being one),
we still need to get at least some of the static data such as memory
configuration out of EFI. Runtime services aren't as critical, and
it's a significant amount of work to implement switching between the
operating modes to call between kernel and firmware for thise cases. So
I'm ignoring it for now.
v3:
* Reorganized to a series of patches to make it easier to review, and
do some of the cleanups I had left out before.
v2:
* Added graceful error handling for 32-bit kernel that gets passed
EFI data above 4GB.
* Removed some warnings that were missed in first version.
Signed-off-by: Olof Johansson <olof@lixom.net>
---
arch/x86/include/asm/efi.h | 2 +-
arch/x86/kernel/setup.c | 10 ++-
arch/x86/platform/efi/efi.c | 234 ++++++++++++++++++++++++++++++++-----------
include/linux/efi.h | 45 ++++++++
4 files changed, 228 insertions(+), 63 deletions(-)
diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h
index 844f735..c9dcc18 100644
--- a/arch/x86/include/asm/efi.h
+++ b/arch/x86/include/asm/efi.h
@@ -95,7 +95,7 @@ extern void __iomem *efi_ioremap(unsigned long addr, unsigned long size,
extern int add_efi_memmap;
extern void efi_set_executable(efi_memory_desc_t *md, bool executable);
-extern void efi_memblock_x86_reserve_range(void);
+extern int efi_memblock_x86_reserve_range(void);
extern void efi_call_phys_prelog(void);
extern void efi_call_phys_epilog(void);
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index d7d5099..8863888 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -749,10 +749,16 @@ void __init setup_arch(char **cmdline_p)
#endif
#ifdef CONFIG_EFI
if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature,
- EFI_LOADER_SIGNATURE, 4)) {
+ "EL32", 4)) {
efi_enabled = 1;
- efi_memblock_x86_reserve_range();
+ efi_64bit = false;
+ } else if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature,
+ "EL64", 4)) {
+ efi_enabled = 1;
+ efi_64bit = true;
}
+ if (efi_enabled && efi_memblock_x86_reserve_range())
+ efi_enabled = 0;
#endif
x86_init.oem.arch_setup();
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index e5ec213..6b53e32 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -67,6 +67,9 @@ EXPORT_SYMBOL(efi);
struct efi_memory_map memmap;
+bool efi_64bit;
+static bool efi_native;
+
static struct efi efi_phys __initdata;
static efi_system_table_t efi_systab __initdata;
@@ -254,7 +257,7 @@ int efi_set_rtc_mmss(unsigned long nowtime)
status = efi.get_time(&eft, &cap);
if (status != EFI_SUCCESS) {
- pr_err("Oops: efitime: can't read time!\n");
+ printk(KERN_ERR "Oops: efitime: can't read time!\n");
return -1;
}
@@ -268,7 +271,7 @@ int efi_set_rtc_mmss(unsigned long nowtime)
status = efi.set_time(&eft);
if (status != EFI_SUCCESS) {
- pr_err("Oops: efitime: can't write time!\n");
+ printk(KERN_ERR "Oops: efitime: can't write time!\n");
return -1;
}
return 0;
@@ -282,7 +285,7 @@ unsigned long efi_get_time(void)
status = efi.get_time(&eft, &cap);
if (status != EFI_SUCCESS)
- pr_err("Oops: efitime: can't read time!\n");
+ printk(KERN_ERR "Oops: efitime: can't read time!\n");
return mktime(eft.year, eft.month, eft.day, eft.hour,
eft.minute, eft.second);
@@ -338,11 +341,14 @@ static void __init do_add_efi_memmap(void)
sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map);
}
-void __init efi_memblock_x86_reserve_range(void)
+int __init efi_memblock_x86_reserve_range(void)
{
unsigned long pmap;
#ifdef CONFIG_X86_32
+ /* Can't handle data above 4GB at this time */
+ if (boot_params.efi_info.efi_memmap_hi)
+ return -EINVAL;
pmap = boot_params.efi_info.efi_memmap;
#else
pmap = (boot_params.efi_info.efi_memmap |
@@ -354,6 +360,8 @@ void __init efi_memblock_x86_reserve_range(void)
memmap.desc_version = boot_params.efi_info.efi_memdesc_version;
memmap.desc_size = boot_params.efi_info.efi_memdesc_size;
memblock_reserve(pmap, memmap.nr_map * memmap.desc_size);
+
+ return 0;
}
#if EFI_DEBUG
@@ -367,7 +375,7 @@ static void __init print_efi_memmap(void)
p < memmap.map_end;
p += memmap.desc_size, i++) {
md = p;
- pr_info(PFX "mem%02u: type=%u, attr=0x%llx, "
+ printk(KERN_INFO PFX "mem%02u: type=%u, attr=0x%llx, "
"range=[0x%016llx-0x%016llx) (%lluMB)\n",
i, md->type, md->attribute, md->phys_addr,
md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT),
@@ -431,25 +439,84 @@ static void __init efi_free_boot_services(void)
static int __init efi_systab_init(void *phys)
{
- efi.systab = early_ioremap((unsigned long)efi_phys.systab,
- sizeof(efi_system_table_t));
- if (efi.systab == NULL) {
- pr_err("Couldn't map the EFI system table!\n");
- return -ENOMEM;
+ if (efi_64bit) {
+ _efi_system_table_64_t *systab64;
+ u64 tmp = 0;
+
+ systab64 = early_ioremap((unsigned long)phys,
+ sizeof(*systab64));
+ if (systab64 == NULL) {
+ printk(KERN_ERR "Couldn't map the EFI system table!\n");
+ return -ENOMEM;
+ }
+
+ efi_systab.hdr = systab64->hdr;
+ efi_systab.fw_vendor = systab64->fw_vendor;
+ tmp |= systab64->fw_vendor;
+ efi_systab.fw_revision = systab64->fw_revision;
+ efi_systab.con_in_handle = systab64->con_in_handle;
+ tmp |= systab64->con_in_handle;
+ efi_systab.con_in = systab64->con_in;
+ tmp |= systab64->con_in;
+ efi_systab.con_out_handle = systab64->con_out_handle;
+ tmp |= systab64->con_out_handle;
+ efi_systab.con_out = systab64->con_out;
+ tmp |= systab64->con_out;
+ efi_systab.stderr_handle = systab64->stderr_handle;
+ tmp |= systab64->stderr_handle;
+ efi_systab.stderr = systab64->stderr;
+ tmp |= systab64->stderr;
+ efi_systab.runtime = (void *)(unsigned long)systab64->runtime;
+ tmp |= systab64->runtime;
+ efi_systab.boottime = (void *)(unsigned long)systab64->boottime;
+ tmp |= systab64->boottime;
+ efi_systab.nr_tables = systab64->nr_tables;
+ efi_systab.tables = systab64->tables;
+ tmp |= systab64->tables;
+
+ early_iounmap(systab64, sizeof(*systab64));
+#ifdef CONFIG_X86_32
+ if (tmp >> 32) {
+ printk(KERN_ERR "EFI data located above 4GB, disabling.\n");
+ return -EINVAL;
+ }
+#endif
+ } else {
+ _efi_system_table_32_t *systab32;
+
+ systab32 = early_ioremap((unsigned long)phys,
+ sizeof(*systab32));
+ if (systab32 == NULL) {
+ printk(KERN_ERR "Couldn't map the EFI system table!\n");
+ return -ENOMEM;
+ }
+
+ efi_systab.hdr = systab32->hdr;
+ efi_systab.fw_vendor = systab32->fw_vendor;
+ efi_systab.fw_revision = systab32->fw_revision;
+ efi_systab.con_in_handle = systab32->con_in_handle;
+ efi_systab.con_in = systab32->con_in;
+ efi_systab.con_out_handle = systab32->con_out_handle;
+ efi_systab.con_out = systab32->con_out;
+ efi_systab.stderr_handle = systab32->stderr_handle;
+ efi_systab.stderr = systab32->stderr;
+ efi_systab.runtime = (void *)(unsigned long)systab32->runtime;
+ efi_systab.boottime = (void *)(unsigned long)systab32->boottime;
+ efi_systab.nr_tables = systab32->nr_tables;
+ efi_systab.tables = systab32->tables;
+
+ early_iounmap(systab32, sizeof(*systab32));
}
- memcpy(&efi_systab, efi.systab, sizeof(efi_system_table_t));
- early_iounmap(efi.systab, sizeof(efi_system_table_t));
+
efi.systab = &efi_systab;
/*
* Verify the EFI Table
*/
- if (efi.systab->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE) {
- pr_err("EFI system table signature incorrect!\n");
- return -EINVAL;
- }
+ if (efi.systab->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE)
+ printk(KERN_ERR "EFI system table signature incorrect!\n");
if ((efi.systab->hdr.revision >> 16) == 0)
- pr_err("Warning: EFI system table version "
+ printk(KERN_ERR "Warning: EFI system table version "
"%d.%02d, expected 1.00 or greater!\n",
efi.systab->hdr.revision >> 16,
efi.systab->hdr.revision & 0xffff);
@@ -459,52 +526,75 @@ static int __init efi_systab_init(void *phys)
static int __init efi_config_init(u64 tables, int nr_tables)
{
- efi_config_table_t *config_tables;
- int i, sz = sizeof(efi_config_table_t);
+ void *mapped_table, *tablep;
+ int i, sz;
+
+ if (efi_64bit)
+ sz = sizeof(_efi_config_table_64_t);
+ else
+ sz = sizeof(_efi_config_table_32_t);
/*
* Let's see what config tables the firmware passed to us.
*/
- config_tables = early_ioremap(efi.systab->tables,
- efi.systab->nr_tables * sz);
- if (config_tables == NULL) {
- pr_err("Could not map EFI Configuration Table!\n");
+ mapped_table = early_ioremap(tables, nr_tables * sz);
+ if (mapped_table == NULL) {
+ printk(KERN_ERR "Could not map EFI Configuration Table!\n");
return -ENOMEM;
}
- pr_info("");
+ tablep = mapped_table;
+ printk(KERN_INFO);
for (i = 0; i < efi.systab->nr_tables; i++) {
- efi_guid_t guid = config_tables[i].guid;
- unsigned long table = config_tables[i].table;
-
+ efi_guid_t guid;
+ unsigned long table;
+
+ if (efi_64bit) {
+ u64 table64;
+ guid = ((_efi_config_table_64_t *)tablep)->guid;
+ table64 = ((_efi_config_table_64_t *)tablep)->table;
+ table = table64;
+#ifdef CONFIG_X86_32
+ if (table64 >> 32) {
+ printk(KERN_ERR "EFI table located above "
+ "4GB, disabling.\n");
+ early_iounmap(mapped_table,
+ efi.systab->nr_tables * sz);
+ return -EINVAL;
+ }
+#endif
+ } else {
+ guid = ((_efi_config_table_32_t *)tablep)->guid;
+ table = ((_efi_config_table_32_t *)tablep)->table;
+ }
if (!efi_guidcmp(guid, MPS_TABLE_GUID)) {
efi.mps = table;
- pr_cont(" MPS=0x%lx ", table);
+ printk(" MPS=0x%lx ", table);
} else if (!efi_guidcmp(guid, ACPI_20_TABLE_GUID)) {
efi.acpi20 = table;
- pr_cont(" ACPI 2.0=0x%lx ", table);
+ printk(" ACPI 2.0=0x%lx ", table);
} else if (!efi_guidcmp(guid, ACPI_TABLE_GUID)) {
efi.acpi = table;
- pr_cont(" ACPI=0x%lx ", table);
+ printk(" ACPI=0x%lx ", table);
} else if (!efi_guidcmp(guid, SMBIOS_TABLE_GUID)) {
efi.smbios = table;
- pr_cont(" SMBIOS=0x%lx ", table);
+ printk(" SMBIOS=0x%lx ", table);
#ifdef CONFIG_X86_UV
} else if (!efi_guidcmp(guid, UV_SYSTEM_TABLE_GUID)) {
efi.uv_systab = table;
- pr_cont(" UVsystab=0x%lx ", table);
+ printk(" UVsystab=0x%lx ", table);
#endif
} else if (!efi_guidcmp(guid, HCDP_TABLE_GUID)) {
efi.hcdp = table;
- pr_cont(" HCDP=0x%lx ", table);
+ printk(" HCDP=0x%lx ", table);
} else if (!efi_guidcmp(guid, UGA_IO_PROTOCOL_GUID)) {
efi.uga = table;
- pr_cont(" UGA=0x%lx ", table);
+ printk(" UGA=0x%lx ", table);
}
+ tablep += sz;
}
- pr_cont("\n");
- early_iounmap(config_tables, efi.systab->nr_tables * sz);
-
+ printk("\n");
+ early_iounmap(mapped_table, efi.systab->nr_tables * sz);
return 0;
}
@@ -512,17 +602,11 @@ static int __init efi_runtime_init(void)
{
efi_runtime_services_t *runtime;
- /*
- * Check out the runtime services table. We need to map
- * the runtime services table so that we can grab the physical
- * address of several of the EFI runtime functions, needed to
- * set the firmware into virtual mode.
- */
runtime = early_ioremap((unsigned long)efi.systab->runtime,
sizeof(efi_runtime_services_t));
-
- if (!runtime) {
- pr_err("Could not map the EFI runtime service table!\n");
+ if (runtime == NULL) {
+ printk(KERN_ERR "Could not map the EFI runtime service "
+ "table!\n");
return -ENOMEM;
}
/*
@@ -550,7 +634,7 @@ static int __init efi_memmap_init(void)
memmap.map = early_ioremap((unsigned long)memmap.phys_map,
memmap.nr_map * memmap.desc_size);
if (memmap.map == NULL) {
- pr_err("Could not map the EFI memory map!\n");
+ pr_warn("Could not map the EFI memory map!\n");
return -ENOMEM;
}
memmap.map_end = memmap.map + (memmap.nr_map * memmap.desc_size);
@@ -573,11 +657,19 @@ void __init efi_init(void)
void *tmp;
#ifdef CONFIG_X86_32
+ if (boot_params.efi_info.efi_systab_hi ||
+ boot_params.efi_info.efi_memmap_hi) {
+ printk(KERN_INFO "EFI tables located above 4GB, disabling.\n");
+ efi_enabled = 0;
+ return;
+ }
efi_phys.systab = (efi_system_table_t *)boot_params.efi_info.efi_systab;
+ efi_native = !efi_64bit;
#else
efi_phys.systab = (efi_system_table_t *)
- (boot_params.efi_info.efi_systab |
- ((__u64)boot_params.efi_info.efi_systab_hi<<32));
+ (boot_params.efi_info.efi_systab |
+ ((__u64)boot_params.efi_info.efi_systab_hi<<32));
+ efi_native = efi_64bit;
#endif
if (efi_systab_init(efi_phys.systab)) {
@@ -594,31 +686,44 @@ void __init efi_init(void)
vendor[i] = *c16++;
vendor[i] = '\0';
} else
- pr_err(PFX "Could not map the firmware vendor!\n");
+ printk(KERN_ERR PFX "Could not map the firmware vendor!\n");
early_iounmap(tmp, 2);
- pr_info("EFI v%u.%.02u by %s\n",
- efi.systab->hdr.revision >> 16,
- efi.systab->hdr.revision & 0xffff, vendor);
+ printk(KERN_INFO "EFI v%u.%.02u by %s\n",
+ efi.systab->hdr.revision >> 16,
+ efi.systab->hdr.revision & 0xffff, vendor);
if (efi_config_init(efi.systab->tables, efi.systab->nr_tables)) {
efi_enabled = 0;
return;
}
- if (efi_runtime_init()) {
+ /*
+ * Check out the runtime services table. We need to map
+ * the runtime services table so that we can grab the physical
+ * address of several of the EFI runtime functions, needed to
+ * set the firmware into virtual mode.
+ *
+ * Note: We currently don't support runtime services on an EFI
+ * that doesn't match the kernel 32/64-bit mode.
+ */
+
+ if (efi_native && efi_runtime_init()) {
efi_enabled = 0;
return;
- }
+ } else
+ printk(KERN_INFO "Not initializing EFI runtime due to "
+ "32/64 bit mismatch with kernel\n");
if (efi_memmap_init()) {
efi_enabled = 0;
return;
}
-
#ifdef CONFIG_X86_32
- x86_platform.get_wallclock = efi_get_time;
- x86_platform.set_wallclock = efi_set_rtc_mmss;
+ if (efi_native) {
+ x86_platform.get_wallclock = efi_get_time;
+ x86_platform.set_wallclock = efi_set_rtc_mmss;
+ }
#endif
#if EFI_DEBUG
@@ -676,6 +781,13 @@ void __init efi_enter_virtual_mode(void)
efi.systab = NULL;
+ /* We don't do virtual mode, since we don't do runtime services, on
+ * non-native EFI
+ */
+
+ if (!efi_native)
+ goto out;
+
/* Merge contiguous regions of the same type and attribute */
for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
u64 prev_size;
@@ -724,7 +836,7 @@ void __init efi_enter_virtual_mode(void)
md->virt_addr = (u64) (unsigned long) va;
if (!va) {
- pr_err(PFX "ioremap of 0x%llX failed!\n",
+ printk(KERN_ERR PFX "ioremap of 0x%llX failed!\n",
(unsigned long long)md->phys_addr);
continue;
}
@@ -758,7 +870,7 @@ void __init efi_enter_virtual_mode(void)
(efi_memory_desc_t *)__pa(new_memmap));
if (status != EFI_SUCCESS) {
- pr_alert("Unable to switch EFI into virtual mode "
+ printk(KERN_ALERT "Unable to switch EFI into virtual mode "
"(status=%lx)!\n", status);
panic("EFI call to SetVirtualAddressMap() failed!");
}
@@ -791,6 +903,8 @@ void __init efi_enter_virtual_mode(void)
efi.query_capsule_caps = virt_efi_query_capsule_caps;
if (__supported_pte_mask & _PAGE_NX)
runtime_code_page_mkexec();
+
+out:
early_iounmap(memmap.map, memmap.nr_map * memmap.desc_size);
memmap.map = NULL;
kfree(new_memmap);
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 37c3007..17385ba 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -315,6 +315,16 @@ typedef efi_status_t efi_query_capsule_caps_t(efi_capsule_header_t **capsules,
typedef struct {
efi_guid_t guid;
+ u64 table;
+} _efi_config_table_64_t;
+
+typedef struct {
+ efi_guid_t guid;
+ u32 table;
+} _efi_config_table_32_t;
+
+typedef struct {
+ efi_guid_t guid;
unsigned long table;
} efi_config_table_t;
@@ -329,6 +339,40 @@ typedef struct {
typedef struct {
efi_table_hdr_t hdr;
+ u64 fw_vendor; /* physical addr of CHAR16 vendor string */
+ u32 fw_revision;
+ u32 __pad1;
+ u64 con_in_handle;
+ u64 con_in;
+ u64 con_out_handle;
+ u64 con_out;
+ u64 stderr_handle;
+ u64 stderr;
+ u64 runtime;
+ u64 boottime;
+ u32 nr_tables;
+ u32 __pad2;
+ u64 tables;
+} _efi_system_table_64_t;
+
+typedef struct {
+ efi_table_hdr_t hdr;
+ u32 fw_vendor; /* physical addr of CHAR16 vendor string */
+ u32 fw_revision;
+ u32 con_in_handle;
+ u32 con_in;
+ u32 con_out_handle;
+ u32 con_out;
+ u32 stderr_handle;
+ u32 stderr;
+ u32 runtime;
+ u32 boottime;
+ u32 nr_tables;
+ u32 tables;
+} _efi_system_table_32_t;
+
+typedef struct {
+ efi_table_hdr_t hdr;
unsigned long fw_vendor; /* physical addr of CHAR16 vendor string */
u32 fw_revision;
unsigned long con_in_handle;
@@ -497,6 +541,7 @@ extern int __init efi_setup_pcdp_console(char *);
#ifdef CONFIG_EFI
# ifdef CONFIG_X86
extern int efi_enabled;
+ extern bool efi_64bit;
# else
# define efi_enabled 1
# endif
--
1.7.8.GIT
^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCH 2/5] x86: efi: convert printk to pr_*()
2012-01-03 17:11 ` [PATCH 2/5] x86: efi: convert printk to pr_*() Olof Johansson
@ 2012-01-04 5:26 ` Joe Perches
2012-01-05 17:17 ` Olof Johansson
0 siblings, 1 reply; 27+ messages in thread
From: Joe Perches @ 2012-01-04 5:26 UTC (permalink / raw)
To: Olof Johansson
Cc: H. Peter Anvin, Matthew Garrett, linux-kernel, Ingo Molnar,
Thomas Gleixner, x86, Matt Fleming
On Tue, 2012-01-03 at 09:11 -0800, Olof Johansson wrote:
> Alright, I guess I'll go through and convert them, even though
> there's no net gain to speak of.
Perhaps it'd be better to add
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
before any #include and remove PFX from the
formats.
> diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
[]
> @@ -254,7 +254,7 @@ int efi_set_rtc_mmss(unsigned long nowtime)
>
> status = efi.get_time(&eft, &cap);
> if (status != EFI_SUCCESS) {
> - printk(KERN_ERR "Oops: efitime: can't read time!\n");
> + pr_err("Oops: efitime: can't read time!\n");
pr_err("Oops: can't read time!\n")
> @@ -367,7 +367,7 @@ static void __init print_efi_memmap(void)
> p < memmap.map_end;
> p += memmap.desc_size, i++) {
> md = p;
> - printk(KERN_INFO PFX "mem%02u: type=%u, attr=0x%llx, "
> + pr_info(PFX "mem%02u: type=%u, attr=0x%llx, "
> "range=[0x%016llx-0x%016llx) (%lluMB)\n",
pr_info("mem%02u: type..."
etc...
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 5/5] x86: efi: allow basic init with mixed 32/64-bit efi/kernel
2012-01-03 17:11 ` [PATCH 5/5] x86: efi: allow basic init with mixed 32/64-bit efi/kernel Olof Johansson
@ 2012-01-05 11:21 ` Matt Fleming
2012-01-05 17:53 ` Olof Johansson
2012-01-05 18:21 ` Matthew Garrett
1 sibling, 1 reply; 27+ messages in thread
From: Matt Fleming @ 2012-01-05 11:21 UTC (permalink / raw)
To: Olof Johansson
Cc: H. Peter Anvin, Matthew Garrett, linux-kernel, Ingo Molnar,
Thomas Gleixner, x86
On Tue, 2012-01-03 at 09:11 -0800, Olof Johansson wrote:
> Traditionally the kernel has refused to setup EFI at all if there's been
> a mismatch in 32/64-bit mode between EFI and the kernel.
>
> On some platforms that boot natively through EFI (Chrome OS being one),
> we still need to get at least some of the static data such as memory
> configuration out of EFI. Runtime services aren't as critical, and
> it's a significant amount of work to implement switching between the
> operating modes to call between kernel and firmware for thise cases. So
> I'm ignoring it for now.
>
> v3:
> * Reorganized to a series of patches to make it easier to review, and
> do some of the cleanups I had left out before.
>
> v2:
> * Added graceful error handling for 32-bit kernel that gets passed
> EFI data above 4GB.
> * Removed some warnings that were missed in first version.
>
> Signed-off-by: Olof Johansson <olof@lixom.net>
> ---
> arch/x86/include/asm/efi.h | 2 +-
> arch/x86/kernel/setup.c | 10 ++-
> arch/x86/platform/efi/efi.c | 234 ++++++++++++++++++++++++++++++++-----------
> include/linux/efi.h | 45 ++++++++
> 4 files changed, 228 insertions(+), 63 deletions(-)
This needs resubmitting as you're undoing the changes you've made in
PATCH 2/5, i.e. stuff like this,
> @@ -254,7 +257,7 @@ int efi_set_rtc_mmss(unsigned long nowtime)
>
> status = efi.get_time(&eft, &cap);
> if (status != EFI_SUCCESS) {
> - pr_err("Oops: efitime: can't read time!\n");
> + printk(KERN_ERR "Oops: efitime: can't read time!\n");
> return -1;
> }
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/5] x86: efi: add basic error handling
2012-01-03 17:11 ` [PATCH 4/5] x86: efi: add basic error handling Olof Johansson
@ 2012-01-05 11:21 ` Matt Fleming
2012-01-05 17:52 ` Olof Johansson
0 siblings, 1 reply; 27+ messages in thread
From: Matt Fleming @ 2012-01-05 11:21 UTC (permalink / raw)
To: Olof Johansson
Cc: H. Peter Anvin, Matthew Garrett, linux-kernel, Ingo Molnar,
Thomas Gleixner, x86
On Tue, 2012-01-03 at 09:11 -0800, Olof Johansson wrote:
> It's not perfect, but way better than before. Mark efi_enabled as false in
> case of error and at least stop dereferencing pointers that are known to
> be invalid.
>
> The only significant missing piece is the lack of undoing the
> memblock_reserve of the memory that efi marks as in use. On the other
> hand, it's not a large amount of memory, and leaving it unavailable for
> system use should be the safer choice anyway.
>
> Signed-off-by: Olof Johansson <olof@lixom.net>
> ---
> arch/x86/platform/efi/efi.c | 89 ++++++++++++++++++++++++++++--------------
> 1 files changed, 59 insertions(+), 30 deletions(-)
Seems straight forward and better than what was there previously. Have
you tested this error handling?
Acked-by: Matt Fleming <matt.fleming@intel.com>
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 1/5] x86: efi: refactor efi_init() a bit
2012-01-03 17:11 ` [PATCH 1/5] x86: efi: refactor efi_init() a bit Olof Johansson
@ 2012-01-05 11:22 ` Matt Fleming
2012-01-05 17:49 ` Olof Johansson
2012-01-05 18:17 ` Matthew Garrett
1 sibling, 1 reply; 27+ messages in thread
From: Matt Fleming @ 2012-01-05 11:22 UTC (permalink / raw)
To: Olof Johansson
Cc: H. Peter Anvin, Matthew Garrett, linux-kernel, Ingo Molnar,
Thomas Gleixner, x86
On Tue, 2012-01-03 at 09:11 -0800, Olof Johansson wrote:
> Break out some of the init steps into helper functions.
>
> No code changes at all, identical execution flow.
>
> Signed-off-by: Olof Johansson <olof@lixom.net>
> ---
> arch/x86/platform/efi/efi.c | 89 +++++++++++++++++++++++++++----------------
> 1 files changed, 56 insertions(+), 33 deletions(-)
Makes sense. I've got one tiny comment below, but other than that feel
free to add,
Acked-by: Matt Fleming <matt.fleming@intel.com>
> if (memmap.desc_size != sizeof(efi_memory_desc_t))
> - printk(KERN_WARNING
> - "Kernel-defined memdesc doesn't match the one from EFI!\n");
> + printk(KERN_WARNING "Kernel-defined memdesc doesn't match the "
> + "one from EFI!\n");
This sort of thing is generally discouraged because splitting a printk
string across more than one line makes it harder to grep for. I'm not
sure this hunk is an improvement.
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 3/5] x86: efi: cleanup config table walking
2012-01-03 17:11 ` [PATCH 3/5] x86: efi: cleanup config table walking Olof Johansson
@ 2012-01-05 11:22 ` Matt Fleming
0 siblings, 0 replies; 27+ messages in thread
From: Matt Fleming @ 2012-01-05 11:22 UTC (permalink / raw)
To: Olof Johansson
Cc: H. Peter Anvin, Matthew Garrett, linux-kernel, Ingo Molnar,
Thomas Gleixner, x86
On Tue, 2012-01-03 at 09:11 -0800, Olof Johansson wrote:
> Trivial cleanup, move guid and table pointers to local copies to
> make the code cleaner.
>
> Signed-off-by: Olof Johansson <olof@lixom.net>
> ---
> arch/x86/platform/efi/efi.c | 61 +++++++++++++++++++-----------------------
> 1 files changed, 28 insertions(+), 33 deletions(-)
Acked-by: Matt Fleming <matt.fleming@intel.com>
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 2/5] x86: efi: convert printk to pr_*()
2012-01-04 5:26 ` Joe Perches
@ 2012-01-05 17:17 ` Olof Johansson
0 siblings, 0 replies; 27+ messages in thread
From: Olof Johansson @ 2012-01-05 17:17 UTC (permalink / raw)
To: Joe Perches
Cc: H. Peter Anvin, Matthew Garrett, linux-kernel, Ingo Molnar,
Thomas Gleixner, x86, Matt Fleming
On Tue, Jan 3, 2012 at 9:26 PM, Joe Perches <joe@perches.com> wrote:
> On Tue, 2012-01-03 at 09:11 -0800, Olof Johansson wrote:
>> Alright, I guess I'll go through and convert them, even though
>> there's no net gain to speak of.
>
> Perhaps it'd be better to add
> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> before any #include and remove PFX from the
> formats
I'm not sure it's much of a net gain, PFX was used only a couple of
times, the other printouts were just plain ones.
Anyway, I've switched to pr_fmt anyway, and reworded some of the
messages to not have redundant EFI's in them.
Thanks,
-Olof
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 1/5] x86: efi: refactor efi_init() a bit
2012-01-05 11:22 ` Matt Fleming
@ 2012-01-05 17:49 ` Olof Johansson
0 siblings, 0 replies; 27+ messages in thread
From: Olof Johansson @ 2012-01-05 17:49 UTC (permalink / raw)
To: Matt Fleming
Cc: H. Peter Anvin, Matthew Garrett, linux-kernel, Ingo Molnar,
Thomas Gleixner, x86
On Thu, Jan 5, 2012 at 3:22 AM, Matt Fleming <matt.fleming@intel.com> wrote:
> On Tue, 2012-01-03 at 09:11 -0800, Olof Johansson wrote:
>> Break out some of the init steps into helper functions.
>>
>> No code changes at all, identical execution flow.
>>
>> Signed-off-by: Olof Johansson <olof@lixom.net>
>> ---
>> arch/x86/platform/efi/efi.c | 89 +++++++++++++++++++++++++++----------------
>> 1 files changed, 56 insertions(+), 33 deletions(-)
>
> Makes sense. I've got one tiny comment below, but other than that feel
> free to add,
>
> Acked-by: Matt Fleming <matt.fleming@intel.com>
>
>> if (memmap.desc_size != sizeof(efi_memory_desc_t))
>> - printk(KERN_WARNING
>> - "Kernel-defined memdesc doesn't match the one from EFI!\n");
>> + printk(KERN_WARNING "Kernel-defined memdesc doesn't match the "
>> + "one from EFI!\n");
>
> This sort of thing is generally discouraged because splitting a printk
> string across more than one line makes it harder to grep for. I'm not
> sure this hunk is an improvement.
Agreed, and in this particular case it was just churn.
I've taken a couple of liberties with the 80-character limit instead
in the revised patch set. For the ones that would go way above 80 I
still broke them in two lines though.
Thanks,
-Olof
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/5] x86: efi: add basic error handling
2012-01-05 11:21 ` Matt Fleming
@ 2012-01-05 17:52 ` Olof Johansson
2012-01-05 21:02 ` Olof Johansson
0 siblings, 1 reply; 27+ messages in thread
From: Olof Johansson @ 2012-01-05 17:52 UTC (permalink / raw)
To: Matt Fleming
Cc: H. Peter Anvin, Matthew Garrett, linux-kernel, Ingo Molnar,
Thomas Gleixner, x86
On Thu, Jan 5, 2012 at 3:21 AM, Matt Fleming <matt.fleming@intel.com> wrote:
> On Tue, 2012-01-03 at 09:11 -0800, Olof Johansson wrote:
>> It's not perfect, but way better than before. Mark efi_enabled as false in
>> case of error and at least stop dereferencing pointers that are known to
>> be invalid.
>>
>> The only significant missing piece is the lack of undoing the
>> memblock_reserve of the memory that efi marks as in use. On the other
>> hand, it's not a large amount of memory, and leaving it unavailable for
>> system use should be the safer choice anyway.
>>
>> Signed-off-by: Olof Johansson <olof@lixom.net>
>> ---
>> arch/x86/platform/efi/efi.c | 89 ++++++++++++++++++++++++++++--------------
>> 1 files changed, 59 insertions(+), 30 deletions(-)
>
> Seems straight forward and better than what was there previously. Have
> you tested this error handling?
Not much, since the systems I have won't boot if there's an error
(even if graceful) and I didn't have a console with earlyprintk
support until yesterday. I'll beat on it a bit this afternoon but it
should be OK as it is.
Thanks,
-Olof
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 5/5] x86: efi: allow basic init with mixed 32/64-bit efi/kernel
2012-01-05 11:21 ` Matt Fleming
@ 2012-01-05 17:53 ` Olof Johansson
0 siblings, 0 replies; 27+ messages in thread
From: Olof Johansson @ 2012-01-05 17:53 UTC (permalink / raw)
To: Matt Fleming
Cc: H. Peter Anvin, Matthew Garrett, linux-kernel, Ingo Molnar,
Thomas Gleixner, x86
On Thu, Jan 5, 2012 at 3:21 AM, Matt Fleming <matt.fleming@intel.com> wrote:
> This needs resubmitting as you're undoing the changes you've made in
> PATCH 2/5, i.e. stuff like this,
Yes, I completely messed up here, pretty sad. Fixed up in the series
I'll repost shortly.
-Olof
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 1/5] x86: efi: refactor efi_init() a bit
2012-01-03 17:11 ` [PATCH 1/5] x86: efi: refactor efi_init() a bit Olof Johansson
2012-01-05 11:22 ` Matt Fleming
@ 2012-01-05 18:17 ` Matthew Garrett
2012-01-05 21:00 ` Olof Johansson
1 sibling, 1 reply; 27+ messages in thread
From: Matthew Garrett @ 2012-01-05 18:17 UTC (permalink / raw)
To: Olof Johansson
Cc: H. Peter Anvin, linux-kernel, Ingo Molnar, Thomas Gleixner, x86,
Matt Fleming
On Tue, Jan 03, 2012 at 09:11:18AM -0800, Olof Johansson wrote:
> if (memmap.desc_size != sizeof(efi_memory_desc_t))
> - printk(KERN_WARNING
> - "Kernel-defined memdesc doesn't match the one from EFI!\n");
> + printk(KERN_WARNING "Kernel-defined memdesc doesn't match the "
> + "one from EFI!\n");
Just kill this - it's valid per-spec, there's no reason for us to
complain.
Looks fine otherwise.
--
Matthew Garrett | mjg59@srcf.ucam.org
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 5/5] x86: efi: allow basic init with mixed 32/64-bit efi/kernel
2012-01-03 17:11 ` [PATCH 5/5] x86: efi: allow basic init with mixed 32/64-bit efi/kernel Olof Johansson
2012-01-05 11:21 ` Matt Fleming
@ 2012-01-05 18:21 ` Matthew Garrett
2012-01-05 20:59 ` Olof Johansson
1 sibling, 1 reply; 27+ messages in thread
From: Matthew Garrett @ 2012-01-05 18:21 UTC (permalink / raw)
To: Olof Johansson
Cc: H. Peter Anvin, linux-kernel, Ingo Molnar, Thomas Gleixner, x86,
Matt Fleming
This seems like a reasonable step, but outside some special cases it's
not going to be terribly useful - general purpose EFI machines aren't
going to boot unless you can set the boot variable, which requires
runtime services. ChromeOS machines presumably have their own way of
handling this so I've no objection to adding it if it helps them, but
just wanted to make sure people knew that it's something that we'd still
need to fix up if we want this to work elsewhere.
--
Matthew Garrett | mjg59@srcf.ucam.org
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 5/5] x86: efi: allow basic init with mixed 32/64-bit efi/kernel
2012-01-05 18:21 ` Matthew Garrett
@ 2012-01-05 20:59 ` Olof Johansson
0 siblings, 0 replies; 27+ messages in thread
From: Olof Johansson @ 2012-01-05 20:59 UTC (permalink / raw)
To: Matthew Garrett
Cc: H. Peter Anvin, linux-kernel, Ingo Molnar, Thomas Gleixner, x86,
Matt Fleming
On Thu, Jan 5, 2012 at 10:21 AM, Matthew Garrett <mjg59@srcf.ucam.org> wrote:
> This seems like a reasonable step, but outside some special cases it's
> not going to be terribly useful - general purpose EFI machines aren't
> going to boot unless you can set the boot variable, which requires
> runtime services. ChromeOS machines presumably have their own way of
> handling this so I've no objection to adding it if it helps them, but
> just wanted to make sure people knew that it's something that we'd still
> need to fix up if we want this to work elsewhere.
Thanks, good point. And yes, on ChromeOS there is a wrapper around the
kernel that provides the bootargs and a few other things, so we get by
with this limited EFI support there.
Given that the feature has been missing for years now, and it's a
nontrivial amount of work to get the mode switching implemented right
and debugged, I'm not inclined to go the whole way. This is a good
start, and if someone needs the rest of the functionality they can
build on top of this.
-Olof
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 1/5] x86: efi: refactor efi_init() a bit
2012-01-05 18:17 ` Matthew Garrett
@ 2012-01-05 21:00 ` Olof Johansson
0 siblings, 0 replies; 27+ messages in thread
From: Olof Johansson @ 2012-01-05 21:00 UTC (permalink / raw)
To: Matthew Garrett
Cc: H. Peter Anvin, linux-kernel, Ingo Molnar, Thomas Gleixner, x86,
Matt Fleming
On Thu, Jan 5, 2012 at 10:17 AM, Matthew Garrett <mjg59@srcf.ucam.org> wrote:
> On Tue, Jan 03, 2012 at 09:11:18AM -0800, Olof Johansson wrote:
>
>> if (memmap.desc_size != sizeof(efi_memory_desc_t))
>> - printk(KERN_WARNING
>> - "Kernel-defined memdesc doesn't match the one from EFI!\n");
>> + printk(KERN_WARNING "Kernel-defined memdesc doesn't match the "
>> + "one from EFI!\n");
>
> Just kill this - it's valid per-spec, there's no reason for us to
> complain.
>
> Looks fine otherwise.
Sounds good, I removed it in v4.
-Olof
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH v4 0/5] x86: efi: cleanups and basic 32/64 bit support
2012-01-03 17:11 [PATCH v3 0/5] x86: efi: cleanups and basic 32/64 bit support Olof Johansson
` (4 preceding siblings ...)
2012-01-03 17:11 ` [PATCH 5/5] x86: efi: allow basic init with mixed 32/64-bit efi/kernel Olof Johansson
@ 2012-01-05 21:02 ` Olof Johansson
2012-01-05 21:02 ` [PATCH 1/5] x86: efi: refactor efi_init() a bit Olof Johansson
` (4 more replies)
5 siblings, 5 replies; 27+ messages in thread
From: Olof Johansson @ 2012-01-05 21:02 UTC (permalink / raw)
To: Ingo Molnar, Matthew Garrett
Cc: H. Peter Anvin, Thomas Gleixner, x86, Matt Fleming, linux-kernel
Here's the second version of the refactored series of cleanups with the
32/64-bit enablement at the end (v4 for the patch in total).
I've revised patches based on review comments, change lists for each is
in the patches in question.
As Matthew pointed out: For mixed 32/64 operation on a traditional EFI
system, there are more pieces needed to deal with variables being passed
in, etc. It's not the case on Chrome OS due to a custom kernel boot
wrapper that sets up kernel boot args, etc. Still, this is a good step
on the way even for said traditional setups.
(I've labelled all patches as v4 even though some have only been posted
once and maybe not even changed to keep the series in sync)
-Olof
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/5] x86: efi: add basic error handling
2012-01-05 17:52 ` Olof Johansson
@ 2012-01-05 21:02 ` Olof Johansson
0 siblings, 0 replies; 27+ messages in thread
From: Olof Johansson @ 2012-01-05 21:02 UTC (permalink / raw)
To: Matt Fleming
Cc: H. Peter Anvin, Matthew Garrett, linux-kernel, Ingo Molnar,
Thomas Gleixner, x86
On Thu, Jan 5, 2012 at 9:52 AM, Olof Johansson <olof@lixom.net> wrote:
> Not much, since the systems I have won't boot if there's an error
> (even if graceful) and I didn't have a console with earlyprintk
> support until yesterday. I'll beat on it a bit this afternoon but it
> should be OK as it is.
Ok, tested now to the point that I made sure the errors are shown
appropriately on the early console for the appropriate error paths,
but since the system doesn't come up there isn't much more than that
to test at this time.
-olof
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 1/5] x86: efi: refactor efi_init() a bit
2012-01-05 21:02 ` [PATCH v4 0/5] x86: efi: cleanups and basic 32/64 bit support Olof Johansson
@ 2012-01-05 21:02 ` Olof Johansson
2012-01-05 21:02 ` [PATCH 2/5] x86: efi: convert printk to pr_*() Olof Johansson
` (3 subsequent siblings)
4 siblings, 0 replies; 27+ messages in thread
From: Olof Johansson @ 2012-01-05 21:02 UTC (permalink / raw)
To: Ingo Molnar, Matthew Garrett
Cc: H. Peter Anvin, Thomas Gleixner, x86, Matt Fleming, linux-kernel,
Olof Johansson
Break out some of the init steps into helper functions.
Only change to execution flow is the removal of the warning when the
kernel memdesc structure differ in size from what firmware specifies
since it's a bogus warning (it's a valid difference per spec).
v4:
* Removed memdesc warning as per above
Signed-off-by: Olof Johansson <olof@lixom.net>
Acked-by: Matt Fleming <matt.fleming@intel.com>
---
arch/x86/platform/efi/efi.c | 89 ++++++++++++++++++++++++++-----------------
1 files changed, 54 insertions(+), 35 deletions(-)
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index 4cf9bd0..6d88dca 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -429,23 +429,8 @@ static void __init efi_free_boot_services(void)
}
}
-void __init efi_init(void)
+static void __init efi_systab_init(void *phys)
{
- efi_config_table_t *config_tables;
- efi_runtime_services_t *runtime;
- efi_char16_t *c16;
- char vendor[100] = "unknown";
- int i = 0;
- void *tmp;
-
-#ifdef CONFIG_X86_32
- efi_phys.systab = (efi_system_table_t *)boot_params.efi_info.efi_systab;
-#else
- efi_phys.systab = (efi_system_table_t *)
- (boot_params.efi_info.efi_systab |
- ((__u64)boot_params.efi_info.efi_systab_hi<<32));
-#endif
-
efi.systab = early_ioremap((unsigned long)efi_phys.systab,
sizeof(efi_system_table_t));
if (efi.systab == NULL)
@@ -464,22 +449,12 @@ void __init efi_init(void)
"%d.%02d, expected 1.00 or greater!\n",
efi.systab->hdr.revision >> 16,
efi.systab->hdr.revision & 0xffff);
+}
- /*
- * Show what we know for posterity
- */
- c16 = tmp = early_ioremap(efi.systab->fw_vendor, 2);
- if (c16) {
- for (i = 0; i < sizeof(vendor) - 1 && *c16; ++i)
- vendor[i] = *c16++;
- vendor[i] = '\0';
- } else
- printk(KERN_ERR PFX "Could not map the firmware vendor!\n");
- early_iounmap(tmp, 2);
-
- printk(KERN_INFO "EFI v%u.%.02u by %s\n",
- efi.systab->hdr.revision >> 16,
- efi.systab->hdr.revision & 0xffff, vendor);
+static void __init efi_config_init(u64 tables, int nr_tables)
+{
+ efi_config_table_t *config_tables;
+ int i;
/*
* Let's see what config tables the firmware passed to us.
@@ -526,6 +501,11 @@ void __init efi_init(void)
printk("\n");
early_iounmap(config_tables,
efi.systab->nr_tables * sizeof(efi_config_table_t));
+}
+
+static void __init efi_runtime_init(void)
+{
+ efi_runtime_services_t *runtime;
/*
* Check out the runtime services table. We need to map
@@ -554,7 +534,10 @@ void __init efi_init(void)
printk(KERN_ERR "Could not map the EFI runtime service "
"table!\n");
early_iounmap(runtime, sizeof(efi_runtime_services_t));
+}
+static void __init efi_memmap_init(void)
+{
/* Map the EFI memory map */
memmap.map = early_ioremap((unsigned long)memmap.phys_map,
memmap.nr_map * memmap.desc_size);
@@ -562,12 +545,48 @@ void __init efi_init(void)
printk(KERN_ERR "Could not map the EFI memory map!\n");
memmap.map_end = memmap.map + (memmap.nr_map * memmap.desc_size);
- if (memmap.desc_size != sizeof(efi_memory_desc_t))
- printk(KERN_WARNING
- "Kernel-defined memdesc doesn't match the one from EFI!\n");
-
if (add_efi_memmap)
do_add_efi_memmap();
+}
+
+void __init efi_init(void)
+{
+ efi_char16_t *c16;
+ char vendor[100] = "unknown";
+ int i = 0;
+ void *tmp;
+
+#ifdef CONFIG_X86_32
+ efi_phys.systab = (efi_system_table_t *)boot_params.efi_info.efi_systab;
+#else
+ efi_phys.systab = (efi_system_table_t *)
+ (boot_params.efi_info.efi_systab |
+ ((__u64)boot_params.efi_info.efi_systab_hi<<32));
+#endif
+
+ efi_systab_init(efi_phys.systab);
+
+ /*
+ * Show what we know for posterity
+ */
+ c16 = tmp = early_ioremap(efi.systab->fw_vendor, 2);
+ if (c16) {
+ for (i = 0; i < sizeof(vendor) - 1 && *c16; ++i)
+ vendor[i] = *c16++;
+ vendor[i] = '\0';
+ } else
+ printk(KERN_ERR PFX "Could not map the firmware vendor!\n");
+ early_iounmap(tmp, 2);
+
+ printk(KERN_INFO "EFI v%u.%.02u by %s\n",
+ efi.systab->hdr.revision >> 16,
+ efi.systab->hdr.revision & 0xffff, vendor);
+
+ efi_config_init(efi.systab->tables, efi.systab->nr_tables);
+
+ efi_runtime_init();
+
+ efi_memmap_init();
#ifdef CONFIG_X86_32
x86_platform.get_wallclock = efi_get_time;
--
1.7.8.GIT
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 2/5] x86: efi: convert printk to pr_*()
2012-01-05 21:02 ` [PATCH v4 0/5] x86: efi: cleanups and basic 32/64 bit support Olof Johansson
2012-01-05 21:02 ` [PATCH 1/5] x86: efi: refactor efi_init() a bit Olof Johansson
@ 2012-01-05 21:02 ` Olof Johansson
2012-01-05 21:02 ` [PATCH 3/5] x86: efi: cleanup config table walking Olof Johansson
` (2 subsequent siblings)
4 siblings, 0 replies; 27+ messages in thread
From: Olof Johansson @ 2012-01-05 21:02 UTC (permalink / raw)
To: Ingo Molnar, Matthew Garrett
Cc: H. Peter Anvin, Thomas Gleixner, x86, Matt Fleming, linux-kernel,
Olof Johansson, Joe Perches
Alright, I guess I'll go through and convert them, even though
there's no net gain to speak of.
v4:
* Switched to pr_fmt and removed some redundant use of "EFI" in
messages.
Signed-off-by: Olof Johansson <olof@lixom.net>
Cc: Joe Perches <joe@perches.com>
---
arch/x86/platform/efi/efi.c | 58 +++++++++++++++++++++---------------------
1 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index 6d88dca..511fb15 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -26,6 +26,8 @@
* Skip non-WB memory and ignore empty memory ranges.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/efi.h>
@@ -47,7 +49,6 @@
#include <asm/x86_init.h>
#define EFI_DEBUG 1
-#define PFX "EFI: "
int efi_enabled;
EXPORT_SYMBOL(efi_enabled);
@@ -254,7 +255,7 @@ int efi_set_rtc_mmss(unsigned long nowtime)
status = efi.get_time(&eft, &cap);
if (status != EFI_SUCCESS) {
- printk(KERN_ERR "Oops: efitime: can't read time!\n");
+ pr_err("Oops: efitime: can't read time!\n");
return -1;
}
@@ -268,7 +269,7 @@ int efi_set_rtc_mmss(unsigned long nowtime)
status = efi.set_time(&eft);
if (status != EFI_SUCCESS) {
- printk(KERN_ERR "Oops: efitime: can't write time!\n");
+ pr_err("Oops: efitime: can't write time!\n");
return -1;
}
return 0;
@@ -282,7 +283,7 @@ unsigned long efi_get_time(void)
status = efi.get_time(&eft, &cap);
if (status != EFI_SUCCESS)
- printk(KERN_ERR "Oops: efitime: can't read time!\n");
+ pr_err("Oops: efitime: can't read time!\n");
return mktime(eft.year, eft.month, eft.day, eft.hour,
eft.minute, eft.second);
@@ -367,7 +368,7 @@ static void __init print_efi_memmap(void)
p < memmap.map_end;
p += memmap.desc_size, i++) {
md = p;
- printk(KERN_INFO PFX "mem%02u: type=%u, attr=0x%llx, "
+ pr_info("mem%02u: type=%u, attr=0x%llx, "
"range=[0x%016llx-0x%016llx) (%lluMB)\n",
i, md->type, md->attribute, md->phys_addr,
md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT),
@@ -400,7 +401,7 @@ void __init efi_reserve_boot_services(void)
memblock_is_region_reserved(start, size)) {
/* Could not reserve, skip it */
md->num_pages = 0;
- memblock_dbg(PFX "Could not reserve boot range "
+ memblock_dbg("Could not reserve boot range "
"[0x%010llx-0x%010llx]\n",
start, start+size-1);
} else
@@ -434,7 +435,7 @@ static void __init efi_systab_init(void *phys)
efi.systab = early_ioremap((unsigned long)efi_phys.systab,
sizeof(efi_system_table_t));
if (efi.systab == NULL)
- printk(KERN_ERR "Couldn't map the EFI system table!\n");
+ pr_err("Couldn't map the system table!\n");
memcpy(&efi_systab, efi.systab, sizeof(efi_system_table_t));
early_iounmap(efi.systab, sizeof(efi_system_table_t));
efi.systab = &efi_systab;
@@ -443,9 +444,9 @@ static void __init efi_systab_init(void *phys)
* Verify the EFI Table
*/
if (efi.systab->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE)
- printk(KERN_ERR "EFI system table signature incorrect!\n");
+ pr_err("System table signature incorrect!\n");
if ((efi.systab->hdr.revision >> 16) == 0)
- printk(KERN_ERR "Warning: EFI system table version "
+ pr_err("Warning: System table version "
"%d.%02d, expected 1.00 or greater!\n",
efi.systab->hdr.revision >> 16,
efi.systab->hdr.revision & 0xffff);
@@ -463,42 +464,42 @@ static void __init efi_config_init(u64 tables, int nr_tables)
efi.systab->tables,
efi.systab->nr_tables * sizeof(efi_config_table_t));
if (config_tables == NULL)
- printk(KERN_ERR "Could not map EFI Configuration Table!\n");
+ pr_err("Could not map Configuration table!\n");
- printk(KERN_INFO);
+ pr_info("");
for (i = 0; i < efi.systab->nr_tables; i++) {
if (!efi_guidcmp(config_tables[i].guid, MPS_TABLE_GUID)) {
efi.mps = config_tables[i].table;
- printk(" MPS=0x%lx ", config_tables[i].table);
+ pr_cont(" MPS=0x%lx ", config_tables[i].table);
} else if (!efi_guidcmp(config_tables[i].guid,
ACPI_20_TABLE_GUID)) {
efi.acpi20 = config_tables[i].table;
- printk(" ACPI 2.0=0x%lx ", config_tables[i].table);
+ pr_cont(" ACPI 2.0=0x%lx ", config_tables[i].table);
} else if (!efi_guidcmp(config_tables[i].guid,
ACPI_TABLE_GUID)) {
efi.acpi = config_tables[i].table;
- printk(" ACPI=0x%lx ", config_tables[i].table);
+ pr_cont(" ACPI=0x%lx ", config_tables[i].table);
} else if (!efi_guidcmp(config_tables[i].guid,
SMBIOS_TABLE_GUID)) {
efi.smbios = config_tables[i].table;
- printk(" SMBIOS=0x%lx ", config_tables[i].table);
+ pr_cont(" SMBIOS=0x%lx ", config_tables[i].table);
#ifdef CONFIG_X86_UV
} else if (!efi_guidcmp(config_tables[i].guid,
UV_SYSTEM_TABLE_GUID)) {
efi.uv_systab = config_tables[i].table;
- printk(" UVsystab=0x%lx ", config_tables[i].table);
+ pr_cont(" UVsystab=0x%lx ", config_tables[i].table);
#endif
} else if (!efi_guidcmp(config_tables[i].guid,
HCDP_TABLE_GUID)) {
efi.hcdp = config_tables[i].table;
- printk(" HCDP=0x%lx ", config_tables[i].table);
+ pr_cont(" HCDP=0x%lx ", config_tables[i].table);
} else if (!efi_guidcmp(config_tables[i].guid,
UGA_IO_PROTOCOL_GUID)) {
efi.uga = config_tables[i].table;
- printk(" UGA=0x%lx ", config_tables[i].table);
+ pr_cont(" UGA=0x%lx ", config_tables[i].table);
}
}
- printk("\n");
+ pr_cont("\n");
early_iounmap(config_tables,
efi.systab->nr_tables * sizeof(efi_config_table_t));
}
@@ -531,8 +532,7 @@ static void __init efi_runtime_init(void)
*/
efi.get_time = phys_efi_get_time;
} else
- printk(KERN_ERR "Could not map the EFI runtime service "
- "table!\n");
+ pr_err("Could not map the runtime service table!\n");
early_iounmap(runtime, sizeof(efi_runtime_services_t));
}
@@ -542,7 +542,7 @@ static void __init efi_memmap_init(void)
memmap.map = early_ioremap((unsigned long)memmap.phys_map,
memmap.nr_map * memmap.desc_size);
if (memmap.map == NULL)
- printk(KERN_ERR "Could not map the EFI memory map!\n");
+ pr_err("Could not map the memory map!\n");
memmap.map_end = memmap.map + (memmap.nr_map * memmap.desc_size);
if (add_efi_memmap)
@@ -575,12 +575,12 @@ void __init efi_init(void)
vendor[i] = *c16++;
vendor[i] = '\0';
} else
- printk(KERN_ERR PFX "Could not map the firmware vendor!\n");
+ pr_err("Could not map the firmware vendor!\n");
early_iounmap(tmp, 2);
- printk(KERN_INFO "EFI v%u.%.02u by %s\n",
- efi.systab->hdr.revision >> 16,
- efi.systab->hdr.revision & 0xffff, vendor);
+ pr_info("EFI v%u.%.02u by %s\n",
+ efi.systab->hdr.revision >> 16,
+ efi.systab->hdr.revision & 0xffff, vendor);
efi_config_init(efi.systab->tables, efi.systab->nr_tables);
@@ -696,7 +696,7 @@ void __init efi_enter_virtual_mode(void)
md->virt_addr = (u64) (unsigned long) va;
if (!va) {
- printk(KERN_ERR PFX "ioremap of 0x%llX failed!\n",
+ pr_err("ioremap of 0x%llX failed!\n",
(unsigned long long)md->phys_addr);
continue;
}
@@ -730,8 +730,8 @@ void __init efi_enter_virtual_mode(void)
(efi_memory_desc_t *)__pa(new_memmap));
if (status != EFI_SUCCESS) {
- printk(KERN_ALERT "Unable to switch EFI into virtual mode "
- "(status=%lx)!\n", status);
+ pr_alert("Unable to switch EFI into virtual mode "
+ "(status=%lx)!\n", status);
panic("EFI call to SetVirtualAddressMap() failed!");
}
--
1.7.8.GIT
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 3/5] x86: efi: cleanup config table walking
2012-01-05 21:02 ` [PATCH v4 0/5] x86: efi: cleanups and basic 32/64 bit support Olof Johansson
2012-01-05 21:02 ` [PATCH 1/5] x86: efi: refactor efi_init() a bit Olof Johansson
2012-01-05 21:02 ` [PATCH 2/5] x86: efi: convert printk to pr_*() Olof Johansson
@ 2012-01-05 21:02 ` Olof Johansson
2012-01-05 21:02 ` [PATCH 4/5] x86: efi: add basic error handling Olof Johansson
2012-01-05 21:02 ` [PATCH 5/5] x86: efi: allow basic init with mixed 32/64-bit efi/kernel Olof Johansson
4 siblings, 0 replies; 27+ messages in thread
From: Olof Johansson @ 2012-01-05 21:02 UTC (permalink / raw)
To: Ingo Molnar, Matthew Garrett
Cc: H. Peter Anvin, Thomas Gleixner, x86, Matt Fleming, linux-kernel,
Olof Johansson
Trivial cleanup, move guid and table pointers to local copies to
make the code cleaner.
Signed-off-by: Olof Johansson <olof@lixom.net>
Acked-by: Matt Fleming <matt.fleming@intel.com>
---
arch/x86/platform/efi/efi.c | 61 +++++++++++++++++++-----------------------
1 files changed, 28 insertions(+), 33 deletions(-)
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index 511fb15..03259d1 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -455,53 +455,48 @@ static void __init efi_systab_init(void *phys)
static void __init efi_config_init(u64 tables, int nr_tables)
{
efi_config_table_t *config_tables;
- int i;
+ int i, sz = sizeof(efi_config_table_t);
/*
* Let's see what config tables the firmware passed to us.
*/
- config_tables = early_ioremap(
- efi.systab->tables,
- efi.systab->nr_tables * sizeof(efi_config_table_t));
+ config_tables = early_ioremap(efi.systab->tables,
+ efi.systab->nr_tables * sz);
if (config_tables == NULL)
pr_err("Could not map Configuration table!\n");
pr_info("");
for (i = 0; i < efi.systab->nr_tables; i++) {
- if (!efi_guidcmp(config_tables[i].guid, MPS_TABLE_GUID)) {
- efi.mps = config_tables[i].table;
- pr_cont(" MPS=0x%lx ", config_tables[i].table);
- } else if (!efi_guidcmp(config_tables[i].guid,
- ACPI_20_TABLE_GUID)) {
- efi.acpi20 = config_tables[i].table;
- pr_cont(" ACPI 2.0=0x%lx ", config_tables[i].table);
- } else if (!efi_guidcmp(config_tables[i].guid,
- ACPI_TABLE_GUID)) {
- efi.acpi = config_tables[i].table;
- pr_cont(" ACPI=0x%lx ", config_tables[i].table);
- } else if (!efi_guidcmp(config_tables[i].guid,
- SMBIOS_TABLE_GUID)) {
- efi.smbios = config_tables[i].table;
- pr_cont(" SMBIOS=0x%lx ", config_tables[i].table);
+ efi_guid_t guid = config_tables[i].guid;
+ unsigned long table = config_tables[i].table;
+
+ if (!efi_guidcmp(guid, MPS_TABLE_GUID)) {
+ efi.mps = table;
+ pr_cont(" MPS=0x%lx ", table);
+ } else if (!efi_guidcmp(guid, ACPI_20_TABLE_GUID)) {
+ efi.acpi20 = table;
+ pr_cont(" ACPI 2.0=0x%lx ", table);
+ } else if (!efi_guidcmp(guid, ACPI_TABLE_GUID)) {
+ efi.acpi = table;
+ pr_cont(" ACPI=0x%lx ", table);
+ } else if (!efi_guidcmp(guid, SMBIOS_TABLE_GUID)) {
+ efi.smbios = table;
+ pr_cont(" SMBIOS=0x%lx ", table);
#ifdef CONFIG_X86_UV
- } else if (!efi_guidcmp(config_tables[i].guid,
- UV_SYSTEM_TABLE_GUID)) {
- efi.uv_systab = config_tables[i].table;
- pr_cont(" UVsystab=0x%lx ", config_tables[i].table);
+ } else if (!efi_guidcmp(guid, UV_SYSTEM_TABLE_GUID)) {
+ efi.uv_systab = table;
+ pr_cont(" UVsystab=0x%lx ", table);
#endif
- } else if (!efi_guidcmp(config_tables[i].guid,
- HCDP_TABLE_GUID)) {
- efi.hcdp = config_tables[i].table;
- pr_cont(" HCDP=0x%lx ", config_tables[i].table);
- } else if (!efi_guidcmp(config_tables[i].guid,
- UGA_IO_PROTOCOL_GUID)) {
- efi.uga = config_tables[i].table;
- pr_cont(" UGA=0x%lx ", config_tables[i].table);
+ } else if (!efi_guidcmp(guid, HCDP_TABLE_GUID)) {
+ efi.hcdp = table;
+ pr_cont(" HCDP=0x%lx ", table);
+ } else if (!efi_guidcmp(guid, UGA_IO_PROTOCOL_GUID)) {
+ efi.uga = table;
+ pr_cont(" UGA=0x%lx ", table);
}
}
pr_cont("\n");
- early_iounmap(config_tables,
- efi.systab->nr_tables * sizeof(efi_config_table_t));
+ early_iounmap(config_tables, efi.systab->nr_tables * sz);
}
static void __init efi_runtime_init(void)
--
1.7.8.GIT
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 4/5] x86: efi: add basic error handling
2012-01-05 21:02 ` [PATCH v4 0/5] x86: efi: cleanups and basic 32/64 bit support Olof Johansson
` (2 preceding siblings ...)
2012-01-05 21:02 ` [PATCH 3/5] x86: efi: cleanup config table walking Olof Johansson
@ 2012-01-05 21:02 ` Olof Johansson
2012-01-05 21:02 ` [PATCH 5/5] x86: efi: allow basic init with mixed 32/64-bit efi/kernel Olof Johansson
4 siblings, 0 replies; 27+ messages in thread
From: Olof Johansson @ 2012-01-05 21:02 UTC (permalink / raw)
To: Ingo Molnar, Matthew Garrett
Cc: H. Peter Anvin, Thomas Gleixner, x86, Matt Fleming, linux-kernel,
Olof Johansson
It's not perfect, but way better than before. Mark efi_enabled as false in
case of error and at least stop dereferencing pointers that are known to
be invalid.
The only significant missing piece is the lack of undoing the
memblock_reserve of the memory that efi marks as in use. On the other
hand, it's not a large amount of memory, and leaving it unavailable for
system use should be the safer choice anyway.
Signed-off-by: Olof Johansson <olof@lixom.net>
Acked-by: Matt Fleming <matt.fleming@intel.com>
---
arch/x86/platform/efi/efi.c | 85 +++++++++++++++++++++++++++++--------------
1 files changed, 57 insertions(+), 28 deletions(-)
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index 03259d1..5a053e7 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -430,12 +430,14 @@ static void __init efi_free_boot_services(void)
}
}
-static void __init efi_systab_init(void *phys)
+static int __init efi_systab_init(void *phys)
{
efi.systab = early_ioremap((unsigned long)efi_phys.systab,
sizeof(efi_system_table_t));
- if (efi.systab == NULL)
+ if (efi.systab == NULL) {
pr_err("Couldn't map the system table!\n");
+ return -ENOMEM;
+ }
memcpy(&efi_systab, efi.systab, sizeof(efi_system_table_t));
early_iounmap(efi.systab, sizeof(efi_system_table_t));
efi.systab = &efi_systab;
@@ -443,16 +445,20 @@ static void __init efi_systab_init(void *phys)
/*
* Verify the EFI Table
*/
- if (efi.systab->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE)
+ if (efi.systab->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE) {
pr_err("System table signature incorrect!\n");
+ return -EINVAL;
+ }
if ((efi.systab->hdr.revision >> 16) == 0)
pr_err("Warning: System table version "
"%d.%02d, expected 1.00 or greater!\n",
efi.systab->hdr.revision >> 16,
efi.systab->hdr.revision & 0xffff);
+
+ return 0;
}
-static void __init efi_config_init(u64 tables, int nr_tables)
+static int __init efi_config_init(u64 tables, int nr_tables)
{
efi_config_table_t *config_tables;
int i, sz = sizeof(efi_config_table_t);
@@ -462,8 +468,10 @@ static void __init efi_config_init(u64 tables, int nr_tables)
*/
config_tables = early_ioremap(efi.systab->tables,
efi.systab->nr_tables * sz);
- if (config_tables == NULL)
+ if (config_tables == NULL) {
pr_err("Could not map Configuration table!\n");
+ return -ENOMEM;
+ }
pr_info("");
for (i = 0; i < efi.systab->nr_tables; i++) {
@@ -497,9 +505,11 @@ static void __init efi_config_init(u64 tables, int nr_tables)
}
pr_cont("\n");
early_iounmap(config_tables, efi.systab->nr_tables * sz);
+
+ return 0;
}
-static void __init efi_runtime_init(void)
+static int __init efi_runtime_init(void)
{
efi_runtime_services_t *runtime;
@@ -511,37 +521,44 @@ static void __init efi_runtime_init(void)
*/
runtime = early_ioremap((unsigned long)efi.systab->runtime,
sizeof(efi_runtime_services_t));
- if (runtime != NULL) {
- /*
- * We will only need *early* access to the following
- * two EFI runtime services before set_virtual_address_map
- * is invoked.
- */
- efi_phys.get_time = (efi_get_time_t *)runtime->get_time;
- efi_phys.set_virtual_address_map =
- (efi_set_virtual_address_map_t *)
- runtime->set_virtual_address_map;
- /*
- * Make efi_get_time can be called before entering
- * virtual mode.
- */
- efi.get_time = phys_efi_get_time;
- } else
+ if (!runtime) {
pr_err("Could not map the runtime service table!\n");
+ return -ENOMEM;
+ }
+ /*
+ * We will only need *early* access to the following
+ * two EFI runtime services before set_virtual_address_map
+ * is invoked.
+ */
+ efi_phys.get_time = (efi_get_time_t *)runtime->get_time;
+ efi_phys.set_virtual_address_map =
+ (efi_set_virtual_address_map_t *)
+ runtime->set_virtual_address_map;
+ /*
+ * Make efi_get_time can be called before entering
+ * virtual mode.
+ */
+ efi.get_time = phys_efi_get_time;
early_iounmap(runtime, sizeof(efi_runtime_services_t));
+
+ return 0;
}
-static void __init efi_memmap_init(void)
+static int __init efi_memmap_init(void)
{
/* Map the EFI memory map */
memmap.map = early_ioremap((unsigned long)memmap.phys_map,
memmap.nr_map * memmap.desc_size);
- if (memmap.map == NULL)
+ if (memmap.map == NULL) {
pr_err("Could not map the memory map!\n");
+ return -ENOMEM;
+ }
memmap.map_end = memmap.map + (memmap.nr_map * memmap.desc_size);
if (add_efi_memmap)
do_add_efi_memmap();
+
+ return 0;
}
void __init efi_init(void)
@@ -559,7 +576,10 @@ void __init efi_init(void)
((__u64)boot_params.efi_info.efi_systab_hi<<32));
#endif
- efi_systab_init(efi_phys.systab);
+ if (efi_systab_init(efi_phys.systab)) {
+ efi_enabled = 0;
+ return;
+ }
/*
* Show what we know for posterity
@@ -577,11 +597,20 @@ void __init efi_init(void)
efi.systab->hdr.revision >> 16,
efi.systab->hdr.revision & 0xffff, vendor);
- efi_config_init(efi.systab->tables, efi.systab->nr_tables);
+ if (efi_config_init(efi.systab->tables, efi.systab->nr_tables)) {
+ efi_enabled = 0;
+ return;
+ }
- efi_runtime_init();
+ if (efi_runtime_init()) {
+ efi_enabled = 0;
+ return;
+ }
- efi_memmap_init();
+ if (efi_memmap_init()) {
+ efi_enabled = 0;
+ return;
+ }
#ifdef CONFIG_X86_32
x86_platform.get_wallclock = efi_get_time;
--
1.7.8.GIT
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 5/5] x86: efi: allow basic init with mixed 32/64-bit efi/kernel
2012-01-05 21:02 ` [PATCH v4 0/5] x86: efi: cleanups and basic 32/64 bit support Olof Johansson
` (3 preceding siblings ...)
2012-01-05 21:02 ` [PATCH 4/5] x86: efi: add basic error handling Olof Johansson
@ 2012-01-05 21:02 ` Olof Johansson
4 siblings, 0 replies; 27+ messages in thread
From: Olof Johansson @ 2012-01-05 21:02 UTC (permalink / raw)
To: Ingo Molnar, Matthew Garrett
Cc: H. Peter Anvin, Thomas Gleixner, x86, Matt Fleming, linux-kernel,
Olof Johansson
Traditionally the kernel has refused to setup EFI at all if there's been
a mismatch in 32/64-bit mode between EFI and the kernel.
On some platforms that boot natively through EFI (Chrome OS being one),
we still need to get at least some of the static data such as memory
configuration out of EFI. Runtime services aren't as critical, and
it's a significant amount of work to implement switching between the
operating modes to call between kernel and firmware for thise cases. So
I'm ignoring it for now.
v4:
* Some of the earlier cleanup was accidentally reverted by this patch, fixed.
* Reworded some messages to not have to line wrap printk strings
v3:
* Reorganized to a series of patches to make it easier to review, and
do some of the cleanups I had left out before.
v2:
* Added graceful error handling for 32-bit kernel that gets passed
EFI data above 4GB.
* Removed some warnings that were missed in first version.
Signed-off-by: Olof Johansson <olof@lixom.net>
---
arch/x86/include/asm/efi.h | 2 +-
arch/x86/kernel/setup.c | 10 ++-
arch/x86/platform/efi/efi.c | 164 +++++++++++++++++++++++++++++++++++++------
include/linux/efi.h | 45 ++++++++++++
4 files changed, 195 insertions(+), 26 deletions(-)
diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h
index 844f735..c9dcc18 100644
--- a/arch/x86/include/asm/efi.h
+++ b/arch/x86/include/asm/efi.h
@@ -95,7 +95,7 @@ extern void __iomem *efi_ioremap(unsigned long addr, unsigned long size,
extern int add_efi_memmap;
extern void efi_set_executable(efi_memory_desc_t *md, bool executable);
-extern void efi_memblock_x86_reserve_range(void);
+extern int efi_memblock_x86_reserve_range(void);
extern void efi_call_phys_prelog(void);
extern void efi_call_phys_epilog(void);
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index d7d5099..8863888 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -749,10 +749,16 @@ void __init setup_arch(char **cmdline_p)
#endif
#ifdef CONFIG_EFI
if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature,
- EFI_LOADER_SIGNATURE, 4)) {
+ "EL32", 4)) {
efi_enabled = 1;
- efi_memblock_x86_reserve_range();
+ efi_64bit = false;
+ } else if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature,
+ "EL64", 4)) {
+ efi_enabled = 1;
+ efi_64bit = true;
}
+ if (efi_enabled && efi_memblock_x86_reserve_range())
+ efi_enabled = 0;
#endif
x86_init.oem.arch_setup();
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index 5a053e7..e41a320 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -68,6 +68,9 @@ EXPORT_SYMBOL(efi);
struct efi_memory_map memmap;
+bool efi_64bit;
+static bool efi_native;
+
static struct efi efi_phys __initdata;
static efi_system_table_t efi_systab __initdata;
@@ -339,11 +342,16 @@ static void __init do_add_efi_memmap(void)
sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map);
}
-void __init efi_memblock_x86_reserve_range(void)
+int __init efi_memblock_x86_reserve_range(void)
{
unsigned long pmap;
#ifdef CONFIG_X86_32
+ /* Can't handle data above 4GB at this time */
+ if (boot_params.efi_info.efi_memmap_hi) {
+ pr_err("Memory map is above 4GB, disabling EFI.\n");
+ return -EINVAL;
+ }
pmap = boot_params.efi_info.efi_memmap;
#else
pmap = (boot_params.efi_info.efi_memmap |
@@ -355,6 +363,8 @@ void __init efi_memblock_x86_reserve_range(void)
memmap.desc_version = boot_params.efi_info.efi_memdesc_version;
memmap.desc_size = boot_params.efi_info.efi_memdesc_size;
memblock_reserve(pmap, memmap.nr_map * memmap.desc_size);
+
+ return 0;
}
#if EFI_DEBUG
@@ -432,14 +442,75 @@ static void __init efi_free_boot_services(void)
static int __init efi_systab_init(void *phys)
{
- efi.systab = early_ioremap((unsigned long)efi_phys.systab,
- sizeof(efi_system_table_t));
- if (efi.systab == NULL) {
- pr_err("Couldn't map the system table!\n");
- return -ENOMEM;
+ if (efi_64bit) {
+ _efi_system_table_64_t *systab64;
+ u64 tmp = 0;
+
+ systab64 = early_ioremap((unsigned long)phys,
+ sizeof(*systab64));
+ if (systab64 == NULL) {
+ pr_err("Couldn't map the system table!\n");
+ return -ENOMEM;
+ }
+
+ efi_systab.hdr = systab64->hdr;
+ efi_systab.fw_vendor = systab64->fw_vendor;
+ tmp |= systab64->fw_vendor;
+ efi_systab.fw_revision = systab64->fw_revision;
+ efi_systab.con_in_handle = systab64->con_in_handle;
+ tmp |= systab64->con_in_handle;
+ efi_systab.con_in = systab64->con_in;
+ tmp |= systab64->con_in;
+ efi_systab.con_out_handle = systab64->con_out_handle;
+ tmp |= systab64->con_out_handle;
+ efi_systab.con_out = systab64->con_out;
+ tmp |= systab64->con_out;
+ efi_systab.stderr_handle = systab64->stderr_handle;
+ tmp |= systab64->stderr_handle;
+ efi_systab.stderr = systab64->stderr;
+ tmp |= systab64->stderr;
+ efi_systab.runtime = (void *)(unsigned long)systab64->runtime;
+ tmp |= systab64->runtime;
+ efi_systab.boottime = (void *)(unsigned long)systab64->boottime;
+ tmp |= systab64->boottime;
+ efi_systab.nr_tables = systab64->nr_tables;
+ efi_systab.tables = systab64->tables;
+ tmp |= systab64->tables;
+
+ early_iounmap(systab64, sizeof(*systab64));
+#ifdef CONFIG_X86_32
+ if (tmp >> 32) {
+ pr_err("EFI data located above 4GB, disabling.\n");
+ return -EINVAL;
+ }
+#endif
+ } else {
+ _efi_system_table_32_t *systab32;
+
+ systab32 = early_ioremap((unsigned long)phys,
+ sizeof(*systab32));
+ if (systab32 == NULL) {
+ pr_err("Couldn't map the system table!\n");
+ return -ENOMEM;
+ }
+
+ efi_systab.hdr = systab32->hdr;
+ efi_systab.fw_vendor = systab32->fw_vendor;
+ efi_systab.fw_revision = systab32->fw_revision;
+ efi_systab.con_in_handle = systab32->con_in_handle;
+ efi_systab.con_in = systab32->con_in;
+ efi_systab.con_out_handle = systab32->con_out_handle;
+ efi_systab.con_out = systab32->con_out;
+ efi_systab.stderr_handle = systab32->stderr_handle;
+ efi_systab.stderr = systab32->stderr;
+ efi_systab.runtime = (void *)(unsigned long)systab32->runtime;
+ efi_systab.boottime = (void *)(unsigned long)systab32->boottime;
+ efi_systab.nr_tables = systab32->nr_tables;
+ efi_systab.tables = systab32->tables;
+
+ early_iounmap(systab32, sizeof(*systab32));
}
- memcpy(&efi_systab, efi.systab, sizeof(efi_system_table_t));
- early_iounmap(efi.systab, sizeof(efi_system_table_t));
+
efi.systab = &efi_systab;
/*
@@ -460,24 +531,47 @@ static int __init efi_systab_init(void *phys)
static int __init efi_config_init(u64 tables, int nr_tables)
{
- efi_config_table_t *config_tables;
- int i, sz = sizeof(efi_config_table_t);
+ void *config_tables, *tablep;
+ int i, sz;
+
+ if (efi_64bit)
+ sz = sizeof(_efi_config_table_64_t);
+ else
+ sz = sizeof(_efi_config_table_32_t);
/*
* Let's see what config tables the firmware passed to us.
*/
- config_tables = early_ioremap(efi.systab->tables,
- efi.systab->nr_tables * sz);
+ config_tables = early_ioremap(tables, nr_tables * sz);
if (config_tables == NULL) {
pr_err("Could not map Configuration table!\n");
return -ENOMEM;
}
+ tablep = config_tables;
pr_info("");
for (i = 0; i < efi.systab->nr_tables; i++) {
- efi_guid_t guid = config_tables[i].guid;
- unsigned long table = config_tables[i].table;
-
+ efi_guid_t guid;
+ unsigned long table;
+
+ if (efi_64bit) {
+ u64 table64;
+ guid = ((_efi_config_table_64_t *)tablep)->guid;
+ table64 = ((_efi_config_table_64_t *)tablep)->table;
+ table = table64;
+#ifdef CONFIG_X86_32
+ if (table64 >> 32) {
+ pr_cont("\n");
+ pr_err("Table located above 4GB, disabling.\n");
+ early_iounmap(config_tables,
+ efi.systab->nr_tables * sz);
+ return -EINVAL;
+ }
+#endif
+ } else {
+ guid = ((_efi_config_table_32_t *)tablep)->guid;
+ table = ((_efi_config_table_32_t *)tablep)->table;
+ }
if (!efi_guidcmp(guid, MPS_TABLE_GUID)) {
efi.mps = table;
pr_cont(" MPS=0x%lx ", table);
@@ -502,10 +596,10 @@ static int __init efi_config_init(u64 tables, int nr_tables)
efi.uga = table;
pr_cont(" UGA=0x%lx ", table);
}
+ tablep += sz;
}
pr_cont("\n");
early_iounmap(config_tables, efi.systab->nr_tables * sz);
-
return 0;
}
@@ -569,11 +663,19 @@ void __init efi_init(void)
void *tmp;
#ifdef CONFIG_X86_32
+ if (boot_params.efi_info.efi_systab_hi ||
+ boot_params.efi_info.efi_memmap_hi) {
+ pr_info("Table located above 4GB, disabling.\n");
+ efi_enabled = 0;
+ return;
+ }
efi_phys.systab = (efi_system_table_t *)boot_params.efi_info.efi_systab;
+ efi_native = !efi_64bit;
#else
efi_phys.systab = (efi_system_table_t *)
- (boot_params.efi_info.efi_systab |
- ((__u64)boot_params.efi_info.efi_systab_hi<<32));
+ (boot_params.efi_info.efi_systab |
+ ((__u64)boot_params.efi_info.efi_systab_hi<<32));
+ efi_native = efi_64bit;
#endif
if (efi_systab_init(efi_phys.systab)) {
@@ -602,19 +704,26 @@ void __init efi_init(void)
return;
}
- if (efi_runtime_init()) {
+ /*
+ * Note: We currently don't support runtime services on an EFI
+ * that doesn't match the kernel 32/64-bit mode.
+ */
+
+ if (efi_native && efi_runtime_init()) {
efi_enabled = 0;
return;
- }
+ } else
+ pr_info("No EFI runtime due to 32/64b mismatch with kernel\n");
if (efi_memmap_init()) {
efi_enabled = 0;
return;
}
-
#ifdef CONFIG_X86_32
- x86_platform.get_wallclock = efi_get_time;
- x86_platform.set_wallclock = efi_set_rtc_mmss;
+ if (efi_native) {
+ x86_platform.get_wallclock = efi_get_time;
+ x86_platform.set_wallclock = efi_set_rtc_mmss;
+ }
#endif
#if EFI_DEBUG
@@ -672,6 +781,13 @@ void __init efi_enter_virtual_mode(void)
efi.systab = NULL;
+ /* We don't do virtual mode, since we don't do runtime services, on
+ * non-native EFI
+ */
+
+ if (!efi_native)
+ goto out;
+
/* Merge contiguous regions of the same type and attribute */
for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
u64 prev_size;
@@ -787,6 +903,8 @@ void __init efi_enter_virtual_mode(void)
efi.query_capsule_caps = virt_efi_query_capsule_caps;
if (__supported_pte_mask & _PAGE_NX)
runtime_code_page_mkexec();
+
+out:
early_iounmap(memmap.map, memmap.nr_map * memmap.desc_size);
memmap.map = NULL;
kfree(new_memmap);
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 37c3007..17385ba 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -315,6 +315,16 @@ typedef efi_status_t efi_query_capsule_caps_t(efi_capsule_header_t **capsules,
typedef struct {
efi_guid_t guid;
+ u64 table;
+} _efi_config_table_64_t;
+
+typedef struct {
+ efi_guid_t guid;
+ u32 table;
+} _efi_config_table_32_t;
+
+typedef struct {
+ efi_guid_t guid;
unsigned long table;
} efi_config_table_t;
@@ -329,6 +339,40 @@ typedef struct {
typedef struct {
efi_table_hdr_t hdr;
+ u64 fw_vendor; /* physical addr of CHAR16 vendor string */
+ u32 fw_revision;
+ u32 __pad1;
+ u64 con_in_handle;
+ u64 con_in;
+ u64 con_out_handle;
+ u64 con_out;
+ u64 stderr_handle;
+ u64 stderr;
+ u64 runtime;
+ u64 boottime;
+ u32 nr_tables;
+ u32 __pad2;
+ u64 tables;
+} _efi_system_table_64_t;
+
+typedef struct {
+ efi_table_hdr_t hdr;
+ u32 fw_vendor; /* physical addr of CHAR16 vendor string */
+ u32 fw_revision;
+ u32 con_in_handle;
+ u32 con_in;
+ u32 con_out_handle;
+ u32 con_out;
+ u32 stderr_handle;
+ u32 stderr;
+ u32 runtime;
+ u32 boottime;
+ u32 nr_tables;
+ u32 tables;
+} _efi_system_table_32_t;
+
+typedef struct {
+ efi_table_hdr_t hdr;
unsigned long fw_vendor; /* physical addr of CHAR16 vendor string */
u32 fw_revision;
unsigned long con_in_handle;
@@ -497,6 +541,7 @@ extern int __init efi_setup_pcdp_console(char *);
#ifdef CONFIG_EFI
# ifdef CONFIG_X86
extern int efi_enabled;
+ extern bool efi_64bit;
# else
# define efi_enabled 1
# endif
--
1.7.8.GIT
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 1/5] x86: efi: refactor efi_init() a bit
2012-02-08 0:25 [PATCH v4 0/5] [RESEND] x86: efi: cleanups and basic 32/64-bit support Olof Johansson
@ 2012-02-08 0:25 ` Olof Johansson
0 siblings, 0 replies; 27+ messages in thread
From: Olof Johansson @ 2012-02-08 0:25 UTC (permalink / raw)
To: x86, hpa, mingo, tglx; +Cc: linux-kernel, matt.fleming, mjg, Olof Johansson
Break out some of the init steps into helper functions.
Only change to execution flow is the removal of the warning when the
kernel memdesc structure differ in size from what firmware specifies
since it's a bogus warning (it's a valid difference per spec).
v4:
* Removed memdesc warning as per above
Signed-off-by: Olof Johansson <olof@lixom.net>
Acked-by: Matt Fleming <matt.fleming@intel.com>
---
arch/x86/platform/efi/efi.c | 89 ++++++++++++++++++++++++++-----------------
1 files changed, 54 insertions(+), 35 deletions(-)
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index 264cc6e..fec2b2e 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -436,23 +436,8 @@ static void __init efi_free_boot_services(void)
}
}
-void __init efi_init(void)
+static void __init efi_systab_init(void *phys)
{
- efi_config_table_t *config_tables;
- efi_runtime_services_t *runtime;
- efi_char16_t *c16;
- char vendor[100] = "unknown";
- int i = 0;
- void *tmp;
-
-#ifdef CONFIG_X86_32
- efi_phys.systab = (efi_system_table_t *)boot_params.efi_info.efi_systab;
-#else
- efi_phys.systab = (efi_system_table_t *)
- (boot_params.efi_info.efi_systab |
- ((__u64)boot_params.efi_info.efi_systab_hi<<32));
-#endif
-
efi.systab = early_ioremap((unsigned long)efi_phys.systab,
sizeof(efi_system_table_t));
if (efi.systab == NULL)
@@ -471,22 +456,12 @@ void __init efi_init(void)
"%d.%02d, expected 1.00 or greater!\n",
efi.systab->hdr.revision >> 16,
efi.systab->hdr.revision & 0xffff);
+}
- /*
- * Show what we know for posterity
- */
- c16 = tmp = early_ioremap(efi.systab->fw_vendor, 2);
- if (c16) {
- for (i = 0; i < sizeof(vendor) - 1 && *c16; ++i)
- vendor[i] = *c16++;
- vendor[i] = '\0';
- } else
- printk(KERN_ERR PFX "Could not map the firmware vendor!\n");
- early_iounmap(tmp, 2);
-
- printk(KERN_INFO "EFI v%u.%.02u by %s\n",
- efi.systab->hdr.revision >> 16,
- efi.systab->hdr.revision & 0xffff, vendor);
+static void __init efi_config_init(u64 tables, int nr_tables)
+{
+ efi_config_table_t *config_tables;
+ int i;
/*
* Let's see what config tables the firmware passed to us.
@@ -533,6 +508,11 @@ void __init efi_init(void)
printk("\n");
early_iounmap(config_tables,
efi.systab->nr_tables * sizeof(efi_config_table_t));
+}
+
+static void __init efi_runtime_init(void)
+{
+ efi_runtime_services_t *runtime;
/*
* Check out the runtime services table. We need to map
@@ -561,7 +541,10 @@ void __init efi_init(void)
printk(KERN_ERR "Could not map the EFI runtime service "
"table!\n");
early_iounmap(runtime, sizeof(efi_runtime_services_t));
+}
+static void __init efi_memmap_init(void)
+{
/* Map the EFI memory map */
memmap.map = early_ioremap((unsigned long)memmap.phys_map,
memmap.nr_map * memmap.desc_size);
@@ -569,12 +552,48 @@ void __init efi_init(void)
printk(KERN_ERR "Could not map the EFI memory map!\n");
memmap.map_end = memmap.map + (memmap.nr_map * memmap.desc_size);
- if (memmap.desc_size != sizeof(efi_memory_desc_t))
- printk(KERN_WARNING
- "Kernel-defined memdesc doesn't match the one from EFI!\n");
-
if (add_efi_memmap)
do_add_efi_memmap();
+}
+
+void __init efi_init(void)
+{
+ efi_char16_t *c16;
+ char vendor[100] = "unknown";
+ int i = 0;
+ void *tmp;
+
+#ifdef CONFIG_X86_32
+ efi_phys.systab = (efi_system_table_t *)boot_params.efi_info.efi_systab;
+#else
+ efi_phys.systab = (efi_system_table_t *)
+ (boot_params.efi_info.efi_systab |
+ ((__u64)boot_params.efi_info.efi_systab_hi<<32));
+#endif
+
+ efi_systab_init(efi_phys.systab);
+
+ /*
+ * Show what we know for posterity
+ */
+ c16 = tmp = early_ioremap(efi.systab->fw_vendor, 2);
+ if (c16) {
+ for (i = 0; i < sizeof(vendor) - 1 && *c16; ++i)
+ vendor[i] = *c16++;
+ vendor[i] = '\0';
+ } else
+ printk(KERN_ERR PFX "Could not map the firmware vendor!\n");
+ early_iounmap(tmp, 2);
+
+ printk(KERN_INFO "EFI v%u.%.02u by %s\n",
+ efi.systab->hdr.revision >> 16,
+ efi.systab->hdr.revision & 0xffff, vendor);
+
+ efi_config_init(efi.systab->tables, efi.systab->nr_tables);
+
+ efi_runtime_init();
+
+ efi_memmap_init();
#ifdef CONFIG_X86_32
x86_platform.get_wallclock = efi_get_time;
--
1.7.9.111.gf3fb0
^ permalink raw reply related [flat|nested] 27+ messages in thread
end of thread, other threads:[~2012-02-08 0:27 UTC | newest]
Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-03 17:11 [PATCH v3 0/5] x86: efi: cleanups and basic 32/64 bit support Olof Johansson
2012-01-03 17:11 ` [PATCH 1/5] x86: efi: refactor efi_init() a bit Olof Johansson
2012-01-05 11:22 ` Matt Fleming
2012-01-05 17:49 ` Olof Johansson
2012-01-05 18:17 ` Matthew Garrett
2012-01-05 21:00 ` Olof Johansson
2012-01-03 17:11 ` [PATCH 2/5] x86: efi: convert printk to pr_*() Olof Johansson
2012-01-04 5:26 ` Joe Perches
2012-01-05 17:17 ` Olof Johansson
2012-01-03 17:11 ` [PATCH 3/5] x86: efi: cleanup config table walking Olof Johansson
2012-01-05 11:22 ` Matt Fleming
2012-01-03 17:11 ` [PATCH 4/5] x86: efi: add basic error handling Olof Johansson
2012-01-05 11:21 ` Matt Fleming
2012-01-05 17:52 ` Olof Johansson
2012-01-05 21:02 ` Olof Johansson
2012-01-03 17:11 ` [PATCH 5/5] x86: efi: allow basic init with mixed 32/64-bit efi/kernel Olof Johansson
2012-01-05 11:21 ` Matt Fleming
2012-01-05 17:53 ` Olof Johansson
2012-01-05 18:21 ` Matthew Garrett
2012-01-05 20:59 ` Olof Johansson
2012-01-05 21:02 ` [PATCH v4 0/5] x86: efi: cleanups and basic 32/64 bit support Olof Johansson
2012-01-05 21:02 ` [PATCH 1/5] x86: efi: refactor efi_init() a bit Olof Johansson
2012-01-05 21:02 ` [PATCH 2/5] x86: efi: convert printk to pr_*() Olof Johansson
2012-01-05 21:02 ` [PATCH 3/5] x86: efi: cleanup config table walking Olof Johansson
2012-01-05 21:02 ` [PATCH 4/5] x86: efi: add basic error handling Olof Johansson
2012-01-05 21:02 ` [PATCH 5/5] x86: efi: allow basic init with mixed 32/64-bit efi/kernel Olof Johansson
-- strict thread matches above, loose matches on Subject: below --
2012-02-08 0:25 [PATCH v4 0/5] [RESEND] x86: efi: cleanups and basic 32/64-bit support Olof Johansson
2012-02-08 0:25 ` [PATCH 1/5] x86: efi: refactor efi_init() a bit Olof Johansson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.