Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2572999rdg; Mon, 16 Oct 2023 08:21:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE/LZp2tkXo2i7zu+xxoECUPkc3dSPUE5MFpjgb42eXmTMv0fqCNwY7vjK+NwEVKXzLebub X-Received: by 2002:a17:90b:118a:b0:27d:19ef:fa2c with SMTP id gk10-20020a17090b118a00b0027d19effa2cmr10306072pjb.14.1697469677901; Mon, 16 Oct 2023 08:21:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697469677; cv=none; d=google.com; s=arc-20160816; b=hDb1J3Vh9dU19N9S3M5oTk9/6DUz1x3ffUJAf/GQT2N7rvqOXko+gR8GD2ca5hiGWe g6QIF7KXbySnhPdGZpNWBhPRfO0sJyA9kWeIytYoLKPnYnVjYmCBWd2ODzuEkx6Lei1q Xe/TGMGKGvnwM3u/JnuHWUX25PIg/bpuHBAvYJTrmgHDs6K4ugdYTwSNJKR4xG3rC/mh p8N2O6ZxBwf/iBDwIB/NcCQ0COXuhIDr42+JkUZMbb9BRxTUkuegWEdTIdt85mxrHfIk JUXedZzt6fF6pmtdMVEAqHxNUIACLsLSk4+zCrzY2AArGAQPg2BuTJWLSWAlr0HeQp1J RgdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=AEix8IoCjFYipbhyqgKL2qJL2YZHCFj9VqmEx2SLGiw=; fh=I7G+7rtRtM3/E4XDaRoZzAF0X+JOP7I22VSuXXE+Gww=; b=lI6SCqgqk9hk+xwUZyLPADDv/1sjUWAdFk0LDWglzuafCLCBvHifB7emWTzqsECVOW dCGQAddy6IEq7B1BtrsE+EuqyYKAUAR09BDCK62AaNmABb8mCVvC+pO1guWFiCxt3Nxr ifLLThQFypRmAJyD6Ucws3NO1ln3AMWP9vhmAQ+8C61ONpWmcC2pseh7ETnKT69eHoUl cwQISGvrJMplNo+AQZZXMgUhGIriSXtMuYt/VEi/p9JqQWWlnbCP5sz56aZg6Oyx1wqc zwfT/m05akYXd97kAUbhm5vR1VBkOMHIgTB2hzwyckfFCj9qwtqtjB9tjJ9brzHP7bxd MhzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SpPhvC8T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id h22-20020a17090a055600b00271a453203esi6164807pjf.130.2023.10.16.08.21.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 08:21:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SpPhvC8T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id AEA3F805A79B; Mon, 16 Oct 2023 08:21:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233692AbjJPPUv (ORCPT + 99 others); Mon, 16 Oct 2023 11:20:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232365AbjJPPUt (ORCPT ); Mon, 16 Oct 2023 11:20:49 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28D51F9 for ; Mon, 16 Oct 2023 08:20:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697469606; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=AEix8IoCjFYipbhyqgKL2qJL2YZHCFj9VqmEx2SLGiw=; b=SpPhvC8TmWVrm6zy97d3BY/Umc8wwkcRv+Z3VVTSz207GNwayu2FANcUQYHsIJuaDVdhKk 5pufUMsi22pR8hFCos6WSubruc88AghGZpSwYptVPZk8uhEQnOYJIr6mlDk3yI0Opvl9m0 mH4hhuS53EDUEfSBkEvxufz1EFhHNsI= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-67-Wv8BcjgINayr-1e0CL4JNA-1; Mon, 16 Oct 2023 11:19:59 -0400 X-MC-Unique: Wv8BcjgINayr-1e0CL4JNA-1 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-9b2cf504e3aso320978366b.2 for ; Mon, 16 Oct 2023 08:19:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697469599; x=1698074399; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=AEix8IoCjFYipbhyqgKL2qJL2YZHCFj9VqmEx2SLGiw=; b=t4RvDNvYP7Q9+Dg5aOsoGvH7/H+lqdht180N6DpCHzVswT5bknu897TV2CdSCPAJhl hABkuIycURYyvgqhaae4BTwrKNqaGmR9eGjCaidw1fGO1hLoZ5+cwQle9rI44sFQGGuo XNeLmVYGPpmLGsoVJSYgtz+MzIpd0pUrqnS9LaX8gdKmXwPQk5xaC+ayGacVBi/YY6wB VHWGbgDVTGOr11gHcwwHymJ9eTgO4xnsBpbb+kXKdg4Z0shEQgSIHhYrfGt98rpl3dlu r3P4OpPH8VFXlZTVftK+qvxGZmvyGZOHns43pqOqO98gqRHFjS4NyB/0Xt8FkTmeYl1t DXMw== X-Gm-Message-State: AOJu0YySba2DS4Ueuu6kC0mPwIVh4aAjIs0V1wqGQ5eeAHtINMmso+0H Sr0za/4Nfx/jObsEOzPUEakkgoOy7+ZLr+xb5+NTNpO650YSl/OYc4iY+1cuXbspf4ofWkw28rU NIz88NJuoLcLdDiQhMDx1s+HE X-Received: by 2002:a17:906:2109:b0:9ba:65e:750e with SMTP id 9-20020a170906210900b009ba065e750emr20293558ejt.32.1697469598880; Mon, 16 Oct 2023 08:19:58 -0700 (PDT) X-Received: by 2002:a17:906:2109:b0:9ba:65e:750e with SMTP id 9-20020a170906210900b009ba065e750emr20293542ejt.32.1697469598512; Mon, 16 Oct 2023 08:19:58 -0700 (PDT) Received: from ?IPV6:2001:b07:6468:f312:63a7:c72e:ea0e:6045? ([2001:b07:6468:f312:63a7:c72e:ea0e:6045]) by smtp.googlemail.com with ESMTPSA id z4-20020a1709064e0400b00982a352f078sm4274087eju.124.2023.10.16.08.19.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 Oct 2023 08:19:57 -0700 (PDT) Message-ID: Date: Mon, 16 Oct 2023 17:19:56 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH gmem FIXUP] kvm: guestmem: do not use a file system Content-Language: en-US To: Sean Christopherson Cc: Al Viro , linux-kernel@vger.kernel.org, kvm@vger.kernel.org References: <20231009200608.GJ800259@ZenIV> <20231009204037.GK800259@ZenIV> <20231010000910.GM800259@ZenIV> <20231010003746.GN800259@ZenIV> <7c4b1c78-de74-5fff-7327-0863f403eb7e@redhat.com> From: Paolo Bonzini Autocrypt: addr=pbonzini@redhat.com; keydata= xsEhBFRCcBIBDqDGsz4K0zZun3jh+U6Z9wNGLKQ0kSFyjN38gMqU1SfP+TUNQepFHb/Gc0E2 CxXPkIBTvYY+ZPkoTh5xF9oS1jqI8iRLzouzF8yXs3QjQIZ2SfuCxSVwlV65jotcjD2FTN04 hVopm9llFijNZpVIOGUTqzM4U55sdsCcZUluWM6x4HSOdw5F5Utxfp1wOjD/v92Lrax0hjiX DResHSt48q+8FrZzY+AUbkUS+Jm34qjswdrgsC5uxeVcLkBgWLmov2kMaMROT0YmFY6A3m1S P/kXmHDXxhe23gKb3dgwxUTpENDBGcfEzrzilWueOeUWiOcWuFOed/C3SyijBx3Av/lbCsHU Vx6pMycNTdzU1BuAroB+Y3mNEuW56Yd44jlInzG2UOwt9XjjdKkJZ1g0P9dwptwLEgTEd3Fo UdhAQyRXGYO8oROiuh+RZ1lXp6AQ4ZjoyH8WLfTLf5g1EKCTc4C1sy1vQSdzIRu3rBIjAvnC tGZADei1IExLqB3uzXKzZ1BZ+Z8hnt2og9hb7H0y8diYfEk2w3R7wEr+Ehk5NQsT2MPI2QBd wEv1/Aj1DgUHZAHzG1QN9S8wNWQ6K9DqHZTBnI1hUlkp22zCSHK/6FwUCuYp1zcAEQEAAc0j UGFvbG8gQm9uemluaSA8cGJvbnppbmlAcmVkaGF0LmNvbT7CwU0EEwECACMFAlRCcBICGwMH CwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRB+FRAMzTZpsbceDp9IIN6BIA0Ol7MoB15E 11kRz/ewzryFY54tQlMnd4xxfH8MTQ/mm9I482YoSwPMdcWFAKnUX6Yo30tbLiNB8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+RjKaGM GDph56ZTswlx75nZVtIukqzLAQ5fa8OALSGum0cFi4ptZUOhDNz1onz61klD6z3MODi0sBZN Aj6guB2L/+2ZwElZEeRBERRd/uommlYuToAXfNRdUwrwl9gRMiA0WSyTb190zneRRDfpSK5d usXnM/O+kr3Dm+Ui+UioPf6wgbn3T0o6I5BhVhs4h4hWmIW7iNhPjX1iybXfmb1gAFfjtHfL xRUr64svXpyfJMScIQtBAm0ihWPltXkyITA92ngCmPdHa6M1hMh4RDX+Jf1fiWubzp1voAg0 JBrdmNZSQDz0iKmSrx8xkoXYfA3bgtFN8WJH2xgFL28XnqY4M6dLhJwV3z08tPSRqYFm4NMP dRsn0/7oymhneL8RthIvjDDQ5ktUjMe8LtHr70OZE/TT88qvEdhiIVUogHdo4qBrk41+gGQh b906Dudw5YhTJFU3nC6bbF2nrLlB4C/XSiH76ZvqzV0Z/cAMBo5NF/w= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Mon, 16 Oct 2023 08:21:15 -0700 (PDT) On 10/13/23 18:55, Sean Christopherson wrote: > 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. Fair enough, it's true that many fops don't have a .open callback already. Paolo