Message ID | 20221117143242.102721-1-mlevitsk@redhat.com |
---|---|
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 q4csp433200wrr; Thu, 17 Nov 2022 06:35:14 -0800 (PST) X-Google-Smtp-Source: AA0mqf4KqBS+6Hqd5qHiNyh8nUiYO3sfe7cMEGd6A4au1t3VSgReTACH4rMOW5DCF4YNTLanXPii X-Received: by 2002:aa7:8709:0:b0:572:2189:84ef with SMTP id b9-20020aa78709000000b00572218984efmr3222802pfo.28.1668695714308; Thu, 17 Nov 2022 06:35:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668695714; cv=none; d=google.com; s=arc-20160816; b=knivyclaxQ2+PxjUYPD0LfQNcI2Fc6dJJ+tGTlcE9jjRxOYBl5BL/zeDM+uzmE3aFO I//0Tf3Ok9tfRyi0cIizrag55m3XDz5CCIiwX8mkJrRSnjOtWBTamncEnN1TC1vsxceK 7OLzQkFP8I97lEjZBHeojMP96ubYB/abt4kbpnwvHadx7eOyBbYzirz7R+eiNIKy3nfd UAEzHdWP23/+0sZWS6JvIksaacqH+PmPzeSKyIp59lfx1DR7uov3NPMSuX9u4o8oKLrS PthkmVZaZOk0PuQkC77bd1c31nQa8LfXx2/2fk+b4ndCqCTVC5cX1/8pM0wCQzRbkfXn krYQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=lbVyA8e03/oayhLH0NTwSULaemKUfym9WQ80/S7gmjE=; b=ROFrCJlWvMYWopOG36E1FnLlxRBYVtJu9cJd0qNdYKRToUPkYTugXa3wossWk9nTZN 5RSqW2Qq4Apm2KCm/BEsd6CbXaIZmA2Y9Fnf1wM/FR95wLJ6ekPCFP50BMc+2kd/s4zm tI3nt+LHkM4D/uhEKnGKbuSE5aQiPt7qAZUV7nApIaqy99WIbYdYOZfxz3+4hItAStZ8 WaTIdQdB/tFMjPM23r+f6lYWrzI35G/fRJ+9S4ZbuA453dIJ2aqJsyEXcg7Uu4YA/dxn aij3j0HcQr0XH9rLDbP148V1GDOcqJq1aFhVU4jtjB4k6y3jzL/h122U0YDVG2xahIXi Zjew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VmGpBY5Z; 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 r17-20020a63ce51000000b0046ecbfda052si1136199pgi.389.2022.11.17.06.34.58; Thu, 17 Nov 2022 06:35:14 -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=VmGpBY5Z; 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 S240338AbiKQOeI (ORCPT <rfc822;a1648639935@gmail.com> + 99 others); Thu, 17 Nov 2022 09:34:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239977AbiKQOdt (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 17 Nov 2022 09:33:49 -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 9A5C57720D for <linux-kernel@vger.kernel.org>; Thu, 17 Nov 2022 06:32:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668695574; h=from:from: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; bh=lbVyA8e03/oayhLH0NTwSULaemKUfym9WQ80/S7gmjE=; b=VmGpBY5Zb39Te2De3CUjIguLByth9+l2tjUufTC4E74jWvR/WKmKUfjJgwo/+4mvO35T1J vDRGLiiRObjJXg5oLw1xC1e6kdxLn0DO6Ft20iXLa3pSA/GUTp/6a3+wbv9qjYDOtrjumg j36SwKukWIAs9Am2V5kiJItzI8516r0= 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-79-IWHx6XvEM62PLM7C-VCOpw-1; Thu, 17 Nov 2022 09:32:48 -0500 X-MC-Unique: IWHx6XvEM62PLM7C-VCOpw-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 7AD0F85A5A6; Thu, 17 Nov 2022 14:32:47 +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 DCC2A2166B29; Thu, 17 Nov 2022 14:32:43 +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> Subject: [PATCH 00/13] SVM: vNMI (with my fixes) Date: Thu, 17 Nov 2022 16:32:29 +0200 Message-Id: <20221117143242.102721-1-mlevitsk@redhat.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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?1749754276889406657?= X-GMAIL-MSGID: =?utf-8?q?1749754276889406657?= |
Series |
SVM: vNMI (with my fixes)
|
|
Message
Maxim Levitsky
Nov. 17, 2022, 2:32 p.m. UTC
Hi! This is the vNMI patch series from Santosh Shukla with few small fixes from me: 1. When a vNMI injection is pending, then to allow to not delay for an unbounded time the injection of another NMI that could arrive before the first vNMI injection is done, I added the code that would intercept IRET/RSM/STGI and then try the injection again. 2. I slighlty modified the 'KVM: SVM: Add VNMI support in get/set_nmi_mask' to have WARN_ON in vNMI functions when called without vNMI enabled. Also NMI mask/unmask should be allowed regardless if SMM is active, to support migration. 3. I did some refactoring in the code which updates the int_ctl in vmcb12 on nested VM exit, and updated the patch 'KVM: nSVM: implement nested VNMI' to use this. 4. I added my reviewed-by to all the patches which I didn't change. I only tested this on a machine which doesn't have vNMI, so this does need some testing to ensure that nothing is broken. Another thing I haven't looked at in depth yet is migration, I think there is a bug because with vNMI, now in practise we can have 2 NMIs injected to the guest, one in service, one 'pending injection' but no longer pending from KVM point of view, and the KVM doesn't take this in account in kvm_vcpu_ioctl_x86_get_vcpu_events,a and maybe more. Best regards, Maxim Levitsky Maxim Levitsky (5): KVM: nSVM: don't sync back tlb_ctl on nested VM exit KVM: nSVM: don't call nested_sync_control_from_vmcb02 on each VM exit KVM: nSVM: rename nested_sync_control_from_vmcb02 to nested_sync_int_ctl_from_vmcb02 KVM: nSVM: clean up copying of int_ctl fields back to vmcb01/vmcb12 KVM: SVM: allow NMI window with vNMI Santosh Shukla (8): x86/cpu: Add CPUID feature bit for VNMI KVM: SVM: Add VNMI bit definition KVM: SVM: Add VNMI support in get/set_nmi_mask KVM: SVM: Report NMI not allowed when Guest busy handling VNMI KVM: SVM: Add VNMI support in inject_nmi KVM: nSVM: implement nested VNMI KVM: nSVM: emulate VMEXIT_INVALID case for nested VNMI KVM: SVM: Enable VNMI feature arch/x86/include/asm/cpufeatures.h | 1 + arch/x86/include/asm/svm.h | 7 +++ arch/x86/kvm/svm/nested.c | 84 +++++++++++++++++++++--------- arch/x86/kvm/svm/svm.c | 60 ++++++++++++++++++--- arch/x86/kvm/svm/svm.h | 70 ++++++++++++++++++++++++- 5 files changed, 189 insertions(+), 33 deletions(-) -- 2.34.3