Lines Matching full:vdev
180 uint64_t (*get_features)(VirtIODevice *vdev,
183 uint64_t (*bad_features)(VirtIODevice *vdev);
184 void (*set_features)(VirtIODevice *vdev, uint64_t val);
185 int (*validate_features)(VirtIODevice *vdev);
186 void (*get_config)(VirtIODevice *vdev, uint8_t *config);
187 void (*set_config)(VirtIODevice *vdev, const uint8_t *config);
188 void (*reset)(VirtIODevice *vdev);
189 void (*set_status)(VirtIODevice *vdev, uint8_t val);
191 void (*queue_reset)(VirtIODevice *vdev, uint32_t queue_index);
193 void (*queue_enable)(VirtIODevice *vdev, uint32_t queue_index);
204 bool (*guest_notifier_pending)(VirtIODevice *vdev, int n);
210 void (*guest_notifier_mask)(VirtIODevice *vdev, int n, bool mask);
211 int (*start_ioeventfd)(VirtIODevice *vdev);
212 void (*stop_ioeventfd)(VirtIODevice *vdev);
214 int (*pre_load_queues)(VirtIODevice *vdev);
218 void (*save)(VirtIODevice *vdev, QEMUFile *f);
219 int (*load)(VirtIODevice *vdev, QEMUFile *f, int version_id);
225 int (*post_load)(VirtIODevice *vdev);
228 /* May be called even when vdev->vhost_started is false */
229 struct vhost_dev *(*get_vhost)(VirtIODevice *vdev);
230 void (*toggle_device_iotlb)(VirtIODevice *vdev);
238 * @vdev: pointer to VirtIODevice
242 void virtio_init(VirtIODevice *vdev, uint16_t device_id, size_t config_size);
244 void virtio_cleanup(VirtIODevice *vdev);
246 void virtio_error(VirtIODevice *vdev, const char *fmt, ...) G_GNUC_PRINTF(2, 3);
249 void virtio_device_set_child_bus_name(VirtIODevice *vdev, char *bus_name);
253 VirtQueue *virtio_add_queue(VirtIODevice *vdev, int queue_size,
256 void virtio_del_queue(VirtIODevice *vdev, int n);
271 void virtqueue_map(VirtIODevice *vdev, VirtQueueElement *elem);
274 void *qemu_get_virtqueue_element(VirtIODevice *vdev, QEMUFile *f, size_t sz);
275 void qemu_put_virtqueue_element(VirtIODevice *vdev, QEMUFile *f,
287 void virtio_notify_irqfd(VirtIODevice *vdev, VirtQueue *vq);
288 void virtio_notify(VirtIODevice *vdev, VirtQueue *vq);
290 int virtio_save(VirtIODevice *vdev, QEMUFile *f);
301 int virtio_load(VirtIODevice *vdev, QEMUFile *f, int version_id);
305 * @vdev: the virtio device
310 void virtio_notify_config(VirtIODevice *vdev);
332 uint32_t virtio_config_readb(VirtIODevice *vdev, uint32_t addr);
333 uint32_t virtio_config_readw(VirtIODevice *vdev, uint32_t addr);
334 uint32_t virtio_config_readl(VirtIODevice *vdev, uint32_t addr);
335 void virtio_config_writeb(VirtIODevice *vdev, uint32_t addr, uint32_t data);
336 void virtio_config_writew(VirtIODevice *vdev, uint32_t addr, uint32_t data);
337 void virtio_config_writel(VirtIODevice *vdev, uint32_t addr, uint32_t data);
338 uint32_t virtio_config_modern_readb(VirtIODevice *vdev, uint32_t addr);
339 uint32_t virtio_config_modern_readw(VirtIODevice *vdev, uint32_t addr);
340 uint32_t virtio_config_modern_readl(VirtIODevice *vdev, uint32_t addr);
341 void virtio_config_modern_writeb(VirtIODevice *vdev,
343 void virtio_config_modern_writew(VirtIODevice *vdev,
345 void virtio_config_modern_writel(VirtIODevice *vdev,
347 void virtio_queue_set_addr(VirtIODevice *vdev, int n, hwaddr addr);
348 hwaddr virtio_queue_get_addr(VirtIODevice *vdev, int n);
349 void virtio_queue_set_num(VirtIODevice *vdev, int n, int num);
350 int virtio_queue_get_num(VirtIODevice *vdev, int n);
351 int virtio_queue_get_max_num(VirtIODevice *vdev, int n);
352 int virtio_get_num_queues(VirtIODevice *vdev);
353 void virtio_queue_set_rings(VirtIODevice *vdev, int n, hwaddr desc,
355 void virtio_queue_update_rings(VirtIODevice *vdev, int n);
356 void virtio_init_region_cache(VirtIODevice *vdev, int n);
357 void virtio_queue_set_align(VirtIODevice *vdev, int n, int align);
358 void virtio_queue_notify(VirtIODevice *vdev, int n);
359 uint16_t virtio_queue_vector(VirtIODevice *vdev, int n);
360 void virtio_queue_set_vector(VirtIODevice *vdev, int n, uint16_t vector);
361 int virtio_queue_set_host_notifier_mr(VirtIODevice *vdev, int n,
363 int virtio_set_status(VirtIODevice *vdev, uint8_t val);
365 void virtio_queue_reset(VirtIODevice *vdev, uint32_t queue_index);
366 void virtio_queue_enable(VirtIODevice *vdev, uint32_t queue_index);
367 void virtio_update_irq(VirtIODevice *vdev);
368 int virtio_set_features(VirtIODevice *vdev, uint64_t val);
396 hwaddr virtio_queue_get_desc_addr(VirtIODevice *vdev, int n);
397 bool virtio_queue_enabled_legacy(VirtIODevice *vdev, int n);
398 bool virtio_queue_enabled(VirtIODevice *vdev, int n);
399 hwaddr virtio_queue_get_avail_addr(VirtIODevice *vdev, int n);
400 hwaddr virtio_queue_get_used_addr(VirtIODevice *vdev, int n);
401 hwaddr virtio_queue_get_desc_size(VirtIODevice *vdev, int n);
402 hwaddr virtio_queue_get_avail_size(VirtIODevice *vdev, int n);
403 hwaddr virtio_queue_get_used_size(VirtIODevice *vdev, int n);
404 unsigned int virtio_queue_get_last_avail_idx(VirtIODevice *vdev, int n);
405 void virtio_queue_set_last_avail_idx(VirtIODevice *vdev, int n,
407 void virtio_queue_restore_last_avail_idx(VirtIODevice *vdev, int n);
408 void virtio_queue_invalidate_signalled_used(VirtIODevice *vdev, int n);
409 void virtio_queue_update_used_idx(VirtIODevice *vdev, int n);
410 VirtQueue *virtio_get_queue(VirtIODevice *vdev, int n);
415 int virtio_device_start_ioeventfd(VirtIODevice *vdev);
416 int virtio_device_grab_ioeventfd(VirtIODevice *vdev);
417 void virtio_device_release_ioeventfd(VirtIODevice *vdev);
418 bool virtio_device_ioeventfd_enabled(VirtIODevice *vdev);
425 VirtQueue *virtio_vector_first_queue(VirtIODevice *vdev, uint16_t vector);
427 EventNotifier *virtio_config_get_guest_notifier(VirtIODevice *vdev);
428 void virtio_config_set_guest_notifier_fd_handler(VirtIODevice *vdev,
449 static inline bool virtio_vdev_has_feature(const VirtIODevice *vdev, in virtio_vdev_has_feature() argument
452 return virtio_has_feature(vdev->guest_features, fbit); in virtio_vdev_has_feature()
455 static inline bool virtio_host_has_feature(VirtIODevice *vdev, in virtio_host_has_feature() argument
458 return virtio_has_feature(vdev->host_features, fbit); in virtio_host_has_feature()
461 static inline bool virtio_is_big_endian(VirtIODevice *vdev) in virtio_is_big_endian() argument
463 if (!virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) { in virtio_is_big_endian()
464 assert(vdev->device_endian != VIRTIO_DEVICE_ENDIAN_UNKNOWN); in virtio_is_big_endian()
465 return vdev->device_endian == VIRTIO_DEVICE_ENDIAN_BIG; in virtio_is_big_endian()
473 * @vdev - the VirtIO device
477 * tracked via the @vdev->started field (to support migration),
481 static inline bool virtio_device_started(VirtIODevice *vdev, uint8_t status) in virtio_device_started() argument
483 if (vdev->use_started) { in virtio_device_started()
484 return vdev->started; in virtio_device_started()
492 * @vdev - the VirtIO device
495 * This is similar to virtio_device_started() but ignores vdev->started
499 static inline bool virtio_device_should_start(VirtIODevice *vdev, uint8_t status) in virtio_device_should_start() argument
501 if (!vdev->vm_running) { in virtio_device_should_start()
508 static inline void virtio_set_started(VirtIODevice *vdev, bool started) in virtio_set_started() argument
511 vdev->start_on_kick = false; in virtio_set_started()
514 if (vdev->use_started) { in virtio_set_started()
515 vdev->started = started; in virtio_set_started()
519 static inline void virtio_set_disabled(VirtIODevice *vdev, bool disable) in virtio_set_disabled() argument
521 if (vdev->use_disabled_flag) { in virtio_set_disabled()
522 vdev->disabled = disable; in virtio_set_disabled()
526 static inline bool virtio_device_disabled(VirtIODevice *vdev) in virtio_device_disabled() argument
528 return unlikely(vdev->disabled || vdev->broken); in virtio_device_disabled()
531 bool virtio_legacy_allowed(VirtIODevice *vdev);
532 bool virtio_legacy_check_disabled(VirtIODevice *vdev);