Message ID | 1576161021-5359-6-git-send-email-pbonzini@redhat.com |
---|---|
State | New |
Headers | show |
Series | x86: allow building without PC machine types | expand |
Paolo Bonzini <pbonzini@redhat.com> writes: > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> > --- > 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.
On 12/12/19 17:11, Sergio Lopez wrote: >> } >> >> - 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. Ok, I will do that. Paolo
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 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); }
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> --- roms/SLOF | 2 +- target/i386/kvm.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-)