[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] xen: x86: copy back tsc info, not pointer to tsc info in domctl



commit f057af7aad462aa9dde5b6ec7aff279c3e70d0e9
Author:     Ian Campbell <ian.campbell@xxxxxxxxxx>
AuthorDate: Tue May 26 12:14:47 2015 +0100
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Tue May 26 14:21:04 2015 +0100

    xen: x86: copy back tsc info, not pointer to tsc info in domctl
    
    In 38b37ed82705 "x86/domctl: cleanup", XEN_DOMCTL_gettscinfo was
    changed to use the standard copyback mechanism.
    
    However the output TSC Info is a guerst handle, i.e. a pointer to the
    location for the information, copyback just copies the unchanged
    pointer back.
    
    Switch back to fetching the details into a local struct and explicitly
    copying it back.
    
    This caused test failures in the Cambridge instance of osstest, but
    not for some reason in the production instance.
    
    Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/arch/x86/domctl.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 684259b..a9ccf58 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -703,13 +703,16 @@ long arch_do_domctl(
             ret = -EINVAL;
         else
         {
+            xen_guest_tsc_info_t info = { 0 };
+
             domain_pause(d);
-            tsc_get_info(d, &domctl->u.tsc_info.info.tsc_mode,
-                         &domctl->u.tsc_info.info.elapsed_nsec,
-                         &domctl->u.tsc_info.info.gtsc_khz,
-                         &domctl->u.tsc_info.info.incarnation);
+            tsc_get_info(d, &info.tsc_mode,
+                            &info.elapsed_nsec,
+                            &info.gtsc_khz,
+                            &info.incarnation);
             domain_unpause(d);
-            copyback = 1;
+            if ( copy_to_guest(domctl->u.tsc_info.out_info, &info, 1) )
+                ret = -EFAULT;
         }
         break;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.