From patchwork Wed Feb 4 14:02:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Parth Dixit X-Patchwork-Id: 44368 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E52DE2029F for ; Wed, 4 Feb 2015 14:07:31 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id gq15sf1484752lab.3 for ; Wed, 04 Feb 2015 06:07:30 -0800 (PST) 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=AmCWcD1h54Q0HEqU5kZ5nSYiBkAuOchly6Jbt0ibISA=; b=Yy2MeR1wXRJcYQy5U5RGFEGWjAVOHuCUJF36dHHLv0WiCMB1JWEwypKtua4W4O1eZO IzXLP3GcHsJu7k+kbj5bt36zn3VSwRJM/Wejxilwn1q+8Wf/KrwYTjrKCpxa26kXF7kA GYaGClnEba4Yh82hltk1oSI57/AgYnrJLhvUljU6+ySm8SSK1EeUADqGX1Cnjzyijd7f yxek8cLRk0tEys6SXshb/TWkgIywW2YEqP+pEMk3ci9ts/SowTnVnR9uNJgyf0VN+NvN zMiuQiKx6J0iMtJXlZlUcT1toGl0rYWXa/1sxLukPOhWdxSjeh/KGhRnKGs2L7YWTap3 dnyg== X-Gm-Message-State: ALoCoQnzfOpz9AQTOI1bLHew2qkB61MnFD37+ZUwJLiBWOVkoTEcXN6KnX6/VqtqxeTj4crOnRcw X-Received: by 10.112.175.10 with SMTP id bw10mr3934453lbc.7.1423058850921; Wed, 04 Feb 2015 06:07:30 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.17 with SMTP id s17ls41337lal.22.gmail; Wed, 04 Feb 2015 06:07:30 -0800 (PST) X-Received: by 10.152.10.238 with SMTP id l14mr29384208lab.68.1423058850715; Wed, 04 Feb 2015 06:07:30 -0800 (PST) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id n3si1434210lan.56.2015.02.04.06.07.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Feb 2015 06:07:30 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by mail-la0-f52.google.com with SMTP id gd6so466913lab.11 for ; Wed, 04 Feb 2015 06:07:30 -0800 (PST) X-Received: by 10.152.8.1 with SMTP id n1mr29620444laa.47.1423058850629; Wed, 04 Feb 2015 06:07:30 -0800 (PST) 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.35.133 with SMTP id h5csp508453lbj; Wed, 4 Feb 2015 06:07:29 -0800 (PST) X-Received: by 10.52.251.197 with SMTP id zm5mr16092773vdc.2.1423058848649; Wed, 04 Feb 2015 06:07:28 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id l9si729381vcz.56.2015.02.04.06.07.27 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 04 Feb 2015 06:07:28 -0800 (PST) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) 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 1YJ0bF-00017f-H2; Wed, 04 Feb 2015 14:06:37 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YJ0bE-00014Y-38 for xen-devel@lists.xen.org; Wed, 04 Feb 2015 14:06:36 +0000 Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id 06/23-31919-B6722D45; Wed, 04 Feb 2015 14:06:35 +0000 X-Env-Sender: parth.dixit@linaro.org X-Msg-Ref: server-8.tower-27.messagelabs.com!1423058793!12743971!1 X-Originating-IP: [209.85.220.41] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 6.13.4; banners=-,-,- X-VirusChecked: Checked Received: (qmail 26612 invoked from network); 4 Feb 2015 14:06:34 -0000 Received: from mail-pa0-f41.google.com (HELO mail-pa0-f41.google.com) (209.85.220.41) by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 4 Feb 2015 14:06:34 -0000 Received: by mail-pa0-f41.google.com with SMTP id kq14so3090525pab.0 for ; Wed, 04 Feb 2015 06:06:33 -0800 (PST) X-Received: by 10.68.190.101 with SMTP id gp5mr15163441pbc.30.1423058792984; Wed, 04 Feb 2015 06:06:32 -0800 (PST) Received: from parthd-ubunutu.qualcomm.com ([202.46.23.62]) by mx.google.com with ESMTPSA id kg12sm2161881pbb.44.2015.02.04.06.06.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 04 Feb 2015 06:06:31 -0800 (PST) From: parth.dixit@linaro.org To: xen-devel@lists.xen.org Date: Wed, 4 Feb 2015 19:32:16 +0530 Message-Id: <1423058539-26403-33-git-send-email-parth.dixit@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1423058539-26403-1-git-send-email-parth.dixit@linaro.org> References: <1423058539-26403-1-git-send-email-parth.dixit@linaro.org> Cc: ian.campbell@citrix.com, julien.grall@linaro.org, tim@xen.org, stefano.stabellini@citrix.com, jbeulich@suse.com, Parth Dixit , christoffer.dall@linaro.org Subject: [Xen-devel] [PATCH RFC 32/35] arm : acpi map xen environment table to dom0 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.52 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: From: Parth Dixit xen environment table contains the grant table address,size and event channel interrupt information required by dom0. Signed-off-by: Parth Dixit --- xen/arch/arm/arm64/acpi/arm-core.c | 52 +++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/arm64/acpi/arm-core.c b/xen/arch/arm/arm64/acpi/arm-core.c index 9fd02f9..9e9285c 100644 --- a/xen/arch/arm/arm64/acpi/arm-core.c +++ b/xen/arch/arm/arm64/acpi/arm-core.c @@ -33,7 +33,6 @@ #include #include #include - /* * We never plan to use RSDT on arm/arm64 as its deprecated in spec but this * variable is still required by the ACPI core @@ -297,6 +296,49 @@ static int map_stao_table(struct domain *d, u64 *mstao) return 0; } +static int map_xenv_table(struct domain *d, u64 *mxenv) +{ + u64 addr; + u64 size; + int res; + u8 checksum; + struct acpi_table_xenv *xenv=NULL; + + xenv = ACPI_ALLOCATE_ZEROED( sizeof(struct acpi_table_xenv) ); + if( xenv == NULL ) + return -ENOMEM; + + ACPI_MEMCPY(xenv->header.signature, ACPI_SIG_XENV, 4); + xenv->header.length = sizeof(struct acpi_table_header)+12; + xenv->header.checksum = 0; + ACPI_MEMCPY(xenv->header.oem_id, "XenVMM", 6); + ACPI_MEMCPY(xenv->header.oem_table_id, "RTSMVEV8", 8); + xenv->header.revision = 1; + ACPI_MEMCPY(xenv->header.asl_compiler_id, "INTL", 4); + xenv->header.asl_compiler_revision = 0x20140828; + xenv->gnt_start = 0x00000010000000; + xenv->gnt_size = 0x20000; + xenv->evt_intr = 31; + xenv->evt_intr_flag =3; + size = sizeof(struct acpi_table_xenv); + checksum = acpi_tb_checksum(ACPI_CAST_PTR(u8, xenv), size); + xenv->header.checksum = (u8)( xenv->header.checksum - checksum ); + *mxenv = addr = virt_to_maddr(xenv); + + res = map_ram_regions(d, + paddr_to_pfn(addr & PAGE_MASK), + DIV_ROUND_UP(size, PAGE_SIZE), + paddr_to_pfn(addr & PAGE_MASK)); + if ( res ) + { + printk(XENLOG_ERR "Unable to map 0x%"PRIx64 + " - 0x%"PRIx64" in domain \n", + addr & PAGE_MASK, PAGE_ALIGN(addr + size) - 1); + return res; + } + + return 0; +} #define NR_NEW_XEN_TABLES 2 @@ -346,6 +388,14 @@ static int map_xsdt_table(struct domain *d, u64 *xsdt) ( ( (size - sizeof(struct acpi_table_header) ) / sizeof(acpi_native_uint) ) ); + /* map xen env table */ + res = map_xenv_table(d, &addr); + if(res) + return res; + + table_entry--; + *table_entry = addr ; + /* map stao table */ map_stao_table(d, &addr); if(res)