• Jason Wang's avatar
    vhost: switch to use new message format · 429711ae
    Jason Wang authored
    We use to have message like:
    
    struct vhost_msg {
    	int type;
    	union {
    		struct vhost_iotlb_msg iotlb;
    		__u8 padding[64];
    	};
    };
    
    Unfortunately, there will be a hole of 32bit in 64bit machine because
    of the alignment. This leads a different formats between 32bit API and
    64bit API. What's more it will break 32bit program running on 64bit
    machine.
    
    So fixing this by introducing a new message type with an explicit
    32bit reserved field after type like:
    
    struct vhost_msg_v2 {
    	__u32 type;
    	__u32 reserved;
    	union {
    		struct vhost_iotlb_msg iotlb;
    		__u8 padding[64];
    	};
    };
    
    We will have a consistent ABI after switching to use this. To enable
    this capability, introduce a new ioctl (VHOST_SET_BAKCEND_FEATURE) for
    userspace to enable this feature (VHOST_BACKEND_F_IOTLB_V2).
    
    Fixes: 6b1e6cc7 ("vhost: new device IOTLB API")
    Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    429711ae
Name
Last commit
Last update
..
acpi Loading commit data...
asm-generic Loading commit data...
clocksource Loading commit data...
crypto Loading commit data...
drm Loading commit data...
dt-bindings Loading commit data...
keys Loading commit data...
kvm Loading commit data...
linux Loading commit data...
math-emu Loading commit data...
media Loading commit data...
memory Loading commit data...
misc Loading commit data...
net Loading commit data...
pcmcia Loading commit data...
ras Loading commit data...
rdma Loading commit data...
scsi Loading commit data...
soc Loading commit data...
sound Loading commit data...
target Loading commit data...
trace Loading commit data...
uapi Loading commit data...
video Loading commit data...
xen Loading commit data...