Skip to content

target/i386/sev: Housekeeping SEV + measured Linux SEV guest

Philippe Mathieu-Daudé kvm qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest23 patches 11 repliesIn review
  2. v322 patches 31 repliesApplied

Changes in v4 from the cover letter

- Rebased ('Measured Linux SEV guest' from Dov [1] merged)
- Addressed Paolo & David review comments

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/23qapi/misc-target: Wrap long 'SEV Attestation Report' long linesqapi/misc-target.json+10 -70 replies
2/23qapi/misc-target: Group SEV QAPI definitionsqapi/misc-target.json+40 -400 replies
3/23target/i386/kvm: Introduce i386_softmmu_kvm Meson source settarget/i386/kvm/meson.build+5 -10 replies
4/23target/i386/kvm: Restrict SEV stubs to x86 architectureaccel/kvm/meson.build target/i386/kvm/meson.build target/i386/kvm/sev-stub.c+2 -10 replies
5/23target/i386/sev: Prefix QMP errors with 'SEV'target/i386/monitor.c target/i386/sev.c+12 -101 reply
6/23target/i386/monitor: Return QMP error when SEV is not enabled for guesttarget/i386/monitor.c+5 -00 replies
7/23target/i386/cpu: Add missing 'qapi/error.h' headertarget/i386/cpu.c+1 -00 replies
8/23target/i386/sev_i386.h: Remove unused headerstarget/i386/sev-stub.c target/i386/sev_i386.h+1 -40 replies
9/23target/i386/sev: Remove sev_get_me_mask()target/i386/sev-stub.c target/i386/sev.c target/i386/sev_i386.h+0 -150 replies
10/23target/i386/sev: Mark unreachable code with g_assert_not_reached()target/i386/sev-stub.c+2 -20 replies
11/23target/i386/sev: sev_get_attestation_report use g_autofreetarget/i386/sev.c+3 -80 replies
12/23target/i386/sev: Use g_autofree in sev_launch_get_measure()target/i386/sev.c+4 -92 replies
13/23target/i386/sev: Restrict SEV to system emulationtarget/i386/meson.build target/i386/sev-stub.c target/i386/sev-sysemu-stub.c+63 -440 replies
14/23target/i386/sev: Rename sev_i386.h -> sev.hhw/i386/x86.c target/i386/cpu.c target/i386/kvm/kvm.c +5 more+7 -71 reply
15/23target/i386/sev: Declare system-specific functions in 'sev.h'hw/i386/pc_sysfw.c include/sysemu/sev.h target/i386/kvm/kvm.c +3 more+13 -330 replies
16/23target/i386/sev: Remove stubs by using code elisiontarget/i386/cpu.c target/i386/meson.build target/i386/sev-stub.c +1 more+20 -506 replies
17/23target/i386/sev: Move qmp_query_sev_attestation_report() to sev.ctarget/i386/monitor.c target/i386/sev-sysemu-stub.c target/i386/sev.c +1 more+13 -120 replies
18/23target/i386/sev: Move qmp_sev_inject_launch_secret() to sev.ctarget/i386/monitor.c target/i386/sev-sysemu-stub.c target/i386/sev.c+34 -340 replies
19/23target/i386/sev: Move qmp_query_sev_capabilities() to sev.ctarget/i386/monitor.c target/i386/sev-sysemu-stub.c target/i386/sev.c +1 more+7 -90 replies
20/23target/i386/sev: Move qmp_query_sev_launch_measure() to sev.ctarget/i386/monitor.c target/i386/sev-sysemu-stub.c target/i386/sev.c +1 more+20 -210 replies
21/23target/i386/sev: Move qmp_query_sev() & hmp_info_sev() to sev.ctarget/i386/monitor.c target/i386/sev-sysemu-stub.c target/i386/sev.c +1 more+45 -400 replies
22/23monitor: Reduce hmp_info_sev() declarationinclude/monitor/hmp-target.h include/monitor/hmp.h target/i386/sev-sysemu-stub.c +1 more+3 -30 replies
23/23MAINTAINERS: Cover SEV-related files with X86/KVM sectionMAINTAINERS+2 -01 reply

Reviews trailers per patch

21 of 23 patches have a Reviewed-by or Acked-by.

PatchMarkus ArmbrusterPaolo BonziniDr. David Alan GilbertConnor KuehlBrijesh SinghEric Blake
1/23R-b R-b
2/23R-b
3/23R-b
4/23R-b
5/23R-b
6/23R-b R-b
7/23R-b R-b R-b
8/23R-b R-b
9/23R-b R-b R-b
10/23R-b R-b
11/23R-b R-b R-b
12/23
13/23R-b
14/23R-b
15/23R-b
16/23R-b
17/23R-b
18/23R-b
19/23R-b
20/23R-b
21/23R-b
22/23R-b
23/23

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 6 reviewers.

Read the v4 thread

Cover letter [PATCH v4 00/23] target/i386/sev: Housekeeping SEV + measured Linux SEV guest

Missing review:
0005-target-i386-sev-Prefix-QMP-errors-with-SEV.patch 0012-target-i386-sev-Use-g_autofree-in-sev_launch_get_mea.patch 0014-target-i386-sev-Rename-sev_i386.h-sev.h.patch 0016-target-i386-sev-Remove-stubs-by-using-code-elision.patch 0023-MAINTAINERS-Cover-SEV-related-files-with-X86-KVM-sec.patch

Hi,

While testing James & Dov patch:
https://www.mail-archive.com/[email protected]/msg810571.html
I wasted some time trying to figure out how OVMF was supposed to behave until realizing the binary I was using was built without SEV support... Then wrote this series to help other developers to not hit the same problem.

Since v3:
- Rebased ('Measured Linux SEV guest' from Dov [1] merged)
- Addressed Paolo & David review comments

Since v2:
- Rebased on top of SGX
- Addressed review comments from Markus / David
- Included/rebased 'Measured Linux SEV guest' from Dov [1]
- Added orphean MAINTAINERS section

[1] https://lore.kernel.org/qemu-devel/[email protected]/

Supersedes: <[email protected]>

Dr. David Alan Gilbert (1):
target/i386/sev: sev_get_attestation_report use g_autofree

Philippe Mathieu-Daudé (22):
qapi/misc-target: Wrap long 'SEV Attestation Report' long lines qapi/misc-target: Group SEV QAPI definitions target/i386/kvm: Introduce i386_softmmu_kvm Meson source set target/i386/kvm: Restrict SEV stubs to x86 architecture target/i386/sev: Prefix QMP errors with 'SEV' target/i386/monitor: Return QMP error when SEV is not enabled for
guest
target/i386/cpu: Add missing 'qapi/error.h' header target/i386/sev_i386.h: Remove unused headers target/i386/sev: Remove sev_get_me_mask() target/i386/sev: Mark unreachable code with g_assert_not_reached() target/i386/sev: Use g_autofree in sev_launch_get_measure() target/i386/sev: Restrict SEV to system emulation target/i386/sev: Rename sev_i386.h -> sev.h target/i386/sev: Declare system-specific functions in 'sev.h' target/i386/sev: Remove stubs by using code elision target/i386/sev: Move qmp_query_sev_attestation_report() to sev.c target/i386/sev: Move qmp_sev_inject_launch_secret() to sev.c target/i386/sev: Move qmp_query_sev_capabilities() to sev.c target/i386/sev: Move qmp_query_sev_launch_measure() to sev.c target/i386/sev: Move qmp_query_sev() & hmp_info_sev() to sev.c
monitor: Reduce hmp_info_sev() declaration
MAINTAINERS: Cover SEV-related files with X86/KVM section

 qapi/misc-target.json                 |  77 ++++++------
 include/monitor/hmp-target.h          |   1 +
 include/monitor/hmp.h                 |   1 -
 include/sysemu/sev.h                  |  28 -----
 target/i386/{sev_i386.h => sev.h}     |  35 ++++--
 hw/i386/pc_sysfw.c                    |   2 +-
 hw/i386/x86.c                         |   2 +-
 target/i386/cpu.c                     |  16 +--
 target/i386/kvm/kvm.c                 |   3 +-
 {accel => target/i386}/kvm/sev-stub.c |   2 +-
 target/i386/monitor.c                 |  92 +--------------
 target/i386/sev-stub.c                |  88 --------------
 target/i386/sev-sysemu-stub.c         |  70 +++++++++++
 target/i386/sev.c                     | 164 +++++++++++++++++++-------
 MAINTAINERS                           |   2 +
 accel/kvm/meson.build                 |   1 -
 target/i386/kvm/meson.build           |   8 +-
 target/i386/meson.build               |   4 +-
 18 files changed, 279 insertions(+), 317 deletions(-)
 delete mode 100644 include/sysemu/sev.h
 rename target/i386/{sev_i386.h => sev.h} (62%)
 rename {accel => target/i386}/kvm/sev-stub.c (94%)
 delete mode 100644 target/i386/sev-stub.c
 create mode 100644 target/i386/sev-sysemu-stub.c
Signature · 1 line
2.31.1