All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yinghai Lu <yinghai@kernel.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: Jan Beulich <jbeulich@novell.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86: fix e820_update_range()
Date: Fri, 13 Mar 2009 11:22:12 -0700	[thread overview]
Message-ID: <49BAA454.3050100@kernel.org> (raw)
In-Reply-To: <20090313111321.GA19523@elte.hu>

Ingo Molnar wrote:
> * Jan Beulich <jbeulich@novell.com> wrote:
> 
>>>>> Yinghai Lu <yinghai@kernel.org> 13.03.09 05:35 >>>
>>> Impact: fix left range size on head.
>>>
>>> | commit 5c0e6f035df983210e4d22213aed624ced502d3d
>>> |    x86: fix code paths used by update_mptable
>>> |    Impact: fix crashes under Xen due to unrobust e820 code
>>> fix one bug about e820 referring, but introduce other bug
>>>
>>> need update size for left range at first in case it is header.
>>>
>>> also add __e820_add_region take more parameter.
>>>
>>> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
>>> ...
>>> +		/*
>>> +		 * left range could be head or tail, so need to update
>>> +		 * size at first.
>>> +		 */
>>> +		ei->size -= final_end - final_start;
>>> 		if (ei->addr < final_start)
>>> 			continue;
>>> 		ei->addr = final_end;
>>> -		ei->size -= final_end - final_start;
>> The change of mine here was done on purpose, since I had 
>> observed that in this particular case (when the changed region 
>> starts later and ends earlier than the original region) 
>> e820_add_region() would in any case create an overlapping 
>> entry (which later gets cleaned up by sanitize_e820_map()). 
>> That cleanup in sanitize_e820_map(), however, already implies 
>> reducing the size of the enclosing region, and hence the 
>> original code (and the code you try to restore now) 
>> effectively shrinks the original region twice.
>>
>> Consequently, the only alternative to the code as resulting 
>> from my patch appears to be to avoid the generation of 
>> overlapping entries in the first place, but that would clearly 
>> make e820_update_range_map() more complex.
> 
> Still that looks like the best course of action - the core e820 
> primitives should always produce a sane map.
> 
yesterday i sent out
[PATCH] x86: make e820_update_range to handle small range update

YH

      reply	other threads:[~2009-03-13 18:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-12 12:57 [PATCH] x86: clean up output resulting from update_mptable option Jan Beulich
2009-03-13  2:34 ` [tip:x86/mm] " Jan Beulich
2009-03-13  4:35   ` [PATCH] x86: fix e820_update_range() Yinghai Lu
2009-03-13  4:39     ` [tip:x86/mm] " Yinghai Lu
2009-03-13  5:36       ` [PATCH] x86: make e820_update_range to handle small range update Yinghai Lu
2009-03-14 11:39         ` [tip:x86/mm] x86: make e820_update_range() " Yinghai Lu
2009-03-14 12:17           ` Ingo Molnar
2009-03-14 18:21             ` Yinghai Lu
2009-03-14 18:40               ` Ingo Molnar
2009-03-14 21:32                 ` Yinghai Lu
2009-03-15  6:04                   ` Ingo Molnar
2009-03-15  6:20                     ` Yinghai Lu
2009-03-15  6:25                       ` Ingo Molnar
2009-03-15  6:12                   ` [tip:x86/mm] x86: fix 64k corruption-check Yinghai Lu
2009-03-13  7:57     ` [PATCH] x86: fix e820_update_range() Jan Beulich
2009-03-13 11:13       ` Ingo Molnar
2009-03-13 18:22         ` Yinghai Lu [this message]

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=49BAA454.3050100@kernel.org \
    --to=yinghai@kernel.org \
    --cc=hpa@zytor.com \
    --cc=jbeulich@novell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.