From patchwork Mon Nov 14 20:11:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver Upton X-Patchwork-Id: 13042785 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C92A5C4332F for ; Mon, 14 Nov 2022 20:12:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :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=8MRmmm45agRfRht9i2a0ofaf17Wd0z9o6phQyBa+V0M=; b=JjO62ln39LNqif wNhN++zlqBV4XOr9brFnDriLi5UgoUlkD718ecL1C9gh4SPQFwV6PevaEi76eJctlDYJZ3fbic9xY MvS6aVWIE3cw7/Ll7HdQjONVxCqkCjwnZpRAkN/ZjHktAASxTauh1OuwFhiF8aR2tIznfZulFnzl7 PAnpMKXdorex8bm0XU34zLS+HLhzpTQp9V2STWCqPqD3DU37IKd3gs4dywApZ30GgQFjRDUciMhvb mPMUlPPUKzoHN+mNAZseRlTttKxHOssw2KiTiN8w44KU8IPufnEiYb8LXqAi8IOT/gjVfdTuQZ3fM d/LGxaLBhNkNzmSI3oBg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oufo3-004eeW-Jl; Mon, 14 Nov 2022 20:11:47 +0000 Received: from out2.migadu.com ([188.165.223.204]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oufo0-004eam-3k for linux-arm-kernel@lists.infradead.org; Mon, 14 Nov 2022 20:11:46 +0000 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1668456698; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=c7eJcRQB0lx33rMvbkdk1U8UPwvqiEcNke7dhs9bXxk=; b=AsNWEzgq6M5I0JGjE3dhOXIXHo/2w12Pduf1EO+Yld+orfYsqG1+y+cmisW/BFDIU7ILBd 860xTFmL+rX+U6HWpuhbcvzXAw3C9eC6dlLZu9rfYXnO3kGsxYS+Al0h4l7x7NgDCe+Wv9 cjAPYp4tuawq+rrX19NYZ3yQ3xeRHg0= From: Oliver Upton To: Marc Zyngier , James Morse , Alexandru Elisei Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, kvmarm@lists.linux.dev, Oliver Upton , Marek Szyprowski Subject: [PATCH 0/1] KVM: arm64: Skip RCU protection for hyp stage-1 Date: Mon, 14 Nov 2022 20:11:26 +0000 Message-Id: <20221114201127.1814794-1-oliver.upton@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221114_121145_182655_A3C75BA5 X-CRM114-Status: UNSURE ( 7.99 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Whelp, that was quick. Marek reports [1] that the parallel faults series leads to a kernel BUG when initializing the hyp stage-1 page tables. Work around the issue by never acquiring the RCU read lock when walking hyp stage-1. This is safe because hyp stage-1 is protected by a spinlock (pKVM) or mutex (regular nVHE). The included patch applies to the parallel faults series. To avoid breaking bisection, the patch should immediately precede commit c3119ae45dfb ("KVM: arm64: Protect stage-2 traversal with RCU"). Or, if preferred, I can respin the whole series in the correct order. Tested with the pKVM isolated vCPU state series [2] merged on top, w/ kvm-arm.mode={nvhe,protected} on an Ampere Altra system. Cc: Marek Szyprowski [1]: https://lore.kernel.org/kvmarm/d9854277-0411-8169-9e8b-68d15e4c0248@samsung.com/ [2]: https://lore.kernel.org/linux-arm-kernel/20221110190259.26861-1-will@kernel.org/ Oliver Upton (1): KVM: arm64: Use a separate function for hyp stage-1 walks arch/arm64/include/asm/kvm_pgtable.h | 24 ++++++++++++++++++++++++ arch/arm64/kvm/hyp/nvhe/setup.c | 2 +- arch/arm64/kvm/hyp/pgtable.c | 18 +++++++++++++++--- 3 files changed, 40 insertions(+), 4 deletions(-)