[PATCH 0/2] qemu: fix capabilities reporting for TDX

Daniel P. Berrangé via Devel posted 2 patches 21 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20251120115754.3528749-1-berrange@redhat.com
src/qemu/qemu_capabilities.c                  | 71 +++++++++++++++++--
src/qemu/qemu_capabilities.h                  |  3 +
.../qemu_10.0.0-q35.x86_64+amdsev.xml         |  1 +
.../domaincapsdata/qemu_10.0.0-q35.x86_64.xml |  1 +
.../qemu_10.0.0-tcg.x86_64+amdsev.xml         |  1 +
.../domaincapsdata/qemu_10.0.0-tcg.x86_64.xml |  1 +
.../qemu_10.0.0.x86_64+amdsev.xml             |  1 +
tests/domaincapsdata/qemu_10.0.0.x86_64.xml   |  1 +
.../qemu_10.1.0-tcg.x86_64+inteltdx.xml       |  1 +
.../domaincapsdata/qemu_10.1.0-tcg.x86_64.xml |  1 +
.../domaincapsdata/qemu_10.2.0-tcg.x86_64.xml |  1 +
.../domaincapsdata/qemu_6.2.0-q35.x86_64.xml  |  1 +
.../domaincapsdata/qemu_6.2.0-tcg.x86_64.xml  |  1 +
tests/domaincapsdata/qemu_6.2.0.x86_64.xml    |  1 +
.../domaincapsdata/qemu_7.0.0-q35.x86_64.xml  |  1 +
.../domaincapsdata/qemu_7.0.0-tcg.x86_64.xml  |  1 +
tests/domaincapsdata/qemu_7.0.0.x86_64.xml    |  1 +
.../domaincapsdata/qemu_7.1.0-q35.x86_64.xml  |  1 +
.../domaincapsdata/qemu_7.1.0-tcg.x86_64.xml  |  1 +
tests/domaincapsdata/qemu_7.1.0.x86_64.xml    |  1 +
.../qemu_7.2.0-hvf.x86_64+hvf.xml             |  1 +
.../domaincapsdata/qemu_7.2.0-q35.x86_64.xml  |  1 +
.../qemu_7.2.0-tcg.x86_64+hvf.xml             |  1 +
.../domaincapsdata/qemu_7.2.0-tcg.x86_64.xml  |  1 +
tests/domaincapsdata/qemu_7.2.0.x86_64.xml    |  1 +
.../domaincapsdata/qemu_8.0.0-q35.x86_64.xml  |  1 +
.../domaincapsdata/qemu_8.0.0-tcg.x86_64.xml  |  1 +
tests/domaincapsdata/qemu_8.0.0.x86_64.xml    |  1 +
.../domaincapsdata/qemu_8.1.0-q35.x86_64.xml  |  1 +
.../domaincapsdata/qemu_8.1.0-tcg.x86_64.xml  |  1 +
tests/domaincapsdata/qemu_8.1.0.x86_64.xml    |  1 +
.../domaincapsdata/qemu_8.2.0-q35.x86_64.xml  |  1 +
.../domaincapsdata/qemu_8.2.0-tcg.x86_64.xml  |  1 +
tests/domaincapsdata/qemu_8.2.0.x86_64.xml    |  1 +
.../domaincapsdata/qemu_9.0.0-q35.x86_64.xml  |  1 +
.../domaincapsdata/qemu_9.0.0-tcg.x86_64.xml  |  1 +
tests/domaincapsdata/qemu_9.0.0.x86_64.xml    |  1 +
.../domaincapsdata/qemu_9.1.0-q35.x86_64.xml  |  1 +
.../domaincapsdata/qemu_9.1.0-tcg.x86_64.xml  |  1 +
tests/domaincapsdata/qemu_9.1.0.x86_64.xml    |  1 +
.../qemu_9.2.0-q35.x86_64+amdsev.xml          |  1 +
.../domaincapsdata/qemu_9.2.0-q35.x86_64.xml  |  1 +
.../qemu_9.2.0-tcg.x86_64+amdsev.xml          |  1 +
.../domaincapsdata/qemu_9.2.0-tcg.x86_64.xml  |  1 +
.../qemu_9.2.0.x86_64+amdsev.xml              |  1 +
tests/domaincapsdata/qemu_9.2.0.x86_64.xml    |  1 +
tests/domaincapsmock.c                        |  6 ++
47 files changed, 120 insertions(+), 4 deletions(-)
[PATCH 0/2] qemu: fix capabilities reporting for TDX
Posted by Daniel P. Berrangé via Devel 21 hours ago
The capabilities reporting merged for TDX was flawed because
it would always report TDX as supported simply if QEMU was
new enough to have 'tdx-guest'.

IOW, all x86 hosts currently report 'tdx' as fully supported
which is a regression for AMD hosts, as we're now reporting
incorrect data there which can confuse mgmt apps.

Unfortunately the 'query-tdx-capabilities' QMP command that
was in early postings:

https://mail.gnu.org/archive/html/qemu-devel/2021-07/msg01689.html

went missing and I'm not seeing an alternative way to query
QEMU to see if TDX is actually launchable. So in these patches
I open /dev/kvm and directly ask of the 'TDX' VM type is
supported by KVM, which IIUC is equivalent to waht the original
'query-tdx-capabilities' patch was doing.

Daniel P. Berrangé (2):
  qemu: correctly detect working TDX support
  qemu: always report TDX feature caps on x86

 src/qemu/qemu_capabilities.c                  | 71 +++++++++++++++++--
 src/qemu/qemu_capabilities.h                  |  3 +
 .../qemu_10.0.0-q35.x86_64+amdsev.xml         |  1 +
 .../domaincapsdata/qemu_10.0.0-q35.x86_64.xml |  1 +
 .../qemu_10.0.0-tcg.x86_64+amdsev.xml         |  1 +
 .../domaincapsdata/qemu_10.0.0-tcg.x86_64.xml |  1 +
 .../qemu_10.0.0.x86_64+amdsev.xml             |  1 +
 tests/domaincapsdata/qemu_10.0.0.x86_64.xml   |  1 +
 .../qemu_10.1.0-tcg.x86_64+inteltdx.xml       |  1 +
 .../domaincapsdata/qemu_10.1.0-tcg.x86_64.xml |  1 +
 .../domaincapsdata/qemu_10.2.0-tcg.x86_64.xml |  1 +
 .../domaincapsdata/qemu_6.2.0-q35.x86_64.xml  |  1 +
 .../domaincapsdata/qemu_6.2.0-tcg.x86_64.xml  |  1 +
 tests/domaincapsdata/qemu_6.2.0.x86_64.xml    |  1 +
 .../domaincapsdata/qemu_7.0.0-q35.x86_64.xml  |  1 +
 .../domaincapsdata/qemu_7.0.0-tcg.x86_64.xml  |  1 +
 tests/domaincapsdata/qemu_7.0.0.x86_64.xml    |  1 +
 .../domaincapsdata/qemu_7.1.0-q35.x86_64.xml  |  1 +
 .../domaincapsdata/qemu_7.1.0-tcg.x86_64.xml  |  1 +
 tests/domaincapsdata/qemu_7.1.0.x86_64.xml    |  1 +
 .../qemu_7.2.0-hvf.x86_64+hvf.xml             |  1 +
 .../domaincapsdata/qemu_7.2.0-q35.x86_64.xml  |  1 +
 .../qemu_7.2.0-tcg.x86_64+hvf.xml             |  1 +
 .../domaincapsdata/qemu_7.2.0-tcg.x86_64.xml  |  1 +
 tests/domaincapsdata/qemu_7.2.0.x86_64.xml    |  1 +
 .../domaincapsdata/qemu_8.0.0-q35.x86_64.xml  |  1 +
 .../domaincapsdata/qemu_8.0.0-tcg.x86_64.xml  |  1 +
 tests/domaincapsdata/qemu_8.0.0.x86_64.xml    |  1 +
 .../domaincapsdata/qemu_8.1.0-q35.x86_64.xml  |  1 +
 .../domaincapsdata/qemu_8.1.0-tcg.x86_64.xml  |  1 +
 tests/domaincapsdata/qemu_8.1.0.x86_64.xml    |  1 +
 .../domaincapsdata/qemu_8.2.0-q35.x86_64.xml  |  1 +
 .../domaincapsdata/qemu_8.2.0-tcg.x86_64.xml  |  1 +
 tests/domaincapsdata/qemu_8.2.0.x86_64.xml    |  1 +
 .../domaincapsdata/qemu_9.0.0-q35.x86_64.xml  |  1 +
 .../domaincapsdata/qemu_9.0.0-tcg.x86_64.xml  |  1 +
 tests/domaincapsdata/qemu_9.0.0.x86_64.xml    |  1 +
 .../domaincapsdata/qemu_9.1.0-q35.x86_64.xml  |  1 +
 .../domaincapsdata/qemu_9.1.0-tcg.x86_64.xml  |  1 +
 tests/domaincapsdata/qemu_9.1.0.x86_64.xml    |  1 +
 .../qemu_9.2.0-q35.x86_64+amdsev.xml          |  1 +
 .../domaincapsdata/qemu_9.2.0-q35.x86_64.xml  |  1 +
 .../qemu_9.2.0-tcg.x86_64+amdsev.xml          |  1 +
 .../domaincapsdata/qemu_9.2.0-tcg.x86_64.xml  |  1 +
 .../qemu_9.2.0.x86_64+amdsev.xml              |  1 +
 tests/domaincapsdata/qemu_9.2.0.x86_64.xml    |  1 +
 tests/domaincapsmock.c                        |  6 ++
 47 files changed, 120 insertions(+), 4 deletions(-)

-- 
2.51.1