Revision f71ac88f target-i386/kvm.c

b/target-i386/kvm.c
1636 1636
    exit(1);
1637 1637
}
1638 1638

  
1639
#ifdef KVM_CAP_MCE
1640
static void kvm_mce_broadcast_rest(CPUState *env)
1641
{
1642
    CPUState *cenv;
1643
    int family, model, cpuver = env->cpuid_version;
1644

  
1645
    family = (cpuver >> 8) & 0xf;
1646
    model = ((cpuver >> 12) & 0xf0) + ((cpuver >> 4) & 0xf);
1647

  
1648
    /* Broadcast MCA signal for processor version 06H_EH and above */
1649
    if ((family == 6 && model >= 14) || family > 6) {
1650
        for (cenv = first_cpu; cenv != NULL; cenv = cenv->next_cpu) {
1651
            if (cenv == env) {
1652
                continue;
1653
            }
1654
            kvm_inject_x86_mce(cenv, 1, MCI_STATUS_VAL | MCI_STATUS_UC,
1655
                               MCG_STATUS_MCIP | MCG_STATUS_RIPV, 0, 0, 1);
1656
        }
1657
    }
1658
}
1659
#endif
1660

  
1639 1661
int kvm_on_sigbus_vcpu(CPUState *env, int code, void *addr)
1640 1662
{
1641 1663
#if defined(KVM_CAP_MCE)
......
1693 1715
            fprintf(stderr, "kvm_set_mce: %s\n", strerror(errno));
1694 1716
            abort();
1695 1717
        }
1718
        kvm_mce_broadcast_rest(env);
1696 1719
    } else
1697 1720
#endif
1698 1721
    {
......
1715 1738
        void *vaddr;
1716 1739
        ram_addr_t ram_addr;
1717 1740
        target_phys_addr_t paddr;
1718
        CPUState *cenv;
1719 1741

  
1720 1742
        /* Hope we are lucky for AO MCE */
1721 1743
        vaddr = addr;
......
1731 1753
        kvm_inject_x86_mce(first_cpu, 9, status,
1732 1754
                           MCG_STATUS_MCIP | MCG_STATUS_RIPV, paddr,
1733 1755
                           (MCM_ADDR_PHYS << 6) | 0xc, 1);
1734
        for (cenv = first_cpu->next_cpu; cenv != NULL; cenv = cenv->next_cpu) {
1735
            kvm_inject_x86_mce(cenv, 1, MCI_STATUS_VAL | MCI_STATUS_UC,
1736
                               MCG_STATUS_MCIP | MCG_STATUS_RIPV, 0, 0, 1);
1737
        }
1756
        kvm_mce_broadcast_rest(first_cpu);
1738 1757
    } else
1739 1758
#endif
1740 1759
    {

Also available in: Unified diff