From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= Subject: Re: [PATCH qom-cpu v2 02/29] kvm: Change cpu_synchronize_state() argument to CPUState Date: Fri, 21 Jun 2013 12:25:50 +0200 Message-ID: <51C42A2E.6040806@suse.de> References: <1371398269-6213-1-git-send-email-afaerber@suse.de> <1371398269-6213-3-git-send-email-afaerber@suse.de> <20130618113956.466c8800@thinkpad> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: qemu-devel@nongnu.org, Alexander Graf , Luiz Capitulino , Gleb Natapov , Marcelo Tosatti , Richard Henderson , qemu-ppc , kvm To: Igor Mammedov Return-path: Received: from cantor2.suse.de ([195.135.220.15]:41566 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752753Ab3FUKZw (ORCPT ); Fri, 21 Jun 2013 06:25:52 -0400 In-Reply-To: <20130618113956.466c8800@thinkpad> Sender: kvm-owner@vger.kernel.org List-ID: Am 18.06.2013 11:39, schrieb Igor Mammedov: > On Sun, 16 Jun 2013 17:57:22 +0200 > Andreas F=E4rber wrote: >=20 >> Change Monitor::mon_cpu to CPUState as well. >> In cpu_synchronize_all_states() use qemu_for_each_cpu() now. >> >> Reviewed-by: liguang >> Signed-off-by: Andreas F=E4rber >> --- [...] >> diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c >> index 655483b..f93629f 100644 >> --- a/hw/i386/kvmvapic.c >> +++ b/hw/i386/kvmvapic.c >> @@ -456,7 +456,7 @@ void vapic_report_tpr_access(DeviceState *dev, C= PUState *cs, target_ulong ip, >> X86CPU *cpu =3D X86_CPU(cs); >> CPUX86State *env =3D &cpu->env; >> =20 >> - cpu_synchronize_state(env); >> + cpu_synchronize_state(cs); >> =20 >> if (evaluate_tpr_instruction(s, env, &ip, access) < 0) { >> if (s->state =3D=3D VAPIC_ACTIVE) { >> @@ -627,7 +627,7 @@ static void vapic_write(void *opaque, hwaddr add= r, uint64_t data, >> hwaddr rom_paddr; >> VAPICROMState *s =3D opaque; >> =20 >> - cpu_synchronize_state(env); >> + cpu_synchronize_state(CPU(x86_env_get_cpu(env))); > why not use ENV_GET_CPU() here and in several other places below to m= ake it > uniform? Explained that in another reply. There's currently about four misuses i= n the tree, and there had been previous patches to clean some others up; after the series only one remains in target-ppc/mmu-hash.c. Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrn= berg From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39338) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpyXS-0006Bx-8r for qemu-devel@nongnu.org; Fri, 21 Jun 2013 06:25:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UpyXQ-0003MH-DT for qemu-devel@nongnu.org; Fri, 21 Jun 2013 06:25:53 -0400 Message-ID: <51C42A2E.6040806@suse.de> Date: Fri, 21 Jun 2013 12:25:50 +0200 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1371398269-6213-1-git-send-email-afaerber@suse.de> <1371398269-6213-3-git-send-email-afaerber@suse.de> <20130618113956.466c8800@thinkpad> In-Reply-To: <20130618113956.466c8800@thinkpad> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH qom-cpu v2 02/29] kvm: Change cpu_synchronize_state() argument to CPUState List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: Alexander Graf , kvm , Gleb Natapov , Marcelo Tosatti , qemu-devel@nongnu.org, Luiz Capitulino , qemu-ppc , Richard Henderson Am 18.06.2013 11:39, schrieb Igor Mammedov: > On Sun, 16 Jun 2013 17:57:22 +0200 > Andreas F=E4rber wrote: >=20 >> Change Monitor::mon_cpu to CPUState as well. >> In cpu_synchronize_all_states() use qemu_for_each_cpu() now. >> >> Reviewed-by: liguang >> Signed-off-by: Andreas F=E4rber >> --- [...] >> diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c >> index 655483b..f93629f 100644 >> --- a/hw/i386/kvmvapic.c >> +++ b/hw/i386/kvmvapic.c >> @@ -456,7 +456,7 @@ void vapic_report_tpr_access(DeviceState *dev, CPU= State *cs, target_ulong ip, >> X86CPU *cpu =3D X86_CPU(cs); >> CPUX86State *env =3D &cpu->env; >> =20 >> - cpu_synchronize_state(env); >> + cpu_synchronize_state(cs); >> =20 >> if (evaluate_tpr_instruction(s, env, &ip, access) < 0) { >> if (s->state =3D=3D VAPIC_ACTIVE) { >> @@ -627,7 +627,7 @@ static void vapic_write(void *opaque, hwaddr addr,= uint64_t data, >> hwaddr rom_paddr; >> VAPICROMState *s =3D opaque; >> =20 >> - cpu_synchronize_state(env); >> + cpu_synchronize_state(CPU(x86_env_get_cpu(env))); > why not use ENV_GET_CPU() here and in several other places below to mak= e it > uniform? Explained that in another reply. There's currently about four misuses in the tree, and there had been previous patches to clean some others up; after the series only one remains in target-ppc/mmu-hash.c. Andreas --=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