From patchwork Thu Jan 12 12:16:33 2023 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: 42398 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3848218wrt; Thu, 12 Jan 2023 04:17:55 -0800 (PST) X-Google-Smtp-Source: AMrXdXsWDTqe+DZgUQnrRhv6BAUvWYq2brCFD2W16rs/betF28HVhV8h6qTtTHPWkPmQ5MOL9gcx X-Received: by 2002:a05:6a20:d2c6:b0:af:8ca0:dd45 with SMTP id ir6-20020a056a20d2c600b000af8ca0dd45mr92857610pzb.41.1673525875024; Thu, 12 Jan 2023 04:17:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673525875; cv=none; d=google.com; s=arc-20160816; b=UqRN+8ylBjEOqsOMDs+RSiQXUEszk9f/j3h61Sr0KCck9b2vhkjO/AkcQ0hS4uJl1M aaO/aTlVIImt4d7y7pffRzvaPWOn1o8YtxFPzJZ3ZE11Q01g5NfXURgtg7nPaCbucLDj 5w5J0dGmLCX7sY9EHobTIlqwaeTeW4Mo3HG25K1ID+9x8aPcT3wrXzML0931EGTNqxxB 3ye9NQxzq3HJP/RyH62Y596osD8L/LlQVNT9m1hALK/WasE629f53SvRKG+PSYAP8ULH vdeI6LnGo/c6Vr0kEAV1ITS2LfI2k4GL9rietSLxJSIRgTQk5u/stCfBUQ/Y99BK5EyX 891A== 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=Bi+ExeYkOPbHhIAX1f7wJ9qfV6qFZ9z26zQbrh429vo=; b=K5Llg2tWUon51hq5hTaxqTTInv3ttxi6hejxS6eqfKXriG2bkXQshu9kiCWrN1HaWT Of8F/H+I5vR0G5w8hScrUXAJdaETCNyhH5dQrH35q3Zdwi6s8FtxZVNcmuYSfdgqOBCy +R6KfAUuPX6X+JXA0LMoInPri3nHwHcFm48IBFmU0k83WwvaPiOmbrmhd3/ztZuWveuI nyhvLuEhfDSxfLF9iXjPVmKsWQpk4/y+fwleN1E42T8M8eAO/A5vq6W6nlJ1CHT1Ibn2 mXmU9vu6bVExN9YqBmOjgulDehN4QnwDeynDcPbPSGma5QxgkfC27f5yjk3IW+RVaCZa WKRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Q1jlED7T; dkim=neutral (no key) header.i=@linutronix.de; 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 i2-20020a17090ac40200b002268aa2b8b0si16383897pjt.88.2023.01.12.04.17.42; Thu, 12 Jan 2023 04:17:55 -0800 (PST) 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=Q1jlED7T; dkim=neutral (no key) header.i=@linutronix.de; 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 S229952AbjALMRS (ORCPT + 99 others); Thu, 12 Jan 2023 07:17:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235059AbjALMQh (ORCPT ); Thu, 12 Jan 2023 07:16:37 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A52B178BD; Thu, 12 Jan 2023 04:16:35 -0800 (PST) Date: Thu, 12 Jan 2023 12:16:33 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1673525793; 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=Bi+ExeYkOPbHhIAX1f7wJ9qfV6qFZ9z26zQbrh429vo=; b=Q1jlED7T0yntfen4zoO85B6YaBj0s7p8F0AcGDbTJQm/3QNL7xmX3MkO52uZPnI3HR2dkT qJP+BDGXOQJrIR3kl3LPU9icLQBvqgi3bcGoQLuQ7PajWWQVJpReDbKH4EHCTHcr5nSTkz 8y9G5qYAC5EFXeGWFiH0YTsPNfTulgwz1jsqoQnItzGND8cOSDZJV6Bx5zzOm958GSwUo0 6KO9iHFXrPahdNIcrJtUMQkgtR+c41lCKAKMsVzfleqjGJfKg8U79HSTevgjfm1V3wuakB FaVZAlPRnJ5sgMgjr+IgUUGRu4nSg+EgEuX8Nfme/lpRMwUvcOTMoHuXQoMhgQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1673525793; 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=Bi+ExeYkOPbHhIAX1f7wJ9qfV6qFZ9z26zQbrh429vo=; b=bWnrcEeWnYOKYdsCjwAYL8nfUyE4P6yehJyC0bCTgDulU70c9Jfoti2BOrBuS2blvtgoZD GmD/BpNv5jkQwkAw== 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/cpu] x86/cpufeature: Add the CPU feature bit for LKGS Cc: "H. Peter Anvin (Intel)" , Xin Li , Ingo Molnar , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230112072032.35626-2-xin3.li@intel.com> References: <20230112072032.35626-2-xin3.li@intel.com> MIME-Version: 1.0 Message-ID: <167352579328.4906.12902713679275801421.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 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?1754819067587656952?= X-GMAIL-MSGID: =?utf-8?q?1754819067587656952?= The following commit has been merged into the x86/cpu branch of tip: Commit-ID: 660569472dd7ac64571375b6727c3f2c1d70ba40 Gitweb: https://git.kernel.org/tip/660569472dd7ac64571375b6727c3f2c1d70ba40 Author: H. Peter Anvin (Intel) AuthorDate: Wed, 11 Jan 2023 23:20:28 -08:00 Committer: Ingo Molnar CommitterDate: Thu, 12 Jan 2023 13:06:20 +01:00 x86/cpufeature: Add the CPU feature bit for LKGS Add the CPU feature bit for LKGS (Load "Kernel" GS). LKGS instruction is introduced with Intel FRED (flexible return and event delivery) specification. Search for the latest FRED spec in most search engines with this search pattern: site:intel.com FRED (flexible return and event delivery) specification LKGS behaves like the MOV to GS instruction except that it loads the base address into the IA32_KERNEL_GS_BASE MSR instead of the GS segment’s descriptor cache, which is exactly what Linux kernel does to load a user level GS base. Thus, with LKGS, there is no need to SWAPGS away from the kernel GS base. [ mingo: Minor tweaks to the description. ] Signed-off-by: H. Peter Anvin (Intel) Signed-off-by: Xin Li Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230112072032.35626-2-xin3.li@intel.com --- arch/x86/include/asm/cpufeatures.h | 1 + tools/arch/x86/include/asm/cpufeatures.h | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h index 6101247..b70111a 100644 --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h @@ -312,6 +312,7 @@ #define X86_FEATURE_AVX_VNNI (12*32+ 4) /* AVX VNNI instructions */ #define X86_FEATURE_AVX512_BF16 (12*32+ 5) /* AVX512 BFLOAT16 instructions */ #define X86_FEATURE_CMPCCXADD (12*32+ 7) /* "" CMPccXADD instructions */ +#define X86_FEATURE_LKGS (12*32+18) /* "" Load "kernel" (userspace) GS */ #define X86_FEATURE_AMX_FP16 (12*32+21) /* "" AMX fp16 Support */ #define X86_FEATURE_AVX_IFMA (12*32+23) /* "" Support for VPMADD52[H,L]UQ */ diff --git a/tools/arch/x86/include/asm/cpufeatures.h b/tools/arch/x86/include/asm/cpufeatures.h index 6101247..b70111a 100644 --- a/tools/arch/x86/include/asm/cpufeatures.h +++ b/tools/arch/x86/include/asm/cpufeatures.h @@ -312,6 +312,7 @@ #define X86_FEATURE_AVX_VNNI (12*32+ 4) /* AVX VNNI instructions */ #define X86_FEATURE_AVX512_BF16 (12*32+ 5) /* AVX512 BFLOAT16 instructions */ #define X86_FEATURE_CMPCCXADD (12*32+ 7) /* "" CMPccXADD instructions */ +#define X86_FEATURE_LKGS (12*32+18) /* "" Load "kernel" (userspace) GS */ #define X86_FEATURE_AMX_FP16 (12*32+21) /* "" AMX fp16 Support */ #define X86_FEATURE_AVX_IFMA (12*32+23) /* "" Support for VPMADD52[H,L]UQ */