From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47436) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fM8b1-0002E0-J1 for qemu-devel@nongnu.org; Fri, 25 May 2018 05:01:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fM8aw-0005Sn-3s for qemu-devel@nongnu.org; Fri, 25 May 2018 05:01:11 -0400 Received: from mail-ot0-x244.google.com ([2607:f8b0:4003:c0f::244]:40516) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fM8av-0005SW-VC for qemu-devel@nongnu.org; Fri, 25 May 2018 05:01:06 -0400 Received: by mail-ot0-x244.google.com with SMTP id n1-v6so5258104otf.7 for ; Fri, 25 May 2018 02:01:05 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <5B07CC79.1070905@huawei.com> 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> <5B07CC79.1070905@huawei.com> From: Peter Maydell Date: Fri, 25 May 2018 10:00:44 +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: Shannon Zhao Cc: Auger Eric , Shannon Zhao , qemu-arm , QEMU Developers On 25 May 2018 at 09:42, Shannon Zhao wrote: > On 2018/5/24 22:56, Peter Maydell wrote: >> We can fix the gicd_ipriority[] case simply by adding >> bmp = GIC_INTERNAL; >> before the assignment to 'field' in both kvm_dist_get_priority() >> and kvm_dist_put_priority(). This doesn't affect migration >> compatibility. We should do this separately from fixing the >> other bitmaps, because it's simpler. >> > If we do bmp += GIC_INTERNAL, we should also add this to offset, > otherwise we will put the SGI/PPIs data to SPIs, right? Yes. This code seems remarkably hard to get right, I think because we effectively have three different things indexing through the loop -- irq, field, offset -- and they're all independently set to starting values in different places. thanks -- PMM