From patchwork Wed Feb 4 14:01:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Parth Dixit X-Patchwork-Id: 44356 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f197.google.com (mail-we0-f197.google.com [74.125.82.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1320D2029F for ; Wed, 4 Feb 2015 14:06:34 +0000 (UTC) Received: by mail-we0-f197.google.com with SMTP id l61sf1484300wev.0 for ; Wed, 04 Feb 2015 06:06: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=4zZcRHBLxFqPb1JzeQw2nNx4agHJNG4X1g+pkk+qeqY=; b=LMk+HXMM9fWQpD4q0JZ+ZpmK2hx+qRTZsCFSeTBhC3s6KEdtqsw2p8kKhEXagmG3Vf d11dV7WgjVinhw88ChWKS7Pm6YxkYhQBSp0/sSPHplFEik+YhsZvpgJHtLUyjiAYug94 AZGGKBB79QmrW++ihJ5TAkn3vbWFYwGFIOXKuilY3ZgKfMLymc04/MOXe4nLepZrOiah oN6d0HA2Dv2IUgNfGpTjqHxDutLpY/rU0aVAwIUzfw/GURaNtfgulgUzMB/YEmxuRjUa BoOcm9GaA6y4lqROKG0+4BkspSz5fKPUDgmWs+Wr5ZNXbbqmKRdgnuDVEtEKMkskzNQk tpbQ== X-Gm-Message-State: ALoCoQkcx2FcA31+H+rGCoKLJu3wbbdkGXO5FJ156/hQToksPjyK5C0+K5rJ/T5CdpPfVtD26SE/ X-Received: by 10.180.108.197 with SMTP id hm5mr2746829wib.4.1423058793293; Wed, 04 Feb 2015 06:06:33 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.1.195 with SMTP id 3ls33446lao.47.gmail; Wed, 04 Feb 2015 06:06:33 -0800 (PST) X-Received: by 10.112.202.227 with SMTP id kl3mr16380469lbc.81.1423058793059; Wed, 04 Feb 2015 06:06:33 -0800 (PST) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id k8si1442983lae.41.2015.02.04.06.06.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Feb 2015 06:06:33 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by mail-la0-f42.google.com with SMTP id ms9so1749103lab.1 for ; Wed, 04 Feb 2015 06:06:32 -0800 (PST) X-Received: by 10.112.25.104 with SMTP id b8mr30560855lbg.69.1423058792705; Wed, 04 Feb 2015 06:06:32 -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 h5csp507750lbj; Wed, 4 Feb 2015 06:06:31 -0800 (PST) X-Received: by 10.52.229.37 with SMTP id sn5mr16482485vdc.53.1423058790809; Wed, 04 Feb 2015 06:06:30 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id ar6si764922vdd.3.2015.02.04.06.06.29 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 04 Feb 2015 06:06:30 -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 1YJ0ZM-0007KY-4z; Wed, 04 Feb 2015 14:04:40 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YJ0ZK-0007JD-Nz for xen-devel@lists.xen.org; Wed, 04 Feb 2015 14:04:38 +0000 Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id 72/80-02750-6F622D45; Wed, 04 Feb 2015 14:04:38 +0000 X-Env-Sender: parth.dixit@linaro.org X-Msg-Ref: server-15.tower-27.messagelabs.com!1423058675!12790073!1 X-Originating-IP: [209.85.220.42] 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 31115 invoked from network); 4 Feb 2015 14:04:36 -0000 Received: from mail-pa0-f42.google.com (HELO mail-pa0-f42.google.com) (209.85.220.42) by server-15.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 4 Feb 2015 14:04:36 -0000 Received: by mail-pa0-f42.google.com with SMTP id bj1so3068469pad.1 for ; Wed, 04 Feb 2015 06:04:35 -0800 (PST) X-Received: by 10.70.102.35 with SMTP id fl3mr5220312pdb.30.1423058675328; Wed, 04 Feb 2015 06:04:35 -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.04.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 04 Feb 2015 06:04:34 -0800 (PST) From: parth.dixit@linaro.org To: xen-devel@lists.xen.org Date: Wed, 4 Feb 2015 19:31:59 +0530 Message-Id: <1423058539-26403-16-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, Al Stone , Naresh Bhat , julien.grall@linaro.org, tim@xen.org, stefano.stabellini@citrix.com, Hanjun Guo , jbeulich@suse.com, christoffer.dall@linaro.org Subject: [Xen-devel] [PATCH RFC 15/35] ARM64 / ACPI: Define ACPI_IRQ_MODEL_GIC needed for arm 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.42 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: Naresh Bhat Needed because ARM64 uses GIC which is defined in ACPI 5.0 spec. Signed-off-by: Al Stone Signed-off-by: Hanjun Guo Signed-off-by: Naresh Bhat --- xen/arch/arm/arm64/acpi/arm-core.c | 6 ++- xen/drivers/acpi/tables.c | 95 ++++++++++++++++++++------------------ 2 files changed, 55 insertions(+), 46 deletions(-) diff --git a/xen/arch/arm/arm64/acpi/arm-core.c b/xen/arch/arm/arm64/acpi/arm-core.c index 84b0032..cc11fce 100644 --- a/xen/arch/arm/arm64/acpi/arm-core.c +++ b/xen/arch/arm/arm64/acpi/arm-core.c @@ -55,7 +55,11 @@ int acpi_psci_use_hvc; /* available_cpus means enabled cpu in MADT */ static int available_cpus; -enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_PLATFORM; +/* + * Since we're on ARM, the default interrupt routing model + * clearly has to be GIC. + */ +enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_GIC; struct acpi_arm_root acpi_arm_rsdp_info; /* info about RSDP from FDT */ diff --git a/xen/drivers/acpi/tables.c b/xen/drivers/acpi/tables.c index 5314f0b..ad680f8 100644 --- a/xen/drivers/acpi/tables.c +++ b/xen/drivers/acpi/tables.c @@ -244,60 +244,65 @@ acpi_parse_entries(unsigned long table_size, struct acpi_table_header *table_header, int entry_id, unsigned int max_entries) { - struct acpi_subtable_header *entry; - int count = 0; - unsigned long table_end; + struct acpi_subtable_header *entry; + int count = 0; + unsigned long table_end; - if (acpi_disabled) - return -ENODEV; + if ( acpi_disabled ) + return -ENODEV; - if (!handler) - return -EINVAL; + if ( !handler ) + return -EINVAL; - if (!table_size) - return -EINVAL; + if ( !table_size ) + return -EINVAL; - if (!table_header) { - printk("Table header not present\n"); - return -ENODEV; - } + if ( !table_header ) + { + printk("Table header not present\n"); + return -ENODEV; + } - table_end = (unsigned long)table_header + table_header->length; + table_end = (unsigned long)table_header + table_header->length; - /* Parse all entries looking for a match. */ + /* Parse all entries looking for a match. */ - entry = (struct acpi_subtable_header *) - ((unsigned long)table_header + table_size); - - while (((unsigned long)entry) + sizeof(struct acpi_subtable_header) < - table_end) { - if (entry->type == entry_id - && (!max_entries || count++ < max_entries)) - if (handler(entry, table_end)) { - count = -EINVAL; - goto err; - } - - /* - * If entry->length is 0, break from this loop to avoid - * infinite loop. - */ - if (entry->length == 0) { - printk("[0x%02x] Invalid zero length\n", entry_id); - count = -EINVAL; - goto err; - } - - entry = (struct acpi_subtable_header *) - ((unsigned long)entry + entry->length); - } + entry = (struct acpi_subtable_header *) + ((unsigned long)table_header + table_size); + + while ( ( (unsigned long)entry ) + sizeof(struct acpi_subtable_header) < + table_end) + { + if ( entry->type == entry_id + && ( !max_entries || count++ < max_entries ) ) + if ( handler(entry, table_end) ) + { + count = -EINVAL; + goto err; + } - if (max_entries && count > max_entries) { - printk("[0x%02x] ignored %i entries of %i found\n", - entry_id, count - max_entries, count); + /* + * If entry->length is 0, break from this loop to avoid + * infinite loop. + */ + if ( entry->length == 0 ) + { + printk("[0x%02x] Invalid zero length\n", entry_id); + count = -EINVAL; + goto err; } -err: + entry = (struct acpi_subtable_header *) + ((unsigned long)entry + entry->length); + } + + if ( max_entries && count > max_entries ) + { + printk("[0x%02x] ignored %i entries of %i found\n", + entry_id, count - max_entries, count); + } + + err: return count; } @@ -394,7 +399,7 @@ int __init acpi_table_parse(char *id, acpi_table_handler handler) return 1; } -/* +/* * The BIOS is supposed to supply a single APIC/MADT, * but some report two. Provide a knob to use either. * (don't you wish instance 0 and 1 were not the same?)