From patchwork Thu Sep 3 13:52:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Scull X-Patchwork-Id: 11753643 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 AF7B3109B for ; Thu, 3 Sep 2020 13:54:23 +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 8875F208CA for ; Thu, 3 Sep 2020 13:54:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="MywsFQM+"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="a57VKu3d" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8875F208CA Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com 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:To:From:Subject:References:Mime-Version:Message-Id: In-Reply-To:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=X3Jz9omd59+Py3Tm1q1ACFbf3gzoci/oAF1ZSNkH/aA=; b=MywsFQM+TdQyr4b15wQwb76FK RB+X6r1/bR52utf/yEsUGwznbhhIBxGsWC9TNfF6T4pZAR/d/WkFr20iwu4bgNbdijwgRz5lIJosk +varNbVEDD30DegpXFqzaDkHnn3KtLnruj4Ohxj00HnSxbxw95NK+txPnqcXMYVzXOScfIPZTgVaq qH31aLfqEtU55caE+05YWJE4DDs2C1qo20MJFqBJac2XrANIEZDEIs02qAYQW+X+0Q1W46u0kPrl9 AzNaApuQz+aiFTn85wfkgnEcsd1JDScL4mh3jfDuNTo4mpWHB94RR8320bVGB9DWJFoTCjpNvba3h fZ5QRqE3Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDpgo-0002Gw-NR; Thu, 03 Sep 2020 13:54:10 +0000 Received: from mail-wr1-x44a.google.com ([2a00:1450:4864:20::44a]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDpgA-0001y8-Rh for linux-arm-kernel@lists.infradead.org; Thu, 03 Sep 2020 13:53:31 +0000 Received: by mail-wr1-x44a.google.com with SMTP id y3so1096176wrl.21 for ; Thu, 03 Sep 2020 06:53:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=m88A2XuNwMqKS/A5OTbXILtJDJGHHDQ7M1ytLL+HaFE=; b=a57VKu3d8f7YGU3eZEhfudZeLt+GdeXwu+I55kMo74gb4vQxXbVd5paqLtjkIPpROl u70wigQah1kJi7USgtlAKd6G1CwioTnLrTW9avprWqHZDNyGqBmJGB2shELbcl7w+JIc TOvAcLDRIRC1+mtTyg7gK18PIQwAx9KNp+TkrcYvJ7lTkj4PAkEphx39uLnuVlKRd8zg SCwsFNpP7mqSQEkuRHdHeEFdqdgq4MuJktCa+NBxGYmL2hcyUzLQkvwCV7xJ+7uZYy/0 4O0RAFuehcbwsGZc6XD9fucQwrvNoiueJVJCvCsckuL51gG4g7gTM5S0PT0Vst7C9Tbg B70A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=m88A2XuNwMqKS/A5OTbXILtJDJGHHDQ7M1ytLL+HaFE=; b=YydLHPo6D3PsVp4y2nn3XIKn6vPAANIjGUapJSL+9bbq57Pr+BEnGiS5xj8e43ewPl HWVSe0WG9cfz2NguV/6L9bF2THIETLWkE9CEJA8go3rLfxDqwjcZQbF1wg3E4Jbc76NF 7YHDivtGzEUq+fDssZTWT8mJUhA1NwbiCn49kLkzJp6q/uPPLLKoUkt1e4C6q4gHYUK9 1BLrcoGxUGMq9MXnuZFHHTNkMrlQc5Q07+Y4SMiN86s2GLNH+dcYVrlw5CGjW8IZmXtV lGo7TPkZoPd/IDP9tVxc/h650vxPf4mcFW2tK2gUbtE0rh4qHUTPPBVAHETk63vUtySg Kmog== X-Gm-Message-State: AOAM532rwRwTJdVUU+c+AdnQf9Iu2nFtfwAdUUY4CVOF+EIy9jv9vR9J SYV429YDhN2FVGVEVPv5g8BWF6ysCFg= X-Google-Smtp-Source: ABdhPJzz/AyE5gxTbwTnqT54ZWV6iqg0ZGGspa3mL/skGF0KeoJc9Ohz89U2PYNeXcB7yShIkypJhdeyarc= X-Received: from ascull.lon.corp.google.com ([2a00:79e0:d:109:4a0f:cfff:fe4a:6363]) (user=ascull job=sendgmr) by 2002:a1c:7c14:: with SMTP id x20mr287186wmc.72.1599141207351; Thu, 03 Sep 2020 06:53:27 -0700 (PDT) Date: Thu, 3 Sep 2020 14:52:56 +0100 In-Reply-To: <20200903135307.251331-1-ascull@google.com> Message-Id: <20200903135307.251331-8-ascull@google.com> Mime-Version: 1.0 References: <20200903135307.251331-1-ascull@google.com> X-Mailer: git-send-email 2.28.0.402.g5ffc5be6b7-goog Subject: [PATCH v3 07/18] KVM: arm64: nVHE: Don't consume host SErrors with ESB From: Andrew Scull To: kvmarm@lists.cs.columbia.edu X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200903_095330_938272_AB1750BD X-CRM114-Status: GOOD ( 14.57 ) X-Spam-Score: -8.2 (--------) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-8.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:44a listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -7.5 USER_IN_DEF_DKIM_WL From: address is in the default DKIM white-list 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.5 DKIMWL_WL_MED DKIMwl.org - Medium 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: linux-arm-kernel@lists.infradead.org, kernel-team@android.com, suzuki.poulose@arm.com, maz@kernel.org, Sudeep Holla , james.morse@arm.com, Andrew Scull , catalin.marinas@arm.com, will@kernel.org, julien.thierry.kdev@gmail.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The ESB at the start of the host vector may cause SErrors to be consumed to DISR_EL1. However, this is not checked for the host so the SError could go unhandled. Remove the ESB so that SErrors are not consumed but are instead left pending for the host to consume. __guest_enter already defers entry into a guest if there are any SErrors pending. Fixes: 0e5b9c085dce ("KVM: arm64: Consume pending SError as early as possible") Cc: James Morse Signed-off-by: Andrew Scull --- arch/arm64/kvm/hyp/nvhe/host.S | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kvm/hyp/nvhe/host.S b/arch/arm64/kvm/hyp/nvhe/host.S index 9c96b9a3b71d..5a7380c342c8 100644 --- a/arch/arm64/kvm/hyp/nvhe/host.S +++ b/arch/arm64/kvm/hyp/nvhe/host.S @@ -24,7 +24,6 @@ SYM_FUNC_END(__hyp_do_panic) .macro valid_host_el1_sync_vect .align 7 - esb stp x0, x1, [sp, #-16]! mrs x0, esr_el2 @@ -77,6 +76,11 @@ SYM_FUNC_END(__hyp_do_panic) .endm /* + * The host vector does not use an ESB instruction in order to avoid consuming + * SErrors that should only be consumed by the host. Guest entry is deferred by + * __guest_enter if there are any pending asynchronous exceptions so hyp will + * always return to the host without having consumerd host SErrors. + * * CONFIG_KVM_INDIRECT_VECTORS is not applied to the host vector because the * host already knows the address of hyp by virtue of loading it there. */