diff --git a/dep/sddf b/dep/sddf index 3c38dab4..2cae425f 160000 --- a/dep/sddf +++ b/dep/sddf @@ -1 +1 @@ -Subproject commit 3c38dab4a295955dbbdb5e2b7836c049657ce005 +Subproject commit 2cae425f735d6dd214bdb285e89275a87625bba3 diff --git a/examples/virtio/client_vmm.c b/examples/virtio/client_vmm.c index 01225b49..ea1086a6 100644 --- a/examples/virtio/client_vmm.c +++ b/examples/virtio/client_vmm.c @@ -79,7 +79,7 @@ void init(void) blk_storage_info_t *storage_info = (blk_storage_info_t *)blk_config; /* Busy wait until blk device is ready */ - while (!__atomic_load_n(&storage_info->ready, __ATOMIC_ACQUIRE)); + while (!blk_storage_is_ready(storage_info)); /* Initialise the VMM, the VCPU(s), and start the guest */ LOG_VMM("starting \"%s\"\n", microkit_name); diff --git a/examples/virtio/include/blk_config.h b/examples/virtio/include/blk_config.h index 0c2e5ab3..bd7ec1de 100644 --- a/examples/virtio/include/blk_config.h +++ b/examples/virtio/include/blk_config.h @@ -8,6 +8,7 @@ #include #include +#include #define BLK_NUM_CLIENTS 2 diff --git a/include/libvmm/virtio/block.h b/include/libvmm/virtio/block.h index 7d22bceb..d1af38de 100644 --- a/include/libvmm/virtio/block.h +++ b/include/libvmm/virtio/block.h @@ -37,6 +37,7 @@ #include #include #include +#include /* Feature bits */ #define VIRTIO_BLK_F_SIZE_MAX 1 /* Indicates maximum segment size */ diff --git a/tools/linux/uio_drivers/blk/blk.c b/tools/linux/uio_drivers/blk/blk.c index 0db08778..b1090c00 100644 --- a/tools/linux/uio_drivers/blk/blk.c +++ b/tools/linux/uio_drivers/blk/blk.c @@ -156,7 +156,7 @@ void driver_notified() int ret = lseek(storage_fd, (off_t)req_block_number * BLK_TRANSFER_SIZE, SEEK_SET); if (ret < 0) { LOG_UIO_BLOCK_ERR("Failed to seek in storage: %s\n", strerror(errno)); - status = BLK_RESP_SEEK_ERROR; + status = BLK_RESP_ERR_UNSPEC; success_count = 0; break; } @@ -165,7 +165,7 @@ void driver_notified() LOG_UIO_BLOCK("Read from storage successfully: %d bytes\n", bytes_read); if (bytes_read < 0) { LOG_UIO_BLOCK_ERR("Failed to read from storage: %s\n", strerror(errno)); - status = BLK_RESP_SEEK_ERROR; + status = BLK_RESP_ERR_UNSPEC; success_count = 0; } else { status = BLK_RESP_OK; @@ -177,7 +177,7 @@ void driver_notified() int ret = lseek(storage_fd, (off_t)req_block_number * BLK_TRANSFER_SIZE, SEEK_SET); if (ret < 0) { LOG_UIO_BLOCK_ERR("Failed to seek in storage: %s\n", strerror(errno)); - status = BLK_RESP_SEEK_ERROR; + status = BLK_RESP_ERR_UNSPEC; success_count = 0; break; } @@ -186,7 +186,7 @@ void driver_notified() LOG_UIO_BLOCK("Wrote to storage successfully: %d bytes\n", bytes_written); if (bytes_written < 0) { LOG_UIO_BLOCK_ERR("Failed to write to storage: %s\n", strerror(errno)); - status = BLK_RESP_SEEK_ERROR; + status = BLK_RESP_ERR_UNSPEC; success_count = 0; } else { status = BLK_RESP_OK; @@ -198,7 +198,7 @@ void driver_notified() int ret = fsync(storage_fd); if (ret != 0) { LOG_UIO_BLOCK_ERR("Failed to flush storage: %s\n", strerror(errno)); - status = BLK_RESP_SEEK_ERROR; + status = BLK_RESP_ERR_UNSPEC; } else { status = BLK_RESP_OK; } @@ -208,7 +208,7 @@ void driver_notified() int ret = fsync(storage_fd); if (ret != 0) { LOG_UIO_BLOCK_ERR("Failed to flush storage: %s\n", strerror(errno)); - status = BLK_RESP_SEEK_ERROR; + status = BLK_RESP_ERR_UNSPEC; } else { status = BLK_RESP_OK; }