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

cpu: expose the total number of AMD SEV ASID and ES #1149

Merged
merged 1 commit into from
Apr 17, 2023

Conversation

ArangoGutierrez
Copy link
Contributor

This patch add SEV ASIDs and the related (but distinct) SEV Encrypted State (SEV-ES) IDs as two quantities to be exposed via extended resources. In a kernel built with CONFIG_CGROUP_MISC on a suitably equipped AMD CPU, the root control group will have a misc.capacity file that shows the number of available IDs in each category:

    $ cat misc.capacity
    sev 50
    sev_es 10

The added extended resources are:

  • sev.asids
  • sev.encrypted_state_ids

An example on how to expose them on a suitable system is:

apiVersion: nfd.k8s-sigs.io/v1alpha1
kind: NodeFeatureRule
metadata:
  name: sev-capacity
spec:
  rules:
    - name: "SEV system capacity"
      extendedResources:
       sev_asids: "@cpu.security.sev.asids"
       sev_es: "@cpu.security.sev.encrypted_state_ids"
      matchFeatures:
        - feature: cpu.security
          matchExpressions:
            sev.enabled: {op: Exists}

@k8s-ci-robot k8s-ci-robot added do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 17, 2023
@netlify
Copy link

netlify bot commented Apr 17, 2023

Deploy Preview for kubernetes-sigs-nfd ready!

Name Link
🔨 Latest commit 05ef5d4
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-nfd/deploys/643d8338ed1a0c000751dbfc
😎 Deploy Preview https://deploy-preview-1149--kubernetes-sigs-nfd.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Apr 17, 2023
@ArangoGutierrez
Copy link
Contributor Author

/cc @zvonkok

@k8s-ci-robot k8s-ci-robot requested a review from zvonkok April 17, 2023 16:18
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Apr 17, 2023
@zvonkok
Copy link
Contributor

zvonkok commented Apr 17, 2023

@ryansavino @larrydewey PTAL

@marquiz
Copy link
Contributor

marquiz commented Apr 17, 2023

Also, this PR doesn't have anything to do with extended resources directly, so I'd suggest to retitle (in commit message too), e.g. to cpu: expose the total number of AMD SEV ASID and ES

@ArangoGutierrez ArangoGutierrez changed the title Extended resource: Expose the total number of SEV ASID and ES cpu: expose the total number of AMD SEV ASID and ES Apr 17, 2023
@ArangoGutierrez ArangoGutierrez requested a review from marquiz April 17, 2023 16:41
@ArangoGutierrez
Copy link
Contributor Author

@marquiz can we add this to #1068 ?

@marquiz
Copy link
Contributor

marquiz commented Apr 17, 2023

@marquiz can we add this to #1068 ?

Yes, let's squeeze this small one in
/milestone v0.13.0

@k8s-ci-robot k8s-ci-robot added this to the v0.13.0 milestone Apr 17, 2023
This patch add SEV ASIDs and the related (but distinct) SEV Encrypted State
(SEV-ES) IDs as two quantities to be exposed via extended resources.
In a kernel built with CONFIG_CGROUP_MISC on a suitably equipped AMD CPU, the
root control group will have a misc.capacity file that shows the number of
available IDs in each category.

The added extended resources are:
- sev.asids
- sev.encrypted_state_ids

Signed-off-by: Carlos Eduardo Arango Gutierrez <[email protected]>
Copy link
Contributor

@marquiz marquiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ArangoGutierrez, to me this looks simple and good to get merged 👍

@zvonkok et al feel free to lgtm if/when you're happy

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ArangoGutierrez, marquiz

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

The pull request process is described 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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 17, 2023
@zvonkok
Copy link
Contributor

zvonkok commented Apr 17, 2023

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 17, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: a465b69d056fcf31b4baf5ba1a96d6f8c79e0332

@k8s-ci-robot k8s-ci-robot merged commit b0c52fe into kubernetes-sigs:master Apr 17, 2023
@marquiz marquiz mentioned this pull request Apr 18, 2023
24 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants