From patchwork Wed Dec 7 17:41:27 2022 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: 631557 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp420011pvb; Wed, 7 Dec 2022 09:42:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf48jd0ZpbXuqCb64NCwnBmbXc2tEX06LTHGXoq2E93Uy78O01dfJkKaoGuAyVn4CMaddUdv X-Received: by 2002:ac8:47c7:0:b0:3a7:e2fb:69b1 with SMTP id d7-20020ac847c7000000b003a7e2fb69b1mr12673028qtr.88.1670434971854; Wed, 07 Dec 2022 09:42:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670434971; cv=none; d=google.com; s=arc-20160816; b=GZmed7q6TJYipHu1YOioLao1KKy5IMGPa0Af9oj/VnTY6YSUWNaUnBvhtSqzqi1YTX emUFZkA4ffNDomE4bkTgDec2OWDGBx5gqxQiXz3304jAfG3BFlCQqsMlWIEOGGL2bSOi 6/JOQsXMNhCrHwEbvLHqMkB5SMJ1OtHS7Eqt7zAm6PggzGhjjLoNCNwMan1NTN/hxEgo ueLDcKW289hME7Ph0gglv+UxG+keXuqb7E1EcIVdmQtLnsrHW70QkpXxE6VGkQe7NP43 KOY4ApUi/aSRdPslserjOGSB2eI3gdXk3RMSxG5Ik9wX20528UdlEG9KobwMS2v6d/hj 5yxA== 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=J5B6vDbFr2pk0CR4IzEviq/2sUbcV4f8oxGB7SYBHu8=; b=U31dMzAOK+KYiJInLY1tmjsMSG+vW7rl2h1icK4BfaaBaDmQlJg0+uH601uaSQlEmB YUS/5yG473/4RUbIb9CJlYu8GfuoOhFEaFzTC8QAvGzdGcDy+xZSAuhSt4LwDL5Ab3I7 xahWfZakstE6N3aBIcsYkUmg9D0ugGstY8LvmA3rHGTsz+OSQ7Yd1/dwtIVYGPJy3oLf QlEZMCsRz5vRPMQhubeTDiVOus89LXb5yg8Q5Q5tt6vQ02L+bE36Gfad0pvp5i4GD9LZ 7iWZMao5VyYZqw+ks2JL5mdch0C8rg+mNELe3Q4FFFDsHP853++YNeFI1TgAtiYJ9qa8 Ef6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dvBcbiDF; 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 cg5-20020a05622a408500b003a573ba6e3asi11161460qtb.165.2022.12.07.09.42.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Dec 2022 09:42:51 -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=dvBcbiDF; 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 1p2yQW-0004gj-SO; Wed, 07 Dec 2022 12:41:48 -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 1p2yQV-0004dt-F0 for qemu-devel@nongnu.org; Wed, 07 Dec 2022 12:41:47 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p2yQT-0001ol-Qn for qemu-devel@nongnu.org; Wed, 07 Dec 2022 12:41:47 -0500 Received: by mail-wm1-x32c.google.com with SMTP id p13-20020a05600c468d00b003cf8859ed1bso1616381wmo.1 for ; Wed, 07 Dec 2022 09:41:45 -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:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=J5B6vDbFr2pk0CR4IzEviq/2sUbcV4f8oxGB7SYBHu8=; b=dvBcbiDFNmEiNHSYU0n7hzKF+tbxKOmppgPgU7/uN5amTMB+ea3Yug/IeP6T6IqcW0 1tC6uw++qALtsXpAxfoFERdQ/Pt7XBkpXg9woogM0YDjdjVTKaFqsSLfr0W9gKPld4ed vtDIlPCSK3Ftvp87Jq0RZr1Zyttc62GUm6Nobu6SRGxm1hIIZ57Xmd/z12QNISMUsyF4 RiwfkPUBeW/5Y00u8GUJKcZVJ1U4XOAmLmlO870D1lOGNiHNY0MC4qh45j4jT55/ggy8 pWM98HPBwJMq7abRlgKFN9EvRh6PVtDdtuRE0XOFxv4ziGRfa0svKv8lVthnI3yQAbwS i7kg== 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:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=J5B6vDbFr2pk0CR4IzEviq/2sUbcV4f8oxGB7SYBHu8=; b=tIxZN1yAilcWVE7NiaB/7MfPkMy7S2RbxkSS5YNvbvCX7xLNPCrZhM+qqc+TFq+TAO LOPLJ7J+/15LhmpwFfwtrfT2Exyb8ajWCrzV+VRqd1ziF6/ozUEtGXmZI6H8zrdvZm2i KQK+NmHFBoJx78PblgtxQtnN6Fe7+8wAv7DR6kGINKhtxhyrb2YNTTNRkOhjVN8168st HUIB//ptfnLXLnPbNOiEr0PowNM492jMGrTETnS69Oqsw7VCu7KH9PNvTXxxYJd4LyNd 7bGVtDufXOKLmG3ZRo5jfSeknKhfZe9orpihDLtYCs2uJbzvvcRAQxaHtDKoW7c1A5eH AaoQ== X-Gm-Message-State: ANoB5pl69yd+P8+SZGKd4dTBtPJibPBtY1+ijc6DsV1x0tmj4Oy77L4S 0nkzrh67rJeMMUeqhGmtsX8WFSOLJqJZ890q4gU= X-Received: by 2002:a7b:ce0e:0:b0:3d1:cae5:efe9 with SMTP id m14-20020a7bce0e000000b003d1cae5efe9mr10723461wmc.158.1670434904326; Wed, 07 Dec 2022 09:41:44 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id n20-20020a05600c3b9400b003cfd10a33afsm2846992wms.11.2022.12.07.09.41.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 07 Dec 2022 09:41:43 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Stafford Horne , =?utf-8?q?Alex_Benn=C3=A9e?= , Yoshinori Sato , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Marek Vasut , Laurent Vivier , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Yanan Wang , Mark Cave-Ayland , Fabiano Rosas , Daniel Henrique Barboza , Richard Henderson , Paolo Bonzini , Marcel Apfelbaum , Max Filippov , Greg Kurz , Artyom Tarasenko , Anton Johansson , qemu-ppc@nongnu.org, Chris Wulff , "Edgar E. Iglesias" , David Gibson Subject: [PATCH-for-8.0 2/4] gdbstub: Use vaddr type for generic insert/remove_breakpoint() API Date: Wed, 7 Dec 2022 18:41:27 +0100 Message-Id: <20221207174129.77593-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221207174129.77593-1-philmd@linaro.org> References: <20221207174129.77593-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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 Both insert/remove_breakpoint() handlers are used in system and user emulation. We can not use the 'hwaddr' type on user emulation, we have to use 'vaddr' which is defined as "wide enough to contain any #target_ulong virtual address". Signed-off-by: Philippe Mathieu-Daudé --- gdbstub/internals.h | 6 ++++-- include/sysemu/accel-ops.h | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/gdbstub/internals.h b/gdbstub/internals.h index eabb0341d1..b23999f951 100644 --- a/gdbstub/internals.h +++ b/gdbstub/internals.h @@ -9,9 +9,11 @@ #ifndef _INTERNALS_H_ #define _INTERNALS_H_ +#include "exec/cpu-common.h" + bool gdb_supports_guest_debug(void); -int gdb_breakpoint_insert(CPUState *cs, int type, hwaddr addr, hwaddr len); -int gdb_breakpoint_remove(CPUState *cs, int type, hwaddr addr, hwaddr len); +int gdb_breakpoint_insert(CPUState *cs, int type, vaddr addr, vaddr len); +int gdb_breakpoint_remove(CPUState *cs, int type, vaddr addr, vaddr len); void gdb_breakpoint_remove_all(CPUState *cs); #endif /* _INTERNALS_H_ */ diff --git a/include/sysemu/accel-ops.h b/include/sysemu/accel-ops.h index 8cc7996def..30690c71bd 100644 --- a/include/sysemu/accel-ops.h +++ b/include/sysemu/accel-ops.h @@ -10,7 +10,7 @@ #ifndef ACCEL_OPS_H #define ACCEL_OPS_H -#include "exec/hwaddr.h" +#include "exec/cpu-common.h" #include "qom/object.h" #define ACCEL_OPS_SUFFIX "-ops" @@ -48,8 +48,8 @@ struct AccelOpsClass { /* gdbstub hooks */ bool (*supports_guest_debug)(void); - int (*insert_breakpoint)(CPUState *cpu, int type, hwaddr addr, hwaddr len); - int (*remove_breakpoint)(CPUState *cpu, int type, hwaddr addr, hwaddr len); + int (*insert_breakpoint)(CPUState *cpu, int type, vaddr addr, vaddr len); + int (*remove_breakpoint)(CPUState *cpu, int type, vaddr addr, vaddr len); void (*remove_all_breakpoints)(CPUState *cpu); };