Skip to content

Commit 4cd7ed9

Browse files
Paolo 'Blaisorblade' GiarrussoLinus Torvalds
authored andcommitted
[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: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Cc: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent e5cf888 commit 4cd7ed9

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎include/asm-um/ldt-x86_64.h‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,13 @@ typedef struct uml_ldt {
3939
} uml_ldt_t;
4040

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

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

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

6973
#endif

0 commit comments

Comments
 (0)