Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp8001pxb; Fri, 5 Mar 2021 12:48:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJzjxWwywEeVCx1hZgiIffA6hRdtWRaiKXQQUpR0WrbcSe/nqjICTX5nALpy1ODxkK6IsNJa X-Received: by 2002:a17:906:1c4f:: with SMTP id l15mr4052077ejg.148.1614977315643; Fri, 05 Mar 2021 12:48:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614977315; cv=none; d=google.com; s=arc-20160816; b=jYXM1SZ9PDgOWXIuUU+zFJT4tEcnwAEyXZw5MZEjdPUhCasXzqPu5nBIHGZuPpdQko rgT2W/GRsF5RFfSi+/U6MhJxFkno+kH9HgLQuEBa9st27yOqIR0YB0vFO3r+DMMSStZb /fQCEwPzI6U0v6xdFpOq4JKO2LbABjY5EBtCjXCY6LItzXV3yU53AWoJ++QZChWXo39z 0y1B++oGPIY2hwIrbNDa7kHtFKn/3iPefA2o/Q+0s6TNvVBfbwYFvccg5lo1ydeWEzBl tj78Z2MaTRN/LXc6N/TYOPo9AFbtzwz5gczd+YeObB1d42zAg3K+fBUQ1EM6F8DIpITe Ju9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=KySvOFZxt1c0YZjiiuNCyl7b6HcxJLjY37j04g7aO08=; b=dDVClY/n/zY5ENrgapAZc/NJfa9yNngLMG/CSSg8rl8V+/3i3bXbe3AVSpyKS3Pkp/ +pmBCd6aidazEajC7P8wZeR9KHIvhesROmKOqnfzr8+xlKwnb7PkUVvUeMUnjRkx3Zve 44cjVkOmCWxPXO7xGriOOiEkZj7w0sbE0ROxviKDsXD6FNuD0HZ9OGoW15UNg5In+pbp 1s8yPy6eCWQ683EGODxrdYAyJ6LTe2cxZWQHHQjTIrD6FkZs2844+wc9bnLRhgm1n/8o nsuUw0xYOOY1c0nklV+4rtLwcB9tzQo+icwfDJSInrPD5twiM+/DBfjauwBgeytje7k6 pjEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=v01vynvW; 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 lt12si2045862ejb.158.2021.03.05.12.47.45; Fri, 05 Mar 2021 12:48:35 -0800 (PST) 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=v01vynvW; 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 S229749AbhCEUnu (ORCPT + 99 others); Fri, 5 Mar 2021 15:43:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229562AbhCEUnT (ORCPT ); Fri, 5 Mar 2021 15:43:19 -0500 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 ADA0EC061760 for ; Fri, 5 Mar 2021 12:43:19 -0800 (PST) Received: by mail-pg1-x535.google.com with SMTP id e6so2155325pgk.5 for ; Fri, 05 Mar 2021 12:43:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KySvOFZxt1c0YZjiiuNCyl7b6HcxJLjY37j04g7aO08=; b=v01vynvWKOKYGLu1bYQ0lAk1nsOmhbm1OSnXePtIutOsSy6HrVj34Y4JSn87NiIV42 dvi0Yb+BPfBlpUYyhJqxEbEYLAVvXTaueiY7R3SoCMLuDiEfHUJgVXEIh8QDGhiKO2Bn UBA81bDq4AR/FMm0VkQdOgDgQ8Tko1G/x2Hx3BnrxQif2Le02xGPaWyjHmUmRv85+LZI 1bbiA/QreROxid8rT4tJpsm8atCtZgIuHU2Of7zWAPh1QNIbsfc4ZUN0Zuc1405Ompiv TRxBGrETyO+4NadWKk2eRvsNd7hNftC9FHWy71LnmGbH7oS57EBLXv91cLwIuFGxBUXO OFgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KySvOFZxt1c0YZjiiuNCyl7b6HcxJLjY37j04g7aO08=; b=tDhR1N6ryJvS7yiPCjmcIUME3Q4cxCG8dq3rGxhnPHPguGu0iqV19Fcq6zNeOKNDiJ TE+0WnVZgX+UyQx/qbW95ZP0dpDY5Unhw08Vw4wj31GacCbyU+p7fmmuHxy6uDosoml7 9q/cF40THsmKQRacap4+l/7xwm8GpRlhqvDkv+JzioIbbW+W1JSTyPJS4u67xL+O7e5f Hj7TK9LOINIsmLlsWnjLHESJERe3xJQvykORdZbiFqMsa4Kn1DhXBfL91o9bn2AvNTXV Tyvm8XfaQgemnarP7wucBZHvVfTskKnmU+wBztT/+7cQWHErPr9U3NxYhrLKFSrak+b5 /GAg== X-Gm-Message-State: AOAM532qcAt+bNpWPG3Da0M99E9B6eFJ5SLxttPu5FDemaJ/KNZmOTJH mQj92X/FNTucFXEQEC8KNZNpocq+x+FKiGWQE1vABg== X-Received: by 2002:a05:6a00:16c7:b029:1b6:68a6:985a with SMTP id l7-20020a056a0016c7b02901b668a6985amr10597366pfc.44.1614976998900; Fri, 05 Mar 2021 12:43:18 -0800 (PST) MIME-Version: 1.0 References: <20210224085915.28751-1-natet@google.com> <20210305140409.GA2116@ashkalra_ubuntu_server> In-Reply-To: From: Nathan Tempelman Date: Fri, 5 Mar 2021 12:43:07 -0800 Message-ID: Subject: Re: [RFC] KVM: x86: Support KVM VMs sharing SEV context To: Paolo Bonzini Cc: Ashish Kalra , Thomas Lendacky , x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Steve Rutherford , Sean Christopherson , David Rientjes , Brijesh Singh Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 5, 2021 at 7:13 AM Paolo Bonzini wrote: > > On 05/03/21 15:04, Ashish Kalra wrote: > >> + /* Mirrors of mirrors should work, but let's not get silly */ > >> + if (is_mirroring_enc_context(kvm)) { > >> + ret = -ENOTTY; > >> + goto failed; > >> + } > > How will A->B->C->... type of live migration work if mirrors of > > mirrors are not supported ? > > Each host would only run one main VM and one mirror, wouldn't it? That's correct. You could create a second mirror vm of the original (A->B, A->C) if you needed two in-guest workers, but I don't see a use for a chain. If anyone can see one I can write it that way, but in the interest of keeping it simple I've blocked it. Originally I'd built it with that functionality, but allowing a chain like that smells like recursion and from what I understand we don't like recursion in the kernel. There's also the fear as steve mentioned that we could blow the callstack with a long chain of destroys starting from the leaf. Ideally we give userspace one less gun to shoot itself in the foot with.