From patchwork Wed Apr 15 00:42:45 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinghai Lu X-Patchwork-Id: 18257 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n3F0i9HM022609 for ; Wed, 15 Apr 2009 00:44:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752898AbZDOAno (ORCPT ); Tue, 14 Apr 2009 20:43:44 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754221AbZDOAno (ORCPT ); Tue, 14 Apr 2009 20:43:44 -0400 Received: from hera.kernel.org ([140.211.167.34]:34839 "EHLO hera.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752288AbZDOAnn (ORCPT ); Tue, 14 Apr 2009 20:43:43 -0400 Received: from [10.6.76.26] (sca-ea-fw-1.Sun.COM [192.18.43.225]) (authenticated bits=0) by hera.kernel.org (8.14.2/8.13.8) with ESMTP id n3F0gmlP024962 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 15 Apr 2009 00:42:48 GMT Message-ID: <49E52D85.2080808@kernel.org> Date: Tue, 14 Apr 2009 17:42:45 -0700 From: Yinghai Lu User-Agent: Thunderbird 2.0.0.19 (X11/20081227) MIME-Version: 1.0 To: Jesse Barnes , Ingo Molnar , Andrew Morton , Thomas Gleixner , "H. Peter Anvin" CC: "linux-kernel@vger.kernel.org" , linux-pci@vger.kernel.org Subject: [PATCH] x86/pci: fix -1 calling to e820_all_mapped with mmconfig References: <200904101913.n3AJDhMm018684@demeter.kernel.org> <49DFABCC.3070001@kernel.org> <49E00E9F.8030605@kernel.org> <49E4F6D6.6030709@kernel.org> <49E4F71F.10107@kernel.org> <49E52A7A.4070607@kernel.org> <49E52D3F.1090206@kernel.org> In-Reply-To: <49E52D3F.1090206@kernel.org> X-Virus-Scanned: ClamAV 0.93.3/9236/Tue Apr 14 18:51:03 2009 on hera.kernel.org X-Virus-Status: Clean Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Impact: fix calling e820_all_mapped need end is (addr + size) instead of (addr + size - 1) Signed-off-by: Yinghai Lu --- arch/x86/pci/mmconfig-shared.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux-2.6/arch/x86/pci/mmconfig-shared.c =================================================================== --- linux-2.6.orig/arch/x86/pci/mmconfig-shared.c +++ linux-2.6/arch/x86/pci/mmconfig-shared.c @@ -375,7 +375,7 @@ static acpi_status __init check_mcfg_res if (!fixmem32) return AE_OK; if ((mcfg_res->start >= fixmem32->address) && - (mcfg_res->end < (fixmem32->address + + (mcfg_res->end <= (fixmem32->address + fixmem32->address_length))) { mcfg_res->flags = 1; return AE_CTRL_TERMINATE; @@ -392,7 +392,7 @@ static acpi_status __init check_mcfg_res return AE_OK; if ((mcfg_res->start >= address.minimum) && - (mcfg_res->end < (address.minimum + address.address_length))) { + (mcfg_res->end <= (address.minimum + address.address_length))) { mcfg_res->flags = 1; return AE_CTRL_TERMINATE; } @@ -439,7 +439,7 @@ static int __init is_mmconf_reserved(che u64 old_size = size; int valid = 0; - while (!is_reserved(addr, addr + size - 1, E820_RESERVED)) { + while (!is_reserved(addr, addr + size, E820_RESERVED)) { size >>= 1; if (size < (16UL<<20)) break;