From mboxrd@z Thu Jan 1 00:00:00 1970 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 4407ECCA482 for ; Tue, 21 Jun 2022 15:59:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353298AbiFUP7T (ORCPT ); Tue, 21 Jun 2022 11:59:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353446AbiFUP6k (ORCPT ); Tue, 21 Jun 2022 11:58: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 ED65B38B4 for ; Tue, 21 Jun 2022 08:58:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655827118; 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=OnM6LWqbySomFL+MYIQvAUbrzoQzHU8UBGdR/EPQFvc=; b=Z+sF8UTB5STn2iOH13ZNfZx43lC0bdhn+sO1t6uvilubGUJocIA65y4TOAy3ob1sqkV5Si W4svIV5lsaF4HZTPCFO2r6Z9G8R2Fc0ZFZTLjuFFSXlXIX83Jl4hdzjrdOaejHR1L2Gbwk nouwJYn0rk30pvVJker9zE+LrtuI2zo= 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-347-EI-eceqAOPqCr-ag0dv3CQ-1; Tue, 21 Jun 2022 11:58:34 -0400 X-MC-Unique: EI-eceqAOPqCr-ag0dv3CQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F17B0811E75; Tue, 21 Jun 2022 15:58:33 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.195.134]) by smtp.corp.redhat.com (Postfix) with ESMTP id E80F42026985; Tue, 21 Jun 2022 15:58:31 +0000 (UTC) From: Vitaly Kuznetsov To: kvm@vger.kernel.org, Paolo Bonzini Cc: Anirudh Rayabharam , Sean Christopherson , Wanpeng Li , Jim Mattson , Maxim Levitsky , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 00/11] KVM: VMX: Support TscScaling and EnclsExitingBitmap whith eVMCS Date: Tue, 21 Jun 2022 17:58:19 +0200 Message-Id: <20220621155830.60115-1-vkuznets@redhat.com> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Enlightened VMCS v1 definition was updates to include fields for the following features: - PerfGlobalCtrl - EnclsExitingBitmap - TSC scaling - GuestLbrCtl - CET - SSP Add support for EnclsExitingBitmap and TSC scaling to KVM. PerfGlobalCtrl doesn't work correctly with Win11, don't enable it yet. SSP, CET and GuestLbrCtl are not currently supported by KVM. Note: adding new field for KVM on Hyper-V case is easy but adding them to Hyper-V on KVM requires some work to not break live migration as we never expected this to happen without eVMCS version update. The series introduces new KVM_CAP_HYPERV_ENLIGHTENED_VMCS2 capability and a notion of KVM internal 'Enlightened VMCS revision'. Example QEMU enablement patch for the new capability will be sent as a follow-up to the series. Vitaly Kuznetsov (11): KVM: x86: hyper-v: Expose access to debug MSRs in the partition privilege flags x86/hyperv: Fix 'struct hv_enlightened_vmcs' definition x86/hyperv: Update 'struct hv_enlightened_vmcs' definition KVM: VMX: Define VMCS-to-EVMCS conversion for the new fields KVM: nVMX: Support several new fields in eVMCSv1 KVM: nVMX: Introduce KVM_CAP_HYPERV_ENLIGHTENED_VMCS2 KVM: selftests: Switch to KVM_CAP_HYPERV_ENLIGHTENED_VMCS2 KVM: VMX: Support TSC scaling with enlightened VMCS KVM: selftests: Add ENCLS_EXITING_BITMAP{,HIGH} VMCS fields KVM: selftests: Switch to updated eVMCSv1 definition KVM: selftests: Enable TSC scaling in evmcs selftest Documentation/virt/kvm/api.rst | 42 ++++++- arch/x86/include/asm/hyperv-tlfs.h | 19 ++- arch/x86/include/asm/kvm_host.h | 2 +- arch/x86/kvm/hyperv.c | 1 + arch/x86/kvm/vmx/evmcs.c | 116 ++++++++++++++---- arch/x86/kvm/vmx/evmcs.h | 28 +++-- arch/x86/kvm/vmx/nested.c | 43 ++++++- arch/x86/kvm/vmx/vmx.c | 4 +- arch/x86/kvm/vmx/vmx.h | 15 +-- arch/x86/kvm/x86.c | 15 ++- include/asm-generic/hyperv-tlfs.h | 2 + include/uapi/linux/kvm.h | 3 +- .../selftests/kvm/include/kvm_util_base.h | 8 ++ .../selftests/kvm/include/x86_64/evmcs.h | 46 ++++++- .../selftests/kvm/include/x86_64/vmx.h | 2 + tools/testing/selftests/kvm/lib/x86_64/vmx.c | 5 +- .../testing/selftests/kvm/x86_64/evmcs_test.c | 33 ++++- .../selftests/kvm/x86_64/hyperv_cpuid.c | 2 +- .../kvm/x86_64/vmx_set_nested_state_test.c | 2 +- 19 files changed, 321 insertions(+), 67 deletions(-) -- 2.35.3