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-3.1-testing] linux/x86: fix initial GDT setup

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.1-testing] linux/x86: fix initial GDT setup
From: "Xen patchbot-3.1-testing" <patchbot-3.1-testing@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 10 Dec 2007 03:10:55 -0800
Delivery-date: Mon, 10 Dec 2007 05:30:41 -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 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

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