From patchwork Mon Feb 27 14:00:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 656976 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2366208wrb; Mon, 27 Feb 2023 06:02:29 -0800 (PST) X-Google-Smtp-Source: AK7set/Ta0IXwrptX4/IL8AH+E1lNkP7ojfpOYWOb5rGHxdY7i9y0unPKU35kDSJ1FxT7Zj3ULA9 X-Received: by 2002:a05:7500:3d8e:b0:f4:636:6c62 with SMTP id le14-20020a0575003d8e00b000f406366c62mr782837gab.25.1677506548922; Mon, 27 Feb 2023 06:02:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677506548; cv=none; d=google.com; s=arc-20160816; b=oNW0RWc0MfVurafjI6co8rYOZukFSyXYY2iUm6AoxNfb1l7u3sAEnO9aLbCo7i4kdN ci1/lmKj+E+AI9AT8gvrXXBAsuHuk/GStcx9rtLwR1drNl2xy+FH61wYPTGVRkPle+5r EJAw0yZH2lbfy3WCJy62uz83dIeALB8LKA87sQVDJsBPHbm2tddadvrX759DxCaAY0y5 wl2Td6ENhB47TFH1A+h/JzZM2pxymhcQe5bUmWKdeRvDVmz3a026f7SKDndWsh7vzexN tPIsW9dn4BRMX5Id99FZp+hPGymCKnuPm/i6ycJL2NqOh9oZ8cSImODWAvbJu9IEMgaA v0BQ== 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=vrjkaKCliIFkLE0ljnHmQFIiPqAoUGCU+4M0ENFMcrk=; b=VnilXMbh+Fm1nctnxctnR2APsJjIsYkiSMdV+igfQ2OKeGPei16euKHkd3v81BaKiR uKuavnxTe0y9F7TqyOYDm49O/Nhhkjtr8moEbQ/mBABXEV4SB3ajSfW3Qcuc0pCw3OnS 3p6yPM984DRXl3WDf4Kaq1jJcrN+4MwEAp+lONPGn3azI49+6ky8aqiTib+ktAF04MIU 8p6VdfOyxlJH1wTqOGQKxXYYZT9xrQte5KAiZwJxGZs9fV+0IeBfmnaOtTiFmv6NZC2o 0nupL14H/awopMHEnP4tr71OiyXWBFcg2zlRlY2L4QGM5AJQa0UVStOH9Rqm2rPvPlBw RPiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gRNlgXAB; 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 c23-20020a67ce97000000b004120b7d8c7bsi2396046vse.676.2023.02.27.06.02.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 06:02:28 -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=gRNlgXAB; 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 1pWe4q-00018r-7u; Mon, 27 Feb 2023 09:02:04 -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 1pWe3z-0000VE-Ok for qemu-devel@nongnu.org; Mon, 27 Feb 2023 09:01:11 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWe3x-0007WR-Uq for qemu-devel@nongnu.org; Mon, 27 Feb 2023 09:01:11 -0500 Received: by mail-wr1-x42c.google.com with SMTP id r7so6329417wrz.6 for ; Mon, 27 Feb 2023 06:01:09 -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=vrjkaKCliIFkLE0ljnHmQFIiPqAoUGCU+4M0ENFMcrk=; b=gRNlgXABrQlLN4CfgW1Z61p3m+VGHgsGU8hF7Yvj5/QE82BS81YVdsqXEx1/NGwYTu JMaTJTUJQFB6WcYMhcRkAVVQnTJy6ECw6i5lc6vh20fLXKj5ToWe/UjWqN5dWxT2482u S27zOUvnE03xwtAIog27jdG6Q2McFMT7QlpzLJDxKCT8apmC5OAb7V5XqChF5e3hTZ/n /yIIc+pp1EKlY+KXdFMP3yy1K8KlH8c5FWWBuOzZff+7Xp80wmDc7oSTOKHH/AX32n+Z 5SiYVmTi6Qo01Oq5Jw56qJRz0oZpUesu0CmQlpc6IdMiCMR5Sxb96OqGBaxsvjz2M+lu itvA== 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=vrjkaKCliIFkLE0ljnHmQFIiPqAoUGCU+4M0ENFMcrk=; b=I2rozQbDILvhtSqWMOqtV2pEyFaekqEt1V0sdZqSQAQ+rgAAxCn95p8xtLfKBWg6Rr p/iZUBpdnHet16BAvJmnymJS0YMxkreUYX0816dhnzyUdTkQ6ajld/waUkD6SWvtXFzu +idl+zAg1I6c0P++uREufbdXYYdM6LQ/APA6p3CT20XnAFUOMcoW8ektTTUPHqyZlv+x /r++nAtF4qytPHolMzJu43gBOlwDyiExvXM3r1bIwMs4XW7Sx9ywEtSS7MwHxZ5y6ozs eAPR4TfSPKoEptIrkCb8IbZl0Xb/QwA4pY+N/y7q06xb82xlH++f5qnVJVPnUxybN8SV AMDw== X-Gm-Message-State: AO0yUKV21in3HW57DYGkQvqZfDvVAXoKZ7RkckShRaZzsZ6/Cm08d8z7 zDeGljQfRGPZ0OAQWj2h7bvCUGXmOSdkYdad X-Received: by 2002:a5d:4447:0:b0:2c9:b3a9:b080 with SMTP id x7-20020a5d4447000000b002c9b3a9b080mr6098768wrr.16.1677506468299; Mon, 27 Feb 2023 06:01:08 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id s9-20020a5d4249000000b002c5598c14acsm7158514wrr.6.2023.02.27.06.01.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 06:01:07 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 02/25] target/arm: Wrap breakpoint/watchpoint updates with tcg_enabled Date: Mon, 27 Feb 2023 14:00:39 +0000 Message-Id: <20230227140102.3712344-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227140102.3712344-1-peter.maydell@linaro.org> References: <20230227140102.3712344-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42c.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: Fabiano Rosas This is in preparation for restricting compilation of some parts of debug_helper.c to TCG only. Signed-off-by: Fabiano Rosas Reviewed-by: Richard Henderson Signed-off-by: Peter Maydell --- target/arm/cpu.c | 6 ++++-- target/arm/debug_helper.c | 16 ++++++++++++---- target/arm/machine.c | 7 +++++-- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 876ab8f3bf8..da416f7b1cb 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -539,8 +539,10 @@ static void arm_cpu_reset_hold(Object *obj) } #endif - hw_breakpoint_update_all(cpu); - hw_watchpoint_update_all(cpu); + if (tcg_enabled()) { + hw_breakpoint_update_all(cpu); + hw_watchpoint_update_all(cpu); + } arm_rebuild_hflags(env); } diff --git a/target/arm/debug_helper.c b/target/arm/debug_helper.c index 3c671c88c1a..3325eb9d7df 100644 --- a/target/arm/debug_helper.c +++ b/target/arm/debug_helper.c @@ -939,7 +939,9 @@ static void dbgwvr_write(CPUARMState *env, const ARMCPRegInfo *ri, value &= ~3ULL; raw_write(env, ri, value); - hw_watchpoint_update(cpu, i); + if (tcg_enabled()) { + hw_watchpoint_update(cpu, i); + } } static void dbgwcr_write(CPUARMState *env, const ARMCPRegInfo *ri, @@ -949,7 +951,9 @@ static void dbgwcr_write(CPUARMState *env, const ARMCPRegInfo *ri, int i = ri->crm; raw_write(env, ri, value); - hw_watchpoint_update(cpu, i); + if (tcg_enabled()) { + hw_watchpoint_update(cpu, i); + } } void hw_breakpoint_update(ARMCPU *cpu, int n) @@ -1062,7 +1066,9 @@ static void dbgbvr_write(CPUARMState *env, const ARMCPRegInfo *ri, int i = ri->crm; raw_write(env, ri, value); - hw_breakpoint_update(cpu, i); + if (tcg_enabled()) { + hw_breakpoint_update(cpu, i); + } } static void dbgbcr_write(CPUARMState *env, const ARMCPRegInfo *ri, @@ -1079,7 +1085,9 @@ static void dbgbcr_write(CPUARMState *env, const ARMCPRegInfo *ri, value = deposit64(value, 8, 1, extract64(value, 7, 1)); raw_write(env, ri, value); - hw_breakpoint_update(cpu, i); + if (tcg_enabled()) { + hw_breakpoint_update(cpu, i); + } } void define_debug_regs(ARMCPU *cpu) diff --git a/target/arm/machine.c b/target/arm/machine.c index b4c3850570c..fd6323f6d8a 100644 --- a/target/arm/machine.c +++ b/target/arm/machine.c @@ -2,6 +2,7 @@ #include "cpu.h" #include "qemu/error-report.h" #include "sysemu/kvm.h" +#include "sysemu/tcg.h" #include "kvm_arm.h" #include "internals.h" #include "migration/cpu.h" @@ -848,8 +849,10 @@ static int cpu_post_load(void *opaque, int version_id) return -1; } - hw_breakpoint_update_all(cpu); - hw_watchpoint_update_all(cpu); + if (tcg_enabled()) { + hw_breakpoint_update_all(cpu); + hw_watchpoint_update_all(cpu); + } /* * TCG gen_update_fp_context() relies on the invariant that