|
From: | Paolo Bonzini |
Subject: | Re: [Qemu-devel] [PULL 20/25] target/i386: kvm: Add support for save and restore nested state |
Date: | Fri, 21 Jun 2019 14:45:28 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 |
On 21/06/19 14:29, Liran Alon wrote: >> + max_nested_state_len = kvm_max_nested_state_length(); >> + if (max_nested_state_len > 0) { >> + assert(max_nested_state_len >= offsetof(struct kvm_nested_state, >> data)); >> + env->nested_state = g_malloc0(max_nested_state_len); >> + >> + env->nested_state->size = max_nested_state_len; >> + >> + if (IS_INTEL_CPU(env)) { > I think it’s better to change this to: “if (cpu_has_vmx(env))” { > >> + struct kvm_vmx_nested_state_hdr *vmx_hdr = >> + &env->nested_state->hdr.vmx; >> + >> + env->nested_state->format = KVM_STATE_NESTED_FORMAT_VMX; >> + vmx_hdr->vmxon_pa = -1ull; >> + vmx_hdr->vmcs12_pa = -1ull; >> + } >> + } > I think we should add here: > } else if (cpu_has_svm(env)) { > env->nested_state->format = KVM_STATE_NESTED_FORMAT_SVM; > } Or even force max_nested_state_len to 0 for AMD hosts, so that kvm_get/put_nested_state are dropped completely. Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |