aboutsummaryrefslogtreecommitdiff
path: root/target/i386/hvf/hvf.c
diff options
context:
space:
mode:
authorRoman Bolshakov <r.bolshakov@yadro.com>2020-05-28 22:37:57 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2020-06-12 11:20:09 -0400
commitfe76b09c5b600310639af7ec614fb1303c773e5f (patch)
tree4e6c5f3cc2640eb00042d20d44bbb5187f209c63 /target/i386/hvf/hvf.c
parent577f02b89049c4a466973ae2785c6928e00798c8 (diff)
i386: hvf: Move mmio_buf into CPUX86State
There's no similar field in CPUX86State, but it's needed for MMIO traps. Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com> Message-Id: <20200528193758.51454-13-r.bolshakov@yadro.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'target/i386/hvf/hvf.c')
-rw-r--r--target/i386/hvf/hvf.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c
index 4cee496d71..57696c46c7 100644
--- a/target/i386/hvf/hvf.c
+++ b/target/i386/hvf/hvf.c
@@ -533,7 +533,11 @@ void hvf_reset_vcpu(CPUState *cpu) {
void hvf_vcpu_destroy(CPUState *cpu)
{
+ X86CPU *x86_cpu = X86_CPU(cpu);
+ CPUX86State *env = &x86_cpu->env;
+
hv_return_t ret = hv_vcpu_destroy((hv_vcpuid_t)cpu->hvf_fd);
+ g_free(env->hvf_mmio_buf);
assert_hvf_ok(ret);
}
@@ -563,6 +567,7 @@ int hvf_init_vcpu(CPUState *cpu)
init_decoder();
hvf_state->hvf_caps = g_new0(struct hvf_vcpu_caps, 1);
+ env->hvf_mmio_buf = g_new(char, 4096);
env->hvf_emul = g_new0(HVFX86EmulatorState, 1);
r = hv_vcpu_create((hv_vcpuid_t *)&cpu->hvf_fd, HV_VCPU_DEFAULT);