[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <50AC1200.8070402@linux.vnet.ibm.com>
Date: Wed, 21 Nov 2012 07:28:00 +0800
From: Xiao Guangrong <xiaoguangrong@...ux.vnet.ibm.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 4/5] KVM: MMU: move adjusting softmmu pte access to FNAME(page_fault)
On 11/21/2012 06:27 AM, Marcelo Tosatti wrote:
>> @@ -544,6 +544,21 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr, u32 error_code,
>> return 0;
>> }
>>
>> + if (write_fault && !(walker.pte_access & ACC_WRITE_MASK) &&
>> + !is_write_protection(vcpu) && !user_fault) {
>> + walker.pte_access |= ACC_WRITE_MASK;
>> + walker.pte_access &= ~ACC_USER_MASK;
>> +
>> + /*
>> + * If we converted a user page to a kernel page,
>> + * so that the kernel can write to it when cr0.wp=0,
>> + * then we should prevent the kernel from executing it
>> + * if SMEP is enabled.
>> + */
>> + if (kvm_read_cr4_bits(vcpu, X86_CR4_SMEP))
>> + walker.pte_access &= ~ACC_EXEC_MASK;
>> + }
>> +
>
> What about sync_page path?
The sync_page and other prefetch paths only do read-prefetch, means
they call set_spte with write_fault = 0.
--
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