From patchwork Thu Jan 21 11:18:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 8080181 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B006B9F1CC for ; Thu, 21 Jan 2016 11:21:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 099302053A for ; Thu, 21 Jan 2016 11:21:18 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5B1502045E for ; Thu, 21 Jan 2016 11:21:17 +0000 (UTC) Received: from localhost ([::1]:47015 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMDIi-00048a-Og for patchwork-qemu-devel@patchwork.kernel.org; Thu, 21 Jan 2016 06:21:16 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54440) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMDGb-0001Iq-Sd for qemu-devel@nongnu.org; Thu, 21 Jan 2016 06:19:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMDGb-0007ar-0c for qemu-devel@nongnu.org; Thu, 21 Jan 2016 06:19:05 -0500 Received: from mail-oi0-x244.google.com ([2607:f8b0:4003:c06::244]:35955) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMDGa-0007an-RY; Thu, 21 Jan 2016 06:19:04 -0500 Received: by mail-oi0-x244.google.com with SMTP id a202so1908336oib.3; Thu, 21 Jan 2016 03:19:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=akYwq4Hd9NYVc5b1BM9GUU2CnQbxQcmXyCX3hIWns0k=; b=RrBAFH5woZnqxQusClOuTP8OP8lsWvj5xW/TIiKuqBPDpQp3n2Z5zH5gPG2mlXoPKg ytfdoHoYo4HBXyJkyyMyppdBNXoteCW3pKJhh59t4oJnlL9VuEgJtUOoBnaqssAaCdxB jWK5uHzK+BcP6pv9XYSXLvTH7VPP8wYdzBBZFwadxabfmFbqNOZiOnYNR8GeouFRpIlC /r6Lpx7nhzmP2BILYV7ZvMZwcKdcKL7ZhHBr2EO/bgYRpUjBgH1W0ZVdleOFBEHQysRJ EyBRFJ6UTdmdgNaj70CHHEljNho/0ih7z2wwo6A0udldEl5YXRrETX0bl3/Q++BGe09L EOaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=akYwq4Hd9NYVc5b1BM9GUU2CnQbxQcmXyCX3hIWns0k=; b=dlCU1C+QMQ2GmCaEJgQDTzv8IwC3JYGC2XhkSJ4uElVuY3ou/tGaFOFyaLhqaks0Aj e+rCk0iUTsgWYqUIyqXIsRAskrngOsp45gnlp0MuSf7huuO6YTEJGXjtLPgFeVrIdkKk V+Nf4jWWopTPxIUijCVPSxWuXzX5xHP630dlHHsdgugC/85bYy/eCfDq7I+UVE5lEwAz KJuqHao6sutUg9sIrRGrOrZoihcVFFY+r18FpyQClgANj1xXzc1mHgV23Qv44c0zwqu5 5/lAWhZJlTtUwD8IYkqPmcf7EVS9nDba4pBLuGP6BUe03USaHK+BhVu1NYwO+PUp8fnf usBA== X-Gm-Message-State: ALoCoQl7Sn4PHMrrNa7kjQfKKGKjV3kYmy5ZbwwlJla5h61lCf6TTmfhHrULIORD2Abpt/vZS91t4/U1gVFidmU/Hr4wg0hCng== X-Received: by 10.202.60.135 with SMTP id j129mr30544702oia.70.1453375144302; Thu, 21 Jan 2016 03:19:04 -0800 (PST) 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 kg7sm305558obb.27.2016.01.21.03.19.03 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 21 Jan 2016 03:19:03 -0800 (PST) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Thu, 21 Jan 2016 12:18:27 +0100 Message-Id: <1453375108-25229-3-git-send-email-edgar.iglesias@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1453375108-25229-1-git-send-email-edgar.iglesias@gmail.com> References: <1453375108-25229-1-git-send-email-edgar.iglesias@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4003:c06::244 Cc: edgar.iglesias@xilinx.com, qemu-arm@nongnu.org, alex.bennee@linaro.org Subject: [Qemu-devel] [PATCH v2 2/3] target-arm: Make pamax an argument to check_s2_startlevel X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Alex Bennée --- 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) { 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.