Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932903AbdDFJgS (ORCPT ); Thu, 6 Apr 2017 05:36:18 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:50390 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753962AbdDFIkG (ORCPT ); Thu, 6 Apr 2017 04:40:06 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ross Lagerwall , Juergen Gross Subject: [PATCH 4.4 02/26] xen/setup: Dont relocate p2m over existing one Date: Thu, 6 Apr 2017 10:38:24 +0200 Message-Id: <20170406083604.474899074@linuxfoundation.org> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170406083604.362636628@linuxfoundation.org> References: <20170406083604.362636628@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1382 Lines: 49 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ross Lagerwall commit 7ecec8503af37de6be4f96b53828d640a968705f upstream. When relocating the p2m, take special care not to relocate it so that is overlaps with the current location of the p2m/initrd. This is needed since the full extent of the current location is not marked as a reserved region in the e820. This was seen to happen to a dom0 with a large initial p2m and a small reserved region in the middle of the initial p2m. Signed-off-by: Ross Lagerwall Reviewed-by: Juergen Gross Signed-off-by: Juergen Gross Signed-off-by: Greg Kroah-Hartman --- arch/x86/xen/setup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/arch/x86/xen/setup.c +++ b/arch/x86/xen/setup.c @@ -713,10 +713,9 @@ static void __init xen_reserve_xen_mfnli size = PFN_PHYS(xen_start_info->nr_p2m_frames); } - if (!xen_is_e820_reserved(start, size)) { - memblock_reserve(start, size); + memblock_reserve(start, size); + if (!xen_is_e820_reserved(start, size)) return; - } #ifdef CONFIG_X86_32 /* @@ -727,6 +726,7 @@ static void __init xen_reserve_xen_mfnli BUG(); #else xen_relocate_p2m(); + memblock_free(start, size); #endif }