sev_do_cmd(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… sev_do_cmd β€” the Kernel API Manual page, bestie edition

okay so this is sev_do_cmd(9) from the Kernel API Manual section (that's the 9 bestie, kernel API vibes only) β€” and she's literally the girl who issues an SEV or an SEV-SNP firmware command. main character energy, no cap ✨


🌸 NAME 🌸

sev_do_cmd β€” issue an SEV or an SEV-SNP command. that's it. that's the whole job. she issues it. πŸŽ€


✨ SYNOPSIS ✨

int sev_do_cmd (int cmd , void *data , int *psp_ret );

like… three args, one int coming back at you. lowkey elegant fr fr πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • cmd β€” the SEV or SEV-SNP firmware command you want to issue. yes that one. the command. go off πŸ‘‘
  • data β€” the arguments for the firmware command. it's a void *, so she's mysterious, she's flexible, she's whatever you need her to be πŸ™ˆ
  • psp_ret β€” the SEV command return code. the receipts. the "what did the firmware actually say" file πŸ’€

πŸ”₯ RETURN πŸ”₯

so here's the vibe check on what you get back:

  • 0 β€” iconic. the SEV device successfully processed the command. slay ⭐
  • -ENODEV β€” the PSP device is not available. not me showing up to a party that doesn't exist 😭
  • -ENOTSUPP β€” the PSP device does not support SEV. she simply doesn't do that 🫢
  • -ETIMEDOUT β€” the SEV command timed out. it's giving waiting-for-a-text-back energy πŸ’€
  • -EIO β€” the PSP device returned a non-zero return code. something went sideways, bestie 🌈

πŸ’œ SEE ALSO πŸ’œ

get into it, the whole friend group showed up:

Kernel file: ./include/linux/psp-sev.h

and the structs / functions, in the exact order she lists them:

  • struct sev_data_init(9)
  • struct sev_data_init_ex(9)
  • struct sev_data_pek_csr(9)
  • struct sev_data_download_firmware(9)
  • struct sev_data_get_id(9)
  • struct sev_data_pdh_cert_export(9)
  • struct sev_data_decommission(9)
  • struct sev_data_activate(9)
  • struct sev_data_deactivate(9)
  • struct sev_data_guest_status(9)
  • struct sev_data_launch_start(9)
  • struct sev_data_launch_update_data(9)
  • struct sev_data_launch_update_vmsa(9)
  • struct sev_data_launch_measure(9)
  • struct sev_data_launch_secret(9)
  • struct sev_data_launch_finish(9)
  • struct sev_data_send_start(9)
  • struct sev_data_send_finish(9)
  • struct sev_data_send_cancel(9)
  • struct sev_data_receive_start(9)
  • struct sev_data_receive_update_data(9)
  • struct sev_data_receive_update_vmsa(9)
  • struct sev_data_receive_finish(9)
  • struct sev_data_dbg(9)
  • struct sev_data_attestation_report(9)
  • struct sev_data_snp_download_firmware(9)
  • struct sev_data_snp_activate(9)
  • struct sev_data_snp_addr(9)
  • struct sev_data_snp_launch_start(9)
  • struct sev_data_snp_launch_update(9)
  • struct sev_data_snp_launch_finish(9)
  • struct sev_data_snp_guest_status(9)
  • struct sev_data_snp_page_reclaim(9)
  • struct sev_data_snp_page_unsmash(9)
  • struct sev_data_snp_dbg(9)
  • struct sev_data_snp_guest_request(9)
  • struct sev_data_snp_init_ex(9)
  • struct sev_data_range(9)
  • struct sev_data_range_list(9)
  • struct sev_data_snp_shutdown_ex(9)
  • struct sev_platform_init_args(9)
  • struct sev_data_snp_commit(9)
  • struct sev_data_snp_feature_info(9)
  • struct sev_data_snp_verify_mitigation(9)
  • struct sev_data_snp_verify_mitigation_dst(9)
  • struct sev_snp_tcb_version_genoa_milan(9)
  • struct sev_snp_tcb_version_turin(9)
  • sev_module_init(9)
  • sev_platform_init(9)
  • sev_platform_status(9)
  • sev_issue_cmd_external_user(9)
  • sev_guest_deactivate(9)
  • sev_guest_activate(9)
  • sev_guest_df_flush(9)
  • sev_guest_decommission(9)

and that's the page, bestie πŸ§šπŸ’–

cute little sign-off so you know where she came from: this one lives in ./include/linux, she's dated October 2026, and her manual name is sev_do_cmd(9) β€” write it down, tell your friends, periodt πŸŽ€βœ¨

πŸ“¦ where this page comes from