Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2121207rdb; Mon, 9 Oct 2023 13:20:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFBWqoODuZqLJPx5f+omW4zaCJQjbTrIbZ8d2+3TywRUEVk6+2Hn9gFTAB9RS5LinWUBmHZ X-Received: by 2002:a9d:6f15:0:b0:6b7:518a:1672 with SMTP id n21-20020a9d6f15000000b006b7518a1672mr18029925otq.34.1696882823539; Mon, 09 Oct 2023 13:20:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696882823; cv=none; d=google.com; s=arc-20160816; b=s0YEjkClBnZeOx9dcVz7LfRI4eRdtdLWbwWDBba9mps/+KT2x8saL7A0YuWnEJdmVv u2BaoqFAKPfRCmF/a/eg4vCWGCiw0OczTtP4GhbHYRWaLgtMrClJ+YTLQTawqmWPTQEU qp+GRWD0e+j9GElZIKUDvoduN5QxAXjr+rhcXuWGteliGdH86R7yzrsuC9xZh0en0Nep veLZ4tvUjg1zt4w/vnHbz4Y0Ml+JlELs4slUY3RMmLR9TbiRC1bgLlE0DJSSQ4s63TzH 1no7SNy8jjeZAkbnpbvQhb6cIwsAxYRmAnKZLEim9u0M6mrTteTdCXY5Ik+Vi20PBKCq Kjlg== 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=X6+GJ5cI4z2TlJw5nJFvkv7FETWY362gjhrvcMB9XFc=; fh=6r7tsuSNtEA1kc6u9rolnGSwa9O/8zGR77V4wjPW5XA=; b=JRzSiLtRL5fakzMQs+gllHsA152cVg60VS2oj2tGdC/CFWm6rVF5W7t/1Ay+QpT4Q0 5gtTl1TfoZe+2dvuvs6S/haNhD6KH2E2GXvthE7iL43oBsCeQxOxcqZDApARLwpkmZEq g9fZdFeSfAJxUDRZHbgN494QYS5oZK+YnlE0iepKfXWsEyPgyd5swHdJp+KlLTL30sDk luaz77hn0M67X1En85BpD0aKBCRIYAuIMpaxXpjOHA0r2C/YEmLQXnIWFjMN/Ql7GeHp ju4RMBEwaD+hqxKeHWvhA8GKX6DljbMjUQfTc9Bjqk+zWrKjzY9q2y+BNH8US5G+FkcL orbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=LYMPNRYa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id u69-20020a637948000000b00573fbbb7803si9862391pgc.613.2023.10.09.13.20.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 13:20:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=LYMPNRYa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 825F2809340C; Mon, 9 Oct 2023 13:20:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378585AbjJIUUO (ORCPT + 99 others); Mon, 9 Oct 2023 16:20:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378544AbjJIUUL (ORCPT ); Mon, 9 Oct 2023 16:20:11 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E74694 for ; Mon, 9 Oct 2023 13:20:09 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-5a22eb73cb3so88386057b3.3 for ; Mon, 09 Oct 2023 13:20:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1696882808; x=1697487608; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=X6+GJ5cI4z2TlJw5nJFvkv7FETWY362gjhrvcMB9XFc=; b=LYMPNRYaGtJ0B7jCpzJLOeAOt4N5rEjxApu3zMBe7oeVCCTl5ExTQEGkDjkQ2VquMi 5JzYk5VrNtmkSZEbCJr7LuTLXgPgdswazaskUq4r/nb2MwvQlY/7bin9K4mSEOb1nh23 aQGNHQR5OCxv8ouCA5FnKE6fg5l2yOVe8wE0MnBeOdtEv7qlv4UWIW+YwoP7fCYOmhM7 IcxngCv54vmqWR2K7rpaTfwzdEBwnwv880xHoxJbZg5AP9sNmeXJ1XIbmh7dlza/cfMf uAMOiB3KSGkQK0ZsaI/eD8AuVIIoMseYxZAZliaW6DQNB32qGbBHGpSYxiTQAKR6ts1H BB/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696882808; x=1697487608; 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=X6+GJ5cI4z2TlJw5nJFvkv7FETWY362gjhrvcMB9XFc=; b=E7CpW7ykcZzmXXwbd8+2w2ueW5nHjblkAAm8BnW3A3xBtiBEyhOdT3OGkMp6uDKWuE um/RhN7aWpauxnDYCwhuKLERosy7BZPcc3WzoYPvPDhtUNRXaPHlLgI+qNd936EJh+iH PfWR7c8kPRP4Kpf1V2vNLitgOnDVuROQNNj/EMZOKmM0CgORVS0QMh6gMqG19ea8txHe Yy9N5IpxuDIzU35xCdbu70KuehMudzAGDs+eV+b8rUUV8RUQZ026kdVEHlWlQctSNooj kSBfPc2cEA5rvsecaxJ7I5/ZuRcZ490EaIbm81AW58X4FZYehLLvsi09mwqfAXB+Q+DT FgqA== X-Gm-Message-State: AOJu0YyIZitdcvcI7tCYE37ELz6qRuAPQ2YijN1LqIoXZSngbjML2BqH iNMwAHAU5kh8v8O/ys+/WYeyq3dC/c8= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a5b:b50:0:b0:d80:904d:c211 with SMTP id b16-20020a5b0b50000000b00d80904dc211mr241176ybr.7.1696882808446; Mon, 09 Oct 2023 13:20:08 -0700 (PDT) Date: Mon, 9 Oct 2023 13:20:06 -0700 In-Reply-To: <20231009200608.GJ800259@ZenIV> Mime-Version: 1.0 References: <20230928180651.1525674-1-pbonzini@redhat.com> <169595365500.1386813.6579237770749312873.b4-ty@google.com> <20231009022248.GD800259@ZenIV> <20231009200608.GJ800259@ZenIV> Message-ID: Subject: Re: [PATCH gmem FIXUP] kvm: guestmem: do not use a file system From: Sean Christopherson To: Al Viro Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Paolo Bonzini Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-4.8 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Mon, 09 Oct 2023 13:20:20 -0700 (PDT) On Mon, Oct 09, 2023, Al Viro wrote: > 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. Yes, this code can be compiled as a module. I assume there issues with the inode outliving the module?