Project

General

Profile

Actions

Bug #14692

closed

consolidate bhyve exception injection

Added by Patrick Mooney 15 days ago. Updated 3 days ago.

Status:
Closed
Priority:
Normal
Category:
bhyve
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

The logic for injecting events (such as exceptions or software interrupts) into guests, including those which require re-injection due to conditions during VM entry, is somewhat scattered in bhyve currently. It would be nice to clean that all up so it can present a consistent interface, both to kernel consumers, and those which use the information from userspace.

Actions #1

Updated by Electric Monk 15 days ago

  • Gerrit CR set to 2152
Actions #2

Updated by Patrick Mooney 4 days ago

To test the change, I ran the normal battery of guest smoke-tests. All seemed to boot and run fine on both AMD and Intel hardware. Additionally, the bhyve-tests suite ran clean on both platforms.

Using dtrace to observe the (now-refactored) vm_entry_intinfo behavior, I could see events of #DF, #GP, and #UD when attempting various in-guest behavior to exercise those paths:

# dtrace -n 'vm_entry_intinfo:entry { self->info = args[2] } vm_entry_intinfo:return /arg1 && self->info/ { printf("%lu %p %08x", timestamp, curthread, *self->info); self->info = 0 }'
dtrace: description 'vm_entry_intinfo:entry ' matched 2 probes
CPU     ID                    FUNCTION:NAME
 11  66616          vm_entry_intinfo:return 2204471752401 fffffe59f1331420 80000b0d
 16  66616          vm_entry_intinfo:return 11056139173713 fffffe59f03e7c20 80000306
 16  66616          vm_entry_intinfo:return 11056139181357 fffffe59f03e7c20 80000b08
Actions #3

Updated by Patrick Mooney 4 days ago

I also confirmed that NMI injection via bhyvectl --inject-nmi is still functional.

Actions #4

Updated by Electric Monk 3 days ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

git commit 3d097f7d985318f4f57189c9c47f3b19f1721f89

commit  3d097f7d985318f4f57189c9c47f3b19f1721f89
Author: Patrick Mooney <pmooney@pfmooney.com>
Date:   2022-05-26T01:55:28.000Z

    14692 consolidate bhyve exception injection
    Reviewed by: Dan Cross <cross@oxidecomputer.com>
    Reviewed by: Jordan Paige Hendricks <jordan@oxidecomputer.com>
    Approved by: Gordon Ross <gordon.w.ross@gmail.com>

Actions

Also available in: Atom PDF