lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4E6FA189.7080607@cn.fujitsu.com>
Date:	Wed, 14 Sep 2011 02:31:37 +0800
From:	Xiao Guangrong <xiaoguangrong@...fujitsu.com>
To:	Avi Kivity <avi@...hat.com>
CC:	Marcelo Tosatti <mtosatti@...hat.com>,
	LKML <linux-kernel@...r.kernel.org>, KVM <kvm@...r.kernel.org>
Subject: Re: [PATCH v3 06/11] KVM: MMU: cleanup FNAME(invlpg)

On 09/13/2011 07:00 PM, Avi Kivity wrote:
> On 08/30/2011 05:36 AM, Xiao Guangrong wrote:
>> Directly Use mmu_page_zap_pte to zap spte in FNAME(invlpg), also remove the
>> same code between FNAME(invlpg) and FNAME(sync_page)
>>
>>
>> +static gpa_t FNAME(get_first_pte_gpa)(struct kvm_mmu_page *sp)
> 
> spte
> 

Yes, Will fix.

>> +{
>> +    int offset = 0;
>> +
>> +    if (PTTYPE == 32)
>> +        offset = sp->role.quadrant<<  PT64_LEVEL_BITS;
>> +
>> +    return gfn_to_gpa(sp->gfn) + offset * sizeof(pt_element_t);
>> +}
> 
> Only works for L1 tables, yes?  Need a comment so it isn't reused for L2.
> 

OK.

>> @@ -663,7 +673,6 @@ static void FNAME(invlpg)(struct kvm_vcpu *vcpu, gva_t gva)
>>       gpa_t pte_gpa = -1;
>>       int level;
>>       u64 *sptep;
>> -    int need_flush = 0;
>>
>>       vcpu_clear_mmio_info(vcpu, gva);
>>
>> @@ -675,36 +684,20 @@ static void FNAME(invlpg)(struct kvm_vcpu *vcpu, gva_t gva)
>>
>>           sp = page_header(__pa(sptep));
>>           if (is_last_spte(*sptep, level)) {
>> -            int offset, shift;
>> -
>>               if (!sp->unsync)
>>                   break;
>>
>> -            shift = PAGE_SHIFT -
>> -                  (PT_LEVEL_BITS - PT64_LEVEL_BITS) * level;
>> -            offset = sp->role.quadrant<<  shift;
>> -
>> -            pte_gpa = (sp->gfn<<  PAGE_SHIFT) + offset;
>> +            pte_gpa = FNAME(get_first_pte_gpa)(sp);
> 
> 
> Here is can be used for L2 - I think we can use 2MB host pages to back 4MB guest mappings.
> 

Only unsync shadow page is fetched here, and its level is always 1.
 


--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ