From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH 10/12] cpu: Pass CPUState to *cpu_synchronize_post*() Date: Thu, 18 Apr 2013 12:18:43 +0300 Message-ID: <20130418091842.GQ8997@redhat.com> References: <1366073209-27119-1-git-send-email-afaerber@suse.de> <1366073209-27119-11-git-send-email-afaerber@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Igor Mammedov , Marcelo Tosatti , qemu-devel@nongnu.org, "open list:Overall" To: Andreas =?utf-8?Q?F=C3=A4rber?= Return-path: Content-Disposition: inline In-Reply-To: <1366073209-27119-11-git-send-email-afaerber@suse.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org List-Id: kvm.vger.kernel.org On Tue, Apr 16, 2013 at 02:46:47AM +0200, Andreas F=C3=A4rber wrote: > From: Igor Mammedov >=20 > ... so it could be called without requiring CPUArchState. >=20 > Signed-off-by: Igor Mammedov > Reviewed-by: Eduardo Habkost > Signed-off-by: Andreas F=C3=A4rber Acked-by: Gleb Natapov > --- > cpus.c | 4 ++-- > include/sysemu/kvm.h | 12 ++++++------ > kvm-all.c | 8 ++------ > kvm-stub.c | 4 ++-- > 4 files changed, 12 insertions(+), 16 deletions(-) >=20 > diff --git a/cpus.c b/cpus.c > index 97e9ab4..c15ff6c 100644 > --- a/cpus.c > +++ b/cpus.c > @@ -419,7 +419,7 @@ void cpu_synchronize_all_post_reset(void) > CPUArchState *cpu; > =20 > for (cpu =3D first_cpu; cpu; cpu =3D cpu->next_cpu) { > - cpu_synchronize_post_reset(cpu); > + cpu_synchronize_post_reset(ENV_GET_CPU(cpu)); > } > } > =20 > @@ -428,7 +428,7 @@ void cpu_synchronize_all_post_init(void) > CPUArchState *cpu; > =20 > for (cpu =3D first_cpu; cpu; cpu =3D cpu->next_cpu) { > - cpu_synchronize_post_init(cpu); > + cpu_synchronize_post_init(ENV_GET_CPU(cpu)); > } > } > =20 > diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h > index f2d97b5..495e6f8 100644 > --- a/include/sysemu/kvm.h > +++ b/include/sysemu/kvm.h > @@ -250,8 +250,8 @@ int kvm_check_extension(KVMState *s, unsigned int ext= ension); > 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(CPUArchState *env); > -void kvm_cpu_synchronize_post_init(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,17 +262,17 @@ static inline void cpu_synchronize_state(CPUArchSta= te *env) > } > } > =20 > -static inline void cpu_synchronize_post_reset(CPUArchState *env) > +static inline void cpu_synchronize_post_reset(CPUState *cpu) > { > if (kvm_enabled()) { > - kvm_cpu_synchronize_post_reset(env); > + kvm_cpu_synchronize_post_reset(cpu); > } > } > =20 > -static inline void cpu_synchronize_post_init(CPUArchState *env) > +static inline void cpu_synchronize_post_init(CPUState *cpu) > { > if (kvm_enabled()) { > - kvm_cpu_synchronize_post_init(env); > + kvm_cpu_synchronize_post_init(cpu); > } > } > =20 > diff --git a/kvm-all.c b/kvm-all.c > index 9b433d3..fc4e17c 100644 > --- a/kvm-all.c > +++ b/kvm-all.c > @@ -1510,18 +1510,14 @@ void kvm_cpu_synchronize_state(CPUArchState *env) > } > } > =20 > -void kvm_cpu_synchronize_post_reset(CPUArchState *env) > +void kvm_cpu_synchronize_post_reset(CPUState *cpu) > { > - CPUState *cpu =3D ENV_GET_CPU(env); > - > kvm_arch_put_registers(cpu, KVM_PUT_RESET_STATE); > cpu->kvm_vcpu_dirty =3D false; > } > =20 > -void kvm_cpu_synchronize_post_init(CPUArchState *env) > +void kvm_cpu_synchronize_post_init(CPUState *cpu) > { > - CPUState *cpu =3D ENV_GET_CPU(env); > - > kvm_arch_put_registers(cpu, KVM_PUT_FULL_STATE); > cpu->kvm_vcpu_dirty =3D false; > } > diff --git a/kvm-stub.c b/kvm-stub.c > index f6137d3..723a813 100644 > --- a/kvm-stub.c > +++ b/kvm-stub.c > @@ -41,11 +41,11 @@ void kvm_cpu_synchronize_state(CPUArchState *env) > { > } > =20 > -void kvm_cpu_synchronize_post_reset(CPUArchState *env) > +void kvm_cpu_synchronize_post_reset(CPUState *cpu) > { > } > =20 > -void kvm_cpu_synchronize_post_init(CPUArchState *env) > +void kvm_cpu_synchronize_post_init(CPUState *cpu) > { > } > =20 > --=20 > 1.8.1.4 -- Gleb.