From patchwork Wed Jul 29 10:28:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 11690755 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1235A13B6 for ; Wed, 29 Jul 2020 10:30:07 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 DFD9C206D4 for ; Wed, 29 Jul 2020 10:30:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="EcZr1uoM"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="dIS/Nmbf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DFD9C206D4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.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=W4c/eInHftUpYOFYUnlKbtES4rGl1uvCOvZddBbmxNI=; b=EcZr1uoMQJR2i9rYu2DMuT7hka a+zWiPNkf7dVaCkdN++j56O2Cn/KalMrc4Cs2bFXEM1apO0r4clq08EqJbCVvRjkp0VewITxAJBz1 Wrl6PIWnBwQ5w3a2w4lWJXf1GU2zbifxbpPtzg+PAyAr0Savr4kE5jXOC+H7ArpeCB7m+SdIGb3MR ++wGpcP9LpDUtodWZzweBXSqdW2MH6nBoAzFmnLV1xumGes6Y6IKUx4tVLPiA+EHmxFxIN5XM+ji3 UQUfSJfPiftLidVyFvM/qNgNFpPvnG4iMdX1JfXjcMF55Mhp7oNF+0OJ6hDqlzoJNcWDDJbZY8Fa3 F3Ni9Cog==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k0jK1-0000vU-NS; Wed, 29 Jul 2020 10:28:29 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k0jJy-0000uX-RZ for linux-arm-kernel@lists.infradead.org; Wed, 29 Jul 2020 10:28:27 +0000 Received: from localhost.localdomain (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 084AE206D4; Wed, 29 Jul 2020 10:28:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596018506; bh=OV8Q9chiN1dhcOrS3acpO8IjQZ3jxCwC1wadS7xchSI=; h=From:To:Cc:Subject:Date:From; b=dIS/NmbfPix05mFEShDhJhFpvMqjnx8Xzl/GtokK8jy9ExXed7SdP0YtzhqUzzMfR 5V4fepj3NuDFzO1ZATSR0ufc1STNSGUh3pavtpsvdHiedi+eYVstGLxQnGoVfPrN03 Za61g1iNQIsqMTeZvemzKjPWGCXxOc7ex75u78mQ= From: Will Deacon To: kvmarm@lists.cs.columbia.edu Subject: [PATCH v2 0/4] KVM: arm64: Fixes to early stage-2 fault handling Date: Wed, 29 Jul 2020 11:28:17 +0100 Message-Id: <20200729102821.23392-1-will@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200729_062826_959675_CC26E642 X-CRM114-Status: GOOD ( 12.33 ) X-Spam-Score: -5.2 (-----) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-5.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [198.145.29.99 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender 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: James Morse , kernel-team@android.com, Will Deacon , linux-arm-kernel@lists.infradead.org, Suzuki Poulose Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Hi all, This is version two of the patches I posted last week: https://lore.kernel.org/r/20200724143506.17772-1-will@kernel.org I got my brain in a twist with exactly what is reported in HPFAR for a stage-2 abort on a stage-1 table walk, so I don't think any of these are serious any more. With these changes, the early stage-2 fault handling follows: S2 instruction abort: * Not in memslot, or S2 fault on S1 walk for tables in R/O memslot: => inject external iabt to guest S2 data abort: * Not in memslot: - S2 fault on S1 walk: inject external dabt to guest - Cache maintenance: skip instr - Syndrome valid EXIT_MMIO - Syndrome invalid EXIT_NISV * Write fault in R/O memslot: - S2 fault on S1 walk: inject external dabt to guest - Access is write: - Syndrome valid EXIT_MMIO - Syndrome invalid EXIT_NISV (includes cache maintenance) Everything else gets handled by handle_access_fault()/user_mem_abort(). Will Cc: James Morse Cc: Suzuki Poulose Cc: kernel-team@android.com --->8 Will Deacon (4): KVM: arm64: Rename kvm_vcpu_dabt_isextabt() KVM: arm64: Handle data and instruction external aborts the same way KVM: arm64: Don't skip cache maintenance for read-only memslots KVM: arm64: Move S1PTW S2 fault logic out of io_mem_abort() arch/arm64/include/asm/kvm_emulate.h | 2 +- arch/arm64/kvm/hyp/switch.c | 2 +- arch/arm64/kvm/mmio.c | 6 ------ arch/arm64/kvm/mmu.c | 26 +++++++++++++++++--------- 4 files changed, 19 insertions(+), 17 deletions(-)