Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1128781rwr; Fri, 5 May 2023 09:28:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7bG30tKzaT3WIFyaM2itbD7sqLLKrz/Jvb3xSzoRVA1/294ooVFtr5hJtEhof/7ThPdLZF X-Received: by 2002:a17:902:9885:b0:1aa:fc97:feb3 with SMTP id s5-20020a170902988500b001aafc97feb3mr1766020plp.50.1683304107871; Fri, 05 May 2023 09:28:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683304107; cv=none; d=google.com; s=arc-20160816; b=DEg7nBW07EVdTL1qF7mjbQyFptgeRt3fl61UniW66yQGVyZeeIyqTHdCx2bj4BPtQC kGXieF4vdsDxxHKMqnvc1so5cBxnWTICk/BePwvtWliiE43R/EkCdzPZWLNh6uVqNqai eQrTytju2MiZrG3TKSL47HB6+uuAnp3+4q9RIXCFeMfRet+hWL08Ywn8EGXKwgPD56+T acscQ4sARCGG4wHGfacRBbJWs9C4J8nUHlo+7HVRWvR63pvrM/RZj91bh6i2wqDjFmUx ZfpAvdIQMCEykbfdWpWIqFEImDR5OuYe9Xd1phXJRztv6vg/qGsZXFw6jgSmRnmxGgYe 5zGA== 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:dkim-signature; bh=j/3HnXMEahFalsmSpul+K4urVAtq8T4QZ9LLrTKBXqA=; b=Ic10hP5ECNdm+yI1JsmYhFBydBGEhzT8slbOBypL0vSJNeIftBPIVp/PAv0/hDif31 tRyDAf2cGIu/bq8KvlI4Gc6X9GRzGVYVIGBAxqQuJElLGgKtZT45rHzzXeYRegdBONFX N21hHR3miPj/D2JM/168gCbe3L1H0Z2uG/llowjiUM3bLHbUKSoK0gmFOGRWkc+W0dXI 6WsRWJla2gUbW/doJGgnPjipM8at/k/0080Za/CYL9E7b3ZeQNej7FQGeQ8zfTsiymgm IudzXW74uhfaSrSNzmWhL7JYUhA6iLYbWc+fLEGGRftqc0Lwa9qqPOBdk19ZEjQAMgmC vT+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DbiEUDJy; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bf9-20020a170902b90900b001aae741abafsi1910172plb.440.2023.05.05.09.27.55; Fri, 05 May 2023 09:28:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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=@kernel.org header.s=k20201202 header.b=DbiEUDJy; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232181AbjEEQZt (ORCPT + 99 others); Fri, 5 May 2023 12:25:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230523AbjEEQZs (ORCPT ); Fri, 5 May 2023 12:25:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFAC11814D; Fri, 5 May 2023 09:25:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 76D3C6145A; Fri, 5 May 2023 16:25:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F24A9C433D2; Fri, 5 May 2023 16:25:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683303946; bh=AjJF3rznt+Ti0zY3wvgVsm1uKpnaub6aIix98B10Tbw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DbiEUDJyS/8oeUjt2ksucAdHtRETadxXkeKVgHi1ZHc3e+obt9baz3rtLxN3lAYn1 Kz/s9IJ3kevctsUtTrPYYSmpTGH3eUMTPbNo++i0UQ4RG69kl2bzUHFf0bJMA3v0Vq LR6203a7aLRIv7Dhqhvo5z8zKC4WecZ0o+1a1FcHWjSA/3gcGaLcMeep5nv2Fi3lrW L1Me5AJHeKkWshm28Jmh5LSOnn+EaKV5inwyw/mIzUs40jfIZhTEjtHdqejbjPqPSp Kbwxns5VZlfk+eevOByvwfnJx6QCGcV+GkI+CySwTUfD7Bknu/HYk1RHiB2bW7IRjg uq2ETteiSmGUg== Date: Fri, 5 May 2023 18:25:40 +0200 From: Simon Horman To: Ross Philipson Cc: linux-kernel@vger.kernel.org, x86@kernel.org, linux-integrity@vger.kernel.org, linux-doc@vger.kernel.org, linux-crypto@vger.kernel.org, iommu@lists.linux-foundation.org, kexec@lists.infradead.org, linux-efi@vger.kernel.org, dpsmith@apertussolutions.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, ardb@kernel.org, mjg59@srcf.ucam.org, James.Bottomley@hansenpartnership.com, luto@amacapital.net, nivedita@alum.mit.edu, kanth.ghatraju@oracle.com, trenchboot-devel@googlegroups.com Subject: Re: [PATCH v6 05/14] x86: Secure Launch main header file Message-ID: References: <20230504145023.835096-1-ross.philipson@oracle.com> <20230504145023.835096-6-ross.philipson@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230504145023.835096-6-ross.philipson@oracle.com> X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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-crypto@vger.kernel.org On Thu, May 04, 2023 at 02:50:14PM +0000, Ross Philipson wrote: > Introduce the main Secure Launch header file used in the early SL stub > and the early setup code. > > Signed-off-by: Ross Philipson > --- > include/linux/slaunch.h | 513 ++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 513 insertions(+) > create mode 100644 include/linux/slaunch.h > > diff --git a/include/linux/slaunch.h b/include/linux/slaunch.h ... > +/* TXTCR_STS status bits */ > +#define TXT_SENTER_DONE_STS (1<<0) > +#define TXT_SEXIT_DONE_STS (1<<1) nit: Please consider using BIT() ... > +/* > + * External functions avalailable in mainline kernel. > + */ > +extern void slaunch_setup_txt(void); > +extern u32 slaunch_get_flags(void); > +extern struct sl_ap_wake_info *slaunch_get_ap_wake_info(void); > +extern struct acpi_table_header *slaunch_get_dmar_table(struct acpi_table_header *dmar); > +extern void __noreturn slaunch_txt_reset(void __iomem *txt, > + const char *msg, u64 error); > +extern void slaunch_finalize(int do_sexit); I think that extern should be avoided. Perhaps these are in a header file that can be included? > + > +#endif /* !__ASSEMBLY */ > + > +#else > + > +#define slaunch_setup_txt() do { } while (0) > +#define slaunch_get_flags() 0 > +#define slaunch_get_dmar_table(d) (d) > +#define slaunch_finalize(d) do { } while (0) I think it is usual to use static functions for this purpose. Usually they end up in header files as static inline functions. > + > +#endif /* !IS_ENABLED(CONFIG_SECURE_LAUNCH) */ > + > +#endif /* _LINUX_SLAUNCH_H */