Re: [PATCH] x86/efi-bgrt: Replace early_memremap() with memremap()

2016-01-04 Thread Matt Fleming
On Mon, 21 Dec, at 02:12:52PM, Matt Fleming wrote:
> Môshe reported the following warning triggered on his machine since
> commit 50a0cb565246 ("x86/efi-bgrt: Fix kernel panic when mapping BGRT
> data"),
> 
>   [0.026936] [ cut here ]
>   [0.026941] WARNING: CPU: 0 PID: 0 at mm/early_ioremap.c:137 
> __early_ioremap+0x102/0x1bb()
>   [0.026941] Modules linked in:
>   [0.026944] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.4.0-rc1 #2
>   [0.026945] Hardware name: Dell Inc. XPS 13 9343/09K8G1, BIOS A05 
> 07/14/2015
>   [0.026946]   900f03d5a116524d 81c03e60 
> 813a3fff
>   [0.026948]   81c03e98 810a0852 
> d7b76000
>   [0.026949]   0001 0001 
> 017c
>   [0.026951] Call Trace:
>   [0.026955]  [] dump_stack+0x44/0x55
>   [0.026958]  [] warn_slowpath_common+0x82/0xc0
>   [0.026959]  [] warn_slowpath_null+0x1a/0x20
>   [0.026961]  [] __early_ioremap+0x102/0x1bb
>   [0.026962]  [] early_memremap+0x13/0x15
>   [0.026964]  [] efi_bgrt_init+0x162/0x1ad
>   [0.026966]  [] efi_late_init+0x9/0xb
>   [0.026968]  [] start_kernel+0x46f/0x49f
>   [0.026970]  [] ? early_idt_handler_array+0x120/0x120
>   [0.026972]  [] x86_64_start_reservations+0x2a/0x2c
>   [0.026974]  [] x86_64_start_kernel+0x14a/0x16d
>   [0.026977] ---[ end trace f9b3812eb8e24c58 ]---
>   [0.026978] efi_bgrt: Ignoring BGRT: failed to map image memory
> 
> early_memremap() has an upper limit on the size of mapping it can
> handle which is ~200KB. Clearly the BGRT image on Môshe's machine is
> much larger than that.
> 
> There's actually no reason to restrict ourselves to using the early_*
> version of memremap() - the ACPI BGRT driver is invoked late enough in
> boot that we can use the standard version, with the benefit that the
> late version allows mappings of arbitrary size.
> 
> Reported-by: Môshe van der Sterre 
> Tested-by: Môshe van der Sterre 
> Cc: Josh Triplett 
> Cc: Sai Praneeth Prakhya 
> Cc: Borislav Petkov 
> Signed-off-by: Matt Fleming 
> ---
>  arch/x86/platform/efi/efi-bgrt.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)

Ping? Could someone please pick this up for the 'x86/efi' branch? It
fixes a bug in 50a0cb565246 ("x86/efi-bgrt: Fix kernel panic when
mapping BGRT data").
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] x86/efi-bgrt: Replace early_memremap() with memremap()

2016-01-04 Thread Matt Fleming
On Mon, 21 Dec, at 02:12:52PM, Matt Fleming wrote:
> Môshe reported the following warning triggered on his machine since
> commit 50a0cb565246 ("x86/efi-bgrt: Fix kernel panic when mapping BGRT
> data"),
> 
>   [0.026936] [ cut here ]
>   [0.026941] WARNING: CPU: 0 PID: 0 at mm/early_ioremap.c:137 
> __early_ioremap+0x102/0x1bb()
>   [0.026941] Modules linked in:
>   [0.026944] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.4.0-rc1 #2
>   [0.026945] Hardware name: Dell Inc. XPS 13 9343/09K8G1, BIOS A05 
> 07/14/2015
>   [0.026946]   900f03d5a116524d 81c03e60 
> 813a3fff
>   [0.026948]   81c03e98 810a0852 
> d7b76000
>   [0.026949]   0001 0001 
> 017c
>   [0.026951] Call Trace:
>   [0.026955]  [] dump_stack+0x44/0x55
>   [0.026958]  [] warn_slowpath_common+0x82/0xc0
>   [0.026959]  [] warn_slowpath_null+0x1a/0x20
>   [0.026961]  [] __early_ioremap+0x102/0x1bb
>   [0.026962]  [] early_memremap+0x13/0x15
>   [0.026964]  [] efi_bgrt_init+0x162/0x1ad
>   [0.026966]  [] efi_late_init+0x9/0xb
>   [0.026968]  [] start_kernel+0x46f/0x49f
>   [0.026970]  [] ? early_idt_handler_array+0x120/0x120
>   [0.026972]  [] x86_64_start_reservations+0x2a/0x2c
>   [0.026974]  [] x86_64_start_kernel+0x14a/0x16d
>   [0.026977] ---[ end trace f9b3812eb8e24c58 ]---
>   [0.026978] efi_bgrt: Ignoring BGRT: failed to map image memory
> 
> early_memremap() has an upper limit on the size of mapping it can
> handle which is ~200KB. Clearly the BGRT image on Môshe's machine is
> much larger than that.
> 
> There's actually no reason to restrict ourselves to using the early_*
> version of memremap() - the ACPI BGRT driver is invoked late enough in
> boot that we can use the standard version, with the benefit that the
> late version allows mappings of arbitrary size.
> 
> Reported-by: Môshe van der Sterre 
> Tested-by: Môshe van der Sterre 
> Cc: Josh Triplett 
> Cc: Sai Praneeth Prakhya 
> Cc: Borislav Petkov 
> Signed-off-by: Matt Fleming 
> ---
>  arch/x86/platform/efi/efi-bgrt.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)

Ping? Could someone please pick this up for the 'x86/efi' branch? It
fixes a bug in 50a0cb565246 ("x86/efi-bgrt: Fix kernel panic when
mapping BGRT data").
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] x86/efi-bgrt: Replace early_memremap() with memremap()

2015-12-21 Thread Josh Triplett
On Mon, Dec 21, 2015 at 02:12:52PM +, Matt Fleming wrote:
> Môshe reported the following warning triggered on his machine since
> commit 50a0cb565246 ("x86/efi-bgrt: Fix kernel panic when mapping BGRT
> data"),
> 
>   [0.026936] [ cut here ]
>   [0.026941] WARNING: CPU: 0 PID: 0 at mm/early_ioremap.c:137 
> __early_ioremap+0x102/0x1bb()
>   [0.026941] Modules linked in:
>   [0.026944] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.4.0-rc1 #2
>   [0.026945] Hardware name: Dell Inc. XPS 13 9343/09K8G1, BIOS A05 
> 07/14/2015
>   [0.026946]   900f03d5a116524d 81c03e60 
> 813a3fff
>   [0.026948]   81c03e98 810a0852 
> d7b76000
>   [0.026949]   0001 0001 
> 017c
>   [0.026951] Call Trace:
>   [0.026955]  [] dump_stack+0x44/0x55
>   [0.026958]  [] warn_slowpath_common+0x82/0xc0
>   [0.026959]  [] warn_slowpath_null+0x1a/0x20
>   [0.026961]  [] __early_ioremap+0x102/0x1bb
>   [0.026962]  [] early_memremap+0x13/0x15
>   [0.026964]  [] efi_bgrt_init+0x162/0x1ad
>   [0.026966]  [] efi_late_init+0x9/0xb
>   [0.026968]  [] start_kernel+0x46f/0x49f
>   [0.026970]  [] ? early_idt_handler_array+0x120/0x120
>   [0.026972]  [] x86_64_start_reservations+0x2a/0x2c
>   [0.026974]  [] x86_64_start_kernel+0x14a/0x16d
>   [0.026977] ---[ end trace f9b3812eb8e24c58 ]---
>   [0.026978] efi_bgrt: Ignoring BGRT: failed to map image memory
> 
> early_memremap() has an upper limit on the size of mapping it can
> handle which is ~200KB. Clearly the BGRT image on Môshe's machine is
> much larger than that.
> 
> There's actually no reason to restrict ourselves to using the early_*
> version of memremap() - the ACPI BGRT driver is invoked late enough in
> boot that we can use the standard version, with the benefit that the
> late version allows mappings of arbitrary size.
> 
> Reported-by: Môshe van der Sterre 
> Tested-by: Môshe van der Sterre 
> Cc: Josh Triplett 
> Cc: Sai Praneeth Prakhya 
> Cc: Borislav Petkov 
> Signed-off-by: Matt Fleming 

Reviewed-by: Josh Triplett 

>  arch/x86/platform/efi/efi-bgrt.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/x86/platform/efi/efi-bgrt.c 
> b/arch/x86/platform/efi/efi-bgrt.c
> index bf51f4c02562..b0970661870a 100644
> --- a/arch/x86/platform/efi/efi-bgrt.c
> +++ b/arch/x86/platform/efi/efi-bgrt.c
> @@ -72,14 +72,14 @@ void __init efi_bgrt_init(void)
>   return;
>   }
>  
> - image = early_memremap(bgrt_tab->image_address, sizeof(bmp_header));
> + image = memremap(bgrt_tab->image_address, sizeof(bmp_header), 
> MEMREMAP_WB);
>   if (!image) {
>   pr_err("Ignoring BGRT: failed to map image header memory\n");
>   return;
>   }
>  
>   memcpy(_header, image, sizeof(bmp_header));
> - early_memunmap(image, sizeof(bmp_header));
> + memunmap(image);
>   bgrt_image_size = bmp_header.size;
>  
>   bgrt_image = kmalloc(bgrt_image_size, GFP_KERNEL | __GFP_NOWARN);
> @@ -89,7 +89,7 @@ void __init efi_bgrt_init(void)
>   return;
>   }
>  
> - image = early_memremap(bgrt_tab->image_address, bmp_header.size);
> + image = memremap(bgrt_tab->image_address, bmp_header.size, MEMREMAP_WB);
>   if (!image) {
>   pr_err("Ignoring BGRT: failed to map image memory\n");
>   kfree(bgrt_image);
> @@ -98,5 +98,5 @@ void __init efi_bgrt_init(void)
>   }
>  
>   memcpy(bgrt_image, image, bgrt_image_size);
> - early_memunmap(image, bmp_header.size);
> + memunmap(image);
>  }
> -- 
> 2.6.2
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] x86/efi-bgrt: Replace early_memremap() with memremap()

2015-12-21 Thread Josh Triplett
On Mon, Dec 21, 2015 at 02:12:52PM +, Matt Fleming wrote:
> Môshe reported the following warning triggered on his machine since
> commit 50a0cb565246 ("x86/efi-bgrt: Fix kernel panic when mapping BGRT
> data"),
> 
>   [0.026936] [ cut here ]
>   [0.026941] WARNING: CPU: 0 PID: 0 at mm/early_ioremap.c:137 
> __early_ioremap+0x102/0x1bb()
>   [0.026941] Modules linked in:
>   [0.026944] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.4.0-rc1 #2
>   [0.026945] Hardware name: Dell Inc. XPS 13 9343/09K8G1, BIOS A05 
> 07/14/2015
>   [0.026946]   900f03d5a116524d 81c03e60 
> 813a3fff
>   [0.026948]   81c03e98 810a0852 
> d7b76000
>   [0.026949]   0001 0001 
> 017c
>   [0.026951] Call Trace:
>   [0.026955]  [] dump_stack+0x44/0x55
>   [0.026958]  [] warn_slowpath_common+0x82/0xc0
>   [0.026959]  [] warn_slowpath_null+0x1a/0x20
>   [0.026961]  [] __early_ioremap+0x102/0x1bb
>   [0.026962]  [] early_memremap+0x13/0x15
>   [0.026964]  [] efi_bgrt_init+0x162/0x1ad
>   [0.026966]  [] efi_late_init+0x9/0xb
>   [0.026968]  [] start_kernel+0x46f/0x49f
>   [0.026970]  [] ? early_idt_handler_array+0x120/0x120
>   [0.026972]  [] x86_64_start_reservations+0x2a/0x2c
>   [0.026974]  [] x86_64_start_kernel+0x14a/0x16d
>   [0.026977] ---[ end trace f9b3812eb8e24c58 ]---
>   [0.026978] efi_bgrt: Ignoring BGRT: failed to map image memory
> 
> early_memremap() has an upper limit on the size of mapping it can
> handle which is ~200KB. Clearly the BGRT image on Môshe's machine is
> much larger than that.
> 
> There's actually no reason to restrict ourselves to using the early_*
> version of memremap() - the ACPI BGRT driver is invoked late enough in
> boot that we can use the standard version, with the benefit that the
> late version allows mappings of arbitrary size.
> 
> Reported-by: Môshe van der Sterre 
> Tested-by: Môshe van der Sterre 
> Cc: Josh Triplett 
> Cc: Sai Praneeth Prakhya 
> Cc: Borislav Petkov 
> Signed-off-by: Matt Fleming 

Reviewed-by: Josh Triplett 

>  arch/x86/platform/efi/efi-bgrt.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/x86/platform/efi/efi-bgrt.c 
> b/arch/x86/platform/efi/efi-bgrt.c
> index bf51f4c02562..b0970661870a 100644
> --- a/arch/x86/platform/efi/efi-bgrt.c
> +++ b/arch/x86/platform/efi/efi-bgrt.c
> @@ -72,14 +72,14 @@ void __init efi_bgrt_init(void)
>   return;
>   }
>  
> - image = early_memremap(bgrt_tab->image_address, sizeof(bmp_header));
> + image = memremap(bgrt_tab->image_address, sizeof(bmp_header), 
> MEMREMAP_WB);
>   if (!image) {
>   pr_err("Ignoring BGRT: failed to map image header memory\n");
>   return;
>   }
>  
>   memcpy(_header, image, sizeof(bmp_header));
> - early_memunmap(image, sizeof(bmp_header));
> + memunmap(image);
>   bgrt_image_size = bmp_header.size;
>  
>   bgrt_image = kmalloc(bgrt_image_size, GFP_KERNEL | __GFP_NOWARN);
> @@ -89,7 +89,7 @@ void __init efi_bgrt_init(void)
>   return;
>   }
>  
> - image = early_memremap(bgrt_tab->image_address, bmp_header.size);
> + image = memremap(bgrt_tab->image_address, bmp_header.size, MEMREMAP_WB);
>   if (!image) {
>   pr_err("Ignoring BGRT: failed to map image memory\n");
>   kfree(bgrt_image);
> @@ -98,5 +98,5 @@ void __init efi_bgrt_init(void)
>   }
>  
>   memcpy(bgrt_image, image, bgrt_image_size);
> - early_memunmap(image, bmp_header.size);
> + memunmap(image);
>  }
> -- 
> 2.6.2
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/