Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp256072pxb; Fri, 15 Jan 2021 02:25:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJw27dwigeGEgybe8wMq85uEEpZHDhsbYBx82HB64gkdGnhhTfLxlv/CeCHi264jc2o3BGXM X-Received: by 2002:a17:906:17c3:: with SMTP id u3mr8050400eje.304.1610706335287; Fri, 15 Jan 2021 02:25:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610706335; cv=none; d=google.com; s=arc-20160816; b=CxZdJbOOHU6KizLz2t77I9IfhZx94xO9G3A3175jXuix0UHiPk8YHfF9UAeFbNmEjO ykZD1sEq5aZYDWRMvo92jABYqNm5+H3AZu9Ww73wweXOQCsmKtgID9NnaeixsAV/1GvP LLXI9UjjKnjEqGD07vdjFhhDLvOl1MYgu+Nzj75KR7/SxeVnhNGJ64KyTb+CEFpXXOPt G2ZVbI+gO12f6/8qIZJkYyYHxurp+eBLgTmID5+J+dYiQLJDfsu1ryw5C1ct2Wz6wYDL IQcVXrvbLPej8RQJ+0AMZkFMMkZKFsVI1RG/f4+y2KBVF+JM6gdb6IS4IV0MebgXl7tb N8EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=H1FRRf4KMZPONHb9KOCSZXVfjT2ppZgzphEYD5USnjQ=; b=XzZsL2MI/U40UP4g11VqBNmJSMROxeDf//BDEq60/yDt5Kn/EuJJaV728KbkXhgBZk 3GW9fWH/rqF10/YzAeZLuBmfXLNH41K3r6DPJhQXkX9yLphYAbLT7V98EKtvQeQZPtAo JH7TzB7hHrN3YvjUKHEq2a7Az6hYMUNlDC9novGHgbvsuBv2N2GuL+g1aXhwWmzo9tyq 89YP1zcCdRFGCdUcFIYuQeRv0BpwqkT9cg9hMXJSC4flsQYKND7gvKB6puqs4dcUFLmS 07atIgmRvHMh693IAuMZvqseB58n2rEVCq1gTSZUBOK1bdQp8TUQW9An1B82skCT65xx acZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GQwIacPm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g25si3569014ejp.67.2021.01.15.02.25.11; Fri, 15 Jan 2021 02:25:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GQwIacPm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726652AbhAOKYX (ORCPT + 99 others); Fri, 15 Jan 2021 05:24:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:57894 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726091AbhAOKYW (ORCPT ); Fri, 15 Jan 2021 05:24:22 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 621BE235F9; Fri, 15 Jan 2021 10:23:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610706221; bh=c/+XqWLmQTEyndmY4XhHmEat6eBL2W+LzNHlJg1xGlc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GQwIacPmjs/aOm4bQ1rFpzSRDHy739OTYVDLZinf3vIbt7XaORjK14OSbDSdGh6Ij 7DOaM4QxtaG0JZsU18PjC4KvQa6bGICy8UpXQw29+cxhdYimqTY9stfbshm+JhT/cf O821VSuzWQTvjgPq0kr+fXNYeQ1z207Ns8XMzOb7LQpsEu+vFr1+8V8TLI0u9i7PFs Z5bY3BeoxFG57wfFcqto6uPrpKzc3NlFGlVWKMEO+wX9/J5iLo2exKI16IJ1DGDZdB 3c4P0oFfKYtWfyHSPqCxayXwV4nWDUlKHeBadwhZArU4E9Q7ZPhnmoyQNBaIjUW+aX q5yeMNOO4fmBw== Date: Fri, 15 Jan 2021 10:23:35 +0000 From: Will Deacon To: Keqian Zhu Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, Marc Zyngier , Catalin Marinas , Mark Rutland , James Morse , Robin Murphy , Joerg Roedel , Daniel Lezcano , Thomas Gleixner , Suzuki K Poulose , Julien Thierry , Andrew Morton , Alexios Zavras , wanghaibin.wang@huawei.com, jiangkunkun@huawei.com Subject: Re: [PATCH] kvm: arm64: Properly align the end address of table walk Message-ID: <20210115102334.GA14167@willie-the-truck> References: <20210115095307.12912-1-zhukeqian1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210115095307.12912-1-zhukeqian1@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 15, 2021 at 05:53:07PM +0800, Keqian Zhu wrote: > When align the end address, ought to use its original value. > > Fixes: b1e57de62cfb ("KVM: arm64: Add stand-alone page-table walker infrastructure") > Signed-off-by: Keqian Zhu > --- > 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 bdf8e55ed308..670b0ef12440 100644 > --- a/arch/arm64/kvm/hyp/pgtable.c > +++ b/arch/arm64/kvm/hyp/pgtable.c > @@ -296,7 +296,7 @@ int kvm_pgtable_walk(struct kvm_pgtable *pgt, u64 addr, u64 size, > struct kvm_pgtable_walk_data walk_data = { > .pgt = pgt, > .addr = ALIGN_DOWN(addr, PAGE_SIZE), > - .end = PAGE_ALIGN(walk_data.addr + size), > + .end = PAGE_ALIGN(addr + size), > .walker = walker, Hmm, this is a change in behaviour, no (consider the case where both 'addr' and 'size' are misaligned)? The current code is consistent with the kerneldoc in asm/kvm_pgtable.h, so I don't see the motivation to change it. Did you hit a bug somewhere? Will