thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

Blame SOURCES/kvm-target-i386-kvm-Add-support-for-save-and-restore-nes.patch

b38b0f
From 0a1fd178d9b7c054d229b60540b7d12d87eb8070 Mon Sep 17 00:00:00 2001
b38b0f
From: Paolo Bonzini <pbonzini@redhat.com>
b38b0f
Date: Mon, 22 Jul 2019 18:22:15 +0100
b38b0f
Subject: [PATCH 34/39] target/i386: kvm: Add support for save and restore
b38b0f
 nested state
b38b0f
b38b0f
RH-Author: Paolo Bonzini <pbonzini@redhat.com>
b38b0f
Message-id: <20190722182220.19374-14-pbonzini@redhat.com>
b38b0f
Patchwork-id: 89629
b38b0f
O-Subject: [RHEL-8.1.0 PATCH qemu-kvm v3 13/18] target/i386: kvm: Add support for save and restore nested state
b38b0f
Bugzilla: 1689269
b38b0f
RH-Acked-by: Peter Xu <zhexu@redhat.com>
b38b0f
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
b38b0f
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
b38b0f
b38b0f
From: Liran Alon <liran.alon@oracle.com>
b38b0f
b38b0f
Kernel commit 8fcc4b5923af ("kvm: nVMX: Introduce KVM_CAP_NESTED_STATE")
b38b0f
introduced new IOCTLs to extract and restore vCPU state related to
b38b0f
Intel VMX & AMD SVM.
b38b0f
b38b0f
Utilize these IOCTLs to add support for migration of VMs which are
b38b0f
running nested hypervisors.
b38b0f
b38b0f
Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
b38b0f
Reviewed-by: Maran Wilson <maran.wilson@oracle.com>
b38b0f
Tested-by: Maran Wilson <maran.wilson@oracle.com>
b38b0f
Signed-off-by: Liran Alon <liran.alon@oracle.com>
b38b0f
Message-Id: <20190619162140.133674-9-liran.alon@oracle.com>
b38b0f
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
b38b0f
(cherry picked from commit ebbfef2f34cfc749c045a4569dedb4f748ec024a)
b38b0f
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
b38b0f
---
b38b0f
 accel/kvm/kvm-all.c   |   8 ++
b38b0f
 include/sysemu/kvm.h  |   1 +
b38b0f
 target/i386/cpu.h     |   3 +
b38b0f
 target/i386/kvm.c     |  80 ++++++++++++++++++++
b38b0f
 target/i386/machine.c | 198 ++++++++++++++++++++++++++++++++++++++++++++++++++
b38b0f
 5 files changed, 290 insertions(+)
b38b0f
b38b0f
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
b38b0f
index a939b26..2130fcb 100644
b38b0f
--- a/accel/kvm/kvm-all.c
b38b0f
+++ b/accel/kvm/kvm-all.c
b38b0f
@@ -87,6 +87,7 @@ struct KVMState
b38b0f
 #ifdef KVM_CAP_SET_GUEST_DEBUG
b38b0f
     struct kvm_sw_breakpoint_head kvm_sw_breakpoints;
b38b0f
 #endif
b38b0f
+    int max_nested_state_len;
b38b0f
     int many_ioeventfds;
b38b0f
     int intx_set_mask;
b38b0f
     bool sync_mmu;
b38b0f
@@ -1646,6 +1647,8 @@ static int kvm_init(MachineState *ms)
b38b0f
     s->debugregs = kvm_check_extension(s, KVM_CAP_DEBUGREGS);
b38b0f
 #endif
b38b0f
 
b38b0f
+    s->max_nested_state_len = kvm_check_extension(s, KVM_CAP_NESTED_STATE);
b38b0f
+
b38b0f
 #ifdef KVM_CAP_IRQ_ROUTING
b38b0f
     kvm_direct_msi_allowed = (kvm_check_extension(s, KVM_CAP_SIGNAL_MSI) > 0);
b38b0f
 #endif
b38b0f
@@ -2207,6 +2210,11 @@ int kvm_has_debugregs(void)
b38b0f
     return kvm_state->debugregs;
b38b0f
 }
b38b0f
 
b38b0f
+int kvm_max_nested_state_length(void)
b38b0f
+{
b38b0f
+    return kvm_state->max_nested_state_len;
b38b0f
+}
b38b0f
+
b38b0f
 int kvm_has_many_ioeventfds(void)
b38b0f
 {
b38b0f
     if (!kvm_enabled()) {
b38b0f
diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
b38b0f
index a5a6dff..3cf04cf 100644
b38b0f
--- a/include/sysemu/kvm.h
b38b0f
+++ b/include/sysemu/kvm.h
b38b0f
@@ -211,6 +211,7 @@ bool kvm_has_sync_mmu(void);
b38b0f
 int kvm_has_vcpu_events(void);
b38b0f
 int kvm_has_robust_singlestep(void);
b38b0f
 int kvm_has_debugregs(void);
b38b0f
+int kvm_max_nested_state_length(void);
b38b0f
 int kvm_has_pit_state2(void);
b38b0f
 int kvm_has_many_ioeventfds(void);
b38b0f
 int kvm_has_gsi_routing(void);
b38b0f
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
b38b0f
index f595fc3..86f3d98 100644
b38b0f
--- a/target/i386/cpu.h
b38b0f
+++ b/target/i386/cpu.h
b38b0f
@@ -1335,6 +1335,9 @@ typedef struct CPUX86State {
b38b0f
     int64_t tsc_khz;
b38b0f
     int64_t user_tsc_khz; /* for sanity check only */
b38b0f
     void *kvm_xsave_buf;
b38b0f
+#if defined(CONFIG_KVM)
b38b0f
+    struct kvm_nested_state *nested_state;
b38b0f
+#endif
b38b0f
 #if defined(CONFIG_HVF)
b38b0f
     HVFX86EmulatorState *hvf_emul;
b38b0f
 #endif
b38b0f
diff --git a/target/i386/kvm.c b/target/i386/kvm.c
b38b0f
index 8a6da90..ddceb7d 100644
b38b0f
--- a/target/i386/kvm.c
b38b0f
+++ b/target/i386/kvm.c
b38b0f
@@ -789,6 +789,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
b38b0f
     struct kvm_cpuid_entry2 *c;
b38b0f
     uint32_t signature[3];
b38b0f
     int kvm_base = KVM_CPUID_SIGNATURE;
b38b0f
+    int max_nested_state_len;
b38b0f
     int r;
b38b0f
     Error *local_err = NULL;
b38b0f
 
b38b0f
@@ -1180,6 +1181,24 @@ int kvm_arch_init_vcpu(CPUState *cs)
b38b0f
     if (has_xsave) {
b38b0f
         env->kvm_xsave_buf = qemu_memalign(4096, sizeof(struct kvm_xsave));
b38b0f
     }
b38b0f
+
b38b0f
+    max_nested_state_len = kvm_max_nested_state_length();
b38b0f
+    if (max_nested_state_len > 0) {
b38b0f
+        assert(max_nested_state_len >= offsetof(struct kvm_nested_state, data));
b38b0f
+        env->nested_state = g_malloc0(max_nested_state_len);
b38b0f
+
b38b0f
+        env->nested_state->size = max_nested_state_len;
b38b0f
+
b38b0f
+        if (IS_INTEL_CPU(env)) {
b38b0f
+            struct kvm_vmx_nested_state_hdr *vmx_hdr =
b38b0f
+                &env->nested_state->hdr.vmx;
b38b0f
+
b38b0f
+            env->nested_state->format = KVM_STATE_NESTED_FORMAT_VMX;
b38b0f
+            vmx_hdr->vmxon_pa = -1ull;
b38b0f
+            vmx_hdr->vmcs12_pa = -1ull;
b38b0f
+        }
b38b0f
+    }
b38b0f
+
b38b0f
     cpu->kvm_msr_buf = g_malloc0(MSR_BUF_SIZE);
b38b0f
 
b38b0f
     if (!(env->features[FEAT_8000_0001_EDX] & CPUID_EXT2_RDTSCP)) {
b38b0f
@@ -1199,12 +1218,18 @@ int kvm_arch_init_vcpu(CPUState *cs)
b38b0f
 int kvm_arch_destroy_vcpu(CPUState *cs)
b38b0f
 {
b38b0f
     X86CPU *cpu = X86_CPU(cs);
b38b0f
+    CPUX86State *env = &cpu->env;
b38b0f
 
b38b0f
     if (cpu->kvm_msr_buf) {
b38b0f
         g_free(cpu->kvm_msr_buf);
b38b0f
         cpu->kvm_msr_buf = NULL;
b38b0f
     }
b38b0f
 
b38b0f
+    if (env->nested_state) {
b38b0f
+        g_free(env->nested_state);
b38b0f
+        env->nested_state = NULL;
b38b0f
+    }
b38b0f
+
b38b0f
     return 0;
b38b0f
 }
b38b0f
 
b38b0f
@@ -2875,6 +2900,52 @@ static int kvm_get_debugregs(X86CPU *cpu)
b38b0f
     return 0;
b38b0f
 }
b38b0f
 
b38b0f
+static int kvm_put_nested_state(X86CPU *cpu)
b38b0f
+{
b38b0f
+    CPUX86State *env = &cpu->env;
b38b0f
+    int max_nested_state_len = kvm_max_nested_state_length();
b38b0f
+
b38b0f
+    if (max_nested_state_len <= 0) {
b38b0f
+        return 0;
b38b0f
+    }
b38b0f
+
b38b0f
+    assert(env->nested_state->size <= max_nested_state_len);
b38b0f
+    return kvm_vcpu_ioctl(CPU(cpu), KVM_SET_NESTED_STATE, env->nested_state);
b38b0f
+}
b38b0f
+
b38b0f
+static int kvm_get_nested_state(X86CPU *cpu)
b38b0f
+{
b38b0f
+    CPUX86State *env = &cpu->env;
b38b0f
+    int max_nested_state_len = kvm_max_nested_state_length();
b38b0f
+    int ret;
b38b0f
+
b38b0f
+    if (max_nested_state_len <= 0) {
b38b0f
+        return 0;
b38b0f
+    }
b38b0f
+
b38b0f
+    /*
b38b0f
+     * It is possible that migration restored a smaller size into
b38b0f
+     * nested_state->hdr.size than what our kernel support.
b38b0f
+     * We preserve migration origin nested_state->hdr.size for
b38b0f
+     * call to KVM_SET_NESTED_STATE but wish that our next call
b38b0f
+     * to KVM_GET_NESTED_STATE will use max size our kernel support.
b38b0f
+     */
b38b0f
+    env->nested_state->size = max_nested_state_len;
b38b0f
+
b38b0f
+    ret = kvm_vcpu_ioctl(CPU(cpu), KVM_GET_NESTED_STATE, env->nested_state);
b38b0f
+    if (ret < 0) {
b38b0f
+        return ret;
b38b0f
+    }
b38b0f
+
b38b0f
+    if (env->nested_state->flags & KVM_STATE_NESTED_GUEST_MODE) {
b38b0f
+        env->hflags |= HF_GUEST_MASK;
b38b0f
+    } else {
b38b0f
+        env->hflags &= ~HF_GUEST_MASK;
b38b0f
+    }
b38b0f
+
b38b0f
+    return ret;
b38b0f
+}
b38b0f
+
b38b0f
 int kvm_arch_put_registers(CPUState *cpu, int level)
b38b0f
 {
b38b0f
     X86CPU *x86_cpu = X86_CPU(cpu);
b38b0f
@@ -2882,6 +2953,11 @@ int kvm_arch_put_registers(CPUState *cpu, int level)
b38b0f
 
b38b0f
     assert(cpu_is_stopped(cpu) || qemu_cpu_is_self(cpu));
b38b0f
 
b38b0f
+    ret = kvm_put_nested_state(x86_cpu);
b38b0f
+    if (ret < 0) {
b38b0f
+        return ret;
b38b0f
+    }
b38b0f
+
b38b0f
     if (level >= KVM_PUT_RESET_STATE) {
b38b0f
         ret = kvm_put_msr_feature_control(x86_cpu);
b38b0f
         if (ret < 0) {
b38b0f
@@ -2997,6 +3073,10 @@ int kvm_arch_get_registers(CPUState *cs)
b38b0f
     if (ret < 0) {
b38b0f
         goto out;
b38b0f
     }
b38b0f
+    ret = kvm_get_nested_state(cpu);
b38b0f
+    if (ret < 0) {
b38b0f
+        goto out;
b38b0f
+    }
b38b0f
     ret = 0;
b38b0f
  out:
b38b0f
     cpu_sync_bndcs_hflags(&cpu->env);
b38b0f
diff --git a/target/i386/machine.c b/target/i386/machine.c
b38b0f
index 561d4a5..a2ddbba 100644
b38b0f
--- a/target/i386/machine.c
b38b0f
+++ b/target/i386/machine.c
b38b0f
@@ -230,6 +230,15 @@ static int cpu_pre_save(void *opaque)
b38b0f
         env->segs[R_SS].flags &= ~(env->segs[R_SS].flags & DESC_DPL_MASK);
b38b0f
     }
b38b0f
 
b38b0f
+#ifdef CONFIG_KVM
b38b0f
+    /* Verify we have nested virtualization state from kernel if required */
b38b0f
+    if (kvm_enabled() && cpu_has_vmx(env) && !env->nested_state) {
b38b0f
+        error_report("Guest enabled nested virtualization but kernel "
b38b0f
+                "does not support saving of nested state");
b38b0f
+        return -EINVAL;
b38b0f
+    }
b38b0f
+#endif
b38b0f
+
b38b0f
     return 0;
b38b0f
 }
b38b0f
 
b38b0f
@@ -277,6 +286,16 @@ static int cpu_post_load(void *opaque, int version_id)
b38b0f
     env->hflags &= ~HF_CPL_MASK;
b38b0f
     env->hflags |= (env->segs[R_SS].flags >> DESC_DPL_SHIFT) & HF_CPL_MASK;
b38b0f
 
b38b0f
+#ifdef CONFIG_KVM
b38b0f
+    if ((env->hflags & HF_GUEST_MASK) &&
b38b0f
+        (!env->nested_state ||
b38b0f
+        !(env->nested_state->flags & KVM_STATE_NESTED_GUEST_MODE))) {
b38b0f
+        error_report("vCPU set in guest-mode inconsistent with "
b38b0f
+                     "migrated kernel nested state");
b38b0f
+        return -EINVAL;
b38b0f
+    }
b38b0f
+#endif
b38b0f
+
b38b0f
     env->fpstt = (env->fpus_vmstate >> 11) & 7;
b38b0f
     env->fpus = env->fpus_vmstate & ~0x3800;
b38b0f
     env->fptag_vmstate ^= 0xff;
b38b0f
@@ -819,6 +838,182 @@ static const VMStateDescription vmstate_tsc_khz = {
b38b0f
     }
b38b0f
 };
b38b0f
 
b38b0f
+#ifdef CONFIG_KVM
b38b0f
+
b38b0f
+static bool vmx_vmcs12_needed(void *opaque)
b38b0f
+{
b38b0f
+    struct kvm_nested_state *nested_state = opaque;
b38b0f
+    return (nested_state->size >
b38b0f
+            offsetof(struct kvm_nested_state, data.vmx[0].vmcs12));
b38b0f
+}
b38b0f
+
b38b0f
+static const VMStateDescription vmstate_vmx_vmcs12 = {
b38b0f
+    .name = "cpu/kvm_nested_state/vmx/vmcs12",
b38b0f
+    .version_id = 1,
b38b0f
+    .minimum_version_id = 1,
b38b0f
+    .needed = vmx_vmcs12_needed,
b38b0f
+    .fields = (VMStateField[]) {
b38b0f
+        VMSTATE_UINT8_ARRAY(data.vmx[0].vmcs12,
b38b0f
+                            struct kvm_nested_state,
b38b0f
+                            KVM_STATE_NESTED_VMX_VMCS_SIZE),
b38b0f
+        VMSTATE_END_OF_LIST()
b38b0f
+    }
b38b0f
+};
b38b0f
+
b38b0f
+static bool vmx_shadow_vmcs12_needed(void *opaque)
b38b0f
+{
b38b0f
+    struct kvm_nested_state *nested_state = opaque;
b38b0f
+    return (nested_state->size >
b38b0f
+            offsetof(struct kvm_nested_state, data.vmx[0].shadow_vmcs12));
b38b0f
+}
b38b0f
+
b38b0f
+static const VMStateDescription vmstate_vmx_shadow_vmcs12 = {
b38b0f
+    .name = "cpu/kvm_nested_state/vmx/shadow_vmcs12",
b38b0f
+    .version_id = 1,
b38b0f
+    .minimum_version_id = 1,
b38b0f
+    .needed = vmx_shadow_vmcs12_needed,
b38b0f
+    .fields = (VMStateField[]) {
b38b0f
+        VMSTATE_UINT8_ARRAY(data.vmx[0].shadow_vmcs12,
b38b0f
+                            struct kvm_nested_state,
b38b0f
+                            KVM_STATE_NESTED_VMX_VMCS_SIZE),
b38b0f
+        VMSTATE_END_OF_LIST()
b38b0f
+    }
b38b0f
+};
b38b0f
+
b38b0f
+static bool vmx_nested_state_needed(void *opaque)
b38b0f
+{
b38b0f
+    struct kvm_nested_state *nested_state = opaque;
b38b0f
+
b38b0f
+    return ((nested_state->format == KVM_STATE_NESTED_FORMAT_VMX) &&
b38b0f
+            ((nested_state->hdr.vmx.vmxon_pa != -1ull) ||
b38b0f
+             (nested_state->hdr.vmx.smm.flags & KVM_STATE_NESTED_SMM_VMXON)));
b38b0f
+}
b38b0f
+
b38b0f
+static const VMStateDescription vmstate_vmx_nested_state = {
b38b0f
+    .name = "cpu/kvm_nested_state/vmx",
b38b0f
+    .version_id = 1,
b38b0f
+    .minimum_version_id = 1,
b38b0f
+    .needed = vmx_nested_state_needed,
b38b0f
+    .fields = (VMStateField[]) {
b38b0f
+        VMSTATE_U64(hdr.vmx.vmxon_pa, struct kvm_nested_state),
b38b0f
+        VMSTATE_U64(hdr.vmx.vmcs12_pa, struct kvm_nested_state),
b38b0f
+        VMSTATE_U16(hdr.vmx.smm.flags, struct kvm_nested_state),
b38b0f
+        VMSTATE_END_OF_LIST()
b38b0f
+    },
b38b0f
+    .subsections = (const VMStateDescription*[]) {
b38b0f
+        &vmstate_vmx_vmcs12,
b38b0f
+        &vmstate_vmx_shadow_vmcs12,
b38b0f
+        NULL,
b38b0f
+    }
b38b0f
+};
b38b0f
+
b38b0f
+static bool svm_nested_state_needed(void *opaque)
b38b0f
+{
b38b0f
+    struct kvm_nested_state *nested_state = opaque;
b38b0f
+
b38b0f
+    return (nested_state->format == KVM_STATE_NESTED_FORMAT_SVM);
b38b0f
+}
b38b0f
+
b38b0f
+static const VMStateDescription vmstate_svm_nested_state = {
b38b0f
+    .name = "cpu/kvm_nested_state/svm",
b38b0f
+    .version_id = 1,
b38b0f
+    .minimum_version_id = 1,
b38b0f
+    .needed = svm_nested_state_needed,
b38b0f
+    .fields = (VMStateField[]) {
b38b0f
+        VMSTATE_END_OF_LIST()
b38b0f
+    }
b38b0f
+};
b38b0f
+
b38b0f
+static bool nested_state_needed(void *opaque)
b38b0f
+{
b38b0f
+    X86CPU *cpu = opaque;
b38b0f
+    CPUX86State *env = &cpu->env;
b38b0f
+
b38b0f
+    return (env->nested_state &&
b38b0f
+            (vmx_nested_state_needed(env->nested_state) ||
b38b0f
+             svm_nested_state_needed(env->nested_state)));
b38b0f
+}
b38b0f
+
b38b0f
+static int nested_state_post_load(void *opaque, int version_id)
b38b0f
+{
b38b0f
+    X86CPU *cpu = opaque;
b38b0f
+    CPUX86State *env = &cpu->env;
b38b0f
+    struct kvm_nested_state *nested_state = env->nested_state;
b38b0f
+    int min_nested_state_len = offsetof(struct kvm_nested_state, data);
b38b0f
+    int max_nested_state_len = kvm_max_nested_state_length();
b38b0f
+
b38b0f
+    /*
b38b0f
+     * If our kernel don't support setting nested state
b38b0f
+     * and we have received nested state from migration stream,
b38b0f
+     * we need to fail migration
b38b0f
+     */
b38b0f
+    if (max_nested_state_len <= 0) {
b38b0f
+        error_report("Received nested state when kernel cannot restore it");
b38b0f
+        return -EINVAL;
b38b0f
+    }
b38b0f
+
b38b0f
+    /*
b38b0f
+     * Verify that the size of received nested_state struct
b38b0f
+     * at least cover required header and is not larger
b38b0f
+     * than the max size that our kernel support
b38b0f
+     */
b38b0f
+    if (nested_state->size < min_nested_state_len) {
b38b0f
+        error_report("Received nested state size less than min: "
b38b0f
+                     "len=%d, min=%d",
b38b0f
+                     nested_state->size, min_nested_state_len);
b38b0f
+        return -EINVAL;
b38b0f
+    }
b38b0f
+    if (nested_state->size > max_nested_state_len) {
b38b0f
+        error_report("Recieved unsupported nested state size: "
b38b0f
+                     "nested_state->size=%d, max=%d",
b38b0f
+                     nested_state->size, max_nested_state_len);
b38b0f
+        return -EINVAL;
b38b0f
+    }
b38b0f
+
b38b0f
+    /* Verify format is valid */
b38b0f
+    if ((nested_state->format != KVM_STATE_NESTED_FORMAT_VMX) &&
b38b0f
+        (nested_state->format != KVM_STATE_NESTED_FORMAT_SVM)) {
b38b0f
+        error_report("Received invalid nested state format: %d",
b38b0f
+                     nested_state->format);
b38b0f
+        return -EINVAL;
b38b0f
+    }
b38b0f
+
b38b0f
+    return 0;
b38b0f
+}
b38b0f
+
b38b0f
+static const VMStateDescription vmstate_kvm_nested_state = {
b38b0f
+    .name = "cpu/kvm_nested_state",
b38b0f
+    .version_id = 1,
b38b0f
+    .minimum_version_id = 1,
b38b0f
+    .fields = (VMStateField[]) {
b38b0f
+        VMSTATE_U16(flags, struct kvm_nested_state),
b38b0f
+        VMSTATE_U16(format, struct kvm_nested_state),
b38b0f
+        VMSTATE_U32(size, struct kvm_nested_state),
b38b0f
+        VMSTATE_END_OF_LIST()
b38b0f
+    },
b38b0f
+    .subsections = (const VMStateDescription*[]) {
b38b0f
+        &vmstate_vmx_nested_state,
b38b0f
+        &vmstate_svm_nested_state,
b38b0f
+        NULL
b38b0f
+    }
b38b0f
+};
b38b0f
+
b38b0f
+static const VMStateDescription vmstate_nested_state = {
b38b0f
+    .name = "cpu/nested_state",
b38b0f
+    .version_id = 1,
b38b0f
+    .minimum_version_id = 1,
b38b0f
+    .needed = nested_state_needed,
b38b0f
+    .post_load = nested_state_post_load,
b38b0f
+    .fields = (VMStateField[]) {
b38b0f
+        VMSTATE_STRUCT_POINTER(env.nested_state, X86CPU,
b38b0f
+                vmstate_kvm_nested_state,
b38b0f
+                struct kvm_nested_state),
b38b0f
+        VMSTATE_END_OF_LIST()
b38b0f
+    }
b38b0f
+};
b38b0f
+
b38b0f
+#endif
b38b0f
+
b38b0f
 static bool mcg_ext_ctl_needed(void *opaque)
b38b0f
 {
b38b0f
     X86CPU *cpu = opaque;
b38b0f
@@ -1080,6 +1275,9 @@ VMStateDescription vmstate_x86_cpu = {
b38b0f
 #ifndef TARGET_X86_64
b38b0f
         &vmstate_efer32,
b38b0f
 #endif
b38b0f
+#ifdef CONFIG_KVM
b38b0f
+        &vmstate_nested_state,
b38b0f
+#endif
b38b0f
         NULL
b38b0f
     }
b38b0f
 };
b38b0f
-- 
b38b0f
1.8.3.1
b38b0f