@@ -434,7 +434,6 @@ static int __init init_stub_exe_fd(void)
434434__initcall (init_stub_exe_fd );
435435
436436int using_seccomp ;
437- int userspace_pid [NR_CPUS ];
438437
439438/**
440439 * start_userspace() - prepare a new userspace process
@@ -553,7 +552,7 @@ extern unsigned long tt_extra_sched_jiffies;
553552
554553void userspace (struct uml_pt_regs * regs )
555554{
556- int err , status , op , pid = userspace_pid [ 0 ] ;
555+ int err , status , op ;
557556 siginfo_t si_ptrace ;
558557 siginfo_t * si ;
559558 int sig ;
@@ -562,6 +561,8 @@ void userspace(struct uml_pt_regs *regs)
562561 interrupt_end ();
563562
564563 while (1 ) {
564+ struct mm_id * mm_id = current_mm_id ();
565+
565566 /*
566567 * When we are in time-travel mode, userspace can theoretically
567568 * do a *lot* of work without being scheduled. The problem with
@@ -590,7 +591,6 @@ void userspace(struct uml_pt_regs *regs)
590591 current_mm_sync ();
591592
592593 if (using_seccomp ) {
593- struct mm_id * mm_id = current_mm_id ();
594594 struct stub_data * proc_data = (void * ) mm_id -> stack ;
595595
596596 err = set_stub_state (regs , proc_data , singlestepping ());
@@ -644,8 +644,10 @@ void userspace(struct uml_pt_regs *regs)
644644 GET_FAULTINFO_FROM_MC (regs -> faultinfo , mcontext );
645645 }
646646 } else {
647+ int pid = mm_id -> pid ;
648+
647649 /* Flush out any pending syscalls */
648- err = syscall_stub_flush (current_mm_id () );
650+ err = syscall_stub_flush (mm_id );
649651 if (err ) {
650652 if (err == - ENOMEM )
651653 report_enomem ();
@@ -776,7 +778,6 @@ void userspace(struct uml_pt_regs *regs)
776778 __func__ , sig );
777779 fatal_sigsegv ();
778780 }
779- pid = userspace_pid [0 ];
780781 interrupt_end ();
781782
782783 /* Avoid -ERESTARTSYS handling in host */
@@ -901,8 +902,3 @@ void reboot_skas(void)
901902 block_signals_trace ();
902903 UML_LONGJMP (& initial_jmpbuf , noreboot ? INIT_JMP_HALT : INIT_JMP_REBOOT );
903904}
904-
905- void __switch_mm (struct mm_id * mm_idp )
906- {
907- userspace_pid [0 ] = mm_idp -> pid ;
908- }
0 commit comments