linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ardb@kernel.org>
To: Guenter Roeck <linux@roeck-us.net>
Cc: linux-efi <linux-efi@vger.kernel.org>,
	Arvind Sankar <nivedita@alum.mit.edu>,
	"the arch/x86 maintainers" <x86@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 16/18] efi: add 'runtime' pointer to struct efi
Date: Tue, 3 Mar 2020 17:39:43 +0100	[thread overview]
Message-ID: <CAKv+Gu_dG2dsrNBWG3fV5S40y6iRGSj7MO2gbtZhqEUg5mXgyQ@mail.gmail.com> (raw)
In-Reply-To: <20200303160353.GA20372@roeck-us.net>

On Tue, 3 Mar 2020 at 17:03, Guenter Roeck <linux@roeck-us.net> wrote:
>
> On Sun, Feb 16, 2020 at 07:23:32PM +0100, Ard Biesheuvel wrote:
> > Instead of going through the EFI system table each time, just copy the
> > runtime services table pointer into struct efi directly. This is the
> > last use of the system table pointer in struct efi, allowing us to
> > drop it in a future patch, along with a fair amount of quirky handling
> > of the translated address.
> >
> > Note that usually, the runtime services pointer changes value during
> > the call to SetVirtualAddressMap(), so grab the updated value as soon
> > as that call returns. (Mixed mode uses a 1:1 mapping, and kexec boot
> > enters with the updated address in the system table, so in those cases,
> > we don't need to do anything here)
> >
> > Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
>
> This patch results in a crash with i386 efi boots if PAE (CONFIG_HIGHMEM64G=y)
> is enabled. Bisect and crash logs attached. There is also a warning which
> I don't recall seeing before, but it may not be caused by this patch
> (I didn' bisect the warning). The warning is seen with all i386:efi boots,
> not only when PAE is enabled. The warning log is also attached.
>
> Guenter
>
> ---
> Qemu command line:
>
> qemu-system-i386 -kernel arch/x86/boot/bzImage -M pc -cpu Westmere \
>         -no-reboot -m 256 -snapshot \
>         -bios OVMF-pure-efi-32.fd \
>         -usb -device usb-storage,drive=d0 \
>         -drive file=rootfs.ext2,if=none,id=d0,format=raw \
>         --append 'earlycon=uart8250,io,0x3f8,9600n8 panic=-1 slub_debug=FZPUA root=/dev/sda rootwait mem=256M console=ttyS0' \
>         -nographic
>

I am failing to reproduce this. Do you have a .config and a copy of
OVMF-pure-efi-32.fd anywhere?


> ---
> # bad: [e78aa714e3261e23c7413fd6e719820e271ff128] Add linux-next specific files for 20200303
> # good: [98d54f81e36ba3bf92172791eba5ca5bd813989b] Linux 5.6-rc4
> git bisect start 'HEAD' 'v5.6-rc4'
> # good: [a2a09dd01b6aa08d10393c8d917de75787e3132e] Merge remote-tracking branch 'crypto/master'
> git bisect good a2a09dd01b6aa08d10393c8d917de75787e3132e
> # good: [5a8e63833f9ef8c26c42220a839bbb9687bfe71b] Merge remote-tracking branch 'spi/for-next'
> git bisect good 5a8e63833f9ef8c26c42220a839bbb9687bfe71b
> # bad: [e02ce27a4ed5d49b92cc5269c15a1acdd9bacd9b] Merge remote-tracking branch 'thunderbolt/next'
> git bisect bad e02ce27a4ed5d49b92cc5269c15a1acdd9bacd9b
> # bad: [943cba4a99fe46ebca32b66bedb867fddeff9a7b] Merge remote-tracking branch 'edac/edac-for-next'
> git bisect bad 943cba4a99fe46ebca32b66bedb867fddeff9a7b
> # good: [a47d8a0913d007555df3cde040091305878b45b1] Merge branch 'locking/kcsan'
> git bisect good a47d8a0913d007555df3cde040091305878b45b1
> # bad: [fe4db90a80cd12ebe4efe385d40d6636330149ed] efi: Add support for EFI_RT_PROPERTIES table
> git bisect bad fe4db90a80cd12ebe4efe385d40d6636330149ed
> # good: [0255973bd6e471e1c34284328098bfab89840df3] efi/libstub: Describe efi_relocate_kernel()
> git bisect good 0255973bd6e471e1c34284328098bfab89840df3
> # good: [686312927b13fc30b23b0e0f9be097c292343048] efi/ia64: Switch to efi_config_parse_tables()
> git bisect good 686312927b13fc30b23b0e0f9be097c292343048
> # bad: [223e3ee56f77570157aba8cc550208af430a869b] efi/x86: add headroom to decompressor BSS to account for setup block
> git bisect bad 223e3ee56f77570157aba8cc550208af430a869b
> # good: [9cd437ac0ef4f324a92e2579784b03bb487ae7fb] efi/x86: Make fw_vendor, config_table and runtime sysfs nodes x86 specific
> git bisect good 9cd437ac0ef4f324a92e2579784b03bb487ae7fb
> # bad: [59f2a619a2db86111e8bb30f349aebff6eb75baa] efi: Add 'runtime' pointer to struct efi
> git bisect bad 59f2a619a2db86111e8bb30f349aebff6eb75baa
> # good: [09308012d8546dda75e96c02bed19e2ba1e875fd] efi/x86: Merge assignments of efi.runtime_version
> git bisect good 09308012d8546dda75e96c02bed19e2ba1e875fd
> # first bad commit: [59f2a619a2db86111e8bb30f349aebff6eb75baa] efi: Add 'runtime' pointer to struct efi
>
> ---
> Crash:
>
> [    1.022602] ------------[ cut here ]------------
> [    1.022602] kernel BUG at arch/x86/mm/pat/set_memory.c:348!
> [    1.022602] invalid opcode: 0000 [#1] SMP PTI
> [    1.022602] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G        W         5.6.0-rc4-next-20200303 #1
> [    1.022602] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 0.0.0 02/06/2015
> [    1.022602] EIP: change_page_attr_set_clr+0x26c/0x280
> [    1.022602] Code: c1 eb 05 c1 e8 03 83 e0 03 09 c3 0f b6 9b 40 89 83 c8 85 db 0f 95 45 a3 e9 b1 fe ff ff 80 3d 88 ef 93 c8 00 0f 85 b7 fe ff ff <0f> 0b e8 6d 8b 00 00 8d b4 26 00 00 00 00 8d b6 00 00 00 00 55 89
> [    1.022602] EAX: 00000046 EBX: 00000000 ECX: 00000000 EDX: 00000000
> [    1.022602] ESI: 00000000 EDI: 00000000 EBP: c880fef4 ESP: c880fe94
> [    1.022602] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 EFLAGS: 00000046
> [    1.022602] CR0: 80050033 CR2: ffbff000 CR3: 08a36000 CR4: 000006b0
> [    1.022602] Call Trace:
> [    1.022602]  ? memremap+0x1d/0x1b0
> [    1.022602]  set_memory_x+0x39/0x40
> [    1.022602]  efi_set_executable+0x5a/0x68
> [    1.022602]  runtime_code_page_mkexec+0x2e/0x39
> [    1.022602]  efi_runtime_update_mappings+0x11/0x14
> [    1.022602]  efi_enter_virtual_mode+0x36c/0x388
> [    1.022602]  start_kernel+0x3b7/0x443
> [    1.022602]  i386_start_kernel+0x43/0x45
> [    1.022602]  startup_32_smp+0x164/0x168
> [    1.022602] Modules linked in:
> [    1.022602] ---[ end trace 9d84af499f5da089 ]---
> [    1.022602] EIP: change_page_attr_set_clr+0x26c/0x280
> [    1.022602] Code: c1 eb 05 c1 e8 03 83 e0 03 09 c3 0f b6 9b 40 89 83 c8 85 db 0f 95 45 a3 e9 b1 fe ff ff 80 3d 88 ef 93 c8 00 0f 85 b7 fe ff ff <0f> 0b e8 6d 8b 00 00 8d b4 26 00 00 00 00 8d b6 00 00 00 00 55 89
> [    1.022602] EAX: 00000046 EBX: 00000000 ECX: 00000000 EDX: 00000000
> [    1.022602] ESI: 00000000 EDI: 00000000 EBP: c880fef4 ESP: c880fe94
> [    1.022602] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 EFLAGS: 00000046
> [    1.022602] CR0: 80050033 CR2: ffbff000 CR3: 08a36000 CR4: 000006b0
> [    1.022602] Kernel panic - not syncing: Attempted to kill the idle task!
>
> ---
> Warning:
>
> [    0.645996] ------------[ cut here ]------------
> [    0.645996] WARNING: CPU: 0 PID: 0 at arch/x86/kernel/traps.c:811 do_debug+0x161/0x1e0
> [    0.645996] Modules linked in:
> [    0.645996] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.6.0-rc4-next-20200303 #1
> [    0.645996] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
> [    0.645996] EIP: do_debug+0x161/0x1e0
> [    0.645996] Code: 84 2b ff ff ff eb da 66 90 e8 cb 89 0c 00 e9 35 ff ff ff 8d b6 00 00 00 00 0f b7 53 34 83 e2 03 66 83 fa 03 0f 84 79 ff ff ff <0f> 0b 80 e4 bf 89 86 3c 0d 00 00 f0 80 0e 10 81 63 38 ff fe ff ff
> [    0.645996] EAX: 00004000 EBX: cd3f9ec8 ECX: 00000000 EDX: 00000000
> [    0.645996] ESI: cd408e80 EDI: 00004000 EBP: cd3f9ec0 ESP: cd3f9ea4
> [    0.645996] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 EFLAGS: 00000093
> [    0.645996] CR0: 80050033 CR2: ffd19000 CR3: 0d615000 CR4: 00000690
> [    0.645996] Call Trace:
> [    0.645996]  ? do_error_trap+0xd0/0xd0
> [    0.645996]  common_exception+0x147/0x162
> [    0.645996] EIP: trace_hardirqs_off+0x0/0x100
> [    0.645996] Code: e8 85 3b f9 ff 8b 55 ec b8 60 34 43 cd e8 68 a1 f8 ff 64 ff 0d e4 47 5f cd 8b 5d 04 e9 49 ff ff ff 0f 0b eb 91 8d 74 26 00 90 <55> 89 e5 57 56 53 83 ec 08 64 a1 70 6e 60 cd 85 c0 0f 85 95 00 00
> [    0.645996] EAX: 00000000 EBX: 000001e0 ECX: d0863f10 EDX: 80050033
> [    0.645996] ESI: 00000000 EDI: 00000030 EBP: cd3f9f48 ESP: cd3f9f24
> [    0.645996] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 EFLAGS: 000001c2
> [    0.645996]  ? do_error_trap+0xd0/0xd0
> [    0.645996]  ? trace_hardirqs_on_caller+0x100/0x100
> [    0.645996]  ? efi_set_virtual_address_map+0x7d/0xb8
> [    0.645996]  efi_enter_virtual_mode+0x340/0x380
> [    0.645996]  start_kernel+0x3a6/0x432
> [    0.645996]  i386_start_kernel+0x43/0x45
> [    0.645996]  startup_32_smp+0x164/0x168
> [    0.645996] irq event stamp: 3346
> [    0.645996] hardirqs last  enabled at (3345): [<cc3e6ba5>] __slab_alloc.constprop.99+0x45/0x60
> [    0.645996] hardirqs last disabled at (3346): [<cd568df9>] efi_set_virtual_address_map+0x51/0xb8
> [    0.645996] softirqs last  enabled at (3298): [<ccf3c155>] __do_softirq+0x2c5/0x3bb
> [    0.645996] softirqs last disabled at (3291): [<cc21fafd>] call_on_stack+0xd/0x50
> [    0.645996] ---[ end trace 4d4ba9fe34c1e861 ]---
>

  reply	other threads:[~2020-03-03 16:39 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-16 18:23 [PATCH 00/18] efi: clean up contents of struct efi Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 01/18] efi: drop handling of 'boot_info' configuration table Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 02/18] efi/ia64: move HCDP and MPS table handling into IA64 arch code Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 03/18] efi: move UGA and PROP table handling to x86 code Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 04/18] efi: make rng_seed table handling local to efi.c Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 05/18] efi: move mem_attr_table out of struct efi Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 06/18] efi: make memreserve table handling local to efi.c Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 07/18] efi: merge EFI system table revision and vendor checks Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 08/18] efi/ia64: use existing helpers to locate ESI table Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 09/18] efi/ia64: use local variable for EFI system table address Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 10/18] efi/ia64: switch to efi_config_parse_tables() Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 11/18] efi: make efi_config_init() x86 only Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 12/18] efi: clean up config_parse_tables() Ard Biesheuvel
2020-02-16 19:12   ` Arvind Sankar
2020-02-17  8:32     ` Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 13/18] efi/x86: remove runtime table address from kexec EFI setup data Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 14/18] efi/x86: make fw_vendor, config_table and runtime sysfs nodes x86 specific Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 15/18] efi/x86: merge assignments of efi.runtime_version Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 16/18] efi: add 'runtime' pointer to struct efi Ard Biesheuvel
2020-03-03 16:03   ` Guenter Roeck
2020-03-03 16:39     ` Ard Biesheuvel [this message]
2020-03-03 17:53       ` Guenter Roeck
2020-03-03 18:01         ` Ard Biesheuvel
2020-03-03 18:14           ` Ard Biesheuvel
2020-03-03 20:30             ` Guenter Roeck
2020-03-03 21:40               ` Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 17/18] efi/arm: drop unnecessary references to efi.systab Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 18/18] efi/x86: drop 'systab' member from struct efi Ard Biesheuvel
2020-02-16 18:31 ` [PATCH 00/18] efi: clean up contents of " Ard Biesheuvel
2020-02-18 19:46   ` Luck, Tony
2020-02-18 22:08     ` Ard Biesheuvel

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=CAKv+Gu_dG2dsrNBWG3fV5S40y6iRGSj7MO2gbtZhqEUg5mXgyQ@mail.gmail.com \
    --to=ardb@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=nivedita@alum.mit.edu \
    --cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).