AMDESE / AMDSEV

AMD Secure Encrypted Virtualization
294 stars 85 forks source link

Possible snp-latest conflicts with vTPM #173

Closed wdsun1008 closed 1 year ago

wdsun1008 commented 1 year ago

I found the following issue when using the host kernel and qemu from snp-latest: When I start qemu using libvirt, vTPM is enabled by default, libvirt use tpm-crb as the default tpm interface, the snp vm can't start with qemu error:

qemu-system-x86_64: -device {"driver":"tpm-crb","tpmdev":"tpm-tpm0","id":"tpm0"}: backing store size 0xf80 does not match 'size' option 0x1000

I noticed the difference between qemu/tpm/tis-interface and qemu/tpm/crb-interface

The CRB interface makes a memory mapped IO region in the area 0xfed40000-0xfed40fff (1 locality) available to the guest operating system.

I changed my libvirt config to tpm-tis and the virtual machine runs fine now. I'm wondering if this is related to crb and snp's current memory-backend-memfd-private?

mdroth commented 1 year ago

I was able to reproduce and pushed a likely fix to the AMDESE qemu snp-latest branch:

https://github.com/AMDESE/qemu/commit/d3cb67d84111d18660f17aee3b836f55eecc3fca

Closing issue, but please re-open if you're still seeing issues.