From owner-svn-src-head@freebsd.org Fri Jun 15 19:07:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BF841018D8D; Fri, 15 Jun 2018 19:07:40 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B8B17EC43; Fri, 15 Jun 2018 19:07:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D1E801B867; Fri, 15 Jun 2018 19:07:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FJ7bbu096251; Fri, 15 Jun 2018 19:07:37 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FJ7baq096250; Fri, 15 Jun 2018 19:07:37 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806151907.w5FJ7baq096250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 15 Jun 2018 19:07:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335231 - head/stand/efi/loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/loader X-SVN-Commit-Revision: 335231 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 19:07:40 -0000 Author: imp Date: Fri Jun 15 19:07:37 2018 New Revision: 335231 URL: https://svnweb.freebsd.org/changeset/base/335231 Log: There's no need to walk through the tables looking for the smbios table if we're just going to ignore it on arm, so expand, slightly, the reach of the ifdef. Move the buffer to the inner block so we don't have a separate #ifdef far away from these lines. The issue on arm is that smbios_detect does unaligned accesses, which in the u-boot implementing EFI context causes a crash. Modified: head/stand/efi/loader/main.c Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Fri Jun 15 19:07:31 2018 (r335230) +++ head/stand/efi/loader/main.c Fri Jun 15 19:07:37 2018 (r335231) @@ -511,9 +511,6 @@ main(int argc, CHAR16 *argv[]) size_t sz; UINT16 boot_order[100]; EFI_LOADED_IMAGE *img; -#if !defined(__arm__) - char buf[40]; -#endif archsw.arch_autoload = efi_autoload; archsw.arch_getdev = efi_getdev; @@ -655,18 +652,20 @@ main(int argc, CHAR16 *argv[]) efi_init_environment(); setenv("LINES", "24", 1); /* optional */ +#if !defined(__arm__) for (k = 0; k < ST->NumberOfTableEntries; k++) { guid = &ST->ConfigurationTable[k].VendorGuid; -#if !defined(__arm__) if (!memcmp(guid, &smbios, sizeof(EFI_GUID))) { + char buf[40]; + snprintf(buf, sizeof(buf), "%p", ST->ConfigurationTable[k].VendorTable); setenv("hint.smbios.0.mem", buf, 1); smbios_detect(ST->ConfigurationTable[k].VendorTable); break; } -#endif } +#endif interact(); /* doesn't return */