Merge branch 'tracing/hw-breakpoints' into perf/core
[linux-2.6-block.git] / arch / x86 / kvm / x86.c
index 22dee7aa7813973e895595ebbc879a1a5e87685f..4fc80174191ce4b17549b643fe11dee645286c3f 100644 (file)
@@ -1693,7 +1693,7 @@ static int kvm_vcpu_ioctl_x86_setup_mce(struct kvm_vcpu *vcpu,
        unsigned bank_num = mcg_cap & 0xff, bank;
 
        r = -EINVAL;
-       if (!bank_num)
+       if (!bank_num || bank_num >= KVM_MAX_MCE_BANKS)
                goto out;
        if (mcg_cap & ~(KVM_MCE_CAP_SUPPORTED | 0xff | 0xff0000))
                goto out;
@@ -3651,7 +3651,7 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
         * care about the messed up debug address registers. But if
         * we have some of them active, restore the old state.
         */
-       if (__get_cpu_var(dr7) & DR_GLOBAL_ENABLE_MASK)
+       if (hw_breakpoint_active())
                hw_breakpoint_restore();
 
        set_bit(KVM_REQ_KICK, &vcpu->requests);
@@ -4053,7 +4053,7 @@ static int save_guest_segment_descriptor(struct kvm_vcpu *vcpu, u16 selector,
        return kvm_write_guest_virt(dtable.base + index*8, seg_desc, sizeof(*seg_desc), vcpu);
 }
 
-static u32 get_tss_base_addr(struct kvm_vcpu *vcpu,
+static gpa_t get_tss_base_addr(struct kvm_vcpu *vcpu,
                             struct desc_struct *seg_desc)
 {
        u32 base_addr = get_desc_base(seg_desc);