public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Yinghai Lu <yinghai@kernel.org>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>,
	Matthew Wilcox <matthew@wil.cx>,
	linux-pci@vger.kernel.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/3] x86/pci: fix -1 calling to e820_all_mapped with mmconfig
Date: Sat, 18 Apr 2009 11:17:20 +0200	[thread overview]
Message-ID: <20090418091720.GO7678@elte.hu> (raw)
In-Reply-To: <49E992C2.4010707@kernel.org>


* Yinghai Lu <yinghai@kernel.org> wrote:

> e820_all_mapped need end is (addr + size) instead of (addr + size - 1)
> 
> [Impact: fix -1 offset calling]
> 
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
> 
> ---
>  arch/x86/pci/mmconfig-shared.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> 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;

good catch. Probably also needed for -stable.

Acked-by: Ingo Molnar <mingo@elte.hu>

	Ingo

  parent reply	other threads:[~2009-04-18  9:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-18  8:43 [PATCH 1/3] x86/pci: fix -1 calling to e820_all_mapped with mmconfig Yinghai Lu
2009-04-18  8:44 ` [PATCH 2/3] pci: don't assume pref memio are 64bit -v2 Yinghai Lu
2009-04-18  9:15   ` Ingo Molnar
2009-04-18 17:01     ` Yinghai Lu
2009-04-18 20:09   ` Ivan Kokshaysky
2009-04-18 20:25     ` Ingo Molnar
2009-04-18  8:46 ` [PATCH 3/3] pci: don't printout if the bus res size is 0 Yinghai Lu
2009-04-18  9:16   ` Ingo Molnar
2009-04-18  9:17 ` Ingo Molnar [this message]
2009-04-22 22:04 ` [PATCH 1/3] x86/pci: fix -1 calling to e820_all_mapped with mmconfig Jesse Barnes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090418091720.GO7678@elte.hu \
    --to=mingo@elte.hu \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=yinghai@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox