Skip to contentSkip to conversation

hpet: check no_hpet when adding fw_cfg entry.

PATCH In review Gerd Hoffmann 2 participants 2 messages Sep 6, 2010 – Sep 13, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hpet: check no_hpet when adding fw_cfg entry.

We should only pass the hpet config entry in case we actually create a hpet device.

---
 hw/pc.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
hw/pc.c +4 -2
index 0c31db1..c96f1fc 100644
@@ -517,8 +517,10 @@ static void *bochs_bios_init(void)
     fw_cfg_add_bytes(fw_cfg, FW_CFG_E820_TABLE, (uint8_t *)&e820_table,
                      sizeof(struct e820_table));
 
-    fw_cfg_add_bytes(fw_cfg, FW_CFG_HPET, (uint8_t *)&hpet_cfg,
-                     sizeof(struct hpet_fw_config));
+    if (!no_hpet) {
+        fw_cfg_add_bytes(fw_cfg, FW_CFG_HPET, (uint8_t *)&hpet_cfg,
+                         sizeof(struct hpet_fw_config));
+    }
     /* allocate memory for the NUMA channel: one (64bit) word for the number
      * of nodes, one word for each VCPU->node and one word for each node to
      * hold the amount of memory.
Signature · 1 line
1.7.1
#1 lore raw
Quoted 3 lines · Gerd Hoffmann

We should only pass the hpet config entry in case we actually create a hpet device.

No we should pass it always. If no hpets are present hpet_cfg will have appropriate info.

Quoted 25 lines
---
 hw/pc.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
hw/pc.c +4 -2
index 0c31db1..c96f1fc 100644
@@ -517,8 +517,10 @@ static void *bochs_bios_init(void)
     fw_cfg_add_bytes(fw_cfg, FW_CFG_E820_TABLE, (uint8_t *)&e820_table,
                      sizeof(struct e820_table));
 
-    fw_cfg_add_bytes(fw_cfg, FW_CFG_HPET, (uint8_t *)&hpet_cfg,
-                     sizeof(struct hpet_fw_config));
+    if (!no_hpet) {
+        fw_cfg_add_bytes(fw_cfg, FW_CFG_HPET, (uint8_t *)&hpet_cfg,
+                         sizeof(struct hpet_fw_config));
+    }
     /* allocate memory for the NUMA channel: one (64bit) word for the number
      * of nodes, one word for each VCPU->node and one word for each node to
      * hold the amount of memory.
Signature · 1 line
1.7.1

--
Gleb.