Commit dc7d5004 authored by Jack Morgenstein's avatar Jack Morgenstein Committed by David S. Miller

net/mlx4_core: Fix struct mlx4_vhcr_cmd to make implicit padding explicit

Struct mlx4_vhcr was implicitly padded by the gcc compiler on 64-bit
architectures.

This commit makes that padding explicit, to prevent issues with
changing compilers and with incompatibilities between 32-bit architecture
implicit padding and 64-bit architecture implicit padding.

This structure is used in virtualization for communication between
the Host and its Guests. The explicit padding allows 64-bit Hosts
(old and new) to continue to interoperate with 64-bit Guests (old and new).

However, without this fix, 64-bit Hosts could not interoperate with 32-bit
Guests (since these did not insert the padding dword). With this fix,
32-bit Guests will be able to interoperate with 64-bit Hosts (since
the structure offsets will be identical on both).
Reported-by: default avatarAlexander Schmidt <alexs@linux.vnet.ibm.com>
Signed-off-by: default avatarJack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: default avatarAmir Vadai <amirv@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 30a5da5b
...@@ -196,6 +196,7 @@ struct mlx4_vhcr { ...@@ -196,6 +196,7 @@ struct mlx4_vhcr {
struct mlx4_vhcr_cmd { struct mlx4_vhcr_cmd {
__be64 in_param; __be64 in_param;
__be32 in_modifier; __be32 in_modifier;
u32 reserved1;
__be64 out_param; __be64 out_param;
__be16 token; __be16 token;
u16 reserved; u16 reserved;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment