From patchwork Sun Sep 17 18:12:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 141173 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp2248876vqi; Sun, 17 Sep 2023 11:18:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF/1WyvPMNg4TlNlcnxZ77938jBXLKXl8DdyUVTmGhDQcxBr51c60JAeG0dbrCMga8xIhMP X-Received: by 2002:a05:6a20:7d87:b0:158:17e6:7a6 with SMTP id v7-20020a056a207d8700b0015817e607a6mr9920601pzj.42.1694974696488; Sun, 17 Sep 2023 11:18:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694974696; cv=none; d=google.com; s=arc-20160816; b=eqeCD1U4+daKLmjPjas8SbZE2rJbYPnZiMd3CYWdMjUB0/eB4HBJV17tNSXCXl9jF1 exuswd87agTnA3DleA/26ZNXFN74F5llrgD5M2Z2Gh3OhIH0qXIZdNQIpLk9XbpUDZU6 OHEcHdTVi5eE+DGLlSS8fQaYX1tkKXWO2sy/16XLgBKl+l0lfZZR9zRe7BuuwuzuPUnE lMcc7qbV06M+/cE4tLRi1FpLjEtW81bg169uzLchxQX7MDw36fD6XeryLyKGKJnNnCDh g80+pBDjEJ0UBXyCT428akPALfHzGEIZk2C/y+pM/EyPF8FCIx0kHMWMPbwvzRHiJhmG cWVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=EAP5sltfIcvMA4Q2ijBQ4PWfxzckzT5fgVQ66E1pkdo=; fh=mh/EFXDyWz6SYA4qEbcbMgOZ07AT4DlRJonTEXgTb50=; b=GUfKtbL81xvNUcn2k3uhkL6zjj+YZrUMpbHjmg7Taimzf7TU9VM9MEDTAkWt9DngrF EhAxR6jTaDF365JOuIdfYki39V15SXPufbWTmUHG6jGw6Kp4EfHtrXi07auJ46d2LGZz 3kYJ6XPOwca14TJqEJ3X2axURFGfvVTLYGnpvQ9VePIBC2R0s9Ew9qeTkqzJuaOlYDj2 C3e6HGC3kTTlGv2ZoOh+aLr6ERLKRu2xR8CU7imlycSO5EaHNJrDAOEJQ9eyMMHZ73ue oCP5PSHneqUMetHtYY3AyLWCobpiSagbIJ6hz7dtepq3+4UJyLbFiktnstFrvK0Pxia1 VTMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=CXwEOsj3; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="5/l1GVMC"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id l2-20020a635702000000b0057777451a91si6911238pgb.581.2023.09.17.11.18.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Sep 2023 11:18:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=CXwEOsj3; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="5/l1GVMC"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 8D6F8812A618; Sun, 17 Sep 2023 11:17:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238870AbjIQSNU (ORCPT + 28 others); Sun, 17 Sep 2023 14:13:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238352AbjIQSNC (ORCPT ); Sun, 17 Sep 2023 14:13:02 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F9B6137; Sun, 17 Sep 2023 11:12:56 -0700 (PDT) Date: Sun, 17 Sep 2023 18:12:52 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1694974372; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EAP5sltfIcvMA4Q2ijBQ4PWfxzckzT5fgVQ66E1pkdo=; b=CXwEOsj3Cq0eXdGLZSqGiJ/8RQItPFa3orVAwlFOws8iHOwzibvR/JixfzeR2TyE8YZv9K rsrkGBoAsReuw2q8VflB3mLcGhWUzLQdafXApbkjdLdQMOUC7jyvcdxVfEgvwKrr6pO4DQ HemdHIlFNMEViLz/AYM5UZJ0JOLoEL0TBgrI58h8uXmV/ocRlbhpPn9hwwGHf4Y0L2Q8tr sZEaEuu3WdHlPOLYnDY/IK2akMlOrIFlpzrlYp0K34P0YtJXSvIhO3XXpIsKcBl/Cy1oHy 4DXImyeWMM2pB8qUPDSKn0DHT6NimyjPADKZ8fyDREIkRUefiPbZSBtcNgQsIw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1694974372; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EAP5sltfIcvMA4Q2ijBQ4PWfxzckzT5fgVQ66E1pkdo=; b=5/l1GVMCPIPIz70/jw76Oangr4ZLCZgtBDLYvPo/apb/EmMaQY7whssCCgP66Lc1mQlHa6 AAQBJD4DX4QXwLDA== From: "tip-bot2 for Ard Biesheuvel" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/boot] x86/boot: Grab kernel_info offset from zoffset header directly Cc: Ard Biesheuvel , Ingo Molnar , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230915171623.655440-11-ardb@google.com> References: <20230915171623.655440-11-ardb@google.com> MIME-Version: 1.0 Message-ID: <169497437238.27769.749289405935929274.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sun, 17 Sep 2023 11:17:32 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777155231593322963 X-GMAIL-MSGID: 1777309787397377546 The following commit has been merged into the x86/boot branch of tip: Commit-ID: 2e765c02dcbfc2a8a4527c621a84b9502f6b9bd2 Gitweb: https://git.kernel.org/tip/2e765c02dcbfc2a8a4527c621a84b9502f6b9bd2 Author: Ard Biesheuvel AuthorDate: Fri, 15 Sep 2023 17:16:25 Committer: Ingo Molnar CommitterDate: Sun, 17 Sep 2023 19:48:42 +02:00 x86/boot: Grab kernel_info offset from zoffset header directly Instead of parsing zoffset.h and poking the kernel_info offset value into the header from the build tool, just grab the value directly in the asm file that describes this header. This change has no impact on the resulting bzImage binary. Signed-off-by: Ard Biesheuvel Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230915171623.655440-11-ardb@google.com --- arch/x86/boot/header.S | 2 +- arch/x86/boot/tools/build.c | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S index 6059f87..5575d0f 100644 --- a/arch/x86/boot/header.S +++ b/arch/x86/boot/header.S @@ -526,7 +526,7 @@ pref_address: .quad LOAD_PHYSICAL_ADDR # preferred load addr init_size: .long INIT_SIZE # kernel initialization size handover_offset: .long 0 # Filled in by build.c -kernel_info_offset: .long 0 # Filled in by build.c +kernel_info_offset: .long ZO_kernel_info # End of setup header ##################################################### diff --git a/arch/x86/boot/tools/build.c b/arch/x86/boot/tools/build.c index 10b0207..14ef13f 100644 --- a/arch/x86/boot/tools/build.c +++ b/arch/x86/boot/tools/build.c @@ -59,7 +59,6 @@ static unsigned long efi32_stub_entry; static unsigned long efi64_stub_entry; static unsigned long efi_pe_entry; static unsigned long efi32_pe_entry; -static unsigned long kernel_info; static unsigned long _end; /*----------------------------------------------------------------------*/ @@ -337,7 +336,6 @@ static void parse_zoffset(char *fname) PARSE_ZOFS(p, efi64_stub_entry); PARSE_ZOFS(p, efi_pe_entry); PARSE_ZOFS(p, efi32_pe_entry); - PARSE_ZOFS(p, kernel_info); PARSE_ZOFS(p, _end); p = strchr(p, '\n'); @@ -419,8 +417,6 @@ int main(int argc, char ** argv) update_pecoff_text(setup_sectors * 512, i + (sys_size * 16)); efi_stub_entry_update(); - /* Update kernel_info offset. */ - put_unaligned_le32(kernel_info, &buf[0x268]); crc = partial_crc32(buf, i, crc); if (fwrite(buf, 1, i, dest) != i)