diff mbox

[v5,4/4] target-i386: abort migration if LMCE config mismatch

Message ID 20160622065624.25291-5-haozhong.zhang@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Haozhong Zhang June 22, 2016, 6:56 a.m. UTC
... to avoid guest errors due to LMCE configurations changes when
migrating from LMCE-enabled QEMU to LMCE-disabled QEMU.

Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
---
 target-i386/machine.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Eduardo Habkost July 7, 2016, 5:10 p.m. UTC | #1
On Wed, Jun 22, 2016 at 02:56:24PM +0800, Haozhong Zhang wrote:
> ... to avoid guest errors due to LMCE configurations changes when
> migrating from LMCE-enabled QEMU to LMCE-disabled QEMU.
> 
> Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>

Paolo doesn't like this change, so I won't apply it.

(Personally, I believe it is nice to have, but not very important.)
Haozhong Zhang July 8, 2016, 2:41 a.m. UTC | #2
On 07/07/16 14:10, Eduardo Habkost wrote:
> On Wed, Jun 22, 2016 at 02:56:24PM +0800, Haozhong Zhang wrote:
> > ... to avoid guest errors due to LMCE configurations changes when
> > migrating from LMCE-enabled QEMU to LMCE-disabled QEMU.
> > 
> > Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
> 
> Paolo doesn't like this change, so I won't apply it.
> 
> (Personally, I believe it is nice to have, but not very important.)
> 

I'm okey with this. Thanks!

Haozhong
diff mbox

Patch

diff --git a/target-i386/machine.c b/target-i386/machine.c
index 71c0e4d..00375a3 100644
--- a/target-i386/machine.c
+++ b/target-i386/machine.c
@@ -347,6 +347,12 @@  static int cpu_post_load(void *opaque, int version_id)
         return -EINVAL;
     }
 
+    if (!cpu->enable_lmce && (env->mcg_cap & MCG_LMCE_P)) {
+        error_report("Config mismatch: VCPU has LMCE enabled, "
+                     "but \"lmce\" option is disabled");
+        return -EINVAL;
+    }
+
     /*
      * Real mode guest segments register DPL should be zero.
      * Older KVM version were setting it wrongly.