Re: [PATCH 8/9] KVM: MMU: fix MTRR update

2015-05-11 Thread Xiao Guangrong
On 05/08/2015 12:53 AM, Paolo Bonzini wrote: On 30/04/2015 12:24, guangrong.x...@linux.intel.com wrote: +static void vmx_set_msr_mtrr(struct kvm_vcpu *vcpu, u32 msr) +{ + struct mtrr_state_type *mtrr_state = >arch.mtrr_state; + unsigned char mtrr_enabled = mtrr_state->enabled; +

Re: [PATCH 8/9] KVM: MMU: fix MTRR update

2015-05-11 Thread Xiao Guangrong
On 05/08/2015 12:53 AM, Paolo Bonzini wrote: On 30/04/2015 12:24, guangrong.x...@linux.intel.com wrote: +static void vmx_set_msr_mtrr(struct kvm_vcpu *vcpu, u32 msr) +{ + struct mtrr_state_type *mtrr_state = vcpu-arch.mtrr_state; + unsigned char mtrr_enabled =

Re: [PATCH 8/9] KVM: MMU: fix MTRR update

2015-05-07 Thread Paolo Bonzini
On 30/04/2015 12:24, guangrong.x...@linux.intel.com wrote: > +static void vmx_set_msr_mtrr(struct kvm_vcpu *vcpu, u32 msr) > +{ > + struct mtrr_state_type *mtrr_state = >arch.mtrr_state; > + unsigned char mtrr_enabled = mtrr_state->enabled; > + gfn_t start, end, mask; > + int

Re: [PATCH 8/9] KVM: MMU: fix MTRR update

2015-05-07 Thread Paolo Bonzini
On 30/04/2015 12:24, guangrong.x...@linux.intel.com wrote: +static void vmx_set_msr_mtrr(struct kvm_vcpu *vcpu, u32 msr) +{ + struct mtrr_state_type *mtrr_state = vcpu-arch.mtrr_state; + unsigned char mtrr_enabled = mtrr_state-enabled; + gfn_t start, end, mask; + int index;

Re: [PATCH 8/9] KVM: MMU: fix MTRR update

2015-05-06 Thread Xiao Guangrong
Hi David, Thanks for your review. On 05/07/2015 05:36 AM, David Matlack wrote: +static void vmx_set_msr_mtrr(struct kvm_vcpu *vcpu, u32 msr) +{ + struct mtrr_state_type *mtrr_state = >arch.mtrr_state; + unsigned char mtrr_enabled = mtrr_state->enabled; + gfn_t start, end,

Re: [PATCH 8/9] KVM: MMU: fix MTRR update

2015-05-06 Thread David Matlack
On Thu, Apr 30, 2015 at 3:24 AM, wrote: > From: Xiao Guangrong > > Currently, whenever guest MTRR registers are changed kvm_mmu_reset_context > is called to switch to the new root shadow page table, however, it's useless > since: > 1) the cache type is not cached into shadow page's attribute so

Re: [PATCH 8/9] KVM: MMU: fix MTRR update

2015-05-06 Thread David Matlack
On Thu, Apr 30, 2015 at 3:24 AM, guangrong.x...@linux.intel.com wrote: From: Xiao Guangrong guangrong.x...@linux.intel.com Currently, whenever guest MTRR registers are changed kvm_mmu_reset_context is called to switch to the new root shadow page table, however, it's useless since: 1) the

Re: [PATCH 8/9] KVM: MMU: fix MTRR update

2015-05-06 Thread Xiao Guangrong
Hi David, Thanks for your review. On 05/07/2015 05:36 AM, David Matlack wrote: +static void vmx_set_msr_mtrr(struct kvm_vcpu *vcpu, u32 msr) +{ + struct mtrr_state_type *mtrr_state = vcpu-arch.mtrr_state; + unsigned char mtrr_enabled = mtrr_state-enabled; + gfn_t start,

[PATCH 8/9] KVM: MMU: fix MTRR update

2015-04-30 Thread guangrong . xiao
From: Xiao Guangrong Currently, whenever guest MTRR registers are changed kvm_mmu_reset_context is called to switch to the new root shadow page table, however, it's useless since: 1) the cache type is not cached into shadow page's attribute so that the original root shadow page will be reused

[PATCH 8/9] KVM: MMU: fix MTRR update

2015-04-30 Thread guangrong . xiao
From: Xiao Guangrong Currently, whenever guest MTRR registers are changed kvm_mmu_reset_context is called to switch to the new root shadow page table, however, it's useless since: 1) the cache type is not cached into shadow page's attribute so that the original root shadow page will be reused

[PATCH 8/9] KVM: MMU: fix MTRR update

2015-04-30 Thread guangrong . xiao
From: Xiao Guangrong guangrong.x...@linux.intel.com Currently, whenever guest MTRR registers are changed kvm_mmu_reset_context is called to switch to the new root shadow page table, however, it's useless since: 1) the cache type is not cached into shadow page's attribute so that the original

[PATCH 8/9] KVM: MMU: fix MTRR update

2015-04-30 Thread guangrong . xiao
From: Xiao Guangrong guangrong.x...@linux.intel.com Currently, whenever guest MTRR registers are changed kvm_mmu_reset_context is called to switch to the new root shadow page table, however, it's useless since: 1) the cache type is not cached into shadow page's attribute so that the original