From patchwork Wed Feb 4 14:02:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Parth Dixit X-Patchwork-Id: 44369 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 428202029F for ; Wed, 4 Feb 2015 14:07:34 +0000 (UTC) Received: by mail-wg0-f69.google.com with SMTP id x12sf1475877wgg.0 for ; Wed, 04 Feb 2015 06:07:33 -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=HDj8CWenxH5AV99RtfYaghO234oNbqSUJipdB6OG/Fo=; b=mCcNDfB3PUW97JZ5snni4geFhO7ji3736ZAY8BBSFTInoY1jaTnPEp5jbwo9HFVmvJ NLS5KP2+9tpD/wpzhixoYV7fY/MjODdiczJeKI+GhkMESTV83pxpfv+uYFEq6wJ+vz9D dAK9yA4o/jOn2krqbz9AowkIaWdhvfCsbkkFTWQivMQlvrOchBB8itUAEEewry615Z+D OYWsAtHYIpG6fmYNHn+ebi2qxFGwiCjwV6r1yuZxWMtxEX6tiqoINB2c62Ipy7FJ9GYu dp5TNq9I8zQrELKGNCi7EUfnRYyN2U1AZBUFtkXy8a6sWvesVrn9l0ox2s64IlqEuOH3 vVnQ== X-Gm-Message-State: ALoCoQnT4lJv53e3K62wFIlHi59wTqjqoIlBABODhoFdl0g+rMA0QQwgJv5hZJuiFMuHOEBwSey9 X-Received: by 10.112.143.167 with SMTP id sf7mr3873171lbb.0.1423058853516; Wed, 04 Feb 2015 06:07:33 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.97 with SMTP id z1ls39112laz.35.gmail; Wed, 04 Feb 2015 06:07:33 -0800 (PST) X-Received: by 10.112.137.38 with SMTP id qf6mr13086704lbb.59.1423058853371; Wed, 04 Feb 2015 06:07:33 -0800 (PST) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id l4si1414572lbp.82.2015.02.04.06.07.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Feb 2015 06:07:33 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by mail-la0-f46.google.com with SMTP id q1so1721244lam.5 for ; Wed, 04 Feb 2015 06:07:33 -0800 (PST) X-Received: by 10.152.7.229 with SMTP id m5mr31004334laa.80.1423058853234; Wed, 04 Feb 2015 06:07:33 -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 h5csp508481lbj; Wed, 4 Feb 2015 06:07:32 -0800 (PST) X-Received: by 10.221.74.146 with SMTP id yw18mr7170097vcb.25.1423058851484; Wed, 04 Feb 2015 06:07:31 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id yw2si761985vdb.4.2015.02.04.06.07.30 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 04 Feb 2015 06:07:31 -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 1YJ0b9-0000uR-07; Wed, 04 Feb 2015 14:06:31 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YJ0b7-0000pe-9r for xen-devel@lists.xen.org; Wed, 04 Feb 2015 14:06:29 +0000 Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id 64/8A-02749-46722D45; Wed, 04 Feb 2015 14:06:28 +0000 X-Env-Sender: parth.dixit@linaro.org X-Msg-Ref: server-10.tower-21.messagelabs.com!1423058787!12488666!1 X-Originating-IP: [209.85.220.46] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.13.4; banners=-,-,- X-VirusChecked: Checked Received: (qmail 14603 invoked from network); 4 Feb 2015 14:06:28 -0000 Received: from mail-pa0-f46.google.com (HELO mail-pa0-f46.google.com) (209.85.220.46) by server-10.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 4 Feb 2015 14:06:28 -0000 Received: by mail-pa0-f46.google.com with SMTP id lj1so2996780pab.5 for ; Wed, 04 Feb 2015 06:06:26 -0800 (PST) X-Received: by 10.66.249.2 with SMTP id yq2mr46807496pac.40.1423058786758; Wed, 04 Feb 2015 06:06:26 -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.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 04 Feb 2015 06:06:25 -0800 (PST) From: parth.dixit@linaro.org To: xen-devel@lists.xen.org Date: Wed, 4 Feb 2015 19:32:15 +0530 Message-Id: <1423058539-26403-32-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 31/35] arm : acpi map status override 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.46 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 hide UART used by xen by indicating it in STAO table and map it to dom0 Signed-off-by: Parth Dixit --- xen/arch/arm/arm64/acpi/arm-core.c | 50 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/xen/arch/arm/arm64/acpi/arm-core.c b/xen/arch/arm/arm64/acpi/arm-core.c index a210596..9fd02f9 100644 --- a/xen/arch/arm/arm64/acpi/arm-core.c +++ b/xen/arch/arm/arm64/acpi/arm-core.c @@ -256,6 +256,48 @@ static void set_psci_fadt(void) fadt->header.checksum = (u8)( fadt->header.checksum-checksum ); } +static int map_stao_table(struct domain *d, u64 *mstao) +{ + u64 addr; + u64 size; + int res; + u8 checksum; + struct acpi_table_stao *stao=NULL; + + stao = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_table_stao) ); + if( stao == NULL ) + return -ENOMEM; + + ACPI_MEMCPY(stao->header.signature,ACPI_SIG_STAO, 4); + stao->header.length = sizeof(struct acpi_table_header) + 1; + stao->header.checksum = 0; + ACPI_MEMCPY(stao->header.oem_id, "LINARO", 6); + ACPI_MEMCPY(stao->header.oem_table_id, "RTSMVEV8", 8); + stao->header.revision = 1; + ACPI_MEMCPY(stao->header.asl_compiler_id, "INTL", 4); + stao->header.asl_compiler_revision = 0x20140828; + stao->uart = 1; + size = sizeof(struct acpi_table_stao); + checksum = acpi_tb_checksum(ACPI_CAST_PTR(u8, stao), size); + stao->header.checksum = (u8)( stao->header.checksum - checksum ); + *mstao = addr = virt_to_maddr(stao); + + 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 static int map_xsdt_table(struct domain *d, u64 *xsdt) @@ -304,6 +346,14 @@ static int map_xsdt_table(struct domain *d, u64 *xsdt) ( ( (size - sizeof(struct acpi_table_header) ) / sizeof(acpi_native_uint) ) ); + /* map stao table */ + map_stao_table(d, &addr); + if(res) + return res; + + table_entry--; + *table_entry = addr ; + checksum = acpi_tb_checksum(ACPI_CAST_PTR(u8, table), table->length); table->checksum = (u8)( table->checksum - checksum ); return 0;