From patchwork Fri Feb 5 22:56:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377029 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2590815ejt; Fri, 5 Feb 2021 15:29:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJyo1dW7m3WNmOqQom6iMyUgu6PukVlx3jP+h0hS1JAuhdNHN0EObnAabs1J+rbz0n+qEvMH X-Received: by 2002:a25:3104:: with SMTP id x4mr10206817ybx.141.1612567741981; Fri, 05 Feb 2021 15:29:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612567741; cv=none; d=google.com; s=arc-20160816; b=tTm2/AGazsm0bl7tlysepT60UrRQhGsMyn0SPKnLGzQJ7YWeXj+E8XDdYVLgZzyl0j duyaO3jNQc9omWbwfVe3DYCIzvs9Q1pE/ChSrLiwptc9aoJgnSaW4RGuYwU6EoMIXqyX xFlwc8qPVGPWjeQ15VbBKfkUad3Z5tYr0Fqhu10ujQebGqast8wj852hXB9PHWiwmBOq ZEf6q1YPzYgJDPnc5MbVcrRg8uKZquO13hk2sZ+u3WtF+k6RFqidJ78QsOFkHoKl5gaV KsXFWuycB+My8oIW7HOkVS08v9bZRc8mCKZzswMrMN5WMsZcNabc2H48So2lmU2c8KaH Enog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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=wqRDnPxC3RxnOxn5WTlMaueEc2xxzwe38jPVUhiL4JU=; b=kMHCCxcjBtOXndp9XuIJGEHx5xr4l1aTfVA0gti/l3hm8hELiUSjDzhnGIV/ykltN9 sO3dcdo66ExFl9rMVOqGs9+/DmwBxzwxbEnXcwPzv8gHxVhr3kWb7cW5RMWyAnAAt5Ii HzM90i3q+uwNiPm4AREtoE7u9VSWesFWBZ3H2eVrkrB0wCzwZXIcjz79BsNBWT9l7ZE6 IAq9nIpsMWqV6gQbqve5I8jHA3HrqN09lffvAXOJQfvQdkaiBJSQSgtoY6Jr0RO+3Bmc fT1+9S3w3XiJIOzd2m6obha8S5oy7j/eHIzGnOXhBu2fjaeJX71DyAi6eGe67x9//aN7 WSiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=hvDO1NxE; 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=fail (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 r3si10357635ybg.132.2021.02.05.15.29.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:29:01 -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=fail header.i=@linaro.org header.s=google header.b=hvDO1NxE; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51358 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8AX7-0000bO-E0 for patch@linaro.org; Fri, 05 Feb 2021 18:29:01 -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) 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-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) 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) 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 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_Benn=C3=A9e?= , Eduardo Habkost , Claudio Fontana Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Eduardo Habkost Signed-off-by: Eduardo Habkost Signed-off-by: Claudio Fontana Reviewed-by: Alex Bennée 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(-) -- 2.25.1 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); } TcgCpuOperations; @@ -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); 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) } } - if (cc->debug_excp_handler) { - cc->debug_excp_handler(cpu); + if (cc->tcg_ops.debug_excp_handler) { + cc->tcg_ops.debug_excp_handler(cpu); } } 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 = arm_cpu_exec_interrupt; cc->tcg_ops.synchronize_from_tb = arm_cpu_synchronize_from_tb; cc->tcg_ops.tlb_fill = arm_cpu_tlb_fill; - cc->debug_excp_handler = arm_debug_excp_handler; + cc->tcg_ops.debug_excp_handler = arm_debug_excp_handler; cc->debug_check_watchpoint = arm_debug_check_watchpoint; cc->do_unaligned_access = 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 = tcg_x86_init; cc->tcg_ops.tlb_fill = x86_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY - cc->debug_excp_handler = breakpoint_handler; + cc->tcg_ops.debug_excp_handler = 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 = 32 + 7; cc->gdb_stop_before_watchpoint = true; - cc->debug_excp_handler = lm32_debug_excp_handler; + cc->tcg_ops.debug_excp_handler = lm32_debug_excp_handler; cc->disas_set_info = lm32_cpu_disas_set_info; cc->tcg_ops.initialize = 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 = s390_cpu_write_elf64_note; #ifdef CONFIG_TCG cc->tcg_ops.cpu_exec_interrupt = s390_cpu_exec_interrupt; - cc->debug_excp_handler = s390x_cpu_debug_excp_handler; + cc->tcg_ops.debug_excp_handler = s390x_cpu_debug_excp_handler; cc->do_unaligned_access = 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 = xtensa_cpu_get_phys_page_debug; cc->do_transaction_failed = xtensa_cpu_do_transaction_failed; #endif - cc->debug_excp_handler = xtensa_breakpoint_handler; + cc->tcg_ops.debug_excp_handler = xtensa_breakpoint_handler; cc->disas_set_info = xtensa_cpu_disas_set_info; cc->tcg_ops.initialize = xtensa_translate_init; dc->vmsd = &vmstate_xtensa_cpu;