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: 9135331 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E0F776075C for ; Wed, 25 May 2016 13:17:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D48AE27984 for ; Wed, 25 May 2016 13:17:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C986528091; Wed, 25 May 2016 13:17:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3E18327984 for ; Wed, 25 May 2016 13:17:25 +0000 (UTC) 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" X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Wei Liu --- 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);