From patchwork Mon Jun 10 16:24:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Morse X-Patchwork-Id: 10985133 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 074AE76 for ; Mon, 10 Jun 2019 16:24:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E81282852A for ; Mon, 10 Jun 2019 16:24:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D97672887D; Mon, 10 Jun 2019 16:24:49 +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 5EC762852A for ; Mon, 10 Jun 2019 16:24:49 +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: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=Ml6fh8UE3DZBec5Uwewdvt7vToN4fvhRYbpBqqd+QTo=; b=BMqNSz1f65ffEX Vi8jYJZFSUKEMrajkJNfSh1/U+Kz2BF5etdxZ4FihumeTosDatWrXfHjlYnTcvk6X8OrzS1RMLBSr N8Yu4u1ZXAhettOhFq6kMSnt361rvWfDbbSUGUlOFFLC+v3S7g9A6vBqkOAI1MeBQog678vFhyT8G A7GFogRqoQQvlPT+8aX80Ozg3SaQ7ded3ntQ+aIvj2v3BZejLUwyW2xsoqlWJKr+FaNqeBBaRwZAW oK/gF4r8xXzrS7bCV1Wrn+fo3VX1OvpMrOnGIyV0M4+LXiAOvhmugqFIB/An/cvfqkUC0mje2g3uE NQQkR0eJ+ALURW2iL3Vg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1haN6A-0007bg-Ic; Mon, 10 Jun 2019 16:24:42 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1haN67-0007am-3g for linux-arm-kernel@lists.infradead.org; Mon, 10 Jun 2019 16:24:40 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 10BDA337; Mon, 10 Jun 2019 09:24:37 -0700 (PDT) Received: from eglon.cambridge.arm.com (eglon.cambridge.arm.com [10.1.196.105]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E5C183F246; Mon, 10 Jun 2019 09:24:35 -0700 (PDT) From: James Morse To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu Subject: [PATCH v2 0/6] KVM: arm64: Account host/guest SError more precisely (Neoverse-N1 #1349291) Date: Mon, 10 Jun 2019 17:24:21 +0100 Message-Id: <20190610162427.115910-1-james.morse@arm.com> 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-20190610_092439_213199_DE2602DC X-CRM114-Status: GOOD ( 11.07 ) 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: Suzuki K Pouloze , Marc Zyngier , Catalin Marinas , Julien Thierry , Will Deacon , James Morse 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 Hello, This series started as a workaround for Neoverse-N1 #1349291, but has become an improvement in RAS error accounting for KVM on arm64. Neoverse-N1 affected by #1349291 may report an Uncontained RAS Errors as Unrecoverable. [0] This is the difference between killing the thread and killing the machine. The workaround is to treat all Unrecoverable SError as Uncontained. The arch code's SError handling already does this, due to its nascent kernel-first support. So only KVM needs some work as it has its own SError handling as we want KVM to handle guest:SError and the host to handle host:SError. Instead of working around the errata in KVM, we account SError as precisely as we can instead. This means moving the ESB-instruction into the guest-exit vectors, and deferring guest-entry if there is an SError pending. (so that the host's existing handling takes it). Changes since v1: * Squashed v1:patch5 into v2:patch4. v1:patch6 to be posted separately. * Dropped all the performance numbers. * Added patch1, making the ESB macro emit a nop if the kconfig feature is disabled. * Tried to formalise the indirect vectors preamble a little more to make changes easier to review * Added preamble size checks to the invalid vector entries. * Pulled the size check out as a macro now there are two invocations. Thanks, James [0] account-required: https://developer.arm.com/docs/sden885747/latest/arm-neoverse-n1-mp050-software-developer-errata-notice [v1] https://lore.kernel.org/linux-arm-kernel/20190604144551.188107-1-james.morse@arm.com/ James Morse (6): arm64: assember: Switch ESB-instruction with a vanilla nop if !ARM64_HAS_RAS KVM: arm64: Abstract the size of the HYP vectors pre-amble KVM: arm64: Make indirect vectors preamble behaviour symmetric KVM: arm64: Consume pending SError as early as possible KVM: arm64: Defer guest entry when an asynchronous exception is pending arm64: Update silicon-errata.txt for Neoverse-N1 #1349291 Documentation/arm64/silicon-errata.txt | 1 + arch/arm64/include/asm/assembler.h | 4 ++++ arch/arm64/include/asm/kvm_asm.h | 6 ++++++ arch/arm64/kernel/traps.c | 4 ++++ arch/arm64/kvm/hyp/entry.S | 19 +++++++++++++--- arch/arm64/kvm/hyp/hyp-entry.S | 30 +++++++++++++++++++++----- arch/arm64/kvm/va_layout.c | 7 +++--- 7 files changed, 59 insertions(+), 12 deletions(-)