Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp802651rdf; Fri, 3 Nov 2023 16:17:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHOlr8JZ4Dwc8K4Lo3jg97ioMD02yW+vs6pCR2ALPQAnognczGi8ofzsvmPUZbMwwXCOLYJ X-Received: by 2002:a05:6871:5a8f:b0:1f0:b2a:768a with SMTP id oo15-20020a0568715a8f00b001f00b2a768amr14110446oac.8.1699053459400; Fri, 03 Nov 2023 16:17:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699053459; cv=none; d=google.com; s=arc-20160816; b=fF8QBiZfCPd9CSIG0yj7ow+bogjC/3yosUxuOZ3E/d/w8cFK4UG0z71cuLXSl1wimu H2/ZE6jwGZTyoFmYbsPLxCvh2ggmqpvjXF043uxZIML+wJ8W+fn9mytjV9u4pubPIBVr 7kWxg1uT4/rvQEu2XvsqUhY47g1fUrJxiqdWpovgwzP58yd1uFBfCPU7cfGjY4jw+Gwy SANI/tFA0AOAd3wqyiH1df7wPxSTcgKrd/2pnx+BRej0KvwvfUpH54enBeu3p1meXeng 28rgunvOl2lBx4QiJbfrp6A4oyMQBuq7bDQ7zRyRzK9DqJgdneHg0erb2/kiYhGbprV4 EgXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:from:subject :message-id:references:mime-version:in-reply-to:date:dkim-signature; bh=wL2niLMenc8rXWamhCVdrH1GL3hMVyvGfUspx7X4DS0=; fh=7qfmZqbAAQZvvB1jb24P2S6ewyTKmKV8ZEBWKlHGLY0=; b=EXxf6vnjap7mykqOlqYe140e/hTJalTHpLNI6fnlDFJLR+yCBo5iXSSvSKHYZm20cd 7bIrHstYJQIBrYeWUvItjbrzpLieu0zSjixYIEgeCZ0Ou6zYsBMeGluYmpqCRz7nlZQX 9Kq58rctwx5AkYYn/PyAIHBTeoW9OxUqguq5cS463JD2XF4r9Kv/TKHe62OXXs61U7qL DwyxLFKUYT21+2Zsgj0jFjc9i/EjWEflN0JMm7kYGeEyfI72c3VS5GpIcp8f7K1fU4bw 4V1aBpR5fgzSm/j7w7886JZx3QwBNDYM6QP2952vYbpcWRZYgsADYoq25wC1OluBgBLJ M13w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=y34aghm2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id i75-20020a636d4e000000b005aa41728293si2429062pgc.318.2023.11.03.16.17.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 16:17:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=y34aghm2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 6869081BDBB1; Fri, 3 Nov 2023 16:17:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230145AbjKCXR3 (ORCPT + 99 others); Fri, 3 Nov 2023 19:17:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231259AbjKCXR2 (ORCPT ); Fri, 3 Nov 2023 19:17:28 -0400 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 B5E09D5A for ; Fri, 3 Nov 2023 16:17:25 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-5b31e000e97so36317857b3.1 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=WppjfBU56TeeSK02rHbnCY1Gu6mlDBlz7+y/KNF68aEth0tYVnDE1xeSjhcXgZFTw+ VNzdJgchK1GUo4T4j4mQFcmIEHLwzVsosduQ32Cyel52M56tMdj6m6DI3WLjRA6E5BX1 SClbcToPoEqx6ngsJ/TyJbCk1BhvdsoQgO0HrULdrOMO92VFMizKvpXgX9xBnSoeN6R8 Ww314mz1TYCgwHL8RNXnzvRSXXsacnk6QmRqnjVBQrVxtQB1CU1PK1I33qvt9RK8C3Y6 r1fPsxCYCSqOL9McIw78gYGWffr1RHkFag2vMxC4NPZErK5MRsfxzhirbXCAvoX0wKlM pI/Q== X-Gm-Message-State: AOJu0YzY1SqYRZMnmj7/xqO+27auOrvrbuArYcAEKbXSeOauYp3TsaEf PVAjD2J6UWW7J6oQSJ9fhtYGKnx9omg= 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: 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 X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 03 Nov 2023 16:17:35 -0700 (PDT) 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.