From: Zachary Amsden Xen requires error returns from the hypercall to update LDT entries, and this generates completely equivalent code on native. Signed-off-by: Zachary Amsden Signed-off-by: Andrew Morton --- arch/i386/kernel/ldt.c | 3 +-- include/asm-i386/mach-default/mach_desc.h | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff -puN arch/i386/kernel/ldt.c~i386--make-write-ldt-return-error-code arch/i386/kernel/ldt.c --- 25/arch/i386/kernel/ldt.c~i386--make-write-ldt-return-error-code Wed Aug 17 13:33:37 2005 +++ 25-akpm/arch/i386/kernel/ldt.c Wed Aug 17 13:33:37 2005 @@ -221,8 +221,7 @@ static int write_ldt(void __user * ptr, /* Install the new entry ... */ install: - write_ldt_entry(mm->context.ldt, ldt_info.entry_number, entry_1, entry_2); - error = 0; + error = write_ldt_entry(mm->context.ldt, ldt_info.entry_number, entry_1, entry_2); out_unlock: up(&mm->context.sem); diff -puN include/asm-i386/mach-default/mach_desc.h~i386--make-write-ldt-return-error-code include/asm-i386/mach-default/mach_desc.h --- 25/include/asm-i386/mach-default/mach_desc.h~i386--make-write-ldt-return-error-code Wed Aug 17 13:33:37 2005 +++ 25-akpm/include/asm-i386/mach-default/mach_desc.h Wed Aug 17 13:33:37 2005 @@ -62,11 +62,12 @@ static inline void set_ldt_desc(unsigned _set_tssldt_desc(&per_cpu(cpu_gdt_table, cpu)[GDT_ENTRY_LDT], (int)addr, ((size << 3)-1), 0x82); } -static inline void write_ldt_entry(void *ldt, int entry, __u32 entry_a, __u32 entry_b) +static inline int write_ldt_entry(void *ldt, int entry, __u32 entry_a, __u32 entry_b) { __u32 *lp = (__u32 *)((char *)ldt + entry*8); *lp = entry_a; *(lp+1) = entry_b; + return 0; } #if TLS_SIZE != 24 _