Skip to contentSkip to conversation

io/ring.h: drop unused and broken *_RING_ATTACH() macros

PATCH In review Jan Beulich 2 participants 2 messages Jun 11, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 io/ring.h: drop unused and broken *_RING_ATTACH() macros

Initializing r*_prod_pvt and r*_cons from independent shared ring fields is broken, as other macros in this header rely on them being coupled. Furthermore using the backend variant would also imply a security vulnerability.

xen/include/public/io/ring.h +0 -15
@@ -174,21 +174,6 @@ typedef struct __name##_back_ring __name
     (_r)->sring = (_s);                                                 \
 } while (0)
 
-/* Initialize to existing shared indexes -- for recovery */
-#define FRONT_RING_ATTACH(_r, _s, __size) do {                          \
-    (_r)->sring = (_s);                                                 \
-    (_r)->req_prod_pvt = (_s)->req_prod;                                \
-    (_r)->rsp_cons = (_s)->rsp_prod;                                    \
-    (_r)->nr_ents = __RING_SIZE(_s, __size);                            \
-} while (0)
-
-#define BACK_RING_ATTACH(_r, _s, __size) do {                           \
-    (_r)->sring = (_s);                                                 \
-    (_r)->rsp_prod_pvt = (_s)->rsp_prod;                                \
-    (_r)->req_cons = (_s)->req_prod;                                    \
-    (_r)->nr_ents = __RING_SIZE(_s, __size);                            \
-} while (0)
-
 /* How big is this ring? */
 #define RING_SIZE(_r)                                                   \
     ((_r)->nr_ents)

io/ring.h: drop unused and broken *_RING_ATTACH() macros

Initializing r*_prod_pvt and r*_cons from independent shared ring fields is broken, as other macros in this header rely on them being coupled. Furthermore using the backend variant would also imply a security vulnerability.

xen/include/public/io/ring.h +0 -15
@@ -174,21 +174,6 @@ typedef struct __name##_back_ring __name
     (_r)->sring = (_s);                                                 \
 } while (0)
 
-/* Initialize to existing shared indexes -- for recovery */
-#define FRONT_RING_ATTACH(_r, _s, __size) do {                          \
-    (_r)->sring = (_s);                                                 \
-    (_r)->req_prod_pvt = (_s)->req_prod;                                \
-    (_r)->rsp_cons = (_s)->rsp_prod;                                    \
-    (_r)->nr_ents = __RING_SIZE(_s, __size);                            \
-} while (0)
-
-#define BACK_RING_ATTACH(_r, _s, __size) do {                           \
-    (_r)->sring = (_s);                                                 \
-    (_r)->rsp_prod_pvt = (_s)->rsp_prod;                                \
-    (_r)->req_cons = (_s)->req_prod;                                    \
-    (_r)->nr_ents = __RING_SIZE(_s, __size);                            \
-} while (0)
-
 /* How big is this ring? */
 #define RING_SIZE(_r)                                                   \
     ((_r)->nr_ents)

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

Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Jan Beulich

Initializing r*_prod_pvt and r*_cons from independent shared ring fields is broken, as other macros in this header rely on them being coupled. Furthermore using the backend variant would also imply a security vulnerability.

Quoted 31 lines
xen/include/public/io/ring.h +0 -15
@@ -174,21 +174,6 @@ typedef struct __name##_back_ring __name
     (_r)->sring = (_s);                                                 \
 } while (0)
 
-/* Initialize to existing shared indexes -- for recovery */
-#define FRONT_RING_ATTACH(_r, _s, __size) do {                          \
-    (_r)->sring = (_s);                                                 \
-    (_r)->req_prod_pvt = (_s)->req_prod;                                \
-    (_r)->rsp_cons = (_s)->rsp_prod;                                    \
-    (_r)->nr_ents = __RING_SIZE(_s, __size);                            \
-} while (0)
-
-#define BACK_RING_ATTACH(_r, _s, __size) do {                           \
-    (_r)->sring = (_s);                                                 \
-    (_r)->rsp_prod_pvt = (_s)->rsp_prod;                                \
-    (_r)->req_cons = (_s)->req_prod;                                    \
-    (_r)->nr_ents = __RING_SIZE(_s, __size);                            \
-} while (0)
-
 /* How big is this ring? */
 #define RING_SIZE(_r)                                                   \
     ((_r)->nr_ents)

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