From: Russ Anderson <rja-sJ/iWh9BUns@public.gmane.org>
To: Matt Fleming <matt-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
Cc: Matthew Garrett
<matthew.garrett-05XSO3Yj/JvQT0dZR+AlfA@public.gmane.org>,
matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Ingo Molnar <mingo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>,
"H. Peter Anvin" <hpa-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
Borislav Petkov <bp-Gina5bIWoIWzQB+pC5nmwQ@public.gmane.org>
Subject: Re: [regression, bisected] x86: efi: Pass boot services variable info to runtime code
Date: Fri, 24 May 2013 15:05:39 -0500 [thread overview]
Message-ID: <20130524200539.GA3322@sgi.com> (raw)
In-Reply-To: <20130524074331.GL14575-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
On Fri, May 24, 2013 at 08:43:31AM +0100, Matt Fleming wrote:
> On Thu, 23 May, at 03:32:34PM, Russ Anderson wrote:
> > efi: mem127: type=4, attr=0xf, range=[0x000000006bb22000-0x000000007ca9c000) (271MB)
>
> EFI_BOOT_SERVICES_CODE
>
> > efi: mem133: type=5, attr=0x800000000000000f, range=[0x000000007daff000-0x000000007dbff000) (1MB)
>
> EFI_RUNTIME_SERVICES_CODE
>
> > EFI Variables Facility v0.08 2004-May-17
> > BUG: unable to handle kernel paging request at 000000007ca95b10
> > IP: [<ffff88007dbf2140>] 0xffff88007dbf213f
>
> > [<ffffffff810499b3>] ? efi_call3+0x43/0x80
> > [<ffffffff810492a7>] ? virt_efi_get_next_variable+0x47/0x1c0
> > [<ffffffff814c8cc0>] ? create_efivars_bin_attributes+0x150/0x150
> > [<ffffffff814c7b55>] ? efivar_init+0xd5/0x390
> > [<ffffffff814c8ae0>] ? efivar_update_sysfs_entries+0x90/0x90
> > [<ffffffff812f906b>] ? kobject_uevent+0xb/0x10
> > [<ffffffff812f812b>] ? kset_register+0x5b/0x70
> > [<ffffffff814c8cc0>] ? create_efivars_bin_attributes+0x150/0x150
> > [<ffffffff814c8d47>] ? efivars_sysfs_init+0x87/0xf0
> > [<ffffffff8100032a>] ? do_one_initcall+0x15a/0x1b0
> > [<ffffffff81a17831>] ? do_basic_setup+0xad/0xce
> > [<ffffffff81a17ae3>] ? kernel_init_freeable+0x291/0x291
> > [<ffffffff81a3708a>] ? sched_init_smp+0x15b/0x162
> > [<ffffffff81a17a5f>] ? kernel_init_freeable+0x20d/0x291
> > [<ffffffff81601eb0>] ? rest_init+0x80/0x80
> > [<ffffffff81601ebe>] ? kernel_init+0xe/0x180
> > [<ffffffff8162179c>] ? ret_from_fork+0x7c/0xb0
> > [<ffffffff81601eb0>] ? rest_init+0x80/0x80
>
> Here's the real call stack leading up to the crash.
>
> What appears to be happening is that your the EFI runtime services code
> is calling into the EFI boot services code, which is definitely a bug in
> your firmware because we're at runtime, but we've seen other machines
> that do similar things so we usually handle it just fine. However, what
> makes your case different, and the reason you see the above splat, is
> that it's using the physical address of the EFI boot services region,
> not the virtual one we setup with SetVirtualAddressMap(). Which is a
> second firmware bug. Again, we have seen other machines that access
> physical addresses after SetVirtualAddressMap(), but until now we
> haven't had any non-optional code that triggered them.
>
> The only reason I can see that the offending commit would introduce this
> problem is because it calls QueryVariableInfo() at boot time. I notice
> that your machine is an SGI UV one, is there any chance you could get a
> firmware fix for this? If possible, it would be also good to confirm
> that it's this chunk of code in setup_efi_vars(),
>
> status = efi_call_phys4(sys_table->runtime->query_variable_info,
> EFI_VARIABLE_NON_VOLATILE |
> EFI_VARIABLE_BOOTSERVICE_ACCESS |
> EFI_VARIABLE_RUNTIME_ACCESS, &store_size,
> &remaining_size, &var_size);
This call is failing, but not returning a valid EFI_* return status.
setup_efi_vars() returns at that point. Maybe it is not set up
to do GetNextVariable() later on??? Why call GetNextVariable() if the
earlier call failed?
> that later makes GetNextVariable() jump to the physical address of the
> EFI Boot Services region. Because if not, we need to do some more
> digging.
One other data point is if the query_variable_info call is hacked to
remove one of the EFI flags (ie comment out EFI_VARIABLE_BOOTSERVICE_ACCESS)
the efi_call_phys4() call fails with EFI_INVALID_PARAMETER and
the system boots. Of course it does not create /sys/firmware/efivars
entries and complains "[Firmware Bug]: efi: Inconsistent initial sizes".
But at least it boots.
One of the BIOS guys will build a debug bios next week to help see
what is going on in the query_variable_info() call.
> Borislav, how are your 1:1 mapping patches coming along? In theory, once
> those are merged we can gracefully workaround these kinds of issues.
>
> --
> Matt Fleming, Intel Open Source Technology Center
--
Russ Anderson, OS RAS/Partitioning Project Lead
SGI - Silicon Graphics Inc rja-sJ/iWh9BUns@public.gmane.org
WARNING: multiple messages have this Message-ID (diff)
From: Russ Anderson <rja@sgi.com>
To: Matt Fleming <matt@console-pimps.org>
Cc: Matthew Garrett <matthew.garrett@nebula.com>,
matt.fleming@intel.com, linux-efi@vger.kernel.org,
x86@kernel.org, linux-kernel@vger.kernel.org,
Ingo Molnar <mingo@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@linux.intel.com>,
Borislav Petkov <bp@alien8.de>
Subject: Re: [regression, bisected] x86: efi: Pass boot services variable info to runtime code
Date: Fri, 24 May 2013 15:05:39 -0500 [thread overview]
Message-ID: <20130524200539.GA3322@sgi.com> (raw)
In-Reply-To: <20130524074331.GL14575@console-pimps.org>
On Fri, May 24, 2013 at 08:43:31AM +0100, Matt Fleming wrote:
> On Thu, 23 May, at 03:32:34PM, Russ Anderson wrote:
> > efi: mem127: type=4, attr=0xf, range=[0x000000006bb22000-0x000000007ca9c000) (271MB)
>
> EFI_BOOT_SERVICES_CODE
>
> > efi: mem133: type=5, attr=0x800000000000000f, range=[0x000000007daff000-0x000000007dbff000) (1MB)
>
> EFI_RUNTIME_SERVICES_CODE
>
> > EFI Variables Facility v0.08 2004-May-17
> > BUG: unable to handle kernel paging request at 000000007ca95b10
> > IP: [<ffff88007dbf2140>] 0xffff88007dbf213f
>
> > [<ffffffff810499b3>] ? efi_call3+0x43/0x80
> > [<ffffffff810492a7>] ? virt_efi_get_next_variable+0x47/0x1c0
> > [<ffffffff814c8cc0>] ? create_efivars_bin_attributes+0x150/0x150
> > [<ffffffff814c7b55>] ? efivar_init+0xd5/0x390
> > [<ffffffff814c8ae0>] ? efivar_update_sysfs_entries+0x90/0x90
> > [<ffffffff812f906b>] ? kobject_uevent+0xb/0x10
> > [<ffffffff812f812b>] ? kset_register+0x5b/0x70
> > [<ffffffff814c8cc0>] ? create_efivars_bin_attributes+0x150/0x150
> > [<ffffffff814c8d47>] ? efivars_sysfs_init+0x87/0xf0
> > [<ffffffff8100032a>] ? do_one_initcall+0x15a/0x1b0
> > [<ffffffff81a17831>] ? do_basic_setup+0xad/0xce
> > [<ffffffff81a17ae3>] ? kernel_init_freeable+0x291/0x291
> > [<ffffffff81a3708a>] ? sched_init_smp+0x15b/0x162
> > [<ffffffff81a17a5f>] ? kernel_init_freeable+0x20d/0x291
> > [<ffffffff81601eb0>] ? rest_init+0x80/0x80
> > [<ffffffff81601ebe>] ? kernel_init+0xe/0x180
> > [<ffffffff8162179c>] ? ret_from_fork+0x7c/0xb0
> > [<ffffffff81601eb0>] ? rest_init+0x80/0x80
>
> Here's the real call stack leading up to the crash.
>
> What appears to be happening is that your the EFI runtime services code
> is calling into the EFI boot services code, which is definitely a bug in
> your firmware because we're at runtime, but we've seen other machines
> that do similar things so we usually handle it just fine. However, what
> makes your case different, and the reason you see the above splat, is
> that it's using the physical address of the EFI boot services region,
> not the virtual one we setup with SetVirtualAddressMap(). Which is a
> second firmware bug. Again, we have seen other machines that access
> physical addresses after SetVirtualAddressMap(), but until now we
> haven't had any non-optional code that triggered them.
>
> The only reason I can see that the offending commit would introduce this
> problem is because it calls QueryVariableInfo() at boot time. I notice
> that your machine is an SGI UV one, is there any chance you could get a
> firmware fix for this? If possible, it would be also good to confirm
> that it's this chunk of code in setup_efi_vars(),
>
> status = efi_call_phys4(sys_table->runtime->query_variable_info,
> EFI_VARIABLE_NON_VOLATILE |
> EFI_VARIABLE_BOOTSERVICE_ACCESS |
> EFI_VARIABLE_RUNTIME_ACCESS, &store_size,
> &remaining_size, &var_size);
This call is failing, but not returning a valid EFI_* return status.
setup_efi_vars() returns at that point. Maybe it is not set up
to do GetNextVariable() later on??? Why call GetNextVariable() if the
earlier call failed?
> that later makes GetNextVariable() jump to the physical address of the
> EFI Boot Services region. Because if not, we need to do some more
> digging.
One other data point is if the query_variable_info call is hacked to
remove one of the EFI flags (ie comment out EFI_VARIABLE_BOOTSERVICE_ACCESS)
the efi_call_phys4() call fails with EFI_INVALID_PARAMETER and
the system boots. Of course it does not create /sys/firmware/efivars
entries and complains "[Firmware Bug]: efi: Inconsistent initial sizes".
But at least it boots.
One of the BIOS guys will build a debug bios next week to help see
what is going on in the query_variable_info() call.
> Borislav, how are your 1:1 mapping patches coming along? In theory, once
> those are merged we can gracefully workaround these kinds of issues.
>
> --
> Matt Fleming, Intel Open Source Technology Center
--
Russ Anderson, OS RAS/Partitioning Project Lead
SGI - Silicon Graphics Inc rja@sgi.com
next prev parent reply other threads:[~2013-05-24 20:05 UTC|newest]
Thread overview: 116+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-22 16:27 [regression, bisected] x86: efi: Pass boot services variable info to runtime code Russ Anderson
2013-05-22 16:27 ` Russ Anderson
[not found] ` <20130522162747.GA20816-sJ/iWh9BUns@public.gmane.org>
2013-05-23 11:58 ` Matt Fleming
2013-05-23 11:58 ` Matt Fleming
[not found] ` <20130523115801.GJ14575-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
2013-05-23 20:32 ` Russ Anderson
2013-05-23 20:32 ` Russ Anderson
[not found] ` <20130523203234.GD20913-sJ/iWh9BUns@public.gmane.org>
2013-05-24 7:43 ` Matt Fleming
2013-05-24 7:43 ` Matt Fleming
[not found] ` <20130524074331.GL14575-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
2013-05-24 11:09 ` Borislav Petkov
2013-05-24 11:09 ` Borislav Petkov
[not found] ` <20130524110911.GA32220-K5JNixvcfoxupOikMc4+xw@public.gmane.org>
2013-05-24 11:40 ` Matt Fleming
2013-05-24 11:40 ` Matt Fleming
2013-05-24 16:11 ` Robin Holt
2013-05-24 16:11 ` Robin Holt
[not found] ` <20130524161111.GE3672-sJ/iWh9BUns@public.gmane.org>
2013-05-24 17:02 ` Russ Anderson
2013-05-24 17:02 ` Russ Anderson
[not found] ` <20130524170214.GA30179-sJ/iWh9BUns@public.gmane.org>
2013-05-24 21:05 ` Dave Jones
2013-05-24 21:05 ` Dave Jones
[not found] ` <20130524210534.GA15466-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-05-27 4:27 ` joeyli
2013-05-27 4:27 ` joeyli
[not found] ` <1369628832.19026.22.camel-ONCj+Eqt86TasUa73XJKwA@public.gmane.org>
2013-05-27 4:32 ` joeyli
2013-05-27 4:32 ` joeyli
2013-05-28 2:43 ` Russ Anderson
2013-05-28 2:43 ` Russ Anderson
2013-05-24 20:05 ` Russ Anderson [this message]
2013-05-24 20:05 ` Russ Anderson
[not found] ` <20130524200539.GA3322-sJ/iWh9BUns@public.gmane.org>
2013-05-24 20:11 ` Matthew Garrett
2013-05-24 20:11 ` Matthew Garrett
2013-05-24 20:49 ` Russ Anderson
2013-05-24 20:49 ` Russ Anderson
[not found] ` <20130524204937.GB3322-sJ/iWh9BUns@public.gmane.org>
2013-05-28 10:50 ` Matt Fleming
2013-05-28 10:50 ` Matt Fleming
2013-05-28 10:53 ` Matt Fleming
2013-05-28 10:53 ` Matt Fleming
2013-05-28 8:35 ` Ingo Molnar
2013-05-28 8:35 ` Ingo Molnar
2013-05-29 21:01 ` Russ Anderson
2013-05-29 21:01 ` Russ Anderson
[not found] ` <20130529210115.GC28027-sJ/iWh9BUns@public.gmane.org>
2013-05-29 22:22 ` Jiri Kosina
2013-05-29 22:22 ` Jiri Kosina
[not found] ` <alpine.LRH.2.00.1305300018180.1111-1ReQVI26iDCaZKY3DrU6dA@public.gmane.org>
2013-05-29 22:46 ` Russ Anderson
2013-05-29 22:46 ` Russ Anderson
[not found] ` <20130529224645.GA16582-sJ/iWh9BUns@public.gmane.org>
2013-05-29 22:53 ` Jiri Kosina
2013-05-29 22:53 ` Jiri Kosina
[not found] ` <alpine.LNX.2.00.1305300048520.30576-ztGlSCb7Y1iN3ZZ/Hiejyg@public.gmane.org>
2013-05-30 2:16 ` joeyli
2013-05-30 2:16 ` joeyli
[not found] ` <1369880172.17397.11.camel-ONCj+Eqt86TasUa73XJKwA@public.gmane.org>
2013-05-30 22:17 ` Russ Anderson
2013-05-30 22:17 ` Russ Anderson
[not found] ` <20130530221737.GA11105-sJ/iWh9BUns@public.gmane.org>
2013-05-30 22:21 ` Matthew Garrett
2013-05-30 22:21 ` Matthew Garrett
2013-05-30 22:28 ` Russ Anderson
2013-05-30 22:28 ` Russ Anderson
[not found] ` <20130530222836.GB11105-sJ/iWh9BUns@public.gmane.org>
2013-05-30 22:30 ` Jiri Kosina
2013-05-30 22:30 ` Jiri Kosina
[not found] ` <alpine.LNX.2.00.1305310029560.30576-ztGlSCb7Y1iN3ZZ/Hiejyg@public.gmane.org>
2013-05-31 2:17 ` Russ Anderson
2013-05-31 2:17 ` Russ Anderson
[not found] ` <20130531021749.GA24287-sJ/iWh9BUns@public.gmane.org>
2013-05-31 3:28 ` joeyli
2013-05-31 3:28 ` joeyli
2013-05-30 22:32 ` Matthew Garrett
2013-05-30 22:32 ` Matthew Garrett
2013-05-31 2:54 ` Russ Anderson
2013-05-31 2:54 ` Russ Anderson
2013-05-31 10:06 ` Ingo Molnar
2013-05-30 22:25 ` Jiri Kosina
2013-05-30 22:25 ` Jiri Kosina
[not found] ` <alpine.LNX.2.00.1305310023020.30576-ztGlSCb7Y1iN3ZZ/Hiejyg@public.gmane.org>
2013-05-31 10:12 ` Ingo Molnar
2013-05-31 10:12 ` Ingo Molnar
[not found] ` <20130531101250.GD30394-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-05-31 11:06 ` Jiri Kosina
2013-05-31 11:06 ` Jiri Kosina
[not found] ` <alpine.LNX.2.00.1305311259520.30576-ztGlSCb7Y1iN3ZZ/Hiejyg@public.gmane.org>
2013-05-31 11:40 ` Ingo Molnar
2013-05-31 11:40 ` Ingo Molnar
[not found] ` <20130531114037.GC7131-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-05-31 11:54 ` Josh Boyer
2013-05-31 11:54 ` Josh Boyer
2013-05-31 12:30 ` Borislav Petkov
2013-05-31 12:30 ` Borislav Petkov
[not found] ` <20130531123015.GC17843-K5JNixvcfoxupOikMc4+xw@public.gmane.org>
2013-05-31 12:43 ` Ingo Molnar
2013-05-31 12:43 ` Ingo Molnar
[not found] ` <20130531124356.GA8212-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-05-31 14:34 ` Matthew Garrett
2013-05-31 14:34 ` Matthew Garrett
[not found] ` <20130531143425.GA5850-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>
2013-05-31 14:42 ` James Bottomley
2013-05-31 14:42 ` James Bottomley
[not found] ` <1370011357.1913.15.camel-sFMDBYUN5F8GjUHQrlYNx2Wm91YjaHnnhRte9Li2A+AAvxtiuMwx3w@public.gmane.org>
2013-05-31 14:45 ` H. Peter Anvin
2013-05-31 14:45 ` H. Peter Anvin
2013-05-31 14:48 ` Matthew Garrett
2013-05-31 14:48 ` Matthew Garrett
2013-05-31 15:43 ` Russ Anderson
[not found] ` <20130531154348.GA17145-sJ/iWh9BUns@public.gmane.org>
2013-05-31 16:28 ` Matthew Garrett
2013-05-31 16:28 ` Matthew Garrett
[not found] ` <20130531162815.GA8082-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>
2013-05-31 17:35 ` James Bottomley
2013-05-31 17:35 ` James Bottomley
2013-05-31 22:57 ` Russ Anderson
2013-05-31 22:57 ` Russ Anderson
[not found] ` <20130531225730.GB14752-sJ/iWh9BUns@public.gmane.org>
2013-05-31 22:59 ` H. Peter Anvin
2013-05-31 22:59 ` H. Peter Anvin
2013-05-31 23:30 ` Jiri Kosina
2013-05-31 23:30 ` Jiri Kosina
2013-06-01 0:03 ` Matthew Garrett
2013-06-01 0:03 ` Matthew Garrett
[not found] ` <20130601000311.GA15126-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>
2013-06-01 4:20 ` Russ Anderson
2013-06-01 4:20 ` Russ Anderson
[not found] ` <20130601042058.GB15199-sJ/iWh9BUns@public.gmane.org>
2013-06-01 4:41 ` Matthew Garrett
2013-06-01 4:41 ` Matthew Garrett
2013-06-01 11:01 ` Linus Torvalds
2013-06-01 11:01 ` Linus Torvalds
[not found] ` <alpine.LFD.2.03.1306011956350.9068-OR3hLWCBCApQetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
2013-06-01 14:40 ` Matthew Garrett
2013-06-01 14:40 ` Matthew Garrett
2013-05-30 2:38 ` joeyli
2013-05-30 2:38 ` joeyli
2013-05-23 22:23 ` Russ Anderson
2013-05-23 22:23 ` Russ Anderson
[not found] ` <20130523222321.GB31880-sJ/iWh9BUns@public.gmane.org>
2013-05-24 7:45 ` Matt Fleming
2013-05-24 7:45 ` Matt Fleming
[not found] ` <20130524074544.GM14575-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
2013-05-29 20:16 ` Russ Anderson
2013-05-29 20:16 ` Russ Anderson
[not found] ` <20130529201616.GB28027-sJ/iWh9BUns@public.gmane.org>
2013-05-31 14:41 ` H. Peter Anvin
2013-05-31 14:41 ` H. Peter Anvin
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=20130524200539.GA3322@sgi.com \
--to=rja-sj/iwh9buns@public.gmane.org \
--cc=bp-Gina5bIWoIWzQB+pC5nmwQ@public.gmane.org \
--cc=hpa-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=matt-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org \
--cc=matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=matthew.garrett-05XSO3Yj/JvQT0dZR+AlfA@public.gmane.org \
--cc=mingo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org \
--cc=x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
/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.