Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1377251rwl; Wed, 12 Apr 2023 11:51:38 -0700 (PDT) X-Google-Smtp-Source: AKy350acjt3D4AyitVbdVO4UClHa3aUOUWofHtAVEpzFGBTiM1HIHgxbpyQhX4jUD9KWUu6GqzJe X-Received: by 2002:aa7:c2c9:0:b0:504:8173:ec8c with SMTP id m9-20020aa7c2c9000000b005048173ec8cmr453375edp.13.1681325498057; Wed, 12 Apr 2023 11:51:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681325498; cv=none; d=google.com; s=arc-20160816; b=F3kCE5WRBTAU/6YhnbGKCSH00J/Dl8Mrh3KJBHg/QceS5ML/muBRq4WKMjZvdxTw+9 TZna5r4sYDKZsfpD9Wgbd3FcEMPAsVISsxjA3FxXtgpJlJsyF1wu3KcA/YMAqKKawky3 7Y6ANsmRB7NSqYoZWjY1axqjRhd4TiwK2q0oDyY8Tc3p6WeagicDIT6lj4sQweMWnUwo 2O602idNZQoRaj8YQDAl42mx7/XQyZ+UXAZetaqsV0aEcC8BcZkqgp8JBNH45Cv2BnuA m64SSKF2biw3VgRzEvudPOiScLJ280jRi7YlC7vOrI0veUArVua2XgfjiX1JW+n4HbsM J19A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Y9jW8lTjmlnLP+VaTuDA/cPZo6I/NjUdF+u0UYf+p20=; b=ZUAD3QRyVo8eQQJtx4e1W3PRuvmnbmJN7UJ/t3AKc3hbjAkbtrFrzhJEEGa5wnp/vw iRAvmHN+ZNtNF57hHZb52Cx1p0Kl/nvuil1uG3pV+l/kk1YKCwiuhK7JgYARbvIMZ/y4 YTlSlplXVKOdhkVZMaoWJ4qMXAtwN078xESJuxFXRpF9trbeEEpCWby4/xd2uW+pJkMY l/t9n/Mw2C6UWwxtUlWrnln7XWObFcq3/UCtfpjM/yEtROroVtbblpJrlb11N9ynAU49 rSmDeAq/OBAA/gkHRRKQFEQItKetxBU94fS6cH14Qsl0m3y+zkZxm6G8ve3ZcVzh1jN9 R51A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=ChDtRmpS; 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=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g15-20020aa7c58f000000b00504e1768d21si2779121edq.168.2023.04.12.11.51.10; Wed, 12 Apr 2023 11:51:38 -0700 (PDT) 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=@gmail.com header.s=20221208 header.b=ChDtRmpS; 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=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230231AbjDLSpc (ORCPT + 99 others); Wed, 12 Apr 2023 14:45:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230170AbjDLSpS (ORCPT ); Wed, 12 Apr 2023 14:45:18 -0400 Received: from mail-oa1-x30.google.com (mail-oa1-x30.google.com [IPv6:2001:4860:4864:20::30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0842B5B8D for ; Wed, 12 Apr 2023 11:45:15 -0700 (PDT) Received: by mail-oa1-x30.google.com with SMTP id 586e51a60fabf-1878a0bf68fso324251fac.7 for ; Wed, 12 Apr 2023 11:45:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681325114; x=1683917114; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Y9jW8lTjmlnLP+VaTuDA/cPZo6I/NjUdF+u0UYf+p20=; b=ChDtRmpS13uPH3Dv861bG+B2sL8tWVRy7GRpQmfuTTZCZlMDYKwSR6qtBTeOI62nvy jbs85WVcDZ9235GtwFnK3iMZxxy41JM44CrQuti5ws0GgBPHWLXig18nviJyCCdZou5D lfzOPN84k2YI0JSqg+JLBX8gBxsrQxRVqxF5jE7opuA7F0guOlaNb6rIVpqBPt669JHx 7PCog0ZqwIAeih6+gKh4nS8hzwx5r3XNsNS+FiAUVJyKCPV1FAv7VCyuEtUKRH1qOed/ 7v2BS0rpVsjF+4QT3qNX0Eyn9rPckIgEcbHil1Mqu+a46qgg6hQpnmjEmeCbFVqRoua9 kZsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681325114; x=1683917114; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Y9jW8lTjmlnLP+VaTuDA/cPZo6I/NjUdF+u0UYf+p20=; b=OZB3hg+96QCcjGBTEDjp6Hvgb738Z6jHvRo5jietZNpabl+5uzkZvWXcGCbqL+L249 GbM15CexMGZzY6YDV0aeq7x8VUJcb86EKWIxLCb0tlXccg9J8+7KNHjVDeyufu2NToV1 FGhI13KaPA7lhd7HV/u2kUIPYSbOP5qTratqKriK/k4IkBpQlnwZv1uog0sLyOvbraNu 3tGd+uWAhKnjer5mv+M44yTkefOdr8NY3pZh5Dw1KX1YnN0Sw1HzRK9H3pDVt4pfKEN5 ArlFgwRAdbOey1POotmX4pQR7GJ+AEdNQYEgC7W6XyoyqOHEHn49GUok4fLC6puww6IQ jZKA== X-Gm-Message-State: AAQBX9eH2ZdyEPDtc5mtDJ2PXhWg+96kGcQ3k2ujzOiA/4/H9YQgg7O2 SyhthdSa/qoVJd+yOnpsVGx1yX7erA== X-Received: by 2002:a05:6870:a116:b0:187:860f:ea31 with SMTP id m22-20020a056870a11600b00187860fea31mr776207oae.44.1681325114174; Wed, 12 Apr 2023 11:45:14 -0700 (PDT) Received: from citadel.. (075-129-116-198.res.spectrum.com. [75.129.116.198]) by smtp.gmail.com with ESMTPSA id w24-20020a9d77d8000000b00690e990e61asm6706020otl.14.2023.04.12.11.45.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Apr 2023 11:45:13 -0700 (PDT) From: Brian Gerst To: linux-kernel@vger.kernel.org, x86@kernel.org Cc: Thomas Gleixner , Borislav Petkov , "H . Peter Anvin" , Peter Zijlstra , Ingo Molnar , Brian Gerst Subject: [PATCH v2 5/6] x86/boot: Use copied boot data in __startup_64() Date: Wed, 12 Apr 2023 14:45:01 -0400 Message-Id: <20230412184502.145289-6-brgerst@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230412184502.145289-1-brgerst@gmail.com> References: <20230412184502.145289-1-brgerst@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 Use the copied version instead of the original real mode data. Signed-off-by: Brian Gerst --- arch/x86/include/asm/setup.h | 2 +- arch/x86/kernel/head64.c | 4 ++-- arch/x86/kernel/head_64.S | 2 -- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h index 47eac5d877a8..f6c04b137d67 100644 --- a/arch/x86/include/asm/setup.h +++ b/arch/x86/include/asm/setup.h @@ -49,7 +49,7 @@ extern unsigned long saved_video_mode; extern void reserve_standard_io_resources(void); extern void i386_reserve_resources(void); -extern unsigned long __startup_64(unsigned long physaddr, struct boot_params *bp); +extern unsigned long __startup_64(unsigned long physaddr); extern void startup_64_setup_env(unsigned long physbase); extern void early_setup_idt(void); extern void __init do_early_exception(struct pt_regs *regs, int trapnr); diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c index 9be8ce41d021..c7d3976a04d6 100644 --- a/arch/x86/kernel/head64.c +++ b/arch/x86/kernel/head64.c @@ -176,9 +176,9 @@ static unsigned long __head sme_postprocess_startup(struct boot_params *bp, pmdv * boot-time crashes. To work around this problem, every global pointer must * be adjusted using fixup_pointer(). */ -unsigned long __head __startup_64(unsigned long physaddr, - struct boot_params *bp) +unsigned long __head __startup_64(unsigned long physaddr) { + struct boot_params *bp = fixup_pointer(&boot_params, physaddr); unsigned long load_delta, *p; unsigned long pgtable_flags; pgdval_t *pgd; diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S index 83fb0dc97ba5..c7b2ef379f42 100644 --- a/arch/x86/kernel/head_64.S +++ b/arch/x86/kernel/head_64.S @@ -113,9 +113,7 @@ SYM_CODE_START_NOALIGN(startup_64) * programmed into CR3. */ leaq _text(%rip), %rdi - pushq %rsi call __startup_64 - popq %rsi /* Form the CR3 value being sure to include the CR3 modifier */ addq $(early_top_pgt - __START_KERNEL_map), %rax -- 2.39.2