From patchwork Tue Sep 27 18:05:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9352579 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 382A660757 for ; Tue, 27 Sep 2016 18:19:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EC1B29272 for ; Tue, 27 Sep 2016 18:19:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2379E292A2; Tue, 27 Sep 2016 18:19:01 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BA7B429272 for ; Tue, 27 Sep 2016 18:19:00 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bowwZ-0007aP-Fs; Tue, 27 Sep 2016 18:17:27 +0000 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bowm7-0005V0-Te for linux-arm-kernel@lists.infradead.org; Tue, 27 Sep 2016 18:06:41 +0000 Received: by mail-wm0-x236.google.com with SMTP id l132so26953989wmf.1 for ; Tue, 27 Sep 2016 11:06:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Sa6OWcssnunJEO98QQGQAjj/YkI1Uq2E9Vm5HTrUqk4=; b=Tyg8cR/5tpggvcjxad0vOgmGyFnkxuyA69o6eSO51bKefAvcZgHlgMEgAh7fvVniwO bXbwcWxHyZGpKJNSIwWh0nsIHUE5eS2wExLLKDgZF3RdIv+Zy/LH2tCi7ZC9DQvqhV6g gn9md8ATL4R1AtF5ddkoEbJqzpZ/TLnqNri4c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Sa6OWcssnunJEO98QQGQAjj/YkI1Uq2E9Vm5HTrUqk4=; b=dqTZTvHov0eEyHQseJ+Nau50Ih/40j24L1dHkozbHZWSnwGXURUNtyC6sPD2TtZLJo JH9L0NzF49xIRO5tazL6YqpKhqHVgdTlKbN38shaV8yNJ59V1/Y/LY2w8mf0tTXnGNFz 9anlPpTo0UoEY4+psvB0yVlAwXe7h9YVaOR/W4uddP3EuJ/HC3CSMxmFrppcBMFz0Imk WIqIvcCxfljGjQ7VCUkzqCfSi5TWnBvuTIambSVfoBwiopiAVI0ebKsdE3cQ5QHc9S5c 69YO4v+ZcXRO+RkXlmiOy6Gz1rOVvzcX5gOq/kQ1OPRT6vFHvASVw1+mPh93yXEmZR7w nS0A== X-Gm-Message-State: AA6/9RnAlawAUOf55R6ohoCZ8OvwUHyHdudNkHWQCmtaygvJgsbQ8QPHgP5vlqJ3wsrykVCZ X-Received: by 10.28.5.133 with SMTP id 127mr4086833wmf.128.1474999578422; Tue, 27 Sep 2016 11:06:18 -0700 (PDT) Received: from localhost.localdomain ([94.18.191.146]) by smtp.gmail.com with ESMTPSA id k2sm17932539wmg.23.2016.09.27.11.06.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 27 Sep 2016 11:06:18 -0700 (PDT) From: Christoffer Dall To: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Subject: [PULL 33/50] arm/arm64: KVM: Inject virtual abort when guest exits on external abort Date: Tue, 27 Sep 2016 20:05:41 +0200 Message-Id: <20160927180558.14699-34-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160927180558.14699-1-christoffer.dall@linaro.org> References: <20160927180558.14699-1-christoffer.dall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160927_110640_343154_0D3159A8 X-CRM114-Status: GOOD ( 10.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marc Zyngier , Christoffer Dall , kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Marc Zyngier If we spot a data abort bearing the ESR_EL2.EA bit set, we know that this is an external abort, and that should be punished by the injection of an abort. Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall --- arch/arm/kvm/mmu.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c index 344755d..60e0c1a 100644 --- a/arch/arm/kvm/mmu.c +++ b/arch/arm/kvm/mmu.c @@ -1432,6 +1432,11 @@ int kvm_handle_guest_abort(struct kvm_vcpu *vcpu, struct kvm_run *run) int ret, idx; is_iabt = kvm_vcpu_trap_is_iabt(vcpu); + if (unlikely(!is_iabt && kvm_vcpu_dabt_isextabt(vcpu))) { + kvm_inject_vabt(vcpu); + return 1; + } + fault_ipa = kvm_vcpu_get_fault_ipa(vcpu); trace_kvm_guest_fault(*vcpu_pc(vcpu), kvm_vcpu_get_hsr(vcpu),