On 9/8/21 10:19 AM, Yang Zhong wrote: > The monitor will coredump if we use 'info sgx' in the '-machine none' or > other non-x86 platform, add the sgx_enabled bool variable to avoid this > coredump issue.
But this code is only built for x86... > > ./qemu-system-x86_64 -S -no-user-config -nodefaults -nographic -machine > none,accel=kvm -monitor stdio > QEMU 6.1.50 monitor - type 'help' for more information > (qemu) info sgx > /home/vmm/project/upstream/9-8/qemu/include/hw/i386/x86.h:93:X86_MACHINE: > Object 0x5615d71a6fd0 is not an instance of type x86-machine > Aborted (core dumped) Paolo suggested on IRC to use object_class_dynamic_cast(). > > Signed-off-by: Yang Zhong <yang.zh...@intel.com> > --- > hw/i386/sgx.c | 32 +++++++++++++++++++------------- > 1 file changed, 19 insertions(+), 13 deletions(-)