All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Prakhya, Sai Praneeth" <sai.praneeth.prakhya@intel.com>
To: Ingo Molnar <mingo@kernel.org>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: "linux-efi@vger.kernel.org" <linux-efi@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH 2/8] efi/x86: Use non-blocking SetVariable() for efi_delete_dummy_variable()
Date: Sun, 15 Jul 2018 23:49:37 +0000	[thread overview]
Message-ID: <FFF73D592F13FD46B8700F0A279B802F46A3F83A@ORSMSX114.amr.corp.intel.com> (raw)
In-Reply-To: <20180715223808.GB16209@gmail.com>

> > diff --git a/arch/x86/platform/efi/quirks.c
> > b/arch/x86/platform/efi/quirks.c index 36c1f8b9f7e0..6af39dc40325
> > 100644
> > --- a/arch/x86/platform/efi/quirks.c
> > +++ b/arch/x86/platform/efi/quirks.c
> > @@ -105,12 +105,11 @@ early_param("efi_no_storage_paranoia",
> > setup_storage_paranoia);  */  void efi_delete_dummy_variable(void)  {
> > -	efi.set_variable((efi_char16_t *)efi_dummy_name,
> > -			 &EFI_DUMMY_GUID,
> > -			 EFI_VARIABLE_NON_VOLATILE |
> > -			 EFI_VARIABLE_BOOTSERVICE_ACCESS |
> > -			 EFI_VARIABLE_RUNTIME_ACCESS,
> > -			 0, NULL);
> > +	efi.set_variable_nonblocking((efi_char16_t *)efi_dummy_name,
> > +				     &EFI_DUMMY_GUID,
> > +				     EFI_VARIABLE_NON_VOLATILE |
> > +				     EFI_VARIABLE_BOOTSERVICE_ACCESS |
> > +				     EFI_VARIABLE_RUNTIME_ACCESS, 0, NULL);
> >  }
> 
> Just wondering, what is the full stack trace of the splat? It sounds a bit surprising
> to me that such type of EFI code is used from the idle thread.

Sorry! for the confusing commit message. Kernel warns about scheduling from idle thread only when "efi_rts_wq" is
used to invoke efi_runtime_services(). So, presently, this doesn't happen on mainline kernel. Support for "efi_rts_wq"
is added by commit 3eb420e70d87 (efi: Use a work queue to invoke EFI Runtime Services).

With v4.18-rc5 kernel, the stack trace looks as below:
Please note that it's not just a warning but a kernel panic due to NULL pointer dereference.
If I remember correctly, I noticed "bad: scheduling from the idle thread!" warning during development phase (probably with v4.15 or v4.16 kernels).

[    0.075052] BUG: unable to handle kernel NULL pointer dereference at 00000000000001c2
[    0.076000] PGD 0 P4D 0 
[    0.076000] Oops: 0000 [#1] SMP PTI
[    0.076000] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.18.0-rc5-efitest+ #216
[    0.076000] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 0.0.0 02/06/2015
[    0.076000] RIP: 0010:__queue_work+0x41/0x5f0
[    0.076000] Code: fd 48 83 ec 10 8b 35 2e e2 79 01 89 7c 24 04 85 f6 74 17 65 48 8b 04 25 40 4f 01 00 8b 88 54 0c 00 00 85 c9 0f 84 b5 02 00 00 <41> f6 84 24 c2 01 00 00 01 0f 85 f7 03 00 00 48 bd eb 83 b5 80 46 
[    0.076000] RSP: 0000:ffffffff82603cf0 EFLAGS: 00010046
[    0.076000] RAX: ffffffff8262a7c0 RBX: 0000000000000246 RCX: 0000000000000000
[    0.076000] RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000002000
[    0.076000] RBP: ffffffff82603da0 R08: 0000000000000000 R09: 0000000000000001
[    0.076000] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
[    0.076000] R13: 0000000000002000 R14: ffffffff82603da0 R15: 0000000000000000
[    0.076000] FS:  0000000000000000(0000) GS:ffff88007e000000(0000) knlGS:0000000000000000
[    0.076000] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    0.076000] CR2: 00000000000001c2 CR3: 0000000005a24001 CR4: 00000000000606b0
[    0.076000] Call Trace:
[    0.076000]  queue_work_on+0x33/0x70
[    0.076000]  virt_efi_set_variable+0x11f/0x160
[    0.076000]  ? efi_call_virt_check_flags+0x80/0x80
[    0.076000]  efi_delete_dummy_variable+0x8c/0xb0
[    0.076000]  ? efi_enter_virtual_mode+0x42c/0x4e0
[    0.076000]  efi_enter_virtual_mode+0x42c/0x4e0
[    0.076000]  start_kernel+0x456/0x4f4
[    0.076000]  secondary_startup_64+0xa5/0xb0
[    0.076000] Modules linked in:
[    0.076000] CR2: 00000000000001c2
[    0.076000] ---[ end trace 5a03876c3be00272 ]---
[    0.076000] RIP: 0010:__queue_work+0x41/0x5f0
[    0.076000] Code: fd 48 83 ec 10 8b 35 2e e2 79 01 89 7c 24 04 85 f6 74 17 65 48 8b 04 25 40 4f 01 00 8b 88 54 0c 00 00 85 c9 0f 84 b5 02 00 00 <41> f6 84 24 c2 01 00 00 01 0f 85 f7 03 00 00 48 bd eb 83 b5 80 46 
[    0.076000] RSP: 0000:ffffffff82603cf0 EFLAGS: 00010046
[    0.076000] RAX: ffffffff8262a7c0 RBX: 0000000000000246 RCX: 0000000000000000
[    0.076000] RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000002000
[    0.076000] RBP: ffffffff82603da0 R08: 0000000000000000 R09: 0000000000000001
[    0.076000] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
[    0.076000] R13: 0000000000002000 R14: ffffffff82603da0 R15: 0000000000000000
[    0.076000] FS:  0000000000000000(0000) GS:ffff88007e000000(0000) knlGS:0000000000000000
[    0.076000] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    0.076000] CR2: 00000000000001c2 CR3: 0000000005a24001 CR4: 00000000000606b0
[    0.076000] Kernel panic - not syncing: Attempted to kill the idle task!
[    0.076000] ---[ end Kernel panic - not syncing: Attempted to kill the idle task! ]---

Regards,
Sai

  reply	other threads:[~2018-07-15 23:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-11  9:40 [GIT PULL 0/8] EFI changes for v4.19 Ard Biesheuvel
2018-07-11  9:40 ` [PATCH 1/8] efi/x86: Clean up the eboot code Ard Biesheuvel
2018-07-15 23:36   ` [tip:efi/core] " tip-bot for Ingo Molnar
2018-07-11  9:40 ` [PATCH 2/8] efi/x86: Use non-blocking SetVariable() for efi_delete_dummy_variable() Ard Biesheuvel
2018-07-15 22:38   ` Ingo Molnar
2018-07-15 23:49     ` Prakhya, Sai Praneeth [this message]
2018-07-16  1:02       ` Ingo Molnar
2018-07-15 23:37   ` [tip:efi/core] " tip-bot for Sai Praneeth
2018-07-11  9:40 ` [PATCH 3/8] efi: Use a work queue to invoke EFI Runtime Services Ard Biesheuvel
2018-07-15 23:37   ` [tip:efi/core] " tip-bot for Sai Praneeth
2018-07-11  9:40 ` [PATCH 4/8] efi: cper: avoid using get_seconds() Ard Biesheuvel
2018-07-15 23:38   ` [tip:efi/core] efi/cper: Avoid " tip-bot for Arnd Bergmann
2018-07-11  9:40 ` [PATCH 5/8] efi: Remove the declaration of efi_late_init() as the function is unused Ard Biesheuvel
2018-07-15 23:38   ` [tip:efi/core] " tip-bot for Sai Praneeth
2018-07-11  9:40 ` [PATCH 6/8] efi/libstub/arm: add opt-in Kconfig option for the DTB loader Ard Biesheuvel
2018-07-15 23:39   ` [tip:efi/core] efi/libstub/arm: Add " tip-bot for Ard Biesheuvel
2018-07-11  9:40 ` [PATCH 7/8] efi: drop type and attribute checks in efi_mem_desc_lookup() Ard Biesheuvel
2018-07-15 23:39   ` [tip:efi/core] efi: Drop " tip-bot for Ard Biesheuvel
2018-07-11  9:40 ` [PATCH 8/8] fbdev/efifb: honour UEFI memory map attributes when mapping the fb Ard Biesheuvel
2018-07-15 23:40   ` [tip:efi/core] fbdev/efifb: Honour UEFI memory map attributes when mapping the FB tip-bot for Ard Biesheuvel
2019-04-20 19:02   ` [PATCH 8/8] fbdev/efifb: honour UEFI memory map attributes when mapping the fb James Hilliard
2019-04-23  6:50     ` Ard Biesheuvel
2019-04-23 12:21       ` James Hilliard

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=FFF73D592F13FD46B8700F0A279B802F46A3F83A@ORSMSX114.amr.corp.intel.com \
    --to=sai.praneeth.prakhya@intel.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    /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.