goto out;
}
-
+ /**
+ * The tag field read may result in unaligned read.
+ * Currently, unaligned read is supported in the underlying function.
+ */
if (virtio_config_get(d->vdev,
__offsetof(struct virtio_9p_config, tag),
d->tag, tag_len, 1) < 0) {
memcpy(buf + sizeof(l), &l, sizeof(l));
break;
default:
- uk_pr_err("Not supported length(%d) for io read\n", len);
- UK_BUG();
+ _virtio_cread_bytes(base, offset, buf, len, 1);
+ uk_pr_warn("Unaligned io read: %d bytes\n", len);
}
return len;
virtio_cwrite32(base, offset + sizeof(l), l);
break;
default:
- uk_pr_err("Not supported length(%d) for io write\n", len);
- UK_BUG();
+ _virtio_cwrite_bytes(base, offset, buf, len, 1);
+ uk_pr_warn("Unaligned io write: %d bytes\n", len);
}
return 0;
* reconsider providing generic read/write function for all these
* virtio device in a separate header file which could be reused across
* different virtio devices.
+ * Currently, unaligned read is supported in the underlying function.
*/
virtio_config_get(vndev->vdev,
__offsetof(struct virtio_net_config, mac),