Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965376AbcDLW3T (ORCPT ); Tue, 12 Apr 2016 18:29:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34323 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934294AbcDLW3R (ORCPT ); Tue, 12 Apr 2016 18:29:17 -0400 Subject: Re: [PART1 RFC v4 08/11] svm: Add VMEXIT handlers for AVIC To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Suravee Suthikulpanit 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> Cc: 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 From: Paolo Bonzini Message-ID: <570D76B4.1030703@redhat.com> Date: Wed, 13 Apr 2016 00:29:08 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <20160412162245.GD6762@potion.brq.redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 12 Apr 2016 22:29:17 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 298 Lines: 15 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. Thanks for the review, Radim. Paolo