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] [linux-2.6.18-xen] linux/x86: fix initial GDT setup

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] linux/x86: fix initial GDT setup
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 07 Dec 2007 08:20:29 -0800
Delivery-date: Fri, 07 Dec 2007 08:22:20 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/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 Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1196956792 0
# Node ID d43906ea0e9c136e9ec28df30f94c225536d588c
# Parent  a235a50c9f1e0f67a96c8cb9e3351ad897623ca3
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>
---
 arch/i386/kernel/cpu/common-xen.c |    4 ++--
 arch/x86_64/kernel/setup64-xen.c  |    6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff -r a235a50c9f1e -r d43906ea0e9c arch/i386/kernel/cpu/common-xen.c
--- a/arch/i386/kernel/cpu/common-xen.c Thu Dec 06 15:51:11 2007 +0000
+++ b/arch/i386/kernel/cpu/common-xen.c Thu Dec 06 15:59:52 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 a235a50c9f1e -r d43906ea0e9c arch/x86_64/kernel/setup64-xen.c
--- a/arch/x86_64/kernel/setup64-xen.c  Thu Dec 06 15:51:11 2007 +0000
+++ b/arch/x86_64/kernel/setup64-xen.c  Thu Dec 06 15:59:52 2007 +0000
@@ -132,7 +132,7 @@ static void switch_pt(void)
        xen_new_user_pt(__pa_symbol(__user_pgd(init_level4_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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] linux/x86: fix initial GDT setup, Xen patchbot-linux-2.6.18-xen <=