Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1451435 > unrolled thread

[PATCH 2/4] x86/platform/UV: Fix problem with bad UV4 EFI System Table causing panic

Started byMike Travis <travis@sgi.com>
First post2016-07-27 19:50 +0200
Last post2016-07-29 18:40 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/4] x86/platform/UV: Fix problem with bad UV4 EFI System Table causing panic Mike Travis <travis@sgi.com> - 2016-07-27 19:50 +0200
    Re: [PATCH 2/4] x86/platform/UV: Fix problem with bad UV4 EFI System  Table causing panic Thomas Gleixner <tglx@linutronix.de> - 2016-07-29 13:20 +0200
      Re: [PATCH 2/4] x86/platform/UV: Fix problem with bad UV4 EFI System  Table causing panic Mike Travis <travis@sgi.com> - 2016-07-29 18:40 +0200

#1451435 — [PATCH 2/4] x86/platform/UV: Fix problem with bad UV4 EFI System Table causing panic

FromMike Travis <travis@sgi.com>
Date2016-07-27 19:50 +0200
Subject[PATCH 2/4] x86/platform/UV: Fix problem with bad UV4 EFI System Table causing panic
Message-ID<rZB7X-2ta-3@gated-at.bofh.it>
Fix a problem that occurs if for some reason the UV4 EFI System Table
is not available, the check inadvertantly can cause a panic.

Reviewed-by: Dimitri Sivanich <sivanich@sgi.com>
Reviewed-by: Nathan Zimmer <nzimmer@sgi.com>
Tested-by: Frank Ramsay <framsay@sgi.com>
Tested-by: John Estabrook <estabrook@sgi.com>
Signed-off-by: Mike Travis <travis@sgi.com>
---
 arch/x86/platform/uv/bios_uv.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

--- linux-3.12.orig/arch/x86/platform/uv/bios_uv.c
+++ linux-3.12/arch/x86/platform/uv/bios_uv.c
@@ -201,11 +201,12 @@ void uv_bios_init(void)
 	}
 
 	if (uv_systab->revision >= UV_SYSTAB_VERSION_UV4) {
+		int size = uv_systab->size;
+
 		iounmap(uv_systab);
-		uv_systab = ioremap(efi.uv_systab, uv_systab->size);
+		uv_systab = ioremap(efi.uv_systab, size);
 		if (!uv_systab) {
-			pr_err("UV: UVsystab: ioremap(%d) failed!\n",
-				uv_systab->size);
+			pr_err("UV: UVsystab: ioremap(%d) failed!\n", size);
 			return;
 		}
 	}

-- 

[toc] | [next] | [standalone]


#1452385 — Re: [PATCH 2/4] x86/platform/UV: Fix problem with bad UV4 EFI System Table causing panic

FromThomas Gleixner <tglx@linutronix.de>
Date2016-07-29 13:20 +0200
SubjectRe: [PATCH 2/4] x86/platform/UV: Fix problem with bad UV4 EFI System Table causing panic
Message-ID<s0dZD-3Vu-7@gated-at.bofh.it>
In reply to#1451435
On Wed, 27 Jul 2016, Mike Travis wrote:

> Fix a problem that occurs if for some reason the UV4 EFI System Table
> is not available, the check inadvertantly can cause a panic.
> 
> Reviewed-by: Dimitri Sivanich <sivanich@sgi.com>
> Reviewed-by: Nathan Zimmer <nzimmer@sgi.com>
> Tested-by: Frank Ramsay <framsay@sgi.com>
> Tested-by: John Estabrook <estabrook@sgi.com>
> Signed-off-by: Mike Travis <travis@sgi.com>
> ---
>  arch/x86/platform/uv/bios_uv.c |    7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> --- linux-3.12.orig/arch/x86/platform/uv/bios_uv.c
> +++ linux-3.12/arch/x86/platform/uv/bios_uv.c
> @@ -201,11 +201,12 @@ void uv_bios_init(void)
>  	}
>  
>  	if (uv_systab->revision >= UV_SYSTAB_VERSION_UV4) {
> +		int size = uv_systab->size;
> +
>  		iounmap(uv_systab);
> -		uv_systab = ioremap(efi.uv_systab, uv_systab->size);

I think the changelog is bogus. What's happening here is a classic use after
unmap, which you avoid by this change.

> +		uv_systab = ioremap(efi.uv_systab, size);

Hmm?

	tglx

[toc] | [prev] | [next] | [standalone]


#1452472 — Re: [PATCH 2/4] x86/platform/UV: Fix problem with bad UV4 EFI System Table causing panic

FromMike Travis <travis@sgi.com>
Date2016-07-29 18:40 +0200
SubjectRe: [PATCH 2/4] x86/platform/UV: Fix problem with bad UV4 EFI System Table causing panic
Message-ID<s0iZk-763-27@gated-at.bofh.it>
In reply to#1452385

On 7/29/2016 4:17 AM, Thomas Gleixner wrote:
> On Wed, 27 Jul 2016, Mike Travis wrote:
> 
>> Fix a problem that occurs if for some reason the UV4 EFI System Table
>> is not available, the check inadvertently can cause a panic.
>>
>> Reviewed-by: Dimitri Sivanich <sivanich@sgi.com>
>> Reviewed-by: Nathan Zimmer <nzimmer@sgi.com>
>> Tested-by: Frank Ramsay <framsay@sgi.com>
>> Tested-by: John Estabrook <estabrook@sgi.com>
>> Signed-off-by: Mike Travis <travis@sgi.com>
>> ---
>>  arch/x86/platform/uv/bios_uv.c |    7 ++++---
>>  1 file changed, 4 insertions(+), 3 deletions(-)
>>
>> --- linux-3.12.orig/arch/x86/platform/uv/bios_uv.c
>> +++ linux-3.12/arch/x86/platform/uv/bios_uv.c
>> @@ -201,11 +201,12 @@ void uv_bios_init(void)
>>  	}
>>  
>>  	if (uv_systab->revision >= UV_SYSTAB_VERSION_UV4) {
>> +		int size = uv_systab->size;
>> +
>>  		iounmap(uv_systab);
>> -		uv_systab = ioremap(efi.uv_systab, uv_systab->size);
> 
> I think the changelog is bogus. What's happening here is a classic use after
> unmap, which you avoid by this change.
> 
>> +		uv_systab = ioremap(efi.uv_systab, size);
> 
> Hmm?
> 
> 	tglx
> 

You might be right, I'm not very familiar with the EFI transitions
between physical and virtual addresses.  I do know that it worked
until the later kernels and the EFI changes that have occurred.
Another engineer here (athorlton) is working that problem and he
is the one that discovered this snafu.

But yes, the original code was incorrect in any case.

Thanks,
Mike

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web