diff options
author | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2016-12-07 21:08:56 +0000 |
---|---|---|
committer | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2016-12-07 21:08:56 +0000 |
commit | eb6b3daa99358fa3f236597719f4089e8a616a18 (patch) | |
tree | df6a1221e7441de0824c97a85b3d8717a660f47b | |
parent | b2fbb3205e50953afaa679f78005bc0b01927f9c (diff) |
Add required padding to the response descriptor
Xen source code relies on the compiler to pad members of the structure
representing the descriptor layout in memory; we're however trying to
be more defensive and define packed structures.
Figured out the hard way with reyk@.
-rw-r--r-- | sys/dev/pv/xbf.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/pv/xbf.c b/sys/dev/pv/xbf.c index b3d9e5c83a0..6a8c22c0b7b 100644 --- a/sys/dev/pv/xbf.c +++ b/sys/dev/pv/xbf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xbf.c,v 1.4 2016/12/07 21:06:55 mikeb Exp $ */ +/* $OpenBSD: xbf.c,v 1.5 2016/12/07 21:08:55 mikeb Exp $ */ /* * Copyright (c) 2016 Mike Belopuhov @@ -98,7 +98,11 @@ struct xbf_ireq { struct xbf_rsp { uint64_t rsp_id; uint8_t rsp_op; + uint8_t rsp_pad1; int16_t rsp_status; +#ifdef __amd64__ + uint32_t rsp_pad2; +#endif } __packed; union xbf_ring_desc { |