linux-mips
[Top] [All Lists]

[PATCH RFC 2/5] extable: Skip sorting if sorted at build time.

To: linux-mips@linux-mips.org, ralf@linux-mips.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-embedded@vger.kernel.org, x86@kernel.org
Subject: [PATCH RFC 2/5] extable: Skip sorting if sorted at build time.
From: David Daney <ddaney.cavm@gmail.com>
Date: Fri, 18 Nov 2011 11:37:45 -0800
Cc: David Daney <david.daney@cavium.com>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=JAZFN0rrR5RwoS38mMQQ6FuAa7XM8IRQfDR5QS02QSQ=; b=iYUpo6+72huDT5qtAwpzEjy6py0yce4ARKIV5qiSGt10jFuAjvTXtspt0CRn+QxphX UBSyHO7vqBpU8+8MRJ+ZbybwGtbmJM27YxEV0BF5zMMVnKGgaWH7MkPQclSMCbF+FkxI OHGIt5RStDWF/UHWv1QMMVvsUqN4wt6uAqRXQ=
In-reply-to: <1321645068-20475-1-git-send-email-ddaney.cavm@gmail.com>
References: <1321645068-20475-1-git-send-email-ddaney.cavm@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
From: David Daney <david.daney@cavium.com>

If the build program sortextable has already sorted the exception
table, don't sort it again.

Signed-off-by: David Daney <david.daney@cavium.com>
---
 kernel/extable.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/kernel/extable.c b/kernel/extable.c
index 5339705..fe35a63 100644
--- a/kernel/extable.c
+++ b/kernel/extable.c
@@ -35,10 +35,16 @@ DEFINE_MUTEX(text_mutex);
 extern struct exception_table_entry __start___ex_table[];
 extern struct exception_table_entry __stop___ex_table[];
 
+/* Cleared by build time tools if the table is already sorted. */
+u32 __initdata main_extable_sort_needed = 1;
+
 /* Sort the kernel's built-in exception table */
 void __init sort_main_extable(void)
 {
-       sort_extable(__start___ex_table, __stop___ex_table);
+       if (main_extable_sort_needed)
+               sort_extable(__start___ex_table, __stop___ex_table);
+       else
+               pr_notice("__ex_table already sorted, skipping sort\n");
 }
 
 /* Given an address, look for it in the exception tables. */
-- 
1.7.2.3


<Prev in Thread] Current Thread [Next in Thread>