[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 0baa4b: KVM: fix CPU reset wrt HF2_GIF_MASK

From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 0baa4b: KVM: fix CPU reset wrt HF2_GIF_MASK
Date: Fri, 24 Jul 2020 08:15:38 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 0baa4b445e28f37243e5dc72e7efe32f0c9d7801
  Author: Vitaly Kuznetsov <vkuznets@redhat.com>
  Date:   2020-07-23 (Thu, 23 Jul 2020)

  Changed paths:
    M target/i386/kvm.c

  Log Message:
  KVM: fix CPU reset wrt HF2_GIF_MASK

HF2_GIF_MASK is set in env->hflags2 unconditionally on CPU reset
(see x86_cpu_reset()) but when calling KVM_SET_NESTED_STATE,
KVM_STATE_NESTED_GIF_SET is only valid for nSVM as e.g. nVMX code
looks like

if (kvm_state->hdr.vmx.vmxon_pa == -1ull) {
    if (kvm_state->flags & ~KVM_STATE_NESTED_EVMCS)
        return -EINVAL;

Also, when adjusting the environment after KVM_GET_NESTED_STATE we
need not reset HF2_GIF_MASK on VMX as e.g. x86_cpu_pending_interrupt()
expects it to be set.

Alternatively, we could've made env->hflags2 SVM-only.

Reported-by: Jan Kiszka <jan.kiszka@siemens.com>
Fixes: b16c0e20c742 ("KVM: add support for AMD nested live migration")
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Message-Id: <20200723142701.2521161-1-vkuznets@redhat.com>
Tested-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

  Commit: 7adfbea8fd1efce36019a0c2f198ca73be9d3f18
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2020-07-24 (Fri, 24 Jul 2020)

  Changed paths:
    M target/i386/kvm.c

  Log Message:
  Merge remote-tracking branch 
'remotes/ehabkost/tags/x86-next-for-5.1-pull-request' into staging

x86 bug fix for -rc2

A fix from Vitaly Kuznetsov for a CPU reset bug
reported by Jan Kiszka.

# gpg: Signature made Thu 23 Jul 2020 20:10:40 BST
# gpg:                using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6
# gpg:                issuer "ehabkost@redhat.com"
# gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full]
# Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6

* remotes/ehabkost/tags/x86-next-for-5.1-pull-request:
  KVM: fix CPU reset wrt HF2_GIF_MASK

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Compare: https://github.com/qemu/qemu/compare/09e0cd773723...7adfbea8fd1e

reply via email to

[Prev in Thread] Current Thread [Next in Thread]