From mboxrd@z Thu Jan 1 00:00:00 1970 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 42925C43327 for ; Fri, 26 Jun 2026 14:21:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Ke6gtps38ktpywN4raSMTf/Qd3T81LDQBZmPN4IfMpo=; b=O/+yqxCYhh4UYGtqZHzhuuO/7R UtrEMtQEIcdUlqSbdHJ7/zOkGu80oiPY4Gs48qPsapUD/d9HkydfVkUdU3V5uaGEWCCo1eRlcxAks 0PCUDYIuDRvkE0b62RnC3EnI702jAgGhpQxsWQhw2PldD/bLlDiHkdOrU40xdEroCpQRt5ik34tKD VJwFfM0ZcpjEu9nw1QYU5YRdTrxwMvKgOIzn2gW6Czcc8SJxWpdOW8kLeK9wUEXO8pU+pLkAntAnq AdeBroVQhhAprJG6puMWjp98utYrwUImKhhx62eY40Q49a+8GbkAtqS8S/T9tD0ordYJl8iltbMEF OoOTtFLA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wd7QO-0000000BRrP-0SIx; Fri, 26 Jun 2026 14:20:56 +0000 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wd7QM-0000000BRrJ-4Bqo for linux-arm-kernel@lists.infradead.org; Fri, 26 Jun 2026 14:20:55 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 6EEBE600D8; Fri, 26 Jun 2026 14:20:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22A341F000E9; Fri, 26 Jun 2026 14:20:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1782483654; bh=Ke6gtps38ktpywN4raSMTf/Qd3T81LDQBZmPN4IfMpo=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=LMaWKo28J2wAgy5wU7ESIVHMDF8JMc02ZW7Q1tLGqNOKkgZwEmqToOnxQM4WKFVfD xEZ5RmakzpzziQjAT2dFAAfA689hfPyNDoplhO6XtxCryZAWbMtYFOKQ24VaUHtu8N US2M+vF5zq3ooki8nMyppjRhNSY5u6h27a21XSyBHNYf2wDgu2uHaqJJULPuZW1Eel 505Abveh4FACFqUsjeOyvKF+hgpV0ARiBUUz5n04LUc6mKz81b2MfJDrn98f/+FvAa gaSCQz3vK7M09AT6E4UiUAcm/EaP/G+nnqYUf2+VrIoBiFMzsaycXkn+xKYzgp2IaS HK66PzB7tLaoQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wd7QK-0000000GMhT-0rdi; Fri, 26 Jun 2026 14:20:52 +0000 Date: Fri, 26 Jun 2026 15:20:51 +0100 Message-ID: <865x35qt6k.wl-maz@kernel.org> From: Marc Zyngier To: Alexander Martyniuk Cc: stable@vger.kernel.org, Greg Kroah-Hartman , Oliver Upton , Joey Gouly , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, Oliver Upton , Hyunwoo Kim Subject: Re: [PATCH 6.12] KVM: arm64: Take the SRCU lock for page table walks in fault injection and AT emulation In-Reply-To: <20260626134210.228892-1-alexevgmart@gmail.com> References: <20260626134210.228892-1-alexevgmart@gmail.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: alexevgmart@gmail.com, stable@vger.kernel.org, gregkh@linuxfoundation.org, oliver.upton@linux.dev, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, oupton@kernel.org, imv4bel@gmail.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false 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 On Fri, 26 Jun 2026 14:42:07 +0100, Alexander Martyniuk wrote: > > From: Hyunwoo Kim > > commit f2ca45b50d4216c9cc7ffabf50d9ad1932209251 upstream. > > walk_s1() and kvm_walk_nested_s2() expect to be called while holding > kvm->srcu to guard against memslot changes. While this is generally > the case, __kvm_at_s12() and __kvm_find_s1_desc_level() call into the > respective walkers without taking kvm->srcu. > > Fix by acquiring kvm->srcu prior to the table walk in both instances. > > Cc: stable@vger.kernel.org > Fixes: 50f77dc87f13 ("KVM: arm64: Populate level on S1PTW SEA injection") > Fixes: be04cebf3e78 ("KVM: arm64: nv: Add emulation of AT S12E{0,1}{R,W}") > Suggested-by: Oliver Upton > Signed-off-by: Hyunwoo Kim > Reviewed-by: Oliver Upton > Link: https://patch.msgid.link/aiAZfdeyanIvP8SD@v4bel > Signed-off-by: Marc Zyngier > [Alexander: __kvm_find_s1_desc_level() not present, patching only __kvm_at_s12()] > Signed-off-by: Alexander Martyniuk See thread at [1], which explains why this is not needed. M. [1] https://lore.kernel.org/all/aifnUC7gmeniiYPv@v4bel/ -- Without deviation from the norm, progress is not possible.