[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.
signature.asc
Description: PGP signature
- [PATCH 0/5] x86: allow building without PC machine types, Paolo Bonzini, 2019/12/12
- [PATCH 1/5] i386: conditionally compile more files, Paolo Bonzini, 2019/12/12
- [PATCH 2/5] fw_cfg: allow building without other devices, Paolo Bonzini, 2019/12/12
- [PATCH 5/5] kvm: check before accessing PCMachineState fields, Paolo Bonzini, 2019/12/12
- Re: [PATCH 5/5] kvm: check before accessing PCMachineState fields,
Sergio Lopez <=
- [PATCH 4/5] pci-stub: add more MSI functions, Paolo Bonzini, 2019/12/12
- [PATCH 3/5] x86: move more functions to X86MachineState and x86.c, Paolo Bonzini, 2019/12/12