Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp496916rdb; Thu, 2 Nov 2023 09:24:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHf4GjnkiW6eOn/iqBPq/Yj/EqOYB3a6JyD8C05Yf2SXJ0ZQcRErMj7T6cHDL0mSPOst4CV X-Received: by 2002:a05:6a20:8421:b0:181:16c7:6cd0 with SMTP id c33-20020a056a20842100b0018116c76cd0mr7955290pzd.17.1698942290738; Thu, 02 Nov 2023 09:24:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698942290; cv=none; d=google.com; s=arc-20160816; b=V/gvaAQtW7RXKc++nObf9Pg4KZjQ9Finsqv7wkCM8iakNz0f9Qr5KHDcO8E7YKnLDH CsOoVzPQGayRVdHWqREu9vRLKOus0wkV7lFQwrypN4VMLcSK6x9p06/+T3fAVs1+A3BF RGo/Qt2iFqMrHp6NizOc3M6eeuwa98Q3oDtSi8KBlCg5vpkc6TuXXnjEzeNZLJjKGLVS bFMbumnYLwYG3caur6Za2FRVkaLmRBjIgjBYIA2/pZH8Tucm/rAtICQz/73f45W0OGqJ PnmjUybP0ixaYJQZzZJkb926uzDAAtVsr9bWKUD8f8sHH1nKyM55YTJcIHd3fwqfzt38 5yiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=HnyBGy2XgkPSPqImTiPWH8+PRjTRB/35l+KAA1/cEPM=; fh=WH1SwOHGBKHfB8l+Y9eVNNmBG3AMqcrXl0nyGFIfefM=; b=n9ad+L6nuZ9qZFSNik55/w1d8kq+x1m29PmmMlRvMGmSr5g9y/YbXyz+OF9sm9xWjt xETdqM+qkZmqtQMGE2nUy2zkz9Eiit7xGkpoBLNgBdEQgHzOTmdFSViC+v5fJ4aPjOC4 Iql4Q2cVEsvvWun8h9aAdgonDU+5P0vTOMgBJrL5RrvFCxVG0cXVyFSCdWItjGneKnq8 gLidY+8Rj0BIDSQTRCJDGHZW41yyBvD1jbIikhIPSaayfIBsV8Z2YJ8qTaqzmE2fz815 WDblbLJvZn3uU2lYm+8Y6cT80IYcp1WRYiGCOgQ79fIYrK9rNKZRVvFqzajhAuYRuve5 LeBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ciKD3Sqq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id 79-20020a630052000000b005859a7d38f9si2037703pga.703.2023.11.02.09.24.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 09:24:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ciKD3Sqq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 72FCA8183ECC; Thu, 2 Nov 2023 09:24:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376572AbjKBQYn (ORCPT + 99 others); Thu, 2 Nov 2023 12:24:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234161AbjKBQYm (ORCPT ); Thu, 2 Nov 2023 12:24:42 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE56312D; Thu, 2 Nov 2023 09:24:39 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EFBABC433C8; Thu, 2 Nov 2023 16:24:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698942279; bh=1oyVMjQI7OXHCUtZSgK71uJyeSsja11PK2zu0Sgh3ck=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ciKD3SqqJbMFjIcI6bCCYkwFV34fiO2ArRgF5fXcYKuOaGXb4Wyi9zozkY1GPacll Wb4+rsmrOAiUFpUvVmXoDHyclytLXtYqrhZkU0PpNpIyYDeZGFKHZDDWtqHWW99OuO qo3jhEw/diJ1a/cjqpth3wyK9LJTK2A2KbT6VwEC/UhcdzfCTDR5j8l+p9MS2DAQxb LzKQyThoycm/wTmhlnVYtsizofoKOqeGHL2Li2UrkzPUXr3zUUph4Dx0xK0JakNnV7 d57GUWFGv9wIfjooWNbwoPxilLaGhd+yLjY93dOc3Y/tHVaznNMcGB6moDDpowdxsF zbisHCIeWrzQg== Date: Thu, 2 Nov 2023 17:24:27 +0100 From: Christian Brauner To: Sean Christopherson Cc: Paolo Bonzini , 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?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" Subject: Re: [PATCH v13 15/35] fs: Export anon_inode_getfile_secure() for use by KVM Message-ID: <20231102-freihalten-vorsah-fdd68051b005@brauner> References: <20231027182217.3615211-1-seanjc@google.com> <20231027182217.3615211-16-seanjc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20231027182217.3615211-16-seanjc@google.com> X-Spam-Status: No, score=-1.6 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Thu, 02 Nov 2023 09:24:48 -0700 (PDT) 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) 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. Merge conflict risk is extremely low so carrying that as part of this patchset is fine and shouldn't cause huge issues for you.