From patchwork Sun May 17 20:03:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Parth Dixit X-Patchwork-Id: 48663 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BE5B121411 for ; Sun, 17 May 2015 20:07:57 +0000 (UTC) Received: by wgyu3 with SMTP id u3sf23650728wgy.3 for ; Sun, 17 May 2015 13:07:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive; bh=XuSYO3ANeJhLC4lcP1QHsALfrZuifjfZrdBlJChnrVc=; b=f0xXfZS9GiHm6jXaonjfd7oDpB5XkqssRE3Dek0m+jiCJp6dDgrb0OyhMgdMpQj8yY qDVK93486DJIUzsLlE8IrpzSKp6YwRGTXUpLIBB1G/nTB1HoEEsf/sWWZfFmmuOwfiIj PArCAb+JdFg4rTgDE6/Bw6H0x8mWy8MduWnaJbeQShCzMK0PAfbnEMq/IMVIjTmnWvqe BkRvQ2Pv+FTrE+xNQAczH92Idrk0IsRqPyoG7eBpGZueMuhLjNUv3x4c4Myds3TO24lY HffkJUh3ezQ+EdU4Ra8hjczGCTuZrOSFgMIYqiiAEAQFu/FYNfDOlvdRmFChujO6TKX2 VAhg== X-Gm-Message-State: ALoCoQl6C1mr2kCaKRsa8Oo4W31lW97ZgGKaobTrnNBtY0f7hx6zThC3lZLatHgyxFji9UTYKqgn X-Received: by 10.152.37.101 with SMTP id x5mr15255065laj.5.1431893276880; Sun, 17 May 2015 13:07:56 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.22.10 with SMTP id z10ls703262lae.24.gmail; Sun, 17 May 2015 13:07:56 -0700 (PDT) X-Received: by 10.152.7.97 with SMTP id i1mr14352610laa.49.1431893276497; Sun, 17 May 2015 13:07:56 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id xp11si5346332lac.1.2015.05.17.13.07.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 May 2015 13:07:56 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by lagv1 with SMTP id v1so191345036lag.3 for ; Sun, 17 May 2015 13:07:56 -0700 (PDT) X-Received: by 10.152.4.137 with SMTP id k9mr14578381lak.29.1431893276399; Sun, 17 May 2015 13:07:56 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp3508517lbb; Sun, 17 May 2015 13:07:55 -0700 (PDT) X-Received: by 10.52.243.73 with SMTP id ww9mr17808866vdc.36.1431893274993; Sun, 17 May 2015 13:07:54 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id fa3si8016274vdb.22.2015.05.17.13.07.54 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 17 May 2015 13:07:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xen.org designates 50.57.142.19 as permitted sender) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Yu4pM-0003GE-Aw; Sun, 17 May 2015 20:06:24 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Yu4pK-0003Cy-Ij for xen-devel@lists.xen.org; Sun, 17 May 2015 20:06:22 +0000 Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id 64/1C-03730-DB4F8555; Sun, 17 May 2015 20:06:21 +0000 X-Env-Sender: parth.dixit@linaro.org X-Msg-Ref: server-3.tower-31.messagelabs.com!1431893179!11314255!1 X-Originating-IP: [209.85.192.181] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.13.15; banners=-,-,- X-VirusChecked: Checked Received: (qmail 18852 invoked from network); 17 May 2015 20:06:20 -0000 Received: from mail-pd0-f181.google.com (HELO mail-pd0-f181.google.com) (209.85.192.181) by server-3.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 17 May 2015 20:06:20 -0000 Received: by pdea3 with SMTP id a3so116281118pde.2 for ; Sun, 17 May 2015 13:06:19 -0700 (PDT) X-Received: by 10.66.145.33 with SMTP id sr1mr37517759pab.41.1431893179463; Sun, 17 May 2015 13:06:19 -0700 (PDT) Received: from localhost.localdomain ([117.247.24.139]) by mx.google.com with ESMTPSA id j9sm7838401pdm.53.2015.05.17.13.06.15 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 17 May 2015 13:06:18 -0700 (PDT) From: Parth Dixit To: xen-devel@lists.xen.org Date: Mon, 18 May 2015 01:33:56 +0530 Message-Id: <1431893048-5214-30-git-send-email-parth.dixit@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431893048-5214-1-git-send-email-parth.dixit@linaro.org> References: <1431893048-5214-1-git-send-email-parth.dixit@linaro.org> Cc: keir@xen.org, ian.campbell@citrix.com, andrew.cooper3@citrix.com, tim@xen.org, julien.grall@citrix.com, stefano.stabellini@citrix.com, jbeulich@suse.com, parth.dixit@linaro.org, christoffer.dall@linaro.org Subject: [Xen-devel] [PATCH v2 29/41] arm : acpi read acpi memory info from uefi X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: parth.dixit@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: ACPI memory is seperate from conventional memory and should be marked as reserved while passing to DOM0. Create a new meminfo structure to store all the acpi tables listed in uefi. Signed-off-by: Parth Dixit --- xen/arch/arm/domain_build.c | 2 ++ xen/arch/arm/efi/efi-boot.h | 20 +++++++++++++++++--- xen/include/asm-arm/setup.h | 1 + 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 865b81a..9d98f64 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -42,6 +42,8 @@ static void __init parse_dom0_mem(const char *s) } custom_param("dom0_mem", parse_dom0_mem); +struct meminfo __initdata acpi_mem; + //#define DEBUG_DT #ifdef DEBUG_DT diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h index b02cc02..d21cba5 100644 --- a/xen/arch/arm/efi/efi-boot.h +++ b/xen/arch/arm/efi/efi-boot.h @@ -127,14 +127,16 @@ static EFI_STATUS __init efi_process_memory_map_bootinfo(EFI_MEMORY_DESCRIPTOR * { int Index; int i = 0; + int j = 0; EFI_MEMORY_DESCRIPTOR *desc_ptr = map; for ( Index = 0; Index < (mmap_size / desc_size); Index++ ) { - if ( desc_ptr->Type == EfiConventionalMemory - || desc_ptr->Type == EfiBootServicesCode - || desc_ptr->Type == EfiBootServicesData ) + switch( desc_ptr->Type ) { + case EfiConventionalMemory: + case EfiBootServicesCode: + case EfiBootServicesData: if ( i >= NR_MEM_BANKS ) { PrintStr(L"Warning: All " __stringify(NR_MEM_BANKS) @@ -144,11 +146,23 @@ static EFI_STATUS __init efi_process_memory_map_bootinfo(EFI_MEMORY_DESCRIPTOR * bootinfo.mem.bank[i].start = desc_ptr->PhysicalStart; bootinfo.mem.bank[i].size = desc_ptr->NumberOfPages * EFI_PAGE_SIZE; ++i; + break; + case EfiACPIReclaimMemory: + if ( j >= NR_MEM_BANKS ) + { + PrintStr(L"Warning: All " __stringify(NR_MEM_BANKS) + " acpi meminfo mem banks exhausted.\r\n"); + break; + } + acpi_mem.bank[j].start = desc_ptr->PhysicalStart; + acpi_mem.bank[j].size = desc_ptr->NumberOfPages * EFI_PAGE_SIZE; + ++j; } desc_ptr = NextMemoryDescriptor(desc_ptr, desc_size); } bootinfo.mem.nr_banks = i; + acpi_mem.nr_banks = j; return EFI_SUCCESS; } diff --git a/xen/include/asm-arm/setup.h b/xen/include/asm-arm/setup.h index ba5a67d..1865b72 100644 --- a/xen/include/asm-arm/setup.h +++ b/xen/include/asm-arm/setup.h @@ -46,6 +46,7 @@ struct bootinfo { }; extern struct bootinfo bootinfo; +extern struct meminfo acpi_mem; void arch_init_memory(void);