Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp3592364ybf; Tue, 3 Mar 2020 08:41:41 -0800 (PST) X-Google-Smtp-Source: ADFU+vv/2I/rZ0pDdBtt182NwNcvFhvc6HTUatobm9M9XUdqhKqNx6O29OOYnHL4oZy6fS3aTYl+ X-Received: by 2002:a05:6830:2102:: with SMTP id i2mr3934670otc.123.1583253701183; Tue, 03 Mar 2020 08:41:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583253701; cv=none; d=google.com; s=arc-20160816; b=kr+xh9Z82Y2lO5Re1RGoIKLj4a6FDLEkqKIFffQgn+F51mtcHHmTdmi/jr5qv09rvY +hZex62AJitYZWW06uyoH5jBJVg4HjCsnEcibkjtIhtfPDyuKsMCXVjNSpk6NFhPxMzE WhksSdusTnXwrMU7319ckrmGNdMIzshtGuLFcY/RMC9IbE3kd0Dvi/P2+lkb2EAgLMvu IjYHV9AZJfH3PkSRybsk38MEPxG9jvcyUSQj3OAlryEkXY6Nh8eNUnMsP2bOLIGsAPoX T5gQlSuCZRsLcw5qGgLxKckMMfp23/1P/NABoGVy3ZTN0FIj3LsbLo2gLyEJgFJdGaTH MNyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=tkJOBp/r1XLnF90tu+H1S3iS+2z8ILNY8C/4wpcUNQE=; b=HKqvKPZVefYz1M61b4D1Dv7OR4DR3kRAE1ZMYs6HAB0NCNAvpmk3qNgdagLhLPo0EY fef+mdd4Hifm95h3CIrHPvBiTjKUAEmksz2bUHTgpo+5m4UtrwKYNDE7MVPzZxrYvouR Hbi3QYVt0oPDNsSsXvoamJ94fFL3AvZn+e/BPGIWfYv4JQc1KeN508VBa/sCpc3sTvSw HjGgLpf7rlumkQTiCW1A3YWRHxYJSk7+5H4Y5zLGd8gVtFTfoWADvcESegjy56g7X7Qh oFcpbDfDAzCPfrtNISc8dFD5FZp3T4K3dCkrNFsKx4shKMs/aeIfBIe5ThoF55EYm0W4 sM0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="kPQa1/p3"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s128si8164984oig.204.2020.03.03.08.41.28; Tue, 03 Mar 2020 08:41:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="kPQa1/p3"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729335AbgCCQj5 (ORCPT + 99 others); Tue, 3 Mar 2020 11:39:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:48968 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729416AbgCCQj5 (ORCPT ); Tue, 3 Mar 2020 11:39:57 -0500 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BE82D217F4 for ; Tue, 3 Mar 2020 16:39:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583253596; bh=zhaz8a1PzXVqJb9FuQ3w7HBH+VPURj1yIscuvDbYu+0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=kPQa1/p3XwXvjfOHz8UPbUkwjOnBMbPI7fviNZJ+lUqL8kZH0ASN37vgy7iS7aNYY pe1e9oRbQOiLcuRNkKY11bYAhaRvpnv7V1d1HmxbLQ4VDnzHAT76isGbvPCj159wvj EzgpY0vHLJ1ZYtVRHaLgwRVA/w0S4EEZndvayeOc= Received: by mail-wr1-f51.google.com with SMTP id r7so5232095wro.2 for ; Tue, 03 Mar 2020 08:39:55 -0800 (PST) X-Gm-Message-State: ANhLgQ0Wk9n3cqTE5U8x2e2Jq/K5GdLkvVa8v6bvEe/rq2U7/bT/b9UC O7UA3l0Qvu8/I0EJJMSDHj+XKjr5MSaF937z3ulpFQ== X-Received: by 2002:a5d:6051:: with SMTP id j17mr6185289wrt.151.1583253594066; Tue, 03 Mar 2020 08:39:54 -0800 (PST) MIME-Version: 1.0 References: <20200216182334.8121-1-ardb@kernel.org> <20200216182334.8121-17-ardb@kernel.org> <20200303160353.GA20372@roeck-us.net> In-Reply-To: <20200303160353.GA20372@roeck-us.net> From: Ard Biesheuvel Date: Tue, 3 Mar 2020 17:39:43 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 16/18] efi: add 'runtime' pointer to struct efi To: Guenter Roeck Cc: linux-efi , Arvind Sankar , "the arch/x86 maintainers" , Linux Kernel Mailing List , linux-arm-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 3 Mar 2020 at 17:03, Guenter Roeck 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 > > 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): [] __slab_alloc.constprop.99+0x45/0x60 > [ 0.645996] hardirqs last disabled at (3346): [] efi_set_virtual_address_map+0x51/0xb8 > [ 0.645996] softirqs last enabled at (3298): [] __do_softirq+0x2c5/0x3bb > [ 0.645996] softirqs last disabled at (3291): [] call_on_stack+0xd/0x50 > [ 0.645996] ---[ end trace 4d4ba9fe34c1e861 ]--- >