From patchwork Thu Jan 25 18:21:36 2024 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: 192241 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:e09d:b0:103:945f:af90 with SMTP id gm29csp172432dyb; Thu, 25 Jan 2024 10:30:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IHDJm/wpwPvnAnu1Ro3Wb3+o6FQaJojpXRh73yKxabAzCqkUJnk8En6v1XgUbCl0c/1d60d X-Received: by 2002:a05:6e02:604:b0:360:4f83:313f with SMTP id t4-20020a056e02060400b003604f83313fmr123491ils.103.1706207401843; Thu, 25 Jan 2024 10:30:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706207401; cv=pass; d=google.com; s=arc-20160816; b=AkH7YSMRw9VwlnZiSP14FBwhyGnVxOHvHLCc5H6sxSdgvV5mU4stOex8H/pa+qc7St Gi6QUGDQMZeYUbaaGg0puCpcizlhOnf4PvlxhrIseBZGRwfRdbed+8ANHP+sapszAb7G wizakWe3MvPe1dDgwbU9eF8DH/p82DOy3hYCogB8FUv2N1cbNKaGYuJoips27j6NCNlm O/Neg2mQq2WfL91BAIqPcOwUHosW9CkqiJhaqxZOyLkFdvW2ohXQ4QdHGaXcRhsyhdX8 mz8ERNtciJYRZ7cZ4yavK7rM2wTnSAWXyu7Sh+bFyT5yAqiGpqUC1DjC/IyQ4cFCbZVT BISg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=0BtMfiW5Jmaue+jLIiKXGH1dEvlk5SISeSvAE/4TjV4=; fh=Xtt8PgBvMlF/Ge3oIoOoNU8UxEJO15ZF1qyrk+WbNL0=; b=T96gNgpEdubxgSmChfO3KdP5GxCpmZyowEtRGRfMALdBgTIsAQHsZgsdfTQBXUGvJX SK+psTfPfyTwTh9JZdIO89bomYcHVVzMQQ+6cZ/kC2gW3pIuKqZOc+lIbGJQoRDDAaZU TLYRzd1NTKU4msFn3hgCU/cuF8omMHSjQMP3t+AOQlOFzMssQ7sCCNLrwkl0muJ9f1AL /p94xH4p693N3kjAjkqrULnCwIz+X6XAWzBm1+KXGMr3IEkXvWkxwBgWu0lkrucqAtmK w3ounzO3om8G0hgFqUkbAhE35bvd2VokOasB7N7hGKNm8WcKwYcjNYaFndcotlbTRgg7 SldQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=xZ6B29b5; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-39109-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39109-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id t18-20020a63dd12000000b005cdaf95abefsi13663064pgg.506.2024.01.25.10.30.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 10:30:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-39109-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=xZ6B29b5; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-39109-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39109-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 3710229B109 for ; Thu, 25 Jan 2024 18:29:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5A8A71420C2; Thu, 25 Jan 2024 18:21:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="xZ6B29b5"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="y0o61jjK" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F4B413BEB4; Thu, 25 Jan 2024 18:21:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706206900; cv=none; b=qUj5EdBULtE9mOKL4SxKPs21N7kG4zpy2r2I/3sQ0z2TUpRksWUtBlrUQgwXFd2C6yFh+tnFJESVbk4g3jJrkgGw6zGNDzghON5gzoj9eQ09iW39nfW2f5KFJ9sjYVVUp8kmK/yNN5OYxlkMS7bi6TlyWUlP8QfvL74KAKybOhk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706206900; c=relaxed/simple; bh=0ukaSdLB7QrrDZhuoXZBBuAGXfiReFxv7PEmTV3Xlbc=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=E9z5PyT+1KoQ4Su0gXkuf/aKT0XKF6LmTUqGboXHR+D03NCnMVDB7GrDQbVe512OdgsW4I4ZL8OnfFmV3JmUVFnV0eh4CO0TDuGuH/lmYM2yD23xdBEnyWE2EwZ+uPHwqd07mdlse0KctmKrma6TIUsqDoHWhyHdx7adJNqfm+A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=xZ6B29b5; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=y0o61jjK; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Thu, 25 Jan 2024 18:21:36 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1706206896; 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=0BtMfiW5Jmaue+jLIiKXGH1dEvlk5SISeSvAE/4TjV4=; b=xZ6B29b5UYNErTfXEPCqr9QRKtsFG30czeQ6rSvzHgNkVdVKDAgw+DsqZ3aBijI2+b+wJF FdCF/Ct9wirLlTghVCZxHN3YFx0uBOGaz2QEd1mh/ggRpMHSTAqcfK1UDCf3x5fDoDIYP9 znM1JEl0wxl+jl19KiuR76nvhCu6V+aj9GyCb070QfWZ915mafF0PEdCbvdEjGBsYezCwS vdhzTaCSsjRS2wZ7C7DQQYzCNTvnznDj7lghA+oqfiT1rIWvEy0AFs3MYhyw/ceMpHl/5Q pt/twFVnT4tYvMx0/mnstAejDKtQMhS1Q3P9zwcLXQ5PPtd9RHHpOVI4kYCyaw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1706206896; 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=0BtMfiW5Jmaue+jLIiKXGH1dEvlk5SISeSvAE/4TjV4=; b=y0o61jjKWGD4YLbr6GyihBK9pKn14LfTWoYuZqUCOP2hNIGj4tDYpCiIo3WIybaKHJ3UCb gvVWbz7HUTZfPdAQ== From: "tip-bot2 for H. Peter Anvin (Intel)" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/fred] x86/fred: Disable FRED support if CONFIG_X86_FRED is disabled Cc: Megha Dey , "H. Peter Anvin (Intel)" , Xin Li , Thomas Gleixner , Shan Kang , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231205105030.8698-8-xin3.li@intel.com> References: <20231205105030.8698-8-xin3.li@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170620689604.398.10401404045358407255.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784440747139845268 X-GMAIL-MSGID: 1789088132548399263 The following commit has been merged into the x86/fred branch of tip: Commit-ID: e554a8ca49d6d6d782f546ae4d7f036946e7dd87 Gitweb: https://git.kernel.org/tip/e554a8ca49d6d6d782f546ae4d7f036946e7dd87 Author: H. Peter Anvin (Intel) AuthorDate: Tue, 05 Dec 2023 02:49:56 -08:00 Committer: Thomas Gleixner CommitterDate: Thu, 25 Jan 2024 19:10:30 +01:00 x86/fred: Disable FRED support if CONFIG_X86_FRED is disabled Add CONFIG_X86_FRED to to make cpu_feature_enabled() work correctly with FRED. Originally-by: Megha Dey Signed-off-by: H. Peter Anvin (Intel) Signed-off-by: Xin Li Signed-off-by: Thomas Gleixner Tested-by: Shan Kang Link: https://lore.kernel.org/r/20231205105030.8698-8-xin3.li@intel.com --- arch/x86/include/asm/disabled-features.h | 8 +++++++- tools/arch/x86/include/asm/disabled-features.h | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/disabled-features.h b/arch/x86/include/asm/disabled-features.h index 702d93f..f40b29d 100644 --- a/arch/x86/include/asm/disabled-features.h +++ b/arch/x86/include/asm/disabled-features.h @@ -117,6 +117,12 @@ #define DISABLE_IBT (1 << (X86_FEATURE_IBT & 31)) #endif +#ifdef CONFIG_X86_FRED +# define DISABLE_FRED 0 +#else +# define DISABLE_FRED (1 << (X86_FEATURE_FRED & 31)) +#endif + /* * Make sure to add features to the correct mask */ @@ -133,7 +139,7 @@ #define DISABLED_MASK10 0 #define DISABLED_MASK11 (DISABLE_RETPOLINE|DISABLE_RETHUNK|DISABLE_UNRET| \ DISABLE_CALL_DEPTH_TRACKING|DISABLE_USER_SHSTK) -#define DISABLED_MASK12 (DISABLE_LAM) +#define DISABLED_MASK12 (DISABLE_FRED|DISABLE_LAM) #define DISABLED_MASK13 0 #define DISABLED_MASK14 0 #define DISABLED_MASK15 0 diff --git a/tools/arch/x86/include/asm/disabled-features.h b/tools/arch/x86/include/asm/disabled-features.h index 702d93f..f40b29d 100644 --- a/tools/arch/x86/include/asm/disabled-features.h +++ b/tools/arch/x86/include/asm/disabled-features.h @@ -117,6 +117,12 @@ #define DISABLE_IBT (1 << (X86_FEATURE_IBT & 31)) #endif +#ifdef CONFIG_X86_FRED +# define DISABLE_FRED 0 +#else +# define DISABLE_FRED (1 << (X86_FEATURE_FRED & 31)) +#endif + /* * Make sure to add features to the correct mask */ @@ -133,7 +139,7 @@ #define DISABLED_MASK10 0 #define DISABLED_MASK11 (DISABLE_RETPOLINE|DISABLE_RETHUNK|DISABLE_UNRET| \ DISABLE_CALL_DEPTH_TRACKING|DISABLE_USER_SHSTK) -#define DISABLED_MASK12 (DISABLE_LAM) +#define DISABLED_MASK12 (DISABLE_FRED|DISABLE_LAM) #define DISABLED_MASK13 0 #define DISABLED_MASK14 0 #define DISABLED_MASK15 0