• M
    virtio: core support for config generation · d71de9ec
    Michael S. Tsirkin 提交于
    virtio 1.0 spec says:
    
    Drivers MUST NOT assume reads from fields greater than 32 bits wide are
    atomic, nor are reads from multiple fields: drivers SHOULD read device
    configuration space fields like so:
    	u32 before, after;
    	do {
    		before = get_config_generation(device);
    		// read config entry/entries.
    		after = get_config_generation(device);
    	} while (after != before);
    
    Do exactly this, for transports that support it.
    Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
    d71de9ec
virtio_config.h 11.5 KB