From patchwork Sun Feb 16 19:43:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183564 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp4181450ile; Sun, 16 Feb 2020 11:49:19 -0800 (PST) X-Google-Smtp-Source: APXvYqyOsrqD6IuKxUhyo8jnQAljFoZ6ruHzBMeapjYitzyD7IOIWMy2Os3KaS5ivROgvcYhoK0I X-Received: by 2002:ae9:e841:: with SMTP id a62mr8828538qkg.384.1581882559121; Sun, 16 Feb 2020 11:49:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581882559; cv=none; d=google.com; s=arc-20160816; b=LUite6IKq6+ZM3lwAOYdfsVHzf2jOlydF8qBk+RM64m8J7qSzkgyiv0MkqHCKMCL/4 P5ZepeeJ5yNpyKXW087XmlXtCL78bTqHSpioK3Z3yPEfSddQTLtZHFce+Hnh/1SpZLAF bQnpGd91hke+QIaUUiVBthI32lYaDA77qLxVBU/s9WZzRm733Qun/rKHXkd7EsKf+vDF T5sLila2lmSR3bDLDEqFcaLsJ6hDqRXmEgVx7riHbRwuL6NzTHWRsBNENMn5kyoQu+Di Df846ZrA4p4DlBvR2Wanmm1hZDltyBtp1Eo7T4b2VDIp73NC+qr7aFISjbfo7RAIIbuA 3mIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Qe8zug4Z0mtaHwBh2av/LIOpMaLY4DsO8Azuq2pRmxw=; b=Hi0FUSltqBMUJ40RGDBTkrQt5pCaRWa+WBu+bBJEuF2aK8vtIIuXf6AdNIsXCiUcVI Le9BTuxY35hgffC3ah5oK8PyPx2s6lejASwGnoZLo6XRhOJUUmmkO9z/DXz+2g4Y7TzC 7/rIBY/CGpWNQxjkWYg7yFH/a6w22jN/c07L0dXPv2VMMPMVdiMnHVZmio6yys11zr7L bClGZAhb8pUPKJKyZPfybfYop26Y98s/1kwkA6IwQpPlfRiGO6sYgAQqOUdVGuMWSaWC uxFhOkuNAmKNMKSX9HsfIFFNQbKmn4pNXGdm5DZ/QhbqMV0aYY2rFcwY7gAxgYn9JpT6 IDfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qcYh2Upb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m19si5560227qvt.65.2020.02.16.11.49.19 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 16 Feb 2020 11:49:19 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qcYh2Upb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35840 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j3Puo-0001yr-Mj for patch@linaro.org; Sun, 16 Feb 2020 14:49:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34731) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j3PpX-0003fG-H4 for qemu-devel@nongnu.org; Sun, 16 Feb 2020 14:43:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j3PpV-0005Yf-Fg for qemu-devel@nongnu.org; Sun, 16 Feb 2020 14:43:51 -0500 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:46027) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j3PpV-0005XT-9q for qemu-devel@nongnu.org; Sun, 16 Feb 2020 14:43:49 -0500 Received: by mail-pf1-x443.google.com with SMTP id 2so7689141pfg.12 for ; Sun, 16 Feb 2020 11:43:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Qe8zug4Z0mtaHwBh2av/LIOpMaLY4DsO8Azuq2pRmxw=; b=qcYh2Upbxze5Ns3eU6RcXNvldmM2IdObrKSayDRs42WJ4QhBY+tNoZzRnE0ShCA9au FuxvVT8L3GGw3BHXuH9MaPfYJkIRHApyxdtZrPaUXI95KDFDeDTd+zbepnxVZDewi7/6 bqxEvwv64iz7jtJky+XhVEvq+xJijWMIF1tBvLGHjzT/Q6k4D5N/ZK86Wc2tlyOyACET zyFwBQdbPEhle0mWN/pbKCPEujmhLKgI85CX3vq6S0huDw4H8IEVLuroWqUXoz7zh5mr TDqAKxJX/4ksRhpVje4FNCtw7YFjlHwfe53u/zTyaucxd5wcQMhDCM5lQAUNt3cUluaQ CKeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Qe8zug4Z0mtaHwBh2av/LIOpMaLY4DsO8Azuq2pRmxw=; b=pJqMzriT+nSOIxxpFNRUpbjcjqjUEIHjonkxeRiTTHL9TJSwvy7ghIK6JIKbZdrqbw P3Gey60CjfRLEw52tgTHhSLDPNQKdDjhoHmtiSEYsl0ahLXNl4StKUWyhazxR9tDuYxU Gri5Tac+DmxN746g/0qV8X5gNKqH1MjRjvykrfp0KVnSAfP/dtm7f29K8gzouqhDtSXh YKltYEI8J18r+FJWnuXTgcPsBxPjhg1PXdZkolleTgK6u1lQcG+o23qP4FvvUoUcch32 JuuaFQRZb3a87xdSoSl0yB6sojsvd2AtUHpCI6gANOfjIilM7/9H3OOzm3ZnP8/+I/bY NGEA== X-Gm-Message-State: APjAAAUm5iS6FDjCXnC2Su8u4VdZDz/BJF42Ge0A6ftcVXPMKsmovevb QagUsPq4DZTdV0j4QRhPl37UiK/0MPo= X-Received: by 2002:a63:9143:: with SMTP id l64mr8829773pge.435.1581882227941; Sun, 16 Feb 2020 11:43:47 -0800 (PST) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id y127sm13945188pfg.22.2020.02.16.11.43.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Feb 2020 11:43:47 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 2/4] target/arm: Fix select for aa64_va_parameters_both Date: Sun, 16 Feb 2020 11:43:41 -0800 Message-Id: <20200216194343.21331-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200216194343.21331-1-richard.henderson@linaro.org> References: <20200216194343.21331-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::443 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Select should always be 0 for a regime with one range. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/helper.c | 46 +++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) -- 2.20.1 diff --git a/target/arm/helper.c b/target/arm/helper.c index 366dbcf460..b09a501284 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -10241,13 +10241,8 @@ ARMVAParameters aa64_va_parameters_both(CPUARMState *env, uint64_t va, bool tbi, tbid, epd, hpd, using16k, using64k; int select, tsz; - /* - * Bit 55 is always between the two regions, and is canonical for - * determining if address tagging is enabled. - */ - select = extract64(va, 55, 1); - if (!regime_has_2_ranges(mmu_idx)) { + select = 0; tsz = extract32(tcr, 0, 6); using64k = extract32(tcr, 14, 1); using16k = extract32(tcr, 15, 1); @@ -10260,23 +10255,30 @@ ARMVAParameters aa64_va_parameters_both(CPUARMState *env, uint64_t va, tbid = extract32(tcr, 29, 1); } epd = false; - } else if (!select) { - tsz = extract32(tcr, 0, 6); - epd = extract32(tcr, 7, 1); - using64k = extract32(tcr, 14, 1); - using16k = extract32(tcr, 15, 1); - tbi = extract64(tcr, 37, 1); - hpd = extract64(tcr, 41, 1); - tbid = extract64(tcr, 51, 1); } else { - int tg = extract32(tcr, 30, 2); - using16k = tg == 1; - using64k = tg == 3; - tsz = extract32(tcr, 16, 6); - epd = extract32(tcr, 23, 1); - tbi = extract64(tcr, 38, 1); - hpd = extract64(tcr, 42, 1); - tbid = extract64(tcr, 52, 1); + /* + * Bit 55 is always between the two regions, and is canonical for + * determining if address tagging is enabled. + */ + select = extract64(va, 55, 1); + if (!select) { + tsz = extract32(tcr, 0, 6); + epd = extract32(tcr, 7, 1); + using64k = extract32(tcr, 14, 1); + using16k = extract32(tcr, 15, 1); + tbi = extract64(tcr, 37, 1); + hpd = extract64(tcr, 41, 1); + tbid = extract64(tcr, 51, 1); + } else { + int tg = extract32(tcr, 30, 2); + using16k = tg == 1; + using64k = tg == 3; + tsz = extract32(tcr, 16, 6); + epd = extract32(tcr, 23, 1); + tbi = extract64(tcr, 38, 1); + hpd = extract64(tcr, 42, 1); + tbid = extract64(tcr, 52, 1); + } } tsz = MIN(tsz, 39); /* TODO: ARMv8.4-TTST */ tsz = MAX(tsz, 16); /* TODO: ARMv8.2-LVA */