From: "Jan Beulich" Subject: [PATCH] linux/x86: make set_ldt() more consistent with native Date: Mon, 21 Jan 2008 15:24:30 +0000 Message-ID: <4794C73E.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org As usual, written and tested on 2.6.24-rc8 and made apply to the 2.6.18 tree without further testing. Signed-off-by: Jan Beulich Index: head-2008-01-21/arch/i386/mm/hypervisor.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- head-2008-01-21.orig/arch/i386/mm/hypervisor.c 2008-01-21 = 13:30:08.000000000 +0100 +++ head-2008-01-21/arch/i386/mm/hypervisor.c 2008-01-21 13:31:56.0000000= 00 +0100 @@ -182,12 +182,12 @@ void xen_pgd_unpin(unsigned long ptr) BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0); } =20 -void xen_set_ldt(unsigned long ptr, unsigned long len) +void xen_set_ldt(const void *ptr, unsigned int ents) { struct mmuext_op op; op.cmd =3D MMUEXT_SET_LDT; - op.arg1.linear_addr =3D ptr; - op.arg2.nr_ents =3D len; + op.arg1.linear_addr =3D (unsigned long)ptr; + op.arg2.nr_ents =3D ents; BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0); } =20 Index: head-2008-01-21/include/asm-i386/mach-xen/asm/desc.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- head-2008-01-21.orig/include/asm-i386/mach-xen/asm/desc.h 2008-01-21 = 13:31:43.000000000 +0100 +++ head-2008-01-21/include/asm-i386/mach-xen/asm/desc.h 2008-01-21 = 13:31:56.000000000 +0100 @@ -140,7 +140,7 @@ static inline void clear_LDT(void) * it slows down context switching. Noone uses it anyway. */ cpu =3D cpu; /* XXX avoid compiler warning */ - xen_set_ldt(0UL, 0); + xen_set_ldt(NULL, 0); put_cpu(); } =20 @@ -160,7 +160,7 @@ static inline void load_LDT_nolock (mm_c if (likely(!count)) segments =3D NULL; =20 - xen_set_ldt((unsigned long)segments, count); + xen_set_ldt(segments, count); } =20 static inline void load_LDT(mm_context_t *pc) Index: head-2008-01-21/include/asm-x86_64/mach-xen/asm/desc.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- head-2008-01-21.orig/include/asm-x86_64/mach-xen/asm/desc.h 2008-01-21 = 13:31:43.000000000 +0100 +++ head-2008-01-21/include/asm-x86_64/mach-xen/asm/desc.h 2008-01-21 = 13:31:56.000000000 +0100 @@ -30,7 +30,7 @@ static inline void clear_LDT(void) * it slows down context switching. Noone uses it anyway. */ cpu =3D cpu; /* XXX avoid compiler warning */ - xen_set_ldt(0UL, 0); + xen_set_ldt(NULL, 0); put_cpu(); } =20 @@ -211,7 +211,7 @@ static inline void load_LDT_nolock (mm_c if (likely(!count)) segments =3D NULL; =20 - xen_set_ldt((unsigned long)segments, count); + xen_set_ldt(segments, count); } =20 static inline void load_LDT(mm_context_t *pc) Index: head-2008-01-21/include/asm-i386/mach-xen/asm/hypervisor.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- head-2008-01-21.orig/include/asm-i386/mach-xen/asm/hypervisor.h = 2008-01-21 13:31:43.000000000 +0100 +++ head-2008-01-21/include/asm-i386/mach-xen/asm/hypervisor.h 2008-01-21 = 13:31:56.000000000 +0100 @@ -96,7 +96,7 @@ void xen_l4_entry_update(pgd_t *ptr, pgd void xen_pgd_pin(unsigned long ptr); void xen_pgd_unpin(unsigned long ptr); =20 -void xen_set_ldt(unsigned long ptr, unsigned long bytes); +void xen_set_ldt(const void *ptr, unsigned int ents); =20 #ifdef CONFIG_SMP #include