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: 12829469 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 148B3C433F5 for ; Wed, 27 Apr 2022 20:03:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234282AbiD0UGl (ORCPT ); Wed, 27 Apr 2022 16:06:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230177AbiD0UGk (ORCPT ); Wed, 27 Apr 2022 16:06:40 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 652D5C03 for ; Wed, 27 Apr 2022 13:03:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651089807; 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=gxyFivBnWm2ccPoNc0+7vH4YY9YxaYGWepGmWCAr+Y9TH0Ty8dXlVUizDm46WpzUir8ZXs laQVQNEe7dnowk7FhA/o74uiE+1BLp3GjZGpgoKW3V0XiYZl7APQHK8DTaEZM0Kgr0kGyg H588KsSAk3LQpuqVOiCZuRlGjld7BQU= 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 Cc: Wanpeng Li , Vitaly Kuznetsov , Jani Nikula , Paolo Bonzini , Tvrtko Ursulin , Rodrigo Vivi , Zhenyu Wang , Joonas Lahtinen , Tom Lendacky , Ingo Molnar , David Airlie , Thomas Gleixner , Dave Hansen , x86@kernel.org, intel-gfx@lists.freedesktop.org, Sean Christopherson , Daniel Vetter , Borislav Petkov , Joerg Roedel , linux-kernel@vger.kernel.org, Jim Mattson , Zhi Wang , Brijesh Singh , "H. Peter Anvin" , intel-gvt-dev@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Maxim Levitsky Subject: [RFC PATCH v3 00/19] RFC: nested AVIC 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 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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(-)