qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2 07/12] apic_common: vapic_paddr synchronization f


From: Pavel Dovgalyuk
Subject: [Qemu-devel] [PATCH v2 07/12] apic_common: vapic_paddr synchronization fix
Date: Thu, 28 Aug 2014 15:19:03 +0400
User-agent: StGit/0.16

This patch postpones vapic_paddr initialization, which is perfromed
by the migration functions. When vapic_paddr is synchronized within
the migration process, apic_common functions could operate with incorrect
apic state, if it hadn't loaded yet. This patch postpones the synchronization
until whole virtual machine state is loaded.

Signed-off-by: Pavel Dovgalyuk <address@hidden>
---
 hw/intc/apic_common.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/hw/intc/apic_common.c b/hw/intc/apic_common.c
index 2d2dfcb..c3590a6 100644
--- a/hw/intc/apic_common.c
+++ b/hw/intc/apic_common.c
@@ -91,13 +91,21 @@ void apic_enable_tpr_access_reporting(DeviceState *dev, 
bool enable)
     }
 }
 
+static void do_apic_enable_vapic(void *data)
+{
+    APICCommonState *s = APIC_COMMON(data);
+    APICCommonClass *info = APIC_COMMON_GET_CLASS(s);
+
+    info->vapic_base_update(s);
+}
+
 void apic_enable_vapic(DeviceState *dev, hwaddr paddr)
 {
     APICCommonState *s = APIC_COMMON(dev);
     APICCommonClass *info = APIC_COMMON_GET_CLASS(s);
 
     s->vapic_paddr = paddr;
-    info->vapic_base_update(s);
+    run_on_cpu(CPU(s->cpu), do_apic_enable_vapic, s);
 }
 
 void apic_handle_tpr_access_report(DeviceState *dev, target_ulong ip,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]