Skip to content

Commit c2220b2

Browse files
Al Virorichardweinberger
authored andcommitted
um: kill HOST_TASK_PID
just provide get_current_pid() to the userland side of things instead of get_current() + manual poking in its results Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Richard Weinberger <richard@nod.at>
1 parent 28a12cb commit c2220b2

4 files changed

Lines changed: 4 additions & 8 deletions

File tree

‎arch/um/include/shared/common-offsets.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
DEFINE(KERNEL_MADV_REMOVE, MADV_REMOVE);
44

5-
OFFSET(HOST_TASK_PID, task_struct, pid);
6-
75
DEFINE(UM_KERN_PAGE_SIZE, PAGE_SIZE);
86
DEFINE(UM_KERN_PAGE_MASK, PAGE_MASK);
97
DEFINE(UM_KERN_PAGE_SHIFT, PAGE_SHIFT);

‎arch/um/include/shared/kern_util.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ extern void do_uml_exitcalls(void);
4848
* GFP_ATOMIC.
4949
*/
5050
extern int __cant_sleep(void);
51-
extern void *get_current(void);
51+
extern int get_current_pid(void);
5252
extern int copy_from_user_proc(void *to, void *from, int size);
5353
extern int cpu(void);
5454
extern char *uml_strdup(const char *string);

‎arch/um/kernel/process.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ void exit_thread(void)
126126
{
127127
}
128128

129-
void *get_current(void)
129+
int get_current_pid(void)
130130
{
131-
return current;
131+
return task_pid_nr(current);
132132
}
133133

134134
/*

‎arch/x86/um/bugs_32.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
static int host_has_cmov = 1;
1414
static jmp_buf cmov_test_return;
1515

16-
#define TASK_PID(task) *((int *) &(((char *) (task))[HOST_TASK_PID]))
17-
1816
static void cmov_sigill_test_handler(int sig)
1917
{
2018
host_has_cmov = 0;
@@ -51,7 +49,7 @@ void arch_examine_signal(int sig, struct uml_pt_regs *regs)
5149
* This is testing for a cmov (0x0f 0x4x) instruction causing a
5250
* SIGILL in init.
5351
*/
54-
if ((sig != SIGILL) || (TASK_PID(get_current()) != 1))
52+
if ((sig != SIGILL) || (get_current_pid() != 1))
5553
return;
5654

5755
if (copy_from_user_proc(tmp, (void *) UPT_IP(regs), 2)) {

0 commit comments

Comments
 (0)