From patchwork Wed Apr 27 20:02:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Levitsky X-Patchwork-Id: 12829487 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 86994C4332F for ; Wed, 27 Apr 2022 20:03:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A979F10E259; Wed, 27 Apr 2022 20:03:31 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8F3CA10E1AE for ; Wed, 27 Apr 2022 20:03:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651089808; 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=rEkeuIdB35PHG3bUObFOQepcEtD/UETXCeHTXiNw/W4=; b=fnFLXxu6+3pvjpUYbE4MPzxDQ4fniY6Oq4z2bPerZFfnmbGBHZ5MxZUFFFCfiRTvRb5P2h 0S28lS0FOU8gE6T2klZwoEUeCcZ1Acs3Pquk9heijwPl4S1Leyj4U1RZb5c2/1+hk7L2M8 nuko1VLJ67hXCJ9zPpl7c3WKzEUWpRo= 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-115-ue9yikiaOze3pcESmgHcQA-1; Wed, 27 Apr 2022 16:03:24 -0400 X-MC-Unique: ue9yikiaOze3pcESmgHcQA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0E67B3C10AA2; Wed, 27 Apr 2022 20:03:23 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 080E87C55; Wed, 27 Apr 2022 20:03:15 +0000 (UTC) From: Maxim Levitsky To: kvm@vger.kernel.org Date: Wed, 27 Apr 2022 23:02:55 +0300 Message-Id: <20220427200314.276673-1-mlevitsk@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 Subject: [Intel-gfx] [RFC PATCH v3 00/19] RFC: nested AVIC X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Wanpeng Li , David Airlie , Dave Hansen , dri-devel@lists.freedesktop.org, "H. Peter Anvin" , Brijesh Singh , Joerg Roedel , x86@kernel.org, Maxim Levitsky , Ingo Molnar , Tom Lendacky , intel-gfx@lists.freedesktop.org, Borislav Petkov , Rodrigo Vivi , Thomas Gleixner , intel-gvt-dev@lists.freedesktop.org, Jim Mattson , Sean Christopherson , linux-kernel@vger.kernel.org, Paolo Bonzini , Vitaly Kuznetsov Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" This is V3 of my nested AVIC patches. I fixed few more bugs, and I also split the cod insto smaller patches. Review is welcome! Best regards, Maxim Levitsky Maxim Levitsky (19): KVM: x86: document AVIC/APICv inhibit reasons KVM: x86: inhibit APICv/AVIC when the guest and/or host changes apic id/base from the defaults. KVM: x86: SVM: remove avic's broken code that updated APIC ID KVM: x86: mmu: allow to enable write tracking externally x86: KVMGT: use kvm_page_track_write_tracking_enable KVM: x86: mmu: add gfn_in_memslot helper KVM: x86: mmu: tweak fast path for emulation of access to nested NPT pages KVM: x86: SVM: move avic state to separate struct KVM: x86: nSVM: add nested AVIC tracepoints KVM: x86: nSVM: implement AVIC's physid/logid table access helpers KVM: x86: nSVM: implement shadowing of AVIC's physical id table KVM: x86: nSVM: make nested AVIC physid write tracking be aware of the host scheduling KVM: x86: nSVM: wire nested AVIC to nested guest entry/exit KVM: x86: rename .set_apic_access_page_addr to reload_apic_access_page KVM: x86: nSVM: add code to reload AVIC physid table when it is invalidated KVM: x86: nSVM: implement support for nested AVIC vmexits KVM: x86: nSVM: implement nested AVIC doorbell emulation KVM: x86: SVM/nSVM: add optional non strict AVIC doorbell mode KVM: x86: nSVM: expose the nested AVIC to the guest arch/x86/include/asm/kvm-x86-ops.h | 2 +- arch/x86/include/asm/kvm_host.h | 23 +- arch/x86/include/asm/kvm_page_track.h | 1 + arch/x86/kvm/Kconfig | 3 - arch/x86/kvm/lapic.c | 25 +- arch/x86/kvm/lapic.h | 8 + arch/x86/kvm/mmu.h | 8 +- arch/x86/kvm/mmu/mmu.c | 21 +- arch/x86/kvm/mmu/page_track.c | 10 +- arch/x86/kvm/svm/avic.c | 985 +++++++++++++++++++++++--- arch/x86/kvm/svm/nested.c | 141 +++- arch/x86/kvm/svm/svm.c | 39 +- arch/x86/kvm/svm/svm.h | 166 ++++- arch/x86/kvm/trace.h | 157 +++- arch/x86/kvm/vmx/vmx.c | 8 +- arch/x86/kvm/x86.c | 19 +- drivers/gpu/drm/i915/Kconfig | 1 - drivers/gpu/drm/i915/gvt/kvmgt.c | 5 + include/linux/kvm_host.h | 10 +- 19 files changed, 1507 insertions(+), 125 deletions(-)