Skip to content

libkrunfw: Add virtio-rtc driver support#121

Merged
slp merged 2 commits intocontainers:mainfrom
dorindabassey:rtc
May 5, 2026
Merged

libkrunfw: Add virtio-rtc driver support#121
slp merged 2 commits intocontainers:mainfrom
dorindabassey:rtc

Conversation

@dorindabassey
Copy link
Copy Markdown

Backport virtio-rtc driver from upstream Linux kernel
to enable RTC and PTP clock support in libkrun guests.

Added 4 upstreamed patches on virtio_rtc
Enabled virtio_rtc kernel configs
This allows libkrun guests to:

  • Access host time via /dev/rtc* (RTC class driver)
  • Access PTP clocks via /dev/ptp* (for time synchronization)
  • Set alarms to wake from suspend
  • Use cross-timestamping on ARM platforms

The driver has been tested with rust-vmm vhost-device-rtc backend.

Upstream commits:

  • 0623c759276885c3ae88197ba6fb5c9c6ba8612f
  • 9a17125a18f9ae1e1233a8e2d919059445b9d6fd
  • e2ef16757bbe1d4566093179944e9ebe730b2701
  • 9d4f22fd563e0cd02e8448e84d057e7c0132a586

Upstream patch author: Peter Hilber quic_philber@quicinc.com

Dorinda Bassey added 2 commits April 29, 2026 12:39
Backport virtio-rtc driver from upstream Linux kernel
to enable RTC and PTP clock support in libkrun guests.

Added 4 upstreamed patches on virtio_rtc
Enabled virtio_rtc kernel configs
This allows libkrun guests to:
- Access host time via /dev/rtc* (RTC class driver)
- Access PTP clocks via /dev/ptp* (for time synchronization)
- Set alarms to wake from suspend
- Use cross-timestamping on ARM platforms

The driver has been tested with rust-vmm vhost-device-rtc backend.

Upstream commits:
- 0623c759276885c3ae88197ba6fb5c9c6ba8612f
- 9a17125a18f9ae1e1233a8e2d919059445b9d6fd
- e2ef16757bbe1d4566093179944e9ebe730b2701
- 9d4f22fd563e0cd02e8448e84d057e7c0132a586

Upstream patch author: Peter Hilber <quic_philber@quicinc.com>

Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
Add compatibility patch to backport virtio-rtc driver to kernel 6.12.
Fix API differences:
- Replace secs_to_jiffies(60) with msecs_to_jiffies(60 * 1000)
(secs_to_jiffies was introduced after 6.12)
- Replace devm_device_init_wakeup(dev) with device_init_wakeup(dev, true)
(devm_device_init_wakeup was introduced after 6.12)

Both changes provide equivalent functionality and allow the driver to
build cleanly on kernel 6.12.76.

Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
Copy link
Copy Markdown
Collaborator

@slp slp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@slp slp merged commit af92b67 into containers:main May 5, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants