AMDESE / sev-guest

Tools, scripts, and configuration files necessary to demonstrate an end-to-end remote attestation example with SEV-SNP.
Apache License 2.0
56 stars 28 forks source link

Missing `/dev/sev-guest` when trying to get the attestation report #20

Closed cowbon closed 2 years ago

cowbon commented 2 years ago

Hi there, I'm trying to run sec-guest get-report report.bin in the guest is getting the following error:

[sev-guest]root@localhost# ./sev-guest get-report report.bin
Generating report using the following hash: 
    0000000000000000000000000000000000000000000000000000000000000000
    0000000000000000000000000000000000000000000000000000000000000000

open: No such file or directory
get_report: No such file or directory

Based on the source code, it's looking for /dev/sev-guest, which is not my case. I'm using the kernel in AMDESE/AMDSEV for the guest and the guest kernel version is 5.17.0-rc6-snp-guest-dfa5ba8 . The truncated dmesg output is the following in the guest

[    0.011868] memblock_alloc_try_nid: 8208 bytes align=0x1000 nid=-1 from=0x0000000000000000 max_addr=0x0000000000000000 sev_es_init_vc_handling+0xea/0x169
[    0.012020] memblock_alloc_try_nid: 8208 bytes align=0x1000 nid=-1 from=0x0000000000000000 max_addr=0x0000000000000000 sev_es_init_vc_handling+0xea/0x169
[    0.012150] memblock_alloc_try_nid: 8208 bytes align=0x1000 nid=-1 from=0x0000000000000000 max_addr=0x0000000000000000 sev_es_init_vc_handling+0xea/0x169
[    0.012273] memblock_alloc_try_nid: 8208 bytes align=0x1000 nid=-1 from=0x0000000000000000 max_addr=0x0000000000000000 sev_es_init_vc_handling+0xea/0x169
[    1.967344] AMD Memory Encryption Features active: SEV SEV-ES SEV-SNP
[    2.332836] SEV: Using SNP CPUID table, 31 entries present.
[    2.544657] SEV: SNP guest platform device initialized.

My understanding is the kernel module for sev-guest was loaded successfully, but I don't know why I cannot find it under /dev

caiqs-sys commented 2 years ago

I think you should use the guest kernel version as documented in the stable-commits file of the sev-snp-devel branch of the AMDSEV repo. Now the guest kernel is based 5.19, not 5.17.

cowbon commented 2 years ago

This is resolved, see this