From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PART1 RFC v4 08/11] svm: Add VMEXIT handlers for AVIC Date: Wed, 13 Apr 2016 14:37:36 +0200 Message-ID: <20160413123735.GA16992@potion.brq.redhat.com> References: <1460017232-17429-1-git-send-email-Suravee.Suthikulpanit@amd.com> <1460017232-17429-9-git-send-email-Suravee.Suthikulpanit@amd.com> <20160412162245.GD6762@potion.brq.redhat.com> <570D76B4.1030703@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Suravee Suthikulpanit , joro@8bytes.org, bp@alien8.de, gleb@kernel.org, alex.williamson@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, wei@redhat.com, sherry.hurwitz@amd.com To: Paolo Bonzini Return-path: Content-Disposition: inline In-Reply-To: <570D76B4.1030703@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org 2016-04-13 00:29+0200, Paolo Bonzini: > On 12/04/2016 18:22, Radim Kr=C4=8Dm=C3=A1=C5=99 wrote: >>> > + if (apic_id > 4 || cluster_id >=3D 0xf) >>> > + return NULL; >>> > + index =3D (cluster_id << 2) + apic_id; >> ffs(apic_id), because 'apic_id' must be compacted into 2 bits. >=20 > ffs(apic_id)-1 actually. Yes, thanks. (And I missed that the confusion begins by passing "ffs(dlid) - 1" as mda to avic_handle_ldr_write, because the rest cannot work after that.= )