x86/mce: Convert to insn_decode()
[linux-2.6-microblaze.git] / arch / x86 / kernel / cpu / mce / severity.c
index 83df991..a2136ce 100644 (file)
@@ -218,15 +218,15 @@ static struct severity {
 static bool is_copy_from_user(struct pt_regs *regs)
 {
        u8 insn_buf[MAX_INSN_SIZE];
-       struct insn insn;
        unsigned long addr;
+       struct insn insn;
+       int ret;
 
        if (copy_from_kernel_nofault(insn_buf, (void *)regs->ip, MAX_INSN_SIZE))
                return false;
 
-       kernel_insn_init(&insn, insn_buf, MAX_INSN_SIZE);
-       insn_get_opcode(&insn);
-       if (!insn.opcode.got)
+       ret = insn_decode(&insn, insn_buf, MAX_INSN_SIZE, INSN_MODE_KERN);
+       if (ret < 0)
                return false;
 
        switch (insn.opcode.value) {
@@ -234,10 +234,6 @@ static bool is_copy_from_user(struct pt_regs *regs)
        case 0x8A: case 0x8B:
        /* MOVZ mem,reg */
        case 0xB60F: case 0xB70F:
-               insn_get_modrm(&insn);
-               insn_get_sib(&insn);
-               if (!insn.modrm.got || !insn.sib.got)
-                       return false;
                addr = (unsigned long)insn_get_addr_ref(&insn, regs);
                break;
        /* REP MOVS */