From nobody Wed Dec 17 21:49:48 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1612567716; cv=none; d=zohomail.com; s=zohoarc; b=TXAv0OLXGgoJj/UyZNS4V+b68LYRpDH8upx/yJWWWnzSo7wvl9tHV24MXuTy5CYVUFcSkehbHKFlYeF7Mdf+oebsR2QHAEL5kcT+EOh/gL+7cVsHx3c6kO+coQ1FD9d+A3FhgOe2uMQ0Wu6NdTKuelGDIYazFRMaIdapI3xgik0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612567716; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=wqRDnPxC3RxnOxn5WTlMaueEc2xxzwe38jPVUhiL4JU=; b=iU99h+QRuPw6GTNJZzVyzFhWoiYXIlfUJAU+ogkhpECRiBCTf78if5NdirSkVwAnWskEcaKaLrer4EuCMvJN2AW14noYThQbN/EX3MG+IV1jS/ZJQjxk8T5SW5cmqPbk1XI3Mk9guRi/zvPG3YsHJ7VsO+sQ/2Z6+/S2qdzMXyw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1612567716419788.5783201659066; Fri, 5 Feb 2021 15:28:36 -0800 (PST) Received: from localhost ([::1]:48606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8AWh-0007ub-Bt for importer@patchew.org; Fri, 05 Feb 2021 18:28:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59642) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A3E-0002hn-WB for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:10 -0500 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]:45839) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A39-0003bp-5W for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:07 -0500 Received: by mail-pg1-x530.google.com with SMTP id o21so4168839pgn.12 for ; Fri, 05 Feb 2021 14:58:01 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.57.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:57:59 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=wqRDnPxC3RxnOxn5WTlMaueEc2xxzwe38jPVUhiL4JU=; b=hvDO1NxEbtnrvJz6f97C5g4S1XdJE7DjZOZ9eq6ed6W7SQiHxutwA5dyKbCncFKtjl rawgY+rDTmh3ke4CwCuzKn6hlRH/Xq+kQFyKlZlMcL5VRpc4AoLNBWCYcDxFlqdzcNK3 dhe1kwlpNg59s3XdhT8Nsifr0utH9ZYJGnoMzwrOVpWgBrVsDz5QiZEjAnluYQXpJLc6 JxrEAFUmMC7DPJ4nVCkZrdHRTSZvZEbjs3QeYXXOYqTAlU4RKBlwn1ypWfOt1ge1HGGW pIQPGNAO+lSJV4d4sAWj3HIAfRXIvcfyEf4x5v0uhgg4nIZTNcb/hcHjPHt2Rz9fQfpf w6gw== 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:mime-version:content-transfer-encoding; bh=wqRDnPxC3RxnOxn5WTlMaueEc2xxzwe38jPVUhiL4JU=; b=ZWz0zRxMhwQOdrmjkdKVogaxS2rQ04JziBm2T/3bGLF83FaYkDafNn/AkrD874Me1e BEUm8I2kxtSnP/CxaTJMh+pwHopaqM2oCOtfOLkwFgIY/K5vh7ZI+DvnjWJPdBoTKSK9 uaxW3qq+oCTSe44xTWaJPqRfFUm6MSVhjOEQSgfVBOw7GZYjElG+h+/BI0s8GtTH7l1z NZuSJACpgrgm9RnM4JEf7CnuyiRdX9CgQNv6t8HN6NmTxqa2m3e2D4xXUTHW2TmxSaik cJUdB1JFXpI20Y2yVkFmBL2YEtX3dANhiKspss5hwLQk+eS9TN8SKEsrGNbNYzI0+W4K AF8A== X-Gm-Message-State: AOAM532+ls4YIz+iGNd/GeqyQsEU7Yh2UmRZIqBwaRQiBgJeOJeYxA95 tNewCR/cOwPia/iYoaOFO368z2sQ2BqiRFfF X-Google-Smtp-Source: ABdhPJz6R9nwmyu89DYwsDv1GtY3a4/d5xJUBascuFSWuns+1tRZ818VVFszyq+vXjUA/viK2LbNnQ== X-Received: by 2002:aa7:864d:0:b029:1d5:ca12:f0e6 with SMTP id a13-20020aa7864d0000b02901d5ca12f0e6mr6503228pfo.58.1612565880160; Fri, 05 Feb 2021 14:58:00 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 35/46] cpu: Move debug_excp_handler to tcg_ops Date: Fri, 5 Feb 2021 12:56:39 -1000 Message-Id: <20210205225650.1330794-36-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::530; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x530.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Eduardo Habkost , Claudio Fontana Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Eduardo Habkost Signed-off-by: Eduardo Habkost Signed-off-by: Claudio Fontana Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson Message-Id: <20210204163931.7358-8-cfontana@suse.de> Signed-off-by: Richard Henderson --- include/hw/core/cpu.h | 4 ++-- accel/tcg/cpu-exec.c | 4 ++-- target/arm/cpu.c | 2 +- target/i386/tcg/tcg-cpu.c | 2 +- target/lm32/cpu.c | 2 +- target/s390x/cpu.c | 2 +- target/xtensa/cpu.c | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 94236b68d7..ff82eae939 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -117,6 +117,8 @@ typedef struct TcgCpuOperations { bool (*tlb_fill)(CPUState *cpu, vaddr address, int size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr); + /** @debug_excp_handler: Callback for handling debug exceptions */ + void (*debug_excp_handler)(CPUState *cpu); =20 } TcgCpuOperations; =20 @@ -161,7 +163,6 @@ typedef struct TcgCpuOperations { * @gdb_write_register: Callback for letting GDB write a register. * @debug_check_watchpoint: Callback: return true if the architectural * watchpoint whose address has matched should really fire. - * @debug_excp_handler: Callback for handling debug exceptions. * @write_elf64_note: Callback for writing a CPU-specific ELF note to a * 64-bit VM coredump. * @write_elf32_qemunote: Callback for writing a CPU- and QEMU-specific ELF @@ -224,7 +225,6 @@ struct CPUClass { int (*gdb_read_register)(CPUState *cpu, GByteArray *buf, int reg); int (*gdb_write_register)(CPUState *cpu, uint8_t *buf, int reg); bool (*debug_check_watchpoint)(CPUState *cpu, CPUWatchpoint *wp); - void (*debug_excp_handler)(CPUState *cpu); =20 int (*write_elf64_note)(WriteCoreDumpFunction f, CPUState *cpu, int cpuid, void *opaque); diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 953f050698..e7e54fd75d 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -512,8 +512,8 @@ static inline void cpu_handle_debug_exception(CPUState = *cpu) } } =20 - if (cc->debug_excp_handler) { - cc->debug_excp_handler(cpu); + if (cc->tcg_ops.debug_excp_handler) { + cc->tcg_ops.debug_excp_handler(cpu); } } =20 diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 27a16c1950..66ac210b0c 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -2280,7 +2280,7 @@ static void arm_cpu_class_init(ObjectClass *oc, void = *data) cc->tcg_ops.cpu_exec_interrupt =3D arm_cpu_exec_interrupt; cc->tcg_ops.synchronize_from_tb =3D arm_cpu_synchronize_from_tb; cc->tcg_ops.tlb_fill =3D arm_cpu_tlb_fill; - cc->debug_excp_handler =3D arm_debug_excp_handler; + cc->tcg_ops.debug_excp_handler =3D arm_debug_excp_handler; cc->debug_check_watchpoint =3D arm_debug_check_watchpoint; cc->do_unaligned_access =3D arm_cpu_do_unaligned_access; #if !defined(CONFIG_USER_ONLY) diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c index 85b69224a9..6c1ebbdcc6 100644 --- a/target/i386/tcg/tcg-cpu.c +++ b/target/i386/tcg/tcg-cpu.c @@ -67,6 +67,6 @@ void tcg_cpu_common_class_init(CPUClass *cc) cc->tcg_ops.initialize =3D tcg_x86_init; cc->tcg_ops.tlb_fill =3D x86_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY - cc->debug_excp_handler =3D breakpoint_handler; + cc->tcg_ops.debug_excp_handler =3D breakpoint_handler; #endif } diff --git a/target/lm32/cpu.c b/target/lm32/cpu.c index 76dc728858..bbe1405e32 100644 --- a/target/lm32/cpu.c +++ b/target/lm32/cpu.c @@ -235,7 +235,7 @@ static void lm32_cpu_class_init(ObjectClass *oc, void *= data) #endif cc->gdb_num_core_regs =3D 32 + 7; cc->gdb_stop_before_watchpoint =3D true; - cc->debug_excp_handler =3D lm32_debug_excp_handler; + cc->tcg_ops.debug_excp_handler =3D lm32_debug_excp_handler; cc->disas_set_info =3D lm32_cpu_disas_set_info; cc->tcg_ops.initialize =3D lm32_translate_init; } diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index ceee62ddca..8ade66178e 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -509,7 +509,7 @@ static void s390_cpu_class_init(ObjectClass *oc, void *= data) cc->write_elf64_note =3D s390_cpu_write_elf64_note; #ifdef CONFIG_TCG cc->tcg_ops.cpu_exec_interrupt =3D s390_cpu_exec_interrupt; - cc->debug_excp_handler =3D s390x_cpu_debug_excp_handler; + cc->tcg_ops.debug_excp_handler =3D s390x_cpu_debug_excp_handler; cc->do_unaligned_access =3D s390x_cpu_do_unaligned_access; #endif #endif diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index e764dbeb73..b6f13ceb32 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -207,7 +207,7 @@ static void xtensa_cpu_class_init(ObjectClass *oc, void= *data) cc->get_phys_page_debug =3D xtensa_cpu_get_phys_page_debug; cc->do_transaction_failed =3D xtensa_cpu_do_transaction_failed; #endif - cc->debug_excp_handler =3D xtensa_breakpoint_handler; + cc->tcg_ops.debug_excp_handler =3D xtensa_breakpoint_handler; cc->disas_set_info =3D xtensa_cpu_disas_set_info; cc->tcg_ops.initialize =3D xtensa_translate_init; dc->vmsd =3D &vmstate_xtensa_cpu; --=20 2.25.1