From patchwork Sun Apr 28 22:14:36 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: 792924 Delivered-To: patch@linaro.org Received: by 2002:adf:cc13:0:b0:346:15ad:a2a with SMTP id x19csp1423542wrh; Sun, 28 Apr 2024 15:16:20 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVKvKeNvf1iCHx4yABiJ/AHLsWIlbXD0K7lpvmjGweR9q//yKic+taHuL7+0CjPSv2LswdFx0IjDpKvD8V26/JM X-Google-Smtp-Source: AGHT+IFBgQOQ+pTy754p3rP0NO2qoxziQAaNGnnQruT8C8YJr13J9189qqrs2R6aUuNEcVFWEYVk X-Received: by 2002:ad4:5be2:0:b0:6a0:a541:79f6 with SMTP id k2-20020ad45be2000000b006a0a54179f6mr10391146qvc.56.1714342580095; Sun, 28 Apr 2024 15:16:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714342580; cv=none; d=google.com; s=arc-20160816; b=MT6mCuDMT1UmVhVC6vtvvZtwcYCIYPdpa/cf5EhvvPKyJ1VlE6GQ6y9+C3+LON7WVA FAz7tCvAn+9Ij/ufRaiNzWvlT/sPptlWk9mXi4Ls0OMpr2Gnlj2w6zf0aqyn0baTaqLV 0Qwq5uU8d01yseiM935rZRq5lO6SASjVxwFje+/EgIvCHu6s5xREQ9b8MLS0vYiWbGE0 Vei1RO04O1w4Fy9xdhvHE+W6lKdpL0e/b29EDRiRFzP+36ml57qsCrOa4F6HGXYpzbjP A3qDkdPyRJuIgtydy22i+h3QGoDTo8npFwPPSCBKNUAK1CTO4UIKYYV0v0S5uyLl6fN3 VNgw== 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=dbxYPWieuKJ2V2McIsSIqfnAs5Fqc2GnHDeEOuheOAc=; fh=+kTJNlX4d/Ktp/5WO5d77IkVGYcQ7tiev+NqB54rN/Q=; b=FeZ+fcWq6bzamfi86YfvwqUVxsVsLePXaKMWLN+NLzrazSp8MZ0Rlvh84ifDaYSg8S /SQE6oVWSEXFRDu3qdLCTbZOqEjzG23zPkk4UwiMOzgNNCYA9c4HZfSju4/GxdfapHVR bL92WPKR373d3YPjNAW/K62t+4LNecUA0CTwlCms+C1B5knGAB62BPPeVOl90nUcPT4E Yx5Bj+9qjr+yBjCLIEwGwOyXsmsKQJJMvbNEkCzkCQGftHVkaFMIR4BYrpM1dxUmGuXV iS2wP+irBdvbwPx6kR26xVPmgSO8ftTkfbTZleG6nuMwMWlCPUuPYQM+t87hQgoBMXPE XHHw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aS4Chf2z; 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 c2-20020ad45ae2000000b0069b6b410474si25798186qvh.126.2024.04.28.15.16.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 28 Apr 2024 15:16:20 -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=aS4Chf2z; 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 1s1CoS-00076N-D8; Sun, 28 Apr 2024 18:16:00 -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 1s1CoJ-0006vl-1z for qemu-devel@nongnu.org; Sun, 28 Apr 2024 18:15:52 -0400 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s1CoG-0005du-V0 for qemu-devel@nongnu.org; Sun, 28 Apr 2024 18:15:50 -0400 Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-51abf1a9332so5257278e87.3 for ; Sun, 28 Apr 2024 15:15:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714342547; x=1714947347; 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=dbxYPWieuKJ2V2McIsSIqfnAs5Fqc2GnHDeEOuheOAc=; b=aS4Chf2zyBKHi8X7HDPOdG0ZonpyDhjIbPSEesnxJFVUG90ytN3ZJCFEfhtj1n20iR 6l+2cNKb++1WP5Qx2NYHzXQu1clqyVHeP9OW2XpZqXBYUYcUlFw5xT4c/cFC3vv3WIRu V5MvBuGxTamhhU4KPRe1wTn4ALjxT0zTHONmcZPqEd+e1VCQnqhN/55m5YXEemcLOupG fw6Vy7SkztZXZ+tAGdvS6ZopC2glczExsNIogooU1PhTCWuYuR8yndT30Y2OMMfD7TDQ VxOT6TM5mD2m7Zx2D+bKE2xAx7xEBD8wiaSVEv7z6UIhDj+fsVGmt+yJTSszHq7iOPBw tGuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714342547; x=1714947347; 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=dbxYPWieuKJ2V2McIsSIqfnAs5Fqc2GnHDeEOuheOAc=; b=M6bU3i3tLarmhYbKvYaM5SkiCWAEzC2At8ZUlmmfv4bMQSNjLHlm9doXkzcu4k9rin kgiH4LoSPFK1AjIdTFpW+JMJgpokw363zeiKcwsRHnT5U6SngSvYK+3v6nzJEeGwleRF mu9AweU/8T+sIspzDPd265uxnqUABh8znWGqTg3wljj9JN6BrQHibrqn7mN78HaceteB yUVUkigIeiz7HFYXFr/6fcbgr9smrR1GrlS0t7LoRyeKxf5KjczcBjj46pQnYziK8fP4 2l/nKqaUTpBd5vqlY8kczx4gcC/nTJ3a8ZRwuD2j16ctiTHLTl8VHr6U/gpV6x8ztcex upBg== X-Gm-Message-State: AOJu0Yy5LOW+xu3w5bD6HVJdxm//GC2j3S+pP7WNMIWGDlihL+sEXWP+ EJT4fAyDw3ZleoT4YhSyO5K7V4r2MIPEs0atnfu4HRE7tGDH9nPsmeCS/5kKSj8YyTntrlxPj0C j X-Received: by 2002:a19:6909:0:b0:51d:1258:349a with SMTP id e9-20020a196909000000b0051d1258349amr2509865lfc.2.1714342546978; Sun, 28 Apr 2024 15:15:46 -0700 (PDT) Received: from m1x-phil.lan ([176.176.142.130]) by smtp.gmail.com with ESMTPSA id v19-20020a170906339300b00a5592a12fe2sm10905821eja.128.2024.04.28.15.15.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 28 Apr 2024 15:15:46 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Anton Johansson , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 10/24] user: Use get_task_state() helper Date: Mon, 29 Apr 2024 00:14:36 +0200 Message-ID: <20240428221450.26460-11-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240428221450.26460-1-philmd@linaro.org> References: <20240428221450.26460-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::130; envelope-from=philmd@linaro.org; helo=mail-lf1-x130.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 Get the TaskState pointer calling get_task_state(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- gdbstub/gdbstub.c | 3 ++- gdbstub/user-target.c | 4 ++-- linux-user/syscall.c | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 9c2b8b5d0a..b3574997ea 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -32,6 +32,7 @@ #include "exec/gdbstub.h" #include "gdbstub/syscalls.h" #ifdef CONFIG_USER_ONLY +#include "accel/tcg/vcpu-state.h" #include "gdbstub/user.h" #else #include "hw/cpu/cluster.h" @@ -1661,7 +1662,7 @@ static void handle_query_supported(GArray *params, void *user_ctx) #if defined(CONFIG_USER_ONLY) #if defined(CONFIG_LINUX) - if (gdbserver_state.c_cpu->opaque) { + if (get_task_state(gdbserver_state.c_cpu)) { g_string_append(gdbserver_state.str_buf, ";qXfer:auxv:read+"); } g_string_append(gdbserver_state.str_buf, ";QCatchSyscalls+"); diff --git a/gdbstub/user-target.c b/gdbstub/user-target.c index 6646684a4c..a9c6c64512 100644 --- a/gdbstub/user-target.c +++ b/gdbstub/user-target.c @@ -216,7 +216,7 @@ void gdb_handle_query_offsets(GArray *params, void *user_ctx) { TaskState *ts; - ts = gdbserver_state.c_cpu->opaque; + ts = get_task_state(gdbserver_state.c_cpu); g_string_printf(gdbserver_state.str_buf, "Text=" TARGET_ABI_FMT_lx ";Data=" TARGET_ABI_FMT_lx @@ -252,7 +252,7 @@ void gdb_handle_query_xfer_auxv(GArray *params, void *user_ctx) offset = get_param(params, 0)->val_ul; len = get_param(params, 1)->val_ul; - ts = gdbserver_state.c_cpu->opaque; + ts = get_task_state(gdbserver_state.c_cpu); saved_auxv = ts->info->saved_auxv; auxv_len = ts->info->auxv_len; diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 1b42e80f9a..b9b5a387b3 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6463,7 +6463,7 @@ static abi_long do_prctl(CPUArchState *env, abi_long option, abi_long arg2, case PR_GET_TID_ADDRESS: { - TaskState *ts = env_cpu(env)->opaque; + TaskState *ts = get_task_state(env_cpu(env)); return put_user_ual(ts->child_tidptr, arg2); } @@ -8124,7 +8124,7 @@ static int open_self_maps_2(void *opaque, target_ulong guest_start, static int open_self_maps_1(CPUArchState *env, int fd, bool smaps) { struct open_self_maps_data d = { - .ts = env_cpu(env)->opaque, + .ts = get_task_state(env_cpu(env)), .host_maps = read_self_maps(), .fd = fd, .smaps = smaps