From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kt0JE-0004OD-K5 for qemu-devel@nongnu.org; Thu, 23 Oct 2008 09:33:04 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kt0J8-0004LS-CH for qemu-devel@nongnu.org; Thu, 23 Oct 2008 09:33:03 -0400 Received: from [199.232.76.173] (port=52570 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kt0J8-0004LK-0y for qemu-devel@nongnu.org; Thu, 23 Oct 2008 09:32:58 -0400 Received: from mx2.redhat.com ([66.187.237.31]:60416) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kt0J7-0008Qj-85 for qemu-devel@nongnu.org; Thu, 23 Oct 2008 09:32:58 -0400 Message-ID: <49007C82.9080300@redhat.com> Date: Thu, 23 Oct 2008 15:30:42 +0200 From: Avi Kivity MIME-Version: 1.0 References: <1224771556-11146-1-git-send-email-glommer@redhat.com> <1224771556-11146-28-git-send-email-glommer@redhat.com> In-Reply-To: <1224771556-11146-28-git-send-email-glommer@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 27/32] arch-specific hooks for accelerator Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Glauber Costa Cc: jan.kiszka@siemens.com, aliguori@us.ibm.com, jes@sgi.com, qemu-devel@nongnu.org, dmitry.baryshkov@siemens.com Glauber Costa wrote: > This patch provides an arch field in QEMUAccel. It will > be used initially for x86, to replace kqemu code in op_helper.c > We start with get_msr and set_msr functions, that allow accelerators > to handle non-default msrs. > > @@ -23,6 +23,7 @@ typedef struct QEMUAccel { > void (*trace_io)(CPUState *env); > int (*break_loop)(CPUState *env); > int (*cpu_exec)(CPUState *env); > + void *arch; /* arch-specific accel functions */ > } QEMUAccel This is more elegant IMO using container_of() and including the common part as a member. Less pointers to chase. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.