public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@bugzilla.kernel.org
To: kvm@vger.kernel.org
Subject: [Bug 207177] New: KVM nested VMM direct MTF event injection fails
Date: Thu, 09 Apr 2020 18:33:45 +0000	[thread overview]
Message-ID: <bug-207177-28872@https.bugzilla.kernel.org/> (raw)

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

            Bug ID: 207177
           Summary: KVM nested VMM direct MTF event injection fails
           Product: Virtualization
           Version: unspecified
    Kernel Version: 5.5.11
          Hardware: x86-64
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: kvm
          Assignee: virtualization_kvm@kernel-bugs.osdl.org
          Reporter: dpreed@deepplum.com
        Regression: No

I'm writing a specialized VMM and debugging it under KVM (that is, a KVM
guest).
Both L0 host and its guest are running Fedora 31 kernel 5.5.11-200, FYI.

The VMM creates a VMCS and vmlaunch's it. If bit 27 of primary processor
controls is set, the first VMEXIT is indeed Exit Reason 37 (monitor trap
fault), as would be expected. No problem here.

However, in the Intel SDM volume 3C, Chapter 26.6.2,  there is another
documented way to *inject* a "one-time" MTF exit. To wit, "If the interruption
type in the VM-entry interruption-information field is 7 (other event) and the
vector field is 0, VM entry cases an MTF VM exit to be pending on the
instruction boundary following VM entry. See section 25.5.2 for the treatment
of pending MTF exits."

So repeat the experiment, but with the VMCS having bit 27 of the primary
processor controls clear, but with the entry interruption information field set
to 0x80000700, per the manual.
No VMEXIT happens, though other VMEXITS subsequent do happen. In other words,
the "injection method" fails.

I have tried the same identical binary on the same system as the guest Fedora
31, running on bare metal on the same hardware. The behavior is precisely as
documented in the Intel SDM section above.

So clearly the nested KVM mechanics do not properly handle the injection of an
MTF via the VM-entry interruption information field.

This is a useful feature, so I hope the bug will be fixed, allowing me to debug
my code under KVM.
Thanks.

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

             reply	other threads:[~2020-04-09 18:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-09 18:33 bugzilla-daemon [this message]
2020-06-10 18:54 ` [Bug 207177] KVM nested VMM direct MTF event injection fails 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-207177-28872@https.bugzilla.kernel.org/ \
    --to=bugzilla-daemon@bugzilla.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