x86: SEV-ES Guest Support
Status from this message: The following commit has been merged into the x86/seves branch of tip:
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v7 Latest72 patches 24 repliesApplied
- v676 patches 39 repliesSuperseded
- v575 patches 21 repliesSuperseded
Earlier versions · 4
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v4 | 75 patches | 42 replies | Superseded | |
| v3 | 75 patches | 82 replies | Applied | |
| v2 RFC | 70 patches | 50 replies | Applied | |
| v1 RFC | 62 patches | 46 replies | Superseded |
Patches in v7 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/72 | KVM: SVM: nested: Don't allocate VMCB structures on stackarch/ | +33 | 5 replies | |
| 2/72 | KVM: SVM: Add GHCB definitionsarch/ arch/ | +51 | 0 replies | |
| 3/72 | KVM: SVM: Add GHCB Accessor functionsarch/ | +43 | 0 replies | |
| 4/72 | KVM: SVM: Use __packed shorthandarch/ | +6 | 0 replies | |
| 5/72 | x86/cpufeatures: Add SEV-ES CPU featurearch/ arch/ arch/ | +4 | 0 replies | |
| 6/72 | x86/traps: Move pf error codes to <asm/trap_pf.h>arch/ arch/ | +25 | 0 replies | |
| 7/72 | x86/insn: Make inat-tables.c suitable for pre-decompression codearch/ tools/ | +98 | 0 replies | |
| 8/72 | x86/umip: Factor out instruction fetcharch/ arch/ arch/ | +46 | 0 replies | |
| 9/72 | x86/umip: Factor out instruction decodingarch/ arch/ arch/ | +48 | 0 replies | |
| 10/72 | x86/insn: Add insn_get_modrm_reg_off()arch/ arch/ | +24 | 0 replies | |
| 11/72 | x86/insn: Add insn_has_rep_prefix() helperarch/ arch/ | +25 | 0 replies | |
| 12/72 | x86/boot/compressed/64: Disable red-zone usagearch/ | +1 | 0 replies | |
| 13/72 | x86/boot/compressed/64: Add IDT Infrastructurearch/ arch/ arch/ +3 more | +147 | 0 replies | |
| 14/72 | x86/boot/compressed/64: Rename kaslr_64.c to ident_map_64.carch/ arch/ arch/ +1 more | +18 | 0 replies | |
| 15/72 | x86/boot/compressed/64: Add page-fault handlerarch/ arch/ arch/ +1 more | +49 | 0 replies | |
| 16/72 | x86/boot/compressed/64: Always switch to own page-tablearch/ arch/ arch/ | +32 | 0 replies | |
| 17/72 | x86/boot/compressed/64: Don't pre-map memory in KASLR codearch/ arch/ arch/ | +3 | 0 replies | |
| 18/72 | x86/boot/compressed/64: Change add_identity_map() to take start and endarch/ | +5 | 0 replies | |
| 19/72 | x86/boot/compressed/64: Add stage1 #VC handlerarch/ arch/ arch/ +6 more | +160 | 1 reply | |
| 20/72 | x86/boot/compressed/64: Call set_sev_encryption_mask() earlierarch/ arch/ | +8 | 0 replies | |
| 21/72 | x86/boot/compressed/64: Check return value of kernel_ident_mapping_init()arch/ | +5 | 0 replies | |
| 22/72 | x86/boot/compressed/64: Add set_page_en/decrypted() helpersarch/ arch/ | +135 | 0 replies | |
| 23/72 | x86/boot/compressed/64: Setup GHCB Based VC Exception handlerarch/ arch/ arch/ +7 more | +331 | 0 replies | |
| 24/72 | x86/boot/compressed/64: Unmap GHCB page before booting the kernelarch/ arch/ arch/ | +35 | 0 replies | |
| 25/72 | x86/sev-es: Add support for handling IOIO exceptionsarch/ arch/ | +246 | 0 replies | |
| 26/72 | x86/fpu: Move xgetbv()/xsetbv() into separate headerarch/ arch/ | +35 | 0 replies | |
| 27/72 | x86/sev-es: Add CPUID handling to #VC handlerarch/ arch/ | +39 | 0 replies | |
| 28/72 | x86/idt: Split idt_data setup out of set_intr_gate()arch/ | +14 | 0 replies | |
| 29/72 | x86/head/64: Install startup GDTarch/ arch/ arch/ | +48 | 0 replies | |
| 30/72 | x86/head/64: Load GDT after switch to virtual addressesarch/ | +8 | 0 replies | |
| 31/72 | x86/head/64: Load segment registers earlierarch/ | +26 | 0 replies | |
| 32/72 | x86/head/64: Switch to initial stack earlierarch/ | +6 | 0 replies | |
| 33/72 | x86/head/64: Install a CPU bringup IDTarch/ arch/ arch/ | +45 | 0 replies | |
| 34/72 | x86/idt: Move two function from k/idt.c to i/a/desc.harch/ arch/ arch/ | +34 | 0 replies | |
| 35/72 | x86/head/64: Move early exception dispatch to C codearch/ arch/ arch/ +1 more | +20 | 0 replies | |
| 36/72 | x86/sev-es: Add SEV-ES Feature Detectionarch/ arch/ arch/ +1 more | +16 | 1 reply | |
| 37/72 | x86/sev-es: Print SEV-ES info into kernel logarch/ | +26 | 0 replies | |
| 38/72 | x86/sev-es: Compile early handler code into kernel imagearch/ arch/ arch/ | +175 | 0 replies | |
| 39/72 | x86/sev-es: Setup early #VC handlerarch/ arch/ arch/ | +50 | 1 reply | |
| 39/72 | x86/sev-es: Setup early #VC handlerarch/ arch/ arch/ | +54 | 0 replies | |
| 40/72 | x86/sev-es: Setup GHCB based boot #VC handlerarch/ arch/ arch/ +6 more | +177 | 1 reply | |
| 40/72 | x86/sev-es: Setup GHCB based boot #VC handlerarch/ arch/ arch/ +6 more | +176 | 0 replies | |
| 41/72 | x86/sev-es: Setup per-cpu GHCBs for the runtime handlerarch/ arch/ arch/ | +60 | 1 reply | |
| 42/72 | x86/sev-es: Allocate and Map IST stack for #VC handlerarch/ arch/ arch/ +2 more | +63 | 0 replies | |
| 43/72 | x86/sev-es: Adjust #VC IST Stack on entering NMI handlerarch/ arch/ arch/ | +81 | 0 replies | |
| 44/72 | x86/dumpstack/64: Add noinstr version of get_stack_info()arch/ arch/ arch/ +1 more | +30 | 0 replies | |
| 45/72 | x86/entry/64: Add entry code for #VC handlerarch/ arch/ arch/ +2 more | +171 | 2 replies | |
| 46/72 | x86/sev-es: Add Runtime #VC Exception Handlerarch/ arch/ arch/ | +255 | 0 replies | |
| 47/72 | x86/sev-es: Wire up existing #VC exit-code handlersarch/ arch/ | +9 | 0 replies | |
| 48/72 | x86/sev-es: Handle instruction fetches from user-spacearch/ | +22 | 0 replies | |
| 49/72 | x86/sev-es: Handle MMIO eventsarch/ arch/ | +227 | 0 replies | |
| 50/72 | x86/sev-es: Handle MMIO String Instructionsarch/ | +77 | 0 replies | |
| 51/72 | x86/sev-es: Handle MSR eventsarch/ | +28 | 0 replies | |
| 52/72 | x86/sev-es: Handle DR7 read/write eventsarch/ | +85 | 0 replies | |
| 53/72 | x86/sev-es: Handle WBINVD Eventsarch/ | +9 | 0 replies | |
| 54/72 | x86/sev-es: Handle RDTSC(P) Eventsarch/ arch/ arch/ | +31 | 0 replies | |
| 55/72 | x86/sev-es: Handle RDPMC Eventsarch/ | +22 | 0 replies | |
| 56/72 | x86/sev-es: Handle INVD Eventsarch/ | +4 | 0 replies | |
| 57/72 | x86/sev-es: Handle MONITOR/MONITORX Eventsarch/ | +13 | 0 replies | |
| 58/72 | x86/sev-es: Handle MWAIT/MWAITX Eventsarch/ | +10 | 0 replies | |
| 59/72 | x86/sev-es: Handle VMMCALL Eventsarch/ | +23 | 0 replies | |
| 60/72 | x86/sev-es: Handle #AC Eventsarch/ | +19 | 0 replies | |
| 61/72 | x86/sev-es: Handle #DB Eventsarch/ | +17 | 0 replies | |
| 62/72 | x86/paravirt: Allow hypervisor specific VMMCALL handling under SEV-ESarch/ arch/ | +27 | 0 replies | |
| 63/72 | x86/kvm: Add KVM specific VMMCALL handling under SEV-ESarch/ | +29 | 4 replies | |
| 64/72 | x86/vmware: Add VMware specific handling for VMMCALL under SEV-ESarch/ | +45 | 2 replies | |
| 65/72 | x86/realmode: Add SEV-ES specific trampoline entry pointarch/ arch/ arch/ | +26 | 0 replies | |
| 66/72 | x86/realmode: Setup AP jump tablearch/ arch/ arch/ +1 more | +93 | 0 replies | |
| 67/72 | x86/smpboot: Load TSS and getcpu GDT entry before loading IDTarch/ arch/ arch/ | +25 | 2 replies | |
| 68/72 | x86/head/64: Don't call verify_cpu() on starting APsarch/ arch/ arch/ | +19 | 0 replies | |
| 69/72 | x86/sev-es: Support CPU offline/onlinearch/ arch/ | +64 | 0 replies | |
| 70/72 | x86/sev-es: Handle NMI Statearch/ arch/ arch/ +1 more | +32 | 0 replies | |
| 71/72 | x86/efi: Add GHCB mappings when SEV-ES is activearch/ arch/ arch/ +1 more | +43 | 6 replies | |
| 72/72 | x86/sev-es: Check required CPU features for SEV-ESarch/ arch/ arch/ +2 more | +24 | 0 replies |
Reviews trailers per patch
18 of 74 patches have a Reviewed-by or Acked-by.
| Patch | Kees Cook | Masami Hiramatsu | Ard Biesheuvel |
|---|---|---|---|
| 1/72 | |||
| 2/72 | |||
| 3/72 | |||
| 4/72 | |||
| 5/72 | |||
| 6/72 | |||
| 7/72 | A-b | ||
| 8/72 | |||
| 9/72 | |||
| 10/72 | A-b | ||
| 11/72 | R-b | ||
| 12/72 | R-b | ||
| 13/72 | |||
| 14/72 | R-b | ||
| 15/72 | R-b | ||
| 16/72 | R-b | ||
| 17/72 | R-b | ||
| 18/72 | R-b | ||
| 19/72 | |||
| 20/72 | |||
| 21/72 | |||
| 22/72 | |||
| 23/72 | |||
| 24/72 | |||
| 25/72 | |||
| 26/72 | |||
| 27/72 | |||
| 28/72 | R-b | ||
| 29/72 | |||
| 30/72 | R-b | ||
| 31/72 | R-b | ||
| 32/72 | R-b | ||
| 33/72 | |||
| 34/72 | |||
| 35/72 | |||
| 36/72 | R-b | ||
| 37/72 | R-b | ||
| 38/72 | |||
| 39/72 | |||
| 39/72 | |||
| 40/72 | |||
| 40/72 | |||
| 41/72 | |||
| 42/72 | |||
| 43/72 | |||
| 44/72 | |||
| 45/72 | |||
| 46/72 | |||
| 47/72 | |||
| 48/72 | |||
| 49/72 | |||
| 50/72 | |||
| 51/72 | |||
| 52/72 | |||
| 53/72 | |||
| 54/72 | |||
| 55/72 | |||
| 56/72 | |||
| 57/72 | |||
| 58/72 | |||
| 59/72 | |||
| 60/72 | |||
| 61/72 | |||
| 62/72 | |||
| 63/72 | |||
| 64/72 | |||
| 65/72 | |||
| 66/72 | |||
| 67/72 | |||
| 68/72 | R-b | ||
| 69/72 | |||
| 70/72 | |||
| 71/72 | A-b | ||
| 72/72 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH v7 00/72] x86: SEV-ES Guest Support
From: Joerg Roedel <[email protected]>
Hi,
here is a new version of the SEV-ES Guest Support patches for x86. The previous versions can be found as a linked list starting here:
https://lore.kernel.org/lkml/[email protected]/
I updated the patch-set based on ther review comments I got and the discussions around it.
Another important change is that the early IDT setup code is now completly moved to arch/x86/kernel/head64.c. This makes the whole early exception handling setup code more robust for kernels that have KASAN and/or Tracing enabled.
A side effect of this change is that secondary CPU now don't use the idt_table at early boot, which means that on the secondary CPUs the early handler does not use IST or paranoid_entry() anymore. This allowed to remove a couple of patches from this series which were only needed to setup relevant processor starte early enough for IST exceptions. In particular this means that the early FSGSBASE and TSS setup is gone now. Also the patch which moved the idt_table to the data segement is now removed.
A related change was necessary in the boot path of secondary CPUs, because those loaded the runtime IDT before setting up the TSS and the getcpu GDT entry. This is now in proper order so that IST exceptions will work when the runtime IDT is loaded for the first time. This setup is added in patch 67.
The cpu_init() function is untouched so that it still act as the intended cpu-state barrier, regardless of what happens before.
The code survived the usual load test of running one x86-selftest loop on each core of the guest in parallel with perf (for NMI load). This runs for several (4+) hours now without any issues.
Please review.
Thanks,
Joerg
Borislav Petkov (1):
KVM: SVM: Use __packed shorthand
Doug Covelli (1):
x86/vmware: Add VMware specific handling for VMMCALL under SEV-ES
Joerg Roedel (50):
KVM: SVM: nested: Don't allocate VMCB structures on stack
KVM: SVM: Add GHCB Accessor functions
x86/traps: Move pf error codes to <asm/trap_pf.h> x86/insn: Make inat-tables.c suitable for pre-decompression code x86/umip: Factor out instruction fetch
x86/umip: Factor out instruction decoding
x86/insn: Add insn_get_modrm_reg_off()
x86/insn: Add insn_has_rep_prefix() helper x86/boot/compressed/64: Disable red-zone usage x86/boot/compressed/64: Add IDT Infrastructure x86/boot/compressed/64: Rename kaslr_64.c to ident_map_64.c x86/boot/compressed/64: Add page-fault handler x86/boot/compressed/64: Always switch to own page-table x86/boot/compressed/64: Don't pre-map memory in KASLR code x86/boot/compressed/64: Change add_identity_map() to take start and
end
x86/boot/compressed/64: Add stage1 #VC handler x86/boot/compressed/64: Call set_sev_encryption_mask() earlier x86/boot/compressed/64: Check return value of
kernel_ident_mapping_init()
x86/boot/compressed/64: Add set_page_en/decrypted() helpers x86/boot/compressed/64: Setup GHCB Based VC Exception handler x86/boot/compressed/64: Unmap GHCB page before booting the kernel x86/fpu: Move xgetbv()/xsetbv() into separate header x86/idt: Split idt_data setup out of set_intr_gate() x86/head/64: Install startup GDT
x86/head/64: Load GDT after switch to virtual addresses x86/head/64: Load segment registers earlier
x86/head/64: Switch to initial stack earlier
x86/head/64: Install a CPU bringup IDT
x86/idt: Move two function from k/idt.c to i/a/desc.h x86/head/64: Move early exception dispatch to C code x86/sev-es: Add SEV-ES Feature Detection
x86/sev-es: Print SEV-ES info into kernel log
x86/sev-es: Compile early handler code into kernel image x86/sev-es: Setup early #VC handler
x86/sev-es: Setup GHCB based boot #VC handler
x86/sev-es: Allocate and Map IST stack for #VC handler x86/sev-es: Adjust #VC IST Stack on entering NMI handler x86/dumpstack/64: Add noinstr version of get_stack_info() x86/entry/64: Add entry code for #VC handler
x86/sev-es: Wire up existing #VC exit-code handlers x86/sev-es: Handle instruction fetches from user-space x86/sev-es: Handle MMIO String Instructions
x86/sev-es: Handle #AC Events
x86/sev-es: Handle #DB Events
x86/paravirt: Allow hypervisor specific VMMCALL handling under SEV-ES x86/realmode: Add SEV-ES specific trampoline entry point x86/smpboot: Load TSS and getcpu GDT entry before loading IDT x86/head/64: Don't call verify_cpu() on starting APs x86/sev-es: Support CPU offline/online
x86/sev-es: Handle NMI State
Martin Radev (1):
x86/sev-es: Check required CPU features for SEV-ES
Tom Lendacky (19):
KVM: SVM: Add GHCB definitions x86/cpufeatures: Add SEV-ES CPU feature x86/sev-es: Add support for handling IOIO exceptions x86/sev-es: Add CPUID handling to #VC handler x86/sev-es: Setup per-cpu GHCBs for the runtime handler x86/sev-es: Add Runtime #VC Exception Handler x86/sev-es: Handle MMIO events
x86/sev-es: Handle MSR events
x86/sev-es: Handle DR7 read/write events x86/sev-es: Handle WBINVD Events
x86/sev-es: Handle RDTSC(P) Events
x86/sev-es: Handle RDPMC Events
x86/sev-es: Handle INVD Events
x86/sev-es: Handle MONITOR/MONITORX Events x86/sev-es: Handle MWAIT/MWAITX Events x86/sev-es: Handle VMMCALL Events
x86/kvm: Add KVM specific VMMCALL handling under SEV-ES x86/realmode: Setup AP jump table
x86/efi: Add GHCB mappings when SEV-ES is active
arch/x86/Kconfig | 1 + arch/x86/boot/compressed/Makefile | 11 +- arch/x86/boot/compressed/cpuflags.c | 4 - arch/x86/boot/compressed/head_64.S | 33 +- arch/x86/boot/compressed/ident_map_64.c | 349 +++++ arch/x86/boot/compressed/idt_64.c | 54 + arch/x86/boot/compressed/idt_handlers_64.S | 77 ++ arch/x86/boot/compressed/kaslr.c | 36 +- arch/x86/boot/compressed/kaslr_64.c | 153 --- arch/x86/boot/compressed/misc.c | 7 + arch/x86/boot/compressed/misc.h | 50 +- arch/x86/boot/compressed/sev-es.c | 214 +++ arch/x86/entry/entry_64.S | 80 ++ arch/x86/include/asm/cpu_entry_area.h | 33 +- arch/x86/include/asm/cpufeatures.h | 1 + arch/x86/include/asm/desc.h | 27 + arch/x86/include/asm/desc_defs.h | 10 + arch/x86/include/asm/fpu/internal.h | 30 +- arch/x86/include/asm/fpu/xcr.h | 34 + arch/x86/include/asm/idtentry.h | 50 + arch/x86/include/asm/insn-eval.h | 6 + arch/x86/include/asm/mem_encrypt.h | 5 + arch/x86/include/asm/msr-index.h | 3 + arch/x86/include/asm/page_64_types.h | 1 + arch/x86/include/asm/pgtable.h | 2 +- arch/x86/include/asm/processor.h | 1 + arch/x86/include/asm/proto.h | 1 + arch/x86/include/asm/realmode.h | 7 + arch/x86/include/asm/segment.h | 2 +- arch/x86/include/asm/setup.h | 6 +- arch/x86/include/asm/sev-es.h | 114 ++ arch/x86/include/asm/stacktrace.h | 2 + arch/x86/include/asm/svm.h | 106 +- arch/x86/include/asm/trap_pf.h | 24 + arch/x86/include/asm/trapnr.h | 1 + arch/x86/include/asm/traps.h | 20 +- arch/x86/include/asm/x86_init.h | 16 +- arch/x86/include/uapi/asm/svm.h | 11 + arch/x86/kernel/Makefile | 3 + arch/x86/kernel/cpu/amd.c | 3 +- arch/x86/kernel/cpu/common.c | 25 + arch/x86/kernel/cpu/scattered.c | 1 + arch/x86/kernel/cpu/vmware.c | 50 +- arch/x86/kernel/dumpstack.c | 7 +- arch/x86/kernel/dumpstack_64.c | 46 +- arch/x86/kernel/head64.c | 122 +- arch/x86/kernel/head_64.S | 160 ++- arch/x86/kernel/idt.c | 41 +- arch/x86/kernel/kvm.c | 35 +- arch/x86/kernel/nmi.c | 15 + arch/x86/kernel/sev-es-shared.c | 507 +++++++ arch/x86/kernel/sev-es.c | 1404 ++++++++++++++++++++ arch/x86/kernel/smpboot.c | 2 +- arch/x86/kernel/traps.c | 48 + arch/x86/kernel/umip.c | 49 +- arch/x86/kvm/svm/nested.c | 47 +- arch/x86/kvm/svm/svm.c | 2 + arch/x86/lib/insn-eval.c | 130 ++ arch/x86/mm/cpu_entry_area.c | 3 +- arch/x86/mm/extable.c | 1 + arch/x86/mm/mem_encrypt.c | 38 +- arch/x86/mm/mem_encrypt_identity.c | 3 + arch/x86/platform/efi/efi_64.c | 10 + arch/x86/realmode/init.c | 24 +- arch/x86/realmode/rm/header.S | 3 + arch/x86/realmode/rm/trampoline_64.S | 20 + arch/x86/tools/gen-insn-attr-x86.awk | 50 +- tools/arch/x86/tools/gen-insn-attr-x86.awk | 50 +- 68 files changed, 4030 insertions(+), 451 deletions(-) create mode 100644 arch/x86/boot/compressed/ident_map_64.c create mode 100644 arch/x86/boot/compressed/idt_64.c create mode 100644 arch/x86/boot/compressed/idt_handlers_64.S delete mode 100644 arch/x86/boot/compressed/kaslr_64.c create mode 100644 arch/x86/boot/compressed/sev-es.c create mode 100644 arch/x86/include/asm/fpu/xcr.h create mode 100644 arch/x86/include/asm/sev-es.h create mode 100644 arch/x86/include/asm/trap_pf.h create mode 100644 arch/x86/kernel/sev-es-shared.c create mode 100644 arch/x86/kernel/sev-es.c
Signature · 6 lines
2.28.0 _______________________________________________ Virtualization mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/virtualization