From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8n3h-0007Bh-JK for qemu-devel@nongnu.org; Mon, 12 Aug 2013 04:01:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V8n3d-0006T8-6f for qemu-devel@nongnu.org; Mon, 12 Aug 2013 04:00:57 -0400 Received: from ozlabs.org ([203.10.76.45]:38869) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8n3c-0006Sn-S4 for qemu-devel@nongnu.org; Mon, 12 Aug 2013 04:00:53 -0400 From: Rusty Russell In-Reply-To: References: <1375938949-22622-1-git-send-email-rusty@rustcorp.com.au> <1375938949-22622-2-git-send-email-rusty@rustcorp.com.au> <87li4cgvh1.fsf@codemonkey.ws> <5203AB19.9070505@suse.de> <87r4e4p4wj.fsf@codemonkey.ws> <5203C62C.2040303@suse.de> <87eha3nwoa.fsf@rustcorp.com.au> Date: Mon, 12 Aug 2013 17:19:28 +0930 Message-ID: <87d2pjmjqv.fsf@rustcorp.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH 1/7] virtio: allow byte swapping for vring and config access List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Andreas =?utf-8?Q?F=C3=A4rber?= , Anthony Liguori , qemu-devel@nongnu.org Peter Maydell writes: > On 9 August 2013 08:35, Rusty Russell wrote: >> That's a lot of replumbing and indirect function calls for a fairly >> obscure case. We certainly don't have a nice CPUState lying around in >> virtio at the moment, for example. > > Actually if you're in an IO routine you do: it will be in the > global variable 'current_cpu'. Most IO functions don't need this, > but it's what we use for things like "this device behaviour varies > depending on which CPU accesses it". Hmm, that was NULL for me when called from virtio. I have stuck with first_cpu in the ppc64 case. Patches coming, Rusty.