From nobody Fri Dec 16 19:36:08 2022 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NYfV10VqQz1GHPH for ; Fri, 16 Dec 2022 19:36:09 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NYfV05znzz3nrl for ; Fri, 16 Dec 2022 19:36:08 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671219368; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kYxnZDH0z7Ntjqta4FmomMYKwatdjagoLNYWHqjPwak=; b=Bk+qe5Ay+DExAXbez5+SUzmIBfyDcuHK4+nIJr5BQt87hYCmd6x+n9PxuFBLyJsSH9t+h9 hmX49lWMBnkJYzsC/AATg1/8rFw38T0oGxfp1xHCwQtinX6/uUlYZskuYX1sJwVHY7WMID 26XVXe+z/DOkCO5Eit2dd6xmSL58JS7cwXji6CVs1noTSH7RGXj9S7X1ZwPoVW7yFFPX8J TenVzdhmTWhm9ksuKYPtSKFA/7W+9QLXiq2FWgHyxCsmXC1Wt78pcXtYHlAY6xMC6I/Z/v qHvkPDIdf5oGW2HgkATET9y75xZ9nr+8Ve409VHN1w4YS872/KoSWhaH0nksAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1671219368; a=rsa-sha256; cv=none; b=QdNmxlQ53NXwYxPfTx1LHoBMn+B4SMJB4C4x3GcjbeUWZeW06hcT7mrYeanCO6bbM4I955 ItKupTbk7ZKduWVGJDJf5ZzWX7k+qeTMywACDLg0cStDrdtQ2JE6/r+F5S0zGUFGtEqHyS axtimiym1ciclvAsZfXLDIWUZNcIQuJ8CUruzVZyetV5vHKLpT+IOg0jzbTOpDNLWDTyHz 624orqR7s1ZmurfHH5Ei8LKJd8wg1OHCFmZRhgwDqwS0ffVdKI5U9awNDghK6wwfMMkrHI yzbyatMnPLy3/15mPxaAbmbfdSXov7GJrkfg+b90+NPoV5JWeaqVYXE0+fet8A== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NYfV04xNLzPqb for ; Fri, 16 Dec 2022 19:36:08 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 2BGJa8DT007539 for ; Fri, 16 Dec 2022 19:36:08 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 2BGJa8gQ007538 for bugs@FreeBSD.org; Fri, 16 Dec 2022 19:36:08 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 268418] UEFI boot; i386 VM ; crash before jump to kernel Date: Fri, 16 Dec 2022 19:36:08 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 13.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: martin@bxlr.sk X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D268418 Bug ID: 268418 Summary: UEFI boot; i386 VM ; crash before jump to kernel Product: Base System Version: 13.1-RELEASE Hardware: i386 OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: martin@bxlr.sk Failure to uefi boot i386 VM on various hypervisors: qemu, VMware, VirtualB= ox. Crash happens when jump to kernel is done. I've created test qemu VM, used the bios from sysutils/edk2. VM: qemu-system-i386 -s -m 2048 -bios QEMU_UEFI-i386.fd -debugcon file:debug.log -global isa-debugcon.iobase=3D0x402 \ -serial file:serial.log \ -hda FreeBSD-13.1-RELEASE-i386.qcow2 Problem: Loading kernel... /boot/kernel/kernel text=3D0xfc084 text=3D0xb39210 text=3D0x5b5100 data=3D0= xb0 data=3D0x109290+0x2d5540 syms=3D[0x4+0xe91c0+0x4+0x17caac] Loading configured modules... /boot/entropy size=3D0x1000 /etc/hostid size=3D0x25 Start @ 0x8fd000 ... !!!! IA32 Exception Type - 06(#UD - Invalid Opcode) CPU Apic ID - 00000000 !!!! EIP - 000B0000, CS - 00000010, EFLAGS - 00000082 EAX - 7FED4E40, ECX - 0000000C, EDX - 7FEBF2D4, EBX - 7FEBF2D4 ESP - 7FEBF25C, EBP - 7FEBF298, ESI - 80000007, EDI - 7F347010 DS - 00000008, ES - 00000008, FS - 00000008, GS - 00000008, SS - 00000= 008 CR0 - 40000033, CR2 - 00000000, CR3 - 00000000, CR4 - 00000640 DR0 - 00000000, DR1 - 00000000, DR2 - 00000000, DR3 - 00000000 DR6 - FFFF0FF0, DR7 - 00000400 GDTR - 7FC7F000 00000047, IDTR - 7F88D010 000007FF LDTR - 00000000, TR - 00000000 FXSAVE_STATE - 7FEBEFA0 !!!! Can't find image information. !!!! With gdb I found the location where jump to kernel it being done: 0x7f463a55: mov eax,ds:0x7f464734 0x7f463a5a: mov ebx,edx 0x7f463a5c: push 0x10 0x7f463a5e: mov esi,0x80000007 =3D> 0x7f463a63: call DWORD PTR [eax+0x18] (gdb) x/16xw $eax 0x7fed4ea0: 0x00000000 0x00000000 0x00000000 0x00000000 0x7fed4eb0: 0x00000000 0x00000000 0x00000000 0x00000000 0x7fed4ec0: 0x00000000 0x00000000 0x00000000 0x00000000 0x7fed4ed0: 0x00000000 0x00000000 0x00000000 0x00000000 (gdb) That explains the #UD exception. Problem is that kernel is not loaded at al= l: (gdb) x/2xw 0x8fd000 0x8fd000: 0xffffffff 0xffffffff (gdb) I don't have i386 HW capable of UEFI boot, I can test this only in VM. I'm not familiar with the UEFI, debugging this is a bit of challenge for me= . If I understand it correctly at this stage (after https://github.com/freebsd/freebsd-src/blob/main/stand/efi/loader/arch/i386= /elf32_freebsd.c#L94) I can't call printf any more. I'm trying to get familiar with this but I thought opening PR would be worth it. --=20 You are receiving this mail because: You are the assignee for the bug.=