From patchwork Tue Nov 15 00:11:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: athorlton@sgi.com X-Patchwork-Id: 9428993 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D55AF60469 for ; Tue, 15 Nov 2016 05:01:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B438728B4D for ; Tue, 15 Nov 2016 05:01:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A8A4F28B5A; Tue, 15 Nov 2016 05:01:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 01BE028B4D for ; Tue, 15 Nov 2016 05:01:49 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6VqO-0006fD-Pd; Tue, 15 Nov 2016 04:59:40 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6RLQ-0005MB-CJ for xen-devel@lists.xenproject.org; Tue, 15 Nov 2016 00:11:24 +0000 Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id 25/37-23231-AA25A285; Tue, 15 Nov 2016 00:11:22 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrILMWRWlGSWpSXmKPExsVywGAGo+6KIK0 Ig1ncFt+3TGZyYPQ4/OEKSwBjFGtmXlJ+RQJrxv65J1kLJghUtD54yt7A+I23i5GLQ0hgF6PE hJ4lTF2MnEBOrcSHf42sIDabgLrEi1cbGEFsEQEWiZXfv7OANDALrGaSOHLiBTNIQljAT2Ju2 0kwm0VAVWL7oc3sXYwcHLwCjhIHV6eBhCUEFCQ6NhxjB7E5BZwk7k74wwixy1Hi3ozTLBMYuR cwMqxi1ChOLSpLLdI1NNdLKspMzyjJTczM0TU0MNbLTS0uTkxPzUlMKtZLzs/dxAj0LgMQ7GB 8edrzEKMkB5OSKO86L60IIb6k/JTKjMTijPii0pzU4kOMMhwcShK8BYFAOcGi1PTUirTMHGCY waQlOHiURHglQdK8xQWJucWZ6RCpU4y6HG92vXzAJMSSl5+XKiXOGwpSJABSlFGaBzcCFvKXG GWlhHkZgY4S4ilILcrNLEGVf8UozsGoJMx7CWQKT2ZeCdymV0BHMAEdsctcA+SIkkSElFQDY9 T7jj9tB8Uv/ij12fXrq5PZ2qMqX19KbjrnL+01s2F3lXTDuTNGqi41BtmlHuff2p2KnCUb8PL 2EYmEGO4vmUre0yfZ/pCVK/Es+ag2rfRKIL/h9W0zxBLFnv40N+w+vvTFotNrhPmtfWewb//F aFly6E48457i/0cd5EVPP/qZ+U7ilf9MFyWW4oxEQy3mouJEANiszYN0AgAA X-Env-Sender: athorlton@sgi.com X-Msg-Ref: server-3.tower-31.messagelabs.com!1479168679!70918378!1 X-Originating-IP: [192.48.152.1] X-SpamReason: No, hits=0.3 required=7.0 tests=MAILTO_TO_SPAM_ADDR X-StarScan-Received: X-StarScan-Version: 9.0.16; banners=-,-,- X-VirusChecked: Checked Received: (qmail 13967 invoked from network); 15 Nov 2016 00:11:19 -0000 Received: from relay3.sgi.com (HELO relay.sgi.com) (192.48.152.1) by server-3.tower-31.messagelabs.com with SMTP; 15 Nov 2016 00:11:19 -0000 Received: from stormcage.americas.sgi.com (stormcage.americas.sgi.com [128.162.236.70]) by relay3.corp.sgi.com (Postfix) with ESMTP id B3F6DAC004; Mon, 14 Nov 2016 16:11:17 -0800 (PST) Received: by stormcage.americas.sgi.com (Postfix, from userid 48426) id 58FE82025C3B3; Mon, 14 Nov 2016 18:11:17 -0600 (CST) From: Alex Thorlton To: Date: Mon, 14 Nov 2016 18:11:17 -0600 Message-Id: <1479168677-23633-2-git-send-email-athorlton@sgi.com> X-Mailer: git-send-email 1.8.5.6 In-Reply-To: <1479168677-23633-1-git-send-email-athorlton@sgi.com> References: <1479168677-23633-1-git-send-email-athorlton@sgi.com> X-Mailman-Approved-At: Tue, 15 Nov 2016 04:59:39 +0000 Cc: Russ Anderson , Juergen Gross , x86@kernel.org, Ingo Molnar , David Vrabel , "H. Peter Anvin" , xen-devel@lists.xenproject.org, Alex Thorlton , Thomas Gleixner Subject: [Xen-devel] [PATCH] xen/x86: Increase xen_e820_map to E820_X_MAX possible entries 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: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP On systems with sufficiently large e820 tables, and several IOAPICs, it is possible for the XENMEM_machine_memory_map callback (and its counterpart, XENMEM_memory_map) to attempt to return an e820 table with more than 128 entries. This callback adds entries to the BIOS-provided e820 table to account for IOAPIC registers, which, on sufficiently large systems, can result in an e820 table that is too large to copy back into xen_e820_map. This change simply increases the size of xen_e820_map to E820_X_MAX to ensure that there is enough room to store the entire e820 map returned from this callback. Signed-off-by: Alex Thorlton Suggested-by: Boris Ostrovsky Cc: Russ Anderson Cc: David Vrabel Cc: Juergen Gross Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: x86@kernel.org Cc: xen-devel@lists.xenproject.org --- arch/x86/xen/setup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c index f8960fc..5e1ecc7 100644 --- a/arch/x86/xen/setup.c +++ b/arch/x86/xen/setup.c @@ -41,7 +41,7 @@ unsigned long xen_released_pages; /* E820 map used during setting up memory. */ -static struct e820entry xen_e820_map[E820MAX] __initdata; +static struct e820entry xen_e820_map[E820_X_MAX] __initdata; static u32 xen_e820_map_entries __initdata; /* @@ -750,7 +750,7 @@ char * __init xen_memory_setup(void) max_pfn = min(max_pfn, xen_start_info->nr_pages); mem_end = PFN_PHYS(max_pfn); - memmap.nr_entries = E820MAX; + memmap.nr_entries = E820_X_MAX; set_xen_guest_handle(memmap.buffer, xen_e820_map); op = xen_initial_domain() ? @@ -923,7 +923,7 @@ char * __init xen_auto_xlated_memory_setup(void) int i; int rc; - memmap.nr_entries = E820MAX; + memmap.nr_entries = E820_X_MAX; set_xen_guest_handle(memmap.buffer, xen_e820_map); rc = HYPERVISOR_memory_op(XENMEM_memory_map, &memmap);