From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60094) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1boYi3-000737-2Y for qemu-devel@nongnu.org; Mon, 26 Sep 2016 12:24:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1boYi0-0002zi-9o for qemu-devel@nongnu.org; Mon, 26 Sep 2016 12:24:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56734) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1boYi0-0002zZ-2p for qemu-devel@nongnu.org; Mon, 26 Sep 2016 12:24:48 -0400 References: <6dfe4c3f-abad-7358-54a6-a3bd27205757@twiddle.net> <3bec9d39-2415-25c8-837d-87d16165b150@suse.de> From: Paolo Bonzini Message-ID: <84c4e8a0-6f5b-cf09-8000-ffd677537ef8@redhat.com> Date: Mon, 26 Sep 2016 18:24:43 +0200 MIME-Version: 1.0 In-Reply-To: <3bec9d39-2415-25c8-837d-87d16165b150@suse.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 00/18] target-riscv: Add full-system emulation support for the RISC-V Instruction Set Architecture (RV64G, RV32G) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Andreas_F=c3=a4rber?= , Richard Henderson , Sagar Karandikar , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, kbastian@mail.uni-paderborn.de On 26/09/2016 18:20, Andreas F=C3=A4rber wrote: > Am 26.09.2016 um 18:17 schrieb Richard Henderson: >> On 09/26/2016 05:20 AM, Paolo Bonzini wrote: >>> On 26/09/2016 12:56, Sagar Karandikar wrote: >>>> -cpu-qom.h merged into cpu.h >>> >>> Please follow the model of other targets. RISCVCPUClass and the >>> RISCVCPU typedef should be in cpu-qom.h. >> >> I thought we had this discussion before, and cpu-qom.h is sort of a >> legacy header, and that new targets shouldn't use it. >=20 > Yes, a concept that didn't quite work out, sadly. Just cpu.h is fine. Hmm, maybe since 2.7.0 it started working out better? :) The point of cpu-qom.h is to allow using the RISCVCPU symbol in target- specific header files, without forcing all files including said header=20 to be compiled per-target. See for example commit 4da6f8d954429c0cd1471d25cb9dbe909607374e Author: Paolo Bonzini Date: Tue Mar 15 13:49:25 2016 +0100 target-i386: make cpu-qom.h not target specific =20 Make X86CPU an opaque type within cpu-qom.h, and move all definitions= of private methods, as well as all type definitions that require knowled= ge of the layout to cpu.h. This helps making files independent of NEED_= CPU_H if they only need to pass around CPU pointers. =20 Signed-off-by: Paolo Bonzini You cannot include the definition of struct FooCPU in cpu-qom.h, because it embeds "CPUFooState env;" and CPUFooState uses target_long. Still it= 's a nice improvement, for example it's now possible to compile device model= s common to arm-softmmu and aarch64-softmmu (or sh4/sh4eb, etc.) just once. Paolo