@@ -4717,7 +4717,7 @@ static int kvm_load_realmode_segment(struct kvm_vcpu *vcpu, u16 selector, int se
.unusable = 0,
};
kvm_x86_ops->set_segment(vcpu, &segvar, seg);
- return 0;
+ return X86EMUL_CONTINUE;
}
static int is_vm86_segment(struct kvm_vcpu *vcpu, int seg)
@@ -4741,12 +4741,15 @@ int kvm_load_segment_descriptor(struct kvm_vcpu *vcpu, u16 selector,
{
struct kvm_segment kvm_seg;
struct desc_struct seg_desc;
+ int ret;
if (is_vm86_segment(vcpu, seg) || !is_protmode(vcpu))
return kvm_load_realmode_segment(vcpu, selector, seg);
- if (load_guest_segment_descriptor(vcpu, selector, &seg_desc))
- return 1;
+ ret = load_guest_segment_descriptor(vcpu, selector, &seg_desc);
+ if (ret != X86EMUL_CONTINUE)
+ return ret;
+
seg_desct_to_kvm_desct(&seg_desc, selector, &kvm_seg);
kvm_check_segment_descriptor(vcpu, seg, selector);
@@ -4763,7 +4766,7 @@ int kvm_load_segment_descriptor(struct kvm_vcpu *vcpu, u16 selector,
seg_desc.type |= 1;
save_guest_segment_descriptor(vcpu, selector, &seg_desc);
}
- return 0;
+ return X86EMUL_CONTINUE;
}
static void save_state_to_tss32(struct kvm_vcpu *vcpu,