Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1349370rdh; Fri, 27 Oct 2023 11:24:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHzgFj86y5O03DcSHqpHOilbUchf/cYTSBdrfWCT7oJY/Ar4e2Qj7QWMzPd4HDZkmd+vXqI X-Received: by 2002:a81:c946:0:b0:5a7:b464:ff1a with SMTP id c6-20020a81c946000000b005a7b464ff1amr3581890ywl.6.1698431068200; Fri, 27 Oct 2023 11:24:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698431068; cv=none; d=google.com; s=arc-20160816; b=k4Xh+e7pjcZz6ArY4MjUNeB87RY4/RDWFMTbrlTgg14XiQkv+CiZwpErtNu7OZRAeX 7NSmxJ9A1QD/5oIEexoBrfCa+L4cUYFypmqCsGQs+9sqEcN5RKGXFlWUKWi9m23blHNb diqG3HG1+vKTdO6HEMtBkk2uV0lFwfXjoLByNQcQR7WkeyGo30Y0T4Cwg4qg+A4jNvHT iBcVeprTdkIyaAxfG06ZZQwfbCwYD7Ukjhl9DWEmQOvipREEdqo6PZTzshjz2gw73TiO FZhicPHHxYdkfaLDFQC3pQHL3NBVQpOVj9QnAP2RFwupp6tT7tmT+k9XZ3bgrefdP98z eqrw== 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:reply-to:dkim-signature; bh=pX02ozc7lSRzYa356XIJ+CMNCgv5fZ3NEfG1CClMU1M=; fh=lhteFENhZrfxRoH7K7/E/bqXvDWa/XLvUszFia9mLtM=; b=TUuHERd3LYyi5kAGz/BpBc849DF4I0GAtS7YWDMFB4TwP9wzv5ajqaKT1ZJMmPggxl JjsUu+Z/d7dlFL+XwIYLKFPusIbuJj71N+4iUV6yKNttyPFuqqtynB5A4xXIB7pP02DE unENjd9sCLCTEuKkfLN1Q/X7UCDuCupwmKKpIU+bRaRtP6UuuSTmP2hwMLjft33nF54g Y/PuwVkEhlFSTjQvo2JNxrQJrVNUcFTcI/jiuTl+g6CFOBxtRR+xXfEC6f9X8pZ6sTml 6PT0fMu/2c81SEXOrcn0VxiIxKB1k5jCh/xIzwoqVcjJRr3fo/AXbBi/qhK2gnevdDXf N5eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=SdAdDdzk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id t129-20020a818387000000b005a4e9a61e1esi3465812ywf.15.2023.10.27.11.24.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 11:24:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=SdAdDdzk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 7FD808101EC6; Fri, 27 Oct 2023 11:24:26 -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 S235062AbjJ0SYO (ORCPT + 99 others); Fri, 27 Oct 2023 14:24:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346508AbjJ0SXh (ORCPT ); Fri, 27 Oct 2023 14:23:37 -0400 Received: from mail-pl1-x649.google.com (mail-pl1-x649.google.com [IPv6:2607:f8b0:4864:20::649]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCDFA1981 for ; Fri, 27 Oct 2023 11:22:58 -0700 (PDT) Received: by mail-pl1-x649.google.com with SMTP id d9443c01a7336-1cbe08af374so21423445ad.3 for ; Fri, 27 Oct 2023 11:22:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698430975; x=1699035775; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=pX02ozc7lSRzYa356XIJ+CMNCgv5fZ3NEfG1CClMU1M=; b=SdAdDdzkQW9NAOix+vNXPmrygbTqqSa0a0PcQgt4V7j8F4D7DwOVkUnGTZTW8HrWvW /Xg3y/aah/5tG3ui0ecO3iGyey+jskVT/pBjXo5MAJWBHvuBgYlIIwHRtROaC3hfxpO5 I2yHw9aXAcbaIRtuxjUfkGuwaLS75nQNqpUYMD4IdiCNGV+lG2vUe3Rn6sPXbKuQivCh jTpWSoqngr2R6KjjFYKOuxH6sAQxe1e08qvOOvNmKn6UJEzbD6BlsnTiBWCZkorZARPI juoJPOXQyyiWP796K2Y0nm63JMA7H9wP25LS6LeHpYdXniy/qrMr2K6og17hFGhyK9QQ oiMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698430975; x=1699035775; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pX02ozc7lSRzYa356XIJ+CMNCgv5fZ3NEfG1CClMU1M=; b=nlymp2HDZiwf5tlhXqwCBGEw3lHLj+s5eQ/kP28r+k/KY0yUs888mzKiV4Ncvh1F2l J2fgkSYYhVfqH2p+BgvvhzubJjufsBvH4EoJ+W/UW4HDSOUJoWOS+QnS9Q/Tox1s79+0 JTbvIBM+q1AodvnW3CyTAgYBhcqAnqWzXOhVnnKnrg33IPPYwudrU11xV5i9hg1fB08j z1lCk8/6WnnjtQrJjpx0yQzf7IS2bFZDP2pij7fmC0Hd7e8+PUYCDm/UTsZFAT6I+L9W 0aKDj4YkP+zNgi1+52Z6qoVLsh5hrecG/lhACMwT6KviJOmTBm86DBdOPvmesW/CkNfd SPow== X-Gm-Message-State: AOJu0Yy7nYNKQrkKBvExljyHf6PpgsMPcyl77apo9fCGykH8k8VZCbK7 GsQWbPG7bqMMX4Zd5NNFbCIIRtTuYzg= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:902:f7d6:b0:1cc:23d2:bb94 with SMTP id h22-20020a170902f7d600b001cc23d2bb94mr38516plw.1.1698430975510; Fri, 27 Oct 2023 11:22:55 -0700 (PDT) Reply-To: Sean Christopherson Date: Fri, 27 Oct 2023 11:21:57 -0700 In-Reply-To: <20231027182217.3615211-1-seanjc@google.com> Mime-Version: 1.0 References: <20231027182217.3615211-1-seanjc@google.com> X-Mailer: git-send-email 2.42.0.820.g83a721a137-goog Message-ID: <20231027182217.3615211-16-seanjc@google.com> Subject: [PATCH v13 15/35] fs: Export anon_inode_getfile_secure() for use by KVM From: Sean Christopherson To: Paolo Bonzini , Marc Zyngier , Oliver Upton , Huacai Chen , Michael Ellerman , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Sean Christopherson , Alexander Viro , Christian Brauner , "Matthew Wilcox (Oracle)" , Andrew Morton Cc: 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=20Sala=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" 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,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 27 Oct 2023 11:24:26 -0700 (PDT) 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 --- fs/anon_inodes.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/anon_inodes.c b/fs/anon_inodes.c index 24192a7667ed..4190336180ee 100644 --- a/fs/anon_inodes.c +++ b/fs/anon_inodes.c @@ -176,6 +176,7 @@ struct file *anon_inode_getfile_secure(const char *name, return __anon_inode_getfile(name, fops, priv, flags, context_inode, true); } +EXPORT_SYMBOL_GPL(anon_inode_getfile_secure); static int __anon_inode_getfd(const char *name, const struct file_operations *fops, -- 2.42.0.820.g83a721a137-goog