From nobody Wed Nov 5 18:37:19 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 149640880642552.01078992165117; Fri, 2 Jun 2017 06:06:46 -0700 (PDT) Received: from localhost ([::1]:49703 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGmHn-00079A-Go for importer@patchew.org; Fri, 02 Jun 2017 09:06:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33949) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGmGI-0006G6-SX for qemu-devel@nongnu.org; Fri, 02 Jun 2017 09:05:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGmGF-0002fd-I6 for qemu-devel@nongnu.org; Fri, 02 Jun 2017 09:05:06 -0400 Received: from mail-wr0-x234.google.com ([2a00:1450:400c:c0c::234]:34664) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dGmGF-0002fB-BE for qemu-devel@nongnu.org; Fri, 02 Jun 2017 09:05:03 -0400 Received: by mail-wr0-x234.google.com with SMTP id g76so6683896wrd.1 for ; Fri, 02 Jun 2017 06:05:03 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id x126sm2491100wme.12.2017.06.02.06.04.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Jun 2017 06:04:59 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 206B03E031F; Fri, 2 Jun 2017 14:05:19 +0100 (BST) 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=/vgkPSMEl2YnnOoLebzx/r20nDGLFE6ysMUjmT0ACR4=; b=JUsJuddJ4y5i0rGIQhRz8lAvFG6EOIb+cgCvVFZYfch5/FxZ47KY1ATTfJOihtgOQm 0ZryqBgW74tBZSU0Mt7/PFG49By8XKjG+EmvmWhMkMRY4Rw+GWQ3XHQ33l6TgtyVzm41 AXcMdDxRFumKMgX+uaJe2RsqWdWCCcLdSeIxU= 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=/vgkPSMEl2YnnOoLebzx/r20nDGLFE6ysMUjmT0ACR4=; b=uRFdvT4vmrUFWdthBbpv29oNZKBjaOTyuXReLcc+A+E0hy37nqBoY2tvYFmLFRzHvI HS2j2SxtupPhHHnasC8a5SL6Y+6l2tOyTLIAdJ/JVZ7KpeB/ifphQzTYcHDR37YSpk4q ceXyjz+zuaIBMk2QFD4g/ZXjqTIgkY8jF7bznysgdNwk5/bBPV/LLgcoa6tw48zqkfl/ J/45YnL5CYzwSItjUc+a7KxKBv18IdkZGpzDTwBjEXkEAJsVN/JkH0oNzJE2nsV0z6VZ PlSbNu4k7DmCKzNJ4wlMOEeuvduQsVcTts/28+MZ6KyQo4UQNDrdKDIDY/RpovJ9cGdq 831w== X-Gm-Message-State: AODbwcDRrl3b56jocAkud8ykDNWpTlAgBMqjbctKxzq0Jth3MAlfJECC oa9hdbiSETV8Y+/w X-Received: by 10.223.154.195 with SMTP id a61mr4890392wrc.47.1496408702200; Fri, 02 Jun 2017 06:05:02 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: peter.maydell@linaro.org, pbonzini@redhat.com, doug16k@gmail.com, imbrenda@linux.vnet.ibm.com Date: Fri, 2 Jun 2017 14:05:17 +0100 Message-Id: <20170602130518.22943-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170602130518.22943-1-alex.bennee@linaro.org> References: <20170602130518.22943-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::234 Subject: [Qemu-devel] [PATCH v3 3/4] qom/cpu: remove host_tid field X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio , =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 This was only used by the gdbstub and even then was only being set for subsequent threads. Rather the continue duplicating the number just make the gdbstub get the information from TaskState structure. Now the tid is correctly reported for all threads the bug I was seeing with "vCont;C04:0;c" packets is fixed as the correct tid is reported to gdb. I moved cpu_gdb_index into the gdbstub to facilitate easy access to the TaskState which is used elsewhere in gdbstub. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Greg Kurz Reviewed-by: Claudio Imbrenda Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Laurent Vivier --- v3 - fix merge, did move of function in previous commit --- gdbstub.c | 3 ++- include/qom/cpu.h | 2 -- linux-user/syscall.c | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/gdbstub.c b/gdbstub.c index 57befe16e2..45a3a0b16b 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -63,7 +63,8 @@ static inline int target_memory_rw_debug(CPUState *cpu, t= arget_ulong addr, static inline int cpu_gdb_index(CPUState *cpu) { #if defined(CONFIG_USER_ONLY) - return cpu->host_tid; + TaskState *ts =3D (TaskState *) cpu->opaque; + return ts->ts_tid; #else return cpu->cpu_index + 1; #endif diff --git a/include/qom/cpu.h b/include/qom/cpu.h index 55214ce131..909e7ae994 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -266,7 +266,6 @@ struct qemu_work_item; * @nr_cores: Number of cores within this CPU package. * @nr_threads: Number of threads within this CPU. * @numa_node: NUMA node this CPU is belonging to. - * @host_tid: Host thread ID. * @running: #true if CPU is currently running (lockless). * @has_waiter: #true if a CPU is currently waiting for the cpu_exec_end; * valid under cpu_list_lock. @@ -321,7 +320,6 @@ struct CPUState { HANDLE hThread; #endif int thread_id; - uint32_t host_tid; bool running, has_waiter; struct QemuCond *halt_cond; bool thread_kicked; diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 925ae11ea6..003943b736 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6219,7 +6219,6 @@ static void *clone_func(void *arg) thread_cpu =3D cpu; ts =3D (TaskState *)cpu->opaque; info->tid =3D gettid(); - cpu->host_tid =3D info->tid; task_settid(ts); if (info->child_tidptr) put_user_u32(info->tid, info->child_tidptr); --=20 2.13.0