From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2001:ba8:0:1d4::6950:5845; helo=duck.fensystems.co.uk; envelope-from=mcb30@ipxe.org; receiver=edk2-devel@lists.01.org Received: from duck.fensystems.co.uk (duck.fensystems.co.uk [IPv6:2001:ba8:0:1d4::6950:5845]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1D9F821F2AF8C for ; Thu, 28 Sep 2017 11:01:32 -0700 (PDT) Received: from pudding.home (host81-134-0-118.in-addr.btopenworld.com [81.134.0.118]) by duck.fensystems.co.uk (Postfix) with ESMTPSA id BB2D5125AB; Thu, 28 Sep 2017 19:04:44 +0100 (BST) To: Konrad Rzeszutek Wilk , edk2-devel@lists.01.org, Konrad Rzeszutek Wilk , Laszlo Ersek , alejandro.j.jimenez@oracle.com, aaron.young@oracle.com, ipxe-devel@lists.ipxe.org, Xen-devel References: From: Michael Brown Message-ID: <7c5cafdc-67cc-5535-1385-6ed9dd491e7e@ipxe.org> Date: Thu, 28 Sep 2017 19:04:43 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Subject: Re: [ipxe-devel] Tips on how to debug EFI code (iPXE) from within KVM after ipxe.efi has crashed with #GP? X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Sep 2017 18:01:32 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit On 28/09/17 18:37, Konrad Rzeszutek Wilk wrote: > !!! X64 Exception Type - 0D(#GP - General Protection) CPU Apic ID - > 00000000 !!!! > ExceptionData - 0000000000000000 > RIP - 00000000BEC2949C, CS - 0000000000000038, RFLAGS - 0000000000210216 > .... > !!!! Find image 808610ed.efidrv (ImageBase=00000000BEC27000, > EntryPoint=00000000BEC2E089) !!!! > > And now I am trying to figure out how to troubleshoot this. > (and yes I am thinking it was related to the Tivoli work-around, but > disabling that didn't help). The Tivoli workaround is for legacy BIOS only; it doesn't apply to the UEFI build of iPXE. You have the RIP and ImageBase, so you know that the exception happens at offset +0x249c within your iPXE binary. You can use this in conjunction with the corresponding map file from the iPXE build (which will probably be named bin-x86_64-efi/808610d3.efidrv.tmp.map, but see below) to figure out exactly where the crash is occurring. > #crash ipxe/src/bin/ipxe.lkrn.tmp ./guest-memory That's a completely different iPXE binary from the one you are using. > - The 80810ed.efidrv is built using: > > (cd ipxe/src;make bin-x86_64-efi/808610d3.efi CONFIG=qemu > DEBUG=iscsi:4,scsi:4 EMBED=/ipxe.config -j8) > if [ $? -ne 0 ]; then exit 1; fi > (cd ipxe/src;EfiRom -f 0x8086 -i 0x1528 --pci23 -ec > bin-x86_64-efi/808610d3.efidrv -o ../../808610d3.rom) > if [ $? -ne 0 ]; then exit 1; fi You can build this much more simply in a single command: make bin-x86_64-efi/808610d3.efirom EMBED=/ipxe.config Also note that: - debug levels in iPXE are bitmasks, so DEBUG=....:4 generally doesn't make much sense. You probably want DEBUG=iscsi,scsi for minimal debug (i.e. detailed error messages for any problems), or DEBUG=iscsi:3,scsi:3 for much more verbose logging. That said, you don't seem to be using iSCSI anyway, so .....? - In your build chain (using EfiRom) I think you have a typo: you build the EFI _application_ bin-x86_64-efi/808610d3.efi but then use the EFI _driver_ bin-x86_64-efi/808610d3.efidrv, which you have not explicitly built. Your final binary may therefore not match what you think you have just built. You should probably not worry about any of this, and just use the single-command build given above instead. Michael