Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2955456imw; Wed, 6 Jul 2022 14:49:27 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t2GdozYFX186Cjz5+JHc4sRM1N/tRKpPAeQuXAwj7yCT/WUelV4eoKG3hi8NuRxzNNy0es X-Received: by 2002:a17:907:8a28:b0:726:a02a:5bea with SMTP id sc40-20020a1709078a2800b00726a02a5beamr42962610ejc.175.1657144167175; Wed, 06 Jul 2022 14:49:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657144167; cv=none; d=google.com; s=arc-20160816; b=UEx/n0n3KXA/Gl/sSVN1OvlIIVmSSM3iSDqB+bNU9JzB5Kvo6OhRyLokifEVCbqn/s vL7SQGxsyA5ohUdtncA5k+00matfhjE1fOWWPdr9iGuMizydQrt8nXMfcBI9elu1YHcX G1lJfhMFX0u4zHvKBmxhPsVQqyMdLOFQ+TucZyyBBlmKsmvXttZwxrSiabmjk/CHpj7U AK7P2RcvgphX5/1nblzyfR0E5vJQOCncE86275jTlW4EIK0CGCFlI6pjfQkXhxRgpMVz f+IIqp35ISR6wVOHNBKdhmeDHvJE4CEYj3a4Uwk/Tzyu1FfxpAAsVHi4IePeCQottDEP 1dBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=E//5ZA8uzfUdBafNOuQKisK6Qx4fv09+u0puRM54Yd4=; b=XicudiK89ZmUdHPuiLw0o3NH/bX8nuol3VYg7MzZNwPtqoIHfTHVrvp2vaOucEn4tQ 0WVi7fLcM2D6ysXBue15Rt9psb8iijhm3DQGBIgXnkYeimUuXqX0p5Vrv1RyHf1nQu3e +fLA9nmvvQP7RH9CPgbpEbwKY/6CBs1pp1QSp1c1yykJ3byA8L71907qyA4BOQugwH+b pug8gybYFlV6h5yPUrdq+AWNx1Rqlnqe4GotkEENVPV4hH1CgSXc2Ir5OQdkXAaxgacq gvJ+GspUfDhvITPGR/RQovIjo/xlFe2f3RDfSntrUpgmlMV8Mc2TBYMJyeiOVJngoLE+ 1R5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=WYNY3+EZ; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gn1-20020a1709070d0100b00718bfe860a4si16546661ejc.41.2022.07.06.14.48.51; Wed, 06 Jul 2022 14:49:27 -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=@google.com header.s=20210112 header.b=WYNY3+EZ; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233570AbiGFVgF (ORCPT + 99 others); Wed, 6 Jul 2022 17:36:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231872AbiGFVgD (ORCPT ); Wed, 6 Jul 2022 17:36:03 -0400 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2FC1E02 for ; Wed, 6 Jul 2022 14:36:01 -0700 (PDT) Received: by mail-pg1-x535.google.com with SMTP id 145so14978733pga.12 for ; Wed, 06 Jul 2022 14:36:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=E//5ZA8uzfUdBafNOuQKisK6Qx4fv09+u0puRM54Yd4=; b=WYNY3+EZM7O23aAqdPFVrW/DUF8fqtHeku8lTPTokWqu4qo5ihKYdUaHcZWbwvv/uk 8pSXVp4lrwvMkWw/I3pmkDXmnaHZGzkKLQfFWknorNkRdOAZ34z44bGUwMJFTFtav0az gm4V27G3TiZgAd6SfIrgB9fz0EOxM2PT3QKrjXYqlTNYE/nVNyiGONlx9/iQi7rRbONh /hlEJz3SBbw/A6hPaYmMguUx2TWyvJ5D43pCulKKsZ+mosv9JeeNvxWS8RbOy2/4uIVU gwHVRrlkgfaDmSmmD1HpaixNY4NrKhE4Mc0jzJ3HGiknRzhAmLsbIGxApWqP6xhzhjwU Sung== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=E//5ZA8uzfUdBafNOuQKisK6Qx4fv09+u0puRM54Yd4=; b=2HEa/VxRW8QYW2w1JqdaCFS5bCuQg35FQaEtIHExx/FhJiv2RkZiR9FeFWymfZ3wtg 7veV3bquHK23DCEWP9masAKNLwp+CJpD1azFvhPGaCjI5R+2/1ujWTKAYXtfm5Waj6Q2 RWALmQn8sk+xDdS4lcG8OeMaP24Bjnm0dGpDHszwQUOUwatqY33vw4DrfmsIMjn4MFAm ftmdHefoW0TQrho7D/AfFpfLqJbZ0uMn9sQ3JnTRSWi+iJfTslRgpgaSTKiWDpsbQ1Zp EoJUOQvLhqcbui+UXGbqrQfl8ziG+NOjBA2GlldNdCXTuesEKT+3UuFQtS/Xj6+ZShH9 OO3w== X-Gm-Message-State: AJIora/5rKQEsCmnfEk7KiVCohfP8uI8bEHvBNANbxWyCM+uRonCAIUu SH87qkGXp6i/TjEYFB5rSZefTw== X-Received: by 2002:a05:6a00:80d:b0:525:520a:1736 with SMTP id m13-20020a056a00080d00b00525520a1736mr48216477pfk.36.1657143361099; Wed, 06 Jul 2022 14:36:01 -0700 (PDT) Received: from google.com (123.65.230.35.bc.googleusercontent.com. [35.230.65.123]) by smtp.gmail.com with ESMTPSA id i1-20020a17090a718100b001ef87123615sm7423406pjk.37.2022.07.06.14.36.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Jul 2022 14:36:00 -0700 (PDT) Date: Wed, 6 Jul 2022 21:35:56 +0000 From: Sean Christopherson To: Vitaly Kuznetsov Cc: kvm@vger.kernel.org, Paolo Bonzini , Anirudh Rayabharam , Wanpeng Li , Jim Mattson , Maxim Levitsky , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 06/28] KVM: nVMX: Introduce KVM_CAP_HYPERV_ENLIGHTENED_VMCS2 Message-ID: References: <20220629150625.238286-1-vkuznets@redhat.com> <20220629150625.238286-7-vkuznets@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220629150625.238286-7-vkuznets@redhat.com> X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 On Wed, Jun 29, 2022, Vitaly Kuznetsov wrote: > Turns out Enlightened VMCS can gain new fields without version change > and KVM_CAP_HYPERV_ENLIGHTENED_VMCS which KVM currently has cant's > handle this reliably. In particular, just updating the current definition > of eVMCSv1 with the new fields and adjusting the VMX MSR filtering will > inevitably break live migration to older KVMs. Note: enabling eVMCS and > setting VMX feature MSR can happen in any order. > > Introduce a notion of KVM internal "Enlightened VMCS revision" and add > a new capability allowing to add fields to Enlightened VMCS while keeping > its version. Bumping a "minor" version number in KVM is going to be a nightmare. KVM is going to be stuck "supporting" old revisions in perpetuity, and userspace will be forced to keep track of which features are available with which arbitrary revision (is that information even communicated to userspace?). I think a more maintainable approach would be to expose the "filtered" VMX MSRs to userspace, e.g. add KVM_GET_EVMCS_VMX_MSRS. Then KVM just needs to document what the "filters" are for KVM versions that don't support KVM_GET_EVMCS_VMX_MSRS. KVM itself doesn't need to maintain version information because it's userspace's responsibility to ensure that userspace doesn't try to migrate to a KVM that doesn't support the desired feature set. That also avoids messes like unnecessarily blocking migration from "incompatible" revisions when running on hardware that doesn't even support the control.