Re: [PATCH 1/4] KVM: MMU: fix forgot reserved bits check in speculative path

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Avi Kivity
Date: Wednesday, July 14, 2010 - 6:06 am

On 07/13/2010 12:42 PM, Xiao Guangrong wrote:

Do we also need to check cr0.wp?  I think so.


Please move the checks to mmu_pte_write_new_pte(), it's a more logical 
place.

It means the reserved bits check happens multiple times, but that's ok.

Also, you can use arch.mmu.base_role to compare:

     static const kvm_mmu_page_role mask = { .level = -1U, .cr4_pae = 1, 
... };

     if ((sp->role.word ^ base_role.word) & mask.word)
          return;


Eventually we have to reduce the number of paths.  But lets fix things 
first.

-- 
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 2/4] KVM: MMU: cleanup spte update path, Xiao Guangrong, (Tue Jul 13, 2:43 am)
[PATCH 4/4] KVM: MMU: remove valueless output message, Xiao Guangrong, (Tue Jul 13, 2:46 am)
Re: [PATCH 1/4] KVM: MMU: fix forgot reserved bits check i ..., Avi Kivity, (Wed Jul 14, 6:06 am)