User Details
- User Since
- Apr 26 2018, 6:21 PM (343 w, 3 d)
Oct 11 2022
Jun 23 2022
Jun 17 2022
I guess you meant that vmx_apicv_sync() should be called instead saving pir_desc directly ? I understand what you mean, but it will also require saving of vlapic_vtx. Current implementation in FreeBSD also requies saving vlapic_vtx, but just one field pending_prio. I am going to create review for that, once current review is finished.
Sorry, If vlapic_set_intr_ready() is called, it will change pir_desc->pir in some condition:
I assume that it can lead that pir_desc->pir is only container that keeps a interrupt request. Therefore if suspend VM and then restore, that interrupt will be lost.
But this commit should also suffer from not saved pir_desc after vmx_apicv_set_ready() is performed. Am I right?
In illumos bhyve, we chose to "flatten" queued interrupts in the PIR descriptor into the normal vlapic state, so there was only one source of truth for the IRR data:
Aug 14 2020
Aug 8 2020
Abandoned, as it is to be replaced by the approach documented in illumos #13007.
Jul 29 2020
I discovered the lack of a #define for this in FreeBSD while investigating 12998 on illumos bhyve (related to OpenBSD guests attempting to access that MSR on AMD hardware)
May 22 2020
This was integrated as 12746 into illumos bhyve.
May 15 2020
If that seems reasonable, it's now I intend to commit the change to illumos bhyve.
May 7 2020
Updated to include feedback from @jhb
May 6 2020
I do not have a machine available to test on FreeBSD at the moment, but the equivalent patch for SmartOS bhyve does appear to have the desired effect.
Dec 20 2019
We had similar issues regarding vm_smp_rendezvous() and thread interruption in SmartOS. The easiest path forward for us was to totally eliminate the need for vm_smp_rendezvous(), which has been floated for upstreaming in D20389.
Dec 19 2019
Aug 16 2019
After discussion with @markj and @jhb, I drafted up a change which involves using an sxlock to guard against racing vioapic writes while allowing the main vioapic mutex to be dropped during the sensitive portion of the TMR update process. I don't have test hardware I can dedicate to running FreeBSD bhyve, so its performance is speculative.
Aug 13 2019
Thanks for pointing that out @markj. This wasn't a problem in SmartOS bhyve since all of the mutexes there are adaptive, rather than spinlocks. (Due to interface differences, we couldn't guarantee a lack of voluntary context switching inside the critical_enter/critical_exit section, and spinlocks came with their own host of deadlock problems.) Considering the constraints in play on the FreeBSD side, I'm not sure this possible without serious restructuring. The vioapic lock would need to be sleeping, so the EOI processing would require a full exit from the VMRUN critical section. Other consumers (hpet, etc) would probably require similar treatment.
Jul 24 2019
You're correct that illumos bhyve is not being built with any kind of Capsicum support. If the WITHOUT_CAPSICUM guards are removed, we'll just shim the cap_/caph_ interfaces as successful no-ops.
Jul 23 2019
Looks good, with all of @kib's comments addressed.
Jul 17 2019
Jul 16 2019
Jul 2 2019
Jun 26 2019
Looks good, once the 7F->F7 fix is made.
Jun 24 2019
Merged downstream in SmartOS as ec6f18e9
Jun 18 2019
I agree with @jhb that this absolutely should be placed behind #ifdef guards for now.
Rebased to reflect upstream changes
Jun 10 2019
Merged downstream in SmartOS as aa2898c4.
Jun 5 2019
Jun 1 2019
Eliminate the ILLEGAL_VECTOR qualification in vlapic_set_error per @jhb's feedback and rebase.
May 23 2019
May 22 2019
Fix excess whitespace and add attribution
May 21 2019
May 17 2019
Fixed include ordering per @kib's comment.
Added missing atomics header
May 7 2019
Implemented @kib's suggestions.
I'm fine with @kib's suggested changes, with the caveat that we (Joyent) only positively tested the mfence version.
May 3 2019
This issue was addressed when it was effectively side-pulled in commit #345158, despite having been posted here and accepted a week prior.
Mar 9 2019
I think this fix is good for the short term. I can confirm seeing failed writes to that MSR when running a Linux guest on Zen hardware (which were non-fatal to Linux).
Mar 7 2019
Feb 28 2019
Yes, he was concerned about my use of the reserved bits. For a VMX-only case, it was probably fine, but if we ever want PCI-passthru to post interrupts directly to the guest, we'll need those bits. The write-up for OS-7354, which switched to the separate pending_prio field, covers the reasoning.
Feb 27 2019
We do, in a sense, clear those bits on interrupt delivering since it involves clearing the pending bit, meaning the next 0 -> 1 transition would incur a clean of pending_prio. Clearing the lower bits in pending_prio as part of vmx_pending_intr carries no risk of incurring extra work, since interrupt notification is triggered from having an incoming prio greater than what is cached in pending_prio. Besides, spurious wake-ups from the HLT loop to check for interrupts are much preferred to missing one.
Fixed copyright attribution per Rod's comment.
Updated diff to include full context
Feb 22 2019
I used git format-patch assuming phabricator would pick up on the context stuff, but apparently not. I'll be sure to increase the context for the next revision.
Feb 14 2019
This is the fix we're applying to SmartOS bhyve, after syncing from upstream.
This is the fix we're applying to SmartOS bhyve, after syncing from upstream.
Jan 24 2019
That stores the type definitions for the statistics. Storage of the actual statistic data should still be per-vcpu, hung off of struct vcpu`stats. Requiring a type definition per-vcpu doesn't make sense in that case.
Since the statistic tables are allocated on a per-vCPU basis already, it doesn't make sense to me why the tables themselves need to be expanded like this.
Jan 13 2019
This is effectively what we did in SmartOS/illumos to address the issue:
https://github.com/joyent/illumos-joyent/commit/192e1e6405f98e4b0a12f9488793c5dd000f3f7e
Jan 8 2019
Jan 7 2019
Up until now, those structs have been kept opaque to the rest of the system, with accessor functions to perform necessary tasks/queries against them. Could you go into more detail about how your plans for dynamic VM_MAXCPU are impeded by similar constraints?