From patchwork Mon Jun 6 18:08:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Levitsky X-Patchwork-Id: 12870756 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 C5C3DC433EF for ; Mon, 6 Jun 2022 18:08:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231139AbiFFSIm (ORCPT ); Mon, 6 Jun 2022 14:08:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230218AbiFFSIl (ORCPT ); Mon, 6 Jun 2022 14:08:41 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 37D721FCC7 for ; Mon, 6 Jun 2022 11:08:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654538919; 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=U+KgFftnN6DMnXXkePugl57yvd3ZUVGOjzbkB2GcSPM=; b=ddAqL2JONNqzd0weJ3hw/r5YpsBuW7IFaSGsd6NsEcK32IWRMNtiLDogzT8fZ/SdthCAHG JZElrGtj+RJUzaDk9UNWfCBFqIWGtQRJnfU8ZgtPYvbMgRzarCIfFGB0Uvm2HAM0ddiPcm Z6tpbfd0MpCjvjMpBJdlZ1dpZpT2hoc= 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-252-_oL6_bKdNkef3f4x6Cg3LA-1; Mon, 06 Jun 2022 14:08:35 -0400 X-MC-Unique: _oL6_bKdNkef3f4x6Cg3LA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 888B8858EFF; Mon, 6 Jun 2022 18:08:34 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id BBC331121314; Mon, 6 Jun 2022 18:08:30 +0000 (UTC) From: Maxim Levitsky To: kvm@vger.kernel.org Cc: Wanpeng Li , Vitaly Kuznetsov , Sean Christopherson , Jim Mattson , "H. Peter Anvin" , Joerg Roedel , Dave Hansen , Ingo Molnar , Suravee Suthikulpanit , linux-kernel@vger.kernel.org, Maxim Levitsky , Thomas Gleixner , x86@kernel.org, Borislav Petkov , Paolo Bonzini Subject: [PATCH 0/7] KVM: x86: AVIC/APICv patch queue Date: Mon, 6 Jun 2022 21:08:22 +0300 Message-Id: <20220606180829.102503-1-mlevitsk@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org This patch series contains a few fixes that I worked on recently. Also included another attempt to add inhibit when the guest had changed apic id and/or apic base. I also tested AVIC with full preemption and found few bugs, which are now hopefully fixed. Best regards, Maxim Levitsky Maxim Levitsky (7): KVM: x86: document AVIC/APICv inhibit reasons KVM: x86: inhibit APICv/AVIC when the guest and/or host changes either apic id or the apic base from their default values. KVM: x86: SVM: remove avic's broken code that updated APIC ID KVM: x86: SVM: fix avic_kick_target_vcpus_fast KVM: x86: disable preemption while updating apicv inhibition KVM: x86: disable preemption around the call to kvm_arch_vcpu_{un|}blocking KVM: x86: SVM: there is no need for preempt safe wrappers for avic_vcpu_load/put arch/x86/include/asm/kvm_host.h | 68 ++++++++++++- arch/x86/kvm/lapic.c | 27 ++++- arch/x86/kvm/svm/avic.c | 171 ++++++++++++++------------------ arch/x86/kvm/svm/svm.c | 4 +- arch/x86/kvm/svm/svm.h | 4 +- arch/x86/kvm/vmx/vmx.c | 4 +- arch/x86/kvm/x86.c | 2 + virt/kvm/kvm_main.c | 8 +- 8 files changed, 180 insertions(+), 108 deletions(-)