From patchwork Fri Jun 11 09:21:48 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kenji Kaneshige X-Patchwork-Id: 105525 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o5B9MO14004773 for ; Fri, 11 Jun 2010 09:22:24 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757858Ab0FKJWX (ORCPT ); Fri, 11 Jun 2010 05:22:23 -0400 Received: from fgwmail7.fujitsu.co.jp ([192.51.44.37]:39351 "EHLO fgwmail7.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757849Ab0FKJWW (ORCPT ); Fri, 11 Jun 2010 05:22:22 -0400 Received: from m6.gw.fujitsu.co.jp ([10.0.50.76]) by fgwmail7.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id o5B9MLg2027041 (envelope-from kaneshige.kenji@jp.fujitsu.com); Fri, 11 Jun 2010 18:22:21 +0900 Received: from smail (m6 [127.0.0.1]) by outgoing.m6.gw.fujitsu.co.jp (Postfix) with ESMTP id C670C45DE56; Fri, 11 Jun 2010 18:22:20 +0900 (JST) Received: from s6.gw.fujitsu.co.jp (s6.gw.fujitsu.co.jp [10.0.50.96]) by m6.gw.fujitsu.co.jp (Postfix) with ESMTP id 7D63845DE50; Fri, 11 Jun 2010 18:22:20 +0900 (JST) Received: from s6.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s6.gw.fujitsu.co.jp (Postfix) with ESMTP id 276961DB8019; Fri, 11 Jun 2010 18:22:20 +0900 (JST) Received: from ml14.s.css.fujitsu.com (ml14.s.css.fujitsu.com [10.249.87.104]) by s6.gw.fujitsu.co.jp (Postfix) with ESMTP id D8F141DB8013; Fri, 11 Jun 2010 18:22:19 +0900 (JST) Received: from ml14.css.fujitsu.com (ml14 [127.0.0.1]) by ml14.s.css.fujitsu.com (Postfix) with ESMTP id B75069F688C; Fri, 11 Jun 2010 18:22:19 +0900 (JST) Received: from [127.0.0.1] (unknown [10.124.100.137]) by ml14.s.css.fujitsu.com (Postfix) with ESMTP id 4B15B9F6881; Fri, 11 Jun 2010 18:22:19 +0900 (JST) X-SecurityPolicyCheck-FJ: OK by FujitsuOutboundMailChecker v1.3.1 Received: from KANE-LIFEBOOK[10.124.100.137] by KANE-LIFEBOOK (FujitsuOutboundMailChecker v1.3.1/9992[10.124.100.137]); Fri, 11 Jun 2010 18:21:57 +0900 (JST) Message-ID: <4C12002C.5030400@jp.fujitsu.com> Date: Fri, 11 Jun 2010 18:21:48 +0900 From: Kenji Kaneshige User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ja; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , linux-kernel@vger.kernel.org CC: linux-pci@vger.kernel.org, jbarnes@virtuousgeek.org Subject: [PATCH 4/4] x86: ioremap: fix normal ram range check References: <4C11FF10.4060203@jp.fujitsu.com> In-Reply-To: <4C11FF10.4060203@jp.fujitsu.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 11 Jun 2010 09:22:24 +0000 (UTC) Index: linux-2.6.34/arch/x86/mm/ioremap.c =================================================================== --- linux-2.6.34.orig/arch/x86/mm/ioremap.c 2010-06-10 07:28:33.146375380 +0900 +++ linux-2.6.34/arch/x86/mm/ioremap.c 2010-06-10 07:32:59.211196516 +0900 @@ -100,7 +100,7 @@ * Don't allow anybody to remap normal RAM that we're using.. */ last_pfn = last_addr >> PAGE_SHIFT; - for (pfn = phys_addr >> PAGE_SHIFT; pfn < last_pfn; pfn++) { + for (pfn = phys_addr >> PAGE_SHIFT; pfn <= last_pfn; pfn++) { int is_ram = page_is_ram(pfn); if (is_ram && pfn_valid(pfn) && !PageReserved(pfn_to_page(pfn)))