Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759618AbcDMMhm (ORCPT ); Wed, 13 Apr 2016 08:37:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48959 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758664AbcDMMhl (ORCPT ); Wed, 13 Apr 2016 08:37:41 -0400 Date: Wed, 13 Apr 2016 14:37:36 +0200 From: Radim =?utf-8?B?S3LEjW3DocWZ?= To: Paolo Bonzini 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 Subject: Re: [PART1 RFC v4 08/11] svm: Add VMEXIT handlers for AVIC 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-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <570D76B4.1030703@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 13 Apr 2016 12:37:40 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 454 Lines: 13 2016-04-13 00:29+0200, Paolo Bonzini: > On 12/04/2016 18:22, Radim Krčmář wrote: >>> > + if (apic_id > 4 || cluster_id >= 0xf) >>> > + return NULL; >>> > + index = (cluster_id << 2) + apic_id; >> ffs(apic_id), because 'apic_id' must be compacted into 2 bits. > > 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.)