From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41915) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UogZN-0008Me-Lu for qemu-devel@nongnu.org; Mon, 17 Jun 2013 17:02:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UogZL-0003TL-AR for qemu-devel@nongnu.org; Mon, 17 Jun 2013 17:02:33 -0400 Received: from mail-yh0-x22a.google.com ([2607:f8b0:4002:c01::22a]:63319) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UogZL-0003TH-6o for qemu-devel@nongnu.org; Mon, 17 Jun 2013 17:02:31 -0400 Received: by mail-yh0-f42.google.com with SMTP id c41so1213517yho.29 for ; Mon, 17 Jun 2013 14:02:30 -0700 (PDT) Sender: Richard Henderson Message-ID: <51BF7963.4050303@twiddle.net> Date: Mon, 17 Jun 2013 14:02:27 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1371398269-6213-1-git-send-email-afaerber@suse.de> <1371398269-6213-3-git-send-email-afaerber@suse.de> <51BF67A0.3030307@twiddle.net> <51BF787A.7030100@suse.de> In-Reply-To: <51BF787A.7030100@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= Cc: qemu-devel@nongnu.org On 06/17/2013 01:58 PM, Andreas Färber wrote: > Am 17.06.2013 21:46, schrieb Richard Henderson: >> On 06/16/2013 08:57 AM, Andreas Färber wrote: >>> @@ -627,7 +627,7 @@ static void vapic_write(void *opaque, hwaddr addr, uint64_t data, >>> hwaddr rom_paddr; >>> VAPICROMState *s = opaque; >>> >>> - cpu_synchronize_state(env); >>> + cpu_synchronize_state(CPU(x86_env_get_cpu(env))); >> >> ENV_GET_CPU, surely. > > No, ENV_GET_CPU() is only a compatibility macro for generic code and > shouldn't be used in target-specific code. > > Background is that foo_env_get_cpu() can coexist with bar_env_get_cpu() > whereas ENV_GET_CPU() relies on there being only one arch per > executable, which we hope to fix for heterogeneous emulations. What has that got to do with anything? ENV_GET_CPU is a macro, and only applies within the current translation unit. This corresponds well with the CPUArchState type, which is also local to the current translation unit. r~