Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp377943rdf; Fri, 3 Nov 2023 03:42:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFM4wGb/Rt5V+t8JvtCNEJy35GaLWt2B+r+sb+YJFLpDNTX5ruCRLXgk39QUw7FI5/55NT+ X-Received: by 2002:a05:6a00:1396:b0:6b7:b42f:e438 with SMTP id t22-20020a056a00139600b006b7b42fe438mr22473239pfg.8.1699008121862; Fri, 03 Nov 2023 03:42:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699008121; cv=none; d=google.com; s=arc-20160816; b=nn5vCQryJMPGD2BISolHg48euiafuyokn9TYRxmnKQT7JBZ2sAE6AgrW9C0WyC1KAl Lc5zu6QaVxu85fEsKJ4T8RFtAsG9BCpdkYiv2dr8HmIDXofcICWo0MsQyliqvJg6a5Rj jDiI5M30ImwMb5ZVwnc833roQF9/OckF5zNEtHTVGTT+8d8WkngjAKpWkHoHeQWbUEgn 4AElNLxuHHalF2FUVrD91yF8w9k9TABrsnvNzBPs6+pBMbnHwNv7mTH36ue1/MXQezYh tXfAynHE6IT4yiyvkHsHx/zqN0/NXOkFYwxFYfxsodmKJM4NlSClOsrdHvDXLFyAGw2j 6uQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=Lp6Jz+POVOM2ymATN0+4roKlcGz/gu2UjTswWR4Ytbw=; fh=wMklxxwT8gejikHA5tPkSDJKRmUuJf36tG8ihZcHFgw=; b=HWAsU2FKzduuoXCn+s89Og7Q5+fGYLdUgak9132gE0GAncvDCR3PfQ7NV7nZPB/JxK sCXbMjHFlKUvOeD5qFKh04uZ2e32dIDX82xm2tCkPHwQtuyl4L9b5P2qJM7V2V5x2mLQ xXvt3WFP9ceCrqybYlDnwMiwjXASUV/aAMzlVeDVRAZDCpHmYGwEp/aCp/S7H8R0SI/h +o5Tlgw8L3RytnGTpfTavqovQtC6grBX8Y2wHMWhJ7PGxs31HYHRWstZM/EPPQKq4Ak9 yN/kl1kiLyDxZCAKBL/xSEPBqXXv15f7seQaZfcMKEQhhyaNW4WxlFinkxBYVFkwrsSL d0Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cRg4+PCq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id n3-20020a056a0007c300b006bf1f9bb921si1289590pfu.120.2023.11.03.03.42.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 03:42:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cRg4+PCq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 890D183AC0DA; Fri, 3 Nov 2023 03:42:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347166AbjKCKlz (ORCPT + 99 others); Fri, 3 Nov 2023 06:41:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229939AbjKCKlx (ORCPT ); Fri, 3 Nov 2023 06:41:53 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CB2FD4B for ; Fri, 3 Nov 2023 03:41:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699008062; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=Lp6Jz+POVOM2ymATN0+4roKlcGz/gu2UjTswWR4Ytbw=; b=cRg4+PCqqSlOE2s/8+SbHCWChJ/PgzTXRoLzGH2VKsxlFbC6nK51LMuzcKpx7+fFQ85SE9 ZqdCL60k0CdCxvgpyvUtNst78QeZG6G9eFzeg/QI6b37gEj2F0Veh//aj0hpgG1tnhl+/z GKWyOQ93PVAwx6y1OyziDH2saneefoY= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-399-4L2D5j_RP4ei0doGh-MZ8A-1; Fri, 03 Nov 2023 06:41:00 -0400 X-MC-Unique: 4L2D5j_RP4ei0doGh-MZ8A-1 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-9c15543088aso220446566b.1 for ; Fri, 03 Nov 2023 03:41:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699008060; x=1699612860; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Lp6Jz+POVOM2ymATN0+4roKlcGz/gu2UjTswWR4Ytbw=; b=k/1fM/vr3yz3kDX2xEXdMZPAZ6HfDAN9HrkSnRIYxFzdjSDdcjSuc1eN956RNRc3H0 Ii4oRFEyE2ojgjxsBKYIgFJwojGuknneHcdWlBALHaeFXn1bxuAQNkyvU6j+ezcKVBq9 rCHQGwruWWcPqQr0MjZXn1oAT33rLeP0FMQYZtrLwturj8eTfF8Ondo+jH1/fWhepqD0 ivdhv2ZLhLdpbN4NA+BmMnMsC7eSUTbrR6AnMg41igb7BRxfdDwsBZDO9xLaGw9A0fe1 nkxacsTb5SpuS8gJVTEPInPr6gVq2PliZOqIN5fjfR3pMDVkI0MQRAf+omF0fso1yv8g DRaw== X-Gm-Message-State: AOJu0YyYWm4HlG07GvAIH9ZioC0XB6dSLpiv9Nq/PbE9ENTkNGraFZdd 8tFrvRkdoymSf8hFtGeB4q1I2ecrdDTJIjU3vIwQFB6Nqe1SCd9DBbuQWVP/U9CJB9+LEpRWcaf 4PrUTlLrBRFb9w1CN26ZdrU55 X-Received: by 2002:a17:906:7950:b0:9bf:c00f:654a with SMTP id l16-20020a170906795000b009bfc00f654amr2302817ejo.24.1699008059853; Fri, 03 Nov 2023 03:40:59 -0700 (PDT) X-Received: by 2002:a17:906:7950:b0:9bf:c00f:654a with SMTP id l16-20020a170906795000b009bfc00f654amr2302775ejo.24.1699008059454; Fri, 03 Nov 2023 03:40:59 -0700 (PDT) Received: from ?IPV6:2001:b07:6468:f312:4783:a68:c1ee:15c5? ([2001:b07:6468:f312:4783:a68:c1ee:15c5]) by smtp.googlemail.com with ESMTPSA id g4-20020a170906394400b009a5f1d15644sm754493eje.119.2023.11.03.03.40.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 03 Nov 2023 03:40:58 -0700 (PDT) Message-ID: Date: Fri, 3 Nov 2023 11:40:56 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v13 15/35] fs: Export anon_inode_getfile_secure() for use by KVM Content-Language: en-US To: Christian Brauner , Sean Christopherson Cc: Marc Zyngier , Oliver Upton , Huacai Chen , Michael Ellerman , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexander Viro , "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 , Fuad Tabba , Jarkko Sakkinen , Anish Moorthy , David Matlack , Yu Zhang , Isaku Yamahata , =?UTF-8?B?TWlja2HDq2wgU2FsYcO8?= =?UTF-8?Q?n?= , Vlastimil Babka , Vishal Annapurve , Ackerley Tng , Maciej Szmigiero , David Hildenbrand , Quentin Perret , Michael Roth , Wang , Liam Merwick , Isaku Yamahata , "Kirill A . Shutemov" References: <20231027182217.3615211-1-seanjc@google.com> <20231027182217.3615211-16-seanjc@google.com> <20231102-freihalten-vorsah-fdd68051b005@brauner> From: Paolo Bonzini Autocrypt: addr=pbonzini@redhat.com; keydata= xsEhBFRCcBIBDqDGsz4K0zZun3jh+U6Z9wNGLKQ0kSFyjN38gMqU1SfP+TUNQepFHb/Gc0E2 CxXPkIBTvYY+ZPkoTh5xF9oS1jqI8iRLzouzF8yXs3QjQIZ2SfuCxSVwlV65jotcjD2FTN04 hVopm9llFijNZpVIOGUTqzM4U55sdsCcZUluWM6x4HSOdw5F5Utxfp1wOjD/v92Lrax0hjiX DResHSt48q+8FrZzY+AUbkUS+Jm34qjswdrgsC5uxeVcLkBgWLmov2kMaMROT0YmFY6A3m1S P/kXmHDXxhe23gKb3dgwxUTpENDBGcfEzrzilWueOeUWiOcWuFOed/C3SyijBx3Av/lbCsHU Vx6pMycNTdzU1BuAroB+Y3mNEuW56Yd44jlInzG2UOwt9XjjdKkJ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OFnYUCCL77bucx9uImI5nX24PIlqT+zasVEEVGSRF m8dgkcJDB7Tps0IkNrUi4yof3B3shR+vMY3i3Ip0e41zKx0CvlAhMOo6otaHmcxr35sWq1Jk tLkbn3wG+fPQCVudJJECvVQ//UAthSSEklA50QtD2sBkmQ14ZryEyTHQ+E42K3j2IUmOLriF dNr9NvE1QGmGyIcbw2NIVEBOK/GWxkS5+dmxM2iD4Jdaf2nSn3jlHjEXoPwpMs0KZsgdU0pP JQzMUMwmB1wM8JxovFlPYrhNT9MAEQEAAcLBMwQYAQIACQUCVEJx7gIbDAAKCRB+FRAMzTZp sadRDqCctLmYICZu4GSnie4lKXl+HqlLanpVMOoFNnWs9oRP47MbE2wv8OaYh5pNR9VVgyhD OG0AU7oidG36OeUlrFDTfnPYYSF/mPCxHttosyt8O5kabxnIPv2URuAxDByz+iVbL+RjKaGM GDph56ZTswlx75nZVtIukqzLAQ5fa8OALSGum0cFi4ptZUOhDNz1onz61klD6z3MODi0sBZN Aj6guB2L/+2ZwElZEeRBERRd/uommlYuToAXfNRdUwrwl9gRMiA0WSyTb190zneRRDfpSK5d usXnM/O+kr3Dm+Ui+UioPf6wgbn3T0o6I5BhVhs4h4hWmIW7iNhPjX1iybXfmb1gAFfjtHfL xRUr64svXpyfJMScIQtBAm0ihWPltXkyITA92ngCmPdHa6M1hMh4RDX+Jf1fiWubzp1voAg0 JBrdmNZSQDz0iKmSrx8xkoXYfA3bgtFN8WJH2xgFL28XnqY4M6dLhJwV3z08tPSRqYFm4NMP dRsn0/7oymhneL8RthIvjDDQ5ktUjMe8LtHr70OZE/TT88qvEdhiIVUogHdo4qBrk41+gGQh b906Dudw5YhTJFU3nC6bbF2nrLlB4C/XSiH76ZvqzV0Z/cAMBo5NF/w= In-Reply-To: <20231102-freihalten-vorsah-fdd68051b005@brauner> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 03 Nov 2023 03:42:00 -0700 (PDT) On 11/2/23 17:24, Christian Brauner wrote: > On Fri, Oct 27, 2023 at 11:21:57AM -0700, Sean Christopherson wrote: >> Export anon_inode_getfile_secure() so that it can be used by KVM to create >> and manage file-based guest memory without need a fullblow filesystem. >> The "standard" anon_inode_getfd() doesn't work for KVM's use case as KVM >> needs a unique inode for each file, e.g. to be able to independently >> manage the size and lifecycle of a given file. >> >> Note, KVM doesn't need a "secure" version, just unique inodes, i.e. ignore >> the name. >> >> Signed-off-by: Sean Christopherson >> --- > > Before we enshrine this misleading name let's rename this to: > > create_anon_inode_getfile() > > I don't claim it's a great name but it's better than *_secure() which is > very confusing. So just: > > struct file *create_anon_inode_getfile(const char *name, > const struct file_operations *fops, > void *priv, int flags) I slightly prefer anon_inode_create_getfile(); grepping include/linux for '\ May also just remove that context_inode argument from the exported > function. The only other caller is io_uring. And neither it nor this > patchset need the context_inode thing afaict. True, OTOH we might as well rename anon_inode_getfd_secure() to anon_inode_create_getfd(), and that one does need context_inode. I'll Cc you on v14 and will carry the patch in my tree. Paolo > Merge conflict risk is > extremely low so carrying that as part of this patchset is fine and > shouldn't cause huge issues for you. >