[<prev] [next>] [day] [month] [year] [list]
Message-ID: <4BE3D4C2.4070906@cn.fujitsu.com>
Date: Fri, 07 May 2010 16:52:18 +0800
From: Lai Jiangshan <laijs@...fujitsu.com>
To: Lai Jiangshan <laijs@...fujitsu.com>, Avi Kivity <avi@...hat.com>,
Marcelo Tosatti <mtosatti@...hat.com>
CC: Joerg Roedel <joro@...tes.org>,
LKML <linux-kernel@...r.kernel.org>, kvm@...r.kernel.org,
Gui Jianfeng <guijianfeng@...fujitsu.com>
Subject: Re: [RFC PATCH] kvm: calculate correct gfn for small host pages which
emulates large guest pages
Lai Jiangshan wrote:
> Lai Jiangshan wrote:
>> RFC, because maybe I missing something with the old code.
>>
>> Frome: Lai Jiangshan <laijs@...fujitsu.com>
>>
>> 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 guest uses pse-36 and the guest PDE maps
>> a 4-MByte page(backed by 4k host pages) and bits 20:13 of the guest PDE
>> is not equals to 0.
>> 2) guest is long mode paging and the guest PDPTE maps a 1-GByte page
>> (backed by 4k or 2M host pages)
>>
>
> Resend this patch with the changelog changed.
>
> As Marcelo Tosatti and Gui Jianfeng points out,
> FNAME(fetch)() miss quadrant on 4mb large page emulation with shadow.
>
> Subject: [PATCH] kvm: calculate correct gfn for small host pages which emulates large guest pages
>
> 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.
>
> Signed-off-by: Lai Jiangshan <laijs@...fujitsu.com>
> ---
Could you add these:
Reported-by: Marcelo Tosatti <mtosatti@...hat.com>
Reported-by: Gui Jianfeng <guijianfeng@...fujitsu.com>
Thanks.
Lai.
PS.
The whole patches includes:
[PATCH] kvm mmu: reduce 50% memory usage
[PATCH] kvm: calculate correct gfn for small host pages which emulates large guest pages
[PATCH] kvm, tdp: calculate correct base gfn for non-DIR level
[PATCH] kvm: update document of gfns
--
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