WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] x86: MTRR cleanup

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86: MTRR cleanup
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Thu, 10 Mar 2011 22:20:23 +0000
Delivery-date: Thu, 10 Mar 2011 14:30:14 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxxxx>
# Date 1299688219 0
# Node ID 596ee91b38cec9f0338801e8dfda919836502f58
# Parent  71dae1b6417b18616598e72f23a8ed9e22e517c5
x86: MTRR cleanup

Remove unused and pointless bits from MTRR handling code. Move some
data items into .data.read_mostly. Adjust some types.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---


diff -r 71dae1b6417b -r 596ee91b38ce xen/arch/x86/cpu/mtrr/Makefile
--- a/xen/arch/x86/cpu/mtrr/Makefile    Wed Mar 09 16:29:52 2011 +0000
+++ b/xen/arch/x86/cpu/mtrr/Makefile    Wed Mar 09 16:30:19 2011 +0000
@@ -2,4 +2,4 @@
 obj-$(x86_32) += cyrix.o
 obj-y += generic.o
 obj-y += main.o
-obj-y += state.o
+obj-$(x86_32) += state.o
diff -r 71dae1b6417b -r 596ee91b38ce xen/arch/x86/cpu/mtrr/amd.c
--- a/xen/arch/x86/cpu/mtrr/amd.c       Wed Mar 09 16:29:52 2011 +0000
+++ b/xen/arch/x86/cpu/mtrr/amd.c       Wed Mar 09 16:30:19 2011 +0000
@@ -103,7 +103,7 @@
        return 0;
 }
 
-static struct mtrr_ops amd_mtrr_ops = {
+static const struct mtrr_ops amd_mtrr_ops = {
        .vendor            = X86_VENDOR_AMD,
        .set               = amd_set_mtrr,
        .get               = amd_get_mtrr,
diff -r 71dae1b6417b -r 596ee91b38ce xen/arch/x86/cpu/mtrr/cyrix.c
--- a/xen/arch/x86/cpu/mtrr/cyrix.c     Wed Mar 09 16:29:52 2011 +0000
+++ b/xen/arch/x86/cpu/mtrr/cyrix.c     Wed Mar 09 16:30:19 2011 +0000
@@ -359,7 +359,7 @@
 }
 #endif
 
-static struct mtrr_ops cyrix_mtrr_ops = {
+static const struct mtrr_ops cyrix_mtrr_ops = {
        .vendor            = X86_VENDOR_CYRIX,
 //     .init              = cyrix_arr_init,
        .set_all           = cyrix_set_all,
diff -r 71dae1b6417b -r 596ee91b38ce xen/arch/x86/cpu/mtrr/generic.c
--- a/xen/arch/x86/cpu/mtrr/generic.c   Wed Mar 09 16:29:52 2011 +0000
+++ b/xen/arch/x86/cpu/mtrr/generic.c   Wed Mar 09 16:30:19 2011 +0000
@@ -467,7 +467,7 @@
 
 /* generic structure...
  */
-struct mtrr_ops generic_mtrr_ops = {
+const struct mtrr_ops generic_mtrr_ops = {
        .use_intel_if      = 1,
        .set_all           = generic_set_all,
        .get               = generic_get_mtrr,
diff -r 71dae1b6417b -r 596ee91b38ce xen/arch/x86/cpu/mtrr/main.c
--- a/xen/arch/x86/cpu/mtrr/main.c      Wed Mar 09 16:29:52 2011 +0000
+++ b/xen/arch/x86/cpu/mtrr/main.c      Wed Mar 09 16:30:19 2011 +0000
@@ -50,16 +50,15 @@
 #define        get_cpu()       smp_processor_id()
 #define put_cpu()      do {} while(0)
 
-u32 num_var_ranges = 0;
+u32 __read_mostly num_var_ranges = 0;
 
-unsigned int *usage_table;
+unsigned int *__read_mostly usage_table;
 static DEFINE_MUTEX(mtrr_mutex);
 
-u64 size_or_mask, size_and_mask;
+u64 __read_mostly size_or_mask;
+u64 __read_mostly size_and_mask;
 
-static struct mtrr_ops * mtrr_ops[X86_VENDOR_NUM] = {};
-
-struct mtrr_ops * mtrr_if = NULL;
+const struct mtrr_ops *__read_mostly mtrr_if = NULL;
 
 static void set_mtrr(unsigned int reg, unsigned long base,
                     unsigned long size, mtrr_type type);
@@ -70,7 +69,7 @@
 #define arr3_protected 0
 #endif
 
-static const char *mtrr_strings[MTRR_NUM_TYPES] =
+static const char *const mtrr_strings[MTRR_NUM_TYPES] =
 {
     "uncachable",               /* 0 */
     "write-combining",          /* 1 */
@@ -81,16 +80,20 @@
     "write-back",               /* 6 */
 };
 
-const char *mtrr_attrib_to_str(int x)
+static const char *mtrr_attrib_to_str(int x)
 {
        return (x <= 6) ? mtrr_strings[x] : "?";
 }
 
-void set_mtrr_ops(struct mtrr_ops * ops)
+#ifndef CONFIG_X86_64
+static const struct mtrr_ops *mtrr_ops[X86_VENDOR_NUM];
+
+void set_mtrr_ops(const struct mtrr_ops * ops)
 {
        if (ops->vendor && ops->vendor < X86_VENDOR_NUM)
                mtrr_ops[ops->vendor] = ops;
 }
+#endif
 
 /*  Returns non-zero if we have the write-combining memory type  */
 static int have_wrcomb(void)
@@ -472,7 +475,7 @@
  *     failures and do not wish system log messages to be sent.
  */
 
-int
+int __init
 mtrr_add(unsigned long base, unsigned long size, unsigned int type,
         char increment)
 {
@@ -565,7 +568,7 @@
  *     code.
  */
 
-int
+int __init
 mtrr_del(int reg, unsigned long base, unsigned long size)
 {
        if (mtrr_check(base, size))
@@ -573,9 +576,6 @@
        return mtrr_del_page(reg, base >> PAGE_SHIFT, size >> PAGE_SHIFT);
 }
 
-EXPORT_SYMBOL(mtrr_add);
-EXPORT_SYMBOL(mtrr_del);
-
 /* HACK ALERT!
  * These should be called implicitly, but we can't yet until all the initcall
  * stuff is done...
diff -r 71dae1b6417b -r 596ee91b38ce xen/arch/x86/cpu/mtrr/mtrr.h
--- a/xen/arch/x86/cpu/mtrr/mtrr.h      Wed Mar 09 16:29:52 2011 +0000
+++ b/xen/arch/x86/cpu/mtrr/mtrr.h      Wed Mar 09 16:30:19 2011 +0000
@@ -52,7 +52,7 @@
 extern int generic_validate_add_page(unsigned long base, unsigned long size,
                                     unsigned int type);
 
-extern struct mtrr_ops generic_mtrr_ops;
+extern const struct mtrr_ops generic_mtrr_ops;
 
 extern int positive_have_wrcomb(void);
 
@@ -70,10 +70,10 @@
 
 void get_mtrr_state(void);
 
-extern void set_mtrr_ops(struct mtrr_ops * ops);
+extern void set_mtrr_ops(const struct mtrr_ops *);
 
 extern u64 size_or_mask, size_and_mask;
-extern struct mtrr_ops * mtrr_if;
+extern const struct mtrr_ops *mtrr_if;
 
 #define is_cpu(vnd)    (mtrr_if && mtrr_if->vendor == X86_VENDOR_##vnd)
 #define use_intel()    (mtrr_if && mtrr_if->use_intel_if == 1)
@@ -81,6 +81,5 @@
 extern unsigned int num_var_ranges;
 
 void mtrr_state_warn(void);
-const char *mtrr_attrib_to_str(int x);
 void mtrr_wrmsr(unsigned int msr, uint64_t msr_content);
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] x86: MTRR cleanup, Xen patchbot-unstable <=