From patchwork Tue Sep 12 10:03:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 112261 Delivered-To: patch@linaro.org Received: by 10.80.202.13 with SMTP id d13csp5674000edi; Tue, 12 Sep 2017 03:05:21 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCSr6KfYfaNrjGOqbiHqyQLVC/LXbcJXEeyEXo9ScaDd3uIdOCfGdcD4wEBetFmklrzISlb X-Received: by 10.107.140.70 with SMTP id o67mr19543489iod.35.1505210721452; Tue, 12 Sep 2017 03:05:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505210721; cv=none; d=google.com; s=arc-20160816; b=m/R79CbRHpxqY8EHCtwoXGuPDCTJ7Vv5zVGmpnx7Pir6FQ8MekxnUI4/+5W2jYrEu+ bTbMPr4kIHqEJ8EBRxcF9GZEx4ecvGfMToctM/lcv2VvRvdJG0h0TyMXM8GE97/lRwxs THuJjAZtERIHsI529Vjdsji3IPrWWKS47yzLTF40UvP6P0KBvY/0iFx4/yNq3a165Lsr IKYfiT6Hykh2fuHHRFstpRTe94nJRywTpXjuy4poW33A9Dz+wRfA4SzMTHaSx7Ybisrz Uk8s7xGytOcnS/qJWuZXF3+c6OiMYGFSYtUSL5NiB9S5kgheqba4jeHgAC4bpi62aKYX ohPQ== 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:arc-authentication-results; bh=6gXikjPvENVCxhW2/eaJY1vJYsuOvJNnBTzBz4Aexms=; b=BIjyldDPPP25S9NykU1CEWm16ZCRyw5mMyuK7kFtd0yrD1Fd51l0R765Itd/xGIXtl RKHdr7NRaVLRoH/ddAN7Y/HXla8g46Sirrlmm8YXveQWwdmsMdm699CWeTUenhB87J0w Bv0X7gC0XqTuxO5Ri5W4wCk1ANIuV/aoTbq8eb0Itw66T8jHZx3wwRSSQrxc45TaH6In h8PAN0VZWDv2w4yHuL1PntWgramtZJR+pGbKrxMbOpnaVtYDVAiINb5+qI4Ffnh+lb0z ln5S8E+9F6hCahW6zW50CkU9UxpD9UZtFgVHSy/A7phGInio7N+5KQwSXlh76H4Y983D 0EZA== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id y15si10548437iti.180.2017.09.12.03.05.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Sep 2017 03:05:21 -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 1dri2u-0002zu-0M; Tue, 12 Sep 2017 10:03:56 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dri2s-0002tF-TY for xen-devel@lists.xen.org; Tue, 12 Sep 2017 10:03:55 +0000 Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id 44/E8-02817-A01B7B95; Tue, 12 Sep 2017 10:03:54 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrELMWRWlGSWpSXmKPExsVysyfVTZdz4/Z Ig2n7zS2WfFzM4sDocXT3b6YAxijWzLyk/IoE1oyZG7YxF7zgqdg4bQtLA+Ntzi5GLg4hgc2M Ek82nGODcE4zSvR27GHtYuTkYBPQlLjz+RMTiC0iIC1x7fNlRhCbWSBS4vCHH+wgtrBAuMSDp 4fA4iwCqhL3Z+8DGsTBwStgKbFxizhIWEJAXmJX20WwkZxA4RUff7GB2EICFhLfX/5gnMDIvY CRYRWjRnFqUVlqka6RmV5SUWZ6RkluYmaOrqGBqV5uanFxYnpqTmJSsV5yfu4mRqB/6xkYGHc w3p7sd4hRkoNJSZT3yPrtkUJ8SfkplRmJxRnxRaU5qcWHGGU4OJQkeM+D5ASLUtNTK9Iyc4CB BpOW4OBREuGdDZLmLS5IzC3OTIdInWLU5ei4efcPkxBLXn5eqpQ4bwZIkQBIUUZpHtwIWNBfY pSVEuZlZGBgEOIpSC3KzSxBlX/FKM7BqCTMewdkCk9mXgncpldARzABHcFzaQvIESWJCCmpBk bdsxEHIv3Di75nZF2uqbivpcAUPrX1dBX785gpaV5fT9ppno8xZJMtzWJ8uyH+VmD14SN39kV F2rxo3M0pplphdW4Hd9v1mkcy53KbvQVThXP8Ji0zmHrER6B16YfWLyYBr/0f3Jk0n42lqPQc 8z8VUVE/0SiX3HX7tFf/fX3rQb+4s177RSWW4oxEQy3mouJEABxqdA11AgAA X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-4.tower-206.messagelabs.com!1505210633!111086264!1 X-Originating-IP: [217.140.101.70] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 63082 invoked from network); 12 Sep 2017 10:03:53 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-4.tower-206.messagelabs.com with SMTP; 12 Sep 2017 10:03:53 -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 20639165D; Tue, 12 Sep 2017 03:03:53 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.206.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3105A3F578; Tue, 12 Sep 2017 03:03:52 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Tue, 12 Sep 2017 11:03:17 +0100 Message-Id: <20170912100330.2168-12-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170912100330.2168-1-julien.grall@arm.com> References: <20170912100330.2168-1-julien.grall@arm.com> Cc: andre.przywara@arm.com, Julien Grall , sstabellini@kernel.org Subject: [Xen-devel] [PATCH v2 11/24] xen/arm: traps: Improve logging for data/prefetch abort fault 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" Walk the hypervisor page table for data/prefetch abort fault to help diagnostics error in the page tables. Signed-off-by: Julien Grall Reviewed-by: Andre Przywara Acked-by: Stefano Stabellini --- Andre, I assumed you were happy with changes you suggested, so I kept your reviewed-by. Changes in v2: - Add Andre's reviewed-by - Simplify condition check - Update warning message --- xen/arch/arm/traps.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index 2e48089d61..0b856fb4fd 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -2986,7 +2986,26 @@ void do_trap_hyp_sync(struct cpu_user_regs *regs) do_trap_brk(regs, hsr); break; #endif + case HSR_EC_DATA_ABORT_CURR_EL: + case HSR_EC_INSTR_ABORT_CURR_EL: + { + bool is_data = (hsr.ec == HSR_EC_DATA_ABORT_CURR_EL); + const char *fault = (is_data) ? "Data Abort" : "Instruction Abort"; + + printk("%s Trap. Syndrome=%#x\n", fault, hsr.iss); + /* + * FAR may not be valid for a Synchronous External abort other + * than translation table walk. + */ + if ( hsr.xabt.fsc == FSC_SEA && hsr.xabt.fnv ) + printk("Invalid FAR, not walking the hypervisor tables\n"); + else + dump_hyp_walk(get_hfar(is_data)); + + do_unexpected_trap(fault, regs); + break; + } default: printk("Hypervisor Trap. HSR=0x%x EC=0x%x IL=%x Syndrome=0x%"PRIx32"\n", hsr.bits, hsr.ec, hsr.len, hsr.iss);