From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1cUaPC-0004e6-5R for mharc-grub-devel@gnu.org; Fri, 20 Jan 2017 09:43:06 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51005) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cUUFq-0006mx-Uc for grub-devel@gnu.org; Fri, 20 Jan 2017 03:09:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cUUFn-0005dj-Fr for grub-devel@gnu.org; Fri, 20 Jan 2017 03:09:02 -0500 Received: from g2t2352.austin.hpe.com ([15.233.44.25]:35115) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cUUFn-0005ZE-9w for grub-devel@gnu.org; Fri, 20 Jan 2017 03:08:59 -0500 Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2352.austin.hpe.com (Postfix) with ESMTP id ECDBF45 for ; Fri, 20 Jan 2017 08:08:52 +0000 (UTC) Received: from hpe.com (unknown [15.119.158.60]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id 86CBD37; Fri, 20 Jan 2017 08:08:52 +0000 (UTC) From: Ken Lin To: grub-devel@gnu.org Cc: kengyu@hpe.com, clayc@hpe.com, michael.ruan@hpe.com, ljk@hpe.com, Ken Lin Subject: [RFC 2/2] net: workaround to bypass corruption of the efihttp function pointer Date: Fri, 20 Jan 2017 09:13:21 +0800 Message-Id: <1484874801-15420-3-git-send-email-ken.lin@hpe.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484874801-15420-1-git-send-email-ken.lin@hpe.com> References: <1484874801-15420-1-git-send-email-ken.lin@hpe.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 15.233.44.25 X-Mailman-Approved-At: Fri, 20 Jan 2017 09:43:04 -0500 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2017 08:09:04 -0000 It's a workaround to bypass the corruption of the Request function pointe= r. The function pointer crashes after the grub menu is shown. Here is the lo= g: net/drivers/efi/efihttp.c:175: b->create_event() net/drivers/efi/efihttp.c:188: grub_efihttp:0x3edc4020, grub_efihttp->request:0xafafafafafafafaf net/drivers/efi/efihttp.c:191: Before grub_efihttp->request(), url:http://192.168.111.1/boot/grub/x86_64-efi/part_gpt.mod !!!! X64 Exception Type - 0D(#GP - General Protection) CPU Apic ID - 000= 00000 !!!! RIP - 000000003E74C59B, CS - 0000000000000038, RFLAGS - 000000000021020= 2 ExceptionData - 0000000000000000 RAX - 000000003BD24280, RCX - 000000003EDC4020, RDX - 000000003BC5B500 RBX - 000000003BC5B600, RSP - 000000003FAFA6D0, RBP - 000000003BC5B4A0 RSI - 000000003EDC4020, RDI - AFAFAFAFAFAFAFAF R8 - 000000003BC5B340, R9 - 000000003BC5B1A0, R10 - 0000000000000013 R11 - 0000000000000058, R12 - 000000003E74C594, R13 - 000000003E754D13 R14 - 000000003BC5B460, R15 - 0000000000000000 DS - 0000000000000030, ES - 0000000000000030, FS - 0000000000000030 GS - 0000000000000030, SS - 0000000000000030 CR0 - 0000000080000033, CR2 - 0000000000000000, CR3 - 000000003FA99000 CR4 - 0000000000000668, CR8 - 0000000000000000 DR0 - 0000000000000000, DR1 - 0000000000000000, DR2 - 0000000000000000 DR3 - 0000000000000000, DR6 - 00000000FFFF0FF0, DR7 - 0000000000000400 GDTR - 000000003FA87698 0000000000000047, LDTR - 0000000000000000 IDTR - 000000003F4FA018 0000000000000FFF, TR - 0000000000000000 FXSAVE_STATE - 000000003FAFA330 !!!! Find PE image (No PDB) (ImageBase=3D000000003E74C000, EntryPoint=3D= 000000003E74C400) !!!! HTTP Boot can=E2=80=99t work without this workaround. The root cause is unknown. It is much appreciated for any kind of suggest= ions for debugging this. Signed-off-by: Ken Lin Signed-off-by: Clay Chang Reviewed-by: Keng-Yu Lin --- grub-core/net/net.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/grub-core/net/net.c b/grub-core/net/net.c index 90c5b48..e258109 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c @@ -1661,6 +1661,9 @@ static void grub_net_poll_cards_idle_real (void) { struct grub_net_card *card; +#ifdef GRUB_MACHINE_EFI + if (grub_efihttp) return; +#endif FOR_NET_CARDS (card) { grub_uint64_t ctime =3D grub_get_time_ms (); --=20 2.7.4