# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1196963141 0
# Node ID 60865716545565e719f2874260d2647757750ba6
# Parent 3abe38e37d18820227508c7c51540b615a9df912
linux/x86: fix initial GDT setup
cpu_gdt_init() can be static, can have its argument point to const,
and the number of descriptors should be calculated from one more than
the table's limit.
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
linux-2.6.18-xen changeset: 349:d43906ea0e9c136e9ec28df30f94c225536d588c
linux-2.6.18-xen date: Thu Dec 06 15:59:52 2007 +0000
---
linux-2.6-xen-sparse/arch/i386/kernel/cpu/common-xen.c | 4 ++--
linux-2.6-xen-sparse/arch/x86_64/kernel/setup64-xen.c | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff -r 3abe38e37d18 -r 608657165455
linux-2.6-xen-sparse/arch/i386/kernel/cpu/common-xen.c
--- a/linux-2.6-xen-sparse/arch/i386/kernel/cpu/common-xen.c Thu Dec 06
17:45:05 2007 +0000
+++ b/linux-2.6-xen-sparse/arch/i386/kernel/cpu/common-xen.c Thu Dec 06
17:45:41 2007 +0000
@@ -590,7 +590,7 @@ void __init early_cpu_init(void)
#endif
}
-void __cpuinit cpu_gdt_init(struct Xgt_desc_struct *gdt_descr)
+static void __cpuinit cpu_gdt_init(const struct Xgt_desc_struct *gdt_descr)
{
unsigned long frames[16];
unsigned long va;
@@ -603,7 +603,7 @@ void __cpuinit cpu_gdt_init(struct Xgt_d
make_lowmem_page_readonly(
(void *)va, XENFEAT_writable_descriptor_tables);
}
- if (HYPERVISOR_set_gdt(frames, gdt_descr->size / 8))
+ if (HYPERVISOR_set_gdt(frames, (gdt_descr->size + 1) / 8))
BUG();
}
diff -r 3abe38e37d18 -r 608657165455
linux-2.6-xen-sparse/arch/x86_64/kernel/setup64-xen.c
--- a/linux-2.6-xen-sparse/arch/x86_64/kernel/setup64-xen.c Thu Dec 06
17:45:05 2007 +0000
+++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/setup64-xen.c Thu Dec 06
17:45:41 2007 +0000
@@ -132,7 +132,7 @@ static void switch_pt(void)
xen_new_user_pt(__pa(init_level4_user_pgt));
}
-void __cpuinit cpu_gdt_init(struct desc_ptr *gdt_descr)
+static void __cpuinit cpu_gdt_init(const struct desc_ptr *gdt_descr)
{
unsigned long frames[16];
unsigned long va;
@@ -145,7 +145,7 @@ void __cpuinit cpu_gdt_init(struct desc_
make_page_readonly(
(void *)va, XENFEAT_writable_descriptor_tables);
}
- if (HYPERVISOR_set_gdt(frames, gdt_descr->size /
+ if (HYPERVISOR_set_gdt(frames, (gdt_descr->size + 1) /
sizeof (struct desc_struct)))
BUG();
}
@@ -155,7 +155,7 @@ static void switch_pt(void)
asm volatile("movq %0,%%cr3" :: "r" (__pa_symbol(&init_level4_pgt)));
}
-void __init cpu_gdt_init(struct desc_ptr *gdt_descr)
+static void __cpuinit cpu_gdt_init(const struct desc_ptr *gdt_descr)
{
asm volatile("lgdt %0" :: "m" (*gdt_descr));
asm volatile("lidt %0" :: "m" (idt_descr));
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|