From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753545AbcG2QcI (ORCPT ); Fri, 29 Jul 2016 12:32:08 -0400 Received: from relay3.sgi.com ([192.48.152.1]:44144 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751640AbcG2QcF (ORCPT ); Fri, 29 Jul 2016 12:32:05 -0400 Subject: Re: [PATCH 2/4] x86/platform/UV: Fix problem with bad UV4 EFI System Table causing panic To: Thomas Gleixner References: <20160727173331.230927085@asylum.americas.sgi.com> <20160727173331.676120136@asylum.americas.sgi.com> CC: Ingo Molnar , "H. Peter Anvin" , Andrew Morton , Dimitri Sivanich , Russ Anderson , John Estabrook , Andrew Banman , Nathan Zimmer , , , , Alex Thorlton From: Mike Travis Message-ID: Date: Fri, 29 Jul 2016 09:31:52 -0700 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [134.15.31.45] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >> Reviewed-by: Nathan Zimmer >> Tested-by: Frank Ramsay >> Tested-by: John Estabrook >> Signed-off-by: Mike Travis >> --- >> 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