KVM: x86: task switch: fix wrong bit setting for the busy flag
authorIzik Eidus <izike@qumranet.com>
Mon, 28 Apr 2008 15:23:52 +0000 (18:23 +0300)
committerAvi Kivity <avi@qumranet.com>
Sun, 4 May 2008 11:44:43 +0000 (14:44 +0300)
The busy bit is bit 1 of the type field, not bit 8.

Signed-off-by: Izik Eidus <izike@qumranet.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
arch/x86/kvm/x86.c

index 1842a86f7c33d1a8a65a94b2068a5f98d926ec49..017daa2561f4b4a1b9ac2db6f7122c4b1892ca91 100644 (file)
@@ -3484,7 +3484,7 @@ int kvm_task_switch(struct kvm_vcpu *vcpu, u16 tss_selector, int reason)
        }
 
        if (reason == TASK_SWITCH_IRET || reason == TASK_SWITCH_JMP) {
-               cseg_desc.type &= ~(1 << 8); //clear the B flag
+               cseg_desc.type &= ~(1 << 1); //clear the B flag
                save_guest_segment_descriptor(vcpu, tr_seg.selector,
                                              &cseg_desc);
        }
@@ -3510,7 +3510,7 @@ int kvm_task_switch(struct kvm_vcpu *vcpu, u16 tss_selector, int reason)
        }
 
        if (reason != TASK_SWITCH_IRET) {
-               nseg_desc.type |= (1 << 8);
+               nseg_desc.type |= (1 << 1);
                save_guest_segment_descriptor(vcpu, tss_selector,
                                              &nseg_desc);
        }