From owner-freebsd-current@freebsd.org Tue Feb 26 02:05:06 2019 Return-Path: Delivered-To: freebsd-current@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 19094152228C for ; Tue, 26 Feb 2019 02:05:06 +0000 (UTC) (envelope-from rebecca@bluestop.org) Received: from muon.bluestop.org (muon.bluestop.org [96.73.9.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D19DE8F3F8 for ; Tue, 26 Feb 2019 02:05:04 +0000 (UTC) (envelope-from rebecca@bluestop.org) Received: from muon.bluestop.org (localhost [127.0.0.1]) by muon.bluestop.org (Postfix) with ESMTP id 0778678CE7 for ; Mon, 25 Feb 2019 19:05:47 -0700 (MST) Received: from muon.bluestop.org ([127.0.0.1]) by muon.bluestop.org (muon.bluestop.org [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id LTw-2-L7H-Ba for ; Mon, 25 Feb 2019 19:05:46 -0700 (MST) Received: from photon.int.bluestop.org (gw.bluestop.org [96.73.9.3]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by muon.bluestop.org (Postfix) with ESMTPSA for ; Mon, 25 Feb 2019 19:05:46 -0700 (MST) To: freebsd-current@freebsd.org From: Rebecca Cran Subject: i386 EFI booting is broken (ExitBootServices called in two places) Message-ID: Date: Mon, 25 Feb 2019 19:04:56 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: D19DE8F3F8 X-Spamd-Bar: ------ X-Spamd-Result: default: False [-6.88 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[bluestop.org:s=mail]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[4]; IP_SCORE(-2.93)[ip: (-9.74), ipnet: 96.64.0.0/11(-4.29), asn: 7922(-0.56), country: US(-0.07)]; DKIM_TRACE(0.00)[bluestop.org:+]; DMARC_POLICY_ALLOW(-0.50)[bluestop.org,quarantine]; MX_GOOD(-0.01)[mail.bluestop.org]; NEURAL_HAM_SHORT(-0.94)[-0.937,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:7922, ipnet:96.64.0.0/11, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 02:05:06 -0000 I've been working on some EFI changes, and in the process found that i386 booting is broken. On real hardware - my MinnowBoard Turbot - the loader hangs when calling ExitBootServices, while in a VM I get a panic saying "exec returned". The problem appears to be that ExitBootServices is called twice: elf32_exec in arch/i386/efimd.c calls bi_load which calls bi_load_efi_data in bootinfo.c - which calls ExitBootServices the first time. Then elf32_exec keeps going, and after printing "Start @ 0x....." calls ldr_enter which tries to call ExitBootServices again - this time with a mapkey whose value is zero since it never attempts to fetch the memory map. I'm guessing that subsequently causes the exec to fail. -- Rebecca Cran