x86/kvm/emulate: Avoid RET for FASTOPs
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest12 patches 25 repliesIn review
- v111 patches 8 repliesSuperseded
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/12 | objtool: Generic annotation infrastructureinclude/ tools/ | +64 | 8 replies | |
| 2/12 | objtool: Convert ANNOTATE_NOENDBR to ANNOTATEinclude/ include/ tools/ +1 more | +19 | 0 replies | |
| 3/12 | objtool: Convert ANNOTATE_RETPOLINE_SAFE to ANNOTATEarch/ include/ tools/ +1 more | +22 | 2 replies | |
| 4/12 | objtool: Convert instrumentation_{begin,end}() to ANNOTATEinclude/ include/ include/ +2 more | +25 | 4 replies | |
| 5/12 | objtool: Convert VALIDATE_UNRET_BEGIN to ANNOTATEinclude/ include/ tools/ +1 more | +10 | 0 replies | |
| 6/12 | objtool: Convert ANNOTATE_IGNORE_ALTERNATIVE to ANNOTATEarch/ include/ tools/ +1 more | +15 | 0 replies | |
| 7/12 | objtool: Convert ANNOTATE_INTRA_FUNCTION_CALLS to ANNOTATEinclude/ include/ tools/ +1 more | +47 | 2 replies | |
| 8/12 | objtool: Collapse annotate sequencestools/ | +32 | 0 replies | |
| 9/12 | x86/nospec: JMP_NOSPECarch/ | +32 | 0 replies | |
| 10/12 | x86,nospec: Simplify {JMP,CALL}_NOSPEC (part 2)arch/ | +11 | 2 replies | |
| 11/12 | x86/kvm/emulate: Implement test_cc() in Carch/ arch/ | +15 | 1 reply | |
| 12/12 | x86/kvm/emulate: Avoid RET for fastopsarch/ include/ tools/ +1 more | +27 | 5 replies |
Reviews trailers per patch
1 of 12 patches has a Reviewed-by or Acked-by.
| Patch | Sean Christopherson |
|---|---|
| 1/12 | |
| 2/12 | |
| 3/12 | |
| 4/12 | |
| 5/12 | |
| 6/12 | |
| 7/12 | |
| 8/12 | |
| 9/12 | |
| 10/12 | |
| 11/12 | A-b |
| 12/12 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 00/12] x86/kvm/emulate: Avoid RET for FASTOPs
Hi!
At long last, a respin of these patches.
The FASTOPs are special because they rely on RET to preserve CFLAGS, which is a problem with all the mitigation stuff. Also see things like: ba5ca5e5e6a1 ("x86/retpoline: Don't clobber RFLAGS during srso_safe_ret()").
Rework FASTOPs to no longer use RET and side-step the problem of trying to make the various return thunks preserve CFLAGS for just this one case.
There are two separate instances, test_cc() and fastop(). The first is basically a SETCC wrapper, which seems like a very complicated (and somewhat expensive) way to read FLAGS. Instead use the code we already have to emulate JCC to fully emulate the instruction.
That then leaves fastop(), which when marked noinline is guaranteed to exist only once. As such, CALL+RET isn't needed, because we'll always be RETurning to the same location, as such replace with JMP+JMP.
My plan is to take the objtool patches through tip/objtool/core, the nospec patches through tip/x86/core and either stick the fastop patches in that latter tree if the KVM folks agree, or they can merge the aforementioned two branches and then stick the patches on top, whatever works for people.