aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/hvm/hvm.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2013-10-14 09:53:31 +0200
committerJan Beulich <jbeulich@suse.com>2013-10-14 09:53:31 +0200
commit63b02eff535b8798517b5a280cc2fff2f7d415c1 (patch)
tree9c56d677aeae0f14f16e8945951bef5afa8c7999 /xen/arch/x86/hvm/hvm.c
parente0c4efbe6dd6822c91b466c34bc6d8aaa935d90f (diff)
downloadxen-63b02eff535b8798517b5a280cc2fff2f7d415c1.tar.gz
xen-63b02eff535b8798517b5a280cc2fff2f7d415c1.tar.bz2
xen-63b02eff535b8798517b5a280cc2fff2f7d415c1.zip
x86/HVM: properly deal with hvm_copy_*_guest_phys() errors
In memory read/write handling the default case should tell the caller that the operation cannot be handled rather than the operation having succeeded, so that when new HVMCOPY_* states get added not handling them explicitly will not result in errors being ignored. In task switch emulation code stop handling some errors, but not others. Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/hvm/hvm.c')
-rw-r--r--xen/arch/x86/hvm/hvm.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 6fcd95a246..5f3a94a043 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2346,11 +2346,7 @@ void hvm_task_switch(
rc = hvm_copy_to_guest_virt(
prev_tr.base, &tss, sizeof(tss), PFEC_page_present);
- if ( rc == HVMCOPY_bad_gva_to_gfn )
- goto out;
- if ( rc == HVMCOPY_gfn_paged_out )
- goto out;
- if ( rc == HVMCOPY_gfn_shared )
+ if ( rc != HVMCOPY_okay )
goto out;
rc = hvm_copy_from_guest_virt(
@@ -2397,9 +2393,7 @@ void hvm_task_switch(
tr.base, &tss, sizeof(tss), PFEC_page_present);
if ( rc == HVMCOPY_bad_gva_to_gfn )
exn_raised = 1;
- if ( rc == HVMCOPY_gfn_paged_out )
- goto out;
- if ( rc == HVMCOPY_gfn_shared )
+ else if ( rc != HVMCOPY_okay )
goto out;
if ( (tss.trace & 1) && !exn_raised )