Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2115270rdb; Mon, 9 Oct 2023 13:07:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEPAjC623Ld5DY/+1Da97v5k40SWDc47e948tK3766aykstyXjA+DjhJRl1ZpuJovK9je1v X-Received: by 2002:a05:6358:430c:b0:133:b42:69ca with SMTP id r12-20020a056358430c00b001330b4269camr18660420rwc.18.1696882019897; Mon, 09 Oct 2023 13:06:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696882019; cv=none; d=google.com; s=arc-20160816; b=OsmQwhN1opM3vDQqGfYUTdZL6T4gdRBiAVSopU7EVRHKEyqgDPBSdyMKR0hkFNHXCU Mr4s7/Epm2/BkfFIb8SjCLGWzNbnFjuaPELf8LWurvCHQQGHG+Poj2ZBRn4cTN3A80ln 6upmnowM3AC2dDjEG3ai4NHJW81u0lnOj8KWW1TOgjJ+HU4mBzx+F6jc5DUg/tG2hqop ZFVHKM53wd5RneHrgeLgl3y+fqFeZRz4pddHG9uWgtibTaNyr+5hij8/P9wnMwKbMgxs pBCxLIJpDwNwwjY5Q5VdufwuFUxn0fLJV9axIygcegxO/O9KuS4NvpRlmCU9026l9MeS kFAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=yQilcMatqexoOCdrHBdsAR2o8PEeqyJV2iNf9DeNghw=; fh=7A2vjXu/ewATeTgBdu7iBmgBP0mnBjez2UGBNdh/IPI=; b=WSbtFGVLwSPzSSCZWKaYUI3X+9M5Q5fJQfkkLDW7ehdIDkjLvtSw6BOGBGeQ/+ZjBY GzF0M8uovXSE+OyJFYCUrCb+V9JsxKTJJMSGQzEvvzrPAk0E1bPdfeFwHKR1t1GEzSCG QDa37+8gtvAxkeRbDzg53CsoQvYqcvRPvzjU43i8ybku2yHO07K/kvrkxGvI9RqbMZ4V Dld/uPcWE7ZOg1yhNlSWQmYgvLVIwNiqHbIvE9txDGhJ61S80WmbIEl2O7bS8uyT/ZqZ IFbXZ15IOQXnvCLuxZ8wn4TQgrpF90HTRvhHbctfqaXWrgsQIslC6dcyQR3D1yeor1aR LXFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b="adV1xt/Z"; 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=zeniv.linux.org.uk Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id j26-20020a63551a000000b00582f1f73c82si7568464pgb.381.2023.10.09.13.06.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 13:06:59 -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=@linux.org.uk header.s=zeniv-20220401 header.b="adV1xt/Z"; 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=zeniv.linux.org.uk Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id A6B0B807C864; Mon, 9 Oct 2023 13:06:23 -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 S1378555AbjJIUGS (ORCPT + 99 others); Mon, 9 Oct 2023 16:06:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378534AbjJIUGM (ORCPT ); Mon, 9 Oct 2023 16:06:12 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59AEAB7; Mon, 9 Oct 2023 13:06:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=yQilcMatqexoOCdrHBdsAR2o8PEeqyJV2iNf9DeNghw=; b=adV1xt/ZK6Bqtj0LQ/bha3U9GI aEsZoJqrWulQeOakzRc648pAdDzxO2D3pda+G91WAeqESU4ENOJZcu2kkdeDO945Geu4/DXImhrzE MmFw2iDYkG0vXDds3RQ+K8/Tan9cNSQSETLIcIicMvk+4vvBhAHUMqCxYLm1pO7tz8aNnp12fBEAP 144QMOZVgaiWgQNKizg2m5RjiUi8/OWB2qlGsk212S/4/w0imByL7VEu9EfuOtAJlLp5xzsuY8gp1 Wlplj+iFstLG3W7fnjVNMFxFYsyVA+HEdFmVCJTsTKpW+8uMfy3VQwJ4obMLvuG0/fB6xeaMuEJjz J7UjZJfw==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1qpwW0-00HIQZ-1P; Mon, 09 Oct 2023 20:06:08 +0000 Date: Mon, 9 Oct 2023 21:06:08 +0100 From: Al Viro To: Sean Christopherson Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Paolo Bonzini Subject: Re: [PATCH gmem FIXUP] kvm: guestmem: do not use a file system Message-ID: <20231009200608.GJ800259@ZenIV> References: <20230928180651.1525674-1-pbonzini@redhat.com> <169595365500.1386813.6579237770749312873.b4-ty@google.com> <20231009022248.GD800259@ZenIV> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE 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]); Mon, 09 Oct 2023 13:06:23 -0700 (PDT) On Mon, Oct 09, 2023 at 07:32:48AM -0700, Sean Christopherson wrote: > Yeah, we found that out the hard way. Is using the "secure" variant to get a > per-file inode a sane approach, or is that abuse that's going to bite us too? > > /* > * Use the so called "secure" variant, which creates a unique inode > * instead of reusing a single inode. Each guest_memfd instance needs > * its own inode to track the size, flags, etc. > */ > file = anon_inode_getfile_secure(anon_name, &kvm_gmem_fops, gmem, > O_RDWR, NULL); Umm... Is there any chance that your call site will ever be in a module? If not, you are probably OK with that variant. I don't like the details of that interface (anon_inode_getfile_secure(), that is), but that's a separate story and your use wouldn't make things harder to clean up.