From patchwork Tue May 9 10:58:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 91508 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2794488vqo; Tue, 9 May 2023 04:12:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4XhN0dj4gOcaS8t1c0uNqQjG7Tev+Se6ZGkbcGtYXswLx1G3gBmg5v4Db1Q9orK1zEzDOd X-Received: by 2002:a05:6a20:54a2:b0:100:85e2:26c9 with SMTP id i34-20020a056a2054a200b0010085e226c9mr8171704pzk.13.1683630769724; Tue, 09 May 2023 04:12:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683630769; cv=none; d=google.com; s=arc-20160816; b=drhC6TF91ooMoqLfjmlGGSWl9byvWXt0XZEWAZBYZnEVTrOlWgG4NngihraetgakAW Gyh/a/KziaoYfbjJFpP5Jyf/aglxi1txflk+JmtBHiJTCgNci1j97XU4NoKoOQmBtFxK q8gRXPWTLp2KpcrgjfQzINb3f5+9THmMoKNVfKGl8W4dJA3ZZhr3KhuBJLH0nRKBbiXH bun6IBDxptn/vqgjjI+7NnmFUFqxlr7SgpU0tL19uqw8D2BSx1EE+7HGKdlRO0hWxBbj QlpB5VZ0ullUxzQZya60O5zld5D7LpZhxZSCmwLFJc1qCGiOYEVaAwqC1hR1dqbw0XEP wr2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=QbOLo9bnGMk27JhmsnwuQODkQepljVGTk1doCsr1Ahs=; b=BNS3Ek9OXEHjZWQbp09t+bNVbs/AMjqi9seXRnGg0/sZaThHBpqtxqpgHsJyCIVUSO Jf/yUIoFvDQAlOC3JJpeW4VoYnQprEsfh/s2R5TPCLbtKjX9EN6xt/nZBX3cwkgi2OWl bz+xSay5gPAcuc1idKbghq/A9NM1OfMym2NxdW2JldxLlDXDlKg/olFB/JwwZCJsKhfB MK52PoKBbKKjaAaERrzo6P0N1iqyDTy+y9yn2J+vfkojwl9zKHP+Yte9c5DZFTWxv9YM +0rQGCZFwWvYfro+RycStJ3z2u3n/g8REMQ5DMOIgw9NG5o0jeb+Tt2G24qNo5vPXnV6 MPyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=PTDKxFdk; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ot18-20020a17090b3b5200b00250acbb4d02si1705342pjb.153.2023.05.09.04.12.35; Tue, 09 May 2023 04:12:49 -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=@linutronix.de header.s=2020 header.b=PTDKxFdk; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235011AbjEIK6Z (ORCPT + 99 others); Tue, 9 May 2023 06:58:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233530AbjEIK6X (ORCPT ); Tue, 9 May 2023 06:58:23 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D20EA76BF; Tue, 9 May 2023 03:58:20 -0700 (PDT) Date: Tue, 09 May 2023 10:58:18 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1683629899; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QbOLo9bnGMk27JhmsnwuQODkQepljVGTk1doCsr1Ahs=; b=PTDKxFdkVdAYqBPmPNxDuqiveUCA29+ZAYuUIgHEdiQVMS+bNO2ywK4sTyY4lF4B0KNX4X P6aayFY818LJDTX/uBPtIKV+9ptp7NVVwA0ew1GpYHePbXvLyHRXqvcqoXjr4r508EZgu9 uHHYkbiOzjAPeSSooX+/Hl17y8C8vfwmhr0ZnZmlreOn6TB/CW3XdXMnsy1mrd3ybgGT15 MY+SFKtOgbVr5OqLOc726WUaaAi5vZqp4UjNkRVfChEZrvT/xf4bc4jiNrnWvo0gRhGEjh FRCKtnrotyAjkCr668VRtcqn4sNFeYb0U4mBqu1MyFHApvJQl7ztVM2fLOwvpQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1683629899; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QbOLo9bnGMk27JhmsnwuQODkQepljVGTk1doCsr1Ahs=; b=DHTSVNHoIh16T8LBYlW6gNOpV9cMElHV3PDZbTakl8/SoMerAAkV3+gWnqNtAnSTpm5xsx 6AIJpHqlKegQ0uAA== From: "tip-bot2 for Borislav Petkov (AMD)" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/sev] x86/coco: Mark cc_platform_has() and descendants noinstr Cc: "Borislav Petkov (AMD)" , Tom Lendacky , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230328201712.25852-2-bp@alien8.de> References: <20230328201712.25852-2-bp@alien8.de> MIME-Version: 1.0 Message-ID: <168362989883.404.10957011001565059160.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761644323540131266?= X-GMAIL-MSGID: =?utf-8?q?1765414818247144595?= The following commit has been merged into the x86/sev branch of tip: Commit-ID: 1eaf282e2c7d062a946980758df013f09f934a54 Gitweb: https://git.kernel.org/tip/1eaf282e2c7d062a946980758df013f09f934a54 Author: Borislav Petkov (AMD) AuthorDate: Tue, 28 Mar 2023 22:17:11 +02:00 Committer: Borislav Petkov (AMD) CommitterDate: Mon, 08 May 2023 11:39:35 +02:00 x86/coco: Mark cc_platform_has() and descendants noinstr Those will be used in code regions where instrumentation is not allowed so mark them as such. No functional changes. Signed-off-by: Borislav Petkov (AMD) Acked-by: Tom Lendacky Link: https://lore.kernel.org/r/20230328201712.25852-2-bp@alien8.de --- arch/x86/coco/core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/coco/core.c b/arch/x86/coco/core.c index 73f8323..df10e75 100644 --- a/arch/x86/coco/core.c +++ b/arch/x86/coco/core.c @@ -16,7 +16,7 @@ enum cc_vendor cc_vendor __ro_after_init; static u64 cc_mask __ro_after_init; -static bool intel_cc_platform_has(enum cc_attr attr) +static bool noinstr intel_cc_platform_has(enum cc_attr attr) { switch (attr) { case CC_ATTR_GUEST_UNROLL_STRING_IO: @@ -34,7 +34,7 @@ static bool intel_cc_platform_has(enum cc_attr attr) * the other levels of SME/SEV functionality, including C-bit * based SEV-SNP, are not enabled. */ -static __maybe_unused bool amd_cc_platform_vtom(enum cc_attr attr) +static __maybe_unused __always_inline bool amd_cc_platform_vtom(enum cc_attr attr) { switch (attr) { case CC_ATTR_GUEST_MEM_ENCRYPT: @@ -58,7 +58,7 @@ static __maybe_unused bool amd_cc_platform_vtom(enum cc_attr attr) * the trampoline area must be encrypted. */ -static bool amd_cc_platform_has(enum cc_attr attr) +static bool noinstr amd_cc_platform_has(enum cc_attr attr) { #ifdef CONFIG_AMD_MEM_ENCRYPT @@ -97,7 +97,7 @@ static bool amd_cc_platform_has(enum cc_attr attr) #endif } -bool cc_platform_has(enum cc_attr attr) +bool noinstr cc_platform_has(enum cc_attr attr) { switch (cc_vendor) { case CC_VENDOR_AMD: