Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83166
b: refs/heads/master
c: 9226b83
h: refs/heads/master
v: v3
  • Loading branch information
Jeff Dike authored and Linus Torvalds committed Feb 5, 2008
1 parent 84184d0 commit 0141323
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 37 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 06d9bd3ad6da2422f838fd11d5d5348fa579bdb2
refs/heads/master: 9226b8384776798986640ce07764d17ba66aa54f
2 changes: 1 addition & 1 deletion trunk/arch/um/include/arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@

extern void arch_check_bugs(void);
extern int arch_fixup(unsigned long address, struct uml_pt_regs *regs);
extern int arch_handle_signal(int sig, struct uml_pt_regs *regs);
extern void arch_examine_signal(int sig, struct uml_pt_regs *regs);

#endif
5 changes: 2 additions & 3 deletions trunk/arch/um/kernel/trap.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,16 +216,15 @@ unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user,

void relay_signal(int sig, struct uml_pt_regs *regs)
{
if (arch_handle_signal(sig, regs))
return;

if (!UPT_IS_USER(regs)) {
if (sig == SIGBUS)
printk(KERN_ERR "Bus error - the host /dev/shm or /tmp "
"mount likely just ran out of space\n");
panic("Kernel mode signal %d", sig);
}

arch_examine_signal(sig, regs);

current->thread.arch.faultinfo = *UPT_FAULTINFO(regs);
force_sig(sig, current);
}
Expand Down
46 changes: 20 additions & 26 deletions trunk/arch/um/sys-i386/bugs.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
* Licensed under the GPL
*/

#include <errno.h>
#include <signal.h>
#include <string.h>
#include "kern_constants.h"
#include "os.h"
#include "longjmp.h"
#include "task.h"
#include "user.h"
#include "sysdep/archsetjmp.h"
#include "sysdep/ptrace.h"

/* Set during early boot */
int host_has_cmov = 1;
Expand All @@ -22,7 +20,7 @@ static void cmov_sigill_test_handler(int sig)
longjmp(cmov_test_return, 1);
}

static void test_for_host_cmov(void)
void arch_check_bugs(void)
{
struct sigaction old, new;

Expand All @@ -44,16 +42,7 @@ static void test_for_host_cmov(void)
sigaction(SIGILL, &old, &new);
}

void arch_init_thread(void)
{
}

void arch_check_bugs(void)
{
test_for_host_cmov();
}

int arch_handle_signal(int sig, struct uml_pt_regs *regs)
void arch_examine_signal(int sig, struct uml_pt_regs *regs)
{
unsigned char tmp[2];

Expand All @@ -62,20 +51,25 @@ int arch_handle_signal(int sig, struct uml_pt_regs *regs)
* SIGILL in init.
*/
if ((sig != SIGILL) || (TASK_PID(get_current()) != 1))
return 0;
return;

if (copy_from_user_proc(tmp, (void *) UPT_IP(regs), 2)) {
printk(UM_KERN_ERR "SIGILL in init, could not read "
"instructions!\n");
return;
}

if (copy_from_user_proc(tmp, (void *) UPT_IP(regs), 2))
panic("SIGILL in init, could not read instructions!\n");
if ((tmp[0] != 0x0f) || ((tmp[1] & 0xf0) != 0x40))
return 0;
return;

if (host_has_cmov == 0)
panic("SIGILL caused by cmov, which this processor doesn't "
"implement, boot a filesystem compiled for older "
"processors");
printk(UM_KERN_ERR "SIGILL caused by cmov, which this "
"processor doesn't implement. Boot a filesystem "
"compiled for older processors");
else if (host_has_cmov == 1)
panic("SIGILL caused by cmov, which this processor claims to "
"implement");
else panic("Bad value for host_has_cmov (%d)", host_has_cmov);
return 0;
printk(UM_KERN_ERR "SIGILL caused by cmov, which this "
"processor claims to implement");
else
printk(UM_KERN_ERR "Bad value for host_has_cmov (%d)",
host_has_cmov);
}
7 changes: 1 addition & 6 deletions trunk/arch/um/sys-x86_64/bugs.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,10 @@

#include "sysdep/ptrace.h"

void arch_init_thread(void)
{
}

void arch_check_bugs(void)
{
}

int arch_handle_signal(int sig, struct uml_pt_regs *regs)
void arch_examine_signal(int sig, struct uml_pt_regs *regs)
{
return 0;
}

0 comments on commit 0141323

Please sign in to comment.