From patchwork Thu May 5 16:34:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 67226 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp844854qge; Thu, 5 May 2016 09:36:11 -0700 (PDT) X-Received: by 10.176.3.172 with SMTP id 41mr10117721uau.108.1462466162894; Thu, 05 May 2016 09:36:02 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id 7si5161673uab.20.2016.05.05.09.36.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 May 2016 09:36:02 -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 1ayMEo-00024N-Ck; Thu, 05 May 2016 16:34:54 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ayMEn-0001uE-KN for xen-devel@lists.xen.org; Thu, 05 May 2016 16:34:53 +0000 Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id A1/5B-07924-D267B275; Thu, 05 May 2016 16:34:53 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrKLMWRWlGSWpSXmKPExsVysyfVTVenTDv c4NZtbYslHxezODB6HN39mymAMYo1My8pvyKBNePnKauCGdwVrx9fYmtgPMrRxcjJISSwkVFi 8Zz0LkYuIPs0o0T3+jXsIAk2AU2JO58/MYHYIgLSEtc+X2YEKWIWaGaUmL7oNRtIQlggRuLU3 oNADRwcLAKqErNep4CEeQVcJabOvQzWKyEgJ3Hy2GRWEJsTKL70/EoWiMUuEid3TGKbwMi9gJ FhFaNGcWpRWWqRrqGBXlJRZnpGSW5iZg6QZ6yXm1pcnJiempOYVKyXnJ+7iRHo3XoGBsYdjNu 6nA8xSnIwKYnyblfSDhfiS8pPqcxILM6ILyrNSS0+xCjDwaEkwbuyBCgnWJSanlqRlpkDDDOY tAQHj5II7wqQNG9xQWJucWY6ROoUo6KUOO9akIQASCKjNA+uDRbalxhlpYR5GRkYGIR4ClKLc jNLUOVfMYpzMCoJ824HmcKTmVcCN/0V0GImoMXv52qCLC5JREhJNTCyv/Trmn7Xcumzd3M1bt 58X5Th3/9lfd9e3t8Gvj23Y6I//fJdf+K8W9Fuw+cvPa6+zPkbVm+zg+t68NH3yv9l00+yJzo 3vDKdYFbuVZH7Y+cDl5WFqQ3b+YUfXuCS38FT9cjeOCHo3qNQQWXPKRmyJ5nZ399dajw9YFPf 4pNLHky0FX3woU1ZiaU4I9FQi7moOBEAOVOX/mgCAAA= X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-12.tower-31.messagelabs.com!1462466092!21990293!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 34821 invoked from network); 5 May 2016 16:34:52 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-12.tower-31.messagelabs.com with SMTP; 5 May 2016 16:34:52 -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 4E3FF49; Thu, 5 May 2016 09:34:59 -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 DED963F252; Thu, 5 May 2016 09:34:50 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Thu, 5 May 2016 17:34:24 +0100 Message-Id: <1462466065-30212-16-git-send-email-julien.grall@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1462466065-30212-1-git-send-email-julien.grall@arm.com> References: <1462466065-30212-1-git-send-email-julien.grall@arm.com> Cc: andre.przywara@arm.com, Julien Grall , sstabellini@kernel.org, wei.chen@arm.com, steve.capper@arm.com Subject: [Xen-devel] [RFC 15/16] xen/arm: traps: Don't inject a fault if the translation VA -> IPA fails 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" Based on ARM ARM (D4.5.3 in ARM DDI 0486A and B3.12.7 in ARM DDI 0406C.c), a Stage 1 translation error has priority over a Stage 2 translation error. Therefore gva_to_ipa can only fail if another vCPU is playing with the page table. Rather than injecting a custom fault, replay the instruction and let the processor injecting the correct fault. Signed-off-by: Julien Grall --- xen/arch/arm/traps.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index c0325d5..3acdba0 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -2410,7 +2410,7 @@ static void do_trap_instr_abort_guest(struct cpu_user_regs *regs, rc = gva_to_ipa(gva, &gpa, GV2M_READ); if ( rc == -EFAULT ) - goto bad_insn_abort; + return; /* Try again */ } rc = p2m_mem_access_check(gpa, gva, npfec); @@ -2422,7 +2422,6 @@ static void do_trap_instr_abort_guest(struct cpu_user_regs *regs, break; } -bad_insn_abort: inject_iabt_exception(regs, gva, hsr.len); } @@ -2452,7 +2451,7 @@ static void do_trap_data_abort_guest(struct cpu_user_regs *regs, { rc = gva_to_ipa(info.gva, &info.gpa, GV2M_READ); if ( rc == -EFAULT ) - goto bad_data_abort; + return; /* Try again */ } switch ( dabt.dfsc & 0x3f )