Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp505259pxj; Fri, 14 May 2021 08:40:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEkgeKS6MvvRkXbjVdaLn4Oyvc4uAxuzo9xNBN5RPFpM8XU4YqeoB7tB6v0t04QODsp7wu X-Received: by 2002:a05:6402:1046:: with SMTP id e6mr7957950edu.218.1621006852629; Fri, 14 May 2021 08:40:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621006852; cv=none; d=google.com; s=arc-20160816; b=t5cTRPYQujgvpUzsQ3QQBRY5G0+rzgqMWWevrgZT/VBeFKAPsNIPa0va2YBs9rAdRt pAvPVcTvWp6GAhT0W0tjtc+DolamIoZoyFJNUfBsv6zzOEP8PkV+c6CJOKsOb12ipubO 1Ha1bVpaDNA45ump3qagIiRf/advn4gr+g5b41JWNNOjVMW2Yt0MB7mjkGMO/z/HO/7L Hc6emDA53e+4gfnQJBv3JsGkTf2wDnh3mL6LmHFig44NiF9O0l4o+No+CUb2L9oKemzB IV4EjaF6wXjYd73QJLIfCigPBcCbrLUDuCdoKaUkVE2CB1iJsTEabeBPcLpT1TMXNucu PVyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=zBNv4081Q/Y0r/u4hcRuN6ngx5638R1+Ds+qvxVrHNs=; b=BFpWDG4Z0XOJgF7CohiHpgtokcBKUgARnccwSldoXLcj3pdo4BRbVmL2L9HJ01Tzz5 NG9ZBO7pjie+5jLVF2w406dbQ43lVKZLCEr7N/hX7KrlHm3gU1mxaYMyG1Be0j0NOlWQ E4NXQg7iYl0MR1Poev06GarQADxZjiuLrdFawQOET8vMdam6fJ70Cs3q9kIhhkJ3hyfL z+aaXN6juEwnJZpPUcfGzsxQTJRqFNKb1+hseAXXhO9lvy5Qcw5s+eClha46bcZCeq19 B21gCQAPnmLxpe0TZRaki1k1mldY5niHdjowYQHUrXaIiPX8jQROCXb5fYQnhGjP0NIX SSYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZuEJAf2v; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bm15si6413862edb.233.2021.05.14.08.40.29; Fri, 14 May 2021 08:40:52 -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=@redhat.com header.s=mimecast20190719 header.b=ZuEJAf2v; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232414AbhENJ6r (ORCPT + 99 others); Fri, 14 May 2021 05:58:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:22926 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231140AbhENJ6o (ORCPT ); Fri, 14 May 2021 05:58:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620986252; 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: in-reply-to:in-reply-to:references:references; bh=zBNv4081Q/Y0r/u4hcRuN6ngx5638R1+Ds+qvxVrHNs=; b=ZuEJAf2vcTIXp/8EzA1GAkkeNGOHL9QMWkQ3wiegyjChUelyD6J5edj11IHMts54OQsNSP /0fkqGfn/k6rOK1pS+oyqzhYTiAcGjW6JwDiYDE94YBWPU90gXW1RFFC4h3y3FlCj05L5z 8iA4jB9AyV6Ce+lwNwTJiSm8YCH4YEM= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-431-4uYgZmtgP16PbTF4-PA7pA-1; Fri, 14 May 2021 05:57:31 -0400 X-MC-Unique: 4uYgZmtgP16PbTF4-PA7pA-1 Received: by mail-ed1-f70.google.com with SMTP id q18-20020a0564025192b02903888712212fso16081848edd.19 for ; Fri, 14 May 2021 02:57:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=zBNv4081Q/Y0r/u4hcRuN6ngx5638R1+Ds+qvxVrHNs=; b=lAOQ+sMTpTLWvwycWWaXFQ02gQdWyDwqiSRghHk/IryjQgHnJYkDKGf3DjgUrsRptF HUEjV06/iQqLrM42my7ixDjLVMKOB9PT/J9mAebZbOIc6UV+BpEt7+QdjOOC3gcicKns ajSIrpOWysqBiSyDiJg2rlDIw/+Us+36+1yyp/s0tm0ozVgs/oC69ZVXSkpr6DnSzGLp za6n+RzI2JJBk7ZTqedOCrPOyBuSn/YhE7ERJrMzB7Aa4awVSc28sYP+FLa1eml2pD9O 72bc2suLDPoTbENoTUObp8KmK1Lh+X0CdQoRQPcvqRClJsSpzdrjOJ69thAhMc99dmRw oNEQ== X-Gm-Message-State: AOAM533+p4mGUng3Mw/nGj11+ucH4I9F1VBCYnfghhL18Freo5daxWwv EyiBlqPh9wN8h++CeeUfbm9nwUE1sdzKIKe6NDcQxn82H6Qb9Q3ovnOdGI1TwhB+LGkfl6u3cKg HJFgGsjJE2sS2z91wvMIs08za X-Received: by 2002:a50:f744:: with SMTP id j4mr19524860edn.211.1620986250007; Fri, 14 May 2021 02:57:30 -0700 (PDT) X-Received: by 2002:a50:f744:: with SMTP id j4mr19524848edn.211.1620986249812; Fri, 14 May 2021 02:57:29 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id zo6sm3317903ejb.77.2021.05.14.02.57.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 14 May 2021 02:57:29 -0700 (PDT) Subject: Re: [PATCH v2 2/4] mm: x86: Invoke hypercall when page encryption status is changed To: Ashish Kalra Cc: Borislav Petkov , seanjc@google.com, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, joro@8bytes.org, thomas.lendacky@amd.com, x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, srutherford@google.com, venu.busireddy@oracle.com, brijesh.singh@amd.com References: <20210513043441.GA28019@ashkalra_ubuntu_server> <7ac12a36-5886-cb07-cc77-a96daa76b854@redhat.com> <20210514090523.GA21627@ashkalra_ubuntu_server> From: Paolo Bonzini Message-ID: <70951773-fe39-c694-abeb-69052934b76b@redhat.com> Date: Fri, 14 May 2021 11:57:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210514090523.GA21627@ashkalra_ubuntu_server> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14/05/21 11:05, Ashish Kalra wrote: > I absolutely agree with both of your point of view. But what's the > alternative ? > > Ideally we should fail/stop migration even if a single guest page > encryption status cannot be notified and that should be the way to > proceed in this case, the guest kernel should notify the source > userspace VMM to block/stop migration in this case. > > From a practical side, i do see Qemu's migrate_add_blocker() interface > but that looks to be a static interface and also i don't think it will > force stop an ongoing migration, is there an existing mechanism > to inform userspace VMM from kernel about blocking/stopping migration ? On the Linux side, all you need to do is WARN and write 0 to the MIGRATION_CONTROL MSR. QEMU can check the MSR value when migrating the CPU registers at the end, and fail migration if the MSR value is 0. Paolo