Project

General

Profile

Bug #13259

SVM event injection can race in bhyve

Added by Patrick Mooney about 1 month ago. Updated 5 days ago.

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

100%

Estimated time:
Difficulty:
Medium
Tags:
bhyve
Gerrit CR:

Description

In upstream (FreeBSD) bhyve, SVM event injection is done with the global interrupt flag (GIF) disabled, effectively blocking all interrupts while that work is performed. Since illumos-bhyve uses adaptive mutexes for data structures, rather than spinlocks, that injection logic was moved outside the section where the GIF was cleared. This opens up the possibility of event injection interrupts being missed because they were delivered after the injection logic ran, but before interrupts were disabled (so the notification would be queued until SVM entry). Just like in #13132, this logic could be split up and refactored to eliminate the possibility of missed notifications.


Related issues

Related to illumos gate - Bug #13132: VMX event injection can race in bhyveClosedPatrick Mooney

Actions
Related to illumos gate - Bug #13007: bhyve vlapic should set TMR on intr acceptClosedPatrick Mooney

Actions
Is duplicate of illumos gate - Bug #13133: SVM event injection can race in bhyveDuplicatePatrick Mooney

Actions
#1

Updated by Patrick Mooney about 1 month ago

  • Related to Bug #13132: VMX event injection can race in bhyve added
#2

Updated by Patrick Mooney about 1 month ago

  • Related to Bug #13007: bhyve vlapic should set TMR on intr accept added
#3

Updated by Electric Monk about 1 month ago

  • Gerrit CR set to 835
#4

Updated by Patrick Mooney 6 days ago

As noted in the description, instances of this race causing a problem have not been observed in the wild or during testing, for that matter. It was discovered while overhauling the event injection system for #13007. Testing to verify that injection still function as before is covered under that ticket.

#5

Updated by Patrick Mooney 5 days ago

  • Is duplicate of Bug #13133: SVM event injection can race in bhyve added
#6

Updated by Electric Monk 5 days ago

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

git commit c74a40a584c9d875009f725565896fd7e8ee38d6

commit  c74a40a584c9d875009f725565896fd7e8ee38d6
Author: Patrick Mooney <pmooney@pfmooney.com>
Date:   2020-11-24T20:30:25.000Z

    13007 bhyve vlapic should set TMR on intr accept
    13106 clarify PPR transitions in bhyve vLAPIC
    13132 VMX event injection can race in bhyve
    13259 SVM event injection can race in bhyve
    Reviewed by: Robert Mustacchi <rm@fingolfin.org>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF