From owner-svn-src-projects@FreeBSD.ORG Fri Nov 29 20:28:38 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0C312398; Fri, 29 Nov 2013 20:28:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EC3E71DCB; Fri, 29 Nov 2013 20:28:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rATKSbiw097829; Fri, 29 Nov 2013 20:28:37 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rATKSbMJ097828; Fri, 29 Nov 2013 20:28:37 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201311292028.rATKSbMJ097828@svn.freebsd.org> From: Ed Maste Date: Fri, 29 Nov 2013 20:28:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r258754 - projects/uefi/sys/boot/amd64/efi X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Nov 2013 20:28:38 -0000 Author: emaste Date: Fri Nov 29 20:28:37 2013 New Revision: 258754 URL: http://svnweb.freebsd.org/changeset/base/258754 Log: Avoid printf after GetMemoryMap The printf may invalidate the memory map obtained in bi_load (resulting in a new MapKey), which then causes ExitBootServices to fail. Some more work is still needed to address GetMemoryMap retries for other situations that may invalidate the memory map, but this change at least allowed me to boot on an Intel DQ77MK system. Sponsored by: The FreeBSD Foundation Modified: projects/uefi/sys/boot/amd64/efi/elf64_freebsd.c Modified: projects/uefi/sys/boot/amd64/efi/elf64_freebsd.c ============================================================================== --- projects/uefi/sys/boot/amd64/efi/elf64_freebsd.c Fri Nov 29 20:19:00 2013 (r258753) +++ projects/uefi/sys/boot/amd64/efi/elf64_freebsd.c Fri Nov 29 20:28:37 2013 (r258754) @@ -159,12 +159,12 @@ elf64_exec(struct preloaded_file *fp) PT2[i] |= PG_V | PG_RW | PG_PS | PG_U; } + printf("Start @ 0x%lx ...\n", ehdr->e_entry); + err = bi_load(fp->f_args, &modulep, &kernend); if (err != 0) return(err); - printf("Start @ 0x%lx ...\n", ehdr->e_entry); - status = BS->ExitBootServices(IH, x86_efi_mapkey); if (EFI_ERROR(status)) { printf("%s: ExitBootServices() returned 0x%lx\n", __func__,