Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4928524rwl; Tue, 28 Mar 2023 13:24:10 -0700 (PDT) X-Google-Smtp-Source: AKy350bNurdkZTUgBszYBif1LuZfnrlMf1ijFEoB6V6bqVvPQ8JLl/uTUPYSChyEOr2SU1OMm2hc X-Received: by 2002:a17:906:8a78:b0:8b1:264f:3776 with SMTP id hy24-20020a1709068a7800b008b1264f3776mr16831433ejc.23.1680035050489; Tue, 28 Mar 2023 13:24:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680035050; cv=none; d=google.com; s=arc-20160816; b=cKZmVjIMb6sfSktUG9z4/Dq2W2u7u6YAJkCzAkonFFl5bHa3ZIbpkp5IBJWGUi/o4V LGsxf1AU+HYb1ALf3PH9/BNJXkx0IYkTPnQdrTj7/5UP66+zzAw4C7/z1Bzw8IaMbYTE r7k5G6S9yVCxHdMlly7H6midJUDQoT+6VoFrrUglXtG5cdz3DlNeMaIQUWy/lwY9Dva9 ++tF9tsdt+NM3PtCrY28yPFsmnkUCZ/BVRubrRazHH/lNecfKS2jDWB6vXGabLtWtWQ7 hjgUVeCwAj2IF1z3qOr1VDuqJ1Z3CK903pxTDn4syVo8NrINsbXoDXrsmjc5lgm27ILP DQHA== 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=kj9ZMXdOiC4j+qhb1y+6eCUnrAvvjZYAJh8azvysCpQ=; b=cTDh1q3B9Rxsk13mEFco5Y/w84AyWNiqxqKxA0LPoCapGF6Rfl1OnOyexWtWmq8sA2 V+5qqik/oSCWj/kmyFv2hrgPXi5EWH4LxJ2pCxc87JXbpbpVwKuyHF0s85ZnqZnfCRgQ 4dR2n9TNQpezjRjk0Ipo1ry+e5w2t1+8OZ3++IpTR4D+X/9p11FfOWsA9P5BsoJ3zJYg 46G5gRoHwIIHMLtUx/qvzn4RuGGIpPDz8HjGoiM05uMXPVUeCuA5zGhMMiAd+8+Ynu/3 ahC/TkgnmFABORXijNqXg1A+Mj6CbPe0aiaTES2wlG4C5nwTmzqx9CuKiW8sIDZAwrS4 A2WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b="ZzLFJ/E5"; 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=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g21-20020aa7c595000000b004fc78b692c7si30338350edq.571.2023.03.28.13.23.46; Tue, 28 Mar 2023 13:24:10 -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=@alien8.de header.s=dkim header.b="ZzLFJ/E5"; 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=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229569AbjC1USL (ORCPT + 99 others); Tue, 28 Mar 2023 16:18:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229489AbjC1USK (ORCPT ); Tue, 28 Mar 2023 16:18:10 -0400 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDFC44222 for ; Tue, 28 Mar 2023 13:17:50 -0700 (PDT) Received: from zn.tnic (p5de8e687.dip0.t-ipconnect.de [93.232.230.135]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 06D431EC067C; Tue, 28 Mar 2023 22:17:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1680034634; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kj9ZMXdOiC4j+qhb1y+6eCUnrAvvjZYAJh8azvysCpQ=; b=ZzLFJ/E5RZZt1ohUTLM3czf8JkkIzDOoX4i5eRu+X7Faaeg6V0VCb0+jQcdQtoIl/uCasM qGlf3qVqO540sZpo8O5pSXIH1XpjIEEH97EuzYA/7VJlotoBFhRkFC6m3VYc2KGiNdBo5X 8CBXduL4/rAchWkbdYZwMAp3JbqLk3E= From: Borislav Petkov To: Joerg Roedel , Tom Lendacky Cc: X86 ML , LKML Subject: [PATCH v2 1/2] x86/coco: Mark cc_platform_has() and descendants noinstr Date: Tue, 28 Mar 2023 22:17:11 +0200 Message-Id: <20230328201712.25852-2-bp@alien8.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230328201712.25852-1-bp@alien8.de> References: <20230328201712.25852-1-bp@alien8.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Borislav Petkov (AMD)" 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) --- 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 73f83233d25d..df10e75be085 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: -- 2.35.1