[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4E13B7A1.9010504@cn.fujitsu.com>
Date: Wed, 06 Jul 2011 09:17:21 +0800
From: Xiao Guangrong <xiaoguangrong@...fujitsu.com>
To: Marcelo Tosatti <mtosatti@...hat.com>
CC: Avi Kivity <avi@...hat.com>, LKML <linux-kernel@...r.kernel.org>,
KVM <kvm@...r.kernel.org>
Subject: Re: [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!
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists