From patchwork Fri Oct 11 15:55:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 175995 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp958134ill; Fri, 11 Oct 2019 09:10:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqwg8+yn2HS3fcFF1r2xZn63dEircvZSyA9eQFboNd9/4i/gOtc/0/yFtE8b/Qb94MhLyym1 X-Received: by 2002:a05:6000:1251:: with SMTP id j17mr13668110wrx.198.1570810202437; Fri, 11 Oct 2019 09:10:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570810202; cv=none; d=google.com; s=arc-20160816; b=a9JI9PvWXxr8lpdm6JR2TlieR1F0aXGquVO1co6JaOM/vAQtbD4KmU5mufj8uoS+m5 W7qnoZoY8qTdCWKe3i6v9YBkOfpi22lfPf1aZPciW5DB6HSWQ/uiyJosyWUHgkKaaNdt dYofCUElCxhuoKA1uIrORCrVuBqEn5p7AtefcT5/nCORNPnXLdJufsUB4JbDiLdknAq+ 6KzM3xJffsGJdaVn29aoUoZzigU2nDgbc1TZj+0ZxScheyQZEdop+Lgb4M5LaBTll3OK jcJBlNY4RefvSDqMvBSN/j+7CNjuNLzfgfh3YRFgW6d2NczTf75csP2og0bCJsSORyRp vcXg== 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:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=nHlb3O+3OTrMLE5XtaApktPGFzFyl87vFrMc6HX9qtE=; b=Yn75wnXtthGsTZaMugF1SwrRSQsxNMHVHpIMd4vFk5L+TnsxcWgbRm5lhZGybGPCrU SDZvQGH9FQ4QWsjMS1BVu2PEQQ6qKpEYNkS5wXCVA5R3mGKI1eQ+vnu08zdUHLF1oUat wyuMabyu9gMU9u5quW2rIYPXRiYlsRnVkSdcGUeDVMwFpNrgGXenzlY+nYqTs9Y1Y1eF mpThjOAWoS50B9U1+BJFekwFA589Kz0+RGozitvxYiy/mC+UL2eoAE6VNEsHYRXaQHTQ kLZIRJkQruVRjoQma90x1rhNPFobsM6G4POpgrTpq8HK+WMqdqK953eAIynhKAPmjsU9 EgiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ZqCEYIpK; 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=fail (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 w55si5825015eda.15.2019.10.11.09.10.02 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Oct 2019 09:10:02 -0700 (PDT) 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=fail header.i=@linaro.org header.s=google header.b=ZqCEYIpK; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:53410 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIxUO-0001i6-Ul for patch@linaro.org; Fri, 11 Oct 2019 12:10:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33702) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIxGp-0002Pg-E5 for qemu-devel@nongnu.org; Fri, 11 Oct 2019 11:56:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIxGo-0007fp-Al for qemu-devel@nongnu.org; Fri, 11 Oct 2019 11:55:59 -0400 Received: from mail-yb1-xb44.google.com ([2607:f8b0:4864:20::b44]:38344) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iIxGo-0007fK-6o for qemu-devel@nongnu.org; Fri, 11 Oct 2019 11:55:58 -0400 Received: by mail-yb1-xb44.google.com with SMTP id r68so3254063ybf.5 for ; Fri, 11 Oct 2019 08:55:58 -0700 (PDT) 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; bh=nHlb3O+3OTrMLE5XtaApktPGFzFyl87vFrMc6HX9qtE=; b=ZqCEYIpKrjpd6xTcqoaQWD1C9Tkcc0sm9eGOxv1ubZPPqRcX+TOxubWYrzOSS9XNo5 dYZTK851BM3lcBvB27RqGY5nfhDTv5ifqGKlWJCv9QK6aP4hojRXQ0H7Q+Td/9Rqh2An 2F5ZYyMGCrVAdlUgkmk2KMvJL863w9y4bamf1jNqHQAVYelHZ2ibBVjreV1HetZ/bGft 6dhLJ0k9ioCkWRpJx7swTcFEO9WY0WGfMQUYBfbrgr3tBgK7kijrrzhsSyI6h90Tq6WU AjmX6+7tODP1rKJIjOhZjo7diaIgg42/kuTaqpbuu8+eeuhn4liFCtUx8QbNV+BQePVs soGw== 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; bh=nHlb3O+3OTrMLE5XtaApktPGFzFyl87vFrMc6HX9qtE=; b=ddR2wjN6ogK4DNwiafCJGxQzHEqRC3yqpAIpDYCoCqm6H0n3duRa1BUlZmKjFzzdnt 524ug4lkQxOOoymF1X5QAERjpXiyha1eF7aLEfEsNZLRaEcESAD0PmBQ1tdrLZK4uIaX CRYj6riiHB27qGSXvUbi4qSOaiOgXf1rR3T0wa+bPCWplWpH2hQ+txRZ4T8mrNTxQe9Z E7uU+C38eJwvKrIsJwVfJpWILNSswXArurx/pPGmFAIr4OyfspB3mBLJPG4D2H2ygA3v 0ymMwGM6WEre3her8DLCG6yN7Vvyw9uWGjAH9zVPDO4DK9szjta4UoiHiNqV+PcJ5gDn Qp1Q== X-Gm-Message-State: APjAAAXkLSXim1Dpvriizdf2iBma5pgoLTfd00NNLUxwUItXO57DPVMl YLyfwhUyQ+Ys5Z9oB69zNmPHnSgUIX0= X-Received: by 2002:a25:2644:: with SMTP id m65mr10846131ybm.462.1570809357334; Fri, 11 Oct 2019 08:55:57 -0700 (PDT) Received: from cloudburst.gateway.pace.com (67.216.151.25.pool.hargray.net. [67.216.151.25]) by smtp.gmail.com with ESMTPSA id d17sm2473139ywb.95.2019.10.11.08.55.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2019 08:55:56 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v6 08/20] target/arm: Split out rebuild_hflags_aprofile Date: Fri, 11 Oct 2019 11:55:34 -0400 Message-Id: <20191011155546.14342-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191011155546.14342-1-richard.henderson@linaro.org> References: <20191011155546.14342-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b44 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: laurent.desnogues@gmail.com, peter.maydell@linaro.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Create a function to compute the values of the TBFLAG_ANY bits that will be cached, and are used by A-profile. Signed-off-by: Richard Henderson --- target/arm/helper.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) -- 2.17.1 Reviewed-by: Alex Bennée diff --git a/target/arm/helper.c b/target/arm/helper.c index d1cd54cc93..ddd21edfcf 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -11106,18 +11106,28 @@ static uint32_t rebuild_hflags_m32(CPUARMState *env, int fp_el, return rebuild_hflags_common_32(env, fp_el, mmu_idx, flags); } +static uint32_t rebuild_hflags_aprofile(CPUARMState *env) +{ + int flags = 0; + + flags = FIELD_DP32(flags, TBFLAG_ANY, DEBUG_TARGET_EL, + arm_debug_target_el(env)); + return flags; +} + static uint32_t rebuild_hflags_a32(CPUARMState *env, int fp_el, ARMMMUIdx mmu_idx) { - return rebuild_hflags_common_32(env, fp_el, mmu_idx, 0); + uint32_t flags = rebuild_hflags_aprofile(env); + return rebuild_hflags_common_32(env, fp_el, mmu_idx, flags); } static uint32_t rebuild_hflags_a64(CPUARMState *env, int el, int fp_el, ARMMMUIdx mmu_idx) { + uint32_t flags = rebuild_hflags_aprofile(env); ARMMMUIdx stage1 = stage_1_mmu_idx(mmu_idx); ARMVAParameters p0 = aa64_va_parameters_both(env, 0, stage1); - uint32_t flags = 0; uint64_t sctlr; int tbii, tbid; @@ -11262,12 +11272,6 @@ void cpu_get_tb_cpu_state(CPUARMState *env, target_ulong *pc, } } - if (!arm_feature(env, ARM_FEATURE_M)) { - int target_el = arm_debug_target_el(env); - - flags = FIELD_DP32(flags, TBFLAG_ANY, DEBUG_TARGET_EL, target_el); - } - *pflags = flags; *cs_base = 0; }