qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 5/5] kvm: check before accessing PCMachineState fields


From: Sergio Lopez
Subject: Re: [PATCH 5/5] kvm: check before accessing PCMachineState fields
Date: Thu, 12 Dec 2019 17:11:30 +0100
User-agent: mu4e 1.2.0; emacs 26.2

Paolo Bonzini <address@hidden> writes:

> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
>  roms/SLOF         |  2 +-
>  target/i386/kvm.c | 11 +++++++++--
>  2 files changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/roms/SLOF b/roms/SLOF
> index 8ebf2f5..bcc3c4e 160000
> --- a/roms/SLOF
> +++ b/roms/SLOF
> @@ -1 +1 @@
> -Subproject commit 8ebf2f55e1ba1492b942ba4b682160e644fc0f98
> +Subproject commit bcc3c4e5c21a015f4680894c4ec978a90d4a2d69

I guess this was included by mistake.

> diff --git a/target/i386/kvm.c b/target/i386/kvm.c
> index ef63f3a..2ad5a94 100644
> --- a/target/i386/kvm.c
> +++ b/target/i386/kvm.c
> @@ -49,6 +49,7 @@
>  #include "migration/blocker.h"
>  #include "exec/memattrs.h"
>  #include "trace.h"
> +#include "config-devices.h"
>  
>  //#define DEBUG_KVM
>  
> @@ -2172,9 +2173,15 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
>          }
>      }
>  
> -    if (kvm_check_extension(s, KVM_CAP_X86_SMM) &&
> +    if (
> +#ifdef CONFIG_PC
> +        kvm_check_extension(s, KVM_CAP_X86_SMM) &&
>          object_dynamic_cast(OBJECT(ms), TYPE_PC_MACHINE) &&
> -        pc_machine_is_smm_enabled(PC_MACHINE(ms))) {
> +        pc_machine_is_smm_enabled(PC_MACHINE(ms))
> +#else
> +     0
> +#endif
> +       ) {
>          smram_machine_done.notify = register_smram_listener;
>          qemu_add_machine_init_done_notifier(&smram_machine_done);
>      }

I'm not familiar with SMM, can we consider it a PC specific thing? If it
isn't, perhaps we should move smm to X86MachineState.

Attachment: signature.asc
Description: PGP signature


reply via email to

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