[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 09/12] rtc: update rtc_cmos on CPU hot-plug
From: |
Igor Mammedov |
Subject: |
[Qemu-devel] [PATCH 09/12] rtc: update rtc_cmos on CPU hot-plug |
Date: |
Thu, 21 Mar 2013 15:28:42 +0100 |
... so that on reboot BIOS could read current available CPU count
Signed-off-by: Igor Mammedov <address@hidden>
---
hw/mc146818rtc.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c
index a2119ad..c32ab92 100644
--- a/hw/mc146818rtc.c
+++ b/hw/mc146818rtc.c
@@ -82,6 +82,7 @@ typedef struct RTCState {
Notifier clock_reset_notifier;
LostTickPolicy lost_tick_policy;
Notifier suspend_notifier;
+ Notifier cpu_added_notifier;
} RTCState;
static void rtc_set_time(RTCState *s);
@@ -759,6 +760,14 @@ static void rtc_notify_suspend(Notifier *notifier, void
*data)
rtc_set_memory(&s->dev, 0xF, 0xFE);
}
+static void rtc_notify_cpu_added(Notifier *notifier, void *data)
+{
+ RTCState *s = container_of(notifier, RTCState, cpu_added_notifier);
+
+ /* increment the number of CPUs */
+ s->cmos_data[0x5f] += 1;
+}
+
static void rtc_reset(void *opaque)
{
RTCState *s = opaque;
@@ -852,6 +861,9 @@ static int rtc_initfn(ISADevice *dev)
s->suspend_notifier.notify = rtc_notify_suspend;
qemu_register_suspend_notifier(&s->suspend_notifier);
+ s->cpu_added_notifier.notify = rtc_notify_cpu_added;
+ qemu_register_cpu_add_notifier(&s->cpu_added_notifier);
+
memory_region_init_io(&s->io, &cmos_ops, s, "rtc", 2);
isa_register_ioport(dev, &s->io, base);
--
1.7.1
- Re: [Qemu-devel] [PATCH 05/12] target-i386: push hot-plugged VCPU state to KVM and unstop it, (continued)
- Re: [Qemu-devel] [PATCH 05/12] target-i386: push hot-plugged VCPU state to KVM and unstop it, Paolo Bonzini, 2013/03/27
- Re: [Qemu-devel] [PATCH 05/12] target-i386: push hot-plugged VCPU state to KVM and unstop it, Igor Mammedov, 2013/03/27
- [Qemu-devel] [PATCH 05/14] cpu: Pass CPUState to *cpu_synchronize_post*(), Igor Mammedov, 2013/03/27
- [Qemu-devel] [PATCH 06/14] cpu: call cpu_synchronize_post_init() from CPUClass.realize() if hotplugged, Igor Mammedov, 2013/03/27
- [Qemu-devel] [PATCH 07/14] cpu: introduce CPUClass.resume() method, Igor Mammedov, 2013/03/27
[Qemu-devel] [PATCH 07/12] target-i386: Add ICC_BUS and attach apic, kvmvapic and cpu to it, Igor Mammedov, 2013/03/21
[Qemu-devel] [PATCH 09/12] rtc: update rtc_cmos on CPU hot-plug,
Igor Mammedov <=
[Qemu-devel] [PATCH 06/12] target-i386: replace FROM_SYSBUS() with QOM type cast, Igor Mammedov, 2013/03/21
[Qemu-devel] [PATCH 08/12] introduce CPU hot-plug notifier, Igor Mammedov, 2013/03/21
[Qemu-devel] [PATCH 10/12] acpi_piix4: add infrastructure to send CPU hot-plug GPE to guest, Igor Mammedov, 2013/03/21
[Qemu-devel] [PATCH 11/12] qmp: add cpu_set qmp command, Igor Mammedov, 2013/03/21