summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2010-11-22 17:53:24 +0200
committerAvi Kivity <avi@redhat.com>2011-01-12 11:29:56 +0200
commitdb297e3d8ed8409b969512c3ecd9d13223f2981c (patch)
treef45bb722f80e0ffd78a665c5f4dd1d69bda319e5 /arch
parent42438e364cbc1e95cacb4ca92688d54a50cf5c4d (diff)
KVM: x86 emulator: tighen up ->read_std() and ->write_std() error checks
Instead of checking for X86EMUL_PROPAGATE_FAULT, check for any error, making the callers more reliable. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/emulate.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 345aa4d3614..223c536b7f7 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -1915,7 +1915,7 @@ static int task_switch_16(struct x86_emulate_ctxt *ctxt,
ret = ops->read_std(old_tss_base, &tss_seg, sizeof tss_seg, ctxt->vcpu,
&ctxt->exception);
- if (ret == X86EMUL_PROPAGATE_FAULT)
+ if (ret != X86EMUL_CONTINUE)
/* FIXME: need to provide precise fault address */
return ret;
@@ -1923,13 +1923,13 @@ static int task_switch_16(struct x86_emulate_ctxt *ctxt,
ret = ops->write_std(old_tss_base, &tss_seg, sizeof tss_seg, ctxt->vcpu,
&ctxt->exception);
- if (ret == X86EMUL_PROPAGATE_FAULT)
+ if (ret != X86EMUL_CONTINUE)
/* FIXME: need to provide precise fault address */
return ret;
ret = ops->read_std(new_tss_base, &tss_seg, sizeof tss_seg, ctxt->vcpu,
&ctxt->exception);
- if (ret == X86EMUL_PROPAGATE_FAULT)
+ if (ret != X86EMUL_CONTINUE)
/* FIXME: need to provide precise fault address */
return ret;
@@ -1940,7 +1940,7 @@ static int task_switch_16(struct x86_emulate_ctxt *ctxt,
&tss_seg.prev_task_link,
sizeof tss_seg.prev_task_link,
ctxt->vcpu, &ctxt->exception);
- if (ret == X86EMUL_PROPAGATE_FAULT)
+ if (ret != X86EMUL_CONTINUE)
/* FIXME: need to provide precise fault address */
return ret;
}
@@ -2049,7 +2049,7 @@ static int task_switch_32(struct x86_emulate_ctxt *ctxt,
ret = ops->read_std(old_tss_base, &tss_seg, sizeof tss_seg, ctxt->vcpu,
&ctxt->exception);
- if (ret == X86EMUL_PROPAGATE_FAULT)
+ if (ret != X86EMUL_CONTINUE)
/* FIXME: need to provide precise fault address */
return ret;
@@ -2057,13 +2057,13 @@ static int task_switch_32(struct x86_emulate_ctxt *ctxt,
ret = ops->write_std(old_tss_base, &tss_seg, sizeof tss_seg, ctxt->vcpu,
&ctxt->exception);
- if (ret == X86EMUL_PROPAGATE_FAULT)
+ if (ret != X86EMUL_CONTINUE)
/* FIXME: need to provide precise fault address */
return ret;
ret = ops->read_std(new_tss_base, &tss_seg, sizeof tss_seg, ctxt->vcpu,
&ctxt->exception);
- if (ret == X86EMUL_PROPAGATE_FAULT)
+ if (ret != X86EMUL_CONTINUE)
/* FIXME: need to provide precise fault address */
return ret;
@@ -2074,7 +2074,7 @@ static int task_switch_32(struct x86_emulate_ctxt *ctxt,
&tss_seg.prev_task_link,
sizeof tss_seg.prev_task_link,
ctxt->vcpu, &ctxt->exception);
- if (ret == X86EMUL_PROPAGATE_FAULT)
+ if (ret != X86EMUL_CONTINUE)
/* FIXME: need to provide precise fault address */
return ret;
}