[libvirt] [PATCH v3 1/9] qemu: provide support to query the SEV capability

Brijesh Singh brijesh.singh at amd.com
Tue Mar 27 14:26:17 UTC 2018



On 03/26/2018 09:32 AM, Andrea Bolognani wrote:
> On Mon, 2018-03-26 at 08:52 -0500, Brijesh Singh wrote:
>>> I tried applying just this patch, but kept getting:
>>>
>>> 29) caps_2.12.0(x86_64)
>>> ... libvirt: QEMU Driver error : internal error: query-cpu-definitions
>>> reply data was not an array
>>>
>>> a small bit of debugging found that qemuMonitorJSONGetCPUDefinitions was
>>> returning NULL for @data after/when the "query-sev-capabilities".
>>>
>>> I narrowed it down into the virQEMUCapsInitQMPMonitor when run during
>>> qemucapabilitiestest (see [1])
>>
>> I have not tried latest libvirt yet, I will try this today and debug to
>> see what we are missing. I did the 'make check' before submitting the
>> patch but at that time QEMU 2.12 was not available and we did not had
>> updated caps_2.12.0.x86_64.xml and caps_2.12.0.x86_64.replies.
> 
> I thought the lack of churn in tests/qemucapabilitiesdata/ was
> weird, but thanks to your explanation it makes perfect sense now.
> 
> Your code adds a call to query-sev-capabilities, but the replies
> file doesn't contain the corresponding return data, which makes
> the parser go out of sync.
> 
> You're going to have to either fetch capabilities from your own
> QEMU 2.12 binary or hack it up by adding the return data in the
> right spot and call tests/qemucapsfixreplies to re-align the ids.
> 

Right, running the tests/qemucapsprobe on my system I see that 
query-sev-capabilities command returns a valid data. In my local branch, 
I updated the caps_2.12.0.x86_64.replies with response. With those 
changes I no longer get the internal error but 
tests/qemucapabilitiestest still fails for me with below error message:

29) caps_2.12.0(x86_64)                                               ...
  In 
'/home/amd/workdir/upstream/libvirt/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml':
  Offset 7143
  Expect [060]
  Actual [306]

It is basically pointing to microcode version change, do I need to 
update the cap with new version ?



> I think you can get away with the latter, as we're going to want
> to refresh the replies files once 2.12 is released anyway.
> 

I am not able to follow this comment, let me explain the situation.
The QEMU_CAPS_SEV flag was set to indicate QEMU supports the 
'query-sev-capabilities' QMP command and sev-guest object. That merely 
indicates that command exist but does not means that command will always 
execute successfully. e.g If hypervisor does not support the SEV feature 
then query-sev-capabilities will return error. That means if 
tests/qemucapsprobe is used to generate the replies on non-SEV capable 
system then .replies will not contain output of query-sev-capabilities 
command. Will this be an issue ?

-Brijesh




More information about the libvir-list mailing list