Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.6]Hygon: CSV3 patch series part 1 (Secure memory management and initialization) #375

Conversation

wojiaohanliyang
Copy link

Description:

  1. Fix the page pin parameter to ensure SEV guest or CSV guest won't pin the CMA pages.
  2. Introduce CSV3 platform and guest management APIs
  3. Provide CMA support for CSV3
  4. Implement CSV3 SET_SMR/SET_SMCR command

Xin Jiang added 4 commits August 17, 2024 15:33
hygon inclusion
category: bugfix
CVE: NA

---------------------------

When pin_user_pages_fast pin SEV guest memory without FOLL_LONGTERM
flag, the pinning pages may be in CMA area, which resulting in other
applications may can't use the CMA area because the pinning pages
can't be migrated.

Add FOLL_LONGTERM flag to pin_user_pages_fast, which makes sure that we
don't keep non_movable pages (due to page reference count) in CMA area.
So CMA area can be allocated by other applications.

Signed-off-by: Xin Jiang <[email protected]>
Signed-off-by: hanliyang <[email protected]>
hygon inclusion
category: feature
CVE: NA

---------------------------

Define Hygon CSV3 key management command id and structure. CSV3 is
the technology for Hygon secure virtualization to improve security
of guest with secure isolated memory technology in hardware.

The command definition is available in CSV3 spec.

Signed-off-by: Xin Jiang <[email protected]>
Signed-off-by: hanliyang <[email protected]>
hygon inclusion
category: feature
CVE: NA

---------------------------

The private memory of a CSV3 guest is isolated from VMM and has to be
physically contiguous. CMA (Contiguous Memory Allocator) is a memory
allocator within the kernel for contiguous physical memory.

Use the CMA for the CSV3 private memory management. In order to
support CSV3, select MMU and CMA when CONIFG_HYGON_CSV is
configured.

Signed-off-by: Xin Jiang <[email protected]>
Signed-off-by: hanliyang <[email protected]>
hygon inclusion
category: feature
CVE: NA

---------------------------

Set guest memory regions in hygon hardware with SET_SMR command.
Secure memory control region(SMCR) is a special memory region which
is dedicated for CSV3 guest's meta data. SET_SMCR command is used to
set SMCR memory in hygon hardware. Both SET_SMR and SET_SMCR should
be issued early during platform initialization.

Signed-off-by: Xin Jiang <[email protected]>
Signed-off-by: hanliyang <[email protected]>
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign matrix-wsk for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deepin-ci-robot
Copy link

Hi @wojiaohanliyang. Thanks for your PR.

I'm waiting for a deepin-community member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@Avenger-285714 Avenger-285714 merged commit b822465 into deepin-community:linux-6.6.y Aug 19, 2024
2 of 5 checks passed
@wojiaohanliyang wojiaohanliyang deleted the linux-6.6.y-csv3-mm branch August 19, 2024 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants