Message ID | 20221117143242.102721-6-mlevitsk@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp433638wrr; Thu, 17 Nov 2022 06:36:01 -0800 (PST) X-Google-Smtp-Source: AA0mqf4OSqlNs2hW6NGryy87kmGDWfUUn+bZUCBpdzKcKt3siw2udbOour1+/40B8FEh3JVBNE+P X-Received: by 2002:a17:902:eb86:b0:188:c395:1748 with SMTP id q6-20020a170902eb8600b00188c3951748mr2806750plg.155.1668695761635; Thu, 17 Nov 2022 06:36:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668695761; cv=none; d=google.com; s=arc-20160816; b=pMH8oPI5PCutzFzqp/NiZRwncnZwoDYDl85w8VCOlA3ZtBaVyIPlshGjwabMZKsFPQ iW4oHHfTZHfuzmhr/kmi5lwQlCu0u4MlUX+PMfztEjOMYvyDRtmHDenbIIkAZVomoUHX 3qJKLMDq7/fZApbUJax7Xpwfagu8/Xcusix8kIXJoH5G6smDykD55T1ex5vx1SA3fhix qQr8BKMaW+tITjrQPBWSDuTL0odEjjtQSckf5Xui7SEL0p+5wF+FDOH5lneXksgQ32uO 5CtB1TZRqlpIfqxmm/rCReICr6XogacnfmkpCw+lcmB9wQ9l7jc5DPghsY7jU4praA8q oIzw== 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=jSFZZCAEySlCF5KURW1fd9eOz0e4b0R1xYf15+jkIuw=; b=WV7mhsRXR8lqR3tLrfaAHgPhQ+aUslVw0U2oePOWMwrfq7UIim5OIvy0grTiuZ2rUT KMNav2R/5nFUBZZWiAljRwzKomdF/6Fly3RJ6Wb45w6e3XiK0M8bPWWglH+0WO5YQa3n c/WIjPIwljlMZilUL1MZFzbeX882cUCUt41xley83myzVPxif4pxfqjvfiXP577FIS3m FpTlziQFKdyq+xfzjuSFzWqovQRoVvGcAihCXBxQ619RUOwVmaPZfaLSNH67I1j2P4JN Fue9XyCfXNb1GNZIiKC/axI4bJniJZJglfeveQFmqaXfIlZo2H4iFCbhC66EaNu6+ql1 W7KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RDH+B+b5; 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=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u17-20020a632351000000b00476759b878csi1177783pgm.328.2022.11.17.06.35.48; Thu, 17 Nov 2022 06:36:01 -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=@redhat.com header.s=mimecast20190719 header.b=RDH+B+b5; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240489AbiKQOe6 (ORCPT <rfc822;a1648639935@gmail.com> + 99 others); Thu, 17 Nov 2022 09:34:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240397AbiKQOeR (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 17 Nov 2022 09:34:17 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E2627722E for <linux-kernel@vger.kernel.org>; Thu, 17 Nov 2022 06:33:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668695590; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jSFZZCAEySlCF5KURW1fd9eOz0e4b0R1xYf15+jkIuw=; b=RDH+B+b5DaqukZ4oFchza44n17Zyh48DoReiIRSEFnT2IUUsNdnR8CcoJxxeqWgpD7ZPCn kZs6/HnxkD43KeFT2NFcQWHE0ei25AqiHu34bM1FjpUhCuOZ7URBxRsbLnBrlpPVWARpQW 3CHVv8O0tQ0ZqJ0713NcBM5aPZhoIBw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-353-dbc2GAnvMiOz5BpZwxvPuA-1; Thu, 17 Nov 2022 09:33:06 -0500 X-MC-Unique: dbc2GAnvMiOz5BpZwxvPuA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BF35F101E152; Thu, 17 Nov 2022 14:33:05 +0000 (UTC) Received: from amdlaptop.tlv.redhat.com (dhcp-4-238.tlv.redhat.com [10.35.4.238]) by smtp.corp.redhat.com (Postfix) with ESMTP id 653D62166B29; Thu, 17 Nov 2022 14:33:02 +0000 (UTC) From: Maxim Levitsky <mlevitsk@redhat.com> To: kvm@vger.kernel.org Cc: Paolo Bonzini <pbonzini@redhat.com>, Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>, Dave Hansen <dave.hansen@linux.intel.com>, linux-kernel@vger.kernel.org, Peter Zijlstra <peterz@infradead.org>, Thomas Gleixner <tglx@linutronix.de>, Sandipan Das <sandipan.das@amd.com>, Daniel Sneddon <daniel.sneddon@linux.intel.com>, Jing Liu <jing2.liu@intel.com>, Josh Poimboeuf <jpoimboe@kernel.org>, Wyes Karny <wyes.karny@amd.com>, Borislav Petkov <bp@alien8.de>, Babu Moger <babu.moger@amd.com>, Pawan Gupta <pawan.kumar.gupta@linux.intel.com>, Sean Christopherson <seanjc@google.com>, Jim Mattson <jmattson@google.com>, x86@kernel.org, Maxim Levitsky <mlevitsk@redhat.com>, Santosh Shukla <santosh.shukla@amd.com> Subject: [PATCH 05/13] x86/cpu: Add CPUID feature bit for VNMI Date: Thu, 17 Nov 2022 16:32:34 +0200 Message-Id: <20221117143242.102721-6-mlevitsk@redhat.com> In-Reply-To: <20221117143242.102721-1-mlevitsk@redhat.com> References: <20221117143242.102721-1-mlevitsk@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,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?1749754326974978827?= X-GMAIL-MSGID: =?utf-8?q?1749754326974978827?= |
Series |
SVM: vNMI (with my fixes)
|
|
Commit Message
Maxim Levitsky
Nov. 17, 2022, 2:32 p.m. UTC
From: Santosh Shukla <santosh.shukla@amd.com> VNMI feature allows the hypervisor to inject NMI into the guest w/o using Event injection mechanism, The benefit of using VNMI over the event Injection that does not require tracking the Guest's NMI state and intercepting the IRET for the NMI completion. VNMI achieves that by exposing 3 capability bits in VMCB intr_cntrl which helps with virtualizing NMI injection and NMI_Masking. The presence of this feature is indicated via the CPUID function 0x8000000A_EDX[25]. Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com> Signed-off-by: Santosh Shukla <santosh.shukla@amd.com> --- arch/x86/include/asm/cpufeatures.h | 1 + 1 file changed, 1 insertion(+)
diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h index b71f4f2ecdd571..23bd69848d271e 100644 --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h @@ -356,6 +356,7 @@ #define X86_FEATURE_VGIF (15*32+16) /* Virtual GIF */ #define X86_FEATURE_X2AVIC (15*32+18) /* Virtual x2apic */ #define X86_FEATURE_V_SPEC_CTRL (15*32+20) /* Virtual SPEC_CTRL */ +#define X86_FEATURE_AMD_VNMI (15*32+25) /* Virtual NMI */ #define X86_FEATURE_SVME_ADDR_CHK (15*32+28) /* "" SVME addr check */ /* Intel-defined CPU features, CPUID level 0x00000007:0 (ECX), word 16 */