Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1376653rwl; Wed, 12 Apr 2023 11:51:00 -0700 (PDT) X-Google-Smtp-Source: AKy350a005Dv9LD4NCwLP7VzEquCjxHFVJ65n5VuzJCzH9WhYHanUtrkSqo0+UGlu5rMZRxx0yhY X-Received: by 2002:aa7:d30d:0:b0:4fc:6475:d249 with SMTP id p13-20020aa7d30d000000b004fc6475d249mr2877516edq.3.1681325459749; Wed, 12 Apr 2023 11:50:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681325459; cv=none; d=google.com; s=arc-20160816; b=UA+a+lG6+ufem0hFPWDl2aj23A9xHYfe14v4snkeWRWtAGm44vdK351Ns4xAQo9KS6 3Zdnch5tk2I0fwlS+zeVeWXaR+AzB6UbqS1ERvjh5/2sn6eZJHkeQoBuy6S5uOsFQqnP 4LlgSryx1GSDf1tG1ktYUdpXMJ1Rk2NY0qNSu0NHk2FTTZ7CmPvLsTr+1r55oPjCFbgr QdiiwgI1n5ldcFVT9b6XaizNNI+YLWG/TJtY50vjZcFLTa5eTVI91JuMaOva6tJHQAkw n6nBYjIpbxQjrP9PvYENtVQpe6T8qGxL8ISLMWRdtS2ywoLTM7Nedhr3y8cxkqH5lxF2 n5JA== 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=gohAHfVouxgH+hJvQeBGsiMrbLKAn/aPyvmRUBO2xEM=; b=LRiIY/F5K4+WURyPFsJvjTlTE4jIW3u/DYVdUpdzD+GcsDaybFeIWPvTignSIemCUI SfBTtvGujVtA2FTwjUrTBiIirA6VjNXLba6goptZcBAOaNMAWNcQ9k022MD+G1FYOezi /1YtR6HjZOX8gw9M6v4I0OCfgfbkx8ejb49qG8mMnd6+NsLC/kktRRQMBfO1i7+Tl+uq 3ihip+5t4L4H445vEaLLq+x5w6Rh5ww8Dxa7zsk5uaxIyI/uF8U6nrEiO73hsMuM8wJw s2Wbb3hsXb63dX8D0JUAr6JkDezCXAm2J/o3muCdoEvE8qhyu2wsfJ4CMJsg/fxFlXjs Zh0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=YW6v+uz3; 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 v4-20020aa7cd44000000b0050634db4f1dsi556784edw.588.2023.04.12.11.50.35; Wed, 12 Apr 2023 11:50:59 -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=YW6v+uz3; 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 S230142AbjDLSpW (ORCPT + 99 others); Wed, 12 Apr 2023 14:45:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229964AbjDLSpQ (ORCPT ); Wed, 12 Apr 2023 14:45:16 -0400 Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E9E340F9 for ; Wed, 12 Apr 2023 11:45:12 -0700 (PDT) Received: by mail-ot1-x32a.google.com with SMTP id q33-20020a056830442100b006a419d3fd20so1535945otv.7 for ; Wed, 12 Apr 2023 11:45:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681325111; x=1683917111; 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=gohAHfVouxgH+hJvQeBGsiMrbLKAn/aPyvmRUBO2xEM=; b=YW6v+uz3qLfkDmYU4CXaszKD4ilipn8i1QxYvhvAwxqWKFqzj7dFKLr203+A9asdY9 xjK0d/O6ztAML6al9g0iq8HgJAAsA5FmEqjokrczDgEanMZjS0B3rfWuahg/KlbImutI SEUvvyhmi5Xiv+Olkf2HYaHBd7G9WIUGFkSA4gsr7FXxtXDFjFXU08m1NXTodPKAjQwt QMevu8h3Bclig7Tr0zibaVAv8CKgdyzVITy2AP+xO3w9CQvHmME3J1aYyUL86vjqmt9H 4HNytispBkPMOieHPnA2fM+Z194+6c01Wm5TJK0rf3VqpWPKfrCnAPcvMDIRrYEXzzs5 XXbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681325111; x=1683917111; 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=gohAHfVouxgH+hJvQeBGsiMrbLKAn/aPyvmRUBO2xEM=; b=WO1Sgsi7ribYBD4NMcwAiM1gwrHOYaQN+M4ZNRRetvHgYM/f9edwYfjvIpxEBQ3Zpa r842cTgTYwcB+iUDZw7EhqOSLohKYG56/OBu6jDPKr9cF39QsuzxRb5xPFmuZNbzo648 UOMvnNAEAbquzhR71fTsXrJ+6tpmHX4sqYOC2nxMufpJ7opc0qPSzBUYmb4K0XuR4orf XvDBUHrD5J1F88N+fxSlEUX+pLAoiDSmEo0viPk51mPQARXfDlVEwaqSK0KYH0wtNzRr B6VxaN3ePfKP3Lcj3siK2pozDUzPy11eZVB+pjVyMifpTVqaQ3iWdvkp7JilKTID6FtV COUg== X-Gm-Message-State: AAQBX9erYVkhD2wMaKfJhIbzYBGVtIEULOm5qbNfNUtHYp7IIdgS+/CO bz5oBzoVuxNWHDsMui5C0Qo0z7iAsw== X-Received: by 2002:a9d:7a8f:0:b0:6a4:2e4c:de05 with SMTP id l15-20020a9d7a8f000000b006a42e4cde05mr224447otn.1.1681325111484; Wed, 12 Apr 2023 11:45:11 -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.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Apr 2023 11:45:11 -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 2/6] x86/boot: Remove extra call to copy_bootdata() Date: Wed, 12 Apr 2023 14:44:58 -0400 Message-Id: <20230412184502.145289-3-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 The call to copy_bootdata() in x86_64_start_reservations() is only applicable to Xen, since native has already call it. Xen on the other hand, has already filled in boot_params and just passes its address in, so the copy ends up being a no-op and can be removed. Signed-off-by: Brian Gerst --- arch/x86/include/asm/setup.h | 2 +- arch/x86/kernel/head64.c | 8 ++------ arch/x86/xen/enlighten_pv.c | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h index f37cbff7354c..fd409b7dda74 100644 --- a/arch/x86/include/asm/setup.h +++ b/arch/x86/include/asm/setup.h @@ -129,7 +129,7 @@ asmlinkage void __init i386_start_kernel(void); #else asmlinkage void __init x86_64_start_kernel(char *real_mode); -asmlinkage void __init x86_64_start_reservations(char *real_mode_data); +asmlinkage void __init x86_64_start_reservations(void); #endif /* __i386__ */ #endif /* _SETUP */ diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c index 4a3b195c9002..6e0f53a66678 100644 --- a/arch/x86/kernel/head64.c +++ b/arch/x86/kernel/head64.c @@ -533,15 +533,11 @@ asmlinkage __visible void __init x86_64_start_kernel(char * real_mode_data) /* set init_top_pgt kernel high mapping*/ init_top_pgt[511] = early_top_pgt[511]; - x86_64_start_reservations(real_mode_data); + x86_64_start_reservations(); } -void __init x86_64_start_reservations(char *real_mode_data) +void __init x86_64_start_reservations(void) { - /* version is always not zero if it is copied */ - if (!boot_params.hdr.version) - copy_bootdata(__va(real_mode_data)); - sanitize_boot_params(&boot_params); x86_early_init_platform_quirks(); diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c index 5a034a994682..a4db5c28af57 100644 --- a/arch/x86/xen/enlighten_pv.c +++ b/arch/x86/xen/enlighten_pv.c @@ -1430,7 +1430,7 @@ asmlinkage __visible void __init xen_start_kernel(struct start_info *si) /* Start the world */ cr4_init_shadow(); /* 32b kernel does this in i386_start_kernel() */ - x86_64_start_reservations((char *)__pa_symbol(&boot_params)); + x86_64_start_reservations(); } static int xen_cpu_up_prepare_pv(unsigned int cpu) -- 2.39.2