Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1091199rdg; Fri, 13 Oct 2023 09:55:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGpumK3PVm98fhOclbpDnCWYSfMFqwN1WrzEUWyjBLUlHJPbMXYH0aeELSpDJ+T9fJtbfhJ X-Received: by 2002:a17:90a:c0f:b0:27c:fb84:101a with SMTP id 15-20020a17090a0c0f00b0027cfb84101amr9415887pjs.29.1697216155487; Fri, 13 Oct 2023 09:55:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697216155; cv=none; d=google.com; s=arc-20160816; b=rJX5Q50NCveeRRK+pz7J8yFGMzTfzySPsfZW92gby0wmtEbQzZKsLxdInCsO56ERgQ c+ewZUXU/ObS9xLOqrfu6RtANerT0efcZXIz2Q2TrivXvR/5jYMFjmkYLVrXDFJHMnSJ s47B1i5yfjlUydBL9NIilD+OoWfBque5ncgEB9g5LsX3MVSUboSBK+Pdz2puzyBJs+vE 9xm3qeVASPacsw8Pg/VvsCczkqSFozeisgg580WRpT+Jp2U2doKUKZ7X6qwNEDslIE3O OcY/tJRjq+U+Vwr/0F3qlgwBst90qClOEW241XwWxiVPYnS3Xzw32JsLTAq1xa5txgfl INpw== 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=SqpC3O39vWA5duvUzqUKP8E1siQNepZhPn4u3Os8+q4=; fh=kMrzn5LA/H/P07keG+ThsafQ/6ePczpqna0iwGmH8aE=; b=LdcOV78phav6chVSg2qUWDcGTEYArgqkNtNXEBogpgTOqj+H95SZb1AFhVJ5ZINdE7 pKiQRE71PpQ1wQjrLiUZPzZc8aXJJHJbrzeBD4kU0UgQOkB2ewmG6RPvFx3ophuSbvWu V/Kw7v7fa0HqeC9bJc4FY66zMunLFVqmse6qSf7inDBr188XyOWq3O7LUcuPJTwbaMQs 5jcUGTDfKPDiE+bif830aqi5daifrEwbejkH414HW7t5wHw30hfEvPK0yqW4ZkeTH8ci h/yfV1cIypiEmRAXqyOBrhJIlVDP8TDCfpNkGJJhaZupZdpK8wjvdy5gqUws2vnr8MtY j4tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="RU7X/bN2"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id em3-20020a17090b014300b002636d222400si460325pjb.14.2023.10.13.09.55.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 09:55:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="RU7X/bN2"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 14135833CE2F; Fri, 13 Oct 2023 09:55:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230213AbjJMQzk (ORCPT + 99 others); Fri, 13 Oct 2023 12:55:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229683AbjJMQzi (ORCPT ); Fri, 13 Oct 2023 12:55:38 -0400 Received: from mail-pf1-x449.google.com (mail-pf1-x449.google.com [IPv6:2607:f8b0:4864:20::449]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F8E695 for ; Fri, 13 Oct 2023 09:55:35 -0700 (PDT) Received: by mail-pf1-x449.google.com with SMTP id d2e1a72fcca58-6b697b7f753so316056b3a.1 for ; Fri, 13 Oct 2023 09:55:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1697216135; x=1697820935; 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=SqpC3O39vWA5duvUzqUKP8E1siQNepZhPn4u3Os8+q4=; b=RU7X/bN2TE0sR2S0pHwbe+KI1fUlsj4j9qUV5hwQXLYLGibXDJ0Z0J/Q6/a8WfFcCM fExWeAqmNIAeDGO8q7GOrxOPd/uO72AUz/SQBP4Gh6ZqPpxzDjLyevO/FVaxfs5atX2U lV+MZGKEvs6tkcW+kotZhOh8zvbU8JsTCQrPd8J+7j51MMQAqMn7+yN+Nz/VN0GOKuLk lQoxUyg2pIhgGyqHva4FLAo6q4MU+jH3537wG6TheF6PdgYGKN46nE+d8VBMWQzd19yx Xx74ONT+lhQYu1d9vyTtP/nzw9HWaXKbFtrtnP3HzLgN1WMXUGgYbRMAZ5pZ78ffTt0o 54gA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697216135; x=1697820935; 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=SqpC3O39vWA5duvUzqUKP8E1siQNepZhPn4u3Os8+q4=; b=W+fowZ4L2sBcEAmB9pBrf/1B667dc3KMoW4g7nke/Dak5AwzBtwiHkZCqUr9Jto8s4 gV9QDG0fE0IFNMN9HQTDmfIjegPJkdV4ClDgTxjcFbrUSPehXLm6v/NRR3wpXi1VRi5X qWx69Ayq1BYffM2+MT4BgvQ1fRIonQeCcM8t+xNPJ0PVN0/vXXh1ps8NFDG4aT1tJL48 1MvF9jS8d8FpFZ6FyFUSlhZMTBNdnQtjp2sIGSTVpa6j0szpwRtkvudWLqRCcNrEAAhP gCvaewnZQZdF+1kYQ3T2nZFGMdwO62L5LIamCIkbsbvj7PyBR0ewKmXgX9E2UEGGDepU NB+Q== X-Gm-Message-State: AOJu0Ywvz3Zff7T19F07f8nffaVnTgWNRZvf0JvgMRFGYdslFbp6Tqa2 HQd/vzrNr8fYl5NFoyTrxP4YOavrMNA= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6a00:2e05:b0:68f:cb69:8e76 with SMTP id fc5-20020a056a002e0500b0068fcb698e76mr640155pfb.2.1697216134809; Fri, 13 Oct 2023 09:55:34 -0700 (PDT) Date: Fri, 13 Oct 2023 09:55:33 -0700 In-Reply-To: <7c4b1c78-de74-5fff-7327-0863f403eb7e@redhat.com> Mime-Version: 1.0 References: <20231009200608.GJ800259@ZenIV> <20231009204037.GK800259@ZenIV> <20231010000910.GM800259@ZenIV> <20231010003746.GN800259@ZenIV> <7c4b1c78-de74-5fff-7327-0863f403eb7e@redhat.com> Message-ID: Subject: Re: [PATCH gmem FIXUP] kvm: guestmem: do not use a file system From: Sean Christopherson To: Paolo Bonzini Cc: Al Viro , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 howler.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 (howler.vger.email [0.0.0.0]); Fri, 13 Oct 2023 09:55:53 -0700 (PDT) On Wed, Oct 11, 2023, Paolo Bonzini wrote: > Your patch 2 looks good, but perhaps instead of setting the owner we could > stash the struct module* in a global, and try_get/put it from open and > release respectively? That is, .owner keeps the kvm module alive and the > kvm module keeps kvm-intel/kvm-amd alive. That would subsume patches 1 and 3. I don't think that would be a net positive. We'd have to implement .open() for several file types just to get a reference to the sub-module. At that point, the odds of forgetting to implement .open() are about the same as forgetting to set .owner when adding a new file type, e.g. guest_memfd.