Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752080AbbFYRLb (ORCPT ); Thu, 25 Jun 2015 13:11:31 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:49922 "EHLO SMTP02.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751712AbbFYRLS (ORCPT ); Thu, 25 Jun 2015 13:11:18 -0400 X-IronPort-AV: E=Sophos;i="5.13,678,1427760000"; d="scan'208";a="278596202" From: David Vrabel To: CC: David Vrabel , Konrad Rzeszutek Wilk , Boris Ostrovsky , , , Daniel Kiper Subject: [PATCHv1 3/8] x86/xen: discard RAM regions above the maximum reservation Date: Thu, 25 Jun 2015 18:10:58 +0100 Message-ID: <1435252263-31952-4-git-send-email-david.vrabel@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1435252263-31952-1-git-send-email-david.vrabel@citrix.com> References: <1435252263-31952-1-git-send-email-david.vrabel@citrix.com> MIME-Version: 1.0 Content-Type: text/plain X-DLP: MIA2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1336 Lines: 43 During setup, discard RAM regions that are above the maximum reservation (instead of marking them as E820_UNUSABLE). This allows hotplug memory to be placed at these addresses. Signed-off-by: David Vrabel --- arch/x86/xen/setup.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c index 55f388e..32910c5 100644 --- a/arch/x86/xen/setup.c +++ b/arch/x86/xen/setup.c @@ -646,6 +646,7 @@ char * __init xen_memory_setup(void) phys_addr_t addr = map[i].addr; phys_addr_t size = map[i].size; u32 type = map[i].type; + bool discard = false; if (type == E820_RAM) { if (addr < mem_end) { @@ -656,10 +657,11 @@ char * __init xen_memory_setup(void) xen_add_extra_mem(addr, size); xen_max_p2m_pfn = PFN_DOWN(addr + size); } else - type = E820_UNUSABLE; + discard = true; } - xen_align_and_add_e820_region(addr, size, type); + if (!discard) + xen_align_and_add_e820_region(addr, size, type); map[i].addr += size; map[i].size -= size; -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/