Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26FC9C433F5 for ; Tue, 11 Jan 2022 18:53:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350223AbiAKSw6 (ORCPT ); Tue, 11 Jan 2022 13:52:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242645AbiAKSw5 (ORCPT ); Tue, 11 Jan 2022 13:52:57 -0500 Received: from mail-yb1-xb2f.google.com (mail-yb1-xb2f.google.com [IPv6:2607:f8b0:4864:20::b2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6919C06173F for ; Tue, 11 Jan 2022 10:52:56 -0800 (PST) Received: by mail-yb1-xb2f.google.com with SMTP id d7so17122221ybo.5 for ; Tue, 11 Jan 2022 10:52:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=17MefAb7Wq51LBItM83lwZITi4By/+6kifCdUczNHes=; b=qe/vTFEQwfqq+6k74r7b8ljqbjo6ywjiHIZvlXWsbp5cgSwDmZeXP7KquwvmXWtxan WIiTsy2bpJ3Edfi0fwgbn5KlEpxI2ct3pCgIQKEnBSsz9YU9mHCiLnH+HrlrvTEJAXQn WVPTmLVQeydNcrhrRk3YLrFt9UfEKFk0/QkK/5QWu4sHXrkFZBC/aTcv04KZJzB5HBzx OhyWzwxYcxgwBacEU0iNLa8PTrZ1sXHyo/H944RQ2AhQlHyUEVjKaDLxyotS/00b3/3A fBQkmgyjGXxOEqWLhMJ/5pZN9YoOzuYeXLnoN+OS+gfAM+/oQhmnjHPWIna3AQU/mNw1 8hfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=17MefAb7Wq51LBItM83lwZITi4By/+6kifCdUczNHes=; b=kXSaRbv4H82uj9LubDeif8YKYYJXyrHuHWmqxZWZbWI16ExRY8LVQfwNspYSYpVgYO n2QRf414qu8QIZAjAyZ0C5sghs83MLj0eOg3XMgIdrMkR5rgc2U0MhvHgEHOQRGYOrPq rUj19hzyv05hyWvUT4xUFZLwY79sIWN3mk0pEzb9hsR2fInZ3liF2ih87CnoXUW3XSn3 HZRYujWHdo7ER3jUq7dbX0Up+HMlSEIBx4G+XNo7PicBsF1l1AXgBbG1eV+TWCNhOIS2 Mj7HVtDxcdvIE1MKK3JDOut0cE98mlJSvUn6xBpy0ImkMCS4Nk12skTPBsORkLdBqb7G sNEw== X-Gm-Message-State: AOAM530Pc1lhO/17+HlS3wHMgH3aTPpur6rXtQDLEmbx3MxacOZ8bLlD qtPrGiW7F54NsPd7NTiXHVJDBHYLreLePmUjdPKklA== X-Google-Smtp-Source: ABdhPJyn0Wq/OnTFO+pZZsGiPNj88pyrxrt8LxfP010ZWFUMpcdrTES6feVX3nFLo0tTGlZ2e9VdGfMDeGrY622KE1E= X-Received: by 2002:a25:c841:: with SMTP id y62mr8486367ybf.196.1641927175898; Tue, 11 Jan 2022 10:52:55 -0800 (PST) MIME-Version: 1.0 References: <20220104194918.373612-1-rananta@google.com> <20220104194918.373612-2-rananta@google.com> In-Reply-To: From: Raghavendra Rao Ananta Date: Tue, 11 Jan 2022 10:52:45 -0800 Message-ID: Subject: Re: [RFC PATCH v3 01/11] KVM: Capture VM start To: Jim Mattson Cc: Reiji Watanabe , Marc Zyngier , Andrew Jones , James Morse , Alexandru Elisei , Suzuki K Poulose , Paolo Bonzini , Catalin Marinas , Will Deacon , Peter Shier , Ricardo Koller , Oliver Upton , Jing Zhang , Linux ARM , kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 10, 2022 at 3:57 PM Jim Mattson wrote: > > On Mon, Jan 10, 2022 at 3:07 PM Raghavendra Rao Ananta > wrote: > > > > On Fri, Jan 7, 2022 at 4:05 PM Jim Mattson wrote: > > > > > > On Fri, Jan 7, 2022 at 3:43 PM Raghavendra Rao Ananta > > > wrote: > > > > > > > > Hi Reiji, > > > > > > > > On Thu, Jan 6, 2022 at 10:07 PM Reiji Watanabe wrote: > > > > > > > > > > Hi Raghu, > > > > > > > > > > On Tue, Jan 4, 2022 at 11:49 AM Raghavendra Rao Ananta > > > > > wrote: > > > > > > > > > > > > Capture the start of the KVM VM, which is basically the > > > > > > start of any vCPU run. This state of the VM is helpful > > > > > > in the upcoming patches to prevent user-space from > > > > > > configuring certain VM features after the VM has started > > > > > > running. > > > > > > What about live migration, where the VM has already technically been > > > started before the first call to KVM_RUN? > > > > My understanding is that a new 'struct kvm' is created on the target > > machine and this flag should be reset, which would allow the VMM to > > restore the firmware registers. However, we would be running KVM_RUN > > for the first time on the target machine, thus setting the flag. > > So, you are right; It's more of a resume operation from the guest's > > point of view. I guess the name of the variable is what's confusing > > here. > > I was actually thinking that live migration gives userspace an easy > way to circumvent your restriction. You said, "This state of the VM is > helpful in the upcoming patches to prevent user-space from configuring > certain VM features after the VM has started running." However, if you > don't ensure that these VM features are configured the same way on the > target machine as they were on the source machine, you have not > actually accomplished your stated goal. > Isn't that up to the VMM to save/restore and validate the registers across migrations? Perhaps I have to re-word my intentions for the patch- userspace should be able to configure the registers before issuing the first KVM_RUN. Thanks, Raghavendra > > Thanks, > > Raghavendra