Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp37782860rwd; Tue, 11 Jul 2023 20:46:13 -0700 (PDT) X-Google-Smtp-Source: APBJJlEWh6iyCCJYK2PZaqY7CJMEC8mdpKlDhUvS//8tKU0FfeJox3Nm2Fy68kiOX/p6leP+/k32 X-Received: by 2002:a17:906:9812:b0:992:1964:cd57 with SMTP id lm18-20020a170906981200b009921964cd57mr16329140ejb.75.1689133573294; Tue, 11 Jul 2023 20:46:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689133573; cv=none; d=google.com; s=arc-20160816; b=Y2fiCeROYgZvOHBS6XOhEVz425kREz0upyBivZP54Pw1WiSVWj5vZsDm3WWrHdw6U4 B0pmtllgGXSe9deIUIMzeM205NqbnEdn3PeXc4BvLxrShRsdj8VIG2tDnDCq6VmOoFEl XK2zrtBcQb/O++GkXEuClOEwgEGeXe1QynN7fNilCXBfC0/HRzqRMgRRkJ8ETdNNEBKq TpB9avVg0BQi3xWFHrxMhBVxu5ZggsGthTrqv/dfSIIGf2wS8ZTFc4NMWEBUcuzLB+xg 6oTZsZMukZEAPCyzox/xTOXH/5fgORipZXVi/KccEz5Cp8ZJ4yoDKK0Yq3LJknMpH6wq uSkA== 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; bh=gqqTT4QCfa6L3lWH/ZJ9TDK+7cjlkDZowSBlDkgFYzo=; fh=H+xol+m9/22gljVAiQKilKMt6BHHgyiL3H+/V9q01Lk=; b=vUOzc0/pBMX7OBmlVzRi3BnbgkRm4zmA+cFUT+Rq4hcDHaMVjje33nf/Km5h2DA/9c vqvbfoB3nOVm3Houz2r3hwwjcjMw+5qWFaceJPeOlOSwwwxqTDO5a/Ybh8f7u9IT8dXO h/ybwzi4Rq7Sfy7CyTZ6UWfcIB8HL+E8/L6J/iTA+toGoGWbSXxam8BWfHnAwr53vwIs MknHN8Ls+MhGGhta0snrfJiGwVnEHOW75fq8lWsvas6IA00/SPAHOMkbU5Y7S4rbMT6+ 95V8UJB2Ot5FRbjM5FS/g6aSm4YQ8asgngFLz2lFXgMpzIow+9SB4zp7bKfQ1vXPMjnD 6csg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p18-20020a170906b21200b0098e3591d105si3482943ejz.405.2023.07.11.20.45.48; Tue, 11 Jul 2023 20:46:13 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230439AbjGLDbY (ORCPT + 99 others); Tue, 11 Jul 2023 23:31:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229843AbjGLDbU (ORCPT ); Tue, 11 Jul 2023 23:31:20 -0400 Received: from out0-201.mail.aliyun.com (out0-201.mail.aliyun.com [140.205.0.201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97704E5F for ; Tue, 11 Jul 2023 20:31:19 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R201e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018047206;MF=houwenlong.hwl@antgroup.com;NM=1;PH=DS;RN=13;SR=0;TI=SMTPD_---.TrdHwby_1689132672; Received: from localhost(mailfrom:houwenlong.hwl@antgroup.com fp:SMTPD_---.TrdHwby_1689132672) by smtp.aliyun-inc.com; Wed, 12 Jul 2023 11:31:13 +0800 From: "Hou Wenlong" To: linux-kernel@vger.kernel.org Cc: "Lai Jiangshan" , "Hou Wenlong" , "Thomas Gleixner" , "Ingo Molnar" , "Borislav Petkov" , "Dave Hansen" , "=?UTF-8?B?bWFpbnRhaW5lcjpYODYgQVJDSElURUNUVVJFIDMyLUJJVCBBTkQgNjQtQklU?=" , "H. Peter Anvin" , "Josh Poimboeuf" , "Anshuman Khandual" , "Mike Rapoport" , "Pasha Tatashin" Subject: [PATCH RFC 1/7] x86/head/64: Mark startup_gdt and startup_gdt_descr as __initdata Date: Wed, 12 Jul 2023 11:30:05 +0800 Message-Id: X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY 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 As startup_gdt and startup_gdt_descr are only used in booting, make them as __initdata to allow them to be freed after boot. Signed-off-by: Hou Wenlong --- arch/x86/kernel/head64.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c index 49f7629b17f7..dd357807ffb5 100644 --- a/arch/x86/kernel/head64.c +++ b/arch/x86/kernel/head64.c @@ -69,7 +69,7 @@ EXPORT_SYMBOL(vmemmap_base); /* * GDT used on the boot CPU before switching to virtual addresses. */ -static struct desc_struct startup_gdt[GDT_ENTRIES] = { +static struct desc_struct startup_gdt[GDT_ENTRIES] __initdata = { [GDT_ENTRY_KERNEL32_CS] = GDT_ENTRY_INIT(0xc09b, 0, 0xfffff), [GDT_ENTRY_KERNEL_CS] = GDT_ENTRY_INIT(0xa09b, 0, 0xfffff), [GDT_ENTRY_KERNEL_DS] = GDT_ENTRY_INIT(0xc093, 0, 0xfffff), @@ -79,7 +79,7 @@ static struct desc_struct startup_gdt[GDT_ENTRIES] = { * Address needs to be set at runtime because it references the startup_gdt * while the kernel still uses a direct mapping. */ -static struct desc_ptr startup_gdt_descr = { +static struct desc_ptr startup_gdt_descr __initdata = { .size = sizeof(startup_gdt), .address = 0, }; -- 2.31.1