From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48753) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aNgia-0004Mt-0z for qemu-devel@nongnu.org; Mon, 25 Jan 2016 07:58:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aNgiX-0001Gq-SV for qemu-devel@nongnu.org; Mon, 25 Jan 2016 07:58:02 -0500 Received: from mail-vk0-x22f.google.com ([2607:f8b0:400c:c05::22f]:33312) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aNgiX-0001Gd-N7 for qemu-devel@nongnu.org; Mon, 25 Jan 2016 07:58:01 -0500 Received: by mail-vk0-x22f.google.com with SMTP id e64so73784612vkg.0 for ; Mon, 25 Jan 2016 04:58:01 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1453456243-19879-4-git-send-email-edgar.iglesias@gmail.com> References: <1453456243-19879-1-git-send-email-edgar.iglesias@gmail.com> <1453456243-19879-4-git-send-email-edgar.iglesias@gmail.com> From: Peter Maydell Date: Mon, 25 Jan 2016 12:57:41 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v3 3/3] target-arm: Implement the S2 MMU inputsize > pamax check List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Edgar E. Iglesias" Cc: Edgar Iglesias , qemu-arm , =?UTF-8?B?QWxleCBCZW5uw6ll?= , QEMU Developers On 22 January 2016 at 09:50, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" > > Implement the inputsize > pamax check for Stage 2 translations. > We have multiple choices for how to respond to errors and > choose to fault. > > Signed-off-by: Edgar E. Iglesias > --- > target-arm/helper.c | 16 ++++++++++++---- > 1 file changed, 12 insertions(+), 4 deletions(-) > > diff --git a/target-arm/helper.c b/target-arm/helper.c > index 2a6fa94..8901762 100644 > --- a/target-arm/helper.c > +++ b/target-arm/helper.c > @@ -6809,7 +6809,7 @@ static bool get_phys_addr_lpae(CPUARMState *env, target_ulong address, > */ > int startlevel = extract32(tcr->raw_tcr, 6, 2); > unsigned int pamax = arm_pamax(cpu); > - bool ok; > + bool ok = true; > > if (va_size == 32 || stride == 9) { > /* AArch32 or 4KB pages */ > @@ -6819,9 +6819,17 @@ static bool get_phys_addr_lpae(CPUARMState *env, target_ulong address, > level = 3 - startlevel; > } > > - /* Check that the starting level is valid. */ > - ok = check_s2_startlevel(cpu, va_size == 64, level, > - inputsize, stride, pamax); > + if (va_size == 64 && > + inputsize > pamax && > + (arm_el_is_aa64(env, 1) || inputsize > 40)) { > + /* We have multiple choices but choose to fault. */ Can we say specifically "This is CONSTRAINED UNPREDICTABLE and we choose...", please? thanks -- PMM