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 X-Spam-Level: X-Spam-Status: No, score=-15.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA604C433E0 for ; Thu, 4 Mar 2021 01:35:29 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 6CBCA651AA for ; Thu, 4 Mar 2021 01:35:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6CBCA651AA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=HDHakq5By94zHX+ts/ssiKI/bPqrSdgbTcKCuQwPVl0=; b=Bz/KA8OrYjmdS2GKIsLcunUsx cG03VmU0sYpa6OzseULaM/ecNKN+mydLj/szoMsSAu0p2spNGRWyfJQLtqqYhP+EhGoDJFQhdtX+/ nuq1uBILCi+Y1Do2q34s/W57rLiX+YkJA4GVmL3FU9KvpKLcn+LyzObnys60Yq/CMWGSlFeUjEfuw /H42ofWtKvIrHHC7dI0wRnSnjVlTtlF/GCf6Tm/0wmB+Yn6qpbm4oZppMioHnkxZf8/7uvHKMQf/E +nyJ0YoSjfS5KeS5ZYgdNggSjb4aeUg1/SENmjNsMVWaVyit9scbo2ScviR2x4bqm/2qajz0KDez1 2htMYAs2w==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lHcr9-007L7t-AP; Thu, 04 Mar 2021 01:32:47 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lHYoK-006YhT-1a for linux-arm-kernel@lists.infradead.org; Wed, 03 Mar 2021 21:13:44 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id D1E2E64EC4; Wed, 3 Mar 2021 21:13:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614806011; bh=La069RJVv7lSY65LoO9v4vrFVi06mMCWoGSs5E3bs80=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ChLlPyKWb/dzGDPuABC1x/e5vhIYdLeTFGQHCU75XumX71T2cxBhQEizAyGm5ILbm OnH9//VdNR4ieq71aPR0gWq9xb0G3ZBbVggXbZofYmjYpoMNmOI8IJ0ntQr2dYgLBZ +lIIDL2g/ErngnPuC2K9axtXikrtjiaf3WOov/Z7CVUxWeX/eWOjS9BbUlqA+akLsq ZkaUQGyFfOM7Ci7sFgOLIflfcwAi3BH2ksW5Ll34EfE9d3INdakvVlGPjIisiXUFWJ PdoSNU3rotHuwS+YPkG/wSdwQZRsQ1/ETLAau5/hmNkPeKL/DX/8DYdr8o9e3W/ub+ KsUcvRP1waJdg== Date: Wed, 3 Mar 2021 21:13:26 +0000 From: Will Deacon To: Marc Zyngier Cc: Jia He , kvmarm@lists.cs.columbia.edu, James Morse , Julien Thierry , Suzuki K Poulose , Catalin Marinas , Gavin Shan , Yanan Wang , Quentin Perret , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] KVM: arm64: Fix unaligned addr case in mmu walking Message-ID: <20210303211325.GA20055@willie-the-truck> References: <20210303024225.2591-1-justin.he@arm.com> <20210303112934.GA18452@willie-the-truck> <87mtvkys1y.wl-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87mtvkys1y.wl-maz@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Mar 03, 2021 at 07:07:37PM +0000, Marc Zyngier wrote: > From e0524b41a71e0f17d6dc8f197e421e677d584e72 Mon Sep 17 00:00:00 2001 > From: Jia He > Date: Wed, 3 Mar 2021 10:42:25 +0800 > Subject: [PATCH] KVM: arm64: Fix range alignment when walking page tables > > When walking the page tables at a given level, and if the start > address for the range isn't aligned for that level, we propagate > the misalignment on each iteration at that level. > > This results in the walker ignoring a number of entries (depending > on the original misalignment) on each subsequent iteration. > > Properly aligning the address at the before the next iteration "at the before the next" ??? > addresses the issue. > > Cc: stable@vger.kernel.org > Reported-by: Howard Zhang > Signed-off-by: Jia He > Fixes: b1e57de62cfb ("KVM: arm64: Add stand-alone page-table walker infrastructure") > [maz: rewrite commit message] > Signed-off-by: Marc Zyngier > Link: https://lore.kernel.org/r/20210303024225.2591-1-justin.he@arm.com > --- > arch/arm64/kvm/hyp/pgtable.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c > index 4d177ce1d536..124cd2f93020 100644 > --- a/arch/arm64/kvm/hyp/pgtable.c > +++ b/arch/arm64/kvm/hyp/pgtable.c > @@ -223,7 +223,7 @@ static inline int __kvm_pgtable_visit(struct kvm_pgtable_walk_data *data, > goto out; > > if (!table) { > - data->addr += kvm_granule_size(level); > + data->addr = ALIGN(data->addr, kvm_granule_size(level)); > goto out; > } If Jia is happy with it, please feel free to add: Acked-by: Will Deacon Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel