From: Keir Fraser Date: Tue, 22 Jan 2008 10:10:52 +0000 (+0000) Subject: xen/x86: make set_ldt() more consistent with native X-Git-Tag: xen-3.2.0~20^2 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=3758a5d0a6b9edb3523d2abe6454171bde2deee4;p=legacy%2Flinux-2.6.18-xen.git xen/x86: make set_ldt() more consistent with native Signed-off-by: Jan Beulich --- diff --git a/arch/i386/mm/hypervisor.c b/arch/i386/mm/hypervisor.c index 247c1d01..a19e1155 100644 --- a/arch/i386/mm/hypervisor.c +++ b/arch/i386/mm/hypervisor.c @@ -181,12 +181,12 @@ void xen_pgd_unpin(unsigned long ptr) BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0); } -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 = MMUEXT_SET_LDT; - op.arg1.linear_addr = ptr; - op.arg2.nr_ents = len; + op.arg1.linear_addr = (unsigned long)ptr; + op.arg2.nr_ents = ents; BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0); } diff --git a/include/asm-i386/mach-xen/asm/desc.h b/include/asm-i386/mach-xen/asm/desc.h index bc1e3766..6ad05eff 100644 --- a/include/asm-i386/mach-xen/asm/desc.h +++ b/include/asm-i386/mach-xen/asm/desc.h @@ -127,7 +127,7 @@ static inline void clear_LDT(void) * it slows down context switching. Noone uses it anyway. */ cpu = cpu; /* XXX avoid compiler warning */ - xen_set_ldt(0UL, 0); + xen_set_ldt(NULL, 0); put_cpu(); } @@ -142,7 +142,7 @@ static inline void load_LDT_nolock(mm_context_t *pc, int cpu) if (likely(!count)) segments = NULL; - xen_set_ldt((unsigned long)segments, count); + xen_set_ldt(segments, count); } static inline void load_LDT(mm_context_t *pc) diff --git a/include/asm-i386/mach-xen/asm/hypervisor.h b/include/asm-i386/mach-xen/asm/hypervisor.h index b294be79..5d18cd77 100644 --- a/include/asm-i386/mach-xen/asm/hypervisor.h +++ b/include/asm-i386/mach-xen/asm/hypervisor.h @@ -105,7 +105,7 @@ void xen_l4_entry_update(pgd_t *ptr, pgd_t val); /* x86_64 only */ void xen_pgd_pin(unsigned long ptr); void xen_pgd_unpin(unsigned long ptr); -void xen_set_ldt(unsigned long ptr, unsigned long bytes); +void xen_set_ldt(const void *ptr, unsigned int ents); #ifdef CONFIG_SMP #include diff --git a/include/asm-x86_64/mach-xen/asm/desc.h b/include/asm-x86_64/mach-xen/asm/desc.h index f88c2615..33b57c81 100644 --- a/include/asm-x86_64/mach-xen/asm/desc.h +++ b/include/asm-x86_64/mach-xen/asm/desc.h @@ -81,7 +81,7 @@ static inline void clear_LDT(void) * it slows down context switching. Noone uses it anyway. */ cpu = cpu; /* XXX avoid compiler warning */ - xen_set_ldt(0UL, 0); + xen_set_ldt(NULL, 0); put_cpu(); } @@ -248,7 +248,7 @@ static inline void load_LDT_nolock (mm_context_t *pc, int cpu) if (likely(!count)) segments = NULL; - xen_set_ldt((unsigned long)segments, count); + xen_set_ldt(segments, count); } static inline void load_LDT(mm_context_t *pc)