lkml.org 
[lkml]   [2011]   [Jul]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 04/19] KVM: MMU: cache mmio info on page fault path
On 07/06/2011 03:04 AM, Marcelo Tosatti wrote:
return 0;
>>
>> /* mmio */
>> - if (is_error_pfn(pfn))
>> - return kvm_handle_bad_page(vcpu->kvm, walker.gfn, pfn);
>> + if (is_error_pfn(pfn)) {
>> + unsigned access = walker.pte_access;
>> + bool dirty = is_dirty_gpte(walker.ptes[walker.level - 1]);
>> +
>> + if (dirty)
>> + access &= ~ACC_WRITE_MASK;
>> +
>> + return kvm_handle_bad_page(vcpu, mmu_is_nested(vcpu) ? 0 :
>> + addr, access, walker.gfn, pfn);
>> + }
>
> Don't get this... if guest pte is dirty you cache without allowing
> write access? Why?
>

Ah, sorry, the logic should be: if pte is not diry, clear write access,
will fix it. Thanks, Marcelo!



\
 
 \ /
  Last update: 2011-07-06 03:17    [W:1.390 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site