Skip to contentSkip to conversation

sysctl: annotate struct pm_cx_stat's pc[]/cc[]

PATCH In review Jan Beulich 3 participants 3 messages Mar 19, 2014 – Mar 24, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sysctl: annotate struct pm_cx_stat's pc[]/cc[]

xen/include/public/sysctl.h +9 -2
@@ -228,8 +228,15 @@ struct pm_cx_stat {
     XEN_GUEST_HANDLE_64(uint64) residencies; /* Cx residencies */
     uint32_t nr_pc;                          /* entry nr in pc[] */
     uint32_t nr_cc;                          /* entry nr in cc[] */
-    XEN_GUEST_HANDLE_64(uint64) pc;          /* 1-biased indexing */
-    XEN_GUEST_HANDLE_64(uint64) cc;          /* 1-biased indexing */
+    /*
+     * These two arrays may (and generally will) have unused slots; slots not
+     * having a corresponding hardware register will not be written by the
+     * hypervisor. It is therefore up to the caller to put a suitable sentinel
+     * into all slots before invoking the function.
+     * Indexing is 1-biased (PC1/CC1 being at index 0).
+     */
+    XEN_GUEST_HANDLE_64(uint64) pc;
+    XEN_GUEST_HANDLE_64(uint64) cc;
 };
 
 struct xen_sysctl_get_pmstat {
Acked-by on v1 1/1
#1 lore raw
Quoted 2 lines · Jan Beulich

Assuming you will apply yourself once you have sufficient acks etc.

Quoted 28 lines
xen/include/public/sysctl.h +9 -2
@@ -228,8 +228,15 @@ struct pm_cx_stat {
     XEN_GUEST_HANDLE_64(uint64) residencies; /* Cx residencies */
     uint32_t nr_pc;                          /* entry nr in pc[] */
     uint32_t nr_cc;                          /* entry nr in cc[] */
-    XEN_GUEST_HANDLE_64(uint64) pc;          /* 1-biased indexing */
-    XEN_GUEST_HANDLE_64(uint64) cc;          /* 1-biased indexing */
+    /*
+     * These two arrays may (and generally will) have unused slots; slots not
+     * having a corresponding hardware register will not be written by the
+     * hypervisor. It is therefore up to the caller to put a suitable sentinel
+     * into all slots before invoking the function.
+     * Indexing is 1-biased (PC1/CC1 being at index 0).
+     */
+    XEN_GUEST_HANDLE_64(uint64) pc;
+    XEN_GUEST_HANDLE_64(uint64) cc;
 };
 
 struct xen_sysctl_get_pmstat {

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Acked-by
#2 lore raw
Quoted 6 lines · Ian Campbell
Quoted 2 lines · Jan Beulich
Quoted 14 lines

Assuming you will apply yourself once you have sufficient acks etc.

xen/include/public/sysctl.h struct pm_cx_stat { · line 232

Quoted 10 lines
xen/include/public/sysctl.h +2 -2
@@ -228,8 +228,15 @@ struct pm_cx_stat {
     XEN_GUEST_HANDLE_64(uint64) residencies; /* Cx residencies */
     uint32_t nr_pc;                          /* entry nr in pc[] */
     uint32_t nr_cc;                          /* entry nr in cc[] */
-    XEN_GUEST_HANDLE_64(uint64) pc;          /* 1-biased indexing */
-    XEN_GUEST_HANDLE_64(uint64) cc;          /* 1-biased indexing */
+    /*
+     * These two arrays may (and generally will) have unused slots;

slots not

Quoted 23 lines

xen/include/public/sysctl.h struct pm_cx_stat { · line 233

Quoted 1 line
xen/include/public/sysctl.h +1 -0
+     * having a corresponding hardware register will not be written by

the

xen/include/public/sysctl.h struct pm_cx_stat { · line 234

Quoted 1 line
xen/include/public/sysctl.h +1 -0
+     * hypervisor. It is therefore up to the caller to put a suitable

sentinel

Quoted 16 lines
xen/include/public/sysctl.h +5 -0
+     * into all slots before invoking the function.
+     * Indexing is 1-biased (PC1/CC1 being at index 0).
+     */
+    XEN_GUEST_HANDLE_64(uint64) pc;
+    XEN_GUEST_HANDLE_64(uint64) cc;
 };
 
 struct xen_sysctl_get_pmstat {

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel