From patchwork Wed May 25 13:14:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 68596 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp1208944qge; Wed, 25 May 2016 06:16:46 -0700 (PDT) X-Received: by 10.200.41.248 with SMTP id 53mr2049318qtt.100.1464182206785; Wed, 25 May 2016 06:16:46 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id s140si4556730qhb.21.2016.05.25.06.16.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 May 2016 06:16:46 -0700 (PDT) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.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 1b5Ydb-0000gO-Tw; Wed, 25 May 2016 13:14:15 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5Ydb-0000gH-8V for xen-devel@lists.xen.org; Wed, 25 May 2016 13:14:15 +0000 Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id DE/22-31299-625A5475; Wed, 25 May 2016 13:14:14 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrALMWRWlGSWpSXmKPExsVysyfVTVd1qWu 4waYmW4slHxezODB6HN39mymAMYo1My8pvyKBNePG1efsBZt5K67/uMPWwLiYu4uRi0NIYCOj xJ93E5kgnNOMEr2XDzN2MXJysAloStz5/IkJxBYRkJa49vkyI0gRs8AGRokdZ5cxgySEBbwkn i0+yg5iswioSsx8eZAFxOYVcJHYuHsJG4gtISAncfLYZNYJjJwLGBlWMWoUpxaVpRbpGhrqJR VlpmeU5CZm5ugaGhjr5aYWFyemp+YkJhXrJefnbmIE+owBCHYwrv7tdIhRkoNJSZSXfbFruBB fUn5KZUZicUZ8UWlOavEhRhkODiUJ3tcgOcGi1PTUirTMHGDwwKQlOHiURHj3gqR5iwsSc4sz 0yFSpxgVpcR560ASAiCJjNI8uDZYwF5ilJUS5mUEOkSIpyC1KDezBFX+FaM4B6OSMO9tkCk8m XklcNNfAS1mAlrs/8UZZHFJIkJKqoGxSbZG++XsibW7GFX//vi8zKBH9sgu/9O56xw0L2/mCY yftqxjx8S3Sy/F3/XjWCJ3tufDGvfYafqrLzZsvvjVattR/2PR104cZVjVt+rb+kz5ybtWict wZ++S78i5rzf9VoV3pL9Gk/iBazmqat6KR+8sl5q7f09obkFoq+CKhz/ZW+TE76uVKbEUZyQa ajEXFScCANPaeRxTAgAA X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-10.tower-31.messagelabs.com!1464182053!41366745!1 X-Originating-IP: [217.140.101.70] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.34; banners=-,-,- X-VirusChecked: Checked Received: (qmail 7116 invoked from network); 25 May 2016 13:14:13 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-10.tower-31.messagelabs.com with SMTP; 25 May 2016 13:14:13 -0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0FC313C; Wed, 25 May 2016 06:14:36 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.215.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4BB213F21A; Wed, 25 May 2016 06:14:11 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Wed, 25 May 2016 14:14:06 +0100 Message-Id: <1464182046-11573-1-git-send-email-julien.grall@arm.com> X-Mailer: git-send-email 1.9.1 Cc: Julien Grall , sstabellini@kernel.org, wei.liu2@citrix.com, Chenxia Zhao Subject: [Xen-devel] [for-4.7] xen/arm: Don't call setup_virtual_regions multiple time X-BeenThere: xen-devel@lists.xen.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.xen.org Sender: "Xen-devel" The commit 2aa925be84293b44ad587ed117184ace61b41dd6 "arm/x86: Use struct virtual_region to do bug, symbol, and (x86) exception tables lookup." has introduced virtual_region. The call to initialize those regions is made in init_traps which is called during each CPU bring up. This will result to register multiple time the same region and Xen crash when an address is looked up. This can be fixed by moving the call to setup_virtual_region directly in start_xen. Signed-off-by: Julien Grall Reported-by: Chenxia Zhao --- Cc: Konrad Rzeszutek Wilk This is a bug fix for Xen 4.7. Without this change, any use of virtual_region (printing a symbol) could lead to a crash in Xen. --- xen/arch/arm/setup.c | 1 + xen/arch/arm/traps.c | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index 09ff1ea..9bc11c4 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -722,6 +722,7 @@ void __init start_xen(unsigned long boot_phys_offset, set_current((struct vcpu *)0xfffff000); /* debug sanity */ idle_vcpu[0] = current; + setup_virtual_regions(NULL, NULL); /* Initialize traps early allow us to get backtrace when an error occurred */ init_traps(); diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index 1828ea1..aa3e3c2 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -102,8 +102,6 @@ integer_param("debug_stack_lines", debug_stack_lines); void init_traps(void) { - setup_virtual_regions(NULL, NULL); - /* Setup Hyp vector base */ WRITE_SYSREG((vaddr_t)hyp_traps_vector, VBAR_EL2);