From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33526) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZotO0-0005rY-Bi for qemu-devel@nongnu.org; Wed, 21 Oct 2015 09:25:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZotNw-0002QT-A6 for qemu-devel@nongnu.org; Wed, 21 Oct 2015 09:25:00 -0400 Received: from mail-vk0-f53.google.com ([209.85.213.53]:34381) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZotNw-0002QN-5f for qemu-devel@nongnu.org; Wed, 21 Oct 2015 09:24:56 -0400 Received: by vkat63 with SMTP id t63so28545345vka.1 for ; Wed, 21 Oct 2015 06:24:55 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <1445361732-16257-1-git-send-email-shlomopongratz@gmail.com> <1445361732-16257-10-git-send-email-shlomopongratz@gmail.com> <00a301d10bce$7bc0daa0$73428fe0$@samsung.com> <00f501d10beb$94d12690$be7373b0$@samsung.com> From: Peter Maydell Date: Wed, 21 Oct 2015 14:24:36 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH RFC V5 9/9] hw/arm: Add virt-v3 machine that uses GIC-500 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Shlomo Pongratz Cc: "eric.auger@linaro.org" , Shlomo Pongratz , Pavel Fedin , "qemu-devel@nongnu.org" , "shannon.zhao@linaro.org" , "ashoks@broadcom.com" , "imammedo@redhat.com" On 21 October 2015 at 14:01, Shlomo Pongratz wrote: > On Wednesday, October 21, 2015, Peter Maydell > wrote: >> The system register implementation belongs in the gic code, not >> target-arm/. We already have support for devices that say >> "I have some system registers, please add them to this CPU". >> > > I don't understand. > The system registers are defined in ARM Architecture reference Manual. > It is true that the real implementation is in arm_gicv3_interrupts.c > But the crn, crm, op0, and op1 of the instructions are in CPU domain. Well, this comes down to "do you want to design the GICv3 emulation to preserve the split the hardware has between the cpu interface and the GIC proper". In hardware there's actually a defined protocol between the two, so you can have CPUs from one implementor that talk to a GIC from another implementor. For QEMU that seems like overkill, as we will only ever have one GICv3 implementation and one CPU implementation. So we should just have the GICv3 provide the CPU system register implementations. But the code for those belongs in hw/intc/: that should call the function for "add these system registers" which we have already: define_arm_cp_regs_with_opaque(). (We use this in hw/arm/pxa2xx_pic, for instance.) thanks -- PMM