Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp248018rwo; Fri, 21 Jul 2023 11:11:28 -0700 (PDT) X-Google-Smtp-Source: APBJJlGRyBMHhmugMAMpTj1BNP7tE+kjJVsNKT3CuyuEYqZpC3r+puqGAnSGzH82Gq/z/155XKZu X-Received: by 2002:aa7:c982:0:b0:51e:404:1e6d with SMTP id c2-20020aa7c982000000b0051e04041e6dmr2312867edt.38.1689963088183; Fri, 21 Jul 2023 11:11:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689963088; cv=none; d=google.com; s=arc-20160816; b=KdOhScghQFFcqrf1BkB76lkta5IuU3VuqWAmrRAqUXECIqzk+Mlv6TEkds8AGgXaI8 LMgLSRXANhAS/d9tYWQ8NRkuWmlhgr2J3m7tiPfRURc6/TiKxwrD9VEB0QYJBJ80JquN EntovjnpAnXoH1MQ9R9vIDtN1SBIdVlTrz1qhSYoUFChiIFeH4cTWDwk4RHBKhoq6v4r 5Cyc8Ut1xmdHevVxZ6W73jmsL5qh4TutjWT7k3fCw4lLJRID3Jbql/63EBKqlk6ryScR X34NYCxUAPNK4cuV7NbVqkzz2VfUJAAngnv2yJ+1jFLeAYNV3PQ2SM1ciUhvtm7MZhIM tp8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=cGq520d0DqyrCnCF7s5Hdb0rD6NYwtkYzvVScy9HYVY=; fh=tka8fjfhHFzL15AUMsoY3DpID25kLtr7rZLwDH2qGkg=; b=XAn8t8ID9ChDLSR/ADo8FIvDMYMYRjYIIfjcClfEJ+RKxGcn7ODnd2Gg/AX/34QflM WiBA5k+YU7gxXpXvlXyNpB6GxRQrNR5ibVWQwtS0rEnSR2kohqUh3ANN8Hd3gGQdbzJp u+M+q2qgzsrRqyn8mL2xWqb0mNDCHxvJnby5mzNN5rUbMAEV6ld2JhUhDrV3b86htJk2 xhloFQgOU0175e6NwyfcmSzsnzNtwQm97LlqwujVKiCKXsVIirZGrhV5ldlRk+IeLdgg 4f61wbwendugmE/+9B3049QpI04w4oQIqPjb9FdI/BTsBTLlVWKQXxD+FrCSdRzsyonc vhVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=lZQ3ytVA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bo9-20020a0564020b2900b00521949d6c77si2698820edb.640.2023.07.21.11.11.02; Fri, 21 Jul 2023 11:11:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=lZQ3ytVA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229808AbjGURuO (ORCPT + 99 others); Fri, 21 Jul 2023 13:50:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229452AbjGURuM (ORCPT ); Fri, 21 Jul 2023 13:50:12 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80BE5359D for ; Fri, 21 Jul 2023 10:50:08 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-d064a458dd5so372711276.1 for ; Fri, 21 Jul 2023 10:50:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1689961807; x=1690566607; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=cGq520d0DqyrCnCF7s5Hdb0rD6NYwtkYzvVScy9HYVY=; b=lZQ3ytVABaMbgeRDyRyj2Y4aroG9rwZE4tos1KIi9+yVur8kHjUJfNDjBsWbA5klWv TLcM88saeccS8fNt+F3rMDPeeLUphdScBaSRyrIwijc1R9havyOwlUNE/IQcuJNK+B8L fg4nRh9mVWUewpR8WoS4y2UShReGqGQI/p2sPXI0/xi9S/4bLyRSoR+wjHm8ngFldPX/ svRbdc4YBfOK5kZ24vC9n3F8L7Li2/2X6A5zsHfs5DeCFBQGgpDd6R/Lv+3ONLhdKh+D zucg4UeBA4sEAN2XLHlR2RolIKqE8NS9aws4SoQANyJbQckavpkDoby1VzLjItanYN4z z0Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689961807; x=1690566607; h=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=cGq520d0DqyrCnCF7s5Hdb0rD6NYwtkYzvVScy9HYVY=; b=Qi59OJGUv3PdtyW7dv7ohkjStdNxcseOpfHeyAsv1gd6Hsev0hkzueQwxbQn2eQXEt zx+Nr/VJd8JYhak4rjBSLN0tZ9dqSVR++LAOTj9uf6VFF0HQEUdFBdzNbXqM4B18oMcf rwgqydFNcyjzDGBYyppHfLp+cFYsxpSkfx0EHMJN/W1SxCaHyjDDFJpRaIjz/AImxToS vNIYBOrRAo06EtW5nVb3N13pFRtwYetmqPvZeMdIeiPadTjnDATNRtMzMYIlKCyXaGc0 xAdCRwNks8x0e+XEjXWfAYssats4uZ7nyLoE/GFXEy6yrfS9rZMxkoGULhtIKocJ+9E5 lQDA== X-Gm-Message-State: ABy/qLbUFg6lIVRCOmuzVh8g7F46urWJ333AkbQO8S1BBF4Oi7iqO0NH CLAapWsQWMYmoThYhmVTuycmCOLvoxw= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6902:10cd:b0:c1c:df23:44ee with SMTP id w13-20020a05690210cd00b00c1cdf2344eemr19769ybu.0.1689961807734; Fri, 21 Jul 2023 10:50:07 -0700 (PDT) Date: Fri, 21 Jul 2023 10:50:06 -0700 In-Reply-To: <8ad7a846-64e9-a3f1-4bf1-731a994d62cb@redhat.com> Mime-Version: 1.0 References: <20230718234512.1690985-1-seanjc@google.com> <20230718234512.1690985-13-seanjc@google.com> <8ad7a846-64e9-a3f1-4bf1-731a994d62cb@redhat.com> Message-ID: Subject: Re: [RFC PATCH v11 12/29] KVM: Add KVM_CREATE_GUEST_MEMFD ioctl() for guest-specific backing memory From: Sean Christopherson To: Paolo Bonzini Cc: Marc Zyngier , Oliver Upton , Huacai Chen , Michael Ellerman , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , "Matthew Wilcox (Oracle)" , Andrew Morton , Paul Moore , James Morris , "Serge E. Hallyn" , 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-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, Chao Peng , Fuad Tabba , Jarkko Sakkinen , Yu Zhang , Vishal Annapurve , Ackerley Tng , Maciej Szmigiero , Vlastimil Babka , David Hildenbrand , Quentin Perret , Michael Roth , Wang , Liam Merwick , Isaku Yamahata , "Kirill A . Shutemov" Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 21, 2023, Paolo Bonzini wrote: > On 7/19/23 01:44, Sean Christopherson wrote: > > + inode = alloc_anon_inode(mnt->mnt_sb); > > + if (IS_ERR(inode)) > > + return PTR_ERR(inode); > > + > > + err = security_inode_init_security_anon(inode, &qname, NULL); > > + if (err) > > + goto err_inode; > > + > > I don't understand the need to have a separate filesystem. If it is to > fully setup the inode before it's given a struct file, why not just export > anon_inode_make_secure_inode instead of security_inode_init_security_anon? Ugh, this is why comments are important, I can't remember either. I suspect I implemented a dedicated filesystem to kinda sorta show that we could allow userspace to provide the mount point with e.g. NUMA hints[*]. But my preference would be to not support a userspace provided mount and instead implement fbind() to let userspace control NUMA and whatnot. [*] https://lore.kernel.org/all/ef48935e5e6f947f6f0c6d748232b14ef5d5ad70.1681176340.git.ackerleytng@google.com