From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752801AbdEJOVs (ORCPT ); Wed, 10 May 2017 10:21:48 -0400 Received: from mx2.suse.de ([195.135.220.15]:43368 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752299AbdEJOVr (ORCPT ); Wed, 10 May 2017 10:21:47 -0400 Subject: Re: [PATCH] xen: adjust early dom0 p2m handling to xen hypervisor behavior To: Boris Ostrovsky , linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org References: <20170510040844.24355-1-jgross@suse.com> <9c434080-8b23-8bc5-1560-9352b9c1e55a@oracle.com> From: Juergen Gross Message-ID: Date: Wed, 10 May 2017 16:19:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <9c434080-8b23-8bc5-1560-9352b9c1e55a@oracle.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/05/17 15:45, Boris Ostrovsky wrote: > On 05/10/2017 12:08 AM, Juergen Gross wrote: >> When booted as pv-guest the p2m list presented by the Xen is already >> mapped to virtual addresses. In dom0 case the hypervisor might make use >> of 2M- or 1G-pages for this mapping. Unfortunately while being properly >> aligned in virtual and machine address space, those pages might not be >> aligned properly in guest physical address space. > > Is this the only place where we shouldn't assume that large page is > properly aligned (in pfn space)? It is the only case requiring a change. xen_cleanmfnmap_*() already does this correctly via the same mechanism I used in this patch. I'm not aware of any other large pages set up by Xen for pv guests than the ones for the initial p2m list. And these large pages are freed (via xen_cleanmfnmap_*()) after setting up the final p2m list in kernel virtual space. Juergen