i386: enable rust hpet for pc when rust is enabled
authorZhao Liu <zhao1.liu@intel.com>
Mon, 10 Feb 2025 03:00:51 +0000 (11:00 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 13 Feb 2025 11:51:34 +0000 (12:51 +0100)
Add HPET configuration in PC's Kconfig options, and select HPET device
(Rust version) if Rust is supported.

Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Link: https://lore.kernel.org/r/20250210030051.2562726-11-zhao1.liu@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
configs/devices/i386-softmmu/default.mak
hw/i386/pc.c
hw/timer/Kconfig
rust/hw/Kconfig
rust/hw/timer/Kconfig [new file with mode: 0644]
tests/qtest/meson.build

index 4faf2f0315e25214029d2602cb393e862317f360..9ef343cace06c934230e9c696719aaddc542744f 100644 (file)
@@ -6,6 +6,7 @@
 #CONFIG_APPLESMC=n
 #CONFIG_FDC=n
 #CONFIG_HPET=n
+#CONFIG_X_HPET_RUST=n
 #CONFIG_HYPERV=n
 #CONFIG_ISA_DEBUG=n
 #CONFIG_ISA_IPMI_BT=n
index 0eb52d315bb77ad3a9f990d392e4e2daacdffac1..22641e6ddca565bef76c3401c4020b6ea2529ffd 100644 (file)
@@ -1701,7 +1701,7 @@ static void pc_machine_initfn(Object *obj)
     pcms->sata_enabled = true;
     pcms->i8042_enabled = true;
     pcms->max_fw_size = 8 * MiB;
-#ifdef CONFIG_HPET
+#if defined(CONFIG_HPET) || defined(CONFIG_X_HPET_RUST)
     pcms->hpet_enabled = true;
 #endif
     pcms->fd_bootchk = true;
index c96fd5d97ae829f4bdd6fff1d00ca3f04de2a8ed..9ac0084534084ebd29db59d6439248d96335010d 100644 (file)
@@ -11,7 +11,7 @@ config A9_GTIMER
 
 config HPET
     bool
-    default y if PC
+    default y if PC && !HAVE_RUST
 
 config I8254
     bool
index 4d934f30afe13ddff418db8ec9e8b8eb25a9e8d0..36f92ec02874bf4a79c2fd78334c247e831e927b 100644 (file)
@@ -1,2 +1,3 @@
 # devices Kconfig
 source char/Kconfig
+source timer/Kconfig
diff --git a/rust/hw/timer/Kconfig b/rust/hw/timer/Kconfig
new file mode 100644 (file)
index 0000000..afd9803
--- /dev/null
@@ -0,0 +1,2 @@
+config X_HPET_RUST
+    bool
index 68316dbdc1a603dd2e50522ca604846e90d7ce46..8a6243382a189b8ef7573d3f6670df77f535e85a 100644 (file)
@@ -103,7 +103,8 @@ qtests_i386 = \
    config_all_devices.has_key('CONFIG_VIRTIO_PCI') and                                      \
    slirp.found() ? ['virtio-net-failover'] : []) +                                          \
   (unpack_edk2_blobs and                                                                    \
-   config_all_devices.has_key('CONFIG_HPET') and                                            \
+   (config_all_devices.has_key('CONFIG_HPET') or                                            \
+    config_all_devices.has_key('CONFIG_X_HPET_RUST')) and                                   \
    config_all_devices.has_key('CONFIG_PARALLEL') ? ['bios-tables-test'] : []) +             \
   qtests_pci +                                                                              \
   qtests_cxl +                                                                              \