From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A2CD43BB68B; Fri, 15 May 2026 16:10:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778861441; cv=none; b=oeQh9BGrZkz5xT6LS7hhBUK1wUjQEjZyWO4fw+tkmuS1QtDTrkbTJevcvwtCbPliKsfJSqO+bdDyj34P8RZn74nbSs1qwGwOEfD9P7kv+iEKFhL7EdL9c1gW+dEezx+9F/sV0ur6jc4yVwDMuBQgnouqFNa4flMxuIZzB6HPyEc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778861441; c=relaxed/simple; bh=y29xSSyZ2v0AFk8J81xU5VMO9G+ea2FrpKuMJZgpJ+M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Xe25W8duDhVyMXC6S6fHt/NW1f7aTOlCF6HnPmkpMF+pOKG+IfqXJUWksRum8HGGNrOE9JywcyBLbMdCMVO7kKtXMlFE4R/45FaEQhugQTeHg26aj7KOINeL9FOTFJ7/22ud5WC6wh/wgIOYHMTG15gi8xB2cMLsxzOKHpATE1g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=gBveX8g1; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="gBveX8g1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3AEF6C2BCB0; Fri, 15 May 2026 16:10:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778861441; bh=y29xSSyZ2v0AFk8J81xU5VMO9G+ea2FrpKuMJZgpJ+M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gBveX8g1j0NWE1vceuizJk96FSqrbfq9sffpaH5GOt4lKIYj5yL/isl7ujOmnsHw/ MFekVTDxrWO+yrxAi3QMf0kqe8W1R5SkGlskTdqWHESa6Luo0YaWE4sskJ/TyI/AKa 89Ylgprag61qp8C57EddZvaAV5FmjaaxomPDCgog= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Quentin Perret , Fuad Tabba , Marc Zyngier Subject: [PATCH 6.6 293/474] KVM: arm64: Fix initialisation order in __pkvm_init_finalise() Date: Fri, 15 May 2026 17:46:42 +0200 Message-ID: <20260515154721.339964064@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260515154715.053014143@linuxfoundation.org> References: <20260515154715.053014143@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Quentin Perret commit 5bb0aed57ba944f8c201e4e82ec066e0187e0f85 upstream. fix_host_ownership() walks the hypervisor's stage-1 page-table to adjust the host's stage-2 accordingly. Any such adjustment that requires cache maintenance operations depends on the per-CPU hyp fixmap being present. However, fix_host_ownership() is currently called before fix_hyp_pgtable_refcnt() and hyp_create_fixmap(), so the fixmap does not yet exist when it runs. This is benign today because the host stage-2 starts empty and no CMOs are needed, but it becomes a latent crash as soon as fix_host_ownership() is extended to operate on a non-empty page-table. Reorder the calls so that fix_hyp_pgtable_refcnt() and hyp_create_fixmap() complete before fix_host_ownership() is invoked. Fixes: 0d16d12eb26e ("KVM: arm64: Fix-up hyp stage-1 refcounts for all pages mapped at EL2") Signed-off-by: Quentin Perret Signed-off-by: Fuad Tabba Link: https://patch.msgid.link/20260424084908.370776-7-tabba@google.com Signed-off-by: Marc Zyngier Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- arch/arm64/kvm/hyp/nvhe/setup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/arch/arm64/kvm/hyp/nvhe/setup.c +++ b/arch/arm64/kvm/hyp/nvhe/setup.c @@ -284,15 +284,15 @@ void __noreturn __pkvm_init_finalise(voi }; pkvm_pgtable.mm_ops = &pkvm_pgtable_mm_ops; - ret = fix_host_ownership(); + ret = fix_hyp_pgtable_refcnt(); if (ret) goto out; - ret = fix_hyp_pgtable_refcnt(); + ret = hyp_create_pcpu_fixmap(); if (ret) goto out; - ret = hyp_create_pcpu_fixmap(); + ret = fix_host_ownership(); if (ret) goto out;