[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/2] xen: fix setting of max_pfn in shared_info


  • To: Juergen Gross <jgross@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 16 Jun 2021 11:52:06 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nvqSXTc9qRreDkQ/pbmsZdVQqBPgRdx/Z2HSpqNP6N0=; b=R72IzlYS5Ei2XM5dOmMz8lXcjSD39HqCmIgAnWtg9ZB4Ahy0f0iER5gK2xy7dST8M1i43nXY8rIn/A98UT/RYaMnVaxf8AYxzmCUGBzYCFneqZyhDD3kn+dandaIcsAhwya4pSTy8oRC/bhjTnbRHFwDd0PTqqBLz9qRlYGYI4kQpru0+xBQT5aWrFET2u62aCt9I6MN0br/Ydb0Ra040jOzpvxAgwo8/J1v9lc8/hsGLNhsIaipgckAA4+x5ms/E5F48QhC8Nn9ORR0yOVjMd1MZHjJL2uEA6SVuK8M++zVyPIb5ahuL+Py3ndbTqd2kPmQnUa5r4xBHbSQVfKopg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XC10Br6y36hBvWKoUo/oarDNIq4lTQGETRDr/OgjPC7aa+RqkszowagqHmLbvw00b/Tj396BLwvtCSZesaO3nSs2lFw9Lir4rsgQ4UdLcVz4oYXU5ZxyTbIHORtCsrS/1Ts4PsIE4CUoCMhADtV4tD8CB3apwwKYam+WlIWBaOzW5ccC4XWAT7kIGWRfa8Rx3KmZiqDuKuuVsHDG5Thn1acCGunze4YOnzadro3Q8GyEJqY4uGbwc6AXvu/GRpwSjedO8dLMEU7UlhUpYGgtlPhltOdyxRPvxb4Moiy4KGcSM/lA54RwxkjAN7BOK86zL5qiRE7liKvL2XKug1vd9A==
  • Authentication-results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=suse.com;
  • Cc: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>, stable@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, x86@xxxxxxxxxx
  • Delivery-date: Wed, 16 Jun 2021 09:52:35 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 16.06.2021 09:30, Juergen Gross wrote:
> Xen PV guests are specifying the highest used PFN via the max_pfn
> field in shared_info. This value is used by the Xen tools when saving
> or migrating the guest.
> 
> Unfortunately this field is misnamed, as in reality it is specifying
> the number of pages (including any memory holes) of the guest, so it
> is the highest used PFN + 1. Renaming isn't possible, as this is a
> public Xen hypervisor interface which needs to be kept stable.
> 
> The kernel will set the value correctly initially at boot time, but
> when adding more pages (e.g. due to memory hotplug or ballooning) a
> real PFN number is stored in max_pfn. This is done when expanding the
> p2m array, and the PFN stored there is even possibly wrong, as it
> should be the last possible PFN of the just added P2M frame, and not
> one which led to the P2M expansion.
> 
> Fix that by setting shared_info->max_pfn to the last possible PFN + 1.
> 
> Fixes: 98dd166ea3a3c3 ("x86/xen/p2m: hint at the last populated P2M entry")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Juergen Gross <jgross@xxxxxxxx>

The code change is fine, so
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

But I think even before the rename you would want to clarify the comment
next to the variable's definition, to make clear what it really holds.

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.