From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758921AbcIWJfX (ORCPT ); Fri, 23 Sep 2016 05:35:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56756 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757419AbcIWJfU (ORCPT ); Fri, 23 Sep 2016 05:35:20 -0400 Subject: Re: [PATCH] KVM: VMX: refactor global page-sized bitmaps To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , linux-kernel@vger.kernel.org, kvm@vger.kernel.org References: <20160922231840.26746-1-rkrcmar@redhat.com> Cc: Wanpeng Li From: Paolo Bonzini Message-ID: Date: Fri, 23 Sep 2016 11:35:16 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <20160922231840.26746-1-rkrcmar@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.31]); Fri, 23 Sep 2016 09:35:20 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/09/2016 01:18, Radim Krčmář wrote: > We've had 10 page-sized bitmaps that were being allocated and freed one > by one when we could just use a cycle and MSR bitmaps had a lot of > useless code lying around. > > This patch > * enumerates vmx bitmaps and uses an array to store them > * replaces vmx_enable_intercept_msr_read_x2apic() with a condition > * joins vmx_msr_disable_intercept_msr_{read,write}_x2apic() > * renames x2apic_apicv_inactive msr_bitmaps to x2apic and original > x2apic bitmaps to x2apic_apicv It's almost like this could be split in four patches! :) Seriously, I like it very much but it's very hard to review. Also, while it's a good idea to keep the bitmaps in an array, vmx_bitmaps[vmread_bitmap] is not very readable. Please make the enum uppercase, and possibly add #define vmread_bitmap (vmx_bitmaps[VMREAD_BITMAP]) Thanks! Paolo > Signed-off-by: Radim Krčmář