From patchwork Fri Jan 22 09:50:42 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: 8088641 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 919919F440 for ; Fri, 22 Jan 2016 09:52:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E336A203B4 for ; Fri, 22 Jan 2016 09:52:30 +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 428EF203A9 for ; Fri, 22 Jan 2016 09:52:30 +0000 (UTC) Received: from localhost ([::1]:52132 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMYOL-0004qs-Ms for patchwork-qemu-devel@patchwork.kernel.org; Fri, 22 Jan 2016 04:52:29 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48734) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMYNB-0002ek-3Z for qemu-devel@nongnu.org; Fri, 22 Jan 2016 04:51:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMYN6-0005p6-AX for qemu-devel@nongnu.org; Fri, 22 Jan 2016 04:51:17 -0500 Received: from mail-ob0-x244.google.com ([2607:f8b0:4003:c01::244]:34620) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMYN6-0005p1-4i; Fri, 22 Jan 2016 04:51:12 -0500 Received: by mail-ob0-x244.google.com with SMTP id x5so4462671obg.1; Fri, 22 Jan 2016 01:51:11 -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 :mime-version:content-type:content-transfer-encoding; bh=lkkZwoiohk1VKkCrZqmOxg5W11Kg7LJZSFSQNsRtd4o=; b=uZHNljhY+Jv7+b4kW135TKBgdfwdzjHAz+nesfy+bURUxy5vAmfeRip0haLEHJeZMh 9pbsUncp+M3hsYwz2A/mouEt+ygAE7akPp2Gh9/4oTNbMMQeLom8pi09CY8OoOWNL9ZY u41KetL874jn4zC0vYkmnfyMJE/NVgDt3oDgVYe5LD+x5V5kxDlznX1bp0KV0zQ/s232 Qz+uNfwFTVyfUh+2gpVQW2MrkTNpj+k0cK+BP/MeuxH0T6oYZLhm7WlUK61cwpEJJ7Ob p6PFsMtMdl0qwInADQDPgE96iOCX7lil9BlD9TnDwHCGHjipqyZhZLWtMLKhSqjxy++n GtVg== 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:mime-version:content-type:content-transfer-encoding; bh=lkkZwoiohk1VKkCrZqmOxg5W11Kg7LJZSFSQNsRtd4o=; b=fSdzynFoJHom2xqXa1K6jw+6g9FcOfCc2+16eqM8fVZPMP4V7aCPnaxNInD8cMe1Bk 2PPPqdhZjW0kbKOTUHnj5gQnwff+ciFSMOq6QBCAHHjRDfRd/OqZ+0iEbPXUK+3W5cik NPNkQNBKgPJYf4sa7aihMyQoSoT5CqSxjiACzZyg9FgL7O1Of6oyZUtGc7a6E/zz+qKq Wa2inddIdh4awKUICu5QH6JoM03f9ZioDVLXFcvQ6vQXeC0twF5QkROy52CioWWXvKlX 5n8ofidphVG03co3mv9p4fs81Q21oDQ0LXGYF0Px0u5hAA4vuzLeQ/c7TChOus0h1+Ca BKYQ== X-Gm-Message-State: AG10YOTC4/ci7pR++kFbHzrW4V+HZ1FCWmmK0z7BaEwhwgfGYSa+1hzgZPezlG++2k5ygA== X-Received: by 10.182.97.164 with SMTP id eb4mr1535541obb.3.1453456271532; Fri, 22 Jan 2016 01:51:11 -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 qs6sm758172oeb.3.2016.01.22.01.51.10 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 22 Jan 2016 01:51:11 -0800 (PST) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Fri, 22 Jan 2016 10:50:42 +0100 Message-Id: <1453456243-19879-3-git-send-email-edgar.iglesias@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1453456243-19879-1-git-send-email-edgar.iglesias@gmail.com> References: <1453456243-19879-1-git-send-email-edgar.iglesias@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4003:c01::244 Cc: edgar.iglesias@xilinx.com, qemu-arm@nongnu.org, alex.bennee@linaro.org Subject: [Qemu-devel] [PATCH v3 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. Reviewed-by: Alex Bennée Signed-off-by: Edgar E. Iglesias --- target-arm/helper.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/target-arm/helper.c b/target-arm/helper.c index 8aedce9..2a6fa94 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -6575,11 +6575,13 @@ typedef enum { * @startlevel: Suggested starting level * @inputsize: Bitsize of IPAs * @stride: Page-table stride (See the ARM ARM) + * @pamax: Implementation defined bit-width of physical addresses * * 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 +6597,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 +6808,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 +6821,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.