From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 256F4C2BA2B for ; Sat, 11 Apr 2020 12:16:58 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EB3F920692 for ; Sat, 11 Apr 2020 12:16:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="bPSpwsCY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EB3F920692 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=rWlmot13SQFjKilHCYUqE9J98DSrUqB59InQMMDjwIk=; b=bPSpwsCYG0AyZ/ vae0jLKrX+rZgJS5QIRpM+t43K6fw3f077HQ/GY1yMvcHsqQI0qDmhoz5OoeIKCfk1n40jvCP5AM/ X1AXMIMjAxoOUGdPZvmEmiNVXPeUdoFR3uNlpPPpdSvfu0xC7q+IE8N91iY6EcHVj+TlwKqHyT0U2 yaI39o6yacQjz701EJrXlg8WuO6c5KgOE/82HBsEohFh8sfrg9T5ceTywPGhlyOaaio58xzpkVggF LYz003/EZLZrjWeCmP9IWY4pm2hZB+bJWOFkeGW5RDkyj+tOAUMzIwDSC2s8Dr/QIjljL44mH9c43 A6GYgtHsejkP/D+E7DCg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jNF46-00009e-QD; Sat, 11 Apr 2020 12:16:50 +0000 Received: from szxga05-in.huawei.com ([45.249.212.191] helo=huawei.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jNF42-0008Oe-5h for linux-arm-kernel@lists.infradead.org; Sat, 11 Apr 2020 12:16:48 +0000 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 2AAC2DD93474802C528B; Sat, 11 Apr 2020 20:16:30 +0800 (CST) Received: from huawei.com (10.151.151.243) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Sat, 11 Apr 2020 20:16:20 +0800 From: Dongjiu Geng To: , , , , , , , , Subject: [PATCH] KVM: handle the right RAS SEA(Synchronous External Abort) type Date: Sat, 11 Apr 2020 20:17:40 +0800 Message-ID: <20200411121740.37615-1-gengdongjiu@huawei.com> X-Mailer: git-send-email 2.18.0.huawei.25 MIME-Version: 1.0 X-Originating-IP: [10.151.151.243] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200411_051646_390389_B45B49FE X-CRM114-Status: UNSURE ( 9.05 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: zhengxiang9@huawei.com, tanxiaofei@huawei.com, linuxarm@huawei.com, gengdongjiu@huawei.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org When the RAS Extension is implemented, b0b011000, 0b011100, 0b011101, 0b011110, and 0b011111, are not used and reserved to the DFSC[5:0] of ESR_ELx, but the code still checks these unused bits, so remove them. If the handling of guest ras data error fails, it should inject data instead of SError to let the guest recover as much as possible. CC: Xiang Zheng CC: Xiaofei Tan CC: James Morse Signed-off-by: Dongjiu Geng --- Abort DFSC of ESR_EL2, below web site[1] has clarified: "When the RAS Extension is implemented, 0b011000, 0b011100, 0b011101, 0b011110, and 0b011111, are reserved." [1]: https://developer.arm.com/docs/ddi0595/b/aarch64-system-registers/esr_el2 --- arch/arm64/include/asm/kvm_emulate.h | 5 ----- virt/kvm/arm/mmu.c | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/arch/arm64/include/asm/kvm_emulate.h b/arch/arm64/include/asm/kvm_emulate.h index a30b4eec7cb4..857fbc79d678 100644 --- a/arch/arm64/include/asm/kvm_emulate.h +++ b/arch/arm64/include/asm/kvm_emulate.h @@ -380,11 +380,6 @@ static __always_inline bool kvm_vcpu_dabt_isextabt(const struct kvm_vcpu *vcpu) case FSC_SEA_TTW1: case FSC_SEA_TTW2: case FSC_SEA_TTW3: - case FSC_SECC: - case FSC_SECC_TTW0: - case FSC_SECC_TTW1: - case FSC_SECC_TTW2: - case FSC_SECC_TTW3: return true; default: return false; diff --git a/virt/kvm/arm/mmu.c b/virt/kvm/arm/mmu.c index e3b9ee268823..3c7972ed7fc5 100644 --- a/virt/kvm/arm/mmu.c +++ b/virt/kvm/arm/mmu.c @@ -1926,7 +1926,7 @@ int kvm_handle_guest_abort(struct kvm_vcpu *vcpu, struct kvm_run *run) return 1; if (unlikely(!is_iabt)) { - kvm_inject_vabt(vcpu); + kvm_inject_dabt(vcpu, kvm_vcpu_get_hfar(vcpu)); return 1; } } -- 2.18.0.huawei.25 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel