From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=56359 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OLAPn-00049T-Ta for qemu-devel@nongnu.org; Sun, 06 Jun 2010 03:37:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OLAPm-0001Ya-Lp for qemu-devel@nongnu.org; Sun, 06 Jun 2010 03:37:03 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]:52341) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OLAPm-0001YL-8i for qemu-devel@nongnu.org; Sun, 06 Jun 2010 03:37:02 -0400 Message-ID: <4C0B4FE1.9070608@web.de> Date: Sun, 06 Jun 2010 09:36:01 +0200 From: Jan Kiszka MIME-Version: 1.0 References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig336526151F7D708BDF4E4DA9" Sender: jan.kiszka@web.de Subject: [Qemu-devel] Re: [PATCH 6/6] apic: avoid using CPUState internals List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig336526151F7D708BDF4E4DA9 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Blue Swirl wrote: > Use only an opaque CPUState pointer and move the actual CPUState > contents handling to cpu.h and cpuid.c. >=20 > Set env->halted in pc.c and add a function to get the local APIC state > of the current CPU for the MMIO. >=20 > Signed-off-by: Blue Swirl > --- > hw/apic.c | 40 +++++++++++++++------------------------- > hw/apic.h | 9 ++++++++- > hw/pc.c | 12 +++++++++++- > target-i386/cpu.h | 27 ++++++++++++++++----------- > target-i386/cpuid.c | 6 ++++++ > 5 files changed, 56 insertions(+), 38 deletions(-) >=20 > diff --git a/hw/apic.c b/hw/apic.c > index 91c8d93..332c66e 100644 > --- a/hw/apic.c > +++ b/hw/apic.c > @@ -95,7 +95,7 @@ > #define MSI_ADDR_SIZE 0x100000 >=20 > struct APICState { > - CPUState *cpu_env; > + void *cpu_env; > uint32_t apicbase; > uint8_t id; > uint8_t arb_id; > @@ -320,7 +320,7 @@ void cpu_set_apic_base(APICState *s, uint64_t val) > /* if disabled, cannot be enabled again */ > if (!(val & MSR_IA32_APICBASE_ENABLE)) { > s->apicbase &=3D ~MSR_IA32_APICBASE_ENABLE; > - s->cpu_env->cpuid_features &=3D ~CPUID_APIC; > + cpu_clear_apic_feature(s->cpu_env); > s->spurious_vec &=3D ~APIC_SV_ENABLE; > } > } > @@ -508,8 +508,6 @@ void apic_init_reset(APICState *s) > s->initial_count_load_time =3D 0; > s->next_time =3D 0; > s->wait_for_sipi =3D 1; > - > - s->cpu_env->halted =3D !(s->apicbase & MSR_IA32_APICBASE_BSP); We are now lacking 'halted' initialization after system reset. Could be addressed by a special reset handler in hw/pc.c, I guess. Jan --------------enig336526151F7D708BDF4E4DA9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkwLT+UACgkQitSsb3rl5xQmSACgm4GiQAo9/000e1yNK0HoTdMU 04UAn2Q+LKudQSnNjqf1eNmtouFwT0Oy =2JTj -----END PGP SIGNATURE----- --------------enig336526151F7D708BDF4E4DA9--