All of lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@kernel.org
To: kvm@vger.kernel.org
Subject: [Bug 215964] nVMX: KVM(L0) does not perform a platform reboot when guest(L2) trigger a reboot event through IO-Port-0xCF9
Date: Thu, 12 May 2022 14:06:17 +0000	[thread overview]
Message-ID: <bug-215964-28872-hTIOr72Rhq@https.bugzilla.kernel.org/> (raw)
In-Reply-To: <bug-215964-28872@https.bugzilla.kernel.org/>

https://bugzilla.kernel.org/show_bug.cgi?id=215964

--- Comment #5 from Sean Christopherson (seanjc@google.com) ---
Definitely sounds like a QEMU bug.  Jim pointed out that you might have an
older version of QEMU, which seems likely given the fix went into v5.1.0 and
lack of clearing HF_GUEST_MASK would result in the behavior you're seeing.

Can you try running v5.1.0 or later?  Specifically, something with this commit.

commit b16c0e20c74218f2d69710cedad11da7dd4d2190
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Wed May 20 10:49:22 2020 -0400

    KVM: add support for AMD nested live migration

    Support for nested guest live migration is part of Linux 5.8, add the
    corresponding code to QEMU.  The migration format consists of a few
    flags, is an opaque 4k blob.

    The blob is in VMCB format (the control area represents the L1 VMCB
    control fields, the save area represents the pre-vmentry state; KVM does
    not use the host save area since the AMD manual allows that) but QEMU
    does not really care about that.  However, the flags need to be
    copied to hflags/hflags2 and back.

    In addition, support for retrieving and setting the AMD nested
virtualization
    states allows the L1 guest to be reset while running a nested guest, but
    a small bug in CPU reset needs to be fixed for that to work.

    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index e46ab8f774..008fd93ff1 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -5968,6 +5968,7 @@ static void x86_cpu_reset(DeviceState *dev)
     /* init to reset state */

     env->hflags2 |= HF2_GIF_MASK;
+    env->hflags &= ~HF_GUEST_MASK;

     cpu_x86_update_cr0(env, 0x60000010);
     env->a20_mask = ~0x0;

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

  parent reply	other threads:[~2022-05-12 14:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-10  2:45 [Bug 215964] New: nVMX: KVM(L0) does not perform a platform reboot when guest(L2) trigger a reboot event through IO-Port-0xCF9 bugzilla-daemon
2022-05-10 16:01 ` [Bug 215964] " bugzilla-daemon
2022-05-11  2:29 ` bugzilla-daemon
2022-05-11 13:55 ` bugzilla-daemon
2022-05-12  1:36 ` bugzilla-daemon
2022-05-12 14:06 ` bugzilla-daemon [this message]
2022-05-13  1:50 ` bugzilla-daemon
2023-01-26 10:03 ` bugzilla-daemon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-215964-28872-hTIOr72Rhq@https.bugzilla.kernel.org/ \
    --to=bugzilla-daemon@kernel.org \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.