On Mon, May 03, 2021 at 01:01:22PM -0500, Eric Blake wrote: > On 4/30/21 1:24 AM, Yang Zhong wrote: > > Since there is no fill_device_info() callback support, and when we > > execute "info memory-devices" command in the monitor, the segfault > > will be found. > > > > This patch will add this callback support and "info memory-devices" > > will show sgx epc memory exposed to guest. The result as below: > > > > qemu) info memory-devices > > Memory device [sgx-epc]: "epc1" > > memaddr: 0x180000000 > > size: 29360128 > > memdev: /objects/mem1 > > Memory device [sgx-epc]: "epc2" > > memaddr: 0x181c00000 > > size: 10485760 > > memdev: /objects/mem2 > > > > Signed-off-by: Yang Zhong <yang.zh...@intel.com> > > --- > > > +++ b/qapi/machine.json > > @@ -1184,6 +1184,29 @@ > > } > > } > > > > +## > > +# @SgxEPCDeviceInfo: > > +# > > +# Sgx EPC state information > > +# > > +# @id: device's ID > > +# > > +# @memaddr: physical address in memory, where device is mapped > > +# > > +# @size: size of memory that the device provides > > +# > > +# @memdev: memory backend linked with device > > +# > > +# Since: 5.1 > > 6.1
Eric, thanks for your comments, i will change this in the next version, thanks! Yang > > > +## > > +{ 'struct': 'SgxEPCDeviceInfo', > > + 'data': { '*id': 'str', > > + 'memaddr': 'size', > > + 'size': 'size', > > + 'memdev': 'str' > > + } > > +} > > + > > ## > > # @MemoryDeviceInfo: > > # > > @@ -1198,7 +1221,8 @@ > > 'data': { 'dimm': 'PCDIMMDeviceInfo', > > 'nvdimm': 'PCDIMMDeviceInfo', > > 'virtio-pmem': 'VirtioPMEMDeviceInfo', > > - 'virtio-mem': 'VirtioMEMDeviceInfo' > > + 'virtio-mem': 'VirtioMEMDeviceInfo', > > + 'sgx-epc': 'SgxEPCDeviceInfo' > > } > > } > > > > > > -- > Eric Blake, Principal Software Engineer > Red Hat, Inc. +1-919-301-3226 > Virtualization: qemu.org | libvirt.org