public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@kernel.org
To: kvm@vger.kernel.org
Subject: [Bug 216045] KVM x2APIC virtualization causes EOI to be ignored
Date: Sun, 29 May 2022 04:48:13 +0000	[thread overview]
Message-ID: <bug-216045-28872-VvH7MyoVHg@https.bugzilla.kernel.org/> (raw)
In-Reply-To: <bug-216045-28872@https.bugzilla.kernel.org/>

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

--- Comment #1 from Eric Li (ercli@ucdavis.edu) ---
Explanation of guest behavior

1. BIOS boots XMHF
2. XMHF starts GRUB as a nested guest
3. GRUB by default boots Debian (5 seconds timeout)
4. Debian executes 0xffffffff81062179 (can set a hardware breakpoint using
GDB). At this instruction is a WRMSR to 0x80b (IA32_X2APIC_EOI)
5. The WRMSR instruction above will VMEXIT to hypervisor mode (XMHF). The
VMEXIT entry point is 0x10206411 (xmhf_parteventhub_arch_x86vmx_entry)
6. At 0x10206434, the hypervisor calls 0x10207eb9
xmhf_parteventhub_arch_x86vmx_intercept_handler()
7. At 0x10208390, the hypervisor calls 0x10206d9f _vmx_handle_intercept_wrmsr()
8. At 0x102070c6, the hypervisor performs WRMSR to 0x80b. The intention is to
forward EOI from the guest (Debian) to KVM. Before WRMSR, "info lapic" in QEMU
gives

...
ISR      48
IRR      48

9. After WRMSR, RIP lands at 0x102070c8. "info lapic" in QEMU gives

...
ISR      48
IRR      48

However, I am expecting it to give

...
ISR      (none)
IRR      48

10. After a lot of instructions, the nested Debian guest halts. "info lapic" is

...
ISR      236
IRR      48 236 253

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

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

      reply	other threads:[~2022-05-29  4:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-29  4:26 [Bug 216045] New: KVM x2APIC virtualization causes EOI to be ignored bugzilla-daemon
2022-05-29  4:48 ` bugzilla-daemon [this message]

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-216045-28872-VvH7MyoVHg@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox