From patchwork Fri Apr 26 19:41:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 792374 Delivered-To: patch@linaro.org Received: by 2002:adf:cc13:0:b0:346:15ad:a2a with SMTP id x19csp627114wrh; Fri, 26 Apr 2024 12:50:12 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXQByZOoHVmH/8BM/gvet1zffPs6JmUtm1NW0i6jsTkfdccYW17mXdOY7CTWtk/JgrTMif02vz3TY9TL67DOX8n X-Google-Smtp-Source: AGHT+IGEogk9KjMbSEQqKkJn/NJcWt24VHYsuqj4B4opXL2TzlV1cICTBUykh7bWELe9mrb/BXYE X-Received: by 2002:a05:622a:1821:b0:439:b3ce:d736 with SMTP id t33-20020a05622a182100b00439b3ced736mr801066qtc.25.1714161011926; Fri, 26 Apr 2024 12:50:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714161011; cv=none; d=google.com; s=arc-20160816; b=G0mer7R7WhjQMU0jTba9nzmH9+dZ0TG+O0tSrsbc4fCD9HjTMN3sKcen51goHz/hn7 LuM/ysTdaP0GE9dD0uJsrDonVu5AyytJTSTN+jBuc3B/sjuHqFVEQXhh1FgxxzKxc4fO peN9Y0TqC+tbxdX44NFV/K4TCdFTVC3j6m36zk4d/da8T9ilxq7Sibbo9LcB9ngGlBd3 j7/F/45lYNOmBc8GEZY3m4TvGOZB2QeEOK/G2airKE1yG4NTqGXj0KsVHKUYOU7Mezjl mIm0xhXEO4Oem7WFwDjW798SL39yLs1hh3uEIeYzJWLVKi6UX5gOF2R9JGfUbOW517jF +BWw== 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:cc:to :from:dkim-signature; bh=fHVia7emVLdfn7RVXOtjmfvyr/0v1O15dG1Znnu+R50=; fh=qFbY957xn2WKUIsgUAk4y13IQubbF/CwCepoK9/6lAg=; b=w1bAvGDlPITRTw6Y9++71FMWE05eCOVVrWOe2buB1FTTm+cOrHbbaCFHn21wWzsK2Y BaBj/3FrLNwODzoT9v6xyts+yrZ/p35F2j8zAB7Xag5EYUg95w+NlA+PRuJl1PTYQ2rI D281X1tIsfblNStFLAkEFuNEHdVUb97aetIjcovQWLE7A57f3cdkC5c1dkMR6VFyYrHX siyYytfBhVZ561VfDToUWQAipw0eZDW5MErXiumGosZYev9Nbh8RveM1krNZrriEX6Bu Dk6on+uuo0RgXfa294Sj2E9lvXeep8crQS9PA5tWROko3P475vPFIFkvt/4nydcImqi5 LQJw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VD3YBFow; 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 s11-20020a05622a178b00b00437b3e0a89csi20528747qtk.174.2024.04.26.12.50.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 26 Apr 2024 12:50:11 -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=VD3YBFow; 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 1s0RVU-0000ZP-SF; Fri, 26 Apr 2024 15:45:17 -0400 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 1s0RVQ-0000O6-BQ for qemu-devel@nongnu.org; Fri, 26 Apr 2024 15:45:12 -0400 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s0RVM-0004UV-LN for qemu-devel@nongnu.org; Fri, 26 Apr 2024 15:45:11 -0400 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a5224dfa9adso459259966b.0 for ; Fri, 26 Apr 2024 12:45:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714160707; x=1714765507; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fHVia7emVLdfn7RVXOtjmfvyr/0v1O15dG1Znnu+R50=; b=VD3YBFowYHVTRk8e3L62qHVwEIOEQEsQxbMsFQpb7h3ygY/AMtl2V+IYc1hJTcjuVh EYj8YrkW4v2IYWaS6z7GxpNGKVItl5nuMtMK0bvjdqNeKsX6VOv8QG6Rz3jqZgpDcrgQ FMZel/ZgcMaULcN1Zr79Nz2UMKPzmwS8O9vAYeTsT02VRfj1+4vnxuzxQ+H1Wi4v3V0F bjBQniObP8x7SfqCQHsww/B8VuaxyVyvGKabJwjC80N5+lWcdT5dFA8l3dOQFHTn2sz5 bgTjSFDZgPM5I6kfUXWG2Huz/mXtFpYM2aHOShJOkkXXsPrV0i4SN197U4WFJBDXO+nK YQcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714160707; x=1714765507; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fHVia7emVLdfn7RVXOtjmfvyr/0v1O15dG1Znnu+R50=; b=TAxK6CJlsCIbbrH/Qb/oZMEdOfmp3J/Gxpmk7EB8eY4dE5aocXtbdkxgPX6Lq0qIqZ sUhDAbhEX5JWf078bthltQWx+6GtLIJj7lE7sQciaExKjocxe3Xn6FtM++FFqK3a7syg XM/Y3e0eh2TqxI9HbQVXeZ8ZATCXNOzAOhZGHC6NyLXnnO9wFe73+K7wE1O163W0Z0FI QSaaO2WE1+YeRV62VAfdKh9vexUU7ORUYMLSVxulCOWvFQBAFujMhE1tfEUZ5WiqXulW sr75Tj+wrx7VK0QxCa+8CaTB7VqiDcdajFBosMEj/r9qkNPxKrD1F6U/iPx+YjsAEXIY Fb/A== X-Gm-Message-State: AOJu0Yw9BuykF+ijp5dSaA1A7XgPRbK1ZerDEG4S8OYmtPYbAgZ9vm+V d2PZ8nWsdDgsqC47GYkcKjJQdAb2z+e5KCp0DyxR+K0F92NSRwGqthmKptKtGKybqddRtYiJ2RO 4jOk= X-Received: by 2002:a17:906:d193:b0:a55:b2c0:a103 with SMTP id c19-20020a170906d19300b00a55b2c0a103mr2866142ejz.33.1714160706682; Fri, 26 Apr 2024 12:45:06 -0700 (PDT) Received: from m1x-phil.lan (aul93-h02-176-184-11-147.dsl.sta.abo.bbox.fr. [176.184.11.147]) by smtp.gmail.com with ESMTPSA id ef15-20020a17090697cf00b00a58bcfa6610sm1863773ejb.185.2024.04.26.12.45.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 26 Apr 2024 12:45:06 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-riscv@nongnu.org, qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Anton Johansson , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang , Peter Maydell , Nicholas Piggin , Daniel Henrique Barboza , Palmer Dabbelt , Alistair Francis , Bin Meng , Weiwei Li , Liu Zhiwei Subject: [PULL 31/38] exec: Declare CPUBreakpoint/CPUWatchpoint type in 'breakpoint.h' header Date: Fri, 26 Apr 2024 21:41:51 +0200 Message-ID: <20240426194200.43723-32-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240426194200.43723-1-philmd@linaro.org> References: <20240426194200.43723-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=philmd@linaro.org; helo=mail-ej1-x636.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=unavailable 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 The CPUBreakpoint and CPUWatchpoint structures are declared in "hw/core/cpu.h", which contains declarations related to CPUState and CPUClass. Some source files only require the BP/WP definitions and don't need to pull in all CPU* API. In order to simplify, create a new "exec/breakpoint.h" header. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson Message-Id: <20240418192525.97451-3-philmd@linaro.org> --- include/exec/breakpoint.h | 30 ++++++++++++++++++++++++++++++ include/hw/core/cpu.h | 16 +--------------- target/arm/internals.h | 1 + target/ppc/internal.h | 1 + target/riscv/debug.h | 2 ++ 5 files changed, 35 insertions(+), 15 deletions(-) create mode 100644 include/exec/breakpoint.h diff --git a/include/exec/breakpoint.h b/include/exec/breakpoint.h new file mode 100644 index 0000000000..95f0482e6d --- /dev/null +++ b/include/exec/breakpoint.h @@ -0,0 +1,30 @@ +/* + * QEMU breakpoint & watchpoint definitions + * + * Copyright (c) 2012 SUSE LINUX Products GmbH + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#ifndef EXEC_BREAKPOINT_H +#define EXEC_BREAKPOINT_H + +#include "qemu/queue.h" +#include "exec/vaddr.h" +#include "exec/memattrs.h" + +typedef struct CPUBreakpoint { + vaddr pc; + int flags; /* BP_* */ + QTAILQ_ENTRY(CPUBreakpoint) entry; +} CPUBreakpoint; + +typedef struct CPUWatchpoint { + vaddr vaddr; + vaddr len; + vaddr hitaddr; + MemTxAttrs hitattrs; + int flags; /* BP_* */ + QTAILQ_ENTRY(CPUWatchpoint) entry; +} CPUWatchpoint; + +#endif diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 759c3e7d89..46b99a7ea5 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -22,6 +22,7 @@ #include "hw/qdev-core.h" #include "disas/dis-asm.h" +#include "exec/breakpoint.h" #include "exec/hwaddr.h" #include "exec/vaddr.h" #include "exec/memattrs.h" @@ -347,21 +348,6 @@ typedef struct CPUNegativeOffsetState { bool can_do_io; } CPUNegativeOffsetState; -typedef struct CPUBreakpoint { - vaddr pc; - int flags; /* BP_* */ - QTAILQ_ENTRY(CPUBreakpoint) entry; -} CPUBreakpoint; - -struct CPUWatchpoint { - vaddr vaddr; - vaddr len; - vaddr hitaddr; - MemTxAttrs hitattrs; - int flags; /* BP_* */ - QTAILQ_ENTRY(CPUWatchpoint) entry; -}; - struct KVMState; struct kvm_run; diff --git a/target/arm/internals.h b/target/arm/internals.h index b53f5e8ff2..e40ec453d5 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -25,6 +25,7 @@ #ifndef TARGET_ARM_INTERNALS_H #define TARGET_ARM_INTERNALS_H +#include "exec/breakpoint.h" #include "hw/registerfields.h" #include "tcg/tcg-gvec-desc.h" #include "syndrome.h" diff --git a/target/ppc/internal.h b/target/ppc/internal.h index 5b20ecbd33..601c0b533f 100644 --- a/target/ppc/internal.h +++ b/target/ppc/internal.h @@ -18,6 +18,7 @@ #ifndef PPC_INTERNAL_H #define PPC_INTERNAL_H +#include "exec/breakpoint.h" #include "hw/registerfields.h" /* PM instructions */ diff --git a/target/riscv/debug.h b/target/riscv/debug.h index 5794aa6ee5..c347863578 100644 --- a/target/riscv/debug.h +++ b/target/riscv/debug.h @@ -22,6 +22,8 @@ #ifndef RISCV_DEBUG_H #define RISCV_DEBUG_H +#include "exec/breakpoint.h" + #define RV_MAX_TRIGGERS 2 /* register index of tdata CSRs */