From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39427) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLrhU-0006lz-VD for qemu-devel@nongnu.org; Thu, 24 May 2018 10:58:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fLrhP-000455-GB for qemu-devel@nongnu.org; Thu, 24 May 2018 10:58:45 -0400 Received: from mail-oi0-x243.google.com ([2607:f8b0:4003:c06::243]:36455) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fLrhP-00044a-BB for qemu-devel@nongnu.org; Thu, 24 May 2018 10:58:39 -0400 Received: by mail-oi0-x243.google.com with SMTP id v2-v6so1722236oif.3 for ; Thu, 24 May 2018 07:58:39 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <1527047633-12368-1-git-send-email-zhaoshenglong@huawei.com> <1527047633-12368-2-git-send-email-zhaoshenglong@huawei.com> <10801e6c-5028-add6-b082-22c5dc9758ca@redhat.com> <38aee779-1baf-ab96-7489-0f34bda2f8e6@redhat.com> From: Peter Maydell Date: Thu, 24 May 2018 15:58:18 +0100 Message-ID: Content-Type: text/plain; charset="UTF-8" Subject: Re: [Qemu-devel] [PATCH V3 2/2] arm_gicv3_kvm: kvm_dist_get/put: skip the registers banked by GICR List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Auger Eric Cc: Shannon Zhao , qemu-arm , QEMU Developers , Shannon Zhao On 24 May 2018 at 15:56, Peter Maydell wrote: > Oops, yes, you're right. My explanation applies to the > various other bitmaps, where we are accessing the > fields in the data structure using gic_bmp_ptr32(bmp, irq), > but not to gicd_ipriority[], which we are directly accessing > starting with the first word, not by indexing via bmp[irq]. > > So we need to handle these two cases differently. > You're correct that for gicd_ipriority[], the code in > master reads and writes to that data structure as: > [0, 0, ..., 0, irq 32, irq 33, ..., 0, 0, ... 0] > so all the values are in the right place but we: > (a) unnecessarily read/write zeroes for the PPI/SGI fields > (b) fail to transfer the last 32 interrupts > > We can fix the gicd_ipriority[] case simply by adding > bmp = GIC_INTERNAL; Oops, I meant bmp += GIC_INTERNAL; thanks -- PMM