[{"id":3676677,"web_url":"http://patchwork.ozlabs.org/comment/3676677/","msgid":"<683c3e65-4589-b3a1-ac51-6d7e2b679944@linux.intel.com>","list_archive_url":null,"date":"2026-04-13T11:45:32","subject":"Re: [PATCH v4 16/24] alpha/PCI: Remove WARN from __pci_mmap_fits()","submitter":{"id":83553,"url":"http://patchwork.ozlabs.org/api/people/83553/","name":"Ilpo Järvinen","email":"ilpo.jarvinen@linux.intel.com"},"content":"On Sat, 11 Apr 2026, Krzysztof Wilczyński wrote:\n\n> Remove the WARN() that fires when userspace attempts to mmap beyond\n> the BAR bounds.  The check still returns 0 to reject the mapping,\n> but the warning is excessive for normal operation.\n> \n> A similar warning was removed from the PCI core in the commit\n> 3b519e4ea618 (\"PCI: fix size checks for mmap() on /proc/bus/pci files\").\n> \n> Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>\n> ---\n>  arch/alpha/kernel/pci-sysfs.c | 8 +-------\n>  1 file changed, 1 insertion(+), 7 deletions(-)\n> \n> diff --git a/arch/alpha/kernel/pci-sysfs.c b/arch/alpha/kernel/pci-sysfs.c\n> index 2748000a7486..c136603ddf2c 100644\n> --- a/arch/alpha/kernel/pci-sysfs.c\n> +++ b/arch/alpha/kernel/pci-sysfs.c\n> @@ -48,13 +48,7 @@ static int __pci_mmap_fits(struct pci_dev *pdev, int num,\n>  \tstart = vma->vm_pgoff;\n>  \tsize = ((len - 1) >> (PAGE_SHIFT - shift)) + 1;\n>  \n> -\tif (start < size && size - start >= nr)\n> -\t\treturn 1;\n> -\tWARN(1, \"process \\\"%s\\\" tried to map%s 0x%08lx-0x%08lx on %s BAR %d \"\n> -\t\t\"(size 0x%08lx)\\n\",\n> -\t\tcurrent->comm, sparse ? \" sparse\" : \"\", start, start + nr,\n> -\t\tpci_name(pdev), num, size);\n> -\treturn 0;\n> +\treturn start < size && size - start >= nr;\n>  }\n>  \n>  /**\n> \n\nReviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>","headers":{"Return-Path":"\n <linux-pci+bounces-52427-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-pci@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256\n header.s=Intel header.b=gTwmbzLb;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.105.105.114; helo=tor.lore.kernel.org;\n envelope-from=linux-pci+bounces-52427-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com\n header.b=\"gTwmbzLb\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=192.198.163.10","smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=linux.intel.com","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=linux.intel.com"],"Received":["from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fvQcN5xXyz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 13 Apr 2026 21:47:00 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id 458B5302F6B5\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 13 Apr 2026 11:45:57 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 20D1027467F;\n\tMon, 13 Apr 2026 11:45:51 +0000 (UTC)","from mgamail.intel.com (mgamail.intel.com [192.198.163.10])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id D6A2B31A053;\n\tMon, 13 Apr 2026 11:45:49 +0000 (UTC)","from fmviesa004.fm.intel.com ([10.60.135.144])\n  by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 13 Apr 2026 04:45:49 -0700","from ijarvine-mobl1.ger.corp.intel.com (HELO localhost)\n ([10.245.245.63])\n  by fmviesa004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 13 Apr 2026 04:45:41 -0700"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776080751; cv=none;\n b=ldYTl+ktkyHVp8HND3wqMRM5hHPuguNCKJBSpYqBHVJp2ui9FTFt7Zus/LzLDB39XJ1sQ8ZF5wfAI7tB0zY9mLPwievHYYcTT4YwJI+uusaHsHSgfYZl43DGQUER5/IOTY01bg6psghkhI6/3htr6MXn/lp0w2zXt2brM+rS6Iw=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776080751; c=relaxed/simple;\n\tbh=MXb8znk6JA5uSw7e9wrvMoeQSHS1hheycQygUFtOceI=;\n\th=From:Date:To:cc:Subject:In-Reply-To:Message-ID:References:\n\t MIME-Version:Content-Type;\n b=tKnW/Rzn+zF4r9Km+889Hh2wHWjh0sJ5bp2Bn6ENvEwu1qxyne9eo3MzYFRNtoEcIPEC2CC24KD8Xlv9UBrEtjXacmxGpgLv48/r6CqKCSY8rtiWYDvfJE0dtDsvXu3w9ErxfhhhJzGPNnBFbMOYhM+LbpOYthb5JIK4Nnvm6GI=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=linux.intel.com;\n spf=pass smtp.mailfrom=linux.intel.com;\n dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com\n header.b=gTwmbzLb; arc=none smtp.client-ip=192.198.163.10","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple;\n  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n  t=1776080750; x=1807616750;\n  h=from:date:to:cc:subject:in-reply-to:message-id:\n   references:mime-version;\n  bh=MXb8znk6JA5uSw7e9wrvMoeQSHS1hheycQygUFtOceI=;\n  b=gTwmbzLbTYSaY8Def1TRQIhmlT6A8R28ladhEwK6R0r59eoCjwYB25kU\n   AimKAxBd5/wlZrQeqAScQZeuIr54CmBbS2NfXvT+Tw6tuEQ4ObqElqSBN\n   xHE6xnUOhj1Y/OHTF9pdHV8bgC0BYm2fklmlMmSkPnbbkVsw8Rzkm03R5\n   ZmF8vcT+EOGlBwjNAn0cxg1VXS0r+3F8U2QRomJhRSNSkNkIvzF6ao0EZ\n   vykng0JB2uAWPUx4WSY4Gy4EYW5JQqd1oHjwmLYZxdkwlr/Wwq3wfUjS7\n   EIxs42z+Axoh+tHpP2hR86EuM96nj0ZJEk5QaWhsX9vHra1e2uHwFkdpd\n   Q==;","X-CSE-ConnectionGUID":["NJ/AfIg/QSuB6UC08PsR/A==","RZP0kXKVTxepfqH2u5Mj1w=="],"X-CSE-MsgGUID":["ua0mpdcmQwSI3gvV7QIdNw==","hvRUpLyoSQGtB1aLUpdGmg=="],"X-IronPort-AV":["E=McAfee;i=\"6800,10657,11757\"; a=\"88396338\"","E=Sophos;i=\"6.23,177,1770624000\";\n   d=\"scan'208\";a=\"88396338\"","E=Sophos;i=\"6.23,177,1770624000\";\n   d=\"scan'208\";a=\"231496176\""],"X-ExtLoop1":"1","From":"=?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com>","Date":"Mon, 13 Apr 2026 14:45:32 +0300 (EEST)","To":"=?iso-8859-2?q?Krzysztof_Wilczy=F1ski?= <kwilczynski@kernel.org>","cc":"Bjorn Helgaas <bhelgaas@google.com>, Bjorn Helgaas <helgaas@kernel.org>,\n  Manivannan Sadhasivam <mani@kernel.org>,\n  Lorenzo Pieralisi <lpieralisi@kernel.org>,\n  Magnus Lindholm <linmag7@gmail.com>, Matt Turner <mattst88@gmail.com>,\n  Richard Henderson <richard.henderson@linaro.org>,\n  Christophe Leroy <chleroy@kernel.org>,\n  Madhavan Srinivasan <maddy@linux.ibm.com>,\n  Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>,\n  Dexuan Cui <decui@microsoft.com>,\n =?iso-8859-2?q?Krzysztof_Ha=B3asa?= <khalasa@piap.pl>,\n  Lukas Wunner <lukas@wunner.de>, Oliver O'Halloran <oohall@gmail.com>,\n  Saurabh Singh Sengar <ssengar@microsoft.com>,\n  Shuan He <heshuan@bytedance.com>,\n  Srivatsa Bhat <srivatsabhat@microsoft.com>, linux-pci@vger.kernel.org,\n  linux-alpha@vger.kernel.org, linuxppc-dev@lists.ozlabs.org","Subject":"Re: [PATCH v4 16/24] alpha/PCI: Remove WARN from __pci_mmap_fits()","In-Reply-To":"<20260411080148.471335-17-kwilczynski@kernel.org>","Message-ID":"<683c3e65-4589-b3a1-ac51-6d7e2b679944@linux.intel.com>","References":"<20260411080148.471335-1-kwilczynski@kernel.org>\n <20260411080148.471335-17-kwilczynski@kernel.org>","Precedence":"bulk","X-Mailing-List":"linux-pci@vger.kernel.org","List-Id":"<linux-pci.vger.kernel.org>","List-Subscribe":"<mailto:linux-pci+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-pci+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Type":"multipart/mixed; boundary=\"8323328-1168042318-1776080732=:962\""}}]