Message ID | 20221117143242.102721-14-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 q4csp444046wrr; Thu, 17 Nov 2022 06:58:47 -0800 (PST) X-Google-Smtp-Source: AA0mqf5mVFwn+Ha0VHj1+ynuUhmdKO05nFfaG02Roxx3wXBkuFk/iFG2UF0nWMguWepU5GpPt+A9 X-Received: by 2002:a05:6402:22f7:b0:462:5f37:5a22 with SMTP id dn23-20020a05640222f700b004625f375a22mr2484676edb.226.1668697127144; Thu, 17 Nov 2022 06:58:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668697127; cv=none; d=google.com; s=arc-20160816; b=bSRQewkEOCisS/Grw5Mzdp8+uF+XH7VlxA6spptfu6/Z7NJF5koZgLXLhfoz/55AIi 7BVfNsmEKtLJ/iYraLw6sdP8iHtsOIkV31Br3/vLr+3U2wsulOkE42eZ7x4Yg3ku2wpa yv5JF9cjOZP8c2dzhfC/IC1aILomWjM5t85MTQijVO8BT5zc9L84TguPV9/y2WXW9VHs ddlY4keQWN4JTQ2LcWsA3VTnWlopeXSXqCrvOUAoW+szTV3iIesx3GjuOmkspbJaL3xe 5hcG6Y93Up+ik7QV2hMV+QBcq69n9pFmTPwIQgdJZftjDIuC/MZWjAEOlSz3+6k5lDNI braQ== 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=l5d3UROtrmIXOlx4UW5lVsYBe3iueIG6WmdS7Aa6h3c=; b=xS9WWWjM4uc8OkBeYQCHZUe5+4MYiGAMKYKIYHsIY6EhFcSv2TioEuS8XJVWDxj4lo 7QBjXvhqCKSYbteAnXtYMjcLFcirgS0FAjEEq6WVDBHtyJ0OKCrDx//s6th1CT8zDB2j E8k19tEvS7qENp6hoTUALeWbjycz7bLVmlutn+46F9S4mI1muDWuh8Kq4fiTfewkw7Ku R3u0GkhXj3PZxGxVB/xJlDwHundEnVHs9qT9HJKzSMP/f4OuyIHHgSkjFI/jqr5uysPl V1CU2taU97rOGCGpOWPwDaxxAdWkVdBD9DuRzkD6dZyghAuDPSykjCUoIgkRdJvR0xuu Q+qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Ws1tFKIg; 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 y6-20020a056402440600b0045d8bff7afesi1156427eda.376.2022.11.17.06.58.23; Thu, 17 Nov 2022 06:58:47 -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=Ws1tFKIg; 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 S240496AbiKQOgE (ORCPT <rfc822;a1648639935@gmail.com> + 99 others); Thu, 17 Nov 2022 09:36:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240481AbiKQOeu (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 17 Nov 2022 09:34:50 -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 503975D6AC for <linux-kernel@vger.kernel.org>; Thu, 17 Nov 2022 06:33:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668695620; 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=l5d3UROtrmIXOlx4UW5lVsYBe3iueIG6WmdS7Aa6h3c=; b=Ws1tFKIg5C0Blqx4Q00dQaZfX4chtqS5097Z1F3WC9dGr2Gob6fzyInDXvq5dttrFttFWk V1G2fZPMfcYA2qcfBN+a3iiC6AsjF8yHlC78jsIW9hIt6arBavFgthz4zZHijdLa9L0hoQ 7il2LFn3+e77C87h8qwMzbJQUDyV8Jk= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-501-Ol7uoAMDP2C3N8X_GQ_pGg-1; Thu, 17 Nov 2022 09:33:37 -0500 X-MC-Unique: Ol7uoAMDP2C3N8X_GQ_pGg-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 26FC01C08975; Thu, 17 Nov 2022 14:33:36 +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 98BC32166B29; Thu, 17 Nov 2022 14:33:32 +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 13/13] KVM: SVM: Enable VNMI feature Date: Thu, 17 Nov 2022 16:32:42 +0200 Message-Id: <20221117143242.102721-14-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=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: <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?1749755758826639729?= X-GMAIL-MSGID: =?utf-8?q?1749755758826639729?= |
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> Enable the NMI virtualization (V_NMI_ENABLE) in the VMCB interrupt control when the vnmi module parameter is set. Signed-off-by: Santosh Shukla <santosh.shukla@amd.com> Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com> --- arch/x86/kvm/svm/svm.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index c9190a8ee03273..5b61d89c644da6 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -1307,6 +1307,9 @@ static void init_vmcb(struct kvm_vcpu *vcpu) if (kvm_vcpu_apicv_active(vcpu)) avic_init_vmcb(svm, vmcb); + if (vnmi) + svm->vmcb->control.int_ctl |= V_NMI_ENABLE; + if (vgif) { svm_clr_intercept(svm, INTERCEPT_STGI); svm_clr_intercept(svm, INTERCEPT_CLGI);