From patchwork Thu Oct 19 14:58:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Morse X-Patchwork-Id: 10017459 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 C923460224 for ; Thu, 19 Oct 2017 15:04:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B6EEC28DA8 for ; Thu, 19 Oct 2017 15:04:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AA0DF28D38; Thu, 19 Oct 2017 15:04:45 +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.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 5B5E228D38 for ; Thu, 19 Oct 2017 15:04:45 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To: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:List-Owner; bh=GY5KiD8nLr8S4XfOnuvZ85oq3fulLeZeaW5cD5HYyiE=; b=HhO6wLUJ2qBfFuzdK0csmgPIcu 185jGvMJ8TV61yl5dEQxq6P/EW5cZgftzTKmUtlT4/lh6yyGoHxqopSLBXvM426mP7sIYxtdydNQv N3qQs0+OF17M719oKFXBkGO4QlCr9/54jjqnJGix9y37K/80QxDIxwAK3pjFECi+pb5w0raP2unoK cVkim/Q3q8MJVdlicfgmnPJey0AOLxmzu3BxuV65EV8oLCySUYuJPC6JXm9DEG40F8Ju5yA3BGGHe fG2mqp98XPo07vCJ7I7GZqpJhheZeR69MfpBJMN2JnnCIzhZ7vwe+HgFGx5rD+nRbmg0qVBx7vOou DA6NjsQg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e5CNI-0004fo-8c; Thu, 19 Oct 2017 15:04:44 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e5CJs-0001OJ-Gj for linux-arm-kernel@bombadil.infradead.org; Thu, 19 Oct 2017 15:01:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Jqf0SVnJSqtFOzPXqXxIh0v4xjtWvyRzKx/5LMAm7aw=; b=iLwbLPpT53aopFOiadDbFBIAZ m9vyp2tzywyai946aluMkYUxtqsRFcGRNhSl9fsr9NJMq7hyiM0osyjv+S9+h+ZV+qpbpJ9qGnjY6 7GYvoulyYDAOsSNfWgkhTIzCiVdEqdd2tubUkS/CP5qn09qtGhrNObHSJe5xOk5LHdv5a8P9DvFFm 4FEgQcNuUBGMqaOB/GguQldPohuLm4HYhFZ/eTSnGWGE31UqBioHxMq2i2Jn8ovwVqf8lOa2/C7XR dHpp5Vsd6cGRHd2rmVIfe2Q4/NrKiyDi7nhuet4jCWZZ+O2Osjpa9HqWjimhsYuzuvTk5aLsnQImy XPCQBmFEg==; Received: from foss.arm.com ([217.140.101.70]) by merlin.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e5CJo-0005aK-Ay for linux-arm-kernel@lists.infradead.org; Thu, 19 Oct 2017 15:01:09 +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 D3F941610; Thu, 19 Oct 2017 08:00:47 -0700 (PDT) Received: from melchizedek.cambridge.arm.com (melchizedek.cambridge.arm.com [10.1.207.55]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B91FB3F483; Thu, 19 Oct 2017 08:00:45 -0700 (PDT) From: James Morse To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 20/21] KVM: arm64: Take any host SError before entering the guest Date: Thu, 19 Oct 2017 15:58:06 +0100 Message-Id: <20171019145807.23251-21-james.morse@arm.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20171019145807.23251-1-james.morse@arm.com> References: <20171019145807.23251-1-james.morse@arm.com> 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: , Cc: Jonathan.Zhang@cavium.com, Xie XiuQi , Marc Zyngier , Catalin Marinas , Julien Thierry , Will Deacon , wangxiongfeng2@huawei.com, James Morse , Dongjiu Geng , kvmarm@lists.cs.columbia.edu, Christoffer Dall 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 On VHE systems KVM masks SError before switching the VBAR value. Any host RAS error that the CPU knew about before world-switch may become pending as an SError during world-switch, and only be taken once we enter the guest. Until KVM can take RAS SErrors during world switch, add an ESB to force any RAS errors to be synchronised and taken on the host before we enter world switch. RAS errors that become pending during world switch are still taken once we enter the guest. Signed-off-by: James Morse Acked-by: Christoffer Dall --- arch/arm64/include/asm/kvm_host.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index cf5d78ba14b5..5dc6f2877762 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -392,6 +392,7 @@ static inline void __cpu_init_stage2(void) static inline void kvm_arm_vhe_guest_enter(void) { + esb(); local_daif_mask(); }