Skip to content

Commit d811bce

Browse files
sstabellinijgross1
authored andcommitted
pvcalls-front: 64-bit align flags
We are using test_and_* operations on the status and flag fields of struct sock_mapping. However, these functions require the operand to be 64-bit aligned on arm64. Currently, only status is 64-bit aligned. Make status and flags explicitly 64-bit aligned. Signed-off-by: Stefano Stabellini <stefano@aporeto.com> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Signed-off-by: Juergen Gross <jgross@suse.com>
1 parent 47b02f4 commit d811bce

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

drivers/xen/pvcalls-front.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,25 @@ struct sock_mapping {
7373
wait_queue_head_t inflight_conn_req;
7474
} active;
7575
struct {
76-
/* Socket status */
76+
/*
77+
* Socket status, needs to be 64-bit aligned due to the
78+
* test_and_* functions which have this requirement on arm64.
79+
*/
7780
#define PVCALLS_STATUS_UNINITALIZED 0
7881
#define PVCALLS_STATUS_BIND 1
7982
#define PVCALLS_STATUS_LISTEN 2
80-
uint8_t status;
83+
uint8_t status __attribute__((aligned(8)));
8184
/*
8285
* Internal state-machine flags.
8386
* Only one accept operation can be inflight for a socket.
8487
* Only one poll operation can be inflight for a given socket.
88+
* flags needs to be 64-bit aligned due to the test_and_*
89+
* functions which have this requirement on arm64.
8590
*/
8691
#define PVCALLS_FLAG_ACCEPT_INFLIGHT 0
8792
#define PVCALLS_FLAG_POLL_INFLIGHT 1
8893
#define PVCALLS_FLAG_POLL_RET 2
89-
uint8_t flags;
94+
uint8_t flags __attribute__((aligned(8)));
9095
uint32_t inflight_req_id;
9196
struct sock_mapping *accept_map;
9297
wait_queue_head_t inflight_accept_req;

0 commit comments

Comments
 (0)