已合并
[OLK-6.6] Enable SEV SNP kernel patches #21196
[OLK-6.6] Enable SEV SNP kernel patches #21196
已合并
PrithivishS创建于 3月11日
PrithivishS
3月11日
  1. KVM: Tweak kvm_hva_range and hva_handler_t to allow reusing for gfn ranges
  2. KVM: Assert that mmu_invalidate_in_progress never goes negative
  3. KVM: Use gfn instead of hva for mmu_notifier_retry
  4. KVM: WARN if there are dangling MMU invalidations at VM destruction
  5. KVM: PPC: Drop dead code related to KVM_ARCH_WANT_MMU_NOTIFIER
  6. KVM: PPC: Return '1' unconditionally for KVM_CAP_SYNC_MMU
  7. KVM: Convert KVM_ARCH_WANT_MMU_NOTIFIER to CONFIG_KVM_GENERIC_MMU_NOTIFIER
  8. KVM: Add a dedicated mmu_notifier flag for reclaiming freed memory
  9. KVM: Drop .on_unlock() mmu_notifier hook
  10. KVM: Introduce per-page memory attributes
  11. mm: Add AS_UNMOVABLE to mark mapping as completely unmovable
  12. fs: Rename anon_inode_getfile_secure() and anon_inode_getfd_secure()
  13. KVM: Add KVM_CREATE_GUEST_MEMFD ioctl() for guest-specific backing memory
  14. KVM: x86: "Reset" vcpu->run->exit_reason early in KVM_RUN
  15. KVM: x86: Disallow hugepages when memory attributes are mixed
  16. KVM: x86/mmu: Handle page fault for private memory
  17. KVM: Drop superfluous __KVM_VCPU_MULTIPLE_ADDRESS_SPACE macro
  18. KVM: Allow arch code to track number of memslot address spaces per VM
  19. KVM: x86: Add support for "protected VMs" that can utilize private memory
  20. KVM: selftests: Drop unused kvm_userspace_memory_region_find() helper
  21. KVM: selftests: Convert lib's mem regions to KVM_SET_USER_MEMORY_REGION2
  22. KVM: selftests: Add support for creating private memslots
  23. KVM: selftests: Add helpers to convert guest memory b/w private and shared
  24. KVM: selftests: Add helpers to do KVM_HC_MAP_GPA_RANGE hypercalls (x86)
  25. KVM: selftests: Introduce VM "shape" to allow tests to specify the VM type
  26. KVM: selftests: Add GUEST_SYNC[1-6] macros for synchronizing more data
  27. KVM: selftests: Add x86-only selftest for private memory conversions
  28. KVM: selftests: Add KVM_SET_USER_MEMORY_REGION2 helper
  29. KVM: selftests: Expand set_memory_region_test to validate guest_memfd()
  30. KVM: selftests: Add basic selftest for guest_memfd()
  31. KVM: selftests: Test KVM exit behavior for private memory/access
  32. KVM: selftests: Add a memory region subtest to validate invalid flags
  33. x86/sev: Harden #VC instruction emulation somewhat
  34. x86/cpufeatures: Add SEV-SNP CPU feature
  35. x86/speculation: Do not enable Automatic IBRS if SEV-SNP is enabled
  36. iommu/amd: Don't rely on external callers to enable IOMMU SNP support
  37. x86/sev: Add SEV-SNP host initialization support
  38. x86/mtrr: Don't print errors if MtrrFixDramModEn is set when SNP enabled
  39. x86/sev: Add RMP entry lookup helpers
  40. x86/fault: Add helper for dumping RMP entries
  41. x86/traps: Define RMP violation #PF error code
  42. x86/fault: Dump RMP table information when RMP page faults occur
  43. x86/sev: Add helper functions for RMPUPDATE and PSMASH instruction
  44. x86/sev: Adjust the directmap to avoid inadvertent RMP faults
  45. crypto: ccp: Define the SEV-SNP commands
  46. crypto: ccp: Add support to initialize the AMD-SP for SEV-SNP
  47. crypto: ccp: Provide an API to issue SEV and SNP commands
  48. x86/sev: Introduce an SNP leaked pages list
  49. crypto: ccp: Handle the legacy TMR allocation when SNP is enabled
  50. crypto: ccp: Handle non-volatile INIT_EX data when SNP is enabled
  51. crypto: ccp: Handle legacy SEV commands when SNP is enabled
  52. iommu/amd: Clean up RMP entries for IOMMU pages during SNP shutdown
  53. crypto: ccp: Add panic notifier for SEV/SNP firmware shutdown on kdump
  54. KVM: SEV: Make AVIC backing, VMSA and VMCB memory allocation SNP safe
  55. x86/cpufeatures: Enable/unmask SEV-SNP CPU feature
  56. crypto: ccp: Add the SNP_PLATFORM_STATUS command
  57. crypto: ccp: Add the SNP_COMMIT command
  58. crypto: ccp: Add the SNP_SET_CONFIG command
  59. x86/sev: Dump SEV_STATUS
  60. x86/sev: Check for MWAITX and MONITORX opcodes in the #VC handler
  61. x86/sev: Shorten struct name snp_secrets_page_layout to snp_secrets_page
  62. x86/sev: Rename snp_init() in boot/compressed/sev.c
  63. x86/sev: Make the VMPL0 checking more straight forward
  64. KVM: SEV: fix compat ABI for KVM_MEMORY_ENCRYPT_OP
  65. Documentation: kvm/sev: separate description of firmware
  66. Documentation: kvm/sev: clarify usage of KVM_MEMORY_ENCRYPT_OP
  67. x86/kvm/Kconfig: Have KVM_AMD_SEV select ARCH_HAS_CC_PLATFORM
  68. x86/cc: Add cc_platform_set/_clear() helpers
  69. x86/CPU/AMD: Track SNP host status with cc_platform_*()
  70. KVM: SVM: Invert handling of SEV and SEV_ES feature flags
  71. KVM: SVM: Compile sev.c if and only if CONFIG_KVM_AMD_SEV=y
  72. KVM: x86: use u64_to_user_ptr()
  73. KVM: introduce new vendor op for KVM_GET_DEVICE_ATTR
  74. KVM: SEV: publish supported VMSA features
  75. KVM: SEV: store VMSA features in kvm_sev_info
  76. KVM: x86: add fields to struct kvm_arch for CoCo features
  77. KVM: x86: Add supported_vm_types to kvm_caps
  78. KVM: SEV: introduce to_kvm_sev_info
  79. KVM: SEV: define VM types for SEV and SEV-ES
  80. KVM: SEV: sync FPU and AVX state at LAUNCH_UPDATE_VMSA time
  81. KVM: SEV: introduce KVM_SEV_INIT2 operation
  82. KVM: SEV: allow SEV-ES DebugSwap again
  83. selftests: kvm: add tests for KVM_SEV_INIT2
  84. selftests: kvm: switch to using KVM_X86_*_VM
  85. selftests: kvm: split "launch" phase of SEV VM creation
  86. selftests: kvm: add test for transferring FPU state into VMSA
  87. KVM: SEV: Add support to handle AP reset MSR protocol
  88. KVM: SEV: Add GHCB handling for Hypervisor Feature Support requests
  89. KVM: SEV: Add GHCB handling for termination requests
  90. KVM: SEV: Allow per-guest configuration of GHCB protocol version
  91. mm: Introduce AS_INACCESSIBLE for encrypted/confidential memory
  92. KVM: guest_memfd: Use AS_INACCESSIBLE when creating guest_memfd inode
  93. KVM: guest_memfd: pass error up from filemap_grab_folio
  94. KVM: guest_memfd: limit overzealous WARN
  95. KVM: guest_memfd: Add hook for initializing memory
  96. KVM: guest_memfd: extract __kvm_gmem_get_pfn()
  97. KVM: guest_memfd: Add interface for populating gmem pages with user data
  98. KVM: guest_memfd: Add hook for invalidating memory
  99. KVM: x86: Add hook for determining max NPT mapping level
  100. KVM: MMU: Disable fast path if KVM_EXIT_MEMORY_FAULT is needed
  101. mm, virt: merge AS_UNMOVABLE and AS_INACCESSIBLE
  102. KVM: SEV: Select KVM_GENERIC_PRIVATE_MEM when CONFIG_KVM_AMD_SEV=y
  103. KVM: SEV: Add initial SEV-SNP support
  104. KVM: SEV: Add KVM_SEV_SNP_LAUNCH_START command
  105. KVM: SEV: Add KVM_SEV_SNP_LAUNCH_UPDATE command
  106. KVM: SEV: Add KVM_SEV_SNP_LAUNCH_FINISH command
  107. KVM: SEV: Add support to handle GHCB GPA register VMGEXIT
  108. KVM: SEV: Add support to handle MSR based Page State Change VMGEXIT
  109. KVM: SEV: Add support to handle Page State Change VMGEXIT
  110. KVM: SEV: Add support to handle RMP nested page faults
  111. KVM: SEV: Support SEV-SNP AP Creation NAE event
  112. hugetlbfs: convert to new timestamp accessors
  113. fs: Rename mapping private members
  114. KVM: SEV: Implement gmem hook for initializing private pages
  115. KVM: SEV: Implement gmem hook for invalidating private pages
  116. KVM: x86: Implement hook for determining max NPT mapping level
  117. KVM: SEV: Avoid WBINVD for HVA-based MMU notifications for SNP
  118. KVM: SVM: Add module parameter to enable SEV-SNP
  119. KVM: SEV: Automatically switch reclaimed pages to shared
  120. KVM: SEV: Don't WARN() if RMP lookup fails when invalidating gmem pages
  121. KVM: SVM: Remove the need to trigger an UNBLOCK event on AP creation
  122. KVM: SEV-ES: Prevent MSR access post VMSA encryption
  123. KVM: SEV-ES: Disallow SEV-ES guests when X86_FEATURE_LBRV is absent
  124. KVM: SEV-ES: Delegate LBR virtualization to the processor
  125. KVM: guest-memfd: fix unused-function warning
  126. KVM: SNP: Fix LBR Virtualization for SNP guest
  127. KVM: interrupt kvm_gmem_populate() on signals
  128. KVM: SEV: Provide support for SNP_GUEST_REQUEST NAE event
  129. x86/sev: Move sev_guest.h into common SEV header
  130. KVM: SEV: Provide support for SNP_EXTENDED_GUEST_REQUEST NAE event
  131. crypto: ccp: Add the SNP_VLEK_LOAD command
  132. KVM: x86: disallow pre-fault for SNP VMs before initialization
  133. KVM: guest_memfd: return folio from __kvm_gmem_get_pfn()
  134. KVM: guest_memfd: delay folio_mark_uptodate() until after successful preparation
  135. KVM: guest_memfd: do not go through struct page
  136. KVM: rename CONFIG_HAVE_KVM_GMEM_* to CONFIG_HAVE_KVM_ARCH_GMEM_*
  137. KVM: guest_memfd: return locked folio from __kvm_gmem_get_pfn
  138. KVM: guest_memfd: delay kvm_gmem_prepare_folio() until the memory is passed to the guest
  139. KVM: guest_memfd: make kvm_gmem_prepare_folio() operate on a single struct kvm
  140. KVM: remove kvm_arch_gmem_prepare_needed()
  141. KVM: guest_memfd: move check for already-populated page to common code
  142. KVM: cleanup and add shortcuts to kvm_range_has_memory_attributes()
  143. KVM: extend kvm_range_has_memory_attributes() to check subset of attributes
  144. KVM: guest_memfd: let kvm_gmem_populate() operate only on private gfns
  145. KVM: guest_memfd: abstract how prepared folios are recorded

Run the following commands to validate your SEV SNP support on the host kernel
Without SEV SNP Patches

[    5.841099] ccp 0000:03:00.5: enabling device (0000 -> 0002)
[    5.843786] ccp 0000:03:00.5: sev enabled
[    5.866866] ccp 0000:03:00.5: psp enabled
[    5.888140] ccp 0000:81:00.5: enabling device (0000 -> 0002)
[    5.888552] ccp 0000:81:00.5: psp enabled
[    6.128498] ccp 0000:03:00.5: SEV API:1.55 build:42
[   13.468350] kvm_amd: SEV enabled (ASIDs 1 - 1006)
[   13.468362] kvm_amd: SEV-ES disabled (ASIDs 0 - 0)

With SEV SNP Patches

$   sudo dmesg | grep  -i -e sev -e ccp -e snp -e rmp
.....
.....
[ 7.688225] ccp 0000:55:00.5: SEV-SNP API:1.55 build:50
[ 7.717370] kvm_amd: SEV enabled (ASIDs 100 - 1006)
[ 7.722942] kvm_amd: SEV-ES enabled (ASIDs 1 - 99)
[ 7.728585] kvm_amd: SEV-SNP enabled (ASIDs 1 - 99)
likedislike
Pull Request已成功合入, 合并人@openeuler-ci-bot
(感谢 PrithivishS 的贡献)
PPrithivishS
3月11日 创建了 pull request,commit 9573babe
openeuler-ci-botopeneuler-ci-bot成员
3月11日 将zeng_zhaorong,zhengzengkai,sanglipeng,oekernel,hanjunguo设为审查人
openeuler-ci-botopeneuler-ci-bot成员
3月11日 添加了label:sig/Kernel
openeuler-ci-bot
openeuler-ci-bot成员
3月11日 评论:

Welcome To openEuler Community

Hey @PrithivishS , thanks for your contribution to the community.

Bot Usage Manual

I'm the Bot here serving you. You can find the instructions on how to interact with me at Here . That means you can comment below every pull request or issue to trigger Bot Commands.

Contact Guide

If you have any questions, please contact the SIG: Kernel ,
and any of the maintainers: @hanjunguo, @oekernel, @sanglipeng, @zeng_zhaorong, @zhengzengkai ,
and any of the committers: @linan888 .

likedislike
openeuler-ci-botopeneuler-ci-bot成员
3月11日 添加了label:stat/needs-squash
此处折叠了599条消息 查看更多
Tengda Wu
Tengda Wu成员
7月1日 评论:

/lgtm
/approve

likedislike
openeuler-ci-botopeneuler-ci-bot成员
7月1日 添加了label:approved
openeuler-ci-bot
openeuler-ci-bot成员
7月1日 评论:

Review Code Feedback

  • The label approved was added to this pull request. It means that stavewu reviewed the code changes. 👋
Tips
  • If this pull request is not merged while all conditions are met, comment /check-pr to try again. 😄
likedislike
openeuler-ci-botopeneuler-ci-bot成员
7月1日 关闭了关联的issue
openeuler-ci-botopeneuler-ci-bot成员
7月1日 合入了pull request,合并节点 SHA:1ca76644e9d3cd0fadd5e0d4b99079a998a07f7b