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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 155A6E7D0AF for ; Thu, 21 Sep 2023 22:15:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232214AbjIUWQC (ORCPT ); Thu, 21 Sep 2023 18:16:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233065AbjIUWPd (ORCPT ); Thu, 21 Sep 2023 18:15:33 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E99157B470; Thu, 21 Sep 2023 10:37:11 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7122AC433B7; Thu, 21 Sep 2023 07:15:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695280543; bh=Tx02dogxcOVuPJ+DWswlMoAIUz1labuHXlWuvwBTGiM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=PNotydpZJebiJsWK5x0zEj2ZxGXRYyowWYd29aCMRjMrCNF+XG1/DU8Vjfrf9vbja Xp6odIA+k1f/1V4BIB98EJYWH5PCdxXO4S/BCEMtM2Nyy4s80mdEqSXK3SLHwNkSFd 1U9Hbb/LZOHBD+Rzo9o3GkqiH+fKjMFPAwgC91MTCh00CvroDgqH4XWyuZtgdIy3lx H1nwB3eOdTwCCvzpJeylIodw2LhDR2IjGDe8mTNGTK5Ig5dMslkxETpn+TTdSiA807 QSM/6JR4RJkvnE2+qQlkq2ej0hSH4qtVP95dg3pJ20IXxNL4q6zA5OskKJTgkVhMQk pBWxYrU6Uhsjw== Received: from 82-132-232-12.dab.02.net ([82.132.232.12] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qjDuW-00Erv1-Pd; Thu, 21 Sep 2023 08:15:41 +0100 Date: Thu, 21 Sep 2023 08:15:36 +0100 Message-ID: <877cok3skn.wl-maz@kernel.org> From: Marc Zyngier To: Suraj Jitindar Singh Cc: , , , , , , , , , , , Will Deacon , Quentin Perret Subject: Re: [PATCH stable 6.1.y 2/2] KVM: arm64: Prevent unconditional donation of unmapped regions from the host In-Reply-To: <20230920192729.694309-2-surajjs@amazon.com> References: <20230920192729.694309-1-surajjs@amazon.com> <20230920192729.694309-2-surajjs@amazon.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/28.2 (x86_64-pc-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: 82.132.232.12 X-SA-Exim-Rcpt-To: surajjs@amazon.com, stable@vger.kernel.org, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, catalin.marinas@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, sjitindarsingh@gmail.com, will@kernel.org, qperret@google.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 20 Sep 2023 20:27:29 +0100, Suraj Jitindar Singh wrote: > > From: Will Deacon > > commit 09cce60bddd6461a93a5bf434265a47827d1bc6f upstream. > > Since host stage-2 mappings are created lazily, we cannot rely solely on > the pte in order to recover the target physical address when checking a > host-initiated memory transition as this permits donation of unmapped > regions corresponding to MMIO or "no-map" memory. > > Instead of inspecting the pte, move the addr_is_allowed_memory() check > into the host callback function where it is passed the physical address > directly from the walker. > > Cc: Quentin Perret > Fixes: e82edcc75c4e ("KVM: arm64: Implement do_share() helper for sharing memory") > Signed-off-by: Will Deacon > Signed-off-by: Marc Zyngier > Link: https://lore.kernel.org/r/20230518095844.1178-1-will@kernel.org > [ bp: s/ctx->addr/addr in __check_page_state_visitor due to missing commit > "KVM: arm64: Combine visitor arguments into a context structure" > in stable. > ] Same question. > Signed-off-by: Suraj Jitindar Singh Again, I find this backport pretty pointless. What is the rationale for it? M. -- Without deviation from the norm, progress is not possible.