From patchwork Mon Jan 23 13:35:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 645565 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp2213581pvb; Mon, 23 Jan 2023 06:28:00 -0800 (PST) X-Google-Smtp-Source: AMrXdXtGM/pdF47F/g+dLMFtGrizeasmOIE4PfVeH0n1KvKPb/64yvcbfEcI+bCH6GX9XsaH4mkf X-Received: by 2002:a05:6214:350f:b0:531:94d7:a41f with SMTP id nk15-20020a056214350f00b0053194d7a41fmr38668405qvb.43.1674484080384; Mon, 23 Jan 2023 06:28:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674484080; cv=none; d=google.com; s=arc-20160816; b=PhA6oK+alUF7sjyYK94Mo0oEMGZBMjkleWkqBakkQsAT++04BFfxn8KOsBStxlzLsf Lixkz2Xv4+MpAGWC1KUVXobkOc2kEANCbwAMOCqfCxRWLariCO9NbhzvD0H7fhDyf/p2 q8pXwt3qat5mBAqgvZZk/56bdkdxMm9ByxbaDsXntnnMiF7nrmKH10BJDeRg6LydGirl DW58f57jAyslv9aWJWzKQqvKiMsfOkDezCs+nkeZ3roeTxZRZYfCU1qWBNBxdMKiEnVB qLgcbqTVdUeLT4SSoNjVuFOoyhNiIshvrsKDVTtMyaMeuCWBdvqnpdjznKiKNyv9m+0Q D8SA== 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=brguCCskR07IlO3tUdOSX78gsX0q+RbP7/3ek3OIEVI=; b=Am4ad1SP+Ig0oJnYe7BQj+3vpw0TFY1liPVRpdcEk8cX1TpZ7A1a712h6HPtTMwe7j uDoVGDcT+cwTFCBuczrhWyuoytAb1HJ/wZuM7w6jN8zrVUcik/K+FeJFxIBzD7oRcfQE HnghlpBKcqgdsoqqbZymyZM/pVwFAw0FIKfFhjNN0ENsOqA8asxlbkSUH4557KwQ9I3B IiBYEXaD7otxjWl42bSTHU8Mn2exab6iXmgv43hrkxOnlI6EsuIJohycQk1vPBGPlQ+g N1HwqREwOdGe/KZUNEBBnmUM3ZodJ7gDNFolUqe4sMC5rDV5+idIEdDxNtVguBDbFX2d 77jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oe00pt1Y; 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 n8-20020a0cfbc8000000b005374df629acsi4880212qvp.102.2023.01.23.06.28.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Jan 2023 06:28:00 -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=oe00pt1Y; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJx02-0006GG-R8; Mon, 23 Jan 2023 08:36:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pJwzk-00060j-0z for qemu-devel@nongnu.org; Mon, 23 Jan 2023 08:36:23 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pJwzi-0002Lc-6B for qemu-devel@nongnu.org; Mon, 23 Jan 2023 08:36:19 -0500 Received: by mail-wm1-x329.google.com with SMTP id f12-20020a7bc8cc000000b003daf6b2f9b9so10607034wml.3 for ; Mon, 23 Jan 2023 05:36:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=brguCCskR07IlO3tUdOSX78gsX0q+RbP7/3ek3OIEVI=; b=oe00pt1Y7Exut/UqdK4ma9r5e400xIJ9sRy/7fHUKWoA6Y4C3tEDLnC3DZnEBdUuPK 3K5uJz7qEld9FKcGXHecKalRLakl21bCv2t3cd8IW+Gt0YwNMb5G4mjqBBulY95lPRa5 Akw9nfaUoigcfUeeQYMm0iyTd++JAnIoFBmu1T55Y6cnXPzf+5NYyQnPlFwm8h2NUPse hqc6pwD/ov1Iu01zPaULD6zhN1B4SINYjf7uZCTq2EdFW849hCDD3vgreDq3GUCMit8A h7BVLFR6ssJON0S0momCdo+W9gzYnpribaCAwSm7W6U8qRdT5JorUo2ysl6liplkHkC9 2QyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=brguCCskR07IlO3tUdOSX78gsX0q+RbP7/3ek3OIEVI=; b=xIlPXVlcR1/hgSWxr4w4wDC57jFAkgxJ+oRhcmXEtQ9y8sl0zPd3WmrMGY3uEYnr5p NKlQyakhnfDKNO+hxpFrM01NvsxuM8LQbfCb328eb+pLShJBLmGogHdlH0oXZTt5heFO IJLRzkOjl+ZsVyW/NLJT1eCKxyYbHoYwsE5GHLUmd5bCrF2rtA9nW4JEwPUMOoVgW1f9 RSC6XFOUttst0m8W4AoW/qgwC9ZZHpujXd18KV2titYZK4ZCFwgnXFiLlD5L8tkmhNqA UGWooj0//5SOQCnfV5/cIkTjY+bUc0C5hxsr9G5PzFD6foAbZKw6buHEwf9Ci6/VvN2E Lmww== X-Gm-Message-State: AFqh2kocTKlSiqbnUHWCWmZDJAIFdF2Bsr1ofrq9GjLKZGQvSjaV9ve4 pGm9bWlj1GyQN2HtX4cYT8njqYYyoyZfkMxo X-Received: by 2002:a05:600c:3d9b:b0:3db:1afd:ac36 with SMTP id bi27-20020a05600c3d9b00b003db1afdac36mr17776682wmb.32.1674480976228; Mon, 23 Jan 2023 05:36:16 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id d19-20020a05600c34d300b003a6125562e1sm10817457wmq.46.2023.01.23.05.36.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 05:36:15 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 23/26] target/arm: implement DBGCLAIM registers Date: Mon, 23 Jan 2023 13:35:50 +0000 Message-Id: <20230123133553.2171158-24-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230123133553.2171158-1-peter.maydell@linaro.org> References: <20230123133553.2171158-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+patch=linaro.org@nongnu.org From: Evgeny Iakovlev The architecture does not define any functionality for the CLAIM tag bits. So we will just keep the raw bits, as per spec. Signed-off-by: Evgeny Iakovlev Reviewed-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20230120155929.32384-2-eiakovlev@linux.microsoft.com Signed-off-by: Peter Maydell --- target/arm/cpu.h | 1 + target/arm/debug_helper.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index f3ddc3b7793..8cf70693be4 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -495,6 +495,7 @@ typedef struct CPUArchState { uint64_t dbgbcr[16]; /* breakpoint control registers */ uint64_t dbgwvr[16]; /* watchpoint value registers */ uint64_t dbgwcr[16]; /* watchpoint control registers */ + uint64_t dbgclaim; /* DBGCLAIM bits */ uint64_t mdscr_el1; uint64_t oslsr_el1; /* OS Lock Status */ uint64_t osdlr_el1; /* OS DoubleLock status */ diff --git a/target/arm/debug_helper.c b/target/arm/debug_helper.c index 2f6ddc0da57..f95a73329db 100644 --- a/target/arm/debug_helper.c +++ b/target/arm/debug_helper.c @@ -632,6 +632,24 @@ static void osdlr_write(CPUARMState *env, const ARMCPRegInfo *ri, } } +static void dbgclaimset_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + env->cp15.dbgclaim |= (value & 0xFF); +} + +static uint64_t dbgclaimset_read(CPUARMState *env, const ARMCPRegInfo *ri) +{ + /* CLAIM bits are RAO */ + return 0xFF; +} + +static void dbgclaimclr_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + env->cp15.dbgclaim &= ~(value & 0xFF); +} + static const ARMCPRegInfo debug_cp_reginfo[] = { /* * DBGDRAR, DBGDSAR: always RAZ since we don't implement memory mapped @@ -715,6 +733,21 @@ static const ARMCPRegInfo debug_cp_reginfo[] = { .cp = 14, .opc0 = 2, .opc1 = 0, .crn = 0, .crm = 2, .opc2 = 0, .access = PL1_RW, .accessfn = access_tda, .type = ARM_CP_NOP }, + /* + * Dummy DBGCLAIM registers. + * "The architecture does not define any functionality for the CLAIM tag bits.", + * so we only keep the raw bits + */ + { .name = "DBGCLAIMSET_EL1", .state = ARM_CP_STATE_BOTH, + .cp = 14, .opc0 = 2, .opc1 = 0, .crn = 7, .crm = 8, .opc2 = 6, + .type = ARM_CP_ALIAS, + .access = PL1_RW, .accessfn = access_tda, + .writefn = dbgclaimset_write, .readfn = dbgclaimset_read }, + { .name = "DBGCLAIMCLR_EL1", .state = ARM_CP_STATE_BOTH, + .cp = 14, .opc0 = 2, .opc1 = 0, .crn = 7, .crm = 9, .opc2 = 6, + .access = PL1_RW, .accessfn = access_tda, + .writefn = dbgclaimclr_write, .raw_writefn = raw_write, + .fieldoffset = offsetof(CPUARMState, cp15.dbgclaim) }, }; static const ARMCPRegInfo debug_lpae_cp_reginfo[] = {