All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ken Lin <ken.lin@hpe.com>
To: grub-devel@gnu.org
Cc: kengyu@hpe.com, clayc@hpe.com, michael.ruan@hpe.com, ljk@hpe.com,
	Ken Lin <ken.lin@hpe.com>
Subject: [RFC 2/2] net: workaround to bypass corruption of the efihttp function pointer
Date: Fri, 20 Jan 2017 09:13:21 +0800	[thread overview]
Message-ID: <1484874801-15420-3-git-send-email-ken.lin@hpe.com> (raw)
In-Reply-To: <1484874801-15420-1-git-send-email-ken.lin@hpe.com>

It's a workaround to bypass the corruption of the Request function pointer.
The function pointer crashes after the grub menu is shown. Here is the log:

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 - 00000000 !!!!
RIP  - 000000003E74C59B, CS  - 0000000000000038, RFLAGS - 0000000000210202
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=000000003E74C000, EntryPoint=000000003E74C400) !!!!

HTTP Boot can’t work without this workaround.
The root cause is unknown. It is much appreciated for any kind of suggestions
for debugging this.

Signed-off-by: Ken Lin <ken.lin@hpe.com>
Signed-off-by: Clay Chang <clayc@hpe.com>
Reviewed-by: Keng-Yu Lin <kengyu@hpe.com>
---
 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 = grub_get_time_ms ();
-- 
2.7.4



  parent reply	other threads:[~2017-01-20 14:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-20  1:13 [RFC 0/2] UEFI-based HTTP Boot Ken Lin
2017-01-20  1:13 ` [RFC 1/2] net: add efihttp to do HTTP(S) Boot by UEFI HTTP Protocol Ken Lin
2017-01-20  1:13 ` Ken Lin [this message]
2017-01-20 14:50 ` [RFC 0/2] UEFI-based HTTP Boot Andrei Borzenkov
2017-01-20 18:01   ` Chang, Clay (HPS OE-Linux TDC)
2017-01-21  3:37   ` Lin, Keng-Yu
2017-01-21 17:41     ` Andrei Borzenkov
2017-01-25  8:09   ` Michael Chang
2017-01-25  8:19     ` Andrei Borzenkov
2017-01-25  8:49       ` Michael Chang
2017-01-25  9:01         ` Andrei Borzenkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1484874801-15420-3-git-send-email-ken.lin@hpe.com \
    --to=ken.lin@hpe.com \
    --cc=clayc@hpe.com \
    --cc=grub-devel@gnu.org \
    --cc=kengyu@hpe.com \
    --cc=ljk@hpe.com \
    --cc=michael.ruan@hpe.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.