i386/sev: Update query-sev QAPI format to handle SEV-SNP
authorMichael Roth <michael.roth@amd.com>
Thu, 30 May 2024 11:16:26 +0000 (06:16 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 5 Jun 2024 09:01:06 +0000 (11:01 +0200)
commit59d3740cb4ac0f010ce35877572904f6297284b4
tree9fcb30d6909fb2e6a4d32da52d7ca9ff34276b2a
parenta808132f6d8e855bd83a400570ec91d2e00bebe3
i386/sev: Update query-sev QAPI format to handle SEV-SNP

Most of the current 'query-sev' command is relevant to both legacy
SEV/SEV-ES guests and SEV-SNP guests, with 2 exceptions:

  - 'policy' is a 64-bit field for SEV-SNP, not 32-bit, and
    the meaning of the bit positions has changed
  - 'handle' is not relevant to SEV-SNP

To address this, this patch adds a new 'sev-type' field that can be
used as a discriminator to select between SEV and SEV-SNP-specific
fields/formats without breaking compatibility for existing management
tools (so long as management tools that add support for launching
SEV-SNP guest update their handling of query-sev appropriately).

The corresponding HMP command has also been fixed up similarly.

Signed-off-by: Michael Roth <michael.roth@amd.com>
Co-developed-by:Pankaj Gupta <pankaj.gupta@amd.com>
Signed-off-by: Pankaj Gupta <pankaj.gupta@amd.com>
Message-ID: <20240530111643.1091816-15-pankaj.gupta@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
qapi/misc-target.json
target/i386/sev.c
target/i386/sev.h