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

qemu-system-x86_64: KVM_TDX_INIT_MEM_REGION failed Input/output error #319

Open
elodj opened this issue Jan 23, 2025 · 3 comments
Open

qemu-system-x86_64: KVM_TDX_INIT_MEM_REGION failed Input/output error #319

elodj opened this issue Jan 23, 2025 · 3 comments

Comments

@elodj
Copy link

elodj commented Jan 23, 2025

Describe the support request
Attempting to start up TD created via a slightly modified create-td-image.sh. (modification fixes the virt "--os-variant ubuntu24.04 missing failure by using a pre downloaded iso file")

Qemu command

$ sudo /opt/qemu-tdx/bin/qemu-system-x86_64 -accel kvm \
 -name process=tdx,debug-threads=on \
 -m 16G \
 -vga none \
 -monitor pty \
 -nodefaults \
 -drive file=./tdx-guest-ubuntu-24.04-intel.qcow2,if=virtio,format=qcow2 \
 -monitor telnet:127.0.0.1:9072,server,nowait \
 -bios ~/dev/edk2/Build/IntelTdx/DEBUG_GCC5/FV/OVMF.fd \
 -object tdx-guest,sept-ve-disable=on,id=tdx \
 -cpu host,-kvm-steal-time,pmu=off,tsc-freq=1000000000 \
 -machine q35,hpet=off,kernel_irqchip=split,memory-encryption=tdx \
 -device virtio-net-pci,netdev=mynet0 \
 -netdev user,id=mynet0,net=10.0.2.0/24,dhcpstart=10.0.2.15,hostfwd=tcp::10059-:22 \
 -smp 4 \
 -chardev stdio,id=mux,mux=on,logfile=/tmp/vm_log_2024-05-10T0232.log \
 -device virtio-serial,romfile= \
 -device virtconsole,chardev=mux \
 -monitor chardev:mux \
 -serial chardev:mux \
 -nographic

Note: I use my own compilation of qemu.

$ /opt/qemu-tdx/bin/qemu-system-x86_64 --version
QEMU emulator version 8.1.0
Copyright (c) 2003-2023 Fabrice Bellard and the QEMU Project developers

Note: I use my own OVMF.fd built by edk2 package. According to instructions found here: Instruction-to-set-up-TDX-host-and-guest.

Error
When attempting to boot I get this error.

qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.intel-pt [bit 25]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.intel-pt [bit 25]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.intel-pt [bit 25]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.intel-pt [bit 25]
qemu-system-x86_64: KVM_TDX_INIT_MEM_REGION failed Input/output error

What am I doing wrong?

Copy link

Thank you for reporting your feedback to us!

The internal ticket has been created: https://warthogs.atlassian.net/browse/PEK-1613.

This message was autogenerated

@frenchwr
Copy link
Collaborator

Hi @elodj ,

Note: I use my own compilation of qemu.

Was it extended in some way to support TDX? The setup instructions (see the README) in this repo install custom versions of qemu and libvirt (among several other packages) to support TDX on Ubuntu, if you are following some other process we will not be able to offer support.

@elodj
Copy link
Author

elodj commented Jan 24, 2025

Hi @frenchwr ,

Was it extended in some way to support TDX? The setup instructions (see the README) in this repo install custom versions of qemu and libvirt (among several other packages) to support TDX on Ubuntu, if you are following some other process we will not be able to offer support.

Yes, qemu installation has TDX support, source: git clone --branch tdx-qemu-next-2023.9.21-v8.1.0 https://github.com/intel/qemu-tdx, can update this if needed. Additionally functionality of qemu was verified in a custom NixOS TD solution.

I don't think libvirt was modified in any way. Version info:

$ virsh --version
9.0.0

Server host - os info:

$ hostnamectl | grep -E "Operating System:|Kernel:"
Operating System: Debian GNU/Linux 12 (bookworm)
          Kernel: Linux 6.6.0-rc2-dirty

Hosts setup follows instructions in the cannonical/tdx and intel/tdx-linux repos, including kernel patches. TDX services are verified and functional on the host.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants