Message ID | 20230410081438.1750-7-xin3.li@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1757182vqo; Mon, 10 Apr 2023 01:42:13 -0700 (PDT) X-Google-Smtp-Source: AKy350aafPdxJKE5u/CzuHafzWIwPdyN44LIjHf94k6nnnU8RuvbgqgWV3rsXR2I0dtFzCkGxTcN X-Received: by 2002:a17:903:2302:b0:1a1:d774:a3d7 with SMTP id d2-20020a170903230200b001a1d774a3d7mr19274222plh.25.1681116133135; Mon, 10 Apr 2023 01:42:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681116133; cv=none; d=google.com; s=arc-20160816; b=jWq/e1ensSDdFOeHn5oa6rP9cSqpfxt4YbFbaXlcNXgH9xuFIJysB2rhJK0Sga4TSb ydDkoRuxAtz/ntEJ8oyU7J8Qm5wzwUGCzBhpTe0DglR3xsNXtp0sEHuDdKImCGPTZSBL +BbOD1/pRKCyGuD4VNb5A9OWLM31OgYHFXw3ALp8DcyGjVWalYxBWu6ElfIuOmLBKTL2 lii3+P65nICjvO7cbkt7oMMoxBhHeIt1KYQp591sAMH/LTpz1Uihs793DE2/jPZ8uCS5 3SCFmEbBQn3j0PXafw0ktr2HLKQ3w00o+4WRFoSxW8Im0y3qfovhsXhMYlSYIUjCv06h O4ow== 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=s1TnurdU9eI1YRCwil5WMrFTmYZQx9ZLxqgiOpLcQhQ=; b=x/mNBK9va1W4aK/xDDWuAFSH0TR4sC0qvisoncwumf6NMB+TRUQ1kYW9C2nELRdZoT YDAHEeLSUK3fiigakVRK9V9xyIoSREBQECLy4pTlY6c/o97ryrJ2gYn2SJWru7T4TdiM tcYjAuw6LLuo738vTl2mZ2LOkDvY7p1cLjkgFEoHLA8Ameksrf6YDR1duKXBlkV06ihx 6qEJDOJgYQi5V6DaSwqJG6io/HYBLdDmVLGFCpGvOecsS82BFPAhELDhuqrdupPLPI11 cic/gvCLTULU0Af4kdQqQNyE29HaCz93ZVgwyPNsf4SUm81XREfnpG9lJG9Na0RXxGHB ZA+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=kqsuerdK; 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=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t2-20020a632d02000000b00513b0d416e4si9705532pgt.599.2023.04.10.01.42.01; Mon, 10 Apr 2023 01:42:13 -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=@intel.com header.s=Intel header.b=kqsuerdK; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229773AbjDJIlW (ORCPT <rfc822;a1648639935@gmail.com> + 99 others); Mon, 10 Apr 2023 04:41:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229703AbjDJIlG (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 10 Apr 2023 04:41:06 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49A513AB1; Mon, 10 Apr 2023 01:41:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681116065; x=1712652065; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=g68cyMdX2debPTjgjq16HL+D6AhwC/hj42OGPtnTvek=; b=kqsuerdKQpgC0EErWd+pi1duB5FXb6jTjqMA4HtS1HDmMMMRBXvZZOes AiVwBo6GdJMnMELzqJ/X4S1I4e3wfWvG942JruqXRZqanaISm5HiRXKZc /qNkYoPTE/q6RAhXSCPeaXbp/i2H4+lpAVOik2LUGCEBvxaf0haRLzBh+ JGs4+zp/kmyhZZyPaKVz5VngZa4TdVRyn7swwnLUg08p2WD/r7tRmDd6F g80SUCaqoMCK0aK6OHQc7hR2i5yL1byA+vUV3Pk0WD3PCho7onbdLoLgV BZ8LJhpA7InhTJKroGEPJxhbSbuQz3pjg7BXlcFNH+eN3i0ARj6jdbLvj w==; X-IronPort-AV: E=McAfee;i="6600,9927,10675"; a="342077923" X-IronPort-AV: E=Sophos;i="5.98,333,1673942400"; d="scan'208";a="342077923" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Apr 2023 01:41:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10675"; a="799436259" X-IronPort-AV: E=Sophos;i="5.98,333,1673942400"; d="scan'208";a="799436259" Received: from unknown (HELO fred..) ([172.25.112.68]) by fmsmga002.fm.intel.com with ESMTP; 10 Apr 2023 01:41:02 -0700 From: Xin Li <xin3.li@intel.com> To: linux-kernel@vger.kernel.org, x86@kernel.org, kvm@vger.kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, peterz@infradead.org, andrew.cooper3@citrix.com, seanjc@google.com, pbonzini@redhat.com, ravi.v.shankar@intel.com, jiangshanlai@gmail.com, shan.kang@intel.com Subject: [PATCH v8 06/33] x86/cpufeature: add the cpu feature bit for FRED Date: Mon, 10 Apr 2023 01:14:11 -0700 Message-Id: <20230410081438.1750-7-xin3.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230410081438.1750-1-xin3.li@intel.com> References: <20230410081438.1750-1-xin3.li@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762778030606506807?= X-GMAIL-MSGID: =?utf-8?q?1762778030606506807?= |
Series |
x86: enable FRED for x86-64
|
|
Commit Message
Li, Xin3
April 10, 2023, 8:14 a.m. UTC
From: "H. Peter Anvin (Intel)" <hpa@zytor.com> Add the CPU feature bit for FRED (Flexible Return and Event Delivery). The Intel flexible return and event delivery (FRED) architecture defines simple new transitions that change privilege level (ring transitions). The FRED architecture was designed with the following goals: 1) Improve overall performance and response time by replacing event delivery through the interrupt descriptor table (IDT event delivery) and event return by the IRET instruction with lower latency transitions. 2) Improve software robustness by ensuring that event delivery establishes the full supervisor context and that event return establishes the full user context. The new transitions defined by the FRED architecture are FRED event delivery and, for returning from events, two FRED return instructions. FRED event delivery can effect a transition from ring 3 to ring 0, but it is used also to deliver events incident to ring 0. One FRED instruction (ERETU) effects a return from ring 0 to ring 3, while the other (ERETS) returns while remaining in ring 0. Search for the latest FRED spec in most search engines with this search pattern: site:intel.com FRED (flexible return and event delivery) specification Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com> Tested-by: Shan Kang <shan.kang@intel.com> Signed-off-by: Xin Li <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 73c9672c123b..1fa444478d33 100644 --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h @@ -318,6 +318,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_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 b89005819cd5..e9064f4a011a 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_FRED (12*32+17) /* Flexible Return and Event Delivery */ #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 */