search for: vring_desc_align_size

Displaying 20 results from an estimated 42 matches for "vring_desc_align_size".

2020 Apr 20
2
[PATCH v3] virtio: force spec specified alignment on types
...d of the used ring. Guest should ignore the used->flags field. */ #define VIRTIO_RING_F_EVENT_IDX 29 +/* Alignment requirements for vring elements. + * When using pre-virtio 1.0 layout, these fall out naturally. + */ +#define VRING_AVAIL_ALIGN_SIZE 2 +#define VRING_USED_ALIGN_SIZE 4 +#define VRING_DESC_ALIGN_SIZE 16 + /* Virtio ring descriptors: 16 bytes. These can chain together via "next". */ struct vring_desc { /* Address (guest-physical). */ @@ -112,29 +119,43 @@ struct vring_used_elem { __virtio32 len; }; +typedef struct vring_used_elem __aligned(VRING_USED_ALIGN_SIZE) + vring_used_...
2020 Apr 20
2
[PATCH v3] virtio: force spec specified alignment on types
...d of the used ring. Guest should ignore the used->flags field. */ #define VIRTIO_RING_F_EVENT_IDX 29 +/* Alignment requirements for vring elements. + * When using pre-virtio 1.0 layout, these fall out naturally. + */ +#define VRING_AVAIL_ALIGN_SIZE 2 +#define VRING_USED_ALIGN_SIZE 4 +#define VRING_DESC_ALIGN_SIZE 16 + /* Virtio ring descriptors: 16 bytes. These can chain together via "next". */ struct vring_desc { /* Address (guest-physical). */ @@ -112,29 +119,43 @@ struct vring_used_elem { __virtio32 len; }; +typedef struct vring_used_elem __aligned(VRING_USED_ALIGN_SIZE) + vring_used_...
2020 Apr 22
2
[PATCH v4] virtio: force spec specified alignment on types
...d of the used ring. Guest should ignore the used->flags field. */ #define VIRTIO_RING_F_EVENT_IDX 29 +/* Alignment requirements for vring elements. + * When using pre-virtio 1.0 layout, these fall out naturally. + */ +#define VRING_AVAIL_ALIGN_SIZE 2 +#define VRING_USED_ALIGN_SIZE 4 +#define VRING_DESC_ALIGN_SIZE 16 + /* Virtio ring descriptors: 16 bytes. These can chain together via "next". */ struct vring_desc { /* Address (guest-physical). */ @@ -112,29 +119,46 @@ struct vring_used_elem { __virtio32 len; }; +typedef struct vring_used_elem __attribute__((aligned(VRING_USED_ALIGN_SIZE))...
2020 Apr 22
2
[PATCH v4] virtio: force spec specified alignment on types
...d of the used ring. Guest should ignore the used->flags field. */ #define VIRTIO_RING_F_EVENT_IDX 29 +/* Alignment requirements for vring elements. + * When using pre-virtio 1.0 layout, these fall out naturally. + */ +#define VRING_AVAIL_ALIGN_SIZE 2 +#define VRING_USED_ALIGN_SIZE 4 +#define VRING_DESC_ALIGN_SIZE 16 + /* Virtio ring descriptors: 16 bytes. These can chain together via "next". */ struct vring_desc { /* Address (guest-physical). */ @@ -112,29 +119,46 @@ struct vring_used_elem { __virtio32 len; }; +typedef struct vring_used_elem __attribute__((aligned(VRING_USED_ALIGN_SIZE))...
2020 Apr 22
0
[vhost:vhost 27/32] ./usr/include/linux/virtio_ring.h:126:2: error: unknown type name 'vring_used_elem_t'
...~~~~~~ >> ./usr/include/linux/virtio_ring.h:126:2: error: unknown type name 'vring_used_elem_t' vring_used_elem_t ring[]; ^~~~~~~~~~~~~~~~~ ./usr/include/linux/virtio_ring.h:92:31: error: expected declaration specifiers or '...' before numeric constant #define VRING_DESC_ALIGN_SIZE 16 ^ ./usr/include/linux/virtio_ring.h:143:37: note: in expansion of macro 'VRING_DESC_ALIGN_SIZE' typedef struct vring_desc __aligned(VRING_DESC_ALIGN_SIZE) vring_desc_t; ^~~~~~~~~~~~~~~~~~~~~ ./usr/include...
2020 Apr 21
0
[PATCH v3] virtio: force spec specified alignment on types
...e used->flags field. */ > #define VIRTIO_RING_F_EVENT_IDX 29 > > +/* Alignment requirements for vring elements. > + * When using pre-virtio 1.0 layout, these fall out naturally. > + */ > +#define VRING_AVAIL_ALIGN_SIZE 2 > +#define VRING_USED_ALIGN_SIZE 4 > +#define VRING_DESC_ALIGN_SIZE 16 > + > /* Virtio ring descriptors: 16 bytes. These can chain together via "next". */ > struct vring_desc { > /* Address (guest-physical). */ > @@ -112,29 +119,43 @@ struct vring_used_elem { > __virtio32 len; > }; > > +typedef struct vring_used_...
2020 Apr 23
0
[PATCH v4] virtio: force spec specified alignment on types
...e used->flags field. */ > #define VIRTIO_RING_F_EVENT_IDX 29 > > +/* Alignment requirements for vring elements. > + * When using pre-virtio 1.0 layout, these fall out naturally. > + */ > +#define VRING_AVAIL_ALIGN_SIZE 2 > +#define VRING_USED_ALIGN_SIZE 4 > +#define VRING_DESC_ALIGN_SIZE 16 > + > /* Virtio ring descriptors: 16 bytes. These can chain together via "next". */ > struct vring_desc { > /* Address (guest-physical). */ > @@ -112,29 +119,46 @@ struct vring_used_elem { > __virtio32 len; > }; > > +typedef struct vring_used_...
2020 Apr 17
0
[PATCH v9] virtio: force spec specified alignment on types
...d int num; - - struct vring_desc *desc; - - struct vring_avail *avail; - - struct vring_used *used; -}; - /* Alignment requirements for vring elements. * When using pre-virtio 1.0 layout, these fall out naturally. */ @@ -135,6 +125,34 @@ struct vring { #define VRING_USED_ALIGN_SIZE 4 #define VRING_DESC_ALIGN_SIZE 16 +/* + * The ring element addresses are passed between components with different + * alignments assumptions. Thus, we might need to decrease the compiler-selected + * alignment, and so must use a typedef to make sure the __aligned attribute + * actually takes hold: + * + * https://gcc.gnu.org/o...
2018 Dec 07
1
[RFC 2/3] virtio_ring: add VIRTIO_RING_NO_LEGACY
...te: > Introduce VIRTIO_RING_NO_LEGACY to support disabling legacy > macros and layout definitions. > > Suggested-by: Michael S. Tsirkin <mst at redhat.com> > Signed-off-by: Tiwei Bie <tiwei.bie at intel.com> > --- > VRING_AVAIL_ALIGN_SIZE, VRING_USED_ALIGN_SIZE and VRING_DESC_ALIGN_SIZE > are not pre-virtio 1.0, but can also be disabled by VIRTIO_RING_NO_LEGACY > in this patch, because their names are not consistent with other names. > Not sure whether this is a good idea. If we want this, we may also want > to define _SPLIT_ version for them. I don't think it'...
2020 Apr 06
2
[PATCH] vhost: force spec specified alignment on types
...nment; in order to decrease it, the packed attribute must + * be specified as well. When used as part of a typedef, the aligned attribute + * can both increase and decrease alignment, and specifying the packed + * attribute generates a warning. + */ +typedef struct vring_desc __attribute__((aligned(VRING_DESC_ALIGN_SIZE))) + vring_desc_t; +typedef struct vring_avail __attribute__((aligned(VRING_AVAIL_ALIGN_SIZE))) + vring_avail_t; +typedef struct vring_used __attribute__((aligned(VRING_USED_ALIGN_SIZE))) + vring_used_t; + +struct vring { + unsigned int num; + + vring_desc_t *desc; + + vring_avail_t *avail; + + vri...
2020 Apr 06
2
[PATCH] vhost: force spec specified alignment on types
...nment; in order to decrease it, the packed attribute must + * be specified as well. When used as part of a typedef, the aligned attribute + * can both increase and decrease alignment, and specifying the packed + * attribute generates a warning. + */ +typedef struct vring_desc __attribute__((aligned(VRING_DESC_ALIGN_SIZE))) + vring_desc_t; +typedef struct vring_avail __attribute__((aligned(VRING_AVAIL_ALIGN_SIZE))) + vring_avail_t; +typedef struct vring_used __attribute__((aligned(VRING_USED_ALIGN_SIZE))) + vring_used_t; + +struct vring { + unsigned int num; + + vring_desc_t *desc; + + vring_avail_t *avail; + + vri...
2020 Apr 20
0
[PATCH v2] virtio: force spec specified alignment on types
...d int num; - - struct vring_desc *desc; - - struct vring_avail *avail; - - struct vring_used *used; -}; - /* Alignment requirements for vring elements. * When using pre-virtio 1.0 layout, these fall out naturally. */ @@ -135,6 +125,34 @@ struct vring { #define VRING_USED_ALIGN_SIZE 4 #define VRING_DESC_ALIGN_SIZE 16 +/* + * The ring element addresses are passed between components with different + * alignments assumptions. Thus, we might need to decrease the compiler-selected + * alignment, and so must use a typedef to make sure the __aligned attribute + * actually takes hold: + * + * https://gcc.gnu.org/o...
2020 Apr 06
2
[PATCH] vhost: force spec specified alignment on types
...te must > > + * be specified as well. When used as part of a typedef, the aligned attribute > > + * can both increase and decrease alignment, and specifying the packed > > + * attribute generates a warning. > > + */ > > +typedef struct vring_desc __attribute__((aligned(VRING_DESC_ALIGN_SIZE))) > > + vring_desc_t; > > +typedef struct vring_avail __attribute__((aligned(VRING_AVAIL_ALIGN_SIZE))) > > + vring_avail_t; > > +typedef struct vring_used __attribute__((aligned(VRING_USED_ALIGN_SIZE))) > > + vring_used_t; > > + > > +struct vring { > &g...
2020 Apr 06
2
[PATCH] vhost: force spec specified alignment on types
...te must > > + * be specified as well. When used as part of a typedef, the aligned attribute > > + * can both increase and decrease alignment, and specifying the packed > > + * attribute generates a warning. > > + */ > > +typedef struct vring_desc __attribute__((aligned(VRING_DESC_ALIGN_SIZE))) > > + vring_desc_t; > > +typedef struct vring_avail __attribute__((aligned(VRING_AVAIL_ALIGN_SIZE))) > > + vring_avail_t; > > +typedef struct vring_used __attribute__((aligned(VRING_USED_ALIGN_SIZE))) > > + vring_used_t; > > + > > +struct vring { > &g...
2018 Dec 07
0
[RFC 2/3] virtio_ring: add VIRTIO_RING_NO_LEGACY
Introduce VIRTIO_RING_NO_LEGACY to support disabling legacy macros and layout definitions. Suggested-by: Michael S. Tsirkin <mst at redhat.com> Signed-off-by: Tiwei Bie <tiwei.bie at intel.com> --- VRING_AVAIL_ALIGN_SIZE, VRING_USED_ALIGN_SIZE and VRING_DESC_ALIGN_SIZE are not pre-virtio 1.0, but can also be disabled by VIRTIO_RING_NO_LEGACY in this patch, because their names are not consistent with other names. Not sure whether this is a good idea. If we want this, we may also want to define _SPLIT_ version for them. include/uapi/linux/virtio_ring.h | 4 ++++...
2019 Sep 11
0
[PATCH v2] virtio: add VIRTIO_RING_NO_LEGACY
..._used *used; > }; > > +#endif /* VIRTIO_RING_NO_LEGACY */ > + > /* Alignment requirements for vring elements. > * When using pre-virtio 1.0 layout, these fall out naturally. > */ > @@ -135,6 +139,8 @@ struct vring { > #define VRING_USED_ALIGN_SIZE 4 > #define VRING_DESC_ALIGN_SIZE 16 > > +#ifndef VIRTIO_RING_NO_LEGACY > + > /* The standard layout for the ring is a continuous chunk of memory which looks > * like this. We assume num is a power of 2. > * > @@ -195,6 +201,8 @@ static inline int vring_need_event(__u16 event_idx, __u16 new_idx, __u16 o...
2019 Sep 11
0
[PATCH v2] virtio: add VIRTIO_RING_NO_LEGACY
..._used *used; > }; > > +#endif /* VIRTIO_RING_NO_LEGACY */ > + > /* Alignment requirements for vring elements. > * When using pre-virtio 1.0 layout, these fall out naturally. > */ > @@ -135,6 +139,8 @@ struct vring { > #define VRING_USED_ALIGN_SIZE 4 > #define VRING_DESC_ALIGN_SIZE 16 > > +#ifndef VIRTIO_RING_NO_LEGACY > + > /* The standard layout for the ring is a continuous chunk of memory which looks > * like this. We assume num is a power of 2. > * > @@ -195,6 +201,8 @@ static inline int vring_need_event(__u16 event_idx, __u16 new_idx, __u16 o...
2020 Apr 06
0
[PATCH v4 04/12] virtio: add VIRTIO_RING_NO_LEGACY
...ci_common.h" /* diff --git a/include/uapi/linux/virtio_ring.h b/include/uapi/linux/virtio_ring.h index 559f42e73315..9223c3a5c46a 100644 --- a/include/uapi/linux/virtio_ring.h +++ b/include/uapi/linux/virtio_ring.h @@ -135,6 +135,8 @@ struct vring { #define VRING_USED_ALIGN_SIZE 4 #define VRING_DESC_ALIGN_SIZE 16 +#ifndef VIRTIO_RING_NO_LEGACY + /* The standard layout for the ring is a continuous chunk of memory which looks * like this. We assume num is a power of 2. * @@ -181,6 +183,8 @@ static inline unsigned vring_size(unsigned int num, unsigned long align) + sizeof(__virtio16) * 3 + sizeof...
2020 Apr 06
0
[PATCH v4 06/12] vhost: force spec specified alignment on types
...ease the alignment; in order to decrease it, the packed attribute must + * be specified as well. When used as part of a typedef, the aligned attribute + * can both increase and decrease alignment, and specifying the packed + * attribute generates a warning. + */ +typedef struct vring_desc __aligned(VRING_DESC_ALIGN_SIZE) vring_desc_t; +typedef struct vring_avail __aligned(VRING_AVAIL_ALIGN_SIZE) vring_avail_t; +typedef struct vring_used __aligned(VRING_USED_ALIGN_SIZE) vring_used_t; + struct vring { unsigned int num; - struct vring_desc *desc; + vring_desc_t *desc; - struct vring_avail *avail; + vring_avail...
2020 Apr 06
0
[PATCH v5 04/12] virtio: add VIRTIO_RING_NO_LEGACY
...ci_common.h" /* diff --git a/include/uapi/linux/virtio_ring.h b/include/uapi/linux/virtio_ring.h index 559f42e73315..9223c3a5c46a 100644 --- a/include/uapi/linux/virtio_ring.h +++ b/include/uapi/linux/virtio_ring.h @@ -135,6 +135,8 @@ struct vring { #define VRING_USED_ALIGN_SIZE 4 #define VRING_DESC_ALIGN_SIZE 16 +#ifndef VIRTIO_RING_NO_LEGACY + /* The standard layout for the ring is a continuous chunk of memory which looks * like this. We assume num is a power of 2. * @@ -181,6 +183,8 @@ static inline unsigned vring_size(unsigned int num, unsigned long align) + sizeof(__virtio16) * 3 + sizeof...