Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4cd7ed94 authored by Paolo 'Blaisorblade' Giarrusso's avatar Paolo 'Blaisorblade' Giarrusso Committed by Linus Torvalds
Browse files

[PATCH] uml: skas0-hold-own-ldt fixups for x86-64



In a recent fixup i386 code was copied raw to x86_64 subarch to make it
compile again.

Here there are some little fixups and resyncs needed for it (mainly for
cleanliness sake) - I did an audit and found the rest of the code to be safe.

Signed-off-by: default avatarPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Cc: Jeff Dike <jdike@addtoit.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e5cf8886
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -39,11 +39,13 @@ typedef struct uml_ldt {
} uml_ldt_t;
} uml_ldt_t;


/*
/*
 * macros stolen from include/asm-i386/desc.h
 * macros stolen from include/asm-x86_64/desc.h
 */
 */
#define LDT_entry_a(info) \
#define LDT_entry_a(info) \
	((((info)->base_addr & 0x0000ffff) << 16) | ((info)->limit & 0x0ffff))
	((((info)->base_addr & 0x0000ffff) << 16) | ((info)->limit & 0x0ffff))


/* Don't allow setting of the lm bit. It is useless anyways because
 * 64bit system calls require __USER_CS. */
#define LDT_entry_b(info) \
#define LDT_entry_b(info) \
	(((info)->base_addr & 0xff000000) | \
	(((info)->base_addr & 0xff000000) | \
	(((info)->base_addr & 0x00ff0000) >> 16) | \
	(((info)->base_addr & 0x00ff0000) >> 16) | \
@@ -54,6 +56,7 @@ typedef struct uml_ldt {
	((info)->seg_32bit << 22) | \
	((info)->seg_32bit << 22) | \
	((info)->limit_in_pages << 23) | \
	((info)->limit_in_pages << 23) | \
	((info)->useable << 20) | \
	((info)->useable << 20) | \
	/* ((info)->lm << 21) | */ \
	0x7000)
	0x7000)


#define LDT_empty(info) (\
#define LDT_empty(info) (\
@@ -64,6 +67,7 @@ typedef struct uml_ldt {
	(info)->seg_32bit	== 0	&& \
	(info)->seg_32bit	== 0	&& \
	(info)->limit_in_pages	== 0	&& \
	(info)->limit_in_pages	== 0	&& \
	(info)->seg_not_present	== 1	&& \
	(info)->seg_not_present	== 1	&& \
	(info)->useable		== 0	)
	(info)->useable		== 0	&& \
	(info)->lm              == 0)


#endif
#endif