On Fri, Sep 03, 2021 at 10:43:19AM -0500, Michael Roth wrote: > On Fri, Sep 03, 2021 at 04:30:48PM +0100, Daniel P. Berrangé wrote: > > On Fri, Sep 03, 2021 at 10:13:16AM -0500, Michael Roth wrote: > > > On Wed, Sep 01, 2021 at 04:14:10PM +0200, Markus Armbruster wrote: > > > > Michael Roth <michael.roth@xxxxxxx> writes: > > > > > > > > > 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). > > > > > > > > Technically a compatibility break: query-sev can now return an object > > > > that whose member @policy has different meaning, and also lacks @handle. > > > > > > > > Matrix: > > > > > > > > Old mgmt app New mgmt app > > > > Old QEMU, SEV/SEV-ES good good(1) > > > > New QEMU, SEV/SEV-ES good(2) good > > > > New QEMU, SEV-SNP bad(3) good > > > > > > > > Notes: > > > > > > > > (1) As long as the management application can cope with absent member > > > > @sev-type. > > > > > > > > (2) As long as the management application ignores unknown member > > > > @sev-type. > > > > > > > > (3) Management application may choke on missing member @handle, or > > > > worse, misinterpret member @policy. Can only happen when something > > > > other than the management application created the SEV-SNP guest (or the > > > > user somehow made the management application create one even though it > > > > doesn't know how, say with CLI option passthrough, but that's always > > > > fragile, and I wouldn't worry about it here). > > > > > > > > I think (1) and (2) are reasonable. (3) is an issue for management > > > > applications that support attaching to existing guests. Thoughts? > > > > > > Hmm... yah I hadn't considering 'old mgmt' trying to interact with a SNP > > > guest started through some other means. > > > > > > Don't really see an alternative other than introducing a new > > > 'query-sev-snp', but that would still leave 'old mgmt' broken, since > > > it might still call do weird stuff like try to interpret the SNP policy > > > as an SEV/SEV-ES and end up with some very unexpected results. So if I > > > did go this route, I would need to have QMP begin returning an error if > > > query-sev is run against an SNP guest. But currently for non-SEV guests > > > it already does: > > > > > > error_setg(errp, "SEV feature is not available") > > > > > > so 'old mgmt' should be able to handle the error just fine. > > > > > > Would that approach be reasonable? > > > > This ties into the question I've just sent in my other mail. > > > > If the hardware strictly requires that guest are created in SEV-SNP > > mode only, and will not support SEV/SEV-ES mode, then we need to > > ensure "query-sev" reports the feature as not-available, so that > > existing mgmt apps don't try to use SEV/SEV-ES. > > An SEV-SNP-capable host can run both 'legacy' SEV/SEV-ES, as well as > SEV-SNP guests, at the same time. But as far as QEMU goes, we need > to specify one or the other explicitly at launch time, via existing > 'sev-guest', or the new 'sev-snp-guest' ConfidentialGuestSupport type. > > > > > If the SEV-SNP hardware is functionally back-compatible with a gues > > configured in SEV/SEV-ES mode, then we souldn't need a new command, > > just augment th eexisting command with additional field(s), to > > indicate existance of SEV-SNP features. > > query-sev-info provides information specific to the guest instance, > like the configured policy. Are you thinking of query-sev-capabilities, > which reports some host-wide information and should indeed remain > available for either case. (and maybe should also be updated to report > on SEV-SNP availability for the host?) Oh right, yes, I am getting confused with query-sev-capabilities. I think this means everything is OK with your query-sev-info changes proposed here, I'll reply direct to Markus' point though. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|