From patchwork Mon Mar 14 17:53:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Vrabel X-Patchwork-Id: 8582471 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5D8249F54C for ; Mon, 14 Mar 2016 17:57:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 89EF52013D for ; Mon, 14 Mar 2016 17:57:04 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A950020120 for ; Mon, 14 Mar 2016 17:57:03 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1afWgf-0004iF-Ad; Mon, 14 Mar 2016 17:53:49 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1afWge-0004i9-6V for xen-devel@lists.xenproject.org; Mon, 14 Mar 2016 17:53:48 +0000 Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id 4E/92-23864-BAAF6E65; Mon, 14 Mar 2016 17:53:47 +0000 X-Env-Sender: prvs=8740a2381=david.vrabel@citrix.com X-Msg-Ref: server-14.tower-31.messagelabs.com!1457978025!28973386!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 8.11; banners=-,-,- X-VirusChecked: Checked Received: (qmail 58039 invoked from network); 14 Mar 2016 17:53:46 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-14.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 14 Mar 2016 17:53:46 -0000 X-IronPort-AV: E=Sophos;i="5.24,336,1454976000"; d="scan'208";a="338807301" From: David Vrabel To: Date: Mon, 14 Mar 2016 17:53:37 +0000 Message-ID: <1457978017-30974-1-git-send-email-david.vrabel@citrix.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 X-DLP: MIA2 Cc: Andrew Cooper , David Vrabel , Jan Beulich Subject: [Xen-devel] [PATCHv1] hvmloader: add high memory e820 region if needed X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If the MMIO hole is large and hvmloader needs to relocate memory to immediately above the 4 GiB boundary, the e820 presented to the guest will not have a RAM region above 4 GiB. e.g., a guest with 3 GiB of memory and a 2 GiB MMIO hole will only see 2 GiB. The required e820 memory region above 4 GiB needs to be added, and not just filled in. Signed-off-by: David Vrabel Reviewed-by: Andrew Cooper --- tools/firmware/hvmloader/e820.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/firmware/hvmloader/e820.c b/tools/firmware/hvmloader/e820.c index bbde2be..5541b18 100644 --- a/tools/firmware/hvmloader/e820.c +++ b/tools/firmware/hvmloader/e820.c @@ -99,6 +99,7 @@ void adjust_memory_map(void) ((uint64_t)hvm_info->high_mem_pgend << PAGE_SHIFT) - memory_map.map[i].addr; memory_map.map[i].type = E820_RAM; + memory_map.nr_map++; } }