linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] /sys/firmware/efi/systab giving incorrect value for smbios
@ 2006-03-04 18:00 Matthew Garrett
  2006-03-04 18:04 ` [PATCH] Remove __init from efi_get_time Matthew Garrett
  2006-03-04 19:00 ` [PATCH] /sys/firmware/efi/systab giving incorrect value for smbios Matthew Garrett
  0 siblings, 2 replies; 8+ messages in thread
From: Matthew Garrett @ 2006-03-04 18:00 UTC (permalink / raw)
  To: mactel-linux-devel, linux-kernel

On my Intel imac, /sys/firmware/efi/systab is the following:

ACPI20=0x1fefd014
ACPI=0x1fefd000
SMBIOS=0x9fec9000

if I have a kernel with a 2:2 user/kernel split, and

SMBIOS=0x5fec9000

if I have a kernel with a 3:1 split. The correct value is 0x1fec9000, 
which is what the kernel prints at boot time. The following trivial 
patch seems to fix things.

Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>

diff --git a/arch/i386/kernel/efi.c b/arch/i386/kernel/efi.c
index ecad519..6be705e 100644
--- a/arch/i386/kernel/efi.c
+++ b/arch/i386/kernel/efi.c
@@ -391,7 +391,7 @@ void __init efi_init(void)
 			printk(KERN_INFO " ACPI=0x%lx ", config_tables[i].table);
 		} else
 		    if (efi_guidcmp(config_tables[i].guid, SMBIOS_TABLE_GUID) == 0) {
-			efi.smbios = (void *) config_tables[i].table;
+			efi.smbios = __va(config_tables[i].table);
 			printk(KERN_INFO " SMBIOS=0x%lx ", config_tables[i].table);
 		} else
 		    if (efi_guidcmp(config_tables[i].guid, HCDP_TABLE_GUID) == 0) {

-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] Remove __init from efi_get_time
  2006-03-04 18:00 [PATCH] /sys/firmware/efi/systab giving incorrect value for smbios Matthew Garrett
@ 2006-03-04 18:04 ` Matthew Garrett
  2006-03-04 19:00 ` [PATCH] /sys/firmware/efi/systab giving incorrect value for smbios Matthew Garrett
  1 sibling, 0 replies; 8+ messages in thread
From: Matthew Garrett @ 2006-03-04 18:04 UTC (permalink / raw)
  To: mactel-linux-devel, linux-kernel

The comment above efi_get_time claims:

Note, this call isn't used later, so mark it __init.

Unfortunately, it's not true - it's called during suspend as well, 
leading to nasty explosions.

Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>

diff --git a/arch/i386/kernel/efi.c b/arch/i386/kernel/efi.c
index ecad519..6be705e 100644
--- a/arch/i386/kernel/efi.c
+++ b/arch/i386/kernel/efi.c
@@ -193,9 +193,9 @@ inline int efi_set_rtc_mmss(unsigned lon
 /*
  * This should only be used during kernel init and before runtime
  * services have been remapped, therefore, we'll need to call in physical
- * mode.  Note, this call isn't used later, so mark it __init.
+ * mode.
  */
-inline unsigned long __init efi_get_time(void)
+inline unsigned long efi_get_time(void)
 {
 	efi_status_t status;
 	efi_time_t eft;
diff --git a/include/linux/efi.h b/include/linux/efi.h
index c7c5dd3..9e97bc2 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -295,7 +295,7 @@ extern u64 efi_mem_attributes (unsigned 
 extern int __init efi_uart_console_only (void);
 extern void efi_initialize_iomem_resources(struct resource *code_resource,
 					struct resource *data_resource);
-extern unsigned long __init efi_get_time(void);
+extern unsigned long efi_get_time(void);
 extern int __init efi_set_rtc_mmss(unsigned long nowtime);
 extern struct efi_memory_map memmap;
 
-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] /sys/firmware/efi/systab giving incorrect value for smbios
  2006-03-04 18:00 [PATCH] /sys/firmware/efi/systab giving incorrect value for smbios Matthew Garrett
  2006-03-04 18:04 ` [PATCH] Remove __init from efi_get_time Matthew Garrett
@ 2006-03-04 19:00 ` Matthew Garrett
  2006-03-04 19:04   ` [Mactel-linux-devel] " gimli
  1 sibling, 1 reply; 8+ messages in thread
From: Matthew Garrett @ 2006-03-04 19:00 UTC (permalink / raw)
  To: mactel-linux-devel, linux-kernel

Or, as an alternative, remove the virtual to physical mapping that 
efivars does. This requires fixing up IA64 to match. I've no idea which 
approach is right.

Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>

diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index bda5bce..ba598af 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -575,7 +575,7 @@ systab_read(struct subsystem *entry, cha
 	if (efi.acpi)
 		str += sprintf(str, "ACPI=0x%lx\n", __pa(efi.acpi));
 	if (efi.smbios)
-		str += sprintf(str, "SMBIOS=0x%lx\n", __pa(efi.smbios));
+		str += sprintf(str, "SMBIOS=0x%lx\n", efi.smbios);
 	if (efi.hcdp)
 		str += sprintf(str, "HCDP=0x%lx\n", __pa(efi.hcdp));
 	if (efi.boot_info)
diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c
index a3aa45c..ff3795b 100644
--- a/arch/ia64/kernel/efi.c
+++ b/arch/ia64/kernel/efi.c
@@ -451,7 +451,7 @@ efi_init (void)
 			efi.acpi = __va(config_tables[i].table);
 			printk(" ACPI=0x%lx", config_tables[i].table);
 		} else if (efi_guidcmp(config_tables[i].guid, SMBIOS_TABLE_GUID) == 0) {
-			efi.smbios = __va(config_tables[i].table);
+			efi.smbios = config_tables[i].table;
 			printk(" SMBIOS=0x%lx", config_tables[i].table);
 		} else if (efi_guidcmp(config_tables[i].guid, SAL_SYSTEM_TABLE_GUID) == 0) {
 			efi.sal_systab = __va(config_tables[i].table);

-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [Mactel-linux-devel] Re: [PATCH] /sys/firmware/efi/systab giving incorrect value for smbios
  2006-03-04 19:00 ` [PATCH] /sys/firmware/efi/systab giving incorrect value for smbios Matthew Garrett
@ 2006-03-04 19:04   ` gimli
  2006-03-04 19:17     ` Matthew Garrett
  0 siblings, 1 reply; 8+ messages in thread
From: gimli @ 2006-03-04 19:04 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: mactel-linux-devel, linux-kernel

Hi.

Do you have any idea why the kernel crashes on machines with more then 512 MB ram ?

cu

gimli

Matthew Garrett wrote:
> Or, as an alternative, remove the virtual to physical mapping that 
> efivars does. This requires fixing up IA64 to match. I've no idea which 
> approach is right.
> 
> Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>
> 
> diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
> index bda5bce..ba598af 100644
> --- a/drivers/firmware/efivars.c
> +++ b/drivers/firmware/efivars.c
> @@ -575,7 +575,7 @@ systab_read(struct subsystem *entry, cha
>  	if (efi.acpi)
>  		str += sprintf(str, "ACPI=0x%lx\n", __pa(efi.acpi));
>  	if (efi.smbios)
> -		str += sprintf(str, "SMBIOS=0x%lx\n", __pa(efi.smbios));
> +		str += sprintf(str, "SMBIOS=0x%lx\n", efi.smbios);
>  	if (efi.hcdp)
>  		str += sprintf(str, "HCDP=0x%lx\n", __pa(efi.hcdp));
>  	if (efi.boot_info)
> diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c
> index a3aa45c..ff3795b 100644
> --- a/arch/ia64/kernel/efi.c
> +++ b/arch/ia64/kernel/efi.c
> @@ -451,7 +451,7 @@ efi_init (void)
>  			efi.acpi = __va(config_tables[i].table);
>  			printk(" ACPI=0x%lx", config_tables[i].table);
>  		} else if (efi_guidcmp(config_tables[i].guid, SMBIOS_TABLE_GUID) == 0) {
> -			efi.smbios = __va(config_tables[i].table);
> +			efi.smbios = config_tables[i].table;
>  			printk(" SMBIOS=0x%lx", config_tables[i].table);
>  		} else if (efi_guidcmp(config_tables[i].guid, SAL_SYSTEM_TABLE_GUID) == 0) {
>  			efi.sal_systab = __va(config_tables[i].table);
> 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Mactel-linux-devel] Re: [PATCH] /sys/firmware/efi/systab giving incorrect value for smbios
  2006-03-04 19:04   ` [Mactel-linux-devel] " gimli
@ 2006-03-04 19:17     ` Matthew Garrett
  0 siblings, 0 replies; 8+ messages in thread
From: Matthew Garrett @ 2006-03-04 19:17 UTC (permalink / raw)
  To: gimli; +Cc: mactel-linux-devel, linux-kernel

On Sat, Mar 04, 2006 at 08:04:08PM +0100, gimli wrote:
> Hi.
> 
> Do you have any idea why the kernel crashes on machines with more then 512 MB ram ?

As yet, absolutely none. I don't have access to a 1GB machine - if it's 
practical to add more, then I'll see what I can do.

-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [Mactel-linux-devel] Re: [PATCH] /sys/firmware/efi/systab giving incorrect value for smbios
@ 2006-03-10 16:34 Tolentino, Matthew E
  0 siblings, 0 replies; 8+ messages in thread
From: Tolentino, Matthew E @ 2006-03-10 16:34 UTC (permalink / raw)
  To: gimli; +Cc: Matthew Garrett, mactel-linux-devel, linux-kernel

gimli <mailto:gimli@dark-green.com> wrote:
> The latest mm patches makes the kernel unbootable on ma iMac.
> 

Can you send me your .config?

matt

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Mactel-linux-devel] Re: [PATCH] /sys/firmware/efi/systab giving incorrect value for smbios
  2006-03-09 22:13 Tolentino, Matthew E
@ 2006-03-09 23:00 ` gimli
  0 siblings, 0 replies; 8+ messages in thread
From: gimli @ 2006-03-09 23:00 UTC (permalink / raw)
  To: Tolentino, Matthew E; +Cc: Matthew Garrett, mactel-linux-devel, linux-kernel

The latest mm patches makes the kernel unbootable on ma iMac.

cu

Edgar (gimli) Hucek

Tolentino, Matthew E wrote:
> gimli <> wrote:
>> Hi.
>>
>> Do you have any idea why the kernel crashes on machines with more
>> then 512 MB ram ? 
>>
> 
> Can you try the latest -mm with the attached patch on your machine?   
> This should fix it.  
> 
> matt


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [Mactel-linux-devel] Re: [PATCH] /sys/firmware/efi/systab giving incorrect value for smbios
@ 2006-03-09 22:13 Tolentino, Matthew E
  2006-03-09 23:00 ` gimli
  0 siblings, 1 reply; 8+ messages in thread
From: Tolentino, Matthew E @ 2006-03-09 22:13 UTC (permalink / raw)
  To: gimli, Matthew Garrett; +Cc: mactel-linux-devel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 228 bytes --]

gimli <> wrote:
> Hi.
> 
> Do you have any idea why the kernel crashes on machines with more
> then 512 MB ram ? 
> 

Can you try the latest -mm with the attached patch on your machine?   
This should fix it.  

matt

[-- Attachment #2: efi-fixes.patch --]
[-- Type: application/octet-stream, Size: 1997 bytes --]

diff -urNp linux-2.6.16-rc5/arch/i386/kernel/dmi_scan.c linux-2.6.16-rc5-efi/arch/i386/kernel/dmi_scan.c
--- linux-2.6.16-rc5/arch/i386/kernel/dmi_scan.c	2006-03-10 07:02:38.000000000 -0500
+++ linux-2.6.16-rc5-efi/arch/i386/kernel/dmi_scan.c	2006-03-10 07:05:04.000000000 -0500
@@ -223,12 +223,11 @@ void __init dmi_scan_machine(void)
                 * needed during early boot.  This also means we can
                 * iounmap the space when we're done with it.
 		*/
-		p = ioremap(efi.smbios, 32);
+		p = dmi_ioremap(efi.smbios, 32);
 		if (p == NULL)
 			goto out;
 
 		rc = dmi_present(p + 0x10); /* offset of _DMI_ string */
-		iounmap(p);
 		if (!rc)
 			return;
 	}
diff -urNp linux-2.6.16-rc5/arch/i386/kernel/setup.c linux-2.6.16-rc5-efi/arch/i386/kernel/setup.c
--- linux-2.6.16-rc5/arch/i386/kernel/setup.c	2006-03-10 07:02:38.000000000 -0500
+++ linux-2.6.16-rc5-efi/arch/i386/kernel/setup.c	2006-03-10 06:55:48.000000000 -0500
@@ -1050,10 +1050,10 @@ static int __init
 free_available_memory(unsigned long start, unsigned long end, void *arg)
 {
 	/* check max_low_pfn */
-	if (start >= ((max_low_pfn + 1) << PAGE_SHIFT))
+	if (start >= (max_low_pfn << PAGE_SHIFT))
 		return 0;
-	if (end >= ((max_low_pfn + 1) << PAGE_SHIFT))
-		end = (max_low_pfn + 1) << PAGE_SHIFT;
+	if (end >= (max_low_pfn << PAGE_SHIFT))
+		end = max_low_pfn << PAGE_SHIFT;
 	if (start < end)
 		free_bootmem(start, end - start);
 
diff -urNp linux-2.6.16-rc5/drivers/acpi/tables.c linux-2.6.16-rc5-efi/drivers/acpi/tables.c
--- linux-2.6.16-rc5/drivers/acpi/tables.c	2006-02-27 00:09:35.000000000 -0500
+++ linux-2.6.16-rc5-efi/drivers/acpi/tables.c	2006-03-10 04:37:18.000000000 -0500
@@ -587,7 +587,8 @@ int __init acpi_table_init(void)
 		return -ENODEV;
 	}
 
-	rsdp = (struct acpi_table_rsdp *)__va(rsdp_phys);
+	rsdp = (struct acpi_table_rsdp *)__acpi_map_table(rsdp_phys, 
+		sizeof(struct acpi_table_rsdp));
 	if (!rsdp) {
 		printk(KERN_WARNING PREFIX "Unable to map RSDP\n");
 		return -ENODEV;

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-03-10 16:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-04 18:00 [PATCH] /sys/firmware/efi/systab giving incorrect value for smbios Matthew Garrett
2006-03-04 18:04 ` [PATCH] Remove __init from efi_get_time Matthew Garrett
2006-03-04 19:00 ` [PATCH] /sys/firmware/efi/systab giving incorrect value for smbios Matthew Garrett
2006-03-04 19:04   ` [Mactel-linux-devel] " gimli
2006-03-04 19:17     ` Matthew Garrett
2006-03-09 22:13 Tolentino, Matthew E
2006-03-09 23:00 ` gimli
2006-03-10 16:34 Tolentino, Matthew E

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).