From patchwork Thu Nov 24 08:12:12 2022 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: 25358 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3258639wrr; Thu, 24 Nov 2022 00:14:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf4VgR0gWnHPGfZwN11JOKr4UNZHAbzjcDU0nu5EGvRUNUU69+FnoWOnIoM7oWuomFlLKEqi X-Received: by 2002:a63:4b10:0:b0:476:e12f:f852 with SMTP id y16-20020a634b10000000b00476e12ff852mr10856192pga.328.1669277660677; Thu, 24 Nov 2022 00:14:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669277660; cv=none; d=google.com; s=arc-20160816; b=bZA4uFlvRZDHQwpYpm8WXo+Jqaxm8qQPllGPPooiFPXPvb14I8WWUcayTmkxjm67BH FZ/fh1WyMYTPhFzPCb0EqjBVmoxKCi2BZiSUMeYOx8upjhVtBjyGme6ir4imu4BcZ6Xf kaY7w8uP1x3/NVcM6fS6RwnxhRKj4Pv62qQOitu8X+AmGFtYdJ5PZgqDsPQAMOsJduMV 9o/BkmkV6wyADENO1msFGWCicDQJcSETN0yXS8f/M/dc1EVjj8bWQShDSJLwxeL6bQlx 0Oo/n57xGlEah1qq3I6hMWTW0DJyh0zUaVQCVunMXjs1XcJAAqERwd439hdr7lmr+d2E k1Fw== 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=oWRWF85M+SfA0MipawGR7I4145ArwGZMy5HP1Q2cy7c=; b=PlJ7ZTkIV/n7QdYABOHwBKo32Ox2KGIm3mD6D2kQ6j2o0yVNdYE5nk+UwmduTpsMWC VXcNll6T61ZHb1tqDK7OY2tCVdaAzAaEuJdXoisQpqhg2n4kQoofp7wcZjik5z1Ruped DJY3Y1PZSgTQH/8vh8whAfxNpv/ofDKnjWOYHSNvPEGKgI4wwkkVcvoSenCkCS5Tuc6g BCwt1P3pVWHhhXH9AusPy0c4e+XJp8c9iPd9WiAA/O1m9sduTSiyz1RJvhYoc4JS+IC1 r0OzwV9TLXTFYWqBOOq7AqRQVaNOEdkZd/bDO5fszPXbfdtiGu725owZj6jw4Lg8nKy9 LkIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=eM4vKEN6; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o24-20020a17090aac1800b0020982a8dbf2si617239pjq.96.2022.11.24.00.14.07; Thu, 24 Nov 2022 00:14:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=eM4vKEN6; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229988AbiKXINr (ORCPT + 99 others); Thu, 24 Nov 2022 03:13:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229849AbiKXIMl (ORCPT ); Thu, 24 Nov 2022 03:12:41 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31605E8703; Thu, 24 Nov 2022 00:12:15 -0800 (PST) Date: Thu, 24 Nov 2022 08:12:12 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669277533; 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=oWRWF85M+SfA0MipawGR7I4145ArwGZMy5HP1Q2cy7c=; b=eM4vKEN6OcPGru4fPEtHQn1aUrsizkZJ+MXGUVCmQo5l1xH6JzpDwly2DE723oRKZpO+RU Lkn13vOKf7LpC2N5sYsxre7q9A1ZxEg6k+ggVD8clph7vcE74YbE6MkowOcd1mEsdhJ2ty 4VJbnoK3Dpl0drL8m128WvhdMg7/7DJUHs9WmSHDDh7pN+KfuXByRxmwI6sIoyVsTekMqC jN8HXJDFQEEgDVkD9/ymokvlLGWG5a3SlpSVbMjk6TkTgpgLPi4nOubCcGrUAU9f6Kfv0p 5IqTPV/0aaGbvyJRJ7IYGWUpaSjuyAMvXD0VdU/MFA3Q2sSUzj8M4YOM15QguQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669277533; 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=oWRWF85M+SfA0MipawGR7I4145ArwGZMy5HP1Q2cy7c=; b=wYmD6+h490AyCCg3Zdedgd8fFjrA5yfhJIDnN0ZfauvEoS6yUOpLe2RCZ59hEGokUCuG6V 1B3gbN3LmvjnrxCw== 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/compressed: Move efi32_pe_entry into .text section Cc: Ard Biesheuvel , Borislav Petkov , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20221122161017.2426828-5-ardb@kernel.org> References: <20221122161017.2426828-5-ardb@kernel.org> MIME-Version: 1.0 Message-ID: <166927753244.4906.1655337476937933729.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750364492239567282?= X-GMAIL-MSGID: =?utf-8?q?1750364492239567282?= The following commit has been merged into the x86/boot branch of tip: Commit-ID: 91592b5c0c2f076ff9d8cc0c14aa563448ac9fc4 Gitweb: https://git.kernel.org/tip/91592b5c0c2f076ff9d8cc0c14aa563448ac9fc4 Author: Ard Biesheuvel AuthorDate: Tue, 22 Nov 2022 17:10:04 +01:00 Committer: Borislav Petkov CommitterDate: Tue, 22 Nov 2022 19:23:01 +01:00 x86/boot/compressed: Move efi32_pe_entry into .text section Move efi32_pe_entry() into the .text section, so that it can be moved out of head_64.S and into a separate compilation unit in a subsequent patch. Signed-off-by: Ard Biesheuvel Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20221122161017.2426828-5-ardb@kernel.org --- arch/x86/boot/compressed/head_64.S | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S index f3d7de5..9dd9010 100644 --- a/arch/x86/boot/compressed/head_64.S +++ b/arch/x86/boot/compressed/head_64.S @@ -770,7 +770,7 @@ SYM_DATA(efi_is64, .byte 1) #define BS32_handle_protocol 88 // offsetof(efi_boot_services_32_t, handle_protocol) #define LI32_image_base 32 // offsetof(efi_loaded_image_32_t, image_base) - __HEAD + .text .code32 SYM_FUNC_START(efi32_pe_entry) /* @@ -792,12 +792,11 @@ SYM_FUNC_START(efi32_pe_entry) call 1f 1: pop %ebx - subl $ rva(1b), %ebx /* Get the loaded image protocol pointer from the image handle */ leal -4(%ebp), %eax pushl %eax // &loaded_image - leal rva(loaded_image_proto)(%ebx), %eax + leal (loaded_image_proto - 1b)(%ebx), %eax pushl %eax // pass the GUID address pushl 8(%ebp) // pass the image handle @@ -826,13 +825,13 @@ SYM_FUNC_START(efi32_pe_entry) movl 12(%ebp), %edx // sys_table movl -4(%ebp), %esi // loaded_image movl LI32_image_base(%esi), %esi // loaded_image->image_base - movl %ebx, %ebp // startup_32 for efi32_pe_stub_entry + leal (startup_32 - 1b)(%ebx), %ebp // runtime address of startup_32 /* * We need to set the image_offset variable here since startup_32() will * use it before we get to the 64-bit efi_pe_entry() in C code. */ - subl %esi, %ebx - movl %ebx, rva(image_offset)(%ebp) // save image_offset + subl %esi, %ebp // calculate image_offset + movl %ebp, (image_offset - 1b)(%ebx) // save image_offset xorl %esi, %esi jmp efi32_entry // pass %ecx, %edx, %esi // no other registers remain live