qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PULL 48/87] x86: move SMM property to X86MachineState


From: Michal Prívozník
Subject: Re: [PULL 48/87] x86: move SMM property to X86MachineState
Date: Mon, 23 Dec 2019 12:28:43 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0

On 12/18/19 1:02 PM, Paolo Bonzini wrote:
> Add it to microvm as well, it is a generic property of the x86
> architecture.
> 
> Suggested-by: Sergio Lopez <address@hidden>
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
>  hw/i386/pc.c          | 49 -------------------------------------------------
>  hw/i386/pc_piix.c     |  6 +++---
>  hw/i386/pc_q35.c      |  2 +-
>  hw/i386/x86.c         | 50 +++++++++++++++++++++++++++++++++++++++++++++++++-
>  include/hw/i386/pc.h  |  3 ---
>  include/hw/i386/x86.h |  5 +++++
>  target/i386/kvm.c     |  3 +--
>  7 files changed, 59 insertions(+), 59 deletions(-)
> 


> diff --git a/target/i386/kvm.c b/target/i386/kvm.c
> index ef63f3a..c7ff67a 100644
> --- a/target/i386/kvm.c
> +++ b/target/i386/kvm.c
> @@ -2173,8 +2173,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
>      }
>  
>      if (kvm_check_extension(s, KVM_CAP_X86_SMM) &&
> -        object_dynamic_cast(OBJECT(ms), TYPE_PC_MACHINE) &&
> -        pc_machine_is_smm_enabled(PC_MACHINE(ms))) {
> +        x86_machine_is_smm_enabled(X86_MACHINE(ms))) {
>          smram_machine_done.notify = register_smram_listener;
>          qemu_add_machine_init_done_notifier(&smram_machine_done);
>      }
> 

Sorry for not catching this earlier, but I don't think this is right.
The @ms is not instance of X


After I refreshed my qemu master I realized that libvirt is unable to
fetch capabilities. Libvirt runs the following command:

  qemu.git $ ./x86_64-softmmu/qemu-system-x86_64 -S -no-user-config
-nodefaults -nographic -machine none,accel=kvm:tcg

plus some other (for now) irrelevant args. But qemu fails to initialize:

  qemu.git/target/i386/kvm.c:2176:kvm_arch_init: Object 0x563493f306b0
is not an instance of type x86-machine

and indeed it is not:

#0  0x00007ffff50acd21 in __GI_raise (sig=sig@entry=6) at
../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff5096535 in __GI_abort () at abort.c:79
#2  0x0000555555d23275 in object_dynamic_cast_assert
(obj=0x5555567846b0, typename=0x555555fd42f7 "x86-machine",
file=0x555555fd3878 "/home/zippy/work/qemu/qemu.git/target/i386/kvm.c",
line=2176, func=0x555555fd4eb0 <__func__.31258> "kvm_arch_init") at
qom/object.c:815
#3  0x0000555555a1c3fb in kvm_arch_init (ms=0x5555567846b0,
s=0x5555568a8430) at /home/zippy/work/qemu/qemu.git/target/i386/kvm.c:2176
#4  0x00005555558b4ad7 in kvm_init (ms=0x5555567846b0) at
/home/zippy/work/qemu/qemu.git/accel/kvm/kvm-all.c:2068
#5  0x0000555555a44f0a in accel_init_machine (accel=0x5555568a8430,
ms=0x5555567846b0) at accel/accel.c:55
#6  0x0000555555a3e28d in do_configure_accelerator
(opaque=0x7fffffffd6c2, opts=0x5555568a8290, errp=0x5555566f34f0
<error_fatal>) at vl.c:2737
#7  0x0000555555e9b773 in qemu_opts_foreach (list=0x55555654ffe0
<qemu_accel_opts>, func=0x555555a3e1a8 <do_configure_accelerator>,
opaque=0x7fffffffd6c2, errp=0x5555566f34f0 <error_fatal>) at
util/qemu-option.c:1170
#8  0x0000555555a3e4cb in configure_accelerators
(progname=0x7fffffffdde1
"/home/zippy/work/qemu/qemu.git/x86_64-softmmu/qemu-system-x86_64") at
vl.c:2798
#9  0x0000555555a417a8 in main (argc=7, argv=0x7fffffffda08,
envp=0x7fffffffda48) at vl.c:4121


#2  0x0000555555d23275 in object_dynamic_cast_assert
(obj=0x5555567846b0, typename=0x555555fd42f7 "x86-machine",
file=0x555555fd3878 "/home/zippy/work/qemu/qemu.git/target/i386/kvm.c",
line=2176, func=0x555555fd4eb0 <__func__.31258> "kvm_arch_init") at
qom/object.c:815
815             abort();
object_dynamic_cast_assert 1 $ p obj->class->type->name
$4 = 0x5555567ad720 "none-machine"


Michal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]