Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp770342pxy; Wed, 28 Apr 2021 13:56:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfFlMtdZtHxNAfemgzgXsq8nbAypJCeVzMonl3cVhysehdjeIjqrZovhE9z7tXNjlbEA0g X-Received: by 2002:a05:6402:617:: with SMTP id n23mr14147854edv.45.1619643389289; Wed, 28 Apr 2021 13:56:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619643389; cv=none; d=google.com; s=arc-20160816; b=CN6MhsfgUtjLNDPknnKVlZlu4DQwSR7MVnBKlQBdigx5U2YmHCVrsTWg9FDsrb//Hf uizS7Sxkc7Rf4sHIIOTQFKbKBpLr3roXMLp5kteCcjHc2qktbRWtPj43+7Gh4h44b6oV 1LQS0O/PxjxdsW3kmKRKbetWSY2eNFL+4455djQ/IIv9J485ktcJhytoHF38wpXKu+2u IYUjnA6nY9VHmSMkiOqPP53C9ZiZ0LmNu+7hxUlM5V3rGi132OugRPhAdR6KJv6HxY4M UaXp469jerdqHKrh3HfRh8f9eB08g9F5LXkW0q/Q467HqDlTMkRKwRi1meLWKLW0nNmO DQeA== 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=CAez7Qyq734BJY4fOHAHF9NJa5VleU6E2eJWVTM5cMY=; b=JYAGhgXUumObLp0VyWno76p50qRMKEWCuvqoAlVNnyJIBTHLOLb4Shz55KhewaBUPa c2cap/DouSv9Hu3htdqgUGTULeV6NI3Zm3hAbdyyg6xpMHUDc1TonGavXjKbQpO/e/oS ECcMiW+D3xPJCVC7LuRjGspUanMB+9DTptAbVT7uQi92pgW5+6cm+puBel2p9rKF1hr7 8kNgPsOeWEnM6dQMoWQwC/P4+NW3XEgSmTQ3dfWnN3E+7joYJTITat1pZJZ/B6uzBJaH oF9/bYlqypsJzT2plFNonSex4KplwXqh/YLlBH567CyBufWaqPlgCVHvNZkBopmb7OOu 9nrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=dNmj2jyG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bo20si789102edb.260.2021.04.28.13.56.03; Wed, 28 Apr 2021 13:56:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=dNmj2jyG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S237191AbhD1UIB (ORCPT + 99 others); Wed, 28 Apr 2021 16:08:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236700AbhD1UHw (ORCPT ); Wed, 28 Apr 2021 16:07:52 -0400 Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42120C061574 for ; Wed, 28 Apr 2021 13:06:45 -0700 (PDT) Received: by mail-pg1-x532.google.com with SMTP id d10so7163435pgf.12 for ; Wed, 28 Apr 2021 13:06:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=CAez7Qyq734BJY4fOHAHF9NJa5VleU6E2eJWVTM5cMY=; b=dNmj2jyG74w6+mYtabfMSjs7cBIPdUxTxmyj4CKo83J4WFnMPA+vAqYBOj3Xgtt6Vf RpoC4mfT2F0H1DdoBTKwS2P4EMiiDNEcHeo+PYiXLTKe/hU4nSTNbCALUq/+yC/Y8N5F T3/jL1RzGWLDE1Ba2vzaetcDUdgp7tVT9PTd6qt+vRBlSr6lqckrHsIdhgWHMRKesRWR sKGk01KaR6sUdjmDiJZVUAJ8hRY4p9OhtbPRGNQxLaKpZ9C3z5wzp6l3uQ07l/a2zGZ4 RcjSGObbebNx5pknTQKC/2MuATCYEfrwBjUh46A+HbL/DvqeeIFhYwoJOxoKfvHaZ9eB mWoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=CAez7Qyq734BJY4fOHAHF9NJa5VleU6E2eJWVTM5cMY=; b=rsrfXk6j1+RTsFpflhq6wykzVpnlRj8ZDi1MDImDFVR8RtDL42ty+Hs1voVud4RS7W DKV6m1AM6JRIHKeSFwJfPYdEQjGNM3bQAV9bOuGaeuvh2leB4+daQpsAuw6H/sJI9yAL CCE3k1te1iJV9Wn/zC/Uz8K7AgXMIf2Q4Bvgnt3G0b5qtrfTh1exipIveDK9ak5k5Evb fGmdxMZrGj0FSqbCApb7aqhLop7cvL9p+Fc6DiAIChHeNORY2BJNJV5NoVIKd3ogJ6Ym m4kdM7rli4lXHHDq9sveEe28sm8FOez3ydHIKR+2yeiuC+pENyoL2v4iXEHPZ+HqdBT9 gizw== X-Gm-Message-State: AOAM532dVSxoTdmZVFIsOahnUotg2Np3yCjQTbLd41iqm4MSFWTTMvyM yjVBiVhZzI9a3mfw4jeyhb3GOloBih4Vuw== X-Received: by 2002:a63:40c1:: with SMTP id n184mr28334914pga.219.1619640404428; Wed, 28 Apr 2021 13:06:44 -0700 (PDT) Received: from google.com (240.111.247.35.bc.googleusercontent.com. [35.247.111.240]) by smtp.gmail.com with ESMTPSA id w7sm431182pff.208.2021.04.28.13.06.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Apr 2021 13:06:43 -0700 (PDT) Date: Wed, 28 Apr 2021 20:06:39 +0000 From: Sean Christopherson To: Steve Rutherford Cc: Paolo Bonzini , LKML , KVM list , Joerg Roedel , Brijesh Singh , Tom Lendacky , Venu Busireddy Subject: Re: [PATCH v2 2/2] KVM: x86: add MSR_KVM_MIGRATION_CONTROL Message-ID: References: <20210421173716.1577745-1-pbonzini@redhat.com> <20210421173716.1577745-3-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 28, 2021, Steve Rutherford wrote: > On Tue, Apr 27, 2021 at 3:14 PM Sean Christopherson wrote: > > > > On Wed, Apr 21, 2021, Paolo Bonzini wrote: > > > Add a new MSR that can be used to communicate whether the page > > > encryption status bitmap is up to date and therefore whether live > > > migration of an encrypted guest is possible. > > > > > > The MSR should be processed by userspace if it is going to live > > > migrate the guest; the default implementation does nothing. > > > > > > Signed-off-by: Paolo Bonzini > > > --- > > > > ... > > > > > @@ -91,6 +93,8 @@ struct kvm_clock_pairing { > > > /* MSR_KVM_ASYNC_PF_INT */ > > > #define KVM_ASYNC_PF_VEC_MASK GENMASK(7, 0) > > > > > > +/* MSR_KVM_MIGRATION_CONTROL */ > > > +#define KVM_PAGE_ENC_STATUS_UPTODATE (1 << 0) > > > > Why explicitly tie this to encryption status? AFAICT, doing so serves no real > > purpose and can only hurt us in the long run. E.g. if a new use case for > > "disabling" migration comes along and it has nothing to do with encryption, then > > it has the choice of either using a different bit or bastardizing the existing > > control. > > > > I've no idea if such a use case is remotely likely to pop up, but allowing for > > such a possibility costs us nothing. > > Using a different bit sounds fine to me. It would allow us to avoid > stuffing multiple meanings into a single bit, which would still happen > even if we had a better name. But there's only multiple meanings if we define the bit to be specific to page encryption. E.g. if the bit is KVM_READY_FOR_MIGRATION, then its meaning (when cleared) is simply "please don't migrate me, I will die". KVM doesn't care _why_ the guest is telling userspace that it's not ready for migration, nor does KVM care if userspace honors the indicator.