Skip to content

virtio-rtc: Add basic device support

Kuan-Wei Chiu qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2standard-headers: Add virtio_rtc.h from Linux 7.0-rc1include/standard-headers/linux/virtio_rtc.h+237 -00 replies
2/2virtio-rtc: Add basic virtio-rtc supportMAINTAINERS hw/virtio/Kconfig hw/virtio/meson.build +3 more+291 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] virtio-rtc: Add basic device support

This patch series introduces initial support for the virtio-rtc device (VIRTIO_ID_CLOCK), based on the OASIS virtio-rtc specification.

This implementation provides a single read-only clock that returns the host's QEMU_CLOCK_HOST time in nanoseconds. It handles the basic control and read requests necessary for the device to be successfully probed and utilized by the upstream Linux virtio_rtc driver.

I have verified this implementation using the virtio_rtc driver from the Linux mainline. The device probes successfully, and the host time can be correctly read from the guest using the following commands:

  $ cat /sys/class/rtc/rtc0/time
  $ cat /sys/class/rtc/rtc0/date
  $ hwclock -r -f /dev/rtc0

Kuan-Wei Chiu (2):
standard-headers: Add virtio_rtc.h from Linux 7.0-rc1
virtio-rtc: Add basic virtio-rtc support

 MAINTAINERS                                 |   7 +
 hw/virtio/Kconfig                           |   5 +
 hw/virtio/meson.build                       |   2 +
 hw/virtio/virtio-rtc-pci.c                  |  65 ++++++
 hw/virtio/virtio-rtc.c                      | 190 ++++++++++++++++
 include/hw/virtio/virtio-rtc.h              |  22 ++
 include/standard-headers/linux/virtio_rtc.h | 237 ++++++++++++++++++++
 7 files changed, 528 insertions(+)
 create mode 100644 hw/virtio/virtio-rtc-pci.c
 create mode 100644 hw/virtio/virtio-rtc.c
 create mode 100644 include/hw/virtio/virtio-rtc.h
 create mode 100644 include/standard-headers/linux/virtio_rtc.h
Signature · 1 line
2.53.0.473.g4a7958ca14-goog