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] [day] [month] [year] [list]
Date:	Fri, 23 Apr 2010 15:11:34 +0300
From:	Avi Kivity <avi@...hat.com>
To:	Xiao Guangrong <xiaoguangrong@...fujitsu.com>
CC:	Marcelo Tosatti <mtosatti@...hat.com>,
	KVM list <kvm@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/10] KVM MMU: fix for calculating gpa in invlpg code

On 04/23/2010 03:05 PM, Xiao Guangrong wrote:
>
>
>>> @@ -478,9 +478,14 @@ static void FNAME(invlpg)(struct kvm_vcpu *vcpu,
>>> gva_t gva)
>>>                ((level == PT_DIRECTORY_LEVEL&&   is_large_pte(*sptep))) ||
>>>                ((level == PT_PDPE_LEVEL&&   is_large_pte(*sptep)))) {
>>>                struct kvm_mmu_page *sp = page_header(__pa(sptep));
>>> +            int offset = 0;
>>> +
>>> +            if (PTTYPE == 32)
>>> +                offset = sp->role.quadrant<<   PT64_LEVEL_BITS;;
>>>
>>>        
>> Wrong for PT_DIRECTORY_LEVEL (should be q<<  8).  Also, too many
>> semicolons.
>>
>>      
> I guess you mean 'PT64_LEVEL_BITS' not 'PT_DIRECTORY_LEVEL' here :-)
>    

No, I mean if level == PT_DIRECTORY_LEVEL, then we want role.quadrant << 
8, not 9.

> It should be q<<  8 here? it hardly understand, take leve = 1 for example,
> 32-bit guest PTE page table mapping range is 2^(10+12), PAE's PTE page table
> mapping range is 2^(9+12),

For level == PT_DIRECTORY_LEVEL, quadrant is in the range 0..3.  Each sp 
maps 1GB, while the guest page table maps 4GB.  So the upper two bits 
become the quadrant.

>   so, i think it's quadrant<<  9 here, and other
> function like FNAME(prefetch_page), FNAME(sync_page) also are q<<  9
>    

They only work for PT_PAGE_TABLE_LEVEL, so for them 9 is correct.

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.

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