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 X-Spam-Level: X-Spam-Status: No, score=-23.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33438C433ED for ; Wed, 28 Apr 2021 20:07:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DEE176143B for ; Wed, 28 Apr 2021 20:07:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241816AbhD1UIP (ORCPT ); Wed, 28 Apr 2021 16:08:15 -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-Google-Smtp-Source: ABdhPJx6CsUROTTzjBOZDTARdsQ0hVWsBEZk8B/IPbqUlZijhoakdsN71COq1doo9BY0qDhDa12OJw== 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.