From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55924) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUH4p-0004D9-Tv for qemu-devel@nongnu.org; Mon, 22 Apr 2013 09:46:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UUH4o-0004CR-Bk for qemu-devel@nongnu.org; Mon, 22 Apr 2013 09:46:39 -0400 Received: from cantor2.suse.de ([195.135.220.15]:58705 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUH4o-0004C2-31 for qemu-devel@nongnu.org; Mon, 22 Apr 2013 09:46:38 -0400 Message-ID: <51753F3D.2060608@suse.de> Date: Mon, 22 Apr 2013 15:46:37 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1366063976-4909-1-git-send-email-imammedo@redhat.com> <1366063976-4909-3-git-send-email-imammedo@redhat.com> In-Reply-To: <1366063976-4909-3-git-send-email-imammedo@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 02/16] cpu: call cpu_synchronize_post_init() from CPUClass.realize() if hotplugged List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov , Gleb Natapov Cc: aliguori@us.ibm.com, ehabkost@redhat.com, mst@redhat.com, jan.kiszka@siemens.com, claudio.fontana@huawei.com, qemu-devel@nongnu.org, aderumier@odiso.com, lcapitulino@redhat.com, jfrei@linux.vnet.ibm.com, yang.z.zhang@intel.com, pbonzini@redhat.com, lig.fnst@cn.fujitsu.com, rth@twiddle.net Am 16.04.2013 00:12, schrieb Igor Mammedov: > ... to synchronize CPU state to KVM >=20 > Signed-off-by: Igor Mammedov > --- > v2: > * linking kvm-stub.o to *-user target moved in separate patch > --- > include/sysemu/kvm.h | 18 ++++++++++-------- > kvm-all.c | 1 + > kvm-stub.c | 1 + > qom/cpu.c | 4 ++++ > vl.c | 1 - > 5 files changed, 16 insertions(+), 9 deletions(-) Looks okay to me. Gleb, can you ack? Andreas > diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h > index 93cef28..8fb2489 100644 > --- a/include/sysemu/kvm.h > +++ b/include/sysemu/kvm.h > @@ -250,8 +250,6 @@ int kvm_check_extension(KVMState *s, unsigned int e= xtension); > uint32_t kvm_arch_get_supported_cpuid(KVMState *env, uint32_t function= , > uint32_t index, int reg); > void kvm_cpu_synchronize_state(CPUArchState *env); > -void kvm_cpu_synchronize_post_reset(CPUState *cpu); > -void kvm_cpu_synchronize_post_init(CPUState *cpu); > =20 > /* generic hooks - to be moved/refactored once there are more users */ > =20 > @@ -262,6 +260,16 @@ static inline void cpu_synchronize_state(CPUArchSt= ate *env) > } > } > =20 > +#if !defined(CONFIG_USER_ONLY) > +int kvm_physical_memory_addr_from_host(KVMState *s, void *ram_addr, > + hwaddr *phys_addr); > +#endif > + > +#endif /* NEED_CPU_H */ > + > +void kvm_cpu_synchronize_post_reset(CPUState *cpu); > +void kvm_cpu_synchronize_post_init(CPUState *cpu); > + > static inline void cpu_synchronize_post_reset(CPUState *cpu) > { > if (kvm_enabled()) { > @@ -277,12 +285,6 @@ static inline void cpu_synchronize_post_init(CPUSt= ate *cpu) > } > =20 > =20 > -#if !defined(CONFIG_USER_ONLY) > -int kvm_physical_memory_addr_from_host(KVMState *s, void *ram_addr, > - hwaddr *phys_addr); > -#endif > - > -#endif > int kvm_set_ioeventfd_mmio(int fd, uint32_t adr, uint32_t val, bool as= sign, > uint32_t size); > =20 > diff --git a/kvm-all.c b/kvm-all.c > index fc4e17c..1d17128 100644 > --- a/kvm-all.c > +++ b/kvm-all.c > @@ -109,6 +109,7 @@ bool kvm_async_interrupts_allowed; > bool kvm_irqfds_allowed; > bool kvm_msi_via_irqfd_allowed; > bool kvm_gsi_routing_allowed; > +bool kvm_allowed; > =20 > static const KVMCapabilityInfo kvm_required_capabilites[] =3D { > KVM_CAP_INFO(USER_MEMORY), > diff --git a/kvm-stub.c b/kvm-stub.c > index a131305..4282e09 100644 > --- a/kvm-stub.c > +++ b/kvm-stub.c > @@ -23,6 +23,7 @@ bool kvm_async_interrupts_allowed; > bool kvm_irqfds_allowed; > bool kvm_msi_via_irqfd_allowed; > bool kvm_gsi_routing_allowed; > +bool kvm_allowed; > =20 > int kvm_init_vcpu(CPUState *cpu) > { > diff --git a/qom/cpu.c b/qom/cpu.c > index e242dcb..0c76712 100644 > --- a/qom/cpu.c > +++ b/qom/cpu.c > @@ -20,6 +20,7 @@ > =20 > #include "qom/cpu.h" > #include "qemu-common.h" > +#include "sysemu/kvm.h" > =20 > void cpu_reset_interrupt(CPUState *cpu, int mask) > { > @@ -57,6 +58,9 @@ static ObjectClass *cpu_common_class_by_name(const ch= ar *cpu_model) > =20 > static void cpu_common_realizefn(DeviceState *dev, Error **errp) > { > + if (dev->hotplugged) { > + cpu_synchronize_post_init(CPU(dev)); > + } > } > =20 > static void cpu_class_init(ObjectClass *klass, void *data) > diff --git a/vl.c b/vl.c > index dd94549..bc9c016 100644 > --- a/vl.c > +++ b/vl.c > @@ -267,7 +267,6 @@ static NotifierList machine_init_done_notifiers =3D > NOTIFIER_LIST_INITIALIZER(machine_init_done_notifiers); > =20 > static bool tcg_allowed =3D true; > -bool kvm_allowed; > bool xen_allowed; > uint32_t xen_domid; > enum xen_mode xen_mode =3D XEN_EMULATE; >=20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg