[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] i386/kvm: Do not sync nested state during runti
From: |
Liran Alon |
Subject: |
Re: [Qemu-devel] [PATCH] i386/kvm: Do not sync nested state during runtime |
Date: |
Mon, 22 Jul 2019 12:44:42 +0300 |
> On 22 Jul 2019, at 7:00, Jan Kiszka <address@hidden> wrote:
>
> Writing the nested state e.g. after a vmport access can invalidate
> important parts of the kernel-internal state, and it is not needed as
> well. So leave this out from KVM_PUT_RUNTIME_STATE.
>
> Suggested-by: Paolo Bonzini <address@hidden>
> Signed-off-by: Jan Kiszka <address@hidden>
As QEMU never modifies vCPU nested-state in userspace besides in vmload and
vCPU creation,
shouldn’t this be under KVM_PUT_FULL_STATE? Same as the call to
kvm_arch_set_tsc_khz().
-Liran
> ---
> target/i386/kvm.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/target/i386/kvm.c b/target/i386/kvm.c
> index ec7870c6af..da98b2cbca 100644
> --- a/target/i386/kvm.c
> +++ b/target/i386/kvm.c
> @@ -3577,12 +3577,12 @@ int kvm_arch_put_registers(CPUState *cpu, int level)
>
> assert(cpu_is_stopped(cpu) || qemu_cpu_is_self(cpu));
>
> - ret = kvm_put_nested_state(x86_cpu);
> - if (ret < 0) {
> - return ret;
> - }
> -
> if (level >= KVM_PUT_RESET_STATE) {
> + ret = kvm_put_nested_state(x86_cpu);
> + if (ret < 0) {
> + return ret;
> + }
> +
> ret = kvm_put_msr_feature_control(x86_cpu);
> if (ret < 0) {
> return ret;
> --
> 2.16.4