WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] RE: xenpm fail

Thanks for this...

On Mon, 2010-11-01 at 10:49 +0000, Zhang, Yang Z wrote:
[...]
> xc__hypercall_bounce_pre bounced 32 bytes from user buf 0x7fffffffe720 into 
> hcall buf 0x607004
> xc__hypercall_bounce_pre bounced 32 bytes from user buf 0x7fffffffe728 into 
> hcall buf 0x609004
> xc__hypercall_bounce_pre bounced 136 bytes from user buf 0x7fffffffe610 into 
> hcall buf 0x60b004
> xc__hypercall_bounce_post bounced 136 bytes back from hcall buf 0x60b004 into 
> user buf 0x7fffffffe610
> xc__hypercall_bounce_post bounced 32 bytes back from hcall buf 0x609004 into 
> user buf 0x7fffffffe728
> xc__hypercall_bounce_post bounced 32 bytes back from hcall buf 0x607004 into 
> user buf 0x7fffffffe720

This is the xc_pm_get_cxstat call, we can see it bounce max_cx(=4) *
sizeof(uint64_t)==32 bytes for both cxpt->triggers and cxpt->residencies
as well as 136 bytes for struct xensysctl.

However the ubuf values for triggers and residencies are suspicious,
they are only 8 bytes different, IOW they apparently overlap.

Can you try this patch which fixes a stupid thinko.

diff -r c3d7d2729410 tools/libxc/xc_pm.c
--- a/tools/libxc/xc_pm.c       Mon Nov 01 11:12:51 2010 +0000
+++ b/tools/libxc/xc_pm.c       Mon Nov 01 11:19:53 2010 +0000
@@ -124,8 +124,8 @@ int xc_pm_get_cxstat(xc_interface *xch, 
 int xc_pm_get_cxstat(xc_interface *xch, int cpuid, struct xc_cx_stat *cxpt)
 {
     DECLARE_SYSCTL;
-    DECLARE_NAMED_HYPERCALL_BOUNCE(triggers, &cxpt->triggers, 0, 
XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
-    DECLARE_NAMED_HYPERCALL_BOUNCE(residencies, &cxpt->residencies, 0, 
XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
+    DECLARE_NAMED_HYPERCALL_BOUNCE(triggers, cxpt->triggers, 0, 
XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
+    DECLARE_NAMED_HYPERCALL_BOUNCE(residencies, cxpt->residencies, 0, 
XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
     int max_cx, ret;
 
     if( !cxpt || !(cxpt->triggers) || !(cxpt->residencies) )



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>