|
From: | Paolo Bonzini |
Subject: | Re: [PATCH v3 05/33] vl: Add sgx compound properties to expose SGX EPC sections to guest |
Date: | Fri, 9 Jul 2021 18:07:13 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 |
On 09/07/21 13:09, Yang Zhong wrote:
+ sgx_epc = g_malloc0(sizeof(*sgx_epc)); + pcms->sgx_epc = sgx_epc; +
No need to malloc this, it's small.
}+##+# @SgxEPC: +# +# Sgx EPC cmdline information +# +# @id: device's ID +# +# @memdev: memory backend linked with device +# +# Since: 6.1 +## +{ 'struct': 'SgxEPC', + 'data': { 'id': [ 'str' ], + 'memdev': [ 'str' ] + } +}
Is the "id" needed at all? If not, you can make the property just a string list.
If not, you should still make the property a list, and SgxEPC can be just the id/memdev pair.
Also please place the compound property in PCMachineState, not in MachineState. You can call the field something else than sgx_epc to avoid conflicts with the SGXEPCState, for example sgx_epc_memdevs or sgx_epc_backends. Later it can be moved to X86MachineState if needed, but in any case it should not be in common target-independent code.
Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |