[PATCH 1/14] i386 / Make write ldt return error code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Xen requires error returns from the hypercall to update LDT entries,
and this generates completely equivalent code on native.

Patch-base: 2.6.13-rc5-mm1
Patch-keys: i386 desc ldt paravirt xen
Signed-off-by: Zachary Amsden <[email protected]>

Index: linux-2.6.13/include/asm-i386/mach-default/mach_desc.h
===================================================================
--- linux-2.6.13.orig/include/asm-i386/mach-default/mach_desc.h	2005-08-09 18:19:39.000000000 -0700
+++ linux-2.6.13/include/asm-i386/mach-default/mach_desc.h	2005-08-09 18:24:10.000000000 -0700
@@ -62,11 +62,12 @@
 	_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
Index: linux-2.6.13/arch/i386/kernel/ldt.c
===================================================================
--- linux-2.6.13.orig/arch/i386/kernel/ldt.c	2005-08-09 18:19:37.000000000 -0700
+++ linux-2.6.13/arch/i386/kernel/ldt.c	2005-08-09 18:22:56.000000000 -0700
@@ -221,8 +221,7 @@
 
 	/* 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);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux