Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3133692rdg; Tue, 17 Oct 2023 05:53:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF6hIXg03o5p3TeXG6uieqlBJqV9geJVW8rMc3vkQjDdnENCnKU1248LQgutFkzoDA+vqEl X-Received: by 2002:a17:902:e892:b0:1c7:1f3f:b6dc with SMTP id w18-20020a170902e89200b001c71f3fb6dcmr2520977plg.11.1697547181666; Tue, 17 Oct 2023 05:53:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697547181; cv=none; d=google.com; s=arc-20160816; b=NXUGKYRhr0hg2oNh3cZu4dvAgj90XyrBq1dRn7VIselF9p9ypA0LHgWZhXB4py0gAz J1XTvLpP+TvzfBUv04vscAFnoFisCbtaR/Sassir+XVepmcsAqvCNSPgN4rqCHEv+l31 Onld1wMLdvcbV2Jd8PjeKFIs5v+ehRlvL/5au/TmWnIrHyvccMSdDicO9M2WdjfY/FqP UNpgIm1E40bA1GgZeKrq9vmNJrajGWag83a8dvIM4SDTHQLfih3H3tfR16TiF6NbPToM VVM9L7kLms58Dz5QfPIw8NpoFylsq2Urz9LnqEtWB7XpTB+8E4PXUEj1OljpuKvetCS5 1ANg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=pCGxqG8VmYbjs0JXGtPdRt/snYHKzop/79rP+5AdwKo=; fh=voafQGsizWyXOSB7V1Tv2134UV+BtT4MbboO7HTeDe8=; b=CnSJig+bRRxV/KS135o86OmZ8+kx6NB9/HazdgGTHexWPEcUJGzcScndl4grd9VfLZ 0nRmkimbAkP1X4Bfg9m4Om9L+tF/TZF44TBwyCoJiBqg2T1jU95kRLQwe6dDCKbVi5A0 8NVTdgKWC5r7R7orj7iWBaJX5Stfuav+rWYGnlT3SQOqkGdFubtr43NBET+b3DvF1t9H FcRcgWOI5DSxs3oqA7f9PksAMWpUhRWY8BYNw0sLk5g/dotfqlRMG+vpce5A3VtB37jG /KbMMxncFHnvUKFdh7CElobwJ29zcn5Ua0MQxiVkvRb4wkVaBmOWBiverrIlP2v0a53u e2LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=dbiVVIi5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id j12-20020a170902da8c00b001c9bc844534si1840278plx.430.2023.10.17.05.53.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 05:53:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=dbiVVIi5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 6F68B802957D; Tue, 17 Oct 2023 05:52:59 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234787AbjJQMwy (ORCPT + 99 others); Tue, 17 Oct 2023 08:52:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234486AbjJQMwx (ORCPT ); Tue, 17 Oct 2023 08:52:53 -0400 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7F1C83 for ; Tue, 17 Oct 2023 05:52:51 -0700 (PDT) Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-53db360294fso9986734a12.3 for ; Tue, 17 Oct 2023 05:52:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697547170; x=1698151970; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=pCGxqG8VmYbjs0JXGtPdRt/snYHKzop/79rP+5AdwKo=; b=dbiVVIi5vJmLcvv09rZ5ULVAbEVwKYhjT/e5qLDNT/uiN6H6ev8hH06B9rKTgFfEjp y2FFyKP34x32hpLHGtiN7PB7U3quJ3CTi5UTxzmyQgjgdpmoiGau6skRYonU9Kro1hgE 6qOjtyhJG7Gklz8s7l77ikTSqZCfZ+GlY5uyxQiv8Q0wtKXmIardnqwEqbnF7/o9+3LG y7UoSDc/mYU8JiZL3oda+qOxfjdkExRGHB5+K2GLLgrzHEWrHnRsmRghPyJPSEiqsJUo 7g3uimyt0xaCB0lrTCl8fiicfqOjFujmXTTu/w6QglSUsNa/5kj9sE9dlOCo1cKft8UW lHcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697547170; x=1698151970; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pCGxqG8VmYbjs0JXGtPdRt/snYHKzop/79rP+5AdwKo=; b=GgjOPMbfSVJOl0CojthsYa0J+6D3cepFehDN1exx3c8aQGK1eNRGwoNJ6yqgYZgEAw u5cofGt6OZD9mpDV2trOfFSiyJWc4FTGYL2StMiR23lKbcwaJaCqtwgftxSPoZsB5Ue1 ttJ7Ebm/MQiUGrvYiiDKQ91mxxtKJu9oqAqUuz321mNTU/0cJoxLXC4msfTn37Kdt9Sm EmBLOz6hA/TBGXT4jd9BzSJB7yBY5enVmKOzWNQbzOUuoxBkvQmyo0RamIwdBiwW+tCZ 0MjwgvS1pzNv7e6yv6MDJLRvxV81WvQ9QgmFjZStb0V1iPAmNWM0h4fjNgiersaA918s 2+Hg== X-Gm-Message-State: AOJu0Ywcd1TVdmWq4AD/OwypnopHY3wTlwGXfAh82Ub5ciVBSJ1QKRAI HwVgLqEN21z9+PUb21HAC0E= X-Received: by 2002:a50:ab51:0:b0:53e:5a90:e57 with SMTP id t17-20020a50ab51000000b0053e5a900e57mr1942467edc.37.1697547170095; Tue, 17 Oct 2023 05:52:50 -0700 (PDT) Received: from gmail.com (1F2EF7B2.nat.pool.telekom.hu. [31.46.247.178]) by smtp.gmail.com with ESMTPSA id v23-20020a50d597000000b0053e2a64b5f8sm1171886edi.14.2023.10.17.05.52.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 05:52:49 -0700 (PDT) Sender: Ingo Molnar Date: Tue, 17 Oct 2023 14:52:46 +0200 From: Ingo Molnar To: Hou Wenlong Cc: linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "maintainer:X86 ARCHITECTURE 32-BIT AND 64-BIT" , "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , Tom Lendacky , Andrew Morton , Steve Rutherford , Michael Kelley , Alexander Shishkin , Arnd Bergmann Subject: Re: [PATCH 2/2] x86/sme: Mark the code as __head in mem_encrypt_identity.c Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Tue, 17 Oct 2023 05:52:59 -0700 (PDT) * Hou Wenlong wrote: > The functions sme_enable() and sme_encrypt_kernel() are only called by > the head code which runs in identity virtual address. Therefore, it's > better to mark them as __head as well. > > Signed-off-by: Hou Wenlong > --- > arch/x86/include/asm/mem_encrypt.h | 8 ++++---- > arch/x86/mm/mem_encrypt_identity.c | 27 ++++++++++++++------------- > 2 files changed, 18 insertions(+), 17 deletions(-) > > diff --git a/arch/x86/include/asm/mem_encrypt.h b/arch/x86/include/asm/mem_encrypt.h > index 359ada486fa9..48469e22a75e 100644 > --- a/arch/x86/include/asm/mem_encrypt.h > +++ b/arch/x86/include/asm/mem_encrypt.h > @@ -46,8 +46,8 @@ void __init sme_unmap_bootdata(char *real_mode_data); > > void __init sme_early_init(void); > > -void __init sme_encrypt_kernel(struct boot_params *bp); > -void __init sme_enable(struct boot_params *bp); > +void sme_encrypt_kernel(struct boot_params *bp); > +void sme_enable(struct boot_params *bp); > > int __init early_set_memory_decrypted(unsigned long vaddr, unsigned long size); > int __init early_set_memory_encrypted(unsigned long vaddr, unsigned long size); > @@ -75,8 +75,8 @@ static inline void __init sme_unmap_bootdata(char *real_mode_data) { } > > static inline void __init sme_early_init(void) { } > > -static inline void __init sme_encrypt_kernel(struct boot_params *bp) { } > -static inline void __init sme_enable(struct boot_params *bp) { } > +static inline void sme_encrypt_kernel(struct boot_params *bp) { } > +static inline void sme_enable(struct boot_params *bp) { } So I think we should preserve the previous convention of marking functions __init in the header-declaration and at the definition site as well, and do the same with __head as well? Thanks, Ingo