diff options
Diffstat (limited to 'arch/um/sys-x86_64/syscalls.c')
-rw-r--r-- | arch/um/sys-x86_64/syscalls.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/arch/um/sys-x86_64/syscalls.c b/arch/um/sys-x86_64/syscalls.c index dd9914642b8e..6f44f40204ed 100644 --- a/arch/um/sys-x86_64/syscalls.c +++ b/arch/um/sys-x86_64/syscalls.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include "asm/unistd.h" | 15 | #include "asm/unistd.h" |
16 | #include "asm/prctl.h" /* XXX This should get the constants from libc */ | 16 | #include "asm/prctl.h" /* XXX This should get the constants from libc */ |
17 | #include "choose-mode.h" | 17 | #include "choose-mode.h" |
18 | #include "kern.h" | ||
18 | 19 | ||
19 | asmlinkage long sys_uname64(struct new_utsname __user * name) | 20 | asmlinkage long sys_uname64(struct new_utsname __user * name) |
20 | { | 21 | { |
@@ -132,23 +133,27 @@ static long arch_prctl_tt(int code, unsigned long addr) | |||
132 | 133 | ||
133 | #ifdef CONFIG_MODE_SKAS | 134 | #ifdef CONFIG_MODE_SKAS |
134 | 135 | ||
136 | /* XXX: Must also call arch_prctl in the host, beside saving the segment bases! */ | ||
135 | static long arch_prctl_skas(int code, unsigned long addr) | 137 | static long arch_prctl_skas(int code, unsigned long addr) |
136 | { | 138 | { |
137 | long ret = 0; | 139 | long ret = 0; |
138 | 140 | ||
139 | switch(code){ | 141 | switch(code){ |
140 | case ARCH_SET_GS: | ||
141 | current->thread.regs.regs.skas.regs[GS_BASE / sizeof(unsigned long)] = addr; | ||
142 | break; | ||
143 | case ARCH_SET_FS: | 142 | case ARCH_SET_FS: |
144 | current->thread.regs.regs.skas.regs[FS_BASE / sizeof(unsigned long)] = addr; | 143 | current->thread.regs.regs.skas.regs[FS_BASE / sizeof(unsigned long)] = addr; |
145 | break; | 144 | break; |
145 | case ARCH_SET_GS: | ||
146 | current->thread.regs.regs.skas.regs[GS_BASE / sizeof(unsigned long)] = addr; | ||
147 | break; | ||
146 | case ARCH_GET_FS: | 148 | case ARCH_GET_FS: |
147 | ret = put_user(current->thread.regs.regs.skas.regs[GS / sizeof(unsigned long)], &addr); | 149 | ret = put_user(current->thread.regs.regs.skas. |
150 | regs[FS_BASE / sizeof(unsigned long)], | ||
151 | (unsigned long __user *)addr); | ||
148 | break; | 152 | break; |
149 | case ARCH_GET_GS: | 153 | case ARCH_GET_GS: |
150 | ret = put_user(current->thread.regs.regs.skas.regs[FS / sizeof(unsigned \ | 154 | ret = put_user(current->thread.regs.regs.skas. |
151 | long)], &addr); | 155 | regs[GS_BASE / sizeof(unsigned long)], |
156 | (unsigned long __user *)addr); | ||
152 | break; | 157 | break; |
153 | default: | 158 | default: |
154 | ret = -EINVAL; | 159 | ret = -EINVAL; |