Received: by 2002:a05:6520:45c5:b0:135:a20d:b557 with SMTP id t5csp2130140lkv; Mon, 23 Aug 2021 10:23:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJHG9NbNkJ47ll06y1qv28kT2ejuRK4dgKv86Zz4sRdfMrSsY3DSxseP+cMkGLhRcpeQL3 X-Received: by 2002:a50:9a84:: with SMTP id p4mr1494601edb.189.1629739392245; Mon, 23 Aug 2021 10:23:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629739392; cv=none; d=google.com; s=arc-20160816; b=zyFZ3YQUlS7e5w1QXU8SqFuZLa+C4P8ZDUU0KuOKCo8oqGY2TRga0yyPdrE1snut3a 5t2L4HMG1wIfpBG8134EdT2D4DBYj7AIg4rFQ77unvSxuJajbwxHEcGdw86L9YhepLYB bqZO86UEClRVNB8E+8boAeKe6Z1+2Boflhz8Xoq5rRI1ZgnHKMGfjwWvtZEo/qbE59cD ipEz8OSn45/DumvYa0XQ3tykHqjIWpxA5ovSuS41OJZEXE7L7UG2WVQ+GCsEbJ9Ghzz6 OV7QRjf0PmNuntusL9/PD7MqqepcdXANRRIWGCqQHHCF5OcxsJaer09Y/vkOM2J8ajFZ mOjQ== 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=IWL7Yh+mP65xmvAitJG8b6Di+ZqbYJAqwLYk9jhbuJA=; b=YwBGLuyGZEKv8ogsSESLUAP2IcxATI22VLezaGq0AwAlsbUgXyEJ+xQfK5P2Re9qfC kpSuOdbjneBJtgLV70VgjGd+g3e1pTkx7Rel0XoIloA6v1o4QbriXo5zOldP+45W2Cz5 YsQAw5/qKifW+eaUokMVXQWOWatRr+PMubrBiu9Vl8Vw6X83fXlCLiVm9KWD7fQ6A8+C N6OBa+Jwtgf81gaYe2EmT0LyrxGLYT9iqFqKp44FJSIUF30zOw6i04kzb9RIikIr1VPF 6ESu58BntMY9MNRqVfyfonVEcGXPZDsmQQPVtWui5A2oOnB3TFKNE1sdjvcfUlMn+ckU b6MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=HxHnaTbL; 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 u19si14981457ejo.211.2021.08.23.10.22.48; Mon, 23 Aug 2021 10:23:12 -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=HxHnaTbL; 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 S231418AbhHWRT6 (ORCPT + 99 others); Mon, 23 Aug 2021 13:19:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229755AbhHWRT4 (ORCPT ); Mon, 23 Aug 2021 13:19:56 -0400 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CEFAC061575 for ; Mon, 23 Aug 2021 10:19:13 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id 7so15949735pfl.10 for ; Mon, 23 Aug 2021 10:19:13 -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=IWL7Yh+mP65xmvAitJG8b6Di+ZqbYJAqwLYk9jhbuJA=; b=HxHnaTbLz9/e7xkXCnUYhY/tMz8hJs+Dx98kRcQoj8kkPcbBhBYtGEJKBn+3ayLFYd zJwdWA8cuMtmtCtYDqAbxn2DP1y69H+qQKCvveWQZJQeixoPrhQFJZNDajvWqu4ninzD /pSwkXlIXyDarPPlMI7K2e+Wf8F8Ln3mNo6jD1PW3CNu1vqjcq72RUTc62fugkMF6svz KFll8FmyuETvuMsjySSQYf/2z02qFnL2KJ+t0UpwGI8AUbumynMo84ICtCsSCw2uWpRm F6si4fM9HnkKxsr0CzIpMFeaz9pxXQyb84yG/ymKaipcPDi2bDhimAVzjf1saPcyVkM+ BxWQ== 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=IWL7Yh+mP65xmvAitJG8b6Di+ZqbYJAqwLYk9jhbuJA=; b=tko3gmA6knSdKOFgyh3UkAQaJeQ31dJTh/2LKegRlvWH8P8gltmUwoWiOtXuLRXtUU Zai8UafWfCRcTHvo78sTHeCZxQJ5z9oF1mnzXC4euG8EhZv5RYtCRTbyQgUC56sfI/Kg xkdMfKbAXmdjz9D1eC84QlzVRDZbEPhUZx1UGiWtdx2QTk/YgZqOe9HHdfQ1st4Ze7sw MzjYkdO/cklSg7g/3lcoxTHQ7q5oR+kbLnepkm/t3izSctSQU3dd9f4/RWXiI6PxqxJl j32BU53slNSoX1ZODcV3vrm9+n5CY7Ylu4sCrYBwO3YQ6fg3F2Gkrz8NIlDrtpkPSvm1 Qq5A== X-Gm-Message-State: AOAM530SyG3D7uyfo556+jL4OTtuM2ERMm73rOxWuQMXIZTjrdslOEQB 0pPNKYKhruhXUaDsrrqtyJIIdQ== X-Received: by 2002:a63:ef12:: with SMTP id u18mr32753706pgh.331.1629739152905; Mon, 23 Aug 2021 10:19:12 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id z131sm17195346pfc.159.2021.08.23.10.19.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Aug 2021 10:19:12 -0700 (PDT) Date: Mon, 23 Aug 2021 17:19:06 +0000 From: Sean Christopherson To: Peter Gonda Cc: kvm@vger.kernel.org, Paolo Bonzini , David Rientjes , "Dr . David Alan Gilbert" , Brijesh Singh , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/2 V5] Add AMD SEV and SEV-ES intra host migration support Message-ID: References: <20210823162756.2686856-1-pgonda@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210823162756.2686856-1-pgonda@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 23, 2021, Peter Gonda wrote: > V5: > * Fix up locking scheme Please add a selftest to prove/verify the anti-deadlock scheme actually works. Unless I'm mistaken, only KVM_SEV_INIT needs to be invoked, i.e. the selftest wouldn't need anything remotely close to full SEV support. And that means it should be trivial to verify the success path as well. E.g. create three SEV VMs (A, B, and C) and verify migrating from any VM to any other VM works (since none of the VMs have memory regions). Then spin up eight pthreads and have each thread concurrently migrate a specific combination an arbitrary number of times. Ignore whether the migration failed or succeeded, "success" from the test's perspective is purely that it completed, i.e. didn't deadlock.