Project

General

Profile

Actions

Bug #13259

closed

SVM event injection can race in bhyve

Added by Patrick Mooney almost 3 years ago. Updated almost 3 years ago.

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

100%

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

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
Actions #1

Updated by Patrick Mooney almost 3 years ago

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

Updated by Patrick Mooney almost 3 years ago

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

Updated by Electric Monk almost 3 years ago

  • Gerrit CR set to 835
Actions #4

Updated by Patrick Mooney almost 3 years 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.

Actions #5

Updated by Patrick Mooney almost 3 years ago

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

Updated by Electric Monk almost 3 years 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>

Actions

Also available in: Atom PDF