Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1459647iob; Thu, 5 May 2022 01:31:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtxh3AqA/80XX9XOAvcuGfsoayKHg0xsvR2IZLbp0oFaWgkNDalsP6e+BSf5rXLAa36LJH X-Received: by 2002:a63:f307:0:b0:3c5:74b3:1b72 with SMTP id l7-20020a63f307000000b003c574b31b72mr6942210pgh.120.1651739510937; Thu, 05 May 2022 01:31:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651739510; cv=none; d=google.com; s=arc-20160816; b=B6OLqAkjGsgukYhZsytqKaYZoj9NK34vbCOkQsvab+/xAHwMXLBTK+Pk8BI/gUAreT IKLkSWbGdwzEcfFwVoJ1z0C4xpGS5gXRtIf6Iebhxr7Xyx2HDkCxbGYWDzsjfmJwFDmQ vMU3dVn7B1Gf3qxmiiLibXLR0Mm7mOFqEdZV2V1bIkE+jFNf+uApJBvkCS8+NcfRiK6Z q6YpsiwmHKfVHGxNT4+xeboG00tNtdYP1MJvJzZ1HXhAnspsxPbzwyP2ZrOKfQTMWcZg gSaHBvr+Z4NCa/9i3PKRbqbfKVIQN4YUsf5d0bhoPH2CLyXxWxDMeAmzqgx1PFthYka8 zhSg== 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:from :references:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=34VZxVT7BZbb571VsASnxn7VWsmyBHWuoREbYnuFRqA=; b=b+8nT9x9NMg59bxCPBnmzkvz3curg+Cf/w8SmVkLp55w2pPcfTLXMj/5ier70ddyUq ELik0pcHiY7qVa4RS4cFp0awOjDGdUBPK4O++MYdyjarhfiQK8yZvuQZI7l+wK96+I5w q2LBfHPEio7kKjiC48NJM7khEIRUx3nANXiIuJANmpxzOXzyIEX1pFVaekY1acnk8Dzf 4oCEJOpDnByBsrt6wG9gi7UJLtbMcPll9be+B1gvU9K1MFjX1cvG6471Q+cjTqFCQPrn ivDRK22rj+B+rGPtAc9CTgksmi+b7Hh/plgdtJ75OpxibvVJzRmMHMxPhKAQPL4tmSDl ZlIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bAF+GusD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x27-20020a63485b000000b003ab9b0e6ffasi933862pgk.122.2022.05.05.01.31.36; Thu, 05 May 2022 01:31:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bAF+GusD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348966AbiEDLjW (ORCPT + 99 others); Wed, 4 May 2022 07:39:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349054AbiEDLjS (ORCPT ); Wed, 4 May 2022 07:39:18 -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 ESMTP id C5035222A6 for ; Wed, 4 May 2022 04:35:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651664141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=34VZxVT7BZbb571VsASnxn7VWsmyBHWuoREbYnuFRqA=; b=bAF+GusD+zUbuKQHwGyPQ18r5QpYfiwMs9cjrazuUueGWamLU01FLpC6b5pI1YfPES1/Bc m7F/V9uHp2I2AhykAqyH0EMisQQ++g21Qgeko0US7aBlbanHFOH9uRg00QaoxnO1fWpcS0 v89ed/lszdCuXXmN78mgpRTHYqUzdY8= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-673-HoCa62dZP3mkqIIPM04-zQ-1; Wed, 04 May 2022 07:35:40 -0400 X-MC-Unique: HoCa62dZP3mkqIIPM04-zQ-1 Received: by mail-wm1-f71.google.com with SMTP id m26-20020a7bcb9a000000b0039455e871b6so531286wmi.8 for ; Wed, 04 May 2022 04:35:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=34VZxVT7BZbb571VsASnxn7VWsmyBHWuoREbYnuFRqA=; b=zbrKWN2tHdbGP/3yjrXH2VUzNKBJK0eBlm4oTdpN1/TlTfoJFoAYS4gcl3lNDE0JTI +jPd4Q072y8Ov55hgaZ7rJRtoE7C7osqKu95EAfwoMkvuWoQ9a1TLpPZLENL96ykzm57 2qOmIxrEFDBcJOIgB0bE+9B8z3NbWNUpkI7WVXU98RLkNCbHM5DK2INy/h6b5W5JLQ7w OeOg1irhZbyBI2qcCY6OzpFDgT8aU0VyTcxzUaMDSYUu8FD9LeOr9mBFvQijQFrgArhz /7EGGaQz3yvY8Jo+nBpo1cCVkBnGgU/vknGesnyUHJsUlAiuNUkOkyCQupXnE+bqYXyy 7iLw== X-Gm-Message-State: AOAM531rsRhF3mIYzvE41SWnA0Kz0DpHP1h4agnQYQieU3hkgyaIjC4q FVmzAMuQtSPvpfbA14RQcfeGPOP0lo8JVLoV9BfXoiO/NCMkHjdWvOaSOsRCPmytykY8epitPT1 8Soh32qV11Yeejb88cZc4uLH1 X-Received: by 2002:a7b:ce0a:0:b0:394:41e:2517 with SMTP id m10-20020a7bce0a000000b00394041e2517mr7303644wmc.135.1651664139535; Wed, 04 May 2022 04:35:39 -0700 (PDT) X-Received: by 2002:a7b:ce0a:0:b0:394:41e:2517 with SMTP id m10-20020a7bce0a000000b00394041e2517mr7303627wmc.135.1651664139274; Wed, 04 May 2022 04:35:39 -0700 (PDT) Received: from [192.168.1.129] (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id e11-20020a05600c4e4b00b003942a244f36sm3780628wmq.15.2022.05.04.04.35.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 May 2022 04:35:38 -0700 (PDT) Message-ID: Date: Wed, 4 May 2022 13:35:37 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH v2] fbdev: Use helper to get fb_info in all file operations Content-Language: en-US To: Thomas Zimmermann , linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org, Junxiao Chang , dri-devel@lists.freedesktop.org, Maxime Ripard , Sam Ravnborg References: <20220503201934.681276-1-javierm@redhat.com> <038f8365-b23b-9d81-f7b2-8f8c6eb3a065@redhat.com> From: Javier Martinez Canillas In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Hello Thomas, On 5/4/22 13:08, Thomas Zimmermann wrote: [snip] >>> So something similar to fb_file_fb_info() is needed to check if >>> the vm_private_data is still valid. I guess that could be done >>> by using the vmf->vma->vm_file and attempting the same trick that >>> fb_file_fb_info() does ? >> >> Yeah should work, except if the ptes are set up already there's kinda not >> much that this will prevent. We'd need to tear down mappings and SIGBUS or >> alternatively have something else in place there so userspace doesn't blow >> up in funny ways (which is what we're doing on the drm side, or at least >> trying to). >> >> I'm also not sure how much we should care, since ideally for drm drivers >> this is all taken care of by drm_dev_enter in the right places. It does >> mean though that fbdev mmap either needs to have it's own memory or be >> fully redirected to the drm gem mmap. >> >> And then we can afford to just not care to fix fbdev itself. > > While the problem has been there ever since, the bug didn't happen until > we fixed hot-unplugging for fbdev. Not doing anything is probably not > the right thing. > Actually, this issue shouldn't happen if the fbdev drivers are not buggy and do the proper cleanup at .fb_release() time rather than at .remove(). I'll post patches for simplefb and efifb which are the drivers that we mostly care at this point. So we should be good and not need more fixes. -- Best regards, Javier Martinez Canillas Linux Engineering Red Hat