From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 091CDF9E7 for ; Fri, 3 Nov 2023 23:17:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="y34aghm2" Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4534A2 for ; Fri, 3 Nov 2023 16:17:25 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-5b053454aeeso36551517b3.0 for ; Fri, 03 Nov 2023 16:17:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1699053445; x=1699658245; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=wL2niLMenc8rXWamhCVdrH1GL3hMVyvGfUspx7X4DS0=; b=y34aghm2O6SNvK8GRGqx/sn9ZtIKtyEKMe8V+/zJansECIFreEzwNQdaN7qaCTMxno iQyNclZxVpo458htEdZJR3G15cLAf//+VCR0X7Bb9mY8NQfPYk2RLQxot9vowL58J+WQ 5hHhx/vsC4Fi5BrmYkOcz2Ry0VrZACj8kcr2w0P5oaF34k83fCp/HQQiRzJGW8Gpgnpt LE8G4T/CWtPumWqO8WdX3VhR7PfMiIcBYnlzl1o/d6i7pLaKqyDczwP5Xg+Vnz46J/mp wCPQ54D8JTsXgyveHL72zftw7M4doAMgz1QNm9HMEpFyaIBnh8OXueGidAopbHc09qPm VOOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699053445; x=1699658245; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=wL2niLMenc8rXWamhCVdrH1GL3hMVyvGfUspx7X4DS0=; b=owTGRpv5aJklaF8sb3y5+TQmJE0YCnS7eorRXI8SP39dNxjdFxHezviORmA4RkI+cn RfHHQtPSOC+8Vwuon/j0h0BDO80pDLqKu3S/Cxb6AGR0Tt6JWpEh/0etKsZRqcJDPjaA xayglgL1myBRFaKmX0qnhJBj0YIxbty+YODK5a+aFnLcm5IURlE1mrgcuUNzXc8lLQYS /pLBnaTtVyEHIl40gOwjl5ql5ZidQiHgsuG7wcIa4si82uezsVJHxQb1oh2Tibl9bAaR uXfVWbOhPz9ks70yun2ygBIZkunmSMD7Rvv+bO/ypmgO+sy+yHqOO0MUQwEf1z9XWv32 WHUg== X-Gm-Message-State: AOJu0YzcUMUrwMV5s/9dkF1K9Zs8PVQMg7UNywT8eJJ/m8rSU1Xq2k47 UFwp3YM8LnjYiIqlZYNh9J/+PfAYWLg= X-Google-Smtp-Source: AGHT+IGJDyi83TwJx+I35GsLQytKZmA4RJCyClEGAPsqdhhOEgS+Lm1oHaoRVNSHVuwQA3+7WVp40Ul4xUY= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a81:4958:0:b0:59f:3cde:b33a with SMTP id w85-20020a814958000000b0059f3cdeb33amr84737ywa.6.1699053444944; Fri, 03 Nov 2023 16:17:24 -0700 (PDT) Date: Fri, 3 Nov 2023 16:17:23 -0700 In-Reply-To: Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20231027182217.3615211-1-seanjc@google.com> <20231027182217.3615211-17-seanjc@google.com> Message-ID: Subject: Re: [PATCH v13 16/35] KVM: Add KVM_CREATE_GUEST_MEMFD ioctl() for guest-specific backing memory From: Sean Christopherson To: Fuad Tabba Cc: Paolo Bonzini , Marc Zyngier , Oliver Upton , Huacai Chen , Michael Ellerman , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexander Viro , Christian Brauner , "Matthew Wilcox (Oracle)" , Andrew Morton , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Xiaoyao Li , Xu Yilun , Chao Peng , Jarkko Sakkinen , Anish Moorthy , David Matlack , Yu Zhang , Isaku Yamahata , "=?utf-8?Q?Micka=C3=ABl_Sala=C3=BCn?=" , Vlastimil Babka , Vishal Annapurve , Ackerley Tng , Maciej Szmigiero , David Hildenbrand , Quentin Perret , Michael Roth , Wang , Liam Merwick , Isaku Yamahata , "Kirill A . Shutemov" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Thu, Nov 02, 2023, Fuad Tabba wrote: > On Wed, Nov 1, 2023 at 9:55=E2=80=AFPM Sean Christopherson wrote: > > E.g. a misbehaving userspace could prematurely delete a memslot. And t= he more > > fun example is intrahost migration, where the plan is to allow pointing= multiple > > guest_memfd files at a single guest_memfd inode: > > https://lore.kernel.org/all/cover.1691446946.git.ackerleytng@google.com > > > > There was a lot of discussion for this, but it's scattered all over the= place. > > The TL;DR is is that the inode will represent physical memory, and a fi= le will > > represent a given "struct kvm" instance's view of that memory. And so = the memory > > isn't reclaimed until the inode is truncated/punched. > > > > I _think_ this reflects the most recent plan from the guest_memfd side: > > https://lore.kernel.org/all/1233d749211c08d51f9ca5d427938d47f008af1f.16= 89893403.git.isaku.yamahata@intel.com Doh, sitting in my TODO folder... https://lore.kernel.org/all/20231016115028.996656-1-michael.roth@amd.com > Thanks for pointing that out. I think this might be the way to go. > I'll have a closer look at this and see how to get it to work with > pKVM.