From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40315) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMEKG-00047e-25 for qemu-devel@nongnu.org; Thu, 21 Jan 2016 07:26:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMEKB-0006ex-Lp for qemu-devel@nongnu.org; Thu, 21 Jan 2016 07:26:55 -0500 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]:33369) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMEKB-0006em-FM for qemu-devel@nongnu.org; Thu, 21 Jan 2016 07:26:51 -0500 Received: by mail-wm0-x235.google.com with SMTP id 123so171989123wmz.0 for ; Thu, 21 Jan 2016 04:26:50 -0800 (PST) References: <1453297780-12514-1-git-send-email-edgar.iglesias@gmail.com> <1453297780-12514-3-git-send-email-edgar.iglesias@gmail.com> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <1453297780-12514-3-git-send-email-edgar.iglesias@gmail.com> Date: Thu, 21 Jan 2016 12:26:47 +0000 Message-ID: <878u3jce48.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v1 2/3] target-arm: Make pamax an argument to check_s2_startlevel List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Edgar E. Iglesias" Cc: edgar.iglesias@xilinx.com, peter.maydell@linaro.org, qemu-arm@nongnu.org, qemu-devel@nongnu.org Edgar E. Iglesias writes: > From: "Edgar E. Iglesias" > > Make pamax an argument to check_s2_startlevel in preparation > for future reuse. > > No functional change. > > Signed-off-by: Edgar E. Iglesias > --- > target-arm/helper.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/target-arm/helper.c b/target-arm/helper.c > index 8aedce9..4abeb4d 100644 > --- a/target-arm/helper.c > +++ b/target-arm/helper.c > @@ -6579,7 +6579,8 @@ typedef enum { > * Returns true if the suggested starting level is OK and false otherwise. > */ > static bool check_s2_startlevel(ARMCPU *cpu, bool is_aa64, int level, > - int inputsize, int stride) > + int inputsize, int stride, > + unsigned int pamax) I'm not convinced about this as we only use pamax in one leg and we can get it via *cpu when needed. If it will eventually be used you would also have to update the docstring above. > { > const int grainsize = stride + 3; > int startsizecheck; > @@ -6595,8 +6596,6 @@ static bool check_s2_startlevel(ARMCPU *cpu, bool is_aa64, int level, > } > > if (is_aa64) { > - unsigned int pamax = arm_pamax(cpu); > - > switch (stride) { > case 13: /* 64KB Pages. */ > if (level == 0 || (level == 1 && pamax <= 42)) { > @@ -6808,6 +6807,7 @@ static bool get_phys_addr_lpae(CPUARMState *env, target_ulong address, > * VTCR_EL2.SL0 field (whose interpretation depends on the page size) > */ > int startlevel = extract32(tcr->raw_tcr, 6, 2); > + unsigned int pamax = arm_pamax(cpu); > bool ok; > > if (va_size == 32 || stride == 9) { > @@ -6820,7 +6820,7 @@ static bool get_phys_addr_lpae(CPUARMState *env, target_ulong address, > > /* Check that the starting level is valid. */ > ok = check_s2_startlevel(cpu, va_size == 64, level, > - inputsize, stride); > + inputsize, stride, pamax); > if (!ok) { > /* AArch64 reports these as level 0 faults. > * AArch32 reports these as level 1 faults. -- Alex Bennée