From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [RESEND PATCH 1/3] kvm: calculate correct gfn for small host pages which emulates large guest pages Date: Wed, 26 May 2010 14:23:32 +0300 Message-ID: <4BFD04B4.6050409@redhat.com> References: <4BD97AC1.8070704@cn.fujitsu.com> <4BFCE053.6040505@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , LKML , kvm@vger.kernel.org To: Lai Jiangshan Return-path: In-Reply-To: <4BFCE053.6040505@cn.fujitsu.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 05/26/2010 11:48 AM, Lai Jiangshan wrote: > In Document/kvm/mmu.txt: > gfn: > Either the guest page table containing the translations shadowed by this > page, or the base page frame for linear translations. See role.direct. > > But in function FNAME(fetch)(), sp->gfn is incorrect when one of following > situations occurred: > 1) guest is 32bit paging and the guest PDE maps a 4-MByte page > (backed by 4k host pages), FNAME(fetch)() miss handling the quadrant. > > And if guest use pse-36, "table_gfn = gpte_to_gfn(gw->ptes[level - delta]);" > is incorrect. > 2) guest is long mode paging and the guest PDPTE maps a 1-GByte page > (backed by 4k or 2M host pages). > > So we fix it to suit to the document and suit to the code which > requires sp->gfn correct when sp->role.direct=1. > > We use the goal mapping gfn(gw->gfn) to calculate the base page frame > for linear translations, it is simple and easy to be understood. > Applied, thanks. -- error compiling committee.c: too many arguments to function