From patchwork Thu Jan 25 18:21:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 192239 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:e09d:b0:103:945f:af90 with SMTP id gm29csp172275dyb; Thu, 25 Jan 2024 10:29:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IEOBcoMbiDY/k2Vs/WYuUidrQDy84Wt5tLzqHX3sJZRX04GdBRHc807QI75ZfjztONfYyu1 X-Received: by 2002:a05:6214:2429:b0:686:ab99:9f44 with SMTP id gy9-20020a056214242900b00686ab999f44mr94124qvb.75.1706207385898; Thu, 25 Jan 2024 10:29:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706207385; cv=pass; d=google.com; s=arc-20160816; b=aKjW7QQGqAVNh/6Q0iIc9i5I1yMs3ixTyuPFQ3ZbVuMuIfodP4634f+GiOMayzXUjM RhPuoSTG/7oFauDYZsfeVxsZ+P2asnX/EVGQm4TIRb6wKnN3MlYjPyaZmUApv/q4+DSX +LktXEaor1rF9uyhzWRpNdSDkUvFOMLxIAP3WrXQ+7cnz4LGsU7x2u24m+SK93yP2tzj hELEDU+8pDMnmyOFYBGHbp3rtucqpy0oKpZ3VgVBqB5nbRN6bdjvBySnCYOzIiLI0lKf 10ZZ0582WCr9xHgmdt2p3xignpYFQzSIbBJOD61mG8zUymDXJypH0Cr4ILSVWnABzLiv 3Vvg== 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=CjJ09yt8uNcPF3b8qNxyWiN2kLfQdJmilN7ktn4gKpI=; fh=U/Hd0cPmVpmsXI9UC370Q88/l4pozXEkKxB1Pi0MTn0=; b=ICN1pHGji+FpK4vY6NDt9fFDFIWq5oi7ZLtIulquboe3Q7owxC3hO/FhA5QiKwVuAv +3GhWgQYTtn/7qNVfXJpCj/io508gCU4+jvCywKxsDXKgemqWcTLdodQyQCaEzElM7Sz VLC7Ud38rAAmYBNdcgAfSmDEcbcNSmBqVqzuY51hrAtCAUNc/CEchevOiLOE2555gCQH JcdoSpQDEyti2K+r2gZoSuxdY0q1T7MDDAKZUM5pVt9DGn49eE60svaaEkSYVuNBX2I4 O7xHd/kPdJHG5vpPYb6s6fzFMOFTLENPCWcZv3X2vplk/wgWsYXyXhBnvsQIlyL7Gm/m a60Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="iI/Eruei"; 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-39110-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39110-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id b3-20020a0ccd03000000b00683b622cc41si13280216qvm.255.2024.01.25.10.29.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 10:29:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-39110-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="iI/Eruei"; 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-39110-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39110-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id AD5931C25D5E for ; Thu, 25 Jan 2024 18:29:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 14E7B14460D; Thu, 25 Jan 2024 18:21:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="iI/Eruei"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="T1W++Nn3" 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 4EC7413D519; 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=1706206901; cv=none; b=UfOcZJOtzBXg/kcz50xUn0vfcm7Q95E4Q0Sp3kpmQrcix8qhEYP+IjthGe+OK9HK4tmemGuKKXS3bndmKxloizRcKYMxkN6qgzakpqBeKucU7UnC2yLmg7yxPuN7/L/SJdpf7uzX3dQnY8rFWlT+wtJtKDVBZjqr3oVLD7VQjWY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706206901; c=relaxed/simple; bh=9HNbCqXqfwUs7zSRBHZbKSyO5jyHiLF+EI2wqtSx5xM=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=nLUCsqBMjXMGy5SdlxC7Zjha2/NLskFVz5i5SYDsuAD4vBBg87oO4Vbn+hATk68odsRxkpjWOkAlvYVzUjClJudyuYpwJZxXJzBp4iRwqWVOPVzauBoCCgryRna3FTF/RvUR1vb62ZR5N7SQtYzcxzthtgSxGOM8llJcshWTm9M= 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=iI/Eruei; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=T1W++Nn3; 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=1706206897; 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=CjJ09yt8uNcPF3b8qNxyWiN2kLfQdJmilN7ktn4gKpI=; b=iI/Eruei7Bthf3wpnXx8/S2GYa2vx/704U4EJC6cr07lfkhLeEcYOscWuI8t2mTGOFXdh2 qEog+QqInwkM+dX8AZJCpQQu/0VmGVVY66yQhhIXgpcJH6arS5IpSs1dksYz5LQ29LNYDv k5srGpdHYUr21c+ihJyZuVNbuIbOU20MdSzTd+qwTKDDcLk9+8XzPcQix13knNC/ppVzFr 1RH0ydITj8p0E0raJui78cv6ppDfnX0O/Uk3H55gmqG8rgUuYAN8t1BWU/Bb2ADVEBEGMA Eip4YGSLUcgUqG/xUF4aUESp17UVxRmUGsOBMhCw6TJkdbQ6ngL0Gw/xGGdkug== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1706206897; 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=CjJ09yt8uNcPF3b8qNxyWiN2kLfQdJmilN7ktn4gKpI=; b=T1W++Nn3O6qlO8RJiwAYJMqbsZ4uHdZLBmolrd2wK6sdgQ5fKSB+1spm6GJBfpnUei7qD9 jmL78LdSebQdM0Ag== 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/cpufeatures: Add the CPU feature bit for FRED Cc: "H. Peter Anvin (Intel)" , Xin Li , Thomas Gleixner , Shan Kang , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231205105030.8698-7-xin3.li@intel.com> References: <20231205105030.8698-7-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: <170620689669.398.1849686617170032778.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: 1784440819692660404 X-GMAIL-MSGID: 1789088115910680604 The following commit has been merged into the x86/fred branch of tip: Commit-ID: 51c158f7aaccc6f6423a61a1df4a0d4c0d9d22a9 Gitweb: https://git.kernel.org/tip/51c158f7aaccc6f6423a61a1df4a0d4c0d9d22a9 Author: H. Peter Anvin (Intel) AuthorDate: Tue, 05 Dec 2023 02:49:55 -08:00 Committer: Thomas Gleixner CommitterDate: Thu, 25 Jan 2024 19:10:30 +01:00 x86/cpufeatures: Add the CPU feature bit for FRED Any FRED enabled CPU will always have the following features as its baseline: 1) LKGS, load attributes of the GS segment but the base address into the IA32_KERNEL_GS_BASE MSR instead of the GS segment’s descriptor cache. 2) WRMSRNS, non-serializing WRMSR for faster MSR writes. 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-7-xin3.li@intel.com --- arch/x86/include/asm/cpufeatures.h | 1 + arch/x86/kernel/cpu/cpuid-deps.c | 2 ++ tools/arch/x86/include/asm/cpufeatures.h | 1 + 3 files changed, 4 insertions(+) diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h index bd05c75..ccbf914 100644 --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h @@ -326,6 +326,7 @@ #define X86_FEATURE_FZRM (12*32+10) /* "" Fast zero-length REP MOVSB */ #define X86_FEATURE_FSRS (12*32+11) /* "" Fast short REP STOSB */ #define X86_FEATURE_FSRC (12*32+12) /* "" Fast short REP {CMPSB,SCASB} */ +#define X86_FEATURE_FRED (12*32+17) /* Flexible Return and Event Delivery */ #define X86_FEATURE_LKGS (12*32+18) /* "" Load "kernel" (userspace) GS */ #define X86_FEATURE_WRMSRNS (12*32+19) /* "" Non-serializing WRMSR */ #define X86_FEATURE_AMX_FP16 (12*32+21) /* "" AMX fp16 Support */ diff --git a/arch/x86/kernel/cpu/cpuid-deps.c b/arch/x86/kernel/cpu/cpuid-deps.c index e462c1d..b717420 100644 --- a/arch/x86/kernel/cpu/cpuid-deps.c +++ b/arch/x86/kernel/cpu/cpuid-deps.c @@ -82,6 +82,8 @@ static const struct cpuid_dep cpuid_deps[] = { { X86_FEATURE_XFD, X86_FEATURE_XGETBV1 }, { X86_FEATURE_AMX_TILE, X86_FEATURE_XFD }, { X86_FEATURE_SHSTK, X86_FEATURE_XSAVES }, + { X86_FEATURE_FRED, X86_FEATURE_LKGS }, + { X86_FEATURE_FRED, X86_FEATURE_WRMSRNS }, {} }; diff --git a/tools/arch/x86/include/asm/cpufeatures.h b/tools/arch/x86/include/asm/cpufeatures.h index 8792841..953e6ef 100644 --- a/tools/arch/x86/include/asm/cpufeatures.h +++ b/tools/arch/x86/include/asm/cpufeatures.h @@ -321,6 +321,7 @@ #define X86_FEATURE_FZRM (12*32+10) /* "" Fast zero-length REP MOVSB */ #define X86_FEATURE_FSRS (12*32+11) /* "" Fast short REP STOSB */ #define X86_FEATURE_FSRC (12*32+12) /* "" Fast short REP {CMPSB,SCASB} */ +#define X86_FEATURE_FRED (12*32+17) /* Flexible Return and Event Delivery */ #define X86_FEATURE_LKGS (12*32+18) /* "" Load "kernel" (userspace) GS */ #define X86_FEATURE_WRMSRNS (12*32+19) /* "" Non-serializing WRMSR */ #define X86_FEATURE_AMX_FP16 (12*32+21) /* "" AMX fp16 Support */