Skip to contentSkip to conversation

libxc: fix bounce buffers in xc_pm_get_cx_stat and xc_pm_get_pxstat

PATCH Applied Ian Campbell 2 participants 2 messages Nov 1, 2010 – Nov 3, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxc: fix bounce buffers in xc_pm_get_cx_stat and xc_pm_get_pxstat

# HG changeset patch
# User Ian Campbell <[email protected]>
# Date 1288617427 0
# Node ID 4e0cc9f6b97a2b048b2dc2d400a2b9155153a5f1
# Parent a548cd399210f6a4a9379c7e87fdf0c208d6c90b
libxc: fix bounce buffers in xc_pm_get_cx_stat and xc_pm_get_pxstat

We should bounce the buffers themselves, not the pointers to them!

Error introduced by 22292:a1b39d2b9001 and reported by Yang Z Zhang.

tools/libxc/xc_pm.c +4 -4
diff -r a548cd399210 -r 4e0cc9f6b97a tools/libxc/xc_pm.c
@@ -46,8 +46,8 @@ int xc_pm_get_pxstat(xc_interface *xch, 
 {
     DECLARE_SYSCTL;
     /* Sizes unknown until xc_pm_get_max_px */
-    DECLARE_NAMED_HYPERCALL_BOUNCE(trans, &pxpt->trans_pt, 0, XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
-    DECLARE_NAMED_HYPERCALL_BOUNCE(pt, &pxpt->pt, 0, XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
+    DECLARE_NAMED_HYPERCALL_BOUNCE(trans, pxpt->trans_pt, 0, XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
+    DECLARE_NAMED_HYPERCALL_BOUNCE(pt, pxpt->pt, 0, XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
 
     int max_px, ret;
 
@@ -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) )
Applied
#1 lore raw

Ian Campbell writes ("[Xen-devel] [PATCH] libxc: fix bounce buffers in xc_pm_get_cx_stat and xc_pm_get_pxstat"):

Quoted 1 line

libxc: fix bounce buffers in xc_pm_get_cx_stat and xc_pm_get_pxstat

Applied, thanks.

Ian.