Remove PAGE_SIZE from public headers
v2 cover Remove PAGE_SIZE from public headers
Reference to PAGE_SIZE slipped in to two public header files. QEMU build on ARM64 is broken by this. PAGE_SIZE should not be used because it could be undefined or it could be defined differently on different operating systems.
Stefano Stabellini (2):
usbif.h: replace PAGE_SIZE with USBIF_RING_SIZE vscsiif.h: replace PAGE_SIZE with VSCSIIF_PAGE_SIZE
xen/include/public/io/usbif.h | 5 +++-- xen/include/public/io/vscsiif.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-)
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH v2 1/2 usbif.h: replace PAGE_SIZE with USBIF_RING_SIZE
Do not reference PAGE_SIZE directly: it could be undefined, or it could have different values in the frontend or in the backend.
Define USBIF_RING_SIZE as 4096, assuming all users of usbif.h have 4K page granularity. Replace PAGE_SIZE with USBIF_RING_SIZE.
--- xen/include/public/io/usbif.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
xen/include/public/io/usbif.h +3 -2
@@ -170,6 +170,7 @@ enum usb_spec_version {#define USBIF_MAX_SEGMENTS_PER_REQUEST (16)#define USBIF_MAX_PORTNR 31 +#define USBIF_RING_SIZE 4096/* * RING for transferring urbs.
@@ -226,7 +227,7 @@ struct usbif_urb_response {typedef struct usbif_urb_response usbif_urb_response_t ; DEFINE_RING_TYPES(usbif_urb, struct usbif_urb_request, struct usbif_urb_response); -#define USB_URB_RING_SIZE __CONST_RING_SIZE(usbif_urb, PAGE_SIZE) +#define USB_URB_RING_SIZE __CONST_RING_SIZE(usbif_urb, USBIF_RING_SIZE)/* * RING for notifying connect/disconnect events to frontend
@@ -248,6 +249,6 @@ struct usbif_conn_response {typedef struct usbif_conn_response usbif_conn_response_t ; DEFINE_RING_TYPES(usbif_conn, struct usbif_conn_request, struct usbif_conn_response); -#define USB_CONN_RING_SIZE __CONST_RING_SIZE(usbif_conn, PAGE_SIZE) +#define USB_CONN_RING_SIZE __CONST_RING_SIZE(usbif_conn, USBIF_RING_SIZE)#endif /* __XEN_PUBLIC_IO_USBIF_H__ */
Signature · 7 lines
1.9.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
PATCH v2 2/2 vscsiif.h: replace PAGE_SIZE with VSCSIIF_PAGE_SIZE
Do not reference PAGE_SIZE directly: it could be undefined, or it could have different values in the frontend or in the backend.
Define VSCSIIF_PAGE_SIZE as 4096, assuming all users of vscsiif.h have 4K page granularity. Replace PAGE_SIZE with VSCSIIF_PAGE_SIZE.
--- xen/include/public/io/vscsiif.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
xen/include/public/io/vscsiif.h +2 -1
@@ -248,6 +248,7 @@*/ #define VSCSIIF_MAX_COMMAND_SIZE 16#define VSCSIIF_SENSE_BUFFERSIZE 96 +#define VSCSIIF_PAGE_SIZE 4096struct scsiif_request_segment {grant_ref_t gref;
@@ -256,7 +257,7 @@ struct scsiif_request_segment { };typedef struct scsiif_request_segment vscsiif_segment_t ; -#define VSCSIIF_SG_PER_PAGE (PAGE_SIZE / sizeof(struct scsiif_request_segment)) +#define VSCSIIF_SG_PER_PAGE (VSCSIIF_PAGE_SIZE / sizeof(struct scsiif_request_segment))/* Size of one request is 252 bytes */ struct vscsiif_request {
Signature · 7 lines
1.9.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 5 lines · On 19/10/16 21:21, [email protected] wrote:
Reference to
PAGE_SIZEslipped in to two public header files. QEMU build on ARM64 is broken by this.PAGE_SIZEshould not be used because it could be undefined or it could be defined differently on different operating systems.
Quoted 8 lines
Stefano Stabellini (2):
usbif.h: replacePAGE_SIZEwithUSBIF_RING_SIZEvscsiif.h: replacePAGE_SIZEwithVSCSIIF_PAGE_SIZExen/include/public/io/usbif.h | 5 +++-- xen/include/public/io/vscsiif.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-)
In principle I'm okay with these changes. But wouldn't it be better to add
#define XEN_RING_PAGE_SIZE 4096
to xen/include/public/io/ring.h instead of having each interface file its own definition?
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 15 lines · Juergen Gross
Quoted 5 lines · On 19/10/16 21:21, [email protected] wrote:
Reference to
PAGE_SIZEslipped in to two public header files. QEMU build on ARM64 is broken by this.PAGE_SIZEshould not be used because it could be undefined or it could be defined differently on different operating systems.Quoted 8 lines
Stefano Stabellini (2):
usbif.h: replacePAGE_SIZEwithUSBIF_RING_SIZEvscsiif.h: replacePAGE_SIZEwithVSCSIIF_PAGE_SIZExen/include/public/io/usbif.h | 5 +++-- xen/include/public/io/vscsiif.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-)
Quoted 7 lines
In principle I'm okay with these changes. But wouldn't it be better to add
#define
XEN_RING_PAGE_SIZE4096to
xen/include/public/io/ring.hinstead of having each interface file its own definition?
I would prefer to avoid having to spell out the page size for all the io interfaces, because the same interfaces should work fine with other page granularities, if the grant table hypercalls supported them.
However in reality frontend and backend would have to agree on the page granularity to use beforehand. Some sort of consensus protocol is required. When that protocol is introduced, we could get rid of #define XEN_RING_PAGE_SIZE 4096.
What do people think about this?
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 26 lines · Stefano Stabellini
Quoted 14 lines · Juergen Gross
Quoted 5 lines · On 19/10/16 21:21, [email protected] wrote:
Reference to
PAGE_SIZEslipped in to two public header files. QEMU build on ARM64 is broken by this.PAGE_SIZEshould not be used because it could be undefined or it could be defined differently on different operating systems.Quoted 8 lines
Stefano Stabellini (2):
usbif.h: replacePAGE_SIZEwithUSBIF_RING_SIZEvscsiif.h: replacePAGE_SIZEwithVSCSIIF_PAGE_SIZExen/include/public/io/usbif.h | 5 +++-- xen/include/public/io/vscsiif.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-)Quoted 7 lines
In principle I'm okay with these changes. But wouldn't it be better to add
#define
XEN_RING_PAGE_SIZE4096to
xen/include/public/io/ring.hinstead of having each interface file its own definition?I would prefer to avoid having to spell out the page size for all the io interfaces, because the same interfaces should work fine with other page granularities, if the grant table hypercalls supported them.
Quoted 6 lines
However in reality frontend and backend would have to agree on the page granularity to use beforehand. Some sort of consensus protocol is required. When that protocol is introduced, we could get rid of #define
XEN_RING_PAGE_SIZE4096.What do people think about this?
Not all current rings are 4k in size, and not all future rings should be implicitly restricted to 4k.
-1 to this introducing XEN_RING_PAGE_SIZE. It will be more confusing than helpful.
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 32 lines · Andrew Cooper
Quoted 31 lines · Stefano Stabellini
Quoted 14 lines · Juergen Gross
Quoted 5 lines · On 19/10/16 21:21, [email protected] wrote:
Reference to
PAGE_SIZEslipped in to two public header files. QEMU build on ARM64 is broken by this.PAGE_SIZEshould not be used because it could be undefined or it could be defined differently on different operating systems.Quoted 8 lines
Stefano Stabellini (2):
usbif.h: replacePAGE_SIZEwithUSBIF_RING_SIZEvscsiif.h: replacePAGE_SIZEwithVSCSIIF_PAGE_SIZExen/include/public/io/usbif.h | 5 +++-- xen/include/public/io/vscsiif.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-)Quoted 7 lines
In principle I'm okay with these changes. But wouldn't it be better to add
#define
XEN_RING_PAGE_SIZE4096to
xen/include/public/io/ring.hinstead of having each interface file its own definition?I would prefer to avoid having to spell out the page size for all the io interfaces, because the same interfaces should work fine with other page granularities, if the grant table hypercalls supported them.
However in reality frontend and backend would have to agree on the page granularity to use beforehand. Some sort of consensus protocol is required. When that protocol is introduced, we could get rid of #define
XEN_RING_PAGE_SIZE4096.
Quoted 7 lines
Quoted 1 line
What do people think about this?
Not all current rings are 4k in size, and not all future rings should be implicitly restricted to 4k.
-1 to this introducing
XEN_RING_PAGE_SIZE. It will be more confusing than helpful.
Indeed, you are right. Since you are at it, feel like acking the current patches? :-)
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 33 lines · Stefano Stabellini
Quoted 32 lines · Andrew Cooper
Quoted 31 lines · Stefano Stabellini
Quoted 14 lines · Juergen Gross
Quoted 5 lines · On 19/10/16 21:21, [email protected] wrote:
Reference to
PAGE_SIZEslipped in to two public header files. QEMU build on ARM64 is broken by this.PAGE_SIZEshould not be used because it could be undefined or it could be defined differently on different operating systems.Quoted 8 lines
Stefano Stabellini (2):
usbif.h: replacePAGE_SIZEwithUSBIF_RING_SIZEvscsiif.h: replacePAGE_SIZEwithVSCSIIF_PAGE_SIZExen/include/public/io/usbif.h | 5 +++-- xen/include/public/io/vscsiif.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-)Quoted 7 lines
In principle I'm okay with these changes. But wouldn't it be better to add
#define
XEN_RING_PAGE_SIZE4096to
xen/include/public/io/ring.hinstead of having each interface file its own definition?I would prefer to avoid having to spell out the page size for all the io interfaces, because the same interfaces should work fine with other page granularities, if the grant table hypercalls supported them.
However in reality frontend and backend would have to agree on the page granularity to use beforehand. Some sort of consensus protocol is required. When that protocol is introduced, we could get rid of #define
XEN_RING_PAGE_SIZE4096.
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
What do people think about this?
Not all current rings are 4k in size, and not all future rings should be implicitly restricted to 4k.
-1 to this introducing
XEN_RING_PAGE_SIZE. It will be more confusing than helpful.Indeed, you are right. Since you are at it, feel like acking the current patches? :-)
Good point. Acked-by: Andrew Cooper <[email protected]>, although you also need a release ack at this point.
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 38 lines · Andrew Cooper
Quoted 37 lines · Stefano Stabellini
Quoted 36 lines · Andrew Cooper
Quoted 26 lines · Stefano Stabellini
Quoted 14 lines · Juergen Gross
Quoted 5 lines · On 19/10/16 21:21, [email protected] wrote:
Reference to
PAGE_SIZEslipped in to two public header files. QEMU build on ARM64 is broken by this.PAGE_SIZEshould not be used because it could be undefined or it could be defined differently on different operating systems.Quoted 8 lines
Stefano Stabellini (2):
usbif.h: replacePAGE_SIZEwithUSBIF_RING_SIZEvscsiif.h: replacePAGE_SIZEwithVSCSIIF_PAGE_SIZExen/include/public/io/usbif.h | 5 +++-- xen/include/public/io/vscsiif.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-)Quoted 7 lines
In principle I'm okay with these changes. But wouldn't it be better to add
#define
XEN_RING_PAGE_SIZE4096to
xen/include/public/io/ring.hinstead of having each interface file its own definition?I would prefer to avoid having to spell out the page size for all the io interfaces, because the same interfaces should work fine with other page granularities, if the grant table hypercalls supported them.
Quoted 6 lines
However in reality frontend and backend would have to agree on the page granularity to use beforehand. Some sort of consensus protocol is required. When that protocol is introduced, we could get rid of #define
XEN_RING_PAGE_SIZE4096.What do people think about this?
Not all current rings are 4k in size, and not all future rings should be implicitly restricted to 4k.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
-1 to this introducing
XEN_RING_PAGE_SIZE. It will be more confusing than helpful.Indeed, you are right. Since you are at it, feel like acking the current patches? :-)
Good point. Acked-by: Andrew Cooper <[email protected]>, although you also need a release ack at this point.
Wei, I also need a release ack for
http://marc.info/?l=xen-devel&m=147690490302553
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 44 lines · Stefano Stabellini
Quoted 43 lines · Andrew Cooper
Quoted 41 lines · Stefano Stabellini
Quoted 32 lines · Andrew Cooper
Quoted 31 lines · Stefano Stabellini
Quoted 14 lines · Juergen Gross
Quoted 5 lines · On 19/10/16 21:21, [email protected] wrote:
Reference to
PAGE_SIZEslipped in to two public header files. QEMU build on ARM64 is broken by this.PAGE_SIZEshould not be used because it could be undefined or it could be defined differently on different operating systems.Quoted 8 lines
Stefano Stabellini (2):
usbif.h: replacePAGE_SIZEwithUSBIF_RING_SIZEvscsiif.h: replacePAGE_SIZEwithVSCSIIF_PAGE_SIZExen/include/public/io/usbif.h | 5 +++-- xen/include/public/io/vscsiif.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-)Quoted 7 lines
In principle I'm okay with these changes. But wouldn't it be better to add
#define
XEN_RING_PAGE_SIZE4096to
xen/include/public/io/ring.hinstead of having each interface file its own definition?I would prefer to avoid having to spell out the page size for all the io interfaces, because the same interfaces should work fine with other page granularities, if the grant table hypercalls supported them.
However in reality frontend and backend would have to agree on the page granularity to use beforehand. Some sort of consensus protocol is required. When that protocol is introduced, we could get rid of #define
XEN_RING_PAGE_SIZE4096.Quoted 6 lines
Quoted 1 line
What do people think about this?
Not all current rings are 4k in size, and not all future rings should be implicitly restricted to 4k.
-1 to this introducing
XEN_RING_PAGE_SIZE. It will be more confusing than helpful.Indeed, you are right. Since you are at it, feel like acking the current patches? :-)
Quoted 6 lines
Quoted 2 lines
Good point. Acked-by: Andrew Cooper <[email protected]>, although you also need a release ack at this point.
Wei, I also need a release ack for
Presumably you want to apply that to our QEMU tree? If so:
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 48 lines · Wei Liu
Quoted 47 lines · Stefano Stabellini
Quoted 45 lines · Andrew Cooper
Quoted 33 lines · Stefano Stabellini
Quoted 32 lines · Andrew Cooper
Quoted 31 lines · Stefano Stabellini
Quoted 14 lines · Juergen Gross
Quoted 5 lines · On 19/10/16 21:21, [email protected] wrote:
Reference to
PAGE_SIZEslipped in to two public header files. QEMU build on ARM64 is broken by this.PAGE_SIZEshould not be used because it could be undefined or it could be defined differently on different operating systems.Quoted 8 lines
Stefano Stabellini (2):
usbif.h: replacePAGE_SIZEwithUSBIF_RING_SIZEvscsiif.h: replacePAGE_SIZEwithVSCSIIF_PAGE_SIZExen/include/public/io/usbif.h | 5 +++-- xen/include/public/io/vscsiif.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-)Quoted 7 lines
In principle I'm okay with these changes. But wouldn't it be better to add
#define
XEN_RING_PAGE_SIZE4096to
xen/include/public/io/ring.hinstead of having each interface file its own definition?I would prefer to avoid having to spell out the page size for all the io interfaces, because the same interfaces should work fine with other page granularities, if the grant table hypercalls supported them.
However in reality frontend and backend would have to agree on the page granularity to use beforehand. Some sort of consensus protocol is required. When that protocol is introduced, we could get rid of #define
XEN_RING_PAGE_SIZE4096.Quoted 8 lines
Quoted 6 lines
Quoted 1 line
What do people think about this?
Not all current rings are 4k in size, and not all future rings should be implicitly restricted to 4k.
-1 to this introducing
XEN_RING_PAGE_SIZE. It will be more confusing than helpful.Indeed, you are right. Since you are at it, feel like acking the current patches? :-)
Good point. Acked-by: Andrew Cooper <[email protected]>, although you also need a release ack at this point.
Quoted 7 lines
Quoted 3 lines
Wei, I also need a release ack for
Presumably you want to apply that to our QEMU tree? If so:
Release-acked-by Wei Liu <[email protected]>
I sent a pull request to qemu with the patch and applied it to staging.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Wei Liu
Acked-byQuoted 38 lines · Andrew Cooper
Quoted 37 lines · Stefano Stabellini
Quoted 36 lines · Andrew Cooper
Quoted 26 lines · Stefano Stabellini
Quoted 14 lines · Juergen Gross
Quoted 5 lines · On 19/10/16 21:21, [email protected] wrote:
Reference to
PAGE_SIZEslipped in to two public header files. QEMU build on ARM64 is broken by this.PAGE_SIZEshould not be used because it could be undefined or it could be defined differently on different operating systems.Quoted 8 lines
Stefano Stabellini (2):
usbif.h: replacePAGE_SIZEwithUSBIF_RING_SIZEvscsiif.h: replacePAGE_SIZEwithVSCSIIF_PAGE_SIZExen/include/public/io/usbif.h | 5 +++-- xen/include/public/io/vscsiif.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-)Quoted 7 lines
In principle I'm okay with these changes. But wouldn't it be better to add
#define
XEN_RING_PAGE_SIZE4096to
xen/include/public/io/ring.hinstead of having each interface file its own definition?I would prefer to avoid having to spell out the page size for all the io interfaces, because the same interfaces should work fine with other page granularities, if the grant table hypercalls supported them.
Quoted 6 lines
However in reality frontend and backend would have to agree on the page granularity to use beforehand. Some sort of consensus protocol is required. When that protocol is introduced, we could get rid of #define
XEN_RING_PAGE_SIZE4096.What do people think about this?
Not all current rings are 4k in size, and not all future rings should be implicitly restricted to 4k.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
-1 to this introducing
XEN_RING_PAGE_SIZE. It will be more confusing than helpful.Indeed, you are right. Since you are at it, feel like acking the current patches? :-)
Good point. Acked-by: Andrew Cooper <[email protected]>, although you also need a release ack at this point.
And applied.
Quoted 1 line
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 44 lines · Wei Liu
Quoted 43 lines · Andrew Cooper
Quoted 41 lines · Stefano Stabellini
Quoted 32 lines · Andrew Cooper
Quoted 31 lines · Stefano Stabellini
Quoted 14 lines · Juergen Gross
Quoted 5 lines · On 19/10/16 21:21, [email protected] wrote:
Reference to
PAGE_SIZEslipped in to two public header files. QEMU build on ARM64 is broken by this.PAGE_SIZEshould not be used because it could be undefined or it could be defined differently on different operating systems.Quoted 8 lines
Stefano Stabellini (2):
usbif.h: replacePAGE_SIZEwithUSBIF_RING_SIZEvscsiif.h: replacePAGE_SIZEwithVSCSIIF_PAGE_SIZExen/include/public/io/usbif.h | 5 +++-- xen/include/public/io/vscsiif.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-)Quoted 7 lines
In principle I'm okay with these changes. But wouldn't it be better to add
#define
XEN_RING_PAGE_SIZE4096to
xen/include/public/io/ring.hinstead of having each interface file its own definition?I would prefer to avoid having to spell out the page size for all the io interfaces, because the same interfaces should work fine with other page granularities, if the grant table hypercalls supported them.
However in reality frontend and backend would have to agree on the page granularity to use beforehand. Some sort of consensus protocol is required. When that protocol is introduced, we could get rid of #define
XEN_RING_PAGE_SIZE4096.Quoted 6 lines
Quoted 1 line
What do people think about this?
Not all current rings are 4k in size, and not all future rings should be implicitly restricted to 4k.
-1 to this introducing
XEN_RING_PAGE_SIZE. It will be more confusing than helpful.Indeed, you are right. Since you are at it, feel like acking the current patches? :-)
Quoted 8 lines
Quoted 3 lines
Good point. Acked-by: Andrew Cooper <[email protected]>, although you also need a release ack at this point.
Acked-by Wei Liu <[email protected]>Release-acked-by Wei Liu <[email protected]>And applied.
Thanks. Please backport to stable trees.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel