SEV: Cleanup sev-guest a bit and add throttling
Status from this message: The following commit has been merged into the x86/urgent branch of tip:
Get series with b4
b4 am [email protected]Versions newest first
Changes in v1 from the cover letter
---
so I've been looking at Dionna's patches adding the SEV guest throttling and that request issuing spaghetti was getting on my nerves. And it would've become even worse with more stuff piling ontop so here's a first round of cleanups before adding more stuff and making it an unmaintainable mess.
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/11 | crypto: ccp - Name -1 return value as SEV_RET_NO_FW_CALLDocumentation/ drivers/ include/ | +14 | 0 replies | |
| 2/11 | virt/coco/sev-guest: Check SEV_SNP attribute at probe timearch/ drivers/ | +3 | 0 replies | |
| 3/11 | virt/coco/sev-guest: Simplify extended guest request handlingarch/ drivers/ | +32 | 0 replies | |
| 4/11 | virt/coco/sev-guest: Remove the disable_vmpck label in handle_guest_request()drivers/ | +4 | 0 replies | |
| 5/11 | virt/coco/sev-guest: Carve out the request issuing logic into a helperdrivers/ | +27 | 0 replies | |
| 6/11 | virt/coco/sev-guest: Do some code style cleanupsdrivers/ | +2 | 0 replies | |
| 7/11 | virt/coco/sev-guest: Convert the sw_exit_info_2 checking to a switch-casearch/ | +11 | 0 replies | |
| 8/11 | crypto: ccp: Get rid of __sev_platform_init_locked()'s local function pointerdrivers/ | +10 | 0 replies | |
| 9/11 | virt/coco/sev-guest: Add throttling awarenessarch/ arch/ drivers/ | +24 | 1 reply | |
| 10/11 | virt/coco/sev-guest: Double-buffer messagesdrivers/ | +23 | 0 replies | |
| 11/11 | x86/sev: Change snp_guest_issue_request()'s fw_err argumentDocumentation/ arch/ arch/ +3 more | +82 | 0 replies |
Reviews trailers per patch
None of the 11 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Tom Lendacky |
|---|---|
| Series | R-b |
| 1/11 | |
| 2/11 | |
| 3/11 | |
| 4/11 | |
| 5/11 | |
| 6/11 | |
| 7/11 | |
| 8/11 | |
| 9/11 | |
| 10/11 | |
| 11/11 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH -v3 00/11] SEV: Cleanup sev-guest a bit and add throttling
From: "Borislav Petkov (AMD)" <[email protected]>
From: "Borislav Petkov (AMD)" <[email protected]>
Hi,
ok, here's v3, rebased ontop of -rc1 and hopefully with all the stuff addressed. There's always room for improvement but that should come later and ontop.
Thx.
Changelog:
----------
v2:
ok, here's v2 with the pending stuff fixed.
Thx.
v1:
---
so I've been looking at Dionna's patches adding the SEV guest throttling and that request issuing spaghetti was getting on my nerves. And it would've become even worse with more stuff piling ontop so here's a first round of cleanups before adding more stuff and making it an unmaintainable mess.
The final result is a lot easier to read with proper separation of functionality between functions. I want to get rid of more input/output params being passed back'n'forth and use a struct instead and Nikunj's patches have stuff which goes in that direction but first things first.
After the cleanup, the new stuff being added is a lot less code and almost trivial. But I've been staring at this for a while now so it could be only me who thinks it is trivial now. But we'll see.
Initial smoke testing seems to work ok but I might've introduced some funky bugs, ofc.
Comments and suggestions are appreciated, as always.
Thanks and thanks, Tom, for the help!
Borislav Petkov (AMD) (7):
virt/coco/sev-guest: Check SEV_SNP attribute at probe time virt/coco/sev-guest: Simplify extended guest request handling virt/coco/sev-guest: Remove the disable_vmpck label in
handle_guest_request()
virt/coco/sev-guest: Carve out the request issuing logic into a helper virt/coco/sev-guest: Do some code style cleanups virt/coco/sev-guest: Convert the sw_exit_info_2 checking to a
switch-case
crypto: ccp: Get rid of __sev_platform_init_locked()'s local function
pointer
Dionna Glaze (3):
virt/coco/sev-guest: Add throttling awareness virt/coco/sev-guest: Double-buffer messages x86/sev: Change snp_guest_issue_request()'s fw_err argument
Peter Gonda (1):
crypto: ccp - Name -1 return value as SEV_RET_NO_FW_CALL
Documentation/virt/coco/sev-guest.rst | 20 ++- arch/x86/include/asm/sev-common.h | 3 - arch/x86/include/asm/sev.h | 10 +- arch/x86/kernel/sev.c | 33 ++-- drivers/crypto/ccp/sev-dev.c | 22 ++- drivers/virt/coco/sev-guest/sev-guest.c | 190 +++++++++++++++--------- include/uapi/linux/psp-sev.h | 7 + include/uapi/linux/sev-guest.h | 18 ++- 8 files changed, 199 insertions(+), 104 deletions(-)
Signature · 1 line
2.35.1