Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752622AbbFCB7w (ORCPT ); Tue, 2 Jun 2015 21:59:52 -0400 Received: from mga09.intel.com ([134.134.136.24]:20846 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751704AbbFCB7m (ORCPT ); Tue, 2 Jun 2015 21:59:42 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,544,1427785200"; d="scan'208";a="719724056" Message-ID: <556E5EA3.8040108@linux.intel.com> Date: Wed, 03 Jun 2015 09:55:47 +0800 From: Xiao Guangrong User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Paolo Bonzini CC: gleb@kernel.org, mtosatti@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 05/15] KVM: MTRR: clean up mtrr default type References: <1432983566-15773-1-git-send-email-guangrong.xiao@linux.intel.com> <1432983566-15773-6-git-send-email-guangrong.xiao@linux.intel.com> <556C21BF.3090003@redhat.com> In-Reply-To: <556C21BF.3090003@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1332 Lines: 38 Thanks for your review, Paolo! On 06/01/2015 05:11 PM, Paolo Bonzini wrote: >> struct kvm_vcpu_arch { >> diff --git a/arch/x86/kvm/mtrr.c b/arch/x86/kvm/mtrr.c >> index 562341b..6de49dd 100644 >> --- a/arch/x86/kvm/mtrr.c >> +++ b/arch/x86/kvm/mtrr.c >> @@ -105,7 +105,6 @@ EXPORT_SYMBOL_GPL(kvm_mtrr_valid); >> static void update_mtrr(struct kvm_vcpu *vcpu, u32 msr) >> { >> struct kvm_mtrr *mtrr_state = &vcpu->arch.mtrr_state; >> - unsigned char mtrr_enabled = mtrr_state->enabled; >> gfn_t start, end, mask; >> int index; >> bool is_fixed = true; >> @@ -114,7 +113,7 @@ static void update_mtrr(struct kvm_vcpu *vcpu, u32 msr) >> !kvm_arch_has_noncoherent_dma(vcpu->kvm)) >> return; >> >> - if (!(mtrr_enabled & 0x2) && msr != MSR_MTRRdefType) >> + if (!mtrr_state->mtrr_enabled && msr != MSR_MTRRdefType) > > I know Linus doesn't like bitfields too much. Can you change these to > inline functions, and only leave an "u64 deftype" in the struct? > Sure. I will introduce mtrr_is_enabled() and fixed_mtrr_is_enabled() instead of these bitfields. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/