From patchwork Wed Apr 24 04:41:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongjiu Geng X-Patchwork-Id: 10914063 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D99F6922 for ; Wed, 24 Apr 2019 04:42:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C001028A28 for ; Wed, 24 Apr 2019 04:42:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B3B2028A2D; Wed, 24 Apr 2019 04:42:17 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5A06A28A28 for ; Wed, 24 Apr 2019 04:42:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=6Z7lKa9DNPP9Ezqx8FQN5bXgilV7NIUV3n394pqqvgQ=; b=KFRIGxNJPJvCBi oHvIwL8pVrlEI9Z+G5Tf9s/xYMCPiM5+IfqA6WJwcLcskkvX65uCjiqYuy4ikwR9CzjCtChG5hgOD RUuK+BiTkDVfHGxf8V/2MNXYoGsUnBbJW/1QvNLmWcLV7a7/qSDukZsLooXTjW4Xd8CUWkapTTC34 SU0G9c8sHKqxTXMNFyW7UMcSJKcxVGiu49DAXW6hRt+QRCz1s6QJucEKPl4H12FJwuocx0+f5FN5w jWNv4u6bZ3iEr5Myug8pYZq2PFdk7/RJpVMmXSkzpCrIrgGRms+2CTI4f/azd9lCqbruZNvMYAgpe XICuVReZUHtzUkwzoKng==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJ9jY-0005Cj-Ho; Wed, 24 Apr 2019 04:42:12 +0000 Received: from szxga07-in.huawei.com ([45.249.212.35] helo=huawei.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJ9jV-0005Bu-0j for linux-arm-kernel@lists.infradead.org; Wed, 24 Apr 2019 04:42:10 +0000 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 292B69D7AFA4C9779A00; Wed, 24 Apr 2019 12:41:55 +0800 (CST) Received: from localhost.localdomain (10.143.28.91) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.439.0; Wed, 24 Apr 2019 12:41:48 +0800 From: Dongjiu Geng To: , , , , , , , , Subject: [PATCH] KVM: arm/arm64: inject an async abort to host if SEA handling failed Date: Wed, 24 Apr 2019 12:41:47 +0800 Message-ID: <1556080907-25158-1-git-send-email-gengdongjiu@huawei.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.143.28.91] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190423_214209_240849_250B3DAE X-CRM114-Status: GOOD ( 11.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 If host failed to handle the SEA, KVM should inject an async abort to guest for both SEA data and instruction abort, but it currently only handles the data abort, so correct it. Cc: James Morse Cc: Xiang Zheng Signed-off-by: Dongjiu Geng --- virt/kvm/arm/mmu.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/virt/kvm/arm/mmu.c b/virt/kvm/arm/mmu.c index 27c9583..5882516 100644 --- a/virt/kvm/arm/mmu.c +++ b/virt/kvm/arm/mmu.c @@ -1924,14 +1924,13 @@ int kvm_handle_guest_abort(struct kvm_vcpu *vcpu, struct kvm_run *run) /* * For RAS the host kernel may handle this abort. * There is no need to pass the error into the guest. + * If host failed to handle it, inject an async abort + * to guest. */ - if (!kvm_handle_guest_sea(fault_ipa, kvm_vcpu_get_hsr(vcpu))) - return 1; - - if (unlikely(!is_iabt)) { + if (kvm_handle_guest_sea(fault_ipa, kvm_vcpu_get_hsr(vcpu))) kvm_inject_vabt(vcpu); - return 1; - } + + return 1; } trace_kvm_guest_fault(*vcpu_pc(vcpu), kvm_vcpu_get_hsr(vcpu),