From: Yinghai Lu <yinghai@kernel.org>
To: Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>,
Andrew Morton <akpm@linux-foundation.org>,
David Miller <davem@davemloft.net>,
Be
Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
Ian Campbell <ian.campbell@citrix.com>,
Yinghai Lu <yinghai@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@elte.hu>
Subject: [PATCH 1/4] x86: do not free zero sized per cpu areas
Date: Tue, 23 Mar 2010 01:39:44 -0700 [thread overview]
Message-ID: <1269333587-1866-2-git-send-email-yinghai@kernel.org> (raw)
In-Reply-To: <1269333587-1866-1-git-send-email-yinghai@kernel.org>
From: Ian Campbell <ian.campbell@citrix.com>
This avoids an infinite loop in free_early_partial().
Add a warning to free_early_partial to catch future problems.
-v5: put back start > end back into WARN_ONCE()
-v6: use one line for if according to linus
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@elte.hu>
---
kernel/early_res.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/kernel/early_res.c b/kernel/early_res.c
index 3cb2c66..69bed5b 100644
--- a/kernel/early_res.c
+++ b/kernel/early_res.c
@@ -333,6 +333,12 @@ void __init free_early_partial(u64 start, u64 end)
struct early_res *r;
int i;
+ if (start == end)
+ return;
+
+ if (WARN_ONCE(start > end, "free_early_partial: wrong range [%#llx, %#llx]\n", start, end))
+ return;
+
try_next:
i = find_overlapped_early(start, end);
if (i >= max_early_res)
--
1.6.4.2
WARNING: multiple messages have this Message-ID (diff)
From: Yinghai Lu <yinghai@kernel.org>
To: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>,
Andrew Morton <akpm@linux-foundation.org>,
David Miller <davem@davemloft.net>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
Ian Campbell <ian.campbell@citrix.com>,
Yinghai Lu <yinghai@kernel.org>,
Peter Zijlstra <peterz@infradead.org>
Subject: [PATCH 1/4] x86: do not free zero sized per cpu areas
Date: Tue, 23 Mar 2010 01:39:44 -0700 [thread overview]
Message-ID: <1269333587-1866-2-git-send-email-yinghai@kernel.org> (raw)
Message-ID: <20100323083944.2S5gOgW9I0IgwtFWkifDpY0XMuTWdxJ7M5cuvSxkmNQ@z> (raw)
In-Reply-To: <1269333587-1866-1-git-send-email-yinghai@kernel.org>
From: Ian Campbell <ian.campbell@citrix.com>
This avoids an infinite loop in free_early_partial().
Add a warning to free_early_partial to catch future problems.
-v5: put back start > end back into WARN_ONCE()
-v6: use one line for if according to linus
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@elte.hu>
---
kernel/early_res.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/kernel/early_res.c b/kernel/early_res.c
index 3cb2c66..69bed5b 100644
--- a/kernel/early_res.c
+++ b/kernel/early_res.c
@@ -333,6 +333,12 @@ void __init free_early_partial(u64 start, u64 end)
struct early_res *r;
int i;
+ if (start == end)
+ return;
+
+ if (WARN_ONCE(start > end, "free_early_partial: wrong range [%#llx, %#llx]\n", start, end))
+ return;
+
try_next:
i = find_overlapped_early(start, end);
if (i >= max_early_res)
--
1.6.4.2
next prev parent reply other threads:[~2010-03-23 8:56 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-23 8:39 [PATCH 00/04] use lmb with x86 Yinghai Lu
2010-03-23 8:39 ` Yinghai Lu
2010-03-23 8:39 ` Yinghai Lu [this message]
2010-03-23 8:39 ` [PATCH 1/4] x86: do not free zero sized per cpu areas Yinghai Lu
2010-03-23 8:39 ` [PATCH 2/4] x86: add find_e820_area_node Yinghai Lu
2010-03-23 8:39 ` Yinghai Lu
2010-03-23 8:39 ` [PATCH 3/4] x86: add sanitize_e820_map Yinghai Lu
2010-03-23 8:39 ` Yinghai Lu
2010-03-23 8:39 ` [RFC PATCH -v2 4/4] x86: use lmb to replace early_res Yinghai Lu
2010-03-23 8:39 ` Yinghai Lu
2010-03-23 9:14 ` Ingo Molnar
2010-03-23 10:36 ` [RFC PATCH -v3 1/2] lmb: seperate region array from lmb_region struct Yinghai Lu
2010-03-23 10:36 ` Yinghai Lu
2010-03-23 10:42 ` Ingo Molnar
2010-03-23 13:18 ` Paul Mundt
2010-03-23 13:18 ` Paul Mundt
2010-03-23 17:17 ` Yinghai Lu
2010-03-23 18:13 ` Paul Mundt
2010-03-23 18:13 ` Paul Mundt
2010-03-24 4:45 ` Benjamin Herrenschmidt
2010-03-24 5:36 ` [RFC PATCH v4 " Yinghai Lu
2010-03-24 5:37 ` [RFC PATCH -v4 2/2] x86: use lmb to replace early_res Yinghai Lu
2010-03-24 5:46 ` [RFC PATCH -v3 1/2] lmb: seperate region array from lmb_region struct Yinghai Lu
2010-03-24 7:41 ` Benjamin Herrenschmidt
2010-03-23 15:07 ` Thomas Gleixner
2010-03-23 17:38 ` Yinghai Lu
2010-03-23 18:08 ` Ingo Molnar
2010-03-23 10:37 ` [RFC PATCH -v3 2/2] x86: use lmb to replace early_res Yinghai Lu
2010-03-23 10:37 ` Yinghai Lu
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=1269333587-1866-2-git-send-email-yinghai@kernel.org \
--to=yinghai@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=hpa@zytor.com \
--cc=ian.campbell@citrix.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox