Received: by 2002:a05:6a10:8a4f:0:0:0:0 with SMTP id dn15csp2600448pxb; Mon, 31 Jan 2022 03:40:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJyqEaiTJTLe5qlJ3vd/me5S1wpSryzhgCDMn3c3gNwCziom2RqNR6fwJUb4RI/Pbaynu3jI X-Received: by 2002:a17:90a:c092:: with SMTP id o18mr34108894pjs.172.1643629227774; Mon, 31 Jan 2022 03:40:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643629227; cv=none; d=google.com; s=arc-20160816; b=Vn2PykFdNvkzRIUjn9UjcRHpFiNvIX90yDu0370GjXBYurJit+E02JAlKnEy+y2IHI f9Kh2zDgNVssDGA+/qckeptx9Sy1Txq7TVjDeXrW4+KEPVp1zvwaO68kyI6ooBKEuzFW j4oK8/qMSkubfvnlnZK8VTiRVQiE19tw/lQTfiDQCBrs0dYqYZHAq8PBHiGLX0J34Hdm f4GPlrP1PDeg+80ye6AeVQckD7xrt+KzstOARN+d5iVXXSt8J/6LF1kTHVR9Lu6TWmvO nHtw7ifR7T2oKxz4gYU91hWMiWmUNUgtl3tXe4eiTXtwUWbyMqf9IdYMuXKr30v7VkVi onwg== 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 :mime-version:user-agent:date:message-id:from:cc:references:to :subject:dkim-signature; bh=cfMRAmoR1rDJZPsZIg2Mf9Md2XIapwAEopIEQIY7W8o=; b=l1bHn4ZcpdWe0yA4g8VQdQ2mtqMwWso+Y3zF0l1eBtSj0X5deCrQNYzhYPr+TLV0aF T8tTqWoKXbN7j6ihm6C9OWoDqOUGUlQ0IyG4kKUl9kLYuolrL6s/o64ahQBniKb09Rhk 0Qan5EV5tzL+w6Hsx1xJbYkFCQw29BrnvesEMKzTsEUNSnUhNxEY/o14daaJmaYTZmxd j2PrpeMkQkQBJdHZLBIa0veQ71sllR+lRlmXc0YeOLNAo6yRDHCxdm46UNWJmsE8pGHu s8k529d6ChhufbAQYXof7KoY9faUWfnShvNxApSMa1PPiO1vj3uB50A0A/6BtE1qeW89 npfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="D/F0HH3R"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nu15si11599500pjb.152.2022.01.31.03.40.17; Mon, 31 Jan 2022 03:40:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="D/F0HH3R"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240553AbiA1V0K (ORCPT + 99 others); Fri, 28 Jan 2022 16:26:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232623AbiA1V0I (ORCPT ); Fri, 28 Jan 2022 16:26:08 -0500 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C25FC061714; Fri, 28 Jan 2022 13:26:08 -0800 (PST) Received: by mail-pj1-x102d.google.com with SMTP id o11so7637648pjf.0; Fri, 28 Jan 2022 13:26:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=cfMRAmoR1rDJZPsZIg2Mf9Md2XIapwAEopIEQIY7W8o=; b=D/F0HH3RAZHiHTuozAEIgdDuk7xHYPKxs8Vsjpdy/MFb1HGPaFzlxZb8fCK4DdpA8y pI45IeTGmWtsXn4dIC4UhI8jozVDWvoR+1B0XR/i5lZbVC8jHYh7vs45sQxt4r0iRhtJ l2GxQmIkfwFexUzY10Weo1sC04Y334JFLOTIGroXmvc+ic+mUqpxZAXCbYzE/u3M8QBo njNyaDcokUOJ6Dy5OY+Zc5CRNOc9mA6k80CI5QeI2UXk8udpMWloPkXMBTFHUfAxHe5k nsqPYWSxJ3Ga/azdEdsaIFTfQJW78K3dc3tAuRx++vURQpeh4rYNNc6m1GBHG/dvQYjt Hf2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=cfMRAmoR1rDJZPsZIg2Mf9Md2XIapwAEopIEQIY7W8o=; b=IKpjN3pj0qH8sJ7yrqkAa6ym+NVcec57azWskxtnsJ05pH2f2LJGlQsu9tl/k6y9BR 2QVEHrUNpDHGnqv3/cuWPnQsnwpNaVxOaEWubAofJZJssQ1EEffIWd0I+4Am/AwTH/2i XvHQvLonXUP8nz3zmoVVtdxzdt77s007bKxydrSU7Ocp1E+XHqzVmXnqnFqhnWJ5HHvu +ociCAICC9w6IBsdDRIn4RFGdfJoUXaCrnrG0bj2d39wIrgg7YNfj16YcY0CpqcG8SYS DiwL0qhMlUrm+6Hm1H7SgdXX3G4Q2qwLM61EUO3Sjf4klD2AjuDTpQ/Uny2CAZCVHY67 o/qw== X-Gm-Message-State: AOAM532i+rXZYtEVBMnBRzEpSuLIQ6rWr2pqav3jdxJsucMw4zqQ2S82 ID1Xxxv6kIzEOYNLe9jkrmA= X-Received: by 2002:a17:902:ecd0:: with SMTP id a16mr9965255plh.64.1643405167909; Fri, 28 Jan 2022 13:26:07 -0800 (PST) Received: from [10.1.1.24] (222-155-5-102-adsl.sparkbb.co.nz. [222.155.5.102]) by smtp.gmail.com with ESMTPSA id u18sm10656761pfk.14.2022.01.28.13.26.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Jan 2022 13:26:07 -0800 (PST) Subject: Re: [PATCH] m68k: mm: Remove check for VM_IO to fix deferred I/O To: Geert Uytterhoeven , linux-m68k@lists.linux-m68k.org References: <20220128173006.1713210-1-geert@linux-m68k.org> Cc: Andrew Morton , linux-mm@kvack.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, Finn Thain From: Michael Schmitz Message-ID: Date: Sat, 29 Jan 2022 10:26:01 +1300 User-Agent: Mozilla/5.0 (X11; Linux ppc; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: <20220128173006.1713210-1-geert@linux-m68k.org> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Geert, for hwregs_present(), the exception fixup will handle any access error (through send_fault_sig()), so this should continue to work. Why the special handling of VM_IO pages? Maybe hp300 had marked all IO register pages VM_IO to distinguish IO faults from VM faults... The only other area I can imagine this might have an impact is the Mac's pseudo-DMA - FInn might want to give this some testing. Cheers, Michael Am 29.01.2022 um 06:30 schrieb Geert Uytterhoeven: > When an application accesses a mapped frame buffer backed by deferred > I/O, it receives a segmentation fault. Fix this by removing the check > for VM_IO in do_page_fault(). > > Signed-off-by: Geert Uytterhoeven > --- > This check was never present in a fault handler on any other > architecture than m68k. > Some digging revealed that it was added in v2.1.106, but I couldn't find > an email with a patch adding it. That same kernel version extended the > use of the hwreg_present() helper to HP9000/300, so the check might have > been needed there, perhaps only during development? > The Atari kernel relies heavily on hwreg_present() (both the success and > failure cases), and these still work, at least on ARAnyM. > --- > arch/m68k/mm/fault.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/arch/m68k/mm/fault.c b/arch/m68k/mm/fault.c > index 1493cf5eac1e7a39..71aa9f6315dc8028 100644 > --- a/arch/m68k/mm/fault.c > +++ b/arch/m68k/mm/fault.c > @@ -93,8 +93,6 @@ int do_page_fault(struct pt_regs *regs, unsigned long address, > vma = find_vma(mm, address); > if (!vma) > goto map_err; > - if (vma->vm_flags & VM_IO) > - goto acc_err; > if (vma->vm_start <= address) > goto good_area; > if (!(vma->vm_flags & VM_GROWSDOWN)) >