rk: revert 20f3d0b+v3.0.66 to v3.0
[firefly-linux-kernel-4.4.55.git] / arch / x86 / kernel / cpu / mcheck / mce.c
index 1396edf20b99efdf0fe7048bb6b3fb2bb3406efb..ff1ae9b6464d80d4663b8bc09124edbe6992ea7f 100644 (file)
@@ -122,7 +122,9 @@ void mce_setup(struct mce *m)
        m->time = get_seconds();
        m->cpuvendor = boot_cpu_data.x86_vendor;
        m->cpuid = cpuid_eax(1);
+#ifdef CONFIG_SMP
        m->socketid = cpu_data(m->extcpu).phys_proc_id;
+#endif
        m->apicid = cpu_data(m->extcpu).initial_apicid;
        rdmsrl(MSR_IA32_MCG_CAP, m->mcgcap);
 }
@@ -451,13 +453,6 @@ static inline void mce_get_rip(struct mce *m, struct pt_regs *regs)
        if (regs && (m->mcgstatus & (MCG_STATUS_RIPV|MCG_STATUS_EIPV))) {
                m->ip = regs->ip;
                m->cs = regs->cs;
-               /*
-                * When in VM86 mode make the cs look like ring 3
-                * always. This is a lie, but it's better than passing
-                * the additional vm86 bit around everywhere.
-                */
-               if (v8086_mode(regs))
-                       m->cs |= 3;
        } else {
                m->ip = 0;
                m->cs = 0;
@@ -995,7 +990,6 @@ void do_machine_check(struct pt_regs *regs, long error_code)
                 */
                add_taint(TAINT_MACHINE_CHECK);
 
-               mce_get_rip(&m, regs);
                severity = mce_severity(&m, tolerant, NULL);
 
                /*
@@ -1034,6 +1028,7 @@ void do_machine_check(struct pt_regs *regs, long error_code)
                if (severity == MCE_AO_SEVERITY && mce_usable_address(&m))
                        mce_ring_add(m.addr >> PAGE_SHIFT);
 
+               mce_get_rip(&m, regs);
                mce_log(&m);
 
                if (severity > worst) {