From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.25.159.19 with SMTP id i19csp3813814lfe; Thu, 21 Jan 2016 08:07:32 -0800 (PST) X-Received: by 10.182.98.227 with SMTP id el3mr32401358obb.8.1453392452772; Thu, 21 Jan 2016 08:07:32 -0800 (PST) Return-Path: Received: from mail-oi0-x242.google.com (mail-oi0-x242.google.com. [2607:f8b0:4003:c06::242]) by mx.google.com with ESMTPS id zr6si1851671obc.60.2016.01.21.08.07.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Jan 2016 08:07:32 -0800 (PST) Received-SPF: pass (google.com: domain of edgar.iglesias@gmail.com designates 2607:f8b0:4003:c06::242 as permitted sender) client-ip=2607:f8b0:4003:c06::242; Authentication-Results: mx.google.com; spf=pass (google.com: domain of edgar.iglesias@gmail.com designates 2607:f8b0:4003:c06::242 as permitted sender) smtp.mailfrom=edgar.iglesias@gmail.com; dkim=pass header.i=@gmail.com; dmarc=pass (p=NONE dis=NONE) header.from=gmail.com Received: by mail-oi0-x242.google.com with SMTP id a202so2326947oib.3; Thu, 21 Jan 2016 08:07:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=qjU0/7UTJBNk5Tu2e2o4wSpAw7JrJBO59QfsuYqKOdU=; b=oMcRWlhkB2suojq8eGNVpENsgh1qF3AU3T18B1NadMezmIrARAf11LHnA8lTB+UvKZ /EOU6JTT2wmbJGINTq7FpuzG5wJCfeOL7NI2LjrsjpC3xQmxAr806r2PDIFxjdEf4EwQ MDSyvCeTGMeNLKPWCY0xznOauZqUUf8hMRBgOSHukY4P6ygwGu7OcjDa0dGh1+ZUxzWd kY1IUXbg+3fuE0tEJSAo4NSWOgbZJmgIkVj31JnfotxZrJDuxuL6Yha+w3zHjMvgMpQJ t+l4eOw3CWClNT38MWuKjvb/utNyry3wGNOMvnndBDFunqOudc8SKAXmJVV+FXfBu8HX DZhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=qjU0/7UTJBNk5Tu2e2o4wSpAw7JrJBO59QfsuYqKOdU=; b=GP2MysdJc0R+Xx+bhiKPmo8IMSqRexATAMbAb5RZDUafdvKCZG55lXHYslBVtHPgIB b/oRqqmhEpb+IKE5xTqrJ6my5SKohWaqfTpvG9gv8OlwVOoPioxTL45ap8mVW8p+oaAv xS7f3PyGZSKe1mNma3U1nhnNLgEF/Fcl6rJl431seZCYxYgyCURRMp7p2W1u9bvJy94G leIq3zZ8gHqvlKbhnQdb67lsVsn00chb49Px1PEAXtvhmS4is1raLYdsiNqYGAd6PqvK sTGGOmXuUQNfm0AQS8zmLOiKAkHiDRkwYiFltVL+KmcW7qLXeKRhAIEvg9remYjwzriG X5nw== X-Gm-Message-State: ALoCoQnm/FpTO67p+fc5sikkIsGMYz66oTVxVDi11wxVzcmzwa1BIHmhT+Cam9JDTqavyLL2WWuWsDoxSPCYWkVL5i1EasGnAg== X-Received: by 10.202.75.129 with SMTP id y123mr29312727oia.110.1453392452293; Thu, 21 Jan 2016 08:07:32 -0800 (PST) Return-Path: Received: from localhost (ec2-52-8-89-49.us-west-1.compute.amazonaws.com. [52.8.89.49]) by smtp.gmail.com with ESMTPSA id mj8sm818091obc.25.2016.01.21.08.07.30 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 21 Jan 2016 08:07:31 -0800 (PST) Date: Thu, 21 Jan 2016 17:07:07 +0100 From: "Edgar E. Iglesias" To: Alex =?iso-8859-1?Q?Benn=E9e?= Cc: qemu-devel@nongnu.org, peter.maydell@linaro.org, qemu-arm@nongnu.org, edgar.iglesias@xilinx.com Subject: Re: [PATCH v2 2/3] target-arm: Make pamax an argument to check_s2_startlevel Message-ID: <20160121160707.GC25287@toto> References: <1453375108-25229-1-git-send-email-edgar.iglesias@gmail.com> <1453375108-25229-3-git-send-email-edgar.iglesias@gmail.com> <8760ync4hd.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8760ync4hd.fsf@linaro.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-TUID: hm+P1ju9IOe3 On Thu, Jan 21, 2016 at 03:54:54PM +0000, Alex Bennée wrote: > > 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) > > { > > If you fix the docstring above you can have my: > > Reviewed-by: Alex Bennée I've fixed the comment for v3. Thanks, Edgar > > > > 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34064) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMHlp-0005MB-Nv for qemu-devel@nongnu.org; Thu, 21 Jan 2016 11:07:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMHlk-0004Ca-Si for qemu-devel@nongnu.org; Thu, 21 Jan 2016 11:07:37 -0500 Date: Thu, 21 Jan 2016 17:07:07 +0100 From: "Edgar E. Iglesias" Message-ID: <20160121160707.GC25287@toto> References: <1453375108-25229-1-git-send-email-edgar.iglesias@gmail.com> <1453375108-25229-3-git-send-email-edgar.iglesias@gmail.com> <8760ync4hd.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8760ync4hd.fsf@linaro.org> Subject: Re: [Qemu-devel] [PATCH v2 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: Alex =?iso-8859-1?Q?Benn=E9e?= Cc: edgar.iglesias@xilinx.com, peter.maydell@linaro.org, qemu-arm@nongnu.org, qemu-devel@nongnu.org On Thu, Jan 21, 2016 at 03:54:54PM +0000, Alex Bennée wrote: > > 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) > > { > > If you fix the docstring above you can have my: > > Reviewed-by: Alex Bennée I've fixed the comment for v3. Thanks, Edgar > > > > 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