From patchwork Fri Jan 28 17:30:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 12728903 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03995C433EF for ; Fri, 28 Jan 2022 17:30:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 89E9D6B0110; Fri, 28 Jan 2022 12:30:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 84FBA6B0112; Fri, 28 Jan 2022 12:30:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 73CD76B0113; Fri, 28 Jan 2022 12:30:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0134.hostedemail.com [216.40.44.134]) by kanga.kvack.org (Postfix) with ESMTP id 647CC6B0110 for ; Fri, 28 Jan 2022 12:30:12 -0500 (EST) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 250DD1815B7E4 for ; Fri, 28 Jan 2022 17:30:12 +0000 (UTC) X-FDA: 79080384264.30.424CC8B Received: from xavier.telenet-ops.be (xavier.telenet-ops.be [195.130.132.52]) by imf08.hostedemail.com (Postfix) with ESMTP id 5DD5616000F for ; Fri, 28 Jan 2022 17:30:11 +0000 (UTC) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed40:3999:e79d:cb59:f2ec]) by xavier.telenet-ops.be with bizsmtp id oHW92600704fKGS01HW9pQ; Fri, 28 Jan 2022 18:30:09 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1nDV4a-00C0CU-Vh; Fri, 28 Jan 2022 18:30:08 +0100 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1nDV4a-007BhB-EK; Fri, 28 Jan 2022 18:30:08 +0100 From: Geert Uytterhoeven To: linux-m68k@lists.linux-m68k.org Cc: Andrew Morton , linux-mm@kvack.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] m68k: mm: Remove check for VM_IO to fix deferred I/O Date: Fri, 28 Jan 2022 18:30:06 +0100 Message-Id: <20220128173006.1713210-1-geert@linux-m68k.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 5DD5616000F X-Stat-Signature: ykig1q85amo43fgskhykpfumyyar9nnn X-Rspam-User: nil Authentication-Results: imf08.hostedemail.com; dkim=none; dmarc=none; spf=none (imf08.hostedemail.com: domain of geert@linux-m68k.org has no SPF policy when checking 195.130.132.52) smtp.mailfrom=geert@linux-m68k.org X-HE-Tag: 1643391011-108870 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 Tested-by: Michael Schmitz --- 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))