Release 4.14 arch/x86/um/bugs_32.c
/*
* Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
* Licensed under the GPL
*/
#include <signal.h>
#include <kern_util.h>
#include <longjmp.h>
#include <sysdep/ptrace.h>
#include <generated/asm-offsets.h>
/* Set during early boot */
static int host_has_cmov = 1;
static jmp_buf cmov_test_return;
static void cmov_sigill_test_handler(int sig)
{
host_has_cmov = 0;
longjmp(cmov_test_return, 1);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Karol Swietlicki | 20 | 100.00% | 1 | 100.00% |
Total | 20 | 100.00% | 1 | 100.00% |
void arch_check_bugs(void)
{
struct sigaction old, new;
printk(UM_KERN_INFO "Checking for host processor cmov support...");
new.sa_handler = cmov_sigill_test_handler;
/* Make sure that SIGILL is enabled after the handler longjmps back */
new.sa_flags = SA_NODEFER;
sigemptyset(&new.sa_mask);
sigaction(SIGILL, &new, &old);
if (setjmp(cmov_test_return) == 0) {
unsigned long foo = 0;
__asm__ __volatile__("cmovz %0, %1" : "=r" (foo) : "0" (foo));
printk(UM_KERN_CONT "Yes\n");
} else
printk(UM_KERN_CONT "No\n");
sigaction(SIGILL, &old, &new);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Karol Swietlicki | 94 | 98.95% | 1 | 50.00% |
Jeff Dike | 1 | 1.05% | 1 | 50.00% |
Total | 95 | 100.00% | 2 | 100.00% |
void arch_examine_signal(int sig, struct uml_pt_regs *regs)
{
unsigned char tmp[2];
/*
* This is testing for a cmov (0x0f 0x4x) instruction causing a
* SIGILL in init.
*/
if ((sig != SIGILL) || (get_current_pid() != 1))
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 ((tmp[0] != 0x0f) || ((tmp[1] & 0xf0) != 0x40))
return;
if (host_has_cmov == 0)
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)
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);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jeff Dike | 122 | 96.06% | 5 | 71.43% |
Paolo 'Blaisorblade' Giarrusso | 4 | 3.15% | 1 | 14.29% |
Al Viro | 1 | 0.79% | 1 | 14.29% |
Total | 127 | 100.00% | 7 | 100.00% |
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jeff Dike | 138 | 51.30% | 7 | 53.85% |
Karol Swietlicki | 118 | 43.87% | 1 | 7.69% |
Paolo 'Blaisorblade' Giarrusso | 7 | 2.60% | 1 | 7.69% |
Al Viro | 5 | 1.86% | 3 | 23.08% |
Américo Wang | 1 | 0.37% | 1 | 7.69% |
Total | 269 | 100.00% | 13 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.