From patchwork Wed Dec 6 14:51:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 120863 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp7151762qgn; Wed, 6 Dec 2017 06:54:10 -0800 (PST) X-Google-Smtp-Source: AGs4zMbt4H3MqO0K4P3gfXQ1XLyYc3fRrA8m6tHQYNVbFrzOcr590Nbl5bQCQy92B1M3ePY+Ksux X-Received: by 10.36.207.196 with SMTP id y187mr21473292itf.123.1512572050469; Wed, 06 Dec 2017 06:54:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512572050; cv=none; d=google.com; s=arc-20160816; b=xwd/3UV4J4StIxmSV7CKc1yI0pOj4dRI706hWwSUaxuIlwFEAbFRBNHNVywqsRy9ge qzS0Zj2uDnJ1MluHgrKbLhdgo2/houTvLT1z/9mMK9pKVmzaLoAIwMfRg7aqsKsXWM7f +cgdlcELiRuEwRbZEN+QXv4QHVLpL+onoQu8NuR1nSFybF1hxZdZcUp9i7YS4GXZryde 0nIFxcW5t2ysz//pOSGX2fya/8mblXno8MPu1qjpBeO8Mec7mL1AfBrXpeLw4sMlO5J0 XZmOi9K7DJc1CnQVa6deP65/Xegh5pIXSd7CIDy8ccmgw9cqXqdJJg3Yr+q31mUARn27 Vq5Q== 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:message-id:date:to:from:dkim-signature :arc-authentication-results; bh=x+gmzTSlVHZ+jkWfvENisyUh25lbGE5Zk87NsiREQqI=; b=NJMI7KUCFzLwgyI2tZWWqGBCqNhSV4Fa3VMMrfiOOHaWE/oElEi5kc0RGgTjTvM9GT jTNJp6ZGhWX02vlhQgdJKM9UuevSgt7VR09A4R5NaC0x89oxbQFDpdo8YVlcuuyq8VX/ Q2AMHfsIj34Wmo/ipAlUjyEPCDkQvmy1GkjDSDSZLd1414qvnIn7HUUwlQCXmTRApkp5 QcMPWKhOSLmeBu7p0lQIJVvBOHA+V1mUhohPLoeOwDJlw+pBkf2QvtJIDcdaMwjJIsyH ZrnUUzK2TGBA3Ta+0dQvRwtjAN3tMXaKtG4b+gCmtFDiF5CYPWQBjnGkPX3hRo8KWHQ7 qWfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=B9+Aa34e; 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 u6si2294672ite.57.2017.12.06.06.54.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Dec 2017 06:54:10 -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=B9+Aa34e; 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 1eMb35-0004yW-Gy; Wed, 06 Dec 2017 14:51:47 +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 1eMb34-0004yQ-B5 for xen-devel@lists.xen.org; Wed, 06 Dec 2017 14:51:46 +0000 X-Inumbo-ID: ebf78444-da94-11e7-b4a6-bc764e045a96 Received: from mail-wr0-x241.google.com (unknown [2a00:1450:400c:c0c::241]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id ebf78444-da94-11e7-b4a6-bc764e045a96; Wed, 06 Dec 2017 15:51:21 +0100 (CET) Received: by mail-wr0-x241.google.com with SMTP id x49so4171755wrb.13 for ; Wed, 06 Dec 2017 06:51:43 -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; bh=2ofZFfPdPaau7nGjmRnsRmXi3ibsBZbizAv/ha6ulOM=; b=B9+Aa34e5H26Y47wf1Q7J62UBk+4hlpb2XRioA08AznmGJaWpbk/9oj3qzR6xsIipb n/XhakpebyRDuOYoHt1jSCQt7JyNKd3G1SCvCLkUQAYWszN2BRwT8J0uXuwm1iSt/0Fq 7L+puf7KIQDBx06aaoCed17gke4kI4R95AHBw= 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; bh=2ofZFfPdPaau7nGjmRnsRmXi3ibsBZbizAv/ha6ulOM=; b=DRLBEP94wxWZMeOzKjxbJ7RXq/4ERULZo+g07Lh1pWTLsY70ww0JW7gMWbeS7QnwFg bjsD8kqxYBqWqDXuyCeKEKnlVOYOyekQFPdK3HRXmIQE/9MPjBx4mkspl5NJ3dvCoVTa 6Zh4+Ob0dK4vyHlX/myt1rTCf13yw7cDKzWsV1sjcAuxAlDXdzd3l/FLOwzK1+wp9a/j lS00iUf4Nnw2T3wr12Zni8mOehB035Q/I/iUP3zgMbQMzs6XqzimpZAsJOEQEF330Dw5 +6uYYHQ/mM4LnNoc04DTtBok6dz1WWiOaHUXlVSiF9lB3wBAjATW+m8BfLMP2t2u9ER+ 3pgA== X-Gm-Message-State: AJaThX7zApm7qRaK4nrNW0HxFHsmH5KzhK4PNPUHNSKcyCax1/+ehrMo AC2s+d5hZwnnY/eP25L+CkysT5pLvC8= X-Received: by 10.223.152.234 with SMTP id w97mr19558753wrb.215.1512571901701; Wed, 06 Dec 2017 06:51:41 -0800 (PST) Received: from e108454-lin.cambridge.arm.com ([2001:41d0:1:6c23::1]) by smtp.gmail.com with ESMTPSA id y51sm3040154wrc.96.2017.12.06.06.51.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Dec 2017 06:51:41 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Wed, 6 Dec 2017 14:51:37 +0000 Message-Id: <20171206145137.15602-1-julien.grall@linaro.org> X-Mailer: git-send-email 2.11.0 Cc: Julien Grall , sstabellini@kernel.org, Julien Grall , andre.przywara@linaro.org Subject: [Xen-devel] [PATCH] xen/arm: gic-v3: Bail out if gicv3_cpu_init fail 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" From: Julien Grall When system registers are not enabled, all the access to them will trap in EL2. In Xen, system registers will be enabled by gicv3_cpu_init only on success. As the rest of the code (e.g gicv3_hyp_init) relies on system register, it is better to bail out directly. This will save time on debugging early boot issue on GICv3 platform. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- This makes easier to debug early boot issue on GICv3 platform. It would be worth considering to backport it. --- xen/arch/arm/gic-v3.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c index 473e26111f..a0d290b55c 100644 --- a/xen/arch/arm/gic-v3.c +++ b/xen/arch/arm/gic-v3.c @@ -847,8 +847,12 @@ static int gicv3_secondary_cpu_init(void) spin_lock(&gicv3.lock); res = gicv3_cpu_init(); + if ( res ) + goto out; + gicv3_hyp_init(); +out: spin_unlock(&gicv3.lock); return res; @@ -1705,8 +1709,12 @@ static int __init gicv3_init(void) panic("GICv3: ITS: initialization failed: %d\n", res); res = gicv3_cpu_init(); + if ( res ) + goto out; + gicv3_hyp_init(); +out: spin_unlock(&gicv3.lock); return res;