From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6493DC41513 for ; Fri, 13 Oct 2023 16:55:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230119AbjJMQzm (ORCPT ); Fri, 13 Oct 2023 12:55:42 -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-Google-Smtp-Source: AGHT+IGj5xI/++tlsxAohTj1c+Qq338n1HPZhLbwf3cqW8PuGxWCGz5IRSyv9cGVcgL/NLV+GP5fOnU9smg= 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.