From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kt0Lt-00068p-Pe for qemu-devel@nongnu.org; Thu, 23 Oct 2008 09:35:49 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kt0Ln-00064e-SY for qemu-devel@nongnu.org; Thu, 23 Oct 2008 09:35:49 -0400 Received: from [199.232.76.173] (port=52646 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kt0Ln-00064U-JQ for qemu-devel@nongnu.org; Thu, 23 Oct 2008 09:35:43 -0400 Received: from mx20.gnu.org ([199.232.41.8]:44154) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kt0Ln-00017E-9O for qemu-devel@nongnu.org; Thu, 23 Oct 2008 09:35:43 -0400 Received: from lizzard.sbs.de ([194.138.37.39]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kt0LJ-0000lc-40 for qemu-devel@nongnu.org; Thu, 23 Oct 2008 09:35:13 -0400 Message-ID: <49007D88.6050402@siemens.com> Date: Thu, 23 Oct 2008 15:35:04 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <1224771556-11146-1-git-send-email-glommer@redhat.com> <1224771556-11146-28-git-send-email-glommer@redhat.com> <49007C82.9080300@redhat.com> In-Reply-To: <49007C82.9080300@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 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: Avi Kivity Cc: aliguori@us.ibm.com, Glauber Costa , jes@sgi.com, qemu-devel@nongnu.org, dmitry.baryshkov@siemens.com Avi Kivity wrote: > 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. ...or to have some kind of QEMUAccel_arch, defined in target-*/accel.h files. Haven't looked into the use cases yet to say what is sufficient. Jan -- Siemens AG, Corporate Technology, CT SE 2 Corporate Competence Center Embedded Linux