From patchwork Thu Oct 24 16:26:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 177539 Delivered-To: patch@linaro.org Received: by 2002:ac9:3c86:0:0:0:0:0 with SMTP id w6csp2398659ocf; Thu, 24 Oct 2019 09:37:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqwRKDPCFcsm/R6Mm03YpsfazfjJkumCIHbsi1/Esbs0D5IHzW/TwrdX+EYFmRWLWBoOm2DF X-Received: by 2002:a17:906:70c7:: with SMTP id g7mr39510223ejk.9.1571935065047; Thu, 24 Oct 2019 09:37:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571935065; cv=none; d=google.com; s=arc-20160816; b=PbYd5Y2oiEO4lpFbf9knUFY3ERULuWFixiSFWep5dP4z9G4FOLOFrwMC/gwAP5KQxN vC51Aed/u6HP5bMexvsi3PyBJoYdNmqt5Qj8qbA7yT+H48A7NOViNtjhw3INQ4XplLRz lSuWTDj8ug1sXoWuac188iVr/ljwhQf4T6uOh1REQh+iKUHibpSQGQISukdrM/QQ2C4a idIeTVvWGqQ02oZFyWLI3CjG+Ccv/UZiPkOXIudptpeebgyhRLOSmQGLEhfOaH9gv6DD 6PYzwdZxCmFQ4I7Gc75QdnII6CjIRC2KmKDWCtqUgFyazu8xASfaCV5wOazurMyhBTj0 XXJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=HhJomiYWFoyGiQnBnfLm1DrjhXgk0FPd/bxO+44fxEo=; b=ehIqyJv0NKYWSxBt4DC85CbAVRVryXybi7kXQLcXQBf2Ndw98Ud3YAt6xL4LiGKn9N aK4S2zNPB5N2vQj73yjqG72TIqNIoajumZ/iCLNrxIVS1n2UAJyrcto0OIW210+uu74J yWZjnGYEBQFbpVyh36yJvHeGcUAIKRlJ9JQ2JHcYvkXgYmZ9/LRZqpRGD5MJ6LOaW36w davkhI2Gw/WOLPeI9gCnh/GBW04a0J+NjygGFqfDIdlvwLeCAGmJvIPAd69RpJGcFGey YSsP0Oa+yPHkRlAJhRDtxTJRKzfXhGCEtGGhBxppUIozqj5fWKz5pd7DcZiWDWoEkyap UFvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r1LiLYvL; 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 a16si9232219eje.336.2019.10.24.09.37.44 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Oct 2019 09:37:45 -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=pass header.i=@linaro.org header.s=google header.b=r1LiLYvL; 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]:47508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNg7L-0007QV-L7 for patch@linaro.org; Thu, 24 Oct 2019 12:37:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57766) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNfxf-00078S-0Y for qemu-devel@nongnu.org; Thu, 24 Oct 2019 12:27:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNfxd-0000ij-RM for qemu-devel@nongnu.org; Thu, 24 Oct 2019 12:27:42 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:35409) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNfxd-0000iP-L4 for qemu-devel@nongnu.org; Thu, 24 Oct 2019 12:27:41 -0400 Received: by mail-wm1-x342.google.com with SMTP id v6so3230506wmj.0 for ; Thu, 24 Oct 2019 09:27:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=HhJomiYWFoyGiQnBnfLm1DrjhXgk0FPd/bxO+44fxEo=; b=r1LiLYvL9/JKnkM0wrN8hqzHjWmnLUecPjgIlAub3XQ7/1G3U7cfIimsaJW7iv6Zd0 eH4W3hct1VcH3t2Yi09DXHffkliUKwCaYhRY0doErRULRMXOyMWL22GFRUYBRZo6fB7I tnqWjp19Bebbs6G49Qpy6MuCU35g99lQuLI0L+9RQ8HfHacZrilOiIkrsGFhelmdGOV6 tZLMXkPj8aQaKPGW1cvogRda8IvLigwBXtPewyn19q8Cms6Vdr7iDDTX8EdTxvx5Uknn HIYydQ8wXoaGjjEioqW6oGNKPcfpzoBLmTdOfAziVjSOyOfIrKEMOUpHH8tHA1xjwhrw naOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HhJomiYWFoyGiQnBnfLm1DrjhXgk0FPd/bxO+44fxEo=; b=d4QnKfyHU8GoK2mjjtaV7JOCD6/ekpKeFuk0FWnFJcYQf9sUsjwgKrXY+IqAaU0ux5 S6yyBsNOqH7mYdqE3t7GdqX2NYC9U77mm6k9m6GUwjUs7XNJlv1b7HFG14HkwVxBXYc4 DwCT2L7+0xMr0Ep09OGG42mMGHTb0aqQBbjQbK3jib9YN33I+IhuBk/Z3ywOSXWtT1Aw JxC9/xeeGZuOi7Rzq+Pk1VwGdjubXTM2rMgcyyTepKmcarMrlwA29PHuXItNGjRgA/da 54SvHHHnTvbLDMZLLqN5sz+YGpev5ayKGkrhg1CHBap2naXvZIoXyH9RPnou95eK1wEy myTQ== X-Gm-Message-State: APjAAAUgnxRuipqkUHA1SDafA55vpKp5PFVXOMlkHnR4bGoXLMINr6c8 cW7nd1fY+Fgci4alYKSE1KejKizF+0g= X-Received: by 2002:a7b:c74a:: with SMTP id w10mr5674950wmk.30.1571934460028; Thu, 24 Oct 2019 09:27:40 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id r27sm42606124wrc.55.2019.10.24.09.27.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 09:27:38 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 10/51] target/arm: Split out rebuild_hflags_aprofile Date: Thu, 24 Oct 2019 17:26:43 +0100 Message-Id: <20191024162724.31675-11-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191024162724.31675-1-peter.maydell@linaro.org> References: <20191024162724.31675-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::342 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Create a function to compute the values of the TBFLAG_ANY bits that will be cached, and are used by A-profile. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson Message-id: 20191023150057.25731-9-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/helper.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) -- 2.20.1 diff --git a/target/arm/helper.c b/target/arm/helper.c index d1cd54cc931..ddd21edfcf1 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; }