From patchwork Tue Mar 22 17:40:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Levitsky X-Patchwork-Id: 12788857 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 0C836C433EF for ; Tue, 22 Mar 2022 17:41:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239794AbiCVRm1 (ORCPT ); Tue, 22 Mar 2022 13:42:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239786AbiCVRm0 (ORCPT ); Tue, 22 Mar 2022 13:42:26 -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 1DAEF888C8 for ; Tue, 22 Mar 2022 10:40:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647970858; 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=Ne0+XLEONvmZcIPI7aFLzd/4MUtOgZ2yVyR/Gh6tcI8=; b=dPr+terD6X9+h4GDmrHO+dv+ATFXkpTFkIwWBm+27qeABDrIhfStrY7RxSWSMqozbhsZ+v QoVmvejAZrqNmqUtq6xR9j8AAh1FWY5zaDCWep7+Ekvyvvb+azmd3VyK6GHr1yHbQC7zwq s25oNFjKiEeaPaJ0+x4IEIAcJCTndEM= 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-277-u4bhh9zqM4mPamm6XF5Ptg-1; Tue, 22 Mar 2022 13:40:55 -0400 X-MC-Unique: u4bhh9zqM4mPamm6XF5Ptg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 912733C153A5; Tue, 22 Mar 2022 17:40:54 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.231]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2E8D0C26EA9; Tue, 22 Mar 2022 17:40:51 +0000 (UTC) From: Maxim Levitsky To: kvm@vger.kernel.org Cc: Ingo Molnar , Borislav Petkov , Sean Christopherson , Vitaly Kuznetsov , Paolo Bonzini , "H. Peter Anvin" , Joerg Roedel , linux-kernel@vger.kernel.org, Thomas Gleixner , Jim Mattson , x86@kernel.org, Dave Hansen , Wanpeng Li , Maxim Levitsky Subject: [PATCH v4 0/6] nSVM/SVM features Date: Tue, 22 Mar 2022 19:40:44 +0200 Message-Id: <20220322174050.241850-1-mlevitsk@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org This is a set of patches for optional SVM nested features. V4: rebased on top of kvm/queue + my patch series 'SVM fixes + refactoring' and incorporated all review feedback. This was tested with kvm unit test, running on L0,L1, and L2, and no new failures were seen. This time I also tested this with all new features disabled in L1, and in L2, to avoid repeating an issue I had in nested tsc scaling. Best regards, Maxim Levitsky Maxim Levitsky (6): KVM: x86: nSVM: correctly virtualize LBR msrs when L2 is running KVM: x86: nSVM: implement nested LBR virtualization KVM: x86: nSVM: support PAUSE filtering when L0 doesn't intercept PAUSE KVM: x86: nSVM: implement nested vGIF KVM: x86: allow per cpu apicv inhibit reasons KVM: x86: SVM: allow AVIC to co-exist with a nested guest running arch/x86/include/asm/kvm-x86-ops.h | 1 + arch/x86/include/asm/kvm_host.h | 6 ++ arch/x86/kvm/svm/avic.c | 7 ++ arch/x86/kvm/svm/nested.c | 83 +++++++++++++-- arch/x86/kvm/svm/svm.c | 162 +++++++++++++++++++++++------ arch/x86/kvm/svm/svm.h | 41 ++++++-- arch/x86/kvm/x86.c | 14 ++- 7 files changed, 264 insertions(+), 50 deletions(-)