Skip to content

x86/nestedsvm: rework nested VMRUN/VMEXIT handling

[email protected] xen-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest13 patches 6 repliesIn review
  2. v15 patches 5 repliesSuperseded

Changes in v2 from the cover letter

- Dropped the v1 "x86/nestedsvm: update vmcb correctly" and "x86/nestedsvm: fix up" patches, which mixed in unrelated bug fixes from our internal patchqueue.
- Those fixes are now submitted as separate patches (1-10) at the start of the series, with the original authorship preserved. The p2m.c change from v1 5/5 is not included.
- The three rework patches from v1 (1-3/5) are now patches 11-13. The stale_np2m handling from v1 5/5 is folded into patch 11; the rest is rebased only. See per-patch notes below the "---" line.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13nestedsvm: Fix CR3 MBZ checkxen/arch/x86/hvm/svm/vmcb.c+2 -41 reply
2/13nestedsvm: Adjust L2's DR intercept when adjusting L1xen/arch/x86/hvm/svm/svm.c+2 -01 reply
3/13nestedsvm: Use the correct VMCB for vGIFxen/arch/x86/hvm/svm/nestedsvm.c+8 -60 replies
4/13nestedsvm: Set GIF during VMRUN if vGIF is enabledxen/arch/x86/hvm/svm/nestedsvm.c+7 -20 replies
5/13tools/libxl: Add support for Viridian stimer direct modedocs/man/xl.cfg.5.pod.in tools/include/libxl.h tools/libs/light/libxl_types.idl +1 more+17 -01 reply
6/13x86/hvm: Clamp Viridian features to known setxen/arch/x86/hvm/hvm.c+3 -11 reply
7/13x86/svm: require VMSAVEvirt for nested virtdocs/designs/nested-svm-cpu-features.md xen/arch/x86/cpu-policy.c xen/arch/x86/hvm/svm/nestedsvm.c +2 more+41 -990 replies
8/13nestedsvm: Don't set VMCB(1-2)'s NP_ENABLE and N_CR3 during VMEXIT to L1xen/arch/x86/hvm/svm/nestedsvm.c+3 -331 reply
9/13x86/svm: Fix VMLOAD/VMSAVE state handling when using nested virtxen/arch/x86/hvm/svm/nestedsvm.c xen/arch/x86/hvm/svm/svm.c xen/arch/x86/hvm/svm/vmcb.c +1 more+75 -680 replies
10/13x86/nSVM: Don't clear TLB_CONTROL on #VMEXITxen/arch/x86/hvm/svm/nestedsvm.c+0 -30 replies
11/13x86/nestedsvm: update vmrun without pending or deferredxen/arch/x86/hvm/svm/entry.S xen/arch/x86/hvm/svm/nestedhvm.h xen/arch/x86/hvm/svm/nestedsvm.c +2 more+79 -150 replies
12/13x86/nestedsvm: remove nv_vmentry_pendingxen/arch/x86/hvm/svm/intr.c xen/arch/x86/hvm/svm/nestedsvm.c+0 -410 replies
13/13x86/nestedsvm: update vmexit without pending or deferred flagxen/arch/x86/hvm/svm/intr.c xen/arch/x86/hvm/svm/nestedhvm.h xen/arch/x86/hvm/svm/nestedsvm.c +2 more+71 -1190 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 00/13] x86/nestedsvm: rework nested VMRUN/VMEXIT handling

From: Chunjie Zhu <[email protected]>

This series simplifies nested SVM execution by removing pending and deferred state from the VMRUN and VMEXIT paths, and includes the nested SVM / Viridian fixes the rework depends on.

Changes in v2 (following Ross Lagerwall's review of v1):
- Dropped the v1 "x86/nestedsvm: update vmcb correctly" and "x86/nestedsvm: fix up" patches, which mixed in unrelated bug fixes from our internal patchqueue.
- Those fixes are now submitted as separate patches (1-10) at the start of the series, with the original authorship preserved. The p2m.c change from v1 5/5 is not included.
- The three rework patches from v1 (1-3/5) are now patches 11-13. The stale_np2m handling from v1 5/5 is folded into patch 11; the rest is rebased only. See per-patch notes below the "---" line.

Contributions by author:
Ross Lagerwall (patches 1-6, 8-9):
- Fix CR3 MBZ check
- Adjust L2's DR intercept when adjusting L1
- Use the correct VMCB for vGIF
- Set GIF during VMRUN if vGIF is enabled
- Viridian stimer direct mode support in libxl
- Clamp Viridian features to known set
- Don't set VMCB(1-2)'s NP_ENABLE and N_CR3 during VMEXIT to L1
- Fix VMLOAD/VMSAVE state handling when using nested virt
Stephen Cheng (patch 7):
- Require VMSAVEvirt for nested virt
Lin Liu (patch 10):
- Don't clear TLB_CONTROL on #VMEXIT
Chunjie Zhu (patches 11-13):
- Rework of nested VMRUN/VMEXIT without pending or deferred flags, and removal of nv_vmentry_pending

Chunjie Zhu (3):
x86/nestedsvm: update vmrun without pending or deferred x86/nestedsvm: remove nv_vmentry_pending x86/nestedsvm: update vmexit without pending or deferred flag

Lin Liu (1):
x86/nSVM: Don't clear TLB_CONTROL on #VMEXIT

Ross Lagerwall (8):
nestedsvm: Fix CR3 MBZ check
nestedsvm: Adjust L2's DR intercept when adjusting L1
nestedsvm: Use the correct VMCB for vGIF
nestedsvm: Set GIF during VMRUN if vGIF is enabled tools/libxl: Add support for Viridian stimer direct mode x86/hvm: Clamp Viridian features to known set
nestedsvm: Don't set VMCB(1-2)'s NP_ENABLE and N_CR3 during VMEXIT to

    L1

x86/svm: Fix VMLOAD/VMSAVE state handling when using nested virt

Stephen Cheng (1):
x86/svm: require VMSAVEvirt for nested virt

 docs/designs/nested-svm-cpu-features.md  |  11 +
 docs/man/xl.cfg.5.pod.in                 |   5 +
 tools/include/libxl.h                    |   6 +
 tools/libs/light/libxl_types.idl         |   1 +
 tools/libs/light/libxl_x86.c             |   5 +
 xen/arch/x86/cpu-policy.c                |   3 +-
 xen/arch/x86/hvm/hvm.c                   |   4 +-
 xen/arch/x86/hvm/svm/entry.S             |  48 +++-
 xen/arch/x86/hvm/svm/intr.c              |  22 +-
 xen/arch/x86/hvm/svm/nestedhvm.h         |   6 +-
 xen/arch/x86/hvm/svm/nestedsvm.c         | 305 +++++++++--------------
 xen/arch/x86/hvm/svm/svm.c               | 226 +++++++----------
 xen/arch/x86/hvm/svm/svm.h               |   2 -
 xen/arch/x86/hvm/svm/vmcb.c              |  32 +--
 xen/arch/x86/hvm/svm/vmcb.h              |   3 +-
 xen/arch/x86/include/asm/hvm/svm-types.h |   7 -
 xen/arch/x86/x86_64/asm-offsets.c        |   1 +
 17 files changed, 302 insertions(+), 385 deletions(-)
Signature · 1 line
2.34.1