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

tsme-test: init at unstable-2022-12-07 #351062

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lynatic1337
Copy link

@lynatic1337 lynatic1337 commented Oct 25, 2024

Things done

Add https://github.com/AMDESE/mem-encryption-tests to nixpkgs. This adds a kernel module that allows to check whether TSME is enabled and working as intended on supported systems while booted.
Note: Testing this requires an supported AMD CPU and supported BIOS. For testing, please load the kernel module and check whether /sys/kernel/tsme exists.

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added the 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` label Oct 25, 2024
@NixOSInfra NixOSInfra added the 12. first-time contribution This PR is the author's first one; please be gentle! label Oct 25, 2024
@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 11-100 labels Oct 25, 2024
Copy link
Member

@FliegendeWurst FliegendeWurst left a comment

Choose a reason for hiding this comment

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

Just some general suggestions. Unfortunately I can't test the module.

pkgs/os-specific/linux/mem-encryption-tests/default.nix Outdated Show resolved Hide resolved
pkgs/os-specific/linux/mem-encryption-tests/default.nix Outdated Show resolved Hide resolved
pkgs/os-specific/linux/mem-encryption-tests/default.nix Outdated Show resolved Hide resolved
pkgs/os-specific/linux/mem-encryption-tests/default.nix Outdated Show resolved Hide resolved
@lynatic1337
Copy link
Author

lynatic1337 commented Oct 27, 2024

Thanks for the suggestions and fixes @zi3m5f @FliegendeWurst, I've included them all in this new revision <3
Additionally I fixed the wrong attributes that somehow made it into this file by accident, the revision before would build the module for some kernel but not the kernel used in the system configuration.

edit: fixed the commit and PR titles as well

@lynatic1337 lynatic1337 changed the title mem-encryption-tests: init at 0-master-2022-12-07 mem-encryption-tests: init at 0-unstable-2022-12-07 Oct 27, 2024
Copy link
Contributor

@zi3m5f zi3m5f left a comment

Choose a reason for hiding this comment

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

  • Checked githubId

I think the package name should contain tsme to be easier to find.

pkgs/os-specific/linux/mem-encryption-tests/default.nix Outdated Show resolved Hide resolved
pkgs/os-specific/linux/mem-encryption-tests/default.nix Outdated Show resolved Hide resolved
pkgs/top-level/linux-kernels.nix Outdated Show resolved Hide resolved
pkgs/os-specific/linux/mem-encryption-tests/default.nix Outdated Show resolved Hide resolved
pkgs/os-specific/linux/mem-encryption-tests/default.nix Outdated Show resolved Hide resolved
pkgs/os-specific/linux/mem-encryption-tests/default.nix Outdated Show resolved Hide resolved
@lynatic1337 lynatic1337 changed the title mem-encryption-tests: init at 0-unstable-2022-12-07 tsme-test: init at unstable-2022-12-07 Oct 27, 2024
@lynatic1337
Copy link
Author

@zi3m5f thanks for the other suggestions, implemented them as well. Package is now renamed to tsme-test, in case AMD decides to add separate modules/tools for other memory-encryption systems we have to change the name back but considering the fact they haven't added any other modules in years...

INSTALL_MOD_PATH was left over from an old version and does nothing, apologies for not noticing.

Copy link
Contributor

@zi3m5f zi3m5f left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM :)

Build with latest kernel and checked with modinfo:

filename: result/lib/modules/6.11.5/extra/tsme-test.ko
description: TSME test module
license: GPL
author: Advanced Micro Devices, Inc.
depends:
retpoline: Y
name: tsme_test
vermagic: 6.11.5 SMP preempt mod_unload
parm: debug: print extra debug information - any non-zero value (uint)

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 11-100 11.by: package-maintainer This PR was created by the maintainer of the package it changes 12.approvals: 1 This PR was reviewed and approved by one reputable person 12. first-time contribution This PR is the author's first one; please be gentle!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants