From patchwork Mon Jan 22 18:22:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 125456 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1300832ljf; Mon, 22 Jan 2018 10:25:18 -0800 (PST) X-Google-Smtp-Source: AH8x225RWkauDaLFDT8uY/hXmSNgZ/q13DvFm8qol9VrrMxgRH+gw6MosWq132pZqI16d6T0AJ4j X-Received: by 10.107.150.211 with SMTP id y202mr9033421iod.10.1516645518278; Mon, 22 Jan 2018 10:25:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516645518; cv=none; d=google.com; s=arc-20160816; b=S4O66L3v44spDdG7jpI+PTUc5pPFOT6AqUssqK5vAOShz4BlfdvYrsGITMpJOOG/Ez PXhxoFWvvN8mVLDAaEss99gKPOeCgIFzahOYuw4SQiQzkOupMBwMlRb+58bn6nWnMSYS PWzuqmCYpvCutOcBO3lXagB1H51AtmiWKYHHX2NDpYjqlJmT4OznWPM7bsP/8SARMTtp P9mQcjyxgp68p3bhejnPB37ryIGmsDrvBZ/hgmkbYoIiBW4Iv/YIYpzLS/2EpUY0tAs8 M88lx4TeR0Yg4fLKN//uSfBlaAsbt1BR0EJjCB1K9bBMoxsG3eVgSEX6caarSO0KVMrb X2MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:references:in-reply-to:message-id:date:to :from:dkim-signature:arc-authentication-results; bh=QGjp2lmYICNFLGyh3zSXxUftoXisVeZJErsjPWhFsA4=; b=DCqLZYM1GvYsYO7HGjjl3D4pG1pxyk6dfiKFdy/kSblboF2Ki4O+PDnNyNNnZFU2n3 rZLVBfX4Z/k07FLanQo2jjQGFvi9F42BezilwXhbijKn/Geki721562DMHOlITpN6S1I 4r01HioMFccYEZMYN81gPpZLT/Jll19pEQE3pPvciO6xghF8Zx0yXfjFEv1KJPG24yjn y/KW8lq3hZqtmeW7sG9yKpflaoIXn//xqG9mGkCSJf96vpksrEutRUFJkM6VVswt21B4 5yzNiv1PFWQePMUPtzgY3YswPFnFU+EuRC6gg3zZP/JC+fn0yrNw9xROHn6yI0aei5no OpTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=UL+63a8w; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id h140si6296869ita.143.2018.01.22.10.25.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jan 2018 10:25:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=UL+63a8w; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1edgkG-000604-Ba; Mon, 22 Jan 2018 18:23:00 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1edgkF-0005zo-EW for xen-devel@lists.xenproject.org; Mon, 22 Jan 2018 18:22:59 +0000 X-Inumbo-ID: 44af8fa6-ffa1-11e7-ba59-bc764e045a96 Received: from mail-wm0-x244.google.com (unknown [2a00:1450:400c:c09::244]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 44af8fa6-ffa1-11e7-ba59-bc764e045a96; Mon, 22 Jan 2018 19:22:57 +0100 (CET) Received: by mail-wm0-x244.google.com with SMTP id 141so18617463wme.3 for ; Mon, 22 Jan 2018 10:22:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tt2co0RRpjeQXAhRNzj3W2MDTpX4xnPonjfR6QQq14M=; b=UL+63a8wbkS8oV7gfJwgjvtPtMh5vKIaSxpdp9TbOCXKMtNsEHPYG2gD/YlSM3ZxqE 1nHEd8IRqABmoQdH81N6CagcjMWUsov3jKAbM6gCLgRYmBbHPf2qJDzbkHcztROu27fv CpjuScAn8DznS75r06/h9C7hPiChklYI6H4Tk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=tt2co0RRpjeQXAhRNzj3W2MDTpX4xnPonjfR6QQq14M=; b=okVfEZBYLO3MhgG3CoYzA6QiuxsJEBSgKAOtrS2/yyN8KODLEhK8pxmNuMIBbQowJG SxnCx0hJ+ebkgdNmVp32f/5MNf7wEFnPGlHqltIiH11vblD4YHlY9rvCsUPfbOyIk6bS rZVrbsB8aQrMdqcxYmUzMc2e+Ph3Y0b3yNbN9wVmIZNZD5tJ5WbFjxQH3F0cqBW3Cw5X AVh50o0Z0yG06gnavs/eI97HbddBBnNaej3pkdGJ4V6PlIgnNX6rLXpLEcDsWIRrmpP2 kEwe8kxzUrdoRCR2nQcih3xsPlCa0zMpkSmeRsycV1sLP+fe5SecZROhaTUDeTFaTC2t usiA== X-Gm-Message-State: AKwxytc5V6UvCrxx+hCydygmlx4AvNu1qX6yzbCodNriY8oBhTC7kGUY 6m3lrbg+vyZ4fMCRQrwMyjeSn7kbrD0= X-Received: by 10.28.145.21 with SMTP id t21mr6598999wmd.136.1516645376596; Mon, 22 Jan 2018 10:22:56 -0800 (PST) Received: from e108454-lin.cambridge.arm.com ([2001:41d0:1:6c23::1]) by smtp.gmail.com with ESMTPSA id v22sm4812277wra.58.2018.01.22.10.22.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jan 2018 10:22:56 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Mon, 22 Jan 2018 18:22:47 +0000 Message-Id: <20180122182247.18490-3-julien.grall@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180122182247.18490-1-julien.grall@linaro.org> References: <20180122182247.18490-1-julien.grall@linaro.org> Cc: sstabellini@kernel.org, Julien Grall , andre.przywara@linaro.org Subject: [Xen-devel] [PATCH 2/2] xen/arm: GICv3: Only initialize ITS when the distributor supports LPIs. X-BeenThere: xen-devel@lists.xenproject.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.xenproject.org Sender: "Xen-devel" There are firmware tables out describing the ITS but does not support LPIs. This will result to a data abort when trying to initialize ITS. While this can be consider a bug in the Device-Tree, same configuration boots on Linux. So gate the ITS initialization with the support of LPIs in the distributor. Signed-off-by: Julien Grall --- xen/arch/arm/gic-v3.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c index 9f9cf59f82..730450e34b 100644 --- a/xen/arch/arm/gic-v3.c +++ b/xen/arch/arm/gic-v3.c @@ -1637,6 +1637,11 @@ static unsigned long gicv3_get_hwdom_extra_madt_size(const struct domain *d) } #endif +static bool gic_dist_supports_lpis(void) +{ + return (readl_relaxed(GICD + GICD_TYPER) & GICD_TYPE_LPIS); +} + /* Set up the GIC */ static int __init gicv3_init(void) { @@ -1699,9 +1704,12 @@ static int __init gicv3_init(void) gicv3_dist_init(); - res = gicv3_its_init(); - if ( res ) - panic("GICv3: ITS: initialization failed: %d\n", res); + if ( gic_dist_supports_lpis() ) + { + res = gicv3_its_init(); + if ( res ) + panic("GICv3: ITS: initialization failed: %d\n", res); + } res = gicv3_cpu_init(); if ( res )