Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp5720120rwi; Tue, 18 Oct 2022 03:15:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM43Cxc2bpdaeUEpQEZOliED0OKKymCFtZpTN6F6F3m2rtLHnnycZfTSYB2Mwy/yMn7Qe67F X-Received: by 2002:a17:902:b089:b0:178:54cf:d692 with SMTP id p9-20020a170902b08900b0017854cfd692mr2278007plr.1.1666088118539; Tue, 18 Oct 2022 03:15:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666088118; cv=none; d=google.com; s=arc-20160816; b=Oe1tF8BZh6++0uZlAWLNLIL41rrcV9A0aS0XUOX6Nuh7TITuJp0qrKf8er2rXK6RFU JY+LdT19zZR7G0SntHPVI8n6+41ekyRkrjl2mIPZvcIgythnFHH3Tf4FSJ34uuKc18M+ wRB/S29v7FSf6a0Rzr1UzXVDv3NwgkR+GAwTaHgfPacjLnzBWnlN7WSZXslTarD2jtuN wC4YuiEoD6dwrAADPW0s2g7RxfnW7tvlDuc4AoOPvriKQ/Mup3qk6Cdgktb+OUNmnJxD dTz4i/UYuhkNsPZCie2ePseXmzUf6A0QtV9RdY0H4qEky26YUfUxFOTB77T75SqAEtb/ qoJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=T1fNmJPBVIEsz+JLKi8Sx69F/41LoIY1mODMhEBFtEs=; b=ys0ywEF3/P61PWmGF4hm5jmPYC05VFBNSE6Y4LfiIDOJHkB/nDWFVH+zXSY8lrPNp2 RLwd9uiIk0HZS4jCKleFxpLwbrnXb4I8gfSHkdnMmpIfAONXqS5ixlZTTte1RBATxJcP XPbpp56Sa0MsAB5WCpFhfYQ2gTF+a0l7xDllUeT5TLJxqu/qRKzDh/nDEGChGIuhpwnG OkE/5npp02dbSFRIiJocl8QTl6p253l20PGsqNyx+Y9BPusPsBCBYm2zsx1bI0sBI3Yr QEwEE9AvE/syFtfnz/izbHCZqTMbAk/r09xEKRt8QnhhiglcHePeqiOSYfClyy27ViNK 37Wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aL0dZQDj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j65-20020a638b44000000b0046b2ebb0a4esi12300409pge.212.2022.10.18.03.15.06; Tue, 18 Oct 2022 03:15:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aL0dZQDj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230136AbiJRKKO (ORCPT + 99 others); Tue, 18 Oct 2022 06:10:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230315AbiJRKKJ (ORCPT ); Tue, 18 Oct 2022 06:10:09 -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 ESMTPS id 60C42501A4 for ; Tue, 18 Oct 2022 03:10:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666087806; 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=T1fNmJPBVIEsz+JLKi8Sx69F/41LoIY1mODMhEBFtEs=; b=aL0dZQDjX+tNYzp3S8yCF2YHOGNQ1NT0bU3r4LncmxVuTfMIyf66q+Or47qOv5NEtuL7Nl jmOIiDgpOD0327cP8Yvr0xdphmSfwHvmaod0k6m5NlBvlIeQA5aUJPgZwMKyKsg9fP/vgz Nu1WuV3XGyYPJTcxgKAJhjgApOKouqo= 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-447-Z1zQxKcNMca16ckOdHUlEA-1; Tue, 18 Oct 2022 06:10:03 -0400 X-MC-Unique: Z1zQxKcNMca16ckOdHUlEA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C3C87101A52A; Tue, 18 Oct 2022 10:10:02 +0000 (UTC) Received: from ovpn-193-156.brq.redhat.com (ovpn-193-156.brq.redhat.com [10.40.193.156]) by smtp.corp.redhat.com (Postfix) with ESMTP id 015DE40C94AA; Tue, 18 Oct 2022 10:10:00 +0000 (UTC) From: Vitaly Kuznetsov To: kvm@vger.kernel.org, Paolo Bonzini Cc: Sean Christopherson , Wanpeng Li , Jim Mattson , Maxim Levitsky , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/4] KVM: VMX: nVMX: Make eVMCS enablement more robust Date: Tue, 18 Oct 2022 12:09:56 +0200 Message-Id: <20221018101000.934413-1-vkuznets@redhat.com> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a continuation of "KVM: VMX: Support updated eVMCSv1 revision + use vmcs_config for L1 VMX MSRs" work: https://lore.kernel.org/kvm/20220830133737.1539624-1-vkuznets@redhat.com/ and a preparation to enabling new eVMCS features for Hyper-V on KVM, namely nested TSC scaling. Future proof KVM against two scenarios: - nVMX: A new feature which doesn't have a corresponding eVMCSv1 field gets implemented in KVM but EVMCS1_UNSUPPORTED_* defines are left unchanged. - VMX: A new feature supported by KVM but currently missing in eVMCSv1 gets implemented in a future Hyper-V version breaking KVM. Note: 'vmx/evmcs.{c,h}' are renamed to 'vmx/hyperv.{c,h}' in https://lore.kernel.org/kvm/20221004123956.188909-7-vkuznets@redhat.com/ Vitaly Kuznetsov (4): KVM: nVMX: Sanitize primary processor-based VM-execution controls with eVMCS too KVM: nVMX: Invert 'unsupported by eVMCSv1' check KVM: nVMX: Prepare to sanitize tertiary execution controls with eVMCS KVM: VMX: Resurrect vmcs_conf sanitization for KVM-on-Hyper-V arch/x86/kvm/vmx/evmcs.c | 118 ++++++++++++++++++++++++++++++++------- arch/x86/kvm/vmx/evmcs.h | 93 +++++++++++++++++++++++++----- arch/x86/kvm/vmx/vmx.c | 5 ++ 3 files changed, 180 insertions(+), 36 deletions(-) -- 2.37.3