From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756569616; cv=none; d=zohomail.com; s=zohoarc; b=giqHyRa+nUeGRB/eHTQA7Rm886jKHjWhqKrFo0Hoe4eQ5mU2BNk6r1zgXcTeXEvqvcNLSGXIT15j/EiJGrWNm4VvgH+b47Cy3kxrLbeBK2VOvGRjEA+GsB7iXpS2aRDXibNdMdqOUm6AITOsa3tS0sEEqZtrsFVSdfqufFdfSzg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756569616; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=9j/Bp+Ofsaajc1QH9mZ+L5jNL3buNCRIVJFSBOGhwRM=; b=gMPQZRFdcdZB2jg+t3fHQXbhrY3oy4/jpOBNSHMLm71mW3aT7TdCmgNDr3ZevljlIbi1Kri1l8BXobECSf7WlvwS0SYu1s6UoNKDODmdIOuUI+/o2n7ZoRuGtRSxeNNgXi0IILRW+behem4AAeVWF6G/EVL2LQ8//MzZ5JcAnWA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756569616856914.6416277156516; Sat, 30 Aug 2025 09:00:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNk1-00085s-I1; Sat, 30 Aug 2025 11:43:45 -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 1us7WS-0002bf-H1 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:24:40 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7WQ-0002Te-Jm for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:24:40 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-771fa8e4190so1831382b3a.1 for ; Fri, 29 Aug 2025 15:24:37 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.24.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:24:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506276; x=1757111076; 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=9j/Bp+Ofsaajc1QH9mZ+L5jNL3buNCRIVJFSBOGhwRM=; b=fm5+FLuhVhgHKpvQkef1V0Qg11O2VyrninPeD3CPKsNiwbOP7BkLrA7GtFRhD9+YzX hMGAZggYb39wI8EM77aVymc5J2ORicTL1HxMnThDzBuB35L7Sf/QAYePG1SjMzRUZ3YW 8gSvlW7cp+AuilGyNneJiwxOwByAwg9elj1/CjD5PSoiwIxTMIQpVqUw5ydd7sS01MUd 4/yXyE2LSeIzwUoVAa+KlU26YFEejVcFUJmx6xOGW1b7rIdNYNIZWygXw2/w47Gio2z2 G9Kr19t37yYoBhfYUwJlvnsd5pvLWD/fER/z5G0ZNesLLtBHWG710Er7Y1Arcjbuvwwf aVcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506276; x=1757111076; 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=9j/Bp+Ofsaajc1QH9mZ+L5jNL3buNCRIVJFSBOGhwRM=; b=ErlBWv35Arrwik9YGqgnseWnU362n11oY6GaKRx0ZjIJMArxgSQ7N4u3vZG+FprFof 2S/KPAeTzfeHTUcZtgVSy9rucSNGIA1MUd6SZwNnLssSq/M7hF9tGAzJIsVH7BXNs5gK zt/yLbk0U0kq/cI9RiVW5uemrGZuGt09koV46EVCohg9J2/nIVbj762JmH5CAKg/bzHi oj+qyhS2QS/YW+GmOdQaV4lUJORlMVflbctWuYl56wFNN/Vo9PGnvXKVnOAikMyfUdci Ioo+ccaivzziuXrWDd6JWwPaufE1BUkb0rsyfyzY96ijUPui/jlxoKu78kIXU4mn2eZj K3PA== X-Gm-Message-State: AOJu0YxGy81QFdYE7uq1EFN+6QGjX2gvdL3eFwOHtWzYRM0Lre4XOPg3 4WZIBdF1lBaD+JqJnDfiPvyNAftYOYPe3n6Ti5y46pQ3SJfsyK2aGpK+jhHpSBB4NzmKC4hCqnm G6zlk4uA= X-Gm-Gg: ASbGncuEMCCreG3YHcj+DR0yyvfEf6jqN41uaNIO0JY7I4Fl/X9VGvov9WqRtC0TEel oG/5z7unnzT/DYQpzOCP/TqvFr1vKJtGJLwETpUx0/Y+38+Q98GSgJ3LqalW0eypTWTQXM20tMy 0iVP7tKc+30RmTWoIh8Lqre/D/abPAz5JJWzeoogn91X9D6xSpSHbim67t+XQK1hbR4ZuA2lIis POkrYYT1M6G5uaVx/MJ2JauJZbOP7/iXuCO2MXeaH5Xs4Qggx3Ns8hQ+GGoqqHlzzTni3EFU9OV 2dSh66S9RdzqB6ihOLcK+f1avn8E/jK73vxjtuiCJVIkXPKZSVj9GPRzQIqS8kDzQXRXDaZNZTT Ezix7QuF8pWFw6bMQWkbIoP/ZtSTSx6ktn8XvBVJj04BuKG2qYLCM+atnF6MI9+gy8tdUatQ= X-Google-Smtp-Source: AGHT+IGCdRpiAhMCHrjl69TC11Slb+COrriaZNgW0wF5wecI+MQTw1M9Q70VNHRL+B7zAWLfovR6Mg== X-Received: by 2002:a05:6a00:4616:b0:770:343b:5457 with SMTP id d2e1a72fcca58-7723e308528mr242100b3a.16.1756506275764; Fri, 29 Aug 2025 15:24:35 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Henk van der Laak , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 01/91] hw/core: Dump cpu_reset in the reset.exit phase Date: Sat, 30 Aug 2025 08:22:57 +1000 Message-ID: <20250829222427.289668-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-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::42b; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42b.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756569617556116600 During reset.hold, the cpu is in an inconsistent state, where the leaf class has not had a chance to initialize state at all. This is visible as a SIGSEGV in "qemu-system-sparc64 -d cpu_reset". Move the dump to the exit phase, where all initialization is certain to be complete. Reported-by: Henk van der Laak Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- hw/core/cpu-common.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index 39e674aca2..26321be785 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -119,11 +119,6 @@ static void cpu_common_reset_hold(Object *obj, ResetTy= pe type) { CPUState *cpu =3D CPU(obj); =20 - if (qemu_loglevel_mask(CPU_LOG_RESET)) { - qemu_log("CPU Reset (CPU %d)\n", cpu->cpu_index); - log_cpu_state(cpu, cpu->cc->reset_dump_flags); - } - cpu->interrupt_request =3D 0; cpu->halted =3D cpu->start_powered_off; cpu->mem_io_pc =3D 0; @@ -137,6 +132,16 @@ static void cpu_common_reset_hold(Object *obj, ResetTy= pe type) cpu_exec_reset_hold(cpu); } =20 +static void cpu_common_reset_exit(Object *obj, ResetType type) +{ + if (qemu_loglevel_mask(CPU_LOG_RESET)) { + CPUState *cpu =3D CPU(obj); + + qemu_log("CPU Reset (CPU %d)\n", cpu->cpu_index); + log_cpu_state(cpu, cpu->cc->reset_dump_flags); + } +} + ObjectClass *cpu_class_by_name(const char *typename, const char *cpu_model) { ObjectClass *oc; @@ -380,6 +385,7 @@ static void cpu_common_class_init(ObjectClass *klass, c= onst void *data) dc->realize =3D cpu_common_realizefn; dc->unrealize =3D cpu_common_unrealizefn; rc->phases.hold =3D cpu_common_reset_hold; + rc->phases.exit =3D cpu_common_reset_exit; cpu_class_init_props(dc); /* * Reason: CPUs still need special care by board code: wiring up --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756571206; cv=none; d=zohomail.com; s=zohoarc; b=OCcW5AhmSw0noTa1WeP0tQgsw80V+gw1bYkOI3AMgdkl0v8mRYCBco0peaBLLviNRmhLQDtbZKrxfaZrDR/K4+x2Vk8r3n6JOtdtlIxFoWO2B0wfOHODe4mMg9iG5x/0jvNAbO+cVje5eTvhccISkIBgFF0MGGI/WBt5CyhY1dc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756571206; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=mOHr0P1cUoVKDM3IaUw7ePoDCqTS/2VdOKzefbBT954=; b=bDJZgAfVDJIOS7aIGos0JJ0O4kAwhdONcaWfpgMFIV1Dv0rrh5zsOCwkI7on0fKuDgU/Vks8sQYJ6aC/RtzYJvg92+TI/sGESfl81LqJerf0LkGgcE2we5k30hn7YVyZydbdxSVjyBgYNDG3DZ1yJ6KDQwLslVio8tkzBENPCvM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756571206074303.8338017968083; Sat, 30 Aug 2025 09:26:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNj9-0005tJ-4B; Sat, 30 Aug 2025 11:42:51 -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 1us7WU-0002cN-DF for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:24:42 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7WS-0002WF-Go for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:24:42 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-771ff6f117aso2304678b3a.2 for ; Fri, 29 Aug 2025 15:24:40 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.24.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:24:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506278; x=1757111078; 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=mOHr0P1cUoVKDM3IaUw7ePoDCqTS/2VdOKzefbBT954=; b=YYR9A0Ugg4yy8NEVb621cW/IGPrEBTtHAQi+mQQ3zoSL2jYOKatnlh6JStwRKBrIdT RqoLFsGs4IValWU5uJR8GXS0haaraJ6x0eqPzzoCnXKuoqHBErJzNSWx1Xb74+Gm7SRz cCARn2hEPqA/6lop7a7d+l9pegd4w1NWnYrDh8h3vgDEDBdVLz5Td/XVYgkOWkGGXevW izr90hmcu58uKcIQJa7q4DaZbPeFRSy6CraHouN6TMddaJfrjLKOC3CJMXRI5ht85mjY NaUNQaXHm7AhUFjSW74kHhpi/T4Ywzs8vZ9+//XOaYBSEIGzjgkOQG0JMDikoDiaRfPz UzPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506278; x=1757111078; 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=mOHr0P1cUoVKDM3IaUw7ePoDCqTS/2VdOKzefbBT954=; b=qkmjOVJ/XrMERF2X8VE8Ky71p9Ly9qT7MDmKw2vos6ZIjGFEhR9k94gdyAoWQd6xvk FaW+qA59bkXk9hWLR66xMCYSLqGW4B2ogH9RETqUwjZIMR7oLZWhdCivJVXOnmY44ctY JIW6wnaU8v+Z3CXnRZhUVhv4CmaaAFcDUFZrktnfUA9mdb6+LiU+V8M5R48IkS/000mO e9d1gEdIE6mkKsptkTUpBPS7Ew3Z3TTFvFi+Kcxs6UURK4MfbQtDfBUYRKhjwfpDjVK/ 95MGtoA8aJzwWBNm6wuCAfDURRa0iGv8UIisVxw94gCVRWiPtENHO5zFYj55Mv3WutE5 Hs5g== X-Gm-Message-State: AOJu0Yz89LsGp74KnPgwhrkcna/sE0AgpVaBxD+2Rk7htnvcm9aux21s OMUXXccEbsbHgYn4r7Vff8pK9w7ceiHz4eHysME++I4c1s1xL8KH5b3xtiDaSMptUaWn5R1/JWF xc7z5jbM= X-Gm-Gg: ASbGncv6NKyYLZsWdZ778AJsFAQxxjvGZHjrx7AnpMp3qd5445bfJUjv1pJqCGPqCOv 6cngKU6x7iqgVHVuMpGqoP9ZKoJIqTiBWr1Ax9uwKUggrflZfueQJmv+x0lKXhA65jTqUTWggnp w/71YTksK0oY8Vp7QnnLR6PjbBuj1PlmS40TTKDm9CEejeUvyJTGb6g4p0zj/O94dpqMViUQyVr gagE25uRxVT/hyEPrT4zuzTR8TQUkfLXoXpx9O70ry8l032B7runAHJejEUSWVVavA8jo1gDgxd o9L77S1MYGd7o7pjR6QMQhHMG6tcsgZzP7qZ6eTPtU/a2PRQhdbCi+jo1ZYe0u/KVz05ZNBpCsY sfA+k+7Z4v7e81NbUlXyJIcCOIfYk8H3MOFu/SaHjxzP2VjwS09My3CD6RpLB0V7liUvGXgg= X-Google-Smtp-Source: AGHT+IErdbSLZ6OtWY33IXwOpjTzBfrmEc2yA/O4DYMS5VmcZgingxjFQtO7M2G0FWTphzdgxUcv4g== X-Received: by 2002:a05:6a00:4b48:b0:772:1a0:f772 with SMTP id d2e1a72fcca58-7723e3920c3mr254693b3a.28.1756506278588; Fri, 29 Aug 2025 15:24:38 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 02/91] hw/core: Use qemu_log_trylock/unlock in cpu_common_reset_exit Date: Sat, 30 Aug 2025 08:22:58 +1000 Message-ID: <20250829222427.289668-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-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::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756571207710124100 Ensure that the "CPU Reset" message won't be separated from the cpu_dump_state output. Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- hw/core/cpu-common.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index 26321be785..259cf2a3c3 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -135,10 +135,15 @@ static void cpu_common_reset_hold(Object *obj, ResetT= ype type) static void cpu_common_reset_exit(Object *obj, ResetType type) { if (qemu_loglevel_mask(CPU_LOG_RESET)) { - CPUState *cpu =3D CPU(obj); + FILE *f =3D qemu_log_trylock(); =20 - qemu_log("CPU Reset (CPU %d)\n", cpu->cpu_index); - log_cpu_state(cpu, cpu->cc->reset_dump_flags); + if (f) { + CPUState *cpu =3D CPU(obj); + + fprintf(f, "CPU Reset (CPU %d)\n", cpu->cpu_index); + cpu_dump_state(cpu, f, cpu->cc->reset_dump_flags); + qemu_log_unlock(f); + } } } =20 --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756570265; cv=none; d=zohomail.com; s=zohoarc; b=kVVtP3eQUdd8CNF8bvQRiqhScbqNJF1rPA/ipE+saXN5t/D2dBYkMuYjg4KqUp72pHR5XlM3cXBJH3FdXO7Do6V76TIFy5+Hr/GkK/8GBEmXDsSpr5PgZ6ulEX9FV8E8HjEKv6Sw8kmIcgph2bYz+YcKLR9u/0bXj/2eBVkkFxE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756570265; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=UOcWUc5rHijwQW3sC3RaBXrOkg4imftVqoCeUx1b1us=; b=f2pNuQ/qME+CN1iSbmWm4T+RWLXBxE2u3vLOEx955Pm/3XZPKFrZA5kiDFd4i+9U310V9UJfhJmcqeTUo0hMamtGHBIXmiorOkxahgdrknbWsD4VUJZhsT6rQcpGU8pfuARrU5fYsUqiulzIyklV8IgYtXyCzwvKQB1/xw2mpYo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756570265108662.4860778314293; Sat, 30 Aug 2025 09:11:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNjD-0006Aa-Qi; Sat, 30 Aug 2025 11:42:56 -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 1us7WY-0002dm-2l for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:24:46 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7WU-0002Ya-WA for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:24:45 -0400 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-76e6cbb991aso2490753b3a.1 for ; Fri, 29 Aug 2025 15:24:42 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.24.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:24:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506281; x=1757111081; 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=UOcWUc5rHijwQW3sC3RaBXrOkg4imftVqoCeUx1b1us=; b=HGDZ5/PPPPUzCT0QP20gHWeZmiFFKlyFCbDM/g93bzV5bnC3Qs+rwxcq7WKdAgLp9C bIv4BblliapAShNE8OPjJafHMWAnd4Z2Rk/MRk8VPhG+UYonAWcxGxqEP6LRV44aN1el MDxBOKrhN/dmGkb75AtVRLCTt0BHlQ08XhIVlRjNGx/tvHWpL0CD7PxagSTEt/zc0RDU TROwn7S3toaMgI7r596Ayj3bjil8o8S7sOqx++pvvYRCgwO5esglMMzkhUYESrY1/ld/ mQx8ZNCQfzFAW4v/b5TOLaT6YcFAj9w0oyPjSyCoURMFS3rOsRyhZdP1q09EmYtDOriL iIWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506281; x=1757111081; 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=UOcWUc5rHijwQW3sC3RaBXrOkg4imftVqoCeUx1b1us=; b=BHvhMnKu9rcFKCOARtZNVdJg+/x227usPiiLTCxGf4udo6pJ7w+3ad/1ekFt8iLTOt dAD2wQRrGUTrDMG0qGGJOEWmVhERffvksIMyWgS29MWdoO73iVMVwDkviijjT16Ky6so oKs2/6Kl5G98TIQSZS5zhqA0MOc0jY2RXkRtzasngRoVfMBjmnsG8aNgszMDJvf/TPpR tXqtajJV+unVq0OrKZAk6rKfGA5ZP9hfR4OL+p6iuJv9/eSMrDKzAXiZSloSBwCkbKOH SlP1OEGpbgfhPoHHelkdjnUUQKuGUopwgVT31RuqHWreAskcSoAkuOc2j2fINSufqnA8 T5qg== X-Gm-Message-State: AOJu0YxA8V6JpjVkah3eHvYyMmrYWBjNFt1s+VNh3YV97mrECb3MNNbv ZtzBWBhVzMMi3AmnBZQ2hxywK6sC1IWnwB+kyw0CrYZ1+gmBNeiYwXIIqus9bLwCRYlKU8W+W2q GJvMO2vo= X-Gm-Gg: ASbGncvvSmjmt4CPByBNq97Jnq49GvcMA6n4yznd09H9xx4DhjgpYYpjYFk52BVxu7Z ltO3lli6+a4lkIf0F/xenZwuPyNvDATRuo7z0ohDaSt+Yjlctydyk+McflusDMos55pJrJ820f+ mjBsuZddyx1rM6DIo956DsbG2LtvlVaC3wo4XqDbmUc1Wu4OAFqkBKlGxXtiiimQxYLIF9DTjAU kswWfYZ/SRPNk6zvM/12AbmaxCJcF97LpMXbHgEiMYb4YHgEp/8VEhdY6vScan+JIv+IL0tKlXl cUoqHyl6oWwSJicwl90mYHzjpxISdexGua9NzYq01MXeSVLnr8FpwzFSbNSxWr9ERpWF/hbgeHy 0JlpXbiJdTuF1VVnxvDCeT6mDSmM60PJvrzpYrvybYiRtUnklYUzBw0yPM9o8 X-Google-Smtp-Source: AGHT+IHuUveqfkfC+6KXlw/14GbFhELbZIwmXziACfIQGIKoyWGgbeNp6mlG+cxoKUQzzqEETObESw== X-Received: by 2002:a05:6a00:1482:b0:771:ea2e:b002 with SMTP id d2e1a72fcca58-7723e22d0a2mr244843b3a.10.1756506281271; Fri, 29 Aug 2025 15:24:41 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 03/91] linux-user: Tidy print_socket_protocol Date: Sat, 30 Aug 2025 08:22:59 +1000 Message-ID: <20250829222427.289668-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-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::433; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x433.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756570266922116600 Sink all of the qemu_log calls to the end, collecting only a string for the name, if identified. Merge separate if blocks into one switch. Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- linux-user/strace.c | 102 ++++++++++++++++++++++---------------------- 1 file changed, 52 insertions(+), 50 deletions(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index 786354627a..1233ebceb0 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -499,116 +499,118 @@ print_socket_type(int type) static void print_socket_protocol(int domain, int type, int protocol) { - if (domain =3D=3D AF_PACKET || - (domain =3D=3D AF_INET && type =3D=3D TARGET_SOCK_PACKET)) { - switch (protocol) { - case 0x0003: - qemu_log("ETH_P_ALL"); - break; - default: - qemu_log("%d", protocol); - } - return; - } + const char *name =3D NULL; =20 - if (domain =3D=3D PF_NETLINK) { + switch (domain) { + case AF_PACKET: + switch (protocol) { + case 3: + name =3D "ETH_P_ALL"; + break; + } + break; + + case PF_NETLINK: switch (protocol) { case NETLINK_ROUTE: - qemu_log("NETLINK_ROUTE"); + name =3D "NETLINK_ROUTE"; break; case NETLINK_UNUSED: - qemu_log("NETLINK_UNUSED"); + name =3D "NETLINK_UNUSED"; break; case NETLINK_USERSOCK: - qemu_log("NETLINK_USERSOCK"); + name =3D "NETLINK_USERSOCK"; break; case NETLINK_FIREWALL: - qemu_log("NETLINK_FIREWALL"); + name =3D "NETLINK_FIREWALL"; break; case NETLINK_SOCK_DIAG: - qemu_log("NETLINK_SOCK_DIAG"); + name =3D "NETLINK_SOCK_DIAG"; break; case NETLINK_NFLOG: - qemu_log("NETLINK_NFLOG"); + name =3D "NETLINK_NFLOG"; break; case NETLINK_XFRM: - qemu_log("NETLINK_XFRM"); + name =3D "NETLINK_XFRM"; break; case NETLINK_SELINUX: - qemu_log("NETLINK_SELINUX"); + name =3D "NETLINK_SELINUX"; break; case NETLINK_ISCSI: - qemu_log("NETLINK_ISCSI"); + name =3D "NETLINK_ISCSI"; break; case NETLINK_AUDIT: - qemu_log("NETLINK_AUDIT"); + name =3D "NETLINK_AUDIT"; break; case NETLINK_FIB_LOOKUP: - qemu_log("NETLINK_FIB_LOOKUP"); + name =3D "NETLINK_FIB_LOOKUP"; break; case NETLINK_CONNECTOR: - qemu_log("NETLINK_CONNECTOR"); + name =3D "NETLINK_CONNECTOR"; break; case NETLINK_NETFILTER: - qemu_log("NETLINK_NETFILTER"); + name =3D "NETLINK_NETFILTER"; break; case NETLINK_IP6_FW: - qemu_log("NETLINK_IP6_FW"); + name =3D "NETLINK_IP6_FW"; break; case NETLINK_DNRTMSG: - qemu_log("NETLINK_DNRTMSG"); + name =3D "NETLINK_DNRTMSG"; break; case NETLINK_KOBJECT_UEVENT: - qemu_log("NETLINK_KOBJECT_UEVENT"); + name =3D "NETLINK_KOBJECT_UEVENT"; break; case NETLINK_GENERIC: - qemu_log("NETLINK_GENERIC"); + name =3D "NETLINK_GENERIC"; break; case NETLINK_SCSITRANSPORT: - qemu_log("NETLINK_SCSITRANSPORT"); + name =3D "NETLINK_SCSITRANSPORT"; break; case NETLINK_ECRYPTFS: - qemu_log("NETLINK_ECRYPTFS"); + name =3D "NETLINK_ECRYPTFS"; break; case NETLINK_RDMA: - qemu_log("NETLINK_RDMA"); + name =3D "NETLINK_RDMA"; break; case NETLINK_CRYPTO: - qemu_log("NETLINK_CRYPTO"); + name =3D "NETLINK_CRYPTO"; break; case NETLINK_SMC: - qemu_log("NETLINK_SMC"); - break; - default: - qemu_log("%d", protocol); + name =3D "NETLINK_SMC"; break; } - return; - } + break; =20 - if (domain =3D=3D AF_INET || domain =3D=3D AF_INET6) { + case AF_INET: + case AF_INET6: switch (protocol) { + case 3: + if (domain =3D=3D AF_INET && type =3D=3D TARGET_SOCK_PACKET) { + name =3D "ETH_P_ALL"; + } + break; case IPPROTO_IP: - qemu_log("IPPROTO_IP"); + name =3D "IPPROTO_IP"; break; case IPPROTO_TCP: - qemu_log("IPPROTO_TCP"); + name =3D "IPPROTO_TCP"; break; case IPPROTO_UDP: - qemu_log("IPPROTO_UDP"); + name =3D "IPPROTO_UDP"; break; case IPPROTO_RAW: - qemu_log("IPPROTO_RAW"); - break; - default: - qemu_log("%d", protocol); + name =3D "IPPROTO_RAW"; break; } - return; + break; } - qemu_log("%d", protocol); -} =20 + if (name) { + qemu_log("%s", name); + } else { + qemu_log("%d", protocol); + } +} =20 #ifdef TARGET_NR__newselect static void --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756570802; cv=none; d=zohomail.com; s=zohoarc; b=B5GXwWeKc5uerOp/gT/kRiRQYKD1oKjZALMU3+jB3B9xKM2HMU4w1TXVA25gYmuK3EzoQgx7+Qhh3xHL3H9prXTZxwZQN+N0IY94iIFUdQ+96LVOIgAW/ERb5UjQvnmbNLgbJO8OQ+xF+lh2u4q2lvJfEETi40d3i0zmZdP51LU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756570802; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=H0Ggm9wlx+9xy29EQzn7RdgHf/CbCvu60/I/6/mmVNA=; b=eLuN1bpI7csYQIlHowMpI1HBCux2wbIT8h4KJ3QiCpixyItyFzzh6O0OlUcAwhHI4gmphxhZHwEjjr/pKwXEcPKw0Zwjcn5Q4yF/Svgc+hOX5CZKG9448jXvI9MyS6V2TSJEWot/64UXP2muCgxP7ZBtAbQBYl8cd4Znn42bdz0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756570802778444.5760272910235; Sat, 30 Aug 2025 09:20:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNjJ-0006bV-PZ; Sat, 30 Aug 2025 11:43:01 -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 1us7Wb-0002eW-Ci for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:24:50 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7WY-0002aL-6x for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:24:49 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-771e15ce64eso2273561b3a.0 for ; Fri, 29 Aug 2025 15:24:45 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.24.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:24:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506284; x=1757111084; 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=H0Ggm9wlx+9xy29EQzn7RdgHf/CbCvu60/I/6/mmVNA=; b=EhJysH+opPv6pKep1Zygg23NlGgRn8M5mFaFMYYdZ/8X8B70o0F4DagjMyBzzORf/l tmkfmckBrLOXB0tx/3O30uEHe2nK+Oht+6ouBKzAmDy11CKFHmA7h0qnHyBrv7xP3/yv 1yxwGoKeDhZHikEAbPFUjZBtAd6D5WYZTHFLnxxBl7KltxtFO6fQFuWO5voythsMcnEm mZT2AcyzPDyqBqdWlUN/iAYQlMdd139lefZPMpMWspXMsO+1HYLcnHaP8ZHbW6rR8rQa NUiZVrIpYIgRy4seIt1gEfxFo8B7Fwq5PeUW7gkGttW3RPcpr8vDGfPnu3fHNzliAcdQ GSCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506284; x=1757111084; 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=H0Ggm9wlx+9xy29EQzn7RdgHf/CbCvu60/I/6/mmVNA=; b=t8Q7gp4fdpWGr849a/7MRsGg6XQNCGS5bUDlmUiXFyTf+LUCo4YryJwwXR5BegucKE qPrQ/5ZDZ1DAzwPz5i/SZnfy4BdV7tqoQrPfLqPRy4TT1XaL01xV5r7ixtbmPUyVgz/E eEY/Dydy8ixZzli6TqTCEGsHoB1OdWdrfUttTsXwpTmPnDz9uIt+wZq6q5eYh2cQ0+LO 6sy3nJtGgb122edEgRz9IUHPTaRok6kkOwUK8rnOHKLYlu/7LCQpUcDxuOEBTZWBKya/ bCHgtw8mhkchIqjg5aUKCRIL71lZieKy7S3GmBet+FGlEkf64AzQpsN9kaP36qcxINq1 OA9g== X-Gm-Message-State: AOJu0YwqmoTtHwJd4jQ4QwauPJmb2cjHBhXwq3ByFwK/iwWEFAkqMdvx xSKnqAFgK7b8TPig7xx4o9aK1kiLqWoFJ8WQQO6QynrWYSwcJOJrrrnCgvhomzc+t5tPNpkbwra smZnAzrk= X-Gm-Gg: ASbGncuXLO0dDlKtBRjUeuLqMZ86OZ057y8zXyE7cm13CWESzc/AiFTizFCayxZIq3e ADyWYXt3PkWmagyHf+PipuIBakZK+RHvlZ/9LsujDwbVvD29fcXpQevydBqj+1/OIX/beOfKkpO aFxlsPsHl0Ob/7R3QhtXrB5XxfoBb037k8PpJGaDXl35fJzIt9bMJHLQxyvP1z/qONuDzp/Lp8P NB5RhitEYbPRLIXA9YIyv1+X67QGW71dK72XNIeMa1cyZDnuUMWbRvzoJLom9keJO0phXvlUoMv n/9Qvjx+rPBtQ4OLv0aX64/aBIYLa7tflmYYMoFlKAYcbNVoBQ8sZafoFGbXlGeGqN/CPZ9GPD/ wqkjDx+ZWSsyHX1+SsUe/HC+Qpwlr6chA8l4yKmTiwwpDM00OcKmZIqb2mLol X-Google-Smtp-Source: AGHT+IGgwAtFm/zW2VAYRCXULc4/gfxnnGl50fxq7QFYBAUx2KYn8im8KALQfb7CJeO3wj7g4v5e4w== X-Received: by 2002:a05:6a00:114b:b0:771:d7b0:6944 with SMTP id d2e1a72fcca58-7723e21ed20mr275593b3a.3.1756506284484; Fri, 29 Aug 2025 15:24:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth Subject: [PULL 04/91] linux-user: Drop deprecated -p option Date: Sat, 30 Aug 2025 08:23:00 +1000 Message-ID: <20250829222427.289668-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-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::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756570803223116600 From: Peter Maydell The user-mode '-p' option has been deprecated since 9.0 and doesn't do anything except emit a warning. We are well past our minimum deprecation period, so drop the option. Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Signed-off-by: Peter Maydell Signed-off-by: Richard Henderson Message-ID: <20250828162012.3307647-1-peter.maydell@linaro.org> --- bsd-user/main.c | 8 -------- linux-user/main.c | 12 ------------ docs/about/deprecated.rst | 10 ---------- docs/about/removed-features.rst | 8 ++++++++ docs/user/main.rst | 3 --- 5 files changed, 8 insertions(+), 33 deletions(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index 7e5d4bbce0..9ba69642f5 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -367,14 +367,6 @@ int main(int argc, char **argv) } } else if (!strcmp(r, "L")) { interp_prefix =3D argv[optind++]; - } else if (!strcmp(r, "p")) { - unsigned size, want =3D qemu_real_host_page_size(); - - r =3D argv[optind++]; - if (qemu_strtoui(r, NULL, 10, &size) || size !=3D want) { - warn_report("Deprecated page size option cannot " - "change host page size (%u)", want); - } } else if (!strcmp(r, "g")) { gdbstub =3D g_strdup(argv[optind++]); } else if (!strcmp(r, "r")) { diff --git a/linux-user/main.c b/linux-user/main.c index 6edeeecef3..7b0ccb6fd6 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -340,16 +340,6 @@ static void handle_arg_ld_prefix(const char *arg) interp_prefix =3D strdup(arg); } =20 -static void handle_arg_pagesize(const char *arg) -{ - unsigned size, want =3D qemu_real_host_page_size(); - - if (qemu_strtoui(arg, NULL, 10, &size) || size !=3D want) { - warn_report("Deprecated page size option cannot " - "change host page size (%u)", want); - } -} - static void handle_arg_seed(const char *arg) { seed_optarg =3D arg; @@ -522,8 +512,6 @@ static const struct qemu_argument arg_table[] =3D { "range[,...]","filter logging based on address range"}, {"D", "QEMU_LOG_FILENAME", true, handle_arg_log_filename, "logfile", "write logs to 'logfile' (default stderr)"}, - {"p", "QEMU_PAGESIZE", true, handle_arg_pagesize, - "pagesize", "deprecated change to host page size"}, {"one-insn-per-tb", "QEMU_ONE_INSN_PER_TB", false, handle_arg_one_insn_per= _tb, "", "run with one guest instruction per emulated TB"}, diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index d50645a071..5d1579dcf8 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -81,16 +81,6 @@ kernel since 2001. None of the board types QEMU supports= need ``param_struct`` support, so this option has been deprecated and will be removed in a future QEMU version. =20 -User-mode emulator command line arguments ------------------------------------------ - -``-p`` (since 9.0) -'''''''''''''''''' - -The ``-p`` option pretends to control the host page size. However, -it is not possible to change the host page size, and using the -option only causes failures. - QEMU Machine Protocol (QMP) commands ------------------------------------ =20 diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.= rst index d7c2113fc3..25a904032c 100644 --- a/docs/about/removed-features.rst +++ b/docs/about/removed-features.rst @@ -571,6 +571,14 @@ The ``-singlestep`` option has been given a name that = better reflects what it actually does. For both linux-user and bsd-user, use the ``-one-insn-per-tb`` option instead. =20 +``-p`` (removed in 10.2) +'''''''''''''''''''''''' + +The ``-p`` option pretends to control the host page size. However, +it is not possible to change the host page size; we stopped trying +to do anything with the option except print a warning from 9.0, +and now the option is removed entirely. + =20 QEMU Machine Protocol (QMP) commands ------------------------------------ diff --git a/docs/user/main.rst b/docs/user/main.rst index 347bdfabf8..a8ddf91424 100644 --- a/docs/user/main.rst +++ b/docs/user/main.rst @@ -262,9 +262,6 @@ Debug options: Activate logging of the specified items (use '-d help' for a list of log items) =20 -``-p pagesize`` - Act as if the host page size was 'pagesize' bytes - ``-one-insn-per-tb`` Run the emulation with one guest instruction per translation block. This slows down emulation a lot, but can be useful in some situations, --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756570006; cv=none; d=zohomail.com; s=zohoarc; b=hQKHEV+SXmjTixCkC5xR4j25DdGINmZ1YdyN9wXnTVAZ0VvDyIEugviGPTCYvKanYtWM2g92H3XoFaWfxazw1uIcXeqtEW6b3293AdbKoghgAjXC9lNPhr1uTG/8dLSusygVRWqHZKXzBhBdR+w2acGiZ5rYEPBJs31Gtr1UULU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756570006; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=f5I/NtM7Pi+1byAnsGGTmyqoepcDZYWEIZxl5JuqsYk=; b=eaeNHFZUvuxA12XMCfEnBoWK4DD7O0dNl5ihcCd+G/Wn/KILzqQ9VQ+zg+G/EegPKxJkaC7g36ibGQpZ4dXq/oEIBKX/Qeayktr2AHDva9JHbY3J93fiIxtg1BbCIHovESeG7Uk0IvCf5MLT7YeDYIb7wUwBykV1qee3JyDmJGk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756570006852597.0989721328958; Sat, 30 Aug 2025 09:06:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNjl-00075k-8o; Sat, 30 Aug 2025 11:43:31 -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 1us7We-0002fU-2L for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:24:52 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7Wa-0002b4-OQ for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:24:51 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-7704f3c4708so3116926b3a.1 for ; Fri, 29 Aug 2025 15:24:48 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.24.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:24:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506287; x=1757111087; 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=f5I/NtM7Pi+1byAnsGGTmyqoepcDZYWEIZxl5JuqsYk=; b=DxzyeTe+o4lcbIR9v+7saHyJdzQCCMY8W9oNb6UhghPRcAVQl2YvRfsFd3nmopl3yQ u3oAmpFLoGeRIfMOEUleYjxjHQh/ZNCcDFu1CWtqHl9CnalooTMTkKl0vzN9cDOwbmqx g4ES87DmJZqTZdV0FsCBY/yFG8vyeYs3fffdUraztAc2F/06djy0qBUVD4Yn8TMG1MYk 5jdGuSKAhO2jWFKWREXeNNs5ql7eoAo9E0jIbG/5H/74tK7zGs5Qj23NLJ72cfZyZ92n wtMZ7wfwu9dQ7+148jPfglXZqwY+NpzC7RTrZd9KXt3EZC3F+m84spvYkIvaUpT/cB2U KW1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506287; x=1757111087; 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=f5I/NtM7Pi+1byAnsGGTmyqoepcDZYWEIZxl5JuqsYk=; b=c3qcdmALcItF+SzlEwJK6d08gN6OnaEuBnmdpSqt2Go7m7zA5iRsQCUCtf+4OrtrMj E8ASo/hZK2Apy5MkuiwabsH3kLbvNhzn/6HsvEe50UA/CDrfqgnEW3ekn8S1PqVigWhs +mSjkGtRD3d61V162PL3z1F5NkfJXsDockoDojpJlBdLu0Rzs0tvQKg5W1Pic6i0Xgxa 7IGT1yayvqhlVskbJ9GOEoQUs/+OaypQuQkmVaT3RfLaQIOvg1zrqdtwmUvuF1BIP5L8 klsfiOGEK8LDy+Ucp7UYp8b/D2QLdpYHAowAvK2VBAMYWhVscUeqL2XpV/gJYk6HVVEj h0hg== X-Gm-Message-State: AOJu0YwucgDMrE5lb3m46j7nAv+EKaQKovmhtbJBYAay+v//YG2/BAUH IOu73RMMztGbf0voOp0bvMbhdBi6AbjCohYcqWvxBbOvJfl2IHQ8fVx8D/TsCKz5Qn7YPnYnoXo /xGfQgl8= X-Gm-Gg: ASbGncuIhRlT0UGo6kEN/ih11KFCHbN956hHmg+3QyvUUYDcUdMllMzdPwuwy3wdiGm l05yVtSyeC6btJeITpuRDEBKTHY4JPQ32Zn33ait+iNwEuSsIJM9156SSD0c/tcNc/XSgFtKeYa ZVVwTrZTttFeqFyGWmKRJ9nvuqmo5qTWZg8q5FlDZkvC9l7z2acgIjmIc7OY55p90nWVRXTtYdd G4gpR7Nfhbc+znA9V0615v1GOSrTchgdXraedcUMhi35g56Dyz6M164UyV5Y+qtDVOijSb/SdN8 JhCBWilYsOkX/twNcQLmPd9aEduwHFimE28OlCuRd2x00+UmfXXPl1zPpKozOFT9fbv90EIwyyd LDPnSVXysBQsW7+jEALfz7axY85GVGyLd4YYbp8vr9l9MuyifCVge3k8A9Rvfzi950LIuJyY= X-Google-Smtp-Source: AGHT+IHTehE9+fW/jscaj6Rdo1FqDTGrBWryGjvOxEmdYxNNZHcl748Terk6JGHjaU2tKTod3sTamQ== X-Received: by 2002:a05:6a00:1495:b0:772:2850:783d with SMTP id d2e1a72fcca58-7723e387ed0mr284737b3a.22.1756506286787; Fri, 29 Aug 2025 15:24:46 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 05/91] linux-user/x86_64: Convert target_elf_gregset_t to a struct Date: Sat, 30 Aug 2025 08:23:01 +1000 Message-ID: <20250829222427.289668-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756570007692116600 Content-Type: text/plain; charset="utf-8" A structure typedef may be abstract, while an array typedef cannot. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/elfload.c | 60 +++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index fce4c05674..ba205c5a19 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -154,7 +154,9 @@ typedef abi_int target_pid_t; #define ELF_ARCH EM_X86_64 =20 #define ELF_NREG 27 -typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; +typedef struct target_elf_gregset_t { + target_elf_greg_t regs[ELF_NREG]; +} target_elf_gregset_t; =20 /* * Note that ELF_NREG should be 29 as there should be place for @@ -163,35 +165,35 @@ typedef target_elf_greg_t target_elf_gregset_t[ELF_N= REG]; * * See linux kernel: arch/x86/include/asm/elf.h */ -static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUX86Sta= te *env) +static void elf_core_copy_regs(target_elf_gregset_t *r, const CPUX86State = *env) { - (*regs)[0] =3D tswapreg(env->regs[15]); - (*regs)[1] =3D tswapreg(env->regs[14]); - (*regs)[2] =3D tswapreg(env->regs[13]); - (*regs)[3] =3D tswapreg(env->regs[12]); - (*regs)[4] =3D tswapreg(env->regs[R_EBP]); - (*regs)[5] =3D tswapreg(env->regs[R_EBX]); - (*regs)[6] =3D tswapreg(env->regs[11]); - (*regs)[7] =3D tswapreg(env->regs[10]); - (*regs)[8] =3D tswapreg(env->regs[9]); - (*regs)[9] =3D tswapreg(env->regs[8]); - (*regs)[10] =3D tswapreg(env->regs[R_EAX]); - (*regs)[11] =3D tswapreg(env->regs[R_ECX]); - (*regs)[12] =3D tswapreg(env->regs[R_EDX]); - (*regs)[13] =3D tswapreg(env->regs[R_ESI]); - (*regs)[14] =3D tswapreg(env->regs[R_EDI]); - (*regs)[15] =3D tswapreg(get_task_state(env_cpu_const(env))->orig_ax); - (*regs)[16] =3D tswapreg(env->eip); - (*regs)[17] =3D tswapreg(env->segs[R_CS].selector & 0xffff); - (*regs)[18] =3D tswapreg(env->eflags); - (*regs)[19] =3D tswapreg(env->regs[R_ESP]); - (*regs)[20] =3D tswapreg(env->segs[R_SS].selector & 0xffff); - (*regs)[21] =3D tswapreg(env->segs[R_FS].selector & 0xffff); - (*regs)[22] =3D tswapreg(env->segs[R_GS].selector & 0xffff); - (*regs)[23] =3D tswapreg(env->segs[R_DS].selector & 0xffff); - (*regs)[24] =3D tswapreg(env->segs[R_ES].selector & 0xffff); - (*regs)[25] =3D tswapreg(env->segs[R_FS].selector & 0xffff); - (*regs)[26] =3D tswapreg(env->segs[R_GS].selector & 0xffff); + r->regs[0] =3D tswapreg(env->regs[15]); + r->regs[1] =3D tswapreg(env->regs[14]); + r->regs[2] =3D tswapreg(env->regs[13]); + r->regs[3] =3D tswapreg(env->regs[12]); + r->regs[4] =3D tswapreg(env->regs[R_EBP]); + r->regs[5] =3D tswapreg(env->regs[R_EBX]); + r->regs[6] =3D tswapreg(env->regs[11]); + r->regs[7] =3D tswapreg(env->regs[10]); + r->regs[8] =3D tswapreg(env->regs[9]); + r->regs[9] =3D tswapreg(env->regs[8]); + r->regs[10] =3D tswapreg(env->regs[R_EAX]); + r->regs[11] =3D tswapreg(env->regs[R_ECX]); + r->regs[12] =3D tswapreg(env->regs[R_EDX]); + r->regs[13] =3D tswapreg(env->regs[R_ESI]); + r->regs[14] =3D tswapreg(env->regs[R_EDI]); + r->regs[15] =3D tswapreg(get_task_state(env_cpu_const(env))->orig_ax); + r->regs[16] =3D tswapreg(env->eip); + r->regs[17] =3D tswapreg(env->segs[R_CS].selector & 0xffff); + r->regs[18] =3D tswapreg(env->eflags); + r->regs[19] =3D tswapreg(env->regs[R_ESP]); + r->regs[20] =3D tswapreg(env->segs[R_SS].selector & 0xffff); + r->regs[21] =3D tswapreg(env->segs[R_FS].selector & 0xffff); + r->regs[22] =3D tswapreg(env->segs[R_GS].selector & 0xffff); + r->regs[23] =3D tswapreg(env->segs[R_DS].selector & 0xffff); + r->regs[24] =3D tswapreg(env->segs[R_ES].selector & 0xffff); + r->regs[25] =3D tswapreg(env->segs[R_FS].selector & 0xffff); + r->regs[26] =3D tswapreg(env->segs[R_GS].selector & 0xffff); } =20 #if ULONG_MAX > UINT32_MAX --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756569589; cv=none; d=zohomail.com; s=zohoarc; b=SRCxPYpTFl6w7FV8NLPZxru4kRbb/Zv4VN7f/kl/zQG0nuFbnRSt5o6ziTqZoMBfeesp6tlYN72BACHljekiy1HuvJc1SxFfh6K/i5NP2m71yv26YeoJgx1c/JJYY1E77j76RSOAaTdH9KvItquflVAZyBSJ1h2OQYN5Bnd38JY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756569589; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Z4f8Bk40mBnFtjMnElfv2A+6k42T3Vl2Ap1FLvlfy/s=; b=mjSEgOS0peuagqVdqMSl1Q952NVla4d0VxJhPk+z/OGhLcG1VWIL62wNTXrI5YYt9MxNiO8EBy3IhKd3jYMAmjZfPQuiA7obRN6u+AI+8LDSZsSny71lGu36dcZ2GgRF4TYXMBk57pf2sVdzll4IlWwADa9PV8yfPsWSIjdSIpE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756569589137654.9580260053049; Sat, 30 Aug 2025 08:59:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNjw-0007Qn-F1; Sat, 30 Aug 2025 11:43:40 -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 1us7Wf-0002fz-7s for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:24:53 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7Wd-0002di-3h for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:24:52 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-771ed4a8124so2659562b3a.2 for ; Fri, 29 Aug 2025 15:24:50 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.24.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:24:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506289; x=1757111089; 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=Z4f8Bk40mBnFtjMnElfv2A+6k42T3Vl2Ap1FLvlfy/s=; b=NhiCoejFNjT22znBHfOXlOaikLeY2XB8T2VNQZGzYwHOCMH3sSDeUQiKNSBAcoLQVf 0EqL1fsFAq6yuAOBjquM7YkVzgJToXjd00z7NLfaC8mxZBHca7+9hXDaj4YiL3SUL3Km i4yOuDuhb3xA6qES801XdxMDeUovYt/nwc7LIcj0l3+qw2ONFM59MDVULXKo1VoQoJDX MzF35z74s/debI7FU9IVdsHeY2c6K49V3l8GSh1zN4O3PKMjdTxrEMa4NMPgGnMn6CUK ZTAzde8JshSzxebWAuTxc+zCWr35liuk7vv2aY+BJrb6fYzvZlPhcwZ6YsXk+1zc2J5q uLpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506289; x=1757111089; 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=Z4f8Bk40mBnFtjMnElfv2A+6k42T3Vl2Ap1FLvlfy/s=; b=Flbly4BHsCCcVyH7S+LsCrrsx+yiDcqej94T1m8oLVwrRnW5Ghr9QVhH+2PSUYFOdO 6BP7tK8c38bR86rIr7RTnQGsPNtCRiJc+FuN/aalvL3jlTboCsb3CCfXkha/faFgxZ5A 3bKyJdGlL/Q8aRDCHK7A/nuEfMU4xOgRJhYxpyNAanvPaBUe5lboDJ3J6f/TjKJxdKB1 ue5/838M2qDUTowVlqscvpoWR63J+auHf7CJgE/ukSqt3gPml1d6jxdllEg14HGHTUYA mWefhvY0OTpjHGS3Z9KjPhM1eVNi2pa/PQ+muj78exuUxVQ9FvdhaaDGF6zUAIpNvv8r 07HA== X-Gm-Message-State: AOJu0Yx1PEftxJReJ04obNFtPgjG6pyVDu/ox3jzTLPmA2cRaxZkQLvE dWhkCKmVERRguDaKQ8k5h+7HxUFjDvK6FOKRpHEZ2yQh7dM/NvHc32EJ+LWJ77ELZdYwmM36Ovm ZMj249S4= X-Gm-Gg: ASbGncsi+ZC8IA0LjT+zUXXisWYCHFk+vlVRcd8LA3elE2ikEsvB0nyJ0zUd6FwrHqU pXKwq/qGVpWmTO+2icDDVU3k8TZVvi0iyC1wuwEGczc7FcY/UjRyjIQJRu352CvlQ0wTtCsFolc C19q1t+PttX1mKv7HppSBzboYFHYMQeWK5cJbY21W0oW1kPK24W3Mp96ceq4LQ3mnUPSszxOVyu FwLtMEG9xnYNp3a1CSaef2EJtf9w2efgiRoQvtR66M+LLJq+onqeK8skhvp7eA22PKmhp8QhUzz IV6VHUBrn7KP06WTutlxnd3PDy1bx934YUEU38XrnfLYEGu56HXzEOrHnLnxD7Yd5QB7dXr389d HyNsv7l7hs5JzXV+bBqGGTlHE8x3qpwly14Ip2ZfsHklpDNq01MWxgfo+kCQ9 X-Google-Smtp-Source: AGHT+IEzNeUMTIm0I/7jVEc7kvWy/BnbCGlNwwfn0Xj/Lz7AIaEtVlYqD88PZlvaaXa4jYQRKOiMoA== X-Received: by 2002:a05:6a00:bd90:b0:771:ead8:dcdb with SMTP id d2e1a72fcca58-7723e258689mr233617b3a.8.1756506288982; Fri, 29 Aug 2025 15:24:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 06/91] linux-user/i386: Convert target_elf_gregset_t to a struct Date: Sat, 30 Aug 2025 08:23:02 +1000 Message-ID: <20250829222427.289668-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756569591377124100 Content-Type: text/plain; charset="utf-8" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/elfload.c | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index ba205c5a19..e8a7f040ed 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -233,7 +233,9 @@ static bool init_guest_commpage(void) #define EXSTACK_DEFAULT true =20 #define ELF_NREG 17 -typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; +typedef struct target_elf_gregset_t { + target_elf_greg_t regs[ELF_NREG]; +} target_elf_gregset_t; =20 /* * Note that ELF_NREG should be 19 as there should be place for @@ -242,25 +244,25 @@ typedef target_elf_greg_t target_elf_gregset_t[ELF_N= REG]; * * See linux kernel: arch/x86/include/asm/elf.h */ -static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUX86Sta= te *env) +static void elf_core_copy_regs(target_elf_gregset_t *r, const CPUX86State = *env) { - (*regs)[0] =3D tswapreg(env->regs[R_EBX]); - (*regs)[1] =3D tswapreg(env->regs[R_ECX]); - (*regs)[2] =3D tswapreg(env->regs[R_EDX]); - (*regs)[3] =3D tswapreg(env->regs[R_ESI]); - (*regs)[4] =3D tswapreg(env->regs[R_EDI]); - (*regs)[5] =3D tswapreg(env->regs[R_EBP]); - (*regs)[6] =3D tswapreg(env->regs[R_EAX]); - (*regs)[7] =3D tswapreg(env->segs[R_DS].selector & 0xffff); - (*regs)[8] =3D tswapreg(env->segs[R_ES].selector & 0xffff); - (*regs)[9] =3D tswapreg(env->segs[R_FS].selector & 0xffff); - (*regs)[10] =3D tswapreg(env->segs[R_GS].selector & 0xffff); - (*regs)[11] =3D tswapreg(get_task_state(env_cpu_const(env))->orig_ax); - (*regs)[12] =3D tswapreg(env->eip); - (*regs)[13] =3D tswapreg(env->segs[R_CS].selector & 0xffff); - (*regs)[14] =3D tswapreg(env->eflags); - (*regs)[15] =3D tswapreg(env->regs[R_ESP]); - (*regs)[16] =3D tswapreg(env->segs[R_SS].selector & 0xffff); + r->regs[0] =3D tswapreg(env->regs[R_EBX]); + r->regs[1] =3D tswapreg(env->regs[R_ECX]); + r->regs[2] =3D tswapreg(env->regs[R_EDX]); + r->regs[3] =3D tswapreg(env->regs[R_ESI]); + r->regs[4] =3D tswapreg(env->regs[R_EDI]); + r->regs[5] =3D tswapreg(env->regs[R_EBP]); + r->regs[6] =3D tswapreg(env->regs[R_EAX]); + r->regs[7] =3D tswapreg(env->segs[R_DS].selector & 0xffff); + r->regs[8] =3D tswapreg(env->segs[R_ES].selector & 0xffff); + r->regs[9] =3D tswapreg(env->segs[R_FS].selector & 0xffff); + r->regs[10] =3D tswapreg(env->segs[R_GS].selector & 0xffff); + r->regs[11] =3D tswapreg(get_task_state(env_cpu_const(env))->orig_ax); + r->regs[12] =3D tswapreg(env->eip); + r->regs[13] =3D tswapreg(env->segs[R_CS].selector & 0xffff); + r->regs[14] =3D tswapreg(env->eflags); + r->regs[15] =3D tswapreg(env->regs[R_ESP]); + r->regs[16] =3D tswapreg(env->segs[R_SS].selector & 0xffff); } =20 /* --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756574625; cv=none; d=zohomail.com; s=zohoarc; b=QrRK46blskluyNS/euK1Zsmd3p+SJTflHYXSrmylM1KI804HhWOz2whYBMZHs0yzmXeVfv6rYwdavZFN/4BgpIw79ajms130ME/R88fG35TaLBdaHnrkUCYhaNi+tuJZosWc414uHMeaepQCkKnUOiGEdpzfVuq64V2P5PGfonI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756574625; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=XxZ+p1n6Rw5X7moye/vqyXYYqTaMcwsPO8BMV0hGGOA=; b=E5ibyyK8zNHpt8kpmC2+1v/hh1CJ0F/rKVdQJzS2BAMA/S+hZy80gVcjTZy2BkhivX6lQEXKlK3pCApVl4SKwvm6mbepq4RTGoSUDlR72Bma47S3jbjrwoHy5CUSB2kIpusK5GxwlWfE8qE7i6kUKftcHbbnRF6+yvf5Vd8ZIKY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756574625101257.7008280183903; Sat, 30 Aug 2025 10:23:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNk8-0000P9-8y; Sat, 30 Aug 2025 11:43:52 -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 1us7Wk-0002iL-8v for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:24:58 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7Wf-0002eU-7O for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:24:58 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-771f69fd6feso2995891b3a.1 for ; Fri, 29 Aug 2025 15:24:52 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.24.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:24:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506291; x=1757111091; 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=XxZ+p1n6Rw5X7moye/vqyXYYqTaMcwsPO8BMV0hGGOA=; b=qhCJQP0k0dAWwojEuU8kftght1QUt0UViM3iwY3okKH9XqLHKRY2TC1SBu+6PLr+C3 dv4z4/u320uTPydknyJg+ezo+NmOJS46X1ulB4KhjMpucHhYGwtlDqfSrwA0l/TX/mXH aREsMRV0p4Miy4MkXRLsQ2SGlTZglauJKSqvPbpg9CssvgA7W186zv+qMMbyPuPEJlTp LmFUR2xDXGYhcfTG2z0eG5kP2+a9kemNeLFdkPSjcKD8N+Uuw411mHVoSAqJ1GL1fZr5 TQWBwBSG5nyKa51l6pQU054pN+qt+yM5S9w3J4UwjYcO5Xl6CerWqnoceFMCh0b+NqGu 7KjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506291; x=1757111091; 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=XxZ+p1n6Rw5X7moye/vqyXYYqTaMcwsPO8BMV0hGGOA=; b=iHkdPQzxR1IdM8aJgO+yNYrsSStj/PQRTtZDGEuj1qn2C32FVbGpXGXqFNzYfvhMUl 5KkHYCtjk0zDoP4B+Amut5LkX1JsMGKv5rvorSHoNuGMerqhAJGtt5V0pZfB5IkfBHRR Nr2W0Q693N/IZCEiG413rW0gcqfE54PufdE8tSL4oeya0gXXPCeFU2oQiKyLcZsa+i8i SrzciCw8oZlntzW3/LXZIeq1xf3pv97IPelghlnyWS9lDnQgDTT8jCd2bviA7bkfLcCC Zcor26Ldw+r1AREfUAwFF54GMmBaf2DeJv+4QsusQTu/u1OgO6MTbrlc1imIuh7vd11y c2sQ== X-Gm-Message-State: AOJu0YxtKA+rCxaSCtS0Ft36J3yTuWg0HypicOOSZEFApcU4m+0ithZV poDyWGGVnUWapcQ60+5lrSEtLyUbbQnkUBnHyzDvS1QM27iq4LBtP3WSPJ45p57A2Q4R+e8zLr4 B3dXYmPM= X-Gm-Gg: ASbGncsSn7Si6YTu47PjsFmb+gh2uZrexhITU+WeimYDriixtqjOjEo4L81ZYxIHL6R ZqNcdhIMCQkj62bRfKKv99DT2/9nns4THGKNqfj+Vq3OF/EfpaLxC6s7NQrIxkv89AZQCl6Ul6D SU3L/46muWMyrz2WklHPt/1fV0PvzWSIVpFIfM2fm75yEllPsROdhmVWN07IevvQC4wtFZnBi2d uZELmlIKhKQ/0bJcs3ff48sg1zyOJ1vJ1e1hduGqpMR6M+dKdkIrjLQdaW0xVdkiF5bCnorIcb+ nh6il1G5Z3sLOqewh/gxHnCzIfqt+yia5JrtzPTvNzvGrIKBw9JWCSAyiVFCHTFB0IqGKaxupez fHaByFrQFZC9KHVeEgB8kS8XHrTas7WWflfllwRhpiguilmKUbMOy0olWDipd X-Google-Smtp-Source: AGHT+IGELuHe97Bqxa0ioERaVP2DO/OrOciPib6Xuohe85rFEcZC9TwtEvIe/ZXpF3u6IJQZomx1DA== X-Received: by 2002:a05:6a00:3d4d:b0:76b:e868:eedd with SMTP id d2e1a72fcca58-7723e3c3156mr356275b3a.24.1756506291275; Fri, 29 Aug 2025 15:24:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 07/91] linux-user/arm: Convert target_elf_gregset_t to a struct Date: Sat, 30 Aug 2025 08:23:03 +1000 Message-ID: <20250829222427.289668-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42b; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42b.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756574626659116600 Content-Type: text/plain; charset="utf-8" While we're at it, loop over the general registers rather than open-code them. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/elfload.c | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index e8a7f040ed..0180f6063f 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -296,29 +296,17 @@ static void elf_core_copy_regs(target_elf_gregset_t *= r, const CPUX86State *env) #define EXSTACK_DEFAULT true =20 #define ELF_NREG 18 -typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; +typedef struct target_elf_gregset_t { + target_elf_greg_t regs[ELF_NREG]; +} target_elf_gregset_t; =20 -static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUARMSta= te *env) +static void elf_core_copy_regs(target_elf_gregset_t *r, const CPUARMState = *env) { - (*regs)[0] =3D tswapreg(env->regs[0]); - (*regs)[1] =3D tswapreg(env->regs[1]); - (*regs)[2] =3D tswapreg(env->regs[2]); - (*regs)[3] =3D tswapreg(env->regs[3]); - (*regs)[4] =3D tswapreg(env->regs[4]); - (*regs)[5] =3D tswapreg(env->regs[5]); - (*regs)[6] =3D tswapreg(env->regs[6]); - (*regs)[7] =3D tswapreg(env->regs[7]); - (*regs)[8] =3D tswapreg(env->regs[8]); - (*regs)[9] =3D tswapreg(env->regs[9]); - (*regs)[10] =3D tswapreg(env->regs[10]); - (*regs)[11] =3D tswapreg(env->regs[11]); - (*regs)[12] =3D tswapreg(env->regs[12]); - (*regs)[13] =3D tswapreg(env->regs[13]); - (*regs)[14] =3D tswapreg(env->regs[14]); - (*regs)[15] =3D tswapreg(env->regs[15]); - - (*regs)[16] =3D tswapreg(cpsr_read((CPUARMState *)env)); - (*regs)[17] =3D tswapreg(env->regs[0]); /* XXX */ + for (int i =3D 0; i < 16; ++i) { + r->regs[i] =3D tswapreg(env->regs[i]); + } + r->regs[16] =3D tswapreg(cpsr_read((CPUARMState *)env)); + r->regs[17] =3D tswapreg(env->regs[0]); /* XXX */ } =20 #define USE_ELF_CORE_DUMP --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756572451; cv=none; d=zohomail.com; s=zohoarc; b=Y6umaMkS6mEnFitKiIRcm5mEj5gveubB4Me7nlrqoSrrOMlM6AdoyuJvl4qFxj7d9X1pO1uqzc4hcidbiIrd50u78P9977a4oQCOkJyGc/PlqIM1qgtjCdWuGa9Uqs8KcCyTI5DZrTcR9B8aIr6qcPY1g6S6eaDYyaF/pSJzQAs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756572451; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ralhvmUvXrh398W1CgVKuYzVQB39ukDZoh3ULpQX2JM=; b=klOndw0FkMQIc33PjDKomRBYHQMuTvJSjBUPmgfFNmS2QLyqE5qu10QX7MjwfOWUwzG+MQPotr04vOhy+UMiFlGQ1DFvL+QGAFuDnCrzFj1hmpjV/iGUmn3m0lj50j0RYvY+aoiM9pMOiMR5RQtOwwadkUmcUnOy8zDcto0mk7I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756572451293102.75983521450235; Sat, 30 Aug 2025 09:47:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNjy-0007mQ-RB; Sat, 30 Aug 2025 11:43:42 -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 1us7Wj-0002i3-4O for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:24:57 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7Wh-0002fo-AU for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:24:56 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-771fa8e4190so1831452b3a.1 for ; Fri, 29 Aug 2025 15:24:54 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.24.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:24:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506293; x=1757111093; 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=ralhvmUvXrh398W1CgVKuYzVQB39ukDZoh3ULpQX2JM=; b=rhafRtNJfK803LTWNg2mEvPEVfkk7EI4B6M+QMrQ7A80FMO7TgfViBNMcIZZhu5aX3 Lp/Al6xEjgSyXwXqamEg/+r1i40o/T2mJsDRGnJ///cEAW4Xbes74DELG71NNlVQEYCh TDrArLf1ADLAu0Ga2mVYIfcqwuoI10oVqlsEd6gTrzxETdcRVw0ycxwkzXzUFg96UDjw 71Los12pQYqhObAeHHcSQuBNm+lmO6uM6qgG1s1VRYBNLiLPJK72GlDMTIegTLSfA1wK KAGxBYPZRQ4yPK6BP1OWBhuRhKdYXRgD/HdLHQOZp46+eaxBgoBvi0+4+2hSFda5mbzD ESEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506293; x=1757111093; 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=ralhvmUvXrh398W1CgVKuYzVQB39ukDZoh3ULpQX2JM=; b=W0+ylI9C4Mil0S+1QB2Cd8V3XUkK+b/7hhwtEXVM4hmTYxZHKsCNVWa1cexdmRHidK GFMNpFRdJpBMqV9iPLRs8Ae3lH2vZncB56RDGPEFPfjrPq9nzdCmAVwTGwX6MOhRTQp9 rox+OjdVBRkPhMV2mGcB5g/3eB8hsNCixsb8ZWl8aQCKzs33/tseNQDIR9plwih+ewfc EypGwzlHCnYQ8O/ok+LsYaNGp9qaIeR0iUAnXsemc1sE7t9ALNjxi5RvEmE95N+34V2C 2UKLpf7FbYSTVRcOPB5A0XwS3bulNRL0bep0eAqQaV4hKpA0qmfWRH3Wvz7q3ChC72U2 pbYQ== X-Gm-Message-State: AOJu0Yx2dSb0WRseZQEH6uTRvL0Rj9io8ovivrikAWi2biPPRfvBcLLf zBNlnlK1HKTL+dkxcY9Wx+ixFtpnCKaLiLSQJ6qDeuMCjpdGtkUDgLlor1KSiyJoCQtvO5VehCr JIV4MNNE= X-Gm-Gg: ASbGncsnXt16pU7TaZBCXd6zMEYMmqezvThFQxLHctKLbcjmrEgDhM9iYXQhUkgbME/ 3kcWp30Ts1B0AI25P4joi0wmMJHi2eGH7wO3fnbuyUw36TthT5SpDsRohPp4bmgBEichVn72cys FiAO23BpFY1Gv9Oo1P9A27rZOrdQNHCKH86XUufJDw3mOLooPoBZj3A4mDHrDEHwL+jk1togD8m C6S5r6I/Zlw3YIUmMAm0dVkQMZQN8gf0yktIb9xuwUE0Um4en9hj7PbN0M05RcKVu7fNs7/VYOW t/Nsgb/yQVtDD3i+8PdhFqK0WzBNLdavALCswg7OT2BFIImwIiyvbGwgvXK2QFLd4qcEvs18mcq VWQeidkMm8Z63vepwQQzfbmqE0kOPFnYCei2yMyVFc9U7Fw74rx3jxGm4Gr1l X-Google-Smtp-Source: AGHT+IEUm+Vr8+uu7r+yv1J+CGVwv26IAHiZbw8Ry0zjJa34Ut1v8SP96Jwvf9SqtqrbRru1Srh6mA== X-Received: by 2002:a05:6a00:1956:b0:772:a60:6c04 with SMTP id d2e1a72fcca58-7723e1ee875mr353125b3a.2.1756506293548; Fri, 29 Aug 2025 15:24:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 08/91] linux-user/aarch64: Convert target_elf_gregset_t to a struct Date: Sat, 30 Aug 2025 08:23:04 +1000 Message-ID: <20250829222427.289668-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756572453549124100 Content-Type: text/plain; charset="utf-8" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/elfload.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 0180f6063f..da57c6c2ce 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -384,18 +384,17 @@ static const VdsoImageInfo *vdso_image_info(uint32_t = elf_flags) #define ELF_CLASS ELFCLASS64 =20 #define ELF_NREG 34 -typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; +typedef struct target_elf_gregset_t { + target_elf_greg_t regs[ELF_NREG]; +} target_elf_gregset_t; =20 -static void elf_core_copy_regs(target_elf_gregset_t *regs, - const CPUARMState *env) +static void elf_core_copy_regs(target_elf_gregset_t *r, const CPUARMState = *env) { - int i; - - for (i =3D 0; i < 32; i++) { - (*regs)[i] =3D tswapreg(env->xregs[i]); + for (int i =3D 0; i < 32; i++) { + r->regs[i] =3D tswapreg(env->xregs[i]); } - (*regs)[32] =3D tswapreg(env->pc); - (*regs)[33] =3D tswapreg(pstate_read((CPUARMState *)env)); + r->regs[32] =3D tswapreg(env->pc); + r->regs[33] =3D tswapreg(pstate_read((CPUARMState *)env)); } =20 #define USE_ELF_CORE_DUMP --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756569329; cv=none; d=zohomail.com; s=zohoarc; b=m3mofMDqPE+kOzN1q8tWOVRJCzmqolvc5F2rhxXuNx+3EQB5FSVrDTJzaf6/SOkpxVHxx9I8P13uCTjaNfBwqKARIXqAhrBlTfyz5Sp75RvEB4w4kuGes0ZvnmnSz3AwPeNogemZEE9cCRPg+VIglMiqeTDPEBqFE9wCBWHIbRM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756569329; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=oeH8XwO19Yd5VENhzbKJ915ynNMOVI6H/v6NatkJErY=; b=A3qtsQrWmnTWUeqAbC1Jl6btg7SyCMx1bwZvTB75aZBlz3fj7PT2PX3061UNbrRLao65eqfYTGZDYbHe/UkoldFydyD483gD2LbAiQlTsvlWFGKGgQQK4YBwJWuqMYg2le1q6AtMQre4SpfBdFO8J8CpznsaOJpuamG37L++Z0s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756569329920240.50063434357503; Sat, 30 Aug 2025 08:55:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNkA-0000hX-GM; Sat, 30 Aug 2025 11:43:54 -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 1us7Wl-0002jI-LC for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:24:59 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7Wj-0002g7-GA for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:24:59 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-7723f0924a3so8890b3a.2 for ; Fri, 29 Aug 2025 15:24:57 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.24.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:24:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506296; x=1757111096; 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=oeH8XwO19Yd5VENhzbKJ915ynNMOVI6H/v6NatkJErY=; b=jtRCABd+ChK2QtEFE44Dn2ByqRHh3hN541QtR9iU/NFaV7m9MhPlP/lXgcpvn7tYQm JjibKVxaX0GKjQsjkzc2uFJ4DrzBfFPxWE7ZEsmbxgm0bs1MgFB3C6ro8fY8ARe7pRb1 LqoJ8QJqKdSqk9Sb+dBPEzRHG/tMzaADg7rnoTZ5bzLrc0y+8k/ZFCg/OKiTjWQ1vOM9 vsCBNpeMm8DT+Rzdl9I5yUZK96rjUe6Ov3bQwAcgf+nOjjRjkxAnQuCYOdz0thFgvPUy Kg62dVNJaGUlf4vGi1g68VGDaSfTA0OSHbJC8h6aXDd7aw3kWU6F/pPAlhZR4/CJYrc6 EMiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506296; x=1757111096; 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=oeH8XwO19Yd5VENhzbKJ915ynNMOVI6H/v6NatkJErY=; b=Zvfa8IwaUsM/bEWoR03G0zsAmlG6DOAeqhxck1T+AnvBGUZCaQesILiGuLrUL2fc3H vDldQAgHYVXkaUHsvr3KdZD0eSpUCEdZdSCY9mY34r2QIPlexavNYGRl5JcYhYJoCWeC uVIgA9vFtK4Qdrg95BR0xCQXBNCMihVgKB3c38APtOqXaF1k2xoyBpyOqvebw3Tue/er eU6L8EdoLW1GF7Yall54OjG39whuFK+VN9xkvzY7PW4BUMSQ7bs4ewDgRoTgdbK7AohO K8NjMd2qWMiD5KR9XPUO7agHn3Rdm1YzihGrut438idL8XdGqwIOBa2NlCmbyFzDbBvk OhOQ== X-Gm-Message-State: AOJu0YwZYQWyAY7WDCUTEOks0LJj7RruIazF7aW5dn8t0l2UkwQuZ2f7 YiaWTXi8/xO/ODKtAzKGfyMqHUTXt2sEwhv1Xyu98qUyEYw3JCkH/Els2K++imytM2xpnTTde2h 4B24wBvA= X-Gm-Gg: ASbGncteRsd2W2IBzQIhHoRQFbhQaStir6oC9ycfGtA3Ttvj6OHXACrnN/3/YhhMLhc n+dXgwVju+i5M7NRX2hHLwIo2sWVucNOpYWWGg1LTHMyIv8Xka86EFmKZrF8t6HdFUl5MlrwHgh Da5sGuoQOBrY0R4rf2YxRzBfvgbRvyOIXN7RV2imgKmZ1Yf1G7df4LB3MB41DOqT4hhUnFrbDBS UZE/X2yTbRGsPxJriMdf2m+ZW3bbcEcTqI16XZQsCKxRz4sdihPly/cbv9PNhlaWMQFi5Af8Liz 6tMwSQ3jaQ2kyiQpefpAGZO4MS7smhRSy5iD5/hlmlGs6tjS8sD+dw8qXC6S7ffjlF5YcLupfLC MvGsj/MUtGnc9am73L9a9aEyoLeTX+EUAnKfVrmFwO5pzJzxJ+c9Uh3yg8cedIH2p9HsWLUs= X-Google-Smtp-Source: AGHT+IHae937BZ/y6AYYN09AMgCdYHToK+rRqHDRdaq1Uclk6D/2fBrOrp1KpnWhPCC48STCxoT02A== X-Received: by 2002:a05:6a00:4fcd:b0:74e:ac5b:17ff with SMTP id d2e1a72fcca58-7723e279893mr288326b3a.13.1756506295790; Fri, 29 Aug 2025 15:24:55 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 09/91] linux-user/ppc: Convert target_elf_gregset_t to a struct Date: Sat, 30 Aug 2025 08:23:05 +1000 Message-ID: <20250829222427.289668-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756569332357124100 Content-Type: text/plain; charset="utf-8" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/elfload.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index da57c6c2ce..0dd76937f9 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -470,25 +470,27 @@ static void elf_core_copy_regs(target_elf_gregset_t *= r, const CPUARMState *env) =20 /* See linux kernel: arch/powerpc/include/asm/elf.h. */ #define ELF_NREG 48 -typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; +typedef struct target_elf_gregset_t { + target_elf_greg_t regs[ELF_NREG]; +} target_elf_gregset_t; =20 -static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUPPCSta= te *env) +static void elf_core_copy_regs(target_elf_gregset_t *r, const CPUPPCState = *env) { int i; target_ulong ccr =3D 0; =20 for (i =3D 0; i < ARRAY_SIZE(env->gpr); i++) { - (*regs)[i] =3D tswapreg(env->gpr[i]); + r->regs[i] =3D tswapreg(env->gpr[i]); } =20 - (*regs)[32] =3D tswapreg(env->nip); - (*regs)[33] =3D tswapreg(env->msr); - (*regs)[35] =3D tswapreg(env->ctr); - (*regs)[36] =3D tswapreg(env->lr); - (*regs)[37] =3D tswapreg(cpu_read_xer(env)); + r->regs[32] =3D tswapreg(env->nip); + r->regs[33] =3D tswapreg(env->msr); + r->regs[35] =3D tswapreg(env->ctr); + r->regs[36] =3D tswapreg(env->lr); + r->regs[37] =3D tswapreg(cpu_read_xer(env)); =20 ccr =3D ppc_get_cr(env); - (*regs)[38] =3D tswapreg(ccr); + r->regs[38] =3D tswapreg(ccr); } =20 #define USE_ELF_CORE_DUMP --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756571265; cv=none; d=zohomail.com; s=zohoarc; b=Z3j3WGaTiATJcCYKKIIt5qJ078y0+e22fjTIXz5DvsyUd6dAoF92/JRp4N5X8h5ARFqRp627mqteqWm0qFmeK5fGGbymVwIyqsKvcXtIK3XaUrMvhX3QlJFHn+ZmSGLmj9zNoUg4c4HR28aEUYZwJyTA90LOp0xX4tLzfqFFmZU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756571265; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=H6pB83+iwDUBtAVO50FPQo1KzrvptaD1cbooGa5Ri+o=; b=CQe27bCyp668sQw0FxlMLqNX6pugDh2C2Zfy9UPNzWxGSaPhYq3qg3PuiskrT2GC8Mz4tkbw635TgWeng+ksnnnTMWGZrCu0W09bEGO2xe98XDRcni4GotkOymNcv1vO8XZ0qug3EYDMvXcnxrmo1Fpp8KSh/v+ePTv2bOWLmr4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756571264978166.00260247882738; Sat, 30 Aug 2025 09:27:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNk1-000844-CK; Sat, 30 Aug 2025 11:43:45 -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 1us7Wr-0002lS-JY for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:06 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7Wl-0002ga-OL for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:04 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-771ed4a8124so2659620b3a.2 for ; Fri, 29 Aug 2025 15:24:59 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.24.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:24:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506298; x=1757111098; 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=H6pB83+iwDUBtAVO50FPQo1KzrvptaD1cbooGa5Ri+o=; b=FSeDEgE6YbkiIHuW5HBy3Sfh4qKWdUzjisqf/8A9zXmK+i7qrijMSpIxRHctQjIj80 f3urIyI1dAE+YKpcMgZ6aorxju1UGX9JcSio3rlLm4apKrmdDizYo/VcWg4ls97yWU3W FlPan1y82c3Qpw9JKiS7cyCFpMtMZQxVoDlYlSK6OGslWAWF3L4/2OwiHB6vIJVDs2mO mgpVoa9HgzR0zpy72fRPnSXa82zrATrbpdzB3t3V9AEl4hOHww3QTpOLaJKHqE3E3lJ3 KMVbk/uOYhLPuTlBPiZl4/AtlU3nphNjlRIDp23SqydfRCOxg7pThtrVROgdw7RHBVUF +YJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506298; x=1757111098; 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=H6pB83+iwDUBtAVO50FPQo1KzrvptaD1cbooGa5Ri+o=; b=pKicnzFILcfElOpPaGd8Tb95WiAWaFI6DaDd13IOUumLrar424GPPbp0h6igBXiRu4 mqCuSbBvWLH7pEnadkxpf1K6JM47fIzkLC3SHM1VnE61oRVTiTgR/QmThrkUXgWrjRCT Yw6yqXnute8nSr2I/q0NBOTZCshLT4W6CxO0+reqD5dj+F6laYwzdYpjBlBtFHEv/f1v vNav+hU4YkMq4nv5OUtF2NYaD5lcBJz6WPu7JSgtFo0bSC5LGAE7JWCIQd53vieOqCv9 I40NtTkKaZz4VpZfMEp4dHQHEXKZo1uqkQTyzP5n236kj0gLF5yaecjAX9v7zPtVXWCH sEHA== X-Gm-Message-State: AOJu0Yz2qznUqsGDRJWNK3V4j+0ihp78JLSNmYZad5grTxRgynduhbN8 jd2w+hieV/qiJ+VihgPS87tFSksen4eCfsv90lumACkr1EWNnA1yYM4L0OlrqmuYW3VSSRGyPeK cvgpQDlg= X-Gm-Gg: ASbGncv8vV/R/oOQXboxMpGPNO6gkQBCObSliadea03GGlu9gS53Gs0U6VEEBxbDfgT 7m9LqMilDvVF8db1GM9SOAlSoF/xgXClV1dvTXcCvRw2qxkpqbkYMr9nt+N0YeDvOC8F5Ft2hy/ PiHaXMBaAZqQroHA7ye5qs4o5F5DwrInXSM2DzIuvduvhLXUEnhdysgkhJKRWrXC4Cj1dlQE/Ng wbzFxsAPZK5vvgc+8MMDkCwSU9jrWuDEl1kchj4/ZquGcCs8ihabo+9tMYy8a4+pdwIE/gwcyK8 7u9b9HAW4MWFgKvYkuLPKsy/Eo26XFjdkLVFQ2ANCIHX+0Ok5FSaqPNY1+4GM0qTtrMZ7IGpqAO 0kIqcWCt64vMAu9Ts6MwYTYOpk84pWcCycdMOPNRC+OPerr5tDdTygS8qhLF8 X-Google-Smtp-Source: AGHT+IHFjdW7j4hEnZoGbCecLjE1D33TGu8WKwOlTdn1gb0q49TjcVtpsuJ0pLQsyvBDQEi0z3AGsw== X-Received: by 2002:a05:6a20:938c:b0:243:bb99:a100 with SMTP id adf61e73a8af0-243d6f38ffemr331997637.46.1756506298060; Fri, 29 Aug 2025 15:24:58 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 10/91] linux-user/loongarch64: Convert target_elf_gregset_t to a struct Date: Sat, 30 Aug 2025 08:23:06 +1000 Message-ID: <20250829222427.289668-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756571266583116600 Content-Type: text/plain; charset="utf-8" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/elfload.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 0dd76937f9..1e59399afa 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -518,7 +518,9 @@ static void elf_core_copy_regs(target_elf_gregset_t *r,= const CPUPPCState *env) =20 /* See linux kernel: arch/loongarch/include/asm/elf.h */ #define ELF_NREG 45 -typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; +typedef struct target_elf_gregset_t { + target_elf_greg_t regs[ELF_NREG]; +} target_elf_gregset_t; =20 enum { TARGET_EF_R0 =3D 0, @@ -526,19 +528,17 @@ enum { TARGET_EF_CSR_BADV =3D TARGET_EF_R0 + 34, }; =20 -static void elf_core_copy_regs(target_elf_gregset_t *regs, +static void elf_core_copy_regs(target_elf_gregset_t *r, const CPULoongArchState *env) { - int i; + r->regs[TARGET_EF_R0] =3D 0; =20 - (*regs)[TARGET_EF_R0] =3D 0; - - for (i =3D 1; i < ARRAY_SIZE(env->gpr); i++) { - (*regs)[TARGET_EF_R0 + i] =3D tswapreg(env->gpr[i]); + for (int i =3D 1; i < ARRAY_SIZE(env->gpr); i++) { + r->regs[TARGET_EF_R0 + i] =3D tswapreg(env->gpr[i]); } =20 - (*regs)[TARGET_EF_CSR_ERA] =3D tswapreg(env->pc); - (*regs)[TARGET_EF_CSR_BADV] =3D tswapreg(env->CSR_BADV); + r->regs[TARGET_EF_CSR_ERA] =3D tswapreg(env->pc); + r->regs[TARGET_EF_CSR_BADV] =3D tswapreg(env->CSR_BADV); } =20 #define USE_ELF_CORE_DUMP --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756576572; cv=none; d=zohomail.com; s=zohoarc; b=ma3irP2Wa5dYm5+3H15rfrwUdGFACFx4qxvU5CINkGNj5wF1vIskc0rFqfSTGbcNwn4si8Y/Ko6wrLazKAlBO1CQ1lupAab4hVPEQtU2eluo95hC9fK3XizYyxAJbuV+77B6ywj4/6rZZ/cKMem8zbwSghEpP9IgFv4u8OdKJNU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756576572; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=3Mjdr1DYVtpql3ViukljsVmvlw0wae7rs6+tm74FMG8=; b=NLUSDRitC1hEREAQtIYec6Oly33lbMDbEtoFeO15rTB+wJlaSVn6pwGt170lVBVJChGq8fG3DB9p8Jpt/UWLZEZ3WR/u9QfGFpLKdCWEmnYKARVS7c3xixi2iR7Iy0p7LoK7FnGrP7noxaBT6FDN7I/ReE2kx7mDR5rm+z6A5AM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756576572868128.35947646069098; Sat, 30 Aug 2025 10:56:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNiE-0002rM-Ka; Sat, 30 Aug 2025 11:41:54 -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 1us7Wr-0002lR-Jy for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:06 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7Wp-0002h3-Gp for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:05 -0400 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-7722d6cc437so1100039b3a.0 for ; Fri, 29 Aug 2025 15:25:02 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.24.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:25:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506301; x=1757111101; 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=3Mjdr1DYVtpql3ViukljsVmvlw0wae7rs6+tm74FMG8=; b=ZGh7qOrWH/cQu0ml0tgop50vEffCGXJMiHVDk0EkEfbYFHbxfMcnuwr8CN1Yun6XZf fKkXTsJEiMox5sgjt2N/SYdMtdrvr+W6k6nckgbhqC9dQvgaKYyaWsk0et27ljpZ7tzc kJXdr3t+95c9coHsa/g/yO3p/aL8fmAGs9NXwJ7nZ1qHvLt4LVfHinAv6G+MICYK749x Tf/0aBpKEUVXELmSD3UQo8SXIBRsmNf5iDdXc9N5FYqpQ3yFSsAhbHJBVzEcdehqlnPC ApAC85LRgvcPnjzF/+10fir1iMQas6yCNrYwc2I6rEDtebBrpsqIOnYOxGdSOPPql3+b 4fbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506301; x=1757111101; 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=3Mjdr1DYVtpql3ViukljsVmvlw0wae7rs6+tm74FMG8=; b=J0DMPcD7t3Knbv1FUoearDFsz9sX1J8MvQLSNtzOTpqtBN+VUujqxnqZERBs2tVkUh svdv1uExCMtrBPxmbv9Ob/qnU5+eP/OQy/y94nH7QVI63nCA6GVHH/j0svpKeEGZ/1Xm ZA9yOwXYPi/xl+FKktuZ1IeoFya9knCeRJDBSMB2o8e+kU+WIwoS2xvB5o97mbA2EjmO dXFfnLbYFy8FqfyggRFwD2SLyJ5grk9BDAnjPy7V6g6C6v4w0vZB+xKvBkK+yiDSl6sq 6KZP9tqYwgbHzchsxnbmrWMlN7HAFVoTga2WHOkTF3umfm/T0NtVYMGdcwsaU0cOZkCf 5Fgg== X-Gm-Message-State: AOJu0YzmRK56WkwJQizBbtxzvmOXxJlpy/viXANxebnhpDjHFCuNpV5V cxKQew6hFzAz7uDJoChqJUjhf+N+ja6VwaAuZmV7HUmTJ8pq3K9kC7zfhFuWE0KKsl9rgREiW74 6UbIUwFE= X-Gm-Gg: ASbGncsmgXKNBj8pSiwRoOu93s2et/Tubwv+cm8wPad5vuLiJ7LDaGZJYe1KtSbOQ1C TvFWJqZFWnlFQ5BtbmnJp/tTjkID7foOkMEnSqoPoQSw/FZMx8U3h/MUBksd4aHfEr9GXPvKplV DCRG8B4KK2qHO1RmgQBVE1Mi/7d8splj9GKNR6wuGVxzkPz/7R/K1nHhM+Ir5Xs8r7Pe+9E0Tii 3c9PqadGP6IgaV5J0FMpgF2Eu8b0mA+XWiinfUYHTjllzWHEAoJlXiudj1O+wPsyZqRznN18Xt9 UHVdBW+C1AQIM9j1Fmz0Mj3851MyqzJBVYK7BpuDzV3xrjsJG4btThGGBwHXDPloI1vtDEU11YQ 7+Z5s0nwwwqa4QBkp059rWDM7pPheSYmhOFKTjXSaKOPl66fAy+bFEpeFpSA8N/1AndsiNk0= X-Google-Smtp-Source: AGHT+IH+vArUnW80SYwaGEYA2tqUFP11IfhOsEB4n44E5qBUDbKzGgD9ItMTbyaDV/cfjpBTW1HOsQ== X-Received: by 2002:a05:6a00:1495:b0:771:f071:28fd with SMTP id d2e1a72fcca58-7723e3880bfmr264061b3a.14.1756506300699; Fri, 29 Aug 2025 15:25:00 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 11/91] linux-user/mips: Convert target_elf_gregset_t to a struct Date: Sat, 30 Aug 2025 08:23:07 +1000 Message-ID: <20250829222427.289668-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756576574138116600 Content-Type: text/plain; charset="utf-8" While we're at it, merge the store of TARGET_EF_R0 into the loop over all R0 registers. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/elfload.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 1e59399afa..8fcdb0569b 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -564,7 +564,9 @@ static void elf_core_copy_regs(target_elf_gregset_t *r, =20 /* See linux kernel: arch/mips/include/asm/elf.h. */ #define ELF_NREG 45 -typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; +typedef struct target_elf_gregset_t { + target_elf_greg_t regs[ELF_NREG]; +} target_elf_gregset_t; =20 /* See linux kernel: arch/mips/include/asm/reg.h. */ enum { @@ -584,27 +586,25 @@ enum { }; =20 /* See linux kernel: arch/mips/kernel/process.c:elf_dump_regs. */ -static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUMIPSSt= ate *env) +static void elf_core_copy_regs(target_elf_gregset_t *r, const CPUMIPSState= *env) { int i; =20 - for (i =3D 0; i < TARGET_EF_R0; i++) { - (*regs)[i] =3D 0; + for (i =3D 0; i <=3D TARGET_EF_R0; i++) { + r->regs[i] =3D 0; } - (*regs)[TARGET_EF_R0] =3D 0; - for (i =3D 1; i < ARRAY_SIZE(env->active_tc.gpr); i++) { - (*regs)[TARGET_EF_R0 + i] =3D tswapreg(env->active_tc.gpr[i]); + r->regs[TARGET_EF_R0 + i] =3D tswapreg(env->active_tc.gpr[i]); } =20 - (*regs)[TARGET_EF_R26] =3D 0; - (*regs)[TARGET_EF_R27] =3D 0; - (*regs)[TARGET_EF_LO] =3D tswapreg(env->active_tc.LO[0]); - (*regs)[TARGET_EF_HI] =3D tswapreg(env->active_tc.HI[0]); - (*regs)[TARGET_EF_CP0_EPC] =3D tswapreg(env->active_tc.PC); - (*regs)[TARGET_EF_CP0_BADVADDR] =3D tswapreg(env->CP0_BadVAddr); - (*regs)[TARGET_EF_CP0_STATUS] =3D tswapreg(env->CP0_Status); - (*regs)[TARGET_EF_CP0_CAUSE] =3D tswapreg(env->CP0_Cause); + r->regs[TARGET_EF_R26] =3D 0; + r->regs[TARGET_EF_R27] =3D 0; + r->regs[TARGET_EF_LO] =3D tswapreg(env->active_tc.LO[0]); + r->regs[TARGET_EF_HI] =3D tswapreg(env->active_tc.HI[0]); + r->regs[TARGET_EF_CP0_EPC] =3D tswapreg(env->active_tc.PC); + r->regs[TARGET_EF_CP0_BADVADDR] =3D tswapreg(env->CP0_BadVAddr); + r->regs[TARGET_EF_CP0_STATUS] =3D tswapreg(env->CP0_Status); + r->regs[TARGET_EF_CP0_CAUSE] =3D tswapreg(env->CP0_Cause); } =20 #define USE_ELF_CORE_DUMP --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756569414; cv=none; d=zohomail.com; s=zohoarc; b=RfX8KWU3wCLj/lno3zXbDGqELlaboYc34lSf4Hgo+xK5i7I2lA6Ras0a8RZ2uqnfA4eWJprBP8QAQA5xVdHL2o32OATfU0ztYO19MS2yaCSYNFKmNdohidknrrUG1Im+4fPrqCjFgvqCc/GKFs16foT7Y1THRGFcWhkUtVPF53o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756569414; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Bq6bpjIPp00ohe3kju2P0pETtz/AxcC5+J8q+lpmdRY=; b=eHyVCdknX3M5uTcFw86CROD304l5mVxeV5su/iNjgCwxe0iHcQvjfL20uK+lJBqwdOi+UrS6FPKwEshwPgqddIOZ+AFCR+Ecnb+the0v+pSkyFIdNZQPzx8qdPLdzRNfGPBEgO6NV9fLhCLgCg5Wz2OC7GiRwWEMkr95iWVa81M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756569414643796.6351256750803; Sat, 30 Aug 2025 08:56:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNiH-0003EZ-NN; Sat, 30 Aug 2025 11:41:57 -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 1us7Wu-0002wJ-Qa for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:10 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7Wr-0002q9-Dg for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:07 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-772301f8a4cso1238402b3a.3 for ; Fri, 29 Aug 2025 15:25:04 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.25.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:25:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506303; x=1757111103; 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=Bq6bpjIPp00ohe3kju2P0pETtz/AxcC5+J8q+lpmdRY=; b=pTOHFi+yv4WSPweolwzzeSh+z/Uvg9F3NiHzqzUFkvzOVmZhlO+FatGYaMBGLzndGh TovJFGjaQrXWvsXb6tx7KK5JCL2AWQFEuXhY88j9CJ0o7egFlPpDWoH4+Xqv9gguPAI3 sIqLaNAi6MKmE/7/N6pgoWhNJqSZL7sqEnu8Nwbvo8W+BQ8Cvt2RkrdgAx5h9ZATSG6C m0RkXKaWL+Nru3zrvObv/sZDVd+zHywOaGIYkDW1kVQp3+Ie3OtKHXRcNkNVneApTQ9E eQfFI56wo8JB71upTli8vgWGgpMzL3qNth0T/2tLP3eOycXEzs0UXqOp3cY5cnGvOj1p MzdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506303; x=1757111103; 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=Bq6bpjIPp00ohe3kju2P0pETtz/AxcC5+J8q+lpmdRY=; b=te3ivAUZLYQYZuwwOjWeW/dInDM6ytDIrHPkV0vzuS8g+PSUhZUcNZwHv/RIX69kLB fdilPpgb5Z5IO+zF5j3+dbFQ9+DZvc0erPXUNJqxvSvFsFG2WiKxtwR1lDBn8tlWsMGN wR8QWVqk9lIDPjw0qS8K89L5n9B5FDkJTE1ysLglFOu6Ws7fFzY/65HKd76n0+IVI8qt iKOp3rxCcxh0iYzvDn6mZcuQYwRTDXfS/M+PsuRC9S686+Hy6AGM6OskO6K+yD1Vd/WW 5q1ruNdL/JjVWTnzpE7y29NkY9dYGj/z5wGk/lNbgXG3+ahR/40IdGOACq2dxryzkWZF NK2Q== X-Gm-Message-State: AOJu0Yw+S/lhlK1arDJT+LtUYom1mSE40OxFtn6bWFIN/5VcwWE6iaFl DcqOZV3KBJKxnZUc8r+Sb92srwBQxARcNBjWWLlbYTYgXmRqT6DbGyhI3HSG0FOOZEFnY8HIKO4 kB84d0PU= X-Gm-Gg: ASbGncvvbiMfaUP7GMrUW89aJqqy2QxoYmiMa/4bSWy/OD/3oU5ShCdFxiP4W9YHejc 9Pv8VeCvH/vtBJnUFo06j/Ens09Db/rFq4ucxF/Moh2aKbaOKb1TGRnK9MJs0tCzmSQ643NMhqL y0cjcr7i/GC06J/S0OC+BgcAmrCeFL/wqOxabnIDV50wnRR4qWz2rNnItFeod/h+i96Zw954wMN 97RUTCm2z9s371SzMn71mwJiEWHNl+59pxiVyIMOF4Mfb8zMWI7zH9JrITeRT1VS/8qcz3ydIWX 3k2MrEFi7ugGphj8XiwbaLrmEsYjMtm9OgGhhYaYLpgK6k/2mVf9K00VGNpCdJ3LsMMGmTxtCv2 fhsk55BAMsY6DKyb9BGob9I64vcslTkQoioFdZ0guhtZ/i5teBmcwN4fuQKljFzDOibB66aY= X-Google-Smtp-Source: AGHT+IEpUBG66KxSOM8HzJ1vW+85QL3ZeTSta18A+/3sZqfO8H8BqaYG0TEt9ROPkjmRSpXVZMe1kA== X-Received: by 2002:a05:6a00:10cd:b0:772:398a:7655 with SMTP id d2e1a72fcca58-7723e38ae13mr209676b3a.23.1756506303069; Fri, 29 Aug 2025 15:25:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 12/91] linux-user/microblaze: Convert target_elf_gregset_t to a struct Date: Sat, 30 Aug 2025 08:23:08 +1000 Message-ID: <20250829222427.289668-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756569416892116600 Content-Type: text/plain; charset="utf-8" While we're at it, drop "pos++" and simply open-code indexes. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/elfload.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 8fcdb0569b..40a5bcccab 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -623,23 +623,23 @@ static void elf_core_copy_regs(target_elf_gregset_t *= r, const CPUMIPSState *env) =20 #define USE_ELF_CORE_DUMP #define ELF_NREG 38 -typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; +typedef struct target_elf_gregset_t { + target_elf_greg_t regs[ELF_NREG]; +} target_elf_gregset_t; =20 /* See linux kernel: arch/mips/kernel/process.c:elf_dump_regs. */ -static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUMBStat= e *env) +static void elf_core_copy_regs(target_elf_gregset_t *r, const CPUMBState *= env) { - int i, pos =3D 0; - - for (i =3D 0; i < 32; i++) { - (*regs)[pos++] =3D tswapreg(env->regs[i]); + for (int i =3D 0; i < 32; i++) { + r->regs[i] =3D tswapreg(env->regs[i]); } =20 - (*regs)[pos++] =3D tswapreg(env->pc); - (*regs)[pos++] =3D tswapreg(mb_cpu_read_msr(env)); - (*regs)[pos++] =3D 0; - (*regs)[pos++] =3D tswapreg(env->ear); - (*regs)[pos++] =3D 0; - (*regs)[pos++] =3D tswapreg(env->esr); + r->regs[32] =3D tswapreg(env->pc); + r->regs[33] =3D tswapreg(mb_cpu_read_msr(env)); + r->regs[34] =3D 0; + r->regs[35] =3D tswapreg(env->ear); + r->regs[36] =3D 0; + r->regs[37] =3D tswapreg(env->esr); } =20 #endif /* TARGET_MICROBLAZE */ --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756571905; cv=none; d=zohomail.com; s=zohoarc; b=N11EDHUGkzH5Y4xdj5MyJ0neAZnlwNPLVCyTKXTmm5EsUMJIhPjHAdt59eCHTpKSxxHZgdWV9UArA7iA+Dj2nplmBWe4HXecsW7zGKwQ3inUCaZVqBIdXfpiHk9WAWdr3sxMvJ6V8twM0qA35YwGzb4AmuEGQ85cbAKMvepnpsk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756571905; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Y9AwCvFTz8r3ZgF7ChY2U9tJWuC1SnogfSAKkPVxJRU=; b=PIigKsYmzLiMrtW6jCqv7Pxz+sBnugfORL25kuqMeXIKU9iIw8T/BRFYVYZUpU5nOHA559kRFUiM8Vg+RVw2NXT4/AQx+fJCTmOjfhGwijVlUo2D300uCnj/Q5xP2frFa1SI0g4FwNy53pVGrOQaaqz/pRY/inVexusJGyiOay8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756571905658141.63547100209246; Sat, 30 Aug 2025 09:38:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNiJ-0003SS-W9; Sat, 30 Aug 2025 11:42: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 1us7Wy-0002zq-J9 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:12 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7Wu-0002st-I8 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:11 -0400 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-772301f8a4cso1238416b3a.3 for ; Fri, 29 Aug 2025 15:25:07 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.25.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:25:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506305; x=1757111105; 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=Y9AwCvFTz8r3ZgF7ChY2U9tJWuC1SnogfSAKkPVxJRU=; b=iyz0nOM3MLH9+/gh7nMx3qfqGFVL21FdgLzYHW9406Sb9yE8pkgGXIv37x+zb+v2Tb 5B0dbjdrVknap6CvuJU6IGCyHr1OzJAKOi8XhVNVVeP7lJtvIG/YnrBOopPbdv36GTiM AWBLoSDE7/Xw6vuabeYvpSpU9ZyJoL06jjyv6lxC0Tn8/7GMRrac/NqEqh0/w4Tm4Qzb ZQd82pXQiuAO92YV2iwvFiwFG0krxV8tzoavyNni7NdjvHYEHU2OSHQcvTMaFRYAMpaI jCGcCNoHiBB3Z/zG7VQtIZ3mSTknzKL/BuS0NnjvYcq9N8cN7lFPMvdmidgir8vD3Gws 6Ywg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506305; x=1757111105; 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=Y9AwCvFTz8r3ZgF7ChY2U9tJWuC1SnogfSAKkPVxJRU=; b=kGqMTyV4KMVDns0fg4hH/EEWisSVcCod3si/jDexYJelk+7oELv3kwPAQgoCjAfpfy G1OD3FsswO76G9vcKIP+xBTGBSKrvUvcUzUfA02D0Zi6e7hLdJLSHwM5VASFdv3ccpk6 dRymzmFG3NstSkvFWLMJWJP/iYNg0Z6HoPWzL/BRreo1cx31EGkVrHwnoUhqZPjksRd3 SMajtzuKynZF3X1yiyaVVmYWsXpNuTwSOfu+hdlHAt2A8eu3MUeY+byinnEFJUIw5JZC D3PKfJD+fqjeQI6xSSg6P7MywFy+fOfbo+RTbiajSqKhdHxeI1BtmKL9zZLv3X0tpW/v 2q6g== X-Gm-Message-State: AOJu0YyqnJVgP2d8DXo6q1XRoqxC8Cc7yo/90e7yjQxxPfDE0le+YSz3 6VEHc0Dw2uhUThSZO6lBYZbKK3BL82mfEq1KtaTIe2qQ36tq6ipv7xPrxVIYEB4rnKdEQSNaqoA j5aSEi9E= X-Gm-Gg: ASbGncu1avwFCuwVLMFtX5rzZE8OOPAW5ur/bXbf1symHGFn05wzPD3EpHdkmfkYIwg DnzrkUuHhxF4pJ62U+nIf+T+QH9mH1CKAicp6wpkqOBM3ptMUP2L322bZ0BAYJKi2Aep7DnzSuh HaKBJuLUnSLahpRgoq88rXKMLR0rLKky13rdHu/DRnv7eiy9REbWaFTCHIOdhH2RCiiocnay6Ji UHMhs5OVbJurQFtCCEx3KWPmAatDxfVh2SnmlQdxERAtrUan0TkurGzU4czrLJ0ECexRBnmT0Ip +EnycTxrjFe5VGaKE3S7Ic6XzRhfEkjllDAoyXTyWCELS9QVlCcVd3eGexdv2tMbgO8FSTtaAbJ xkMggHaJ4JeBoKFRfM/7ZouRqoloC2xsDE88bAXAhAmmiMJL+JJPHsKPByIJkZLqqzQ+YinU= X-Google-Smtp-Source: AGHT+IEvAFk1L+Pcn/Uzb6O2RnHrfPP/1zS5OHJzZ6IjJGH3HQ3YsJMLWnSlUDxaBb8GfBVdT+LUjg== X-Received: by 2002:a05:6a20:5483:b0:243:d5ab:d202 with SMTP id adf61e73a8af0-243d6e0090emr333558637.15.1756506305279; Fri, 29 Aug 2025 15:25:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 13/91] linux-user/openrisc: Convert target_elf_gregset_t to a struct Date: Sat, 30 Aug 2025 08:23:09 +1000 Message-ID: <20250829222427.289668-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::433; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x433.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756571907414124100 Content-Type: text/plain; charset="utf-8" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/elfload.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 40a5bcccab..da034e5a76 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -655,18 +655,18 @@ static void elf_core_copy_regs(target_elf_gregset_t *= r, const CPUMBState *env) =20 /* See linux kernel arch/openrisc/include/asm/elf.h. */ #define ELF_NREG 34 /* gprs and pc, sr */ -typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; +typedef struct target_elf_gregset_t { + target_elf_greg_t regs[ELF_NREG]; +} target_elf_gregset_t; =20 -static void elf_core_copy_regs(target_elf_gregset_t *regs, +static void elf_core_copy_regs(target_elf_gregset_t *r, const CPUOpenRISCState *env) { - int i; - - for (i =3D 0; i < 32; i++) { - (*regs)[i] =3D tswapreg(cpu_get_gpr(env, i)); + for (int i =3D 0; i < 32; i++) { + r->regs[i] =3D tswapreg(cpu_get_gpr(env, i)); } - (*regs)[32] =3D tswapreg(env->pc); - (*regs)[33] =3D tswapreg(cpu_get_sr(env)); + r->regs[32] =3D tswapreg(env->pc); + r->regs[33] =3D tswapreg(cpu_get_sr(env)); } =20 #endif /* TARGET_OPENRISC */ --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756571165; cv=none; d=zohomail.com; s=zohoarc; b=B97ctTWfsgiT93PcZV8YlKZ3GLrTrgZsPLo2QQ793dXju97JFtXfkUeX6YbH8BEHXMGSN+ZtTu2RjG6MXzX7kcciwZWc1y3rdFfSigQYyV/tApM2OHfl8Ji0SC23qGLtuLFTZg7uuaCCY8l9dcBeG1PuvensFPxFhUXPn/UKssg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756571165; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=EBOCs0u9eTFzPs1BXssx7t+lpyppND+lsDMhtkq3G70=; b=NKgGZa02/SfsvZE+r9J3yTqqKKDdJnE2DGLoXCbhvO9qCQ1+Px2HBbiRxbXSfgyZALqJJBhZBf/nM7rEqI4hHmjjl6r6DsuzqibpvQvP7W/C6N9L33slVB0f3ImnuN7mhwCbkGWrWmXlzayvSjQ2E9TwA6eKl1Ppna0wWAfY7cI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756571165292721.3633139785305; Sat, 30 Aug 2025 09:26:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNk4-00004y-Ta; Sat, 30 Aug 2025 11:43:48 -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 1us7Wy-0002zr-Jk for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:12 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7Wv-0002tX-T5 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:11 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-76e4fc419a9so2754683b3a.0 for ; Fri, 29 Aug 2025 15:25:09 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.25.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:25:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506308; x=1757111108; 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=EBOCs0u9eTFzPs1BXssx7t+lpyppND+lsDMhtkq3G70=; b=PsO3AHsyezcOKn+pZw2TXqCB2Wmrr5x1BNqFsBLb1nad4zB9nPnbZRefBmQ/olxcS+ JAeoFTrnRiwQVMwAKdSPfROhRLidVg9/QhdNg1D2H1k34G/W8+DBcYTXpRDBg5Hum3TS VvjUWyzIv6SuVYbv//58+e49n8ZbIqPYox4gbBZ5q3Doko3Ybsvd4ZfQWxMVv+CD3fAk /GZEGAgP2h1w9jIpv9IKhxugAY+9baUxkga1LNza18wVPrimRSCxMfq2pvG0bc0GAuEN CxdSvsc51qwi+sGL4ajfCoSviiNdzvgDMRv0/uNmzIFBQ5iuXRuhWlAbWZ7l0LZpwaio UuGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506308; x=1757111108; 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=EBOCs0u9eTFzPs1BXssx7t+lpyppND+lsDMhtkq3G70=; b=pIENnOCb8ov1bxtwTsk0xiJuTwSr3q++NV6hW96fItV6Is7s5KQgBFApl+3+MHFBKx Le9C3QJ4NVNVBPM1/+E/DZ3CFpJrtq78oeVVRK7SaTa37EHx3Ong1wNWP16a9cvJ7EPY L+HgR2arg7oM3FqBW86+CMCGxyguuirsJTk9Q/COCzEX0c2CLkRLEHTD20mGj+fcpyG/ FGs54OaxeMEI+b5Ta8FgXwnNeVhcj7G52aUM0XBkED0BkaErn+h1D01N0NqDmAc+3j30 LIgPpBFyYC8vm/B4hoENh2pwew9q5x1M1G/w4a1dkKpmS0BktiDIfuAvHni/6Hf8hJe0 P04Q== X-Gm-Message-State: AOJu0YyBGQ+X+jk9E0kURJM5l49JiZ6gaA5lZfCAzXxJ8JyXGv81NuDD QXggjykf29dDaWlRMrJ7YDrF0YCmL/Ez83gf1+w/e/qsWhOuF55uTsa9uXRDS6sdqM2DU1Rkjoy w7I7CAtY= X-Gm-Gg: ASbGncsYQkIS4Rl+96O3ucFBojKhErcx+7YdhXp8wENr2OwRAaKuKntQ9dU6f9Cn7bC o6KxyDeG7Et7PBEyBVuQh7k2j9jiV4pvekmqPb71zly0sHYpdJIfdvLNm3Y+1833m8Wam1fiE30 gaYdrNcAu8zlEEzMHGWL3FB74UM+MNZlDL51oFOW/GmvKIf9cx6dZsB81529LpU9HA9PPOoIMqh s61K5erX+AAXtP30JoVRkNNl/1KsbG1KIwK5CQb6N0YLPH6rtIXWwxPydTA1Z8FHdX8ecMhk936 w3PwqteMYIGRqIXzEAcGEna8d3/BcbUJ5LIJgvkwBmjpsNXi9M0Yv4Oz2LaFygR66W7kbEewPvy cfaw16ZdM6K5DUPlRdFbPMDdyoMPRDpcEFl3trNTjjnxM32zTKI1H5JspK2hk X-Google-Smtp-Source: AGHT+IGC/WQdATEhJ+is6Kaz7Qx3IvOwAs100mcyBwfsLRMDKU732nRYksWhjaG9AZX+f2yRrVXtfQ== X-Received: by 2002:a05:6a00:1495:b0:771:ebf1:5e45 with SMTP id d2e1a72fcca58-7723e393f29mr288794b3a.22.1756506307614; Fri, 29 Aug 2025 15:25:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 14/91] linux-user/sh4: Convert target_elf_gregset_t to a struct Date: Sat, 30 Aug 2025 08:23:10 +1000 Message-ID: <20250829222427.289668-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756571167393124100 Content-Type: text/plain; charset="utf-8" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/elfload.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index da034e5a76..cc9140bf32 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -678,7 +678,9 @@ static void elf_core_copy_regs(target_elf_gregset_t *r, =20 /* See linux kernel: arch/sh/include/asm/elf.h. */ #define ELF_NREG 23 -typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; +typedef struct target_elf_gregset_t { + target_elf_greg_t regs[ELF_NREG]; +} target_elf_gregset_t; =20 /* See linux kernel: arch/sh/include/asm/ptrace.h. */ enum { @@ -691,22 +693,19 @@ enum { TARGET_REG_SYSCALL =3D 22 }; =20 -static inline void elf_core_copy_regs(target_elf_gregset_t *regs, - const CPUSH4State *env) +static void elf_core_copy_regs(target_elf_gregset_t *r, const CPUSH4State = *env) { - int i; - - for (i =3D 0; i < 16; i++) { - (*regs)[i] =3D tswapreg(env->gregs[i]); + for (int i =3D 0; i < 16; i++) { + r->regs[i] =3D tswapreg(env->gregs[i]); } =20 - (*regs)[TARGET_REG_PC] =3D tswapreg(env->pc); - (*regs)[TARGET_REG_PR] =3D tswapreg(env->pr); - (*regs)[TARGET_REG_SR] =3D tswapreg(env->sr); - (*regs)[TARGET_REG_GBR] =3D tswapreg(env->gbr); - (*regs)[TARGET_REG_MACH] =3D tswapreg(env->mach); - (*regs)[TARGET_REG_MACL] =3D tswapreg(env->macl); - (*regs)[TARGET_REG_SYSCALL] =3D 0; /* FIXME */ + r->regs[TARGET_REG_PC] =3D tswapreg(env->pc); + r->regs[TARGET_REG_PR] =3D tswapreg(env->pr); + r->regs[TARGET_REG_SR] =3D tswapreg(env->sr); + r->regs[TARGET_REG_GBR] =3D tswapreg(env->gbr); + r->regs[TARGET_REG_MACH] =3D tswapreg(env->mach); + r->regs[TARGET_REG_MACL] =3D tswapreg(env->macl); + r->regs[TARGET_REG_SYSCALL] =3D 0; /* FIXME */ } =20 #define USE_ELF_CORE_DUMP --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756572833; cv=none; d=zohomail.com; s=zohoarc; b=IBniK6jLI++m+Wm22MduByz3UO1DXtgdgULrUZ2Yi/IcP2VxEpTmYH2sm0hUhqsEuLEIBNHeyOVVpqLxQWg2TeoUdTGk8OzXWTbMfia6iNYCQDOUM3fIDaH9e/4MLOp7IQ40TXy/i0jvLflVYyaDhoGtB54xAQM5eG/yvyXiUsw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756572833; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=9DLQHYrFBBQgrJX6BSepayoYNYcVFTIA/ZVA/HIxSrQ=; b=PHssAfnU3JBJejpIyChIs6qnAS5ud0HFXuG2mznYcqbAfD5o2F4Y+1MvEWx2buVh/sI4E68SOd4d0DyPC1Sln5TAxF9OGxFH63rdbH1pTMMlXQIbv3raQt9XwTKh+F8iak0LaiuWeZm+R3PpNVYdKvqOBnKMRtUxWDeThpH3Zug= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756572833980740.1110619628569; Sat, 30 Aug 2025 09:53:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNiM-0003ew-U8; Sat, 30 Aug 2025 11:42:03 -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 1us7X0-00031F-Ex for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:14 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7Wy-0002u8-CP for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:14 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-771f90a45easo2233460b3a.1 for ; Fri, 29 Aug 2025 15:25:11 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.25.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:25:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506310; x=1757111110; 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=9DLQHYrFBBQgrJX6BSepayoYNYcVFTIA/ZVA/HIxSrQ=; b=cmjJC290+EYX8goDhAh7zsPEjaF8+UAv/fl5GlbdPcdcH8hHmE7jlFFT4sP79QCSJZ Oq3HuJ7EeW9O8AGWt2mZRyC9aITuMulnE0S8O2WtTAE3i6PXdTTVUVIzXZWKUxsye8Wa Cbagc79BnzWyTVXGCoOPLV1wG31zUCXnk3xdQ55//lMCDHrKt6aG3ChCo4hRoJVDO8+p n3NCBhf+f3ymGz0KAYLyalKm0Jcbq5xmrClru1rQNWwyHmlVEfQWIxmaiHqn8jhaAexa 7dpZwulwg12blTOpJpibf6pGI7VBA1+FxNsCGSlmbOaPK989bn2MXGFsKB+cY4jJSirp qA0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506310; x=1757111110; 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=9DLQHYrFBBQgrJX6BSepayoYNYcVFTIA/ZVA/HIxSrQ=; b=iFoK8zqfgBYKXociruZHnewv7TaaW9qT/FR5wXdO9CN4c/izX2hDYX4LDpaAyFW77v sxXDsRujKWYsg7k41UgTXZPYQfyvyKIRgR8w7TTDBUiZeI4pYF+BYMOET4En7QIMxgSK jPgOhb389eIJ1One8u78TDhPcADjPp/RjmnS7IfxUzSfO4cCmnl6G3hzh60EanGJQ9u3 4FAluXwwyGtzl/6S5tBYZBNa75QP5P+e4DqJMMR+J/bNEkeRt4WBnL98oEuTWqatkkJt RRtpR+siYxPMtmRxH1UjAxrirHHTMj/PG4KZUDakfilT2p44o1H7t//aVjgEaEl5lUXr eHtg== X-Gm-Message-State: AOJu0YzC5cLPDTL/XfThWdJGkruFSKarBWphSvxT1DuLp2V6tVydxZqJ CZLQiIIbJypCVSBc6/cY6hPKXwKJB0pJvj/qhfPdF3c2onhE5QisDiaeQ7uIF8DW1Jhsz3P3NaW E+eGnH0I= X-Gm-Gg: ASbGnctB5CizsJfNLW3TXLk3yCYNp0OSHHsBCWLBHam4W98rf/8Jv0qqkPUSiOOrkXT 8qUX6ViwjfjSSS3ZJAifVds0z041QVNA4hF9gAknDe3Bs7Mua7PasyLvmEPu+YRUCsT4/5ibvgb BM78vI3bfxcmwjLmDAS9btB15SnUIVAHtEEU3uj4flS0bDzd2TUf116nV9k4pHm5KL487FTRTsF NbdFHJjoHvtZ+lk9ibehWSvlKGzsC/GPuOdhA3OcbW3dF+4m2GVKLX6AqOIyL6cN6js9Rivb6Uv baV2VnmjzqiZe/a7kDkHoN57FRSCRcgfFrIrvMQloRSMdEGh6xQ4uRV2IVMDv6uRnkV1BKLtB4d Y95VUnoqsQ/F+DurqgVPqr95JGfD6yADIUSqVgLVYMaGg0hbzsvz3ehF63Wgb X-Google-Smtp-Source: AGHT+IGLjX6318Vny1PtbO53PP0M/Q0WooP+7zs6JzXGRm9qpv9cKmoTBwnFBHehll2IOhIz96mmKA== X-Received: by 2002:a05:6a00:b84:b0:772:1a18:b8d0 with SMTP id d2e1a72fcca58-7723e3d1d5bmr228459b3a.30.1756506309973; Fri, 29 Aug 2025 15:25:09 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 15/91] linux-user/m68k: Convert target_elf_gregset_t to a struct Date: Sat, 30 Aug 2025 08:23:11 +1000 Message-ID: <20250829222427.289668-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756572835481116600 Content-Type: text/plain; charset="utf-8" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/elfload.c | 46 +++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index cc9140bf32..63376fa1d6 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -720,30 +720,32 @@ static void elf_core_copy_regs(target_elf_gregset_t *= r, const CPUSH4State *env) =20 /* See linux kernel: arch/m68k/include/asm/elf.h. */ #define ELF_NREG 20 -typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; +typedef struct target_elf_gregset_t { + target_elf_greg_t regs[ELF_NREG]; +} target_elf_gregset_t; =20 -static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUM68KSt= ate *env) +static void elf_core_copy_regs(target_elf_gregset_t *r, const CPUM68KState= *env) { - (*regs)[0] =3D tswapreg(env->dregs[1]); - (*regs)[1] =3D tswapreg(env->dregs[2]); - (*regs)[2] =3D tswapreg(env->dregs[3]); - (*regs)[3] =3D tswapreg(env->dregs[4]); - (*regs)[4] =3D tswapreg(env->dregs[5]); - (*regs)[5] =3D tswapreg(env->dregs[6]); - (*regs)[6] =3D tswapreg(env->dregs[7]); - (*regs)[7] =3D tswapreg(env->aregs[0]); - (*regs)[8] =3D tswapreg(env->aregs[1]); - (*regs)[9] =3D tswapreg(env->aregs[2]); - (*regs)[10] =3D tswapreg(env->aregs[3]); - (*regs)[11] =3D tswapreg(env->aregs[4]); - (*regs)[12] =3D tswapreg(env->aregs[5]); - (*regs)[13] =3D tswapreg(env->aregs[6]); - (*regs)[14] =3D tswapreg(env->dregs[0]); - (*regs)[15] =3D tswapreg(env->aregs[7]); - (*regs)[16] =3D tswapreg(env->dregs[0]); /* FIXME: orig_d0 */ - (*regs)[17] =3D tswapreg(env->sr); - (*regs)[18] =3D tswapreg(env->pc); - (*regs)[19] =3D 0; /* FIXME: regs->format | regs->vector */ + r->regs[0] =3D tswapreg(env->dregs[1]); + r->regs[1] =3D tswapreg(env->dregs[2]); + r->regs[2] =3D tswapreg(env->dregs[3]); + r->regs[3] =3D tswapreg(env->dregs[4]); + r->regs[4] =3D tswapreg(env->dregs[5]); + r->regs[5] =3D tswapreg(env->dregs[6]); + r->regs[6] =3D tswapreg(env->dregs[7]); + r->regs[7] =3D tswapreg(env->aregs[0]); + r->regs[8] =3D tswapreg(env->aregs[1]); + r->regs[9] =3D tswapreg(env->aregs[2]); + r->regs[10] =3D tswapreg(env->aregs[3]); + r->regs[11] =3D tswapreg(env->aregs[4]); + r->regs[12] =3D tswapreg(env->aregs[5]); + r->regs[13] =3D tswapreg(env->aregs[6]); + r->regs[14] =3D tswapreg(env->dregs[0]); + r->regs[15] =3D tswapreg(env->aregs[7]); + r->regs[16] =3D tswapreg(env->dregs[0]); /* FIXME: orig_d0 */ + r->regs[17] =3D tswapreg(env->sr); + r->regs[18] =3D tswapreg(env->pc); + r->regs[19] =3D 0; /* FIXME: regs->format | regs->vector */ } =20 #define USE_ELF_CORE_DUMP --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756570589; cv=none; d=zohomail.com; s=zohoarc; b=hNYwX7BoHZhsy+u9hC1tvjOSHTmCqgj3M6HrgxMVbU3PbamSdHxtN909rqT3ltKjIUFTL13DScmvqlI/QykkKsaVpLTci6pbuq/4uW5RePLZ5OVesLo4kaGbVlIY9KYfE3lZr5QRdLWO3uej+iIl9ATpkCLoy2EAT9Ae2i9Chnk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756570589; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/ODt3jFX/ShiFbhhaunrjNIA0fSWhF7JNs/c5siSe2U=; b=lvM8VACxs/VmQnmGS3U5N7yKvR7Qw256MWf509LfCiO73GkR9r0LpXaxW7R3hRf6741xNd/Cz/fYsuNpf3zPdfNiJhx7vuazn/YAxokisbBK9rxT36dDvkroj3tHNDzTy8QNLTtbuZpXuy94lySgIJlRiaD53huyVC5THdVKBl4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756570589748752.5738334300248; Sat, 30 Aug 2025 09:16:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNk7-0000Jy-OP; Sat, 30 Aug 2025 11:43:51 -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 1us7X2-00032R-72 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:16 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7Wz-0002v1-RN for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:15 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-771eecebb09so3477241b3a.3 for ; Fri, 29 Aug 2025 15:25:13 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.25.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:25:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506312; x=1757111112; 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=/ODt3jFX/ShiFbhhaunrjNIA0fSWhF7JNs/c5siSe2U=; b=e6ftwQcVDaSaiDb7LtWB7g/Ap9grXczrs0jx4ti0MEOu1KHURogBcH9XbilOqIPVGG ylrHGV0rAwraYOfsrrJc2EK+orNQvZmyLwgiIUDrac++546NyBd8A9TRmiK87qsu3iHJ aVSFKn56ox11e9IDiBPkttjtDSBxyTyro7VNirT6R5AJUyTLr9jUhW5OtG+8s4qe6LvY BL7FhVO2ygs6JPmKVGU+1ye8dqBN1db0ONM11zXLOL8gOgWkIZh5uhvfd4onT2MWN0vZ Ftsekqmr+fIwdey4dhIAuoSaJ0qmw4irU2prKSBwaX/SWTCokJxIgObZ1oIn9NGhDF2c yoUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506312; x=1757111112; 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=/ODt3jFX/ShiFbhhaunrjNIA0fSWhF7JNs/c5siSe2U=; b=WMQMFktBh2t+KjXcUTrd+2fiUDESQ3m4mWAIMSikqFwsS60mDOEMpc6rzGVHaux14k ywFwSIJh5JUaCXV2IVmPsdzQa0eXOlHuFLdi1VTndozszEA9UpcepTAAnehqPUbI/XoG Uxuz+MrrsK455bOLEqJsgL2uS1Yz8sGUNK1y0PK7gj1Qtb0cUTrotrbTiR56th339/l/ vTOdxceY+2uyw9Wxdy5luiCqftq7KTDviGTTXThocwGVLg6MzWzDcVylt+dlGteAr6+e KjfPAhllQlUhbFyhRuZt0rOVrmBKd4/iU8A6VRpLVyIAUslTmEM4cw9A3tpasOHssm6W yfDQ== X-Gm-Message-State: AOJu0YymVttTXlBsi0a6Dge0U82mBrjCjaBHHwXoji2Lwjesc6evb1RC LM8Q8c1rYiLe/gvhKuccZhztz4QlUFP/zHPWxjDRGBGNaOA+mTLsItczwgRr4+as9T2XslxuOnm 1jeg0db8= X-Gm-Gg: ASbGncu+pk01027CRQpcK6UdtYQc6RL0z80A3h0sAq3WRDCNwFB39if/m6d+G277Ljv hAmvEtYat1gKPD9RoI7NT9VH5OFPsq/zhmaBpra/p8XfHtHllAvUWnFnCsdu/1Xs3KupEU36uV/ X1LTcD2hK+hsdWRI+7CP78cYmDIHw2yFFwjvaUVyIkBQ1N84IQFUPPILuSlaIXYKWFX5p7SordT YX2UZN7Ww4aq3x71gd9sGHV9VmJNbno07i6KpabJczhXPf4zNTJsIwD4WzG2vyymlRfJwevZcDC wUWbi6PKu897pCT5VpDtNme0pxI+CjVU5p4PQt8cT5vcDEDTjY6WgwW3VhrvuAspXaRWLtvMfCJ pQPnbADyLzWSE64fIHa3diaqaRtjI3yhqEqMfDr7ks3JI3oMQ75kq7KAhNcAu3PptqAq5iE8= X-Google-Smtp-Source: AGHT+IGhjt9x1vdwjR1/Hg1do5ESSaOxca5UZKu2FOaxGaRCUn55DtWdj/H0rVTXffHY2SeHBfPsSQ== X-Received: by 2002:a05:6a00:a22:b0:771:e3d7:4320 with SMTP id d2e1a72fcca58-7723e362840mr206158b3a.19.1756506312252; Fri, 29 Aug 2025 15:25:12 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 16/91] linux-user/s390x: Convert target_elf_gregset_t to a struct Date: Sat, 30 Aug 2025 08:23:12 +1000 Message-ID: <20250829222427.289668-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42b; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42b.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756570590674116600 Content-Type: text/plain; charset="utf-8" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/elfload.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 63376fa1d6..98c17d32e6 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -770,7 +770,9 @@ static void elf_core_copy_regs(target_elf_gregset_t *r,= const CPUM68KState *env) =20 /* See linux kernel: arch/s390/include/uapi/asm/ptrace.h (s390_regs). */ #define ELF_NREG 27 -typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; +typedef struct target_elf_gregset_t { + target_elf_greg_t regs[ELF_NREG]; +} target_elf_gregset_t; =20 enum { TARGET_REG_PSWM =3D 0, @@ -780,22 +782,22 @@ enum { TARGET_REG_ORIG_R2 =3D 26, }; =20 -static void elf_core_copy_regs(target_elf_gregset_t *regs, +static void elf_core_copy_regs(target_elf_gregset_t *r, const CPUS390XState *env) { int i; uint32_t *aregs; =20 - (*regs)[TARGET_REG_PSWM] =3D tswapreg(env->psw.mask); - (*regs)[TARGET_REG_PSWA] =3D tswapreg(env->psw.addr); + r->regs[TARGET_REG_PSWM] =3D tswapreg(env->psw.mask); + r->regs[TARGET_REG_PSWA] =3D tswapreg(env->psw.addr); for (i =3D 0; i < 16; i++) { - (*regs)[TARGET_REG_GPRS + i] =3D tswapreg(env->regs[i]); + r->regs[TARGET_REG_GPRS + i] =3D tswapreg(env->regs[i]); } - aregs =3D (uint32_t *)&((*regs)[TARGET_REG_ARS]); + aregs =3D (uint32_t *)&(r->regs[TARGET_REG_ARS]); for (i =3D 0; i < 16; i++) { aregs[i] =3D tswap32(env->aregs[i]); } - (*regs)[TARGET_REG_ORIG_R2] =3D 0; + r->regs[TARGET_REG_ORIG_R2] =3D 0; } =20 #define USE_ELF_CORE_DUMP --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756576499; cv=none; d=zohomail.com; s=zohoarc; b=f++CfOZYwaatH+Z54F8rSBwsMXH4JD6N+xr0an1VzdB8DZFlNKlGSyVNmN36BKd/kOmTFV1QG7wUwkPSTr0ZdwwN6VR5KCSt5A4LtLDt1vjCMyrFunWufY1viISIOFOvfAEGtPBwR3S0fHRSFerZS50GbZ4MdRN0Q0TBdIEhDxA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756576499; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=vntlxf7RKCOfwSDGO8mO6KzabCP78W1rl91PrXQ2mIc=; b=hkYOiU3J+LL0HGS/CSINibsH1TtHaEA4lkJxJnO7/DQwSEBok2Sc2xwhLCjM48g93tn/iavH6q/xuJpNRiakzXEDyk1gwbrsHcOWd/VCO0WTZOgwNa/foSRWuSUv7WtM4seCReTFigC068UspinIId/8oj/2jDIMp9/tSzX82cc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756576499529265.6311566134357; Sat, 30 Aug 2025 10:54:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNiQ-0003xP-Tl; Sat, 30 Aug 2025 11:42:06 -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 1us7X4-00033i-R8 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:18 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7X2-0002vj-EW for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:18 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-7722c88fc5fso1114396b3a.2 for ; Fri, 29 Aug 2025 15:25:15 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.25.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:25:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506315; x=1757111115; 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=vntlxf7RKCOfwSDGO8mO6KzabCP78W1rl91PrXQ2mIc=; b=p300bDnoql9VzgbCvBsf38moIiul0id4ixc98sYl4Vs/RfEd1uwXj3jXtUEzInuSPx ay3e+iMlFUtsqQtJJqWyr+BUeDpi4/6uW39znARmSps1gPkJnwG9srH3qYwOxKe8ef3A tz/HalTRvQrDSMyepH81IJvLTrqMbYbHbEqG6JqKppTFcANhGaSJYeyyq/lYD+fm2HPT BIjKNx/aUZcK87SETsX2lA9ecFdey3ghKXXKus/r39i2NkcG2lC510HmfHeAdnzEftYA tld3BC04Ji4+9IBOghJO6oOvic8cv2tq5CAh5i6LI/KrANqwPLz+rXcQkKLD/BqGOG5H Fdng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506315; x=1757111115; 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=vntlxf7RKCOfwSDGO8mO6KzabCP78W1rl91PrXQ2mIc=; b=SdZVaWpVviGZ5jIIFBILP0mMW7DzhgcKBUy/kaKYVze9CJivz0bzuF8BD+TnRv9GI4 ShWFZjtIsMP08FP9PRdJrbiTjeOgEbyipSNMViZTuFEJfdvZLkyrFQegxCRYfYyiT/jL 7BCFrH4dq4ZieOaUOPbgmDjxVcjYTlbMiGvtT7PpoBcpxzUdcL3kGSciT2mJPMFZtodh PDQ7u/vwXMIlgq2PJ+KwszAM/6QTss4Bg70Atnq5m2NxGsJ0Nf1NqSbmjluCgzCr4Tfm wg92gSfeaTjaFGnJ/IMO5zi40bFeDAzMc64rfkoMJzdIYmU7SjXv6B1KixmIjGmyd+Dz eYgA== X-Gm-Message-State: AOJu0YyX17F0N/m4VCfz1WbPF2xT2pFzAxPTpssTTM4qs1nnRTjz0jt4 isDTCW5Qm2bS5amfhL3vyVrqo36AwNTRrAbTvmxiZYwHhQ3N06ZlzQSr3zKRoQZHWnBgNm54rE9 Fq4UPVYs= X-Gm-Gg: ASbGncsQfT4MROQEPh5R1aoSGVW0XJdIixXU+aQTpSIQzFGrtoQ3roxyOb6ceHvTy5g 2lhOjDUpkVgJ3i+/xADZPRGqo2XNUSnBLj6pwIrbPfbdoCMaAC5yeqHJkp7UJFsvx0qzT6g8fFI fRDPAjYtTLd5A2AP4NVLwOYm2H0EAwA2dQo1h1sZ6xD56PNypZBkSzQQIMQ5dtv5RG4b5VH14se rRm5XVr7FZ5UOoK5xizmpDfRAFtX9219E4M9ILKPh213EN1nbOoQueq4traKR1z2cbgYLjREszc 3GMmABjTzWk1+oyNbbiUU7z4/ZOsJ2GoOJfQWGA15sfdSCWZ+Gw3BxPWvprkNuDWjPl5jJ4wZ0E rCVSLII3yFke2/gxa0X1wj6COLQiWTGvVMcNYPbqM7IgEn9vUwNXqHA+cx9mGYOgm29hebeH7nD bmlHQDrA== X-Google-Smtp-Source: AGHT+IHwx6EQklugCPEKyuV0YGCstCxb98GkD/wxy3zK7DhlRDxpDcsVNumJJj3gfv9eWK1MkUregw== X-Received: by 2002:a05:6a00:1404:b0:770:556d:32e8 with SMTP id d2e1a72fcca58-7723e3502d7mr312566b3a.24.1756506314742; Fri, 29 Aug 2025 15:25:14 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 17/91] linux-user/xtensa: Convert target_elf_gregset_t to a struct Date: Sat, 30 Aug 2025 08:23:13 +1000 Message-ID: <20250829222427.289668-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756576501430116600 Content-Type: text/plain; charset="utf-8" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/elfload.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 98c17d32e6..930701f08f 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -873,7 +873,9 @@ static bool init_guest_commpage(void) =20 /* See linux kernel: arch/xtensa/include/asm/elf.h. */ #define ELF_NREG 128 -typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; +typedef struct target_elf_gregset_t { + target_elf_greg_t regs[ELF_NREG]; +} target_elf_gregset_t; =20 enum { TARGET_REG_PC, @@ -888,23 +890,23 @@ enum { TARGET_REG_AR0 =3D 64, }; =20 -static void elf_core_copy_regs(target_elf_gregset_t *regs, +static void elf_core_copy_regs(target_elf_gregset_t *r, const CPUXtensaState *env) { unsigned i; =20 - (*regs)[TARGET_REG_PC] =3D tswapreg(env->pc); - (*regs)[TARGET_REG_PS] =3D tswapreg(env->sregs[PS] & ~PS_EXCM); - (*regs)[TARGET_REG_LBEG] =3D tswapreg(env->sregs[LBEG]); - (*regs)[TARGET_REG_LEND] =3D tswapreg(env->sregs[LEND]); - (*regs)[TARGET_REG_LCOUNT] =3D tswapreg(env->sregs[LCOUNT]); - (*regs)[TARGET_REG_SAR] =3D tswapreg(env->sregs[SAR]); - (*regs)[TARGET_REG_WINDOWSTART] =3D tswapreg(env->sregs[WINDOW_START]); - (*regs)[TARGET_REG_WINDOWBASE] =3D tswapreg(env->sregs[WINDOW_BASE]); - (*regs)[TARGET_REG_THREADPTR] =3D tswapreg(env->uregs[THREADPTR]); + r->regs[TARGET_REG_PC] =3D tswapreg(env->pc); + r->regs[TARGET_REG_PS] =3D tswapreg(env->sregs[PS] & ~PS_EXCM); + r->regs[TARGET_REG_LBEG] =3D tswapreg(env->sregs[LBEG]); + r->regs[TARGET_REG_LEND] =3D tswapreg(env->sregs[LEND]); + r->regs[TARGET_REG_LCOUNT] =3D tswapreg(env->sregs[LCOUNT]); + r->regs[TARGET_REG_SAR] =3D tswapreg(env->sregs[SAR]); + r->regs[TARGET_REG_WINDOWSTART] =3D tswapreg(env->sregs[WINDOW_START]); + r->regs[TARGET_REG_WINDOWBASE] =3D tswapreg(env->sregs[WINDOW_BASE]); + r->regs[TARGET_REG_THREADPTR] =3D tswapreg(env->uregs[THREADPTR]); xtensa_sync_phys_from_window((CPUXtensaState *)env); for (i =3D 0; i < env->config->nareg; ++i) { - (*regs)[TARGET_REG_AR0 + i] =3D tswapreg(env->phys_regs[i]); + r->regs[TARGET_REG_AR0 + i] =3D tswapreg(env->phys_regs[i]); } } =20 --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756571321; cv=none; d=zohomail.com; s=zohoarc; b=GqIFCVmn3nwKZ1V4ziBz6jWjEQyvsNBQuZeUeKKFs6bTR4Wsk42vD5WpZOr/U9DrE1eDQAkdfd34+7H5tBvFPXP+DE7F0CgXymcWqN+kzbzLGmsKTWEXwrUY132izDmepPzHXDGzgTz6PUbUowGCguAod2s+ks0F+6B527ncm8w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756571321; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=WDt0kaislKgfQkK/AeZRFzppj7QwoJ8FRry7veda2b8=; b=hnPz8+1IrmS8NAYtEa8kTKk3WP6cpHPeteVzrEMp6O8CEBGRYDdN3eqqn6bNjxxJBtYWmgGg6monWWFYLPrLfPltFO+b9iIATo+RhEPMI6hmBXOaaxNyDDF5Z+zEmpw0wXip1IZ3F0JJ0XZE4RBWSptmNh/5zlHvfYjMLrxp9Gw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756571320973757.1658422509064; Sat, 30 Aug 2025 09:28:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNkA-0000g9-7j; Sat, 30 Aug 2025 11:43:54 -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 1us7X7-00034i-NX for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:21 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7X4-0002wB-I1 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:20 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-7723f0924a3so9165b3a.2 for ; Fri, 29 Aug 2025 15:25:17 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.25.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:25:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506317; x=1757111117; 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=WDt0kaislKgfQkK/AeZRFzppj7QwoJ8FRry7veda2b8=; b=iVmnVaYan3SXe7Sg7JtOZbDPNAmlyrokVuISqnH9DGzhRkaF+VCWCTO/xF/yERPo9U tC8zAOhD1YxUJq9aBvCuBWJ/gIpg6ezFlNfr359beClXrRo/522hNcLxo4QWJADealGg jRi5L9zabaeo6gtAxunRgH5UG+GF7aJtT5PEF2uEJMfwMuFKKnZxS2GPgGWilpIXtPY7 ogW+BI4DpkcLaLh7f3zwUotb0kbBzgP9ozZdLE+PR9t65HEUEdsMWlecyz68clMNggsF 8oaf1XikctRF3k0Odnt18LQ69KfeBuPD9B+/ocw1yVIDOOOLWR7ak/mYy82C2gnhJAzE h9mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506317; x=1757111117; 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=WDt0kaislKgfQkK/AeZRFzppj7QwoJ8FRry7veda2b8=; b=rsVqekgo9oOEMHTYTPNAhbgqkkE1MVNM9iroYSRxJ7HOY47af2lU7RCuhEwL0pHWQL LExAD1mxErRRJKdkoXxX8lQRQJwI5HBqQl3mwOfyxh7zWPPmc2gQd9e5kQ/Lu3+GjngN Hr/xMl1fTpmgwKOBK+2WUc+tJDGdxgjU8lyGhqpKZnviPbnyB9F8yPA2UoTshAjN+3HM 7xkPpN3U+a5kb9d/Fns12dysIU4Tan5Y02uO5bdQv/BTAgzFaY43epv3D+Q82VoNNUaS wBukUm8RoQ0Sw/4mZaa35XFhBt9p4g1tECEM+G76mgn327TkOGvmlvYLgDOlD4NqXNbv 0diQ== X-Gm-Message-State: AOJu0YytW8X3wFEewFuOCMgvV1JcTcZpJAh4VYJeSXB0q6C0P8EbBiol 7oYXZ7BH0GcE/r7oO4IXQHK3qXii1xxajEt9Oj8Xoafvn9S7IDtqhKqLd5QKTHwnWf1ae6ZL5rf N0PiksTY= X-Gm-Gg: ASbGncs/qa6xySDEiJyhfjxKbhX8cR/eIcUxnzMC7qJGNBUekHVlXEvCPRPD00BdLZ8 b1I0EzTlTH905Iiaz99Wl6/yOhXbGaBngF4wcA2Apkc8qubMJSgPocns1YqOm9ZaFLJOo1q3iM6 HprNQoFyYci8zZHzf1jwsn/YtB5ZdU+tAS1NedOi9xCnzlWH+tFnFk1nfjUIRRCxVOzV4e8qrJT KAdcFZRaIXLuz4xGH/Vd0pIwbYRGRuoR5YH5QnOCAqmerrzvh4TCbva++4waTj9RgjMg3RcW2RM dX/R/g+ywGjvXInig64Xe+Z26pvl6lTbxw5p/726EzJnq/bIGAHVkn5J4mVUN2ltsHhBC94x4NS IC3xm2Z68mB8990q/MB33oYEENqt7A70IDj3FczGXhyvS/OI/d+fBC1nn600T X-Google-Smtp-Source: AGHT+IFQwT0iSyIpw4JbYWlj5mslKJ+EjHlTHNU4OQ2ZGcqL1jTSKNXFerf9lXZL3bc4xH7KEDR0eQ== X-Received: by 2002:a05:6a00:2451:b0:749:464a:a77b with SMTP id d2e1a72fcca58-7723e376d48mr340043b3a.18.1756506316889; Fri, 29 Aug 2025 15:25:16 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 18/91] linux-user: Update comment for target_elf_gregset_t Date: Sat, 30 Aug 2025 08:23:14 +1000 Message-ID: <20250829222427.289668-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756571321589116601 Content-Type: text/plain; charset="utf-8" The only thing now used by generic core dump code is target_elf_gregset_t; ELF_NREG and target_elf_greg_t are now private to the implementation. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/elfload.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 930701f08f..74f88dfa68 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -2859,12 +2859,8 @@ int load_elf_binary(struct linux_binprm *bprm, struc= t image_info *info) * * #define USE_ELF_CORE_DUMP * - * Next you define type of register set used for dumping. ELF specificati= on - * says that it needs to be array of elf_greg_t that has size of ELF_NREG. - * - * typedef target_elf_greg_t; - * #define ELF_NREG - * typedef taret_elf_greg_t target_elf_gregset_t[ELF_NREG]; + * Next you define type of register set used for dumping: + * typedef struct target_elf_gregset_t { ... } target_elf_gregset_t; * * Last step is to implement target specific function that copies registers * from given cpu into just specified register set. Prototype is: --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756569168; cv=none; d=zohomail.com; s=zohoarc; b=cL+YNf5gzM6/l6zVpF42vYrETG2jR+tJ7lt994GpchbJ7XILp9MGykZouQaUeyh8kqhVVmxtEC1dTScNqOxeKwvxXsUQE6UtuWDPEktKV882RxRwql42bITjvn4zoDBgdBZ0OoHghfpE/wJqFNH5rEHIPEg27GLZVhlZccX92bk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756569168; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=xdSZmf4gf+D2YfOOkYcOeqd7VudOjMm2IgypnFCFG5I=; b=cg69mbo/JmarxiAU/myxJqdp32DYvf4YPdeF/qBD9F6vNLQS6mSnIolJYgQWrU3qN54SG9WXIz+iOj+My5NqDoFokYqmR+629b7516JtFUWMU5mZ3HfiFkbrkawwgZEe1D2IeJoXU6hHVvBLJnUajBtkXCfPasVA4gkoGF9XZnM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756569168087642.2234321226622; Sat, 30 Aug 2025 08:52:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNkC-0000wu-QS; Sat, 30 Aug 2025 11:43:57 -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 1us7X8-00035B-Rn for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:22 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7X6-0002we-Nn for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:22 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-77033293ed8so2352415b3a.0 for ; Fri, 29 Aug 2025 15:25:20 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.25.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:25:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506319; x=1757111119; 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=xdSZmf4gf+D2YfOOkYcOeqd7VudOjMm2IgypnFCFG5I=; b=R6g0COUXlaiPMJDafAY5L0hfsbB7k1IadQawms/kJUoWbQZxQ97AnydiE8sFqBJpBo Vk2xBpbJ/L2dmHhDUhQj0XmxuptnOLGc5jiQt3bmEu4B4m5Z84AGBJngPYXYbmY9SiKD fedzVE0yVprmu3NO4bhQ8jS9BFLSGCFD6CXnwmiQJ/NPYpcTLV4sFi2cX5nOH6j6DVx6 p1faZfSXZ8xRGmMqQSJt3yBzG1gw5NXvbUYITkefyeVslYVjaMu+ONxRo9TMaqnRIwEc GZpTPywgd7HRBqE1YXSOjwMUt/uHnMKykn2FY/bkYyqpKFsaQS+EKeb8c5kn6o3fuR+/ 7r2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506319; x=1757111119; 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=xdSZmf4gf+D2YfOOkYcOeqd7VudOjMm2IgypnFCFG5I=; b=TZq7/52v+wmEbf8eAbk+4uaInl/uTzSouFlRR1U8/fZZaJZVHA+0PB9ZBcaQshdP6i tHiK6aH+CMv34Pbd0N/PxWxpCLqEjxsLzHSBN/Ay2q91mmgkKamL2yDSKzwGgAVBXWsy 9aqo/cEOeyva7FsQquT8N3qjBeDY5er2culvId/FjMKVIP2TURN700Hp2qAqO/OI+zyf T4NsRAMVbHe4DLyBhwrsMqgXyXA7Kta78jP03X2+h3kmwKO4g2RqmyCmaCN6+JDCPeAN B87bLy8vpA2WtLaxylTJ9iWZCUO4wnXdYLVuZc8POTZiP+vti0HbpGnUHvo5/aUOEdoV GlnA== X-Gm-Message-State: AOJu0Yz665xreP38lI9v6zbbjx/CrCQ2NzC+h3UC2bNzyxbhHC9JKMuL ZaHxiemXgBgugPYXi5fZu7t/5fISgwycCgsoP9dKkMSZD6pRtu0xPbu8SRAdOXWQQz3Za8ZFxkq 6Bv2A/w0= X-Gm-Gg: ASbGncvgLU+gG93QozjfytCVraLM3KYl0VWv/I0IZUUChAGsabEuQ5FxZsPTRlT8D0g 6oEj7btGyybalPBIDThUmTuEPcF4SZVjEIxl9iUvYrN12nfxojqPTb3KEwa9uDcfqQ+wwadcQs8 53JJrSCV3W09CV4zdvCp2LGiMJNmswu0YsvpJ9lUfCA5Ueg6tBq5bVljJYD4xUkvyYH47ROhK5Y ljBDMv6M2HuDk+1wG+empIMPmTxzRiWxCF98eVBBx13cl2pQk5Mium7OmRE3GCZjo2wF+6p72t4 mKIhgHx2+Gq54UslgKdm3f1dyc63HyYy8m8FCqJSGMy4bnpD++/tQkSweUEClOysuA4X2w3lq/b JMDBeUPDhPG7rTPiZo0MfrGAMyy9HkidJwV/EpePy58XtZmSS/EFAPOI7meFNSVwxpQSic4k= X-Google-Smtp-Source: AGHT+IE6G8OQ44EsQZVppr97etnCQXNlov+mussN+3HAQQ3mjFZGJswhBrroZVTvE9COq5X/TREQOA== X-Received: by 2002:a05:6a00:3e0f:b0:771:e06b:7edf with SMTP id d2e1a72fcca58-7723e350dcbmr319402b3a.24.1756506319195; Fri, 29 Aug 2025 15:25:19 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 19/91] linux-user: Declare elf_core_copy_regs in loader.h Date: Sat, 30 Aug 2025 08:23:15 +1000 Message-ID: <20250829222427.289668-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42b; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42b.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756569170623124100 Content-Type: text/plain; charset="utf-8" Drop the static from all implementations. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/loader.h | 3 +++ linux-user/elfload.c | 33 ++++++++++++++------------------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/linux-user/loader.h b/linux-user/loader.h index 6482c7c90c..8f4a7f69ac 100644 --- a/linux-user/loader.h +++ b/linux-user/loader.h @@ -106,4 +106,7 @@ const char *elf_hwcap2_str(uint32_t bit); const char *get_elf_platform(CPUState *cs); const char *get_elf_base_platform(CPUState *cs); =20 +struct target_elf_gregset_t; +void elf_core_copy_regs(struct target_elf_gregset_t *, const CPUArchState = *); + #endif /* LINUX_USER_LOADER_H */ diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 74f88dfa68..5ed5b3c544 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -165,7 +165,7 @@ typedef struct target_elf_gregset_t { * * See linux kernel: arch/x86/include/asm/elf.h */ -static void elf_core_copy_regs(target_elf_gregset_t *r, const CPUX86State = *env) +void elf_core_copy_regs(target_elf_gregset_t *r, const CPUX86State *env) { r->regs[0] =3D tswapreg(env->regs[15]); r->regs[1] =3D tswapreg(env->regs[14]); @@ -244,7 +244,7 @@ typedef struct target_elf_gregset_t { * * See linux kernel: arch/x86/include/asm/elf.h */ -static void elf_core_copy_regs(target_elf_gregset_t *r, const CPUX86State = *env) +void elf_core_copy_regs(target_elf_gregset_t *r, const CPUX86State *env) { r->regs[0] =3D tswapreg(env->regs[R_EBX]); r->regs[1] =3D tswapreg(env->regs[R_ECX]); @@ -300,7 +300,7 @@ typedef struct target_elf_gregset_t { target_elf_greg_t regs[ELF_NREG]; } target_elf_gregset_t; =20 -static void elf_core_copy_regs(target_elf_gregset_t *r, const CPUARMState = *env) +void elf_core_copy_regs(target_elf_gregset_t *r, const CPUARMState *env) { for (int i =3D 0; i < 16; ++i) { r->regs[i] =3D tswapreg(env->regs[i]); @@ -388,7 +388,7 @@ typedef struct target_elf_gregset_t { target_elf_greg_t regs[ELF_NREG]; } target_elf_gregset_t; =20 -static void elf_core_copy_regs(target_elf_gregset_t *r, const CPUARMState = *env) +void elf_core_copy_regs(target_elf_gregset_t *r, const CPUARMState *env) { for (int i =3D 0; i < 32; i++) { r->regs[i] =3D tswapreg(env->xregs[i]); @@ -474,7 +474,7 @@ typedef struct target_elf_gregset_t { target_elf_greg_t regs[ELF_NREG]; } target_elf_gregset_t; =20 -static void elf_core_copy_regs(target_elf_gregset_t *r, const CPUPPCState = *env) +void elf_core_copy_regs(target_elf_gregset_t *r, const CPUPPCState *env) { int i; target_ulong ccr =3D 0; @@ -528,8 +528,7 @@ enum { TARGET_EF_CSR_BADV =3D TARGET_EF_R0 + 34, }; =20 -static void elf_core_copy_regs(target_elf_gregset_t *r, - const CPULoongArchState *env) +void elf_core_copy_regs(target_elf_gregset_t *r, const CPULoongArchState *= env) { r->regs[TARGET_EF_R0] =3D 0; =20 @@ -586,7 +585,7 @@ enum { }; =20 /* See linux kernel: arch/mips/kernel/process.c:elf_dump_regs. */ -static void elf_core_copy_regs(target_elf_gregset_t *r, const CPUMIPSState= *env) +void elf_core_copy_regs(target_elf_gregset_t *r, const CPUMIPSState *env) { int i; =20 @@ -628,7 +627,7 @@ typedef struct target_elf_gregset_t { } target_elf_gregset_t; =20 /* See linux kernel: arch/mips/kernel/process.c:elf_dump_regs. */ -static void elf_core_copy_regs(target_elf_gregset_t *r, const CPUMBState *= env) +void elf_core_copy_regs(target_elf_gregset_t *r, const CPUMBState *env) { for (int i =3D 0; i < 32; i++) { r->regs[i] =3D tswapreg(env->regs[i]); @@ -659,8 +658,7 @@ typedef struct target_elf_gregset_t { target_elf_greg_t regs[ELF_NREG]; } target_elf_gregset_t; =20 -static void elf_core_copy_regs(target_elf_gregset_t *r, - const CPUOpenRISCState *env) +void elf_core_copy_regs(target_elf_gregset_t *r, const CPUOpenRISCState *e= nv) { for (int i =3D 0; i < 32; i++) { r->regs[i] =3D tswapreg(cpu_get_gpr(env, i)); @@ -693,7 +691,7 @@ enum { TARGET_REG_SYSCALL =3D 22 }; =20 -static void elf_core_copy_regs(target_elf_gregset_t *r, const CPUSH4State = *env) +void elf_core_copy_regs(target_elf_gregset_t *r, const CPUSH4State *env) { for (int i =3D 0; i < 16; i++) { r->regs[i] =3D tswapreg(env->gregs[i]); @@ -724,7 +722,7 @@ typedef struct target_elf_gregset_t { target_elf_greg_t regs[ELF_NREG]; } target_elf_gregset_t; =20 -static void elf_core_copy_regs(target_elf_gregset_t *r, const CPUM68KState= *env) +void elf_core_copy_regs(target_elf_gregset_t *r, const CPUM68KState *env) { r->regs[0] =3D tswapreg(env->dregs[1]); r->regs[1] =3D tswapreg(env->dregs[2]); @@ -782,8 +780,7 @@ enum { TARGET_REG_ORIG_R2 =3D 26, }; =20 -static void elf_core_copy_regs(target_elf_gregset_t *r, - const CPUS390XState *env) +void elf_core_copy_regs(target_elf_gregset_t *r, const CPUS390XState *env) { int i; uint32_t *aregs; @@ -890,8 +887,7 @@ enum { TARGET_REG_AR0 =3D 64, }; =20 -static void elf_core_copy_regs(target_elf_gregset_t *r, - const CPUXtensaState *env) +void elf_core_copy_regs(target_elf_gregset_t *r, const CPUXtensaState *env) { unsigned i; =20 @@ -2865,8 +2861,7 @@ int load_elf_binary(struct linux_binprm *bprm, struct= image_info *info) * Last step is to implement target specific function that copies registers * from given cpu into just specified register set. Prototype is: * - * static void elf_core_copy_regs(taret_elf_gregset_t *regs, - * const CPUArchState *env); + * void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUArchState = *env); * * Parameters: * regs - copy register values into here (allocated and zeroed by call= er) --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756569452; cv=none; d=zohomail.com; s=zohoarc; b=g2QVJL0BgzaxifHRgCi/UOMU38HsP1LEUEPZQ2SX3jDzIRBuOMi2j72/5fUMqhshFIwQkUhx+cNMTf54B/nIapeFkbOaH5/stdfqisL0b5nlz+EqtEJOs1bH5CqliEq8ln8wbxQkPpFOq9iV/0Ke39H7XbBC+g4iVdDJvUen9/w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756569452; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=X9m6A5YC5iG2ZMRgXVIU2Ixx/cYFasDyy2ZVNm3Vfvs=; b=d/aqhKEFzspnq2Euo/J6alaYKgE2qlM6AXVF7cuZKfQw7E+PU6mIc5LSpfDgq6Nhm5lo5A5VvWA6GGl7hOLWnHYDivc9hv1goLGcXjnNu1uAhNzH2numDjyn2ldKohhJD8hE6W9kAcRqd1Ijs3Mn4Gg1k2OE7rG/+YvduurZtu8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756569452831598.7774903716471; Sat, 30 Aug 2025 08:57:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNkG-0001OA-UK; Sat, 30 Aug 2025 11:44:01 -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 1us7XB-00036U-Mf for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:25 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7X9-0002x8-GT for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:25 -0400 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-772301f8ae2so954541b3a.0 for ; Fri, 29 Aug 2025 15:25:23 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.25.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:25:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506321; x=1757111121; 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=X9m6A5YC5iG2ZMRgXVIU2Ixx/cYFasDyy2ZVNm3Vfvs=; b=VNmTywkLHolJ54oU7BX6fMahqWVpbbwyAVFfCVoptfW6WIXSFRe0kDFl9Oi3BxB3L6 N9dw5Q5Dxb/8adhmJemekXGNU8d37uqpXULZM76EBCU76cgXV+0KKQ4PMmpOakkhKj+M KLkH70ZYA/T7gSh5frwESX+DJULJ5Cpjm44j0RRU2RT2hzqiu0FswgvKOSe1+WjU3i1T BqwVboWojXQvRpfFxGFIH5Sek5f2Tvzdmz0j7fXhUnxOLqfaD1/JTIAfsrW1zrNYSnHF HjEcs4ins1SzUbDgtW7FDj31+AlWkpLGTP2YfN9HoZpOjCbXzR6KmBbCEQVkY+WyiDoO 1tSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506321; x=1757111121; 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=X9m6A5YC5iG2ZMRgXVIU2Ixx/cYFasDyy2ZVNm3Vfvs=; b=wvqg/Ni1J8WnoK70wf6M8EQfC6kotMssOyvZ9KNYcD0S7TflnYEEcvQBkHi/lp37/Y 6XuWErNmfe+Jf/9v54rxEHCuw9kPzA3IHFiZBVzorjPmUpulV0XenHteEG3LtGPZgZa2 b0I6C8sIuasck4Mt7EDwicCBAdiqka76tXAif/ak7FtzMKf5h4Adz128JxtOlGt+L9Du pNugQ7owr4otpNjMVp8QV8SGZIzq9HtttSkJdVhwmEr66aRfSLyPreYsnvkro/PUFwvK L9Y+rzxwh/ox369wKXZPkx5Ecdi+FnY3Ipv2J4CCgfq8ADinuf9QYXCKeApi+24NEMnq xpBA== X-Gm-Message-State: AOJu0YyT3bKmwhrLQLef9TPMbqYGWRl5sGUqMAD6aF102bYDpdJ712GH RGBwLkXhPuv2EZRjCQnv3LUdQ95bprSklRS4wy4m340f6lPLU6j7L1LUJb386cnG2+DvAmVNUAu CfEa0LIM= X-Gm-Gg: ASbGncsTSKGVckO26cAn4i1OmxSuI38D2ygH0Kzs15OWyc0eB9K0nkYsAbmHgIEOjEs GABIq0gn9PTkAWs5dClGRstX2YBUUXGhkZNmTGLMw/KUdXQ5M4yXt4aDkbnAL7NB0Q4PVybrmY4 iE8PDnkq3gYj5a6pK/eLSNRfuIOzsdJwRZB/XSogpa1pBwgmwnv5TL0GGF/tUYes1Z6ztXRbiYF 2cXZLJV9MJftiIJ/TivKJsBvgL5BVXk2sCBs++HKkjeYPLJClA8E8TylPXU2ih++QILTKDfTTrd xH1JnO62L7M17YHnUfDQWS9U1EM4a60LlK+gRmpQOfdnqmi0VMqubyJsJ/MxY9X05eo6Vh2xsLm dT0ivNvAWktrK1b4yNH1S/haYsyUiS6KhZmCOuum6g3ZkLs/0fCjoT3+ZfqjfvYCnAzHpA4k= X-Google-Smtp-Source: AGHT+IHUN7DT1QQRNVql5dPlF0KNRJ3sGPX1KMPjwyqTQPIujw0xFRfDZyr4x/U14aJGRCC63I6DpA== X-Received: by 2002:a05:6a00:b96:b0:770:4d54:6234 with SMTP id d2e1a72fcca58-7723e1f4471mr278108b3a.3.1756506321511; Fri, 29 Aug 2025 15:25:21 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 20/91] linux-user: Rename USE_ELF_CORE_DUMP to HAVE_ELF_CORE_DUMP Date: Sat, 30 Aug 2025 08:23:16 +1000 Message-ID: <20250829222427.289668-21-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756569455753124100 Content-Type: text/plain; charset="utf-8" The other knobs in target_elf.h are all HAVE_*. Rename this USE_ELF_CORE_DUMP to match. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/elfload.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 5ed5b3c544..af31a34594 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -281,7 +281,7 @@ void elf_core_copy_regs(target_elf_gregset_t *r, const = CPUX86State *env) =20 #define VDSO_HEADER "vdso.c.inc" =20 -#define USE_ELF_CORE_DUMP +#define HAVE_ELF_CORE_DUMP #define ELF_EXEC_PAGESIZE 4096 =20 #endif /* TARGET_I386 */ @@ -309,7 +309,7 @@ void elf_core_copy_regs(target_elf_gregset_t *r, const = CPUARMState *env) r->regs[17] =3D tswapreg(env->regs[0]); /* XXX */ } =20 -#define USE_ELF_CORE_DUMP +#define HAVE_ELF_CORE_DUMP #define ELF_EXEC_PAGESIZE 4096 =20 /* The commpage only exists for 32 bit kernels */ @@ -397,7 +397,7 @@ void elf_core_copy_regs(target_elf_gregset_t *r, const = CPUARMState *env) r->regs[33] =3D tswapreg(pstate_read((CPUARMState *)env)); } =20 -#define USE_ELF_CORE_DUMP +#define HAVE_ELF_CORE_DUMP #define ELF_EXEC_PAGESIZE 4096 =20 #if TARGET_BIG_ENDIAN @@ -493,7 +493,7 @@ void elf_core_copy_regs(target_elf_gregset_t *r, const = CPUPPCState *env) r->regs[38] =3D tswapreg(ccr); } =20 -#define USE_ELF_CORE_DUMP +#define HAVE_ELF_CORE_DUMP #define ELF_EXEC_PAGESIZE 4096 =20 #ifndef TARGET_PPC64 @@ -540,7 +540,7 @@ void elf_core_copy_regs(target_elf_gregset_t *r, const = CPULoongArchState *env) r->regs[TARGET_EF_CSR_BADV] =3D tswapreg(env->CSR_BADV); } =20 -#define USE_ELF_CORE_DUMP +#define HAVE_ELF_CORE_DUMP #define ELF_EXEC_PAGESIZE 4096 =20 #endif /* TARGET_LOONGARCH64 */ @@ -606,7 +606,7 @@ void elf_core_copy_regs(target_elf_gregset_t *r, const = CPUMIPSState *env) r->regs[TARGET_EF_CP0_CAUSE] =3D tswapreg(env->CP0_Cause); } =20 -#define USE_ELF_CORE_DUMP +#define HAVE_ELF_CORE_DUMP #define ELF_EXEC_PAGESIZE 4096 =20 #endif /* TARGET_MIPS */ @@ -620,7 +620,7 @@ void elf_core_copy_regs(target_elf_gregset_t *r, const = CPUMIPSState *env) =20 #define ELF_EXEC_PAGESIZE 4096 =20 -#define USE_ELF_CORE_DUMP +#define HAVE_ELF_CORE_DUMP #define ELF_NREG 38 typedef struct target_elf_gregset_t { target_elf_greg_t regs[ELF_NREG]; @@ -649,7 +649,7 @@ void elf_core_copy_regs(target_elf_gregset_t *r, const = CPUMBState *env) #define ELF_CLASS ELFCLASS32 #define ELF_DATA ELFDATA2MSB =20 -#define USE_ELF_CORE_DUMP +#define HAVE_ELF_CORE_DUMP #define ELF_EXEC_PAGESIZE 8192 =20 /* See linux kernel arch/openrisc/include/asm/elf.h. */ @@ -706,7 +706,7 @@ void elf_core_copy_regs(target_elf_gregset_t *r, const = CPUSH4State *env) r->regs[TARGET_REG_SYSCALL] =3D 0; /* FIXME */ } =20 -#define USE_ELF_CORE_DUMP +#define HAVE_ELF_CORE_DUMP #define ELF_EXEC_PAGESIZE 4096 =20 #endif @@ -746,7 +746,7 @@ void elf_core_copy_regs(target_elf_gregset_t *r, const = CPUM68KState *env) r->regs[19] =3D 0; /* FIXME: regs->format | regs->vector */ } =20 -#define USE_ELF_CORE_DUMP +#define HAVE_ELF_CORE_DUMP #define ELF_EXEC_PAGESIZE 8192 =20 #endif @@ -797,7 +797,7 @@ void elf_core_copy_regs(target_elf_gregset_t *r, const = CPUS390XState *env) r->regs[TARGET_REG_ORIG_R2] =3D 0; } =20 -#define USE_ELF_CORE_DUMP +#define HAVE_ELF_CORE_DUMP #define ELF_EXEC_PAGESIZE 4096 =20 #define VDSO_HEADER "vdso.c.inc" @@ -906,7 +906,7 @@ void elf_core_copy_regs(target_elf_gregset_t *r, const = CPUXtensaState *env) } } =20 -#define USE_ELF_CORE_DUMP +#define HAVE_ELF_CORE_DUMP #define ELF_EXEC_PAGESIZE 4096 =20 #endif /* TARGET_XTENSA */ @@ -1115,9 +1115,9 @@ static void bswap_mips_abiflags(Mips_elf_abiflags_v0 = *abiflags) } #endif =20 -#ifdef USE_ELF_CORE_DUMP +#ifdef HAVE_ELF_CORE_DUMP static int elf_core_dump(int, const CPUArchState *); -#endif /* USE_ELF_CORE_DUMP */ +#endif /* HAVE_ELF_CORE_DUMP */ static void load_symbols(struct elfhdr *hdr, const ImageSource *src, abi_ulong load_bias); =20 @@ -2827,14 +2827,14 @@ int load_elf_binary(struct linux_binprm *bprm, stru= ct image_info *info) g_free(elf_interpreter); } =20 -#ifdef USE_ELF_CORE_DUMP +#ifdef HAVE_ELF_CORE_DUMP bprm->core_dump =3D &elf_core_dump; #endif =20 return 0; } =20 -#ifdef USE_ELF_CORE_DUMP +#ifdef HAVE_ELF_CORE_DUMP =20 /* * Definitions to generate Intel SVR4-like core files. @@ -2850,10 +2850,10 @@ int load_elf_binary(struct linux_binprm *bprm, stru= ct image_info *info) * Core dump code is copied from linux kernel (fs/binfmt_elf.c). * * Porting ELF coredump for target is (quite) simple process. First you - * define USE_ELF_CORE_DUMP in target ELF code (where init_thread() for + * define HAVE_ELF_CORE_DUMP in target ELF code (where init_thread() for * the target resides): * - * #define USE_ELF_CORE_DUMP + * #define HAVE_ELF_CORE_DUMP * * Next you define type of register set used for dumping: * typedef struct target_elf_gregset_t { ... } target_elf_gregset_t; @@ -3392,4 +3392,4 @@ static int elf_core_dump(int signr, const CPUArchStat= e *env) } return ret; } -#endif /* USE_ELF_CORE_DUMP */ +#endif /* HAVE_ELF_CORE_DUMP */ --=20 2.43.0 From nobody Sun Sep 28 15:28:22 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17565705448401014.4065943682491; Sat, 30 Aug 2025 09:15:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNkJ-0001bQ-H1; Sat, 30 Aug 2025 11:44:03 -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 1us7XF-00037q-2C for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:30 -0400 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7XC-0002xa-BS for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:28 -0400 Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-325393d0ddaso2118712a91.3 for ; Fri, 29 Aug 2025 15:25:25 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.25.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:25:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506324; x=1757111124; 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=HnsU2jXPlSI8IOQgo0w2ao2ecU4o+zzanQ1qk+jqfDE=; b=qAKnfpxHzWmmQSAXaga3TNZrIwIn05WwLr3WIYJ0JVxOTuGJvAcdwwV57xuVwBF0z3 fvGbfEL0Wab+zc9OBJD2l/AC5RKRq7bORPlYHkaENHz+aXHA7D9DQhOqsusWkn80P5VW FvseBsnV+iIitz3NGg1r55GefN/VMWA+JK/AFsqkuEVLiNrdkjoAp2qspj0wf3Y6hWqp o14Cz7bAbtmQSQveU+exsi2TsG01iTUTFUq5z+VRXHWdqel2ZDdD7GcbRGmAc4V6wedv BiUpFukCLjR3UHcCjE94yA07vso/OD9C9EVbI87muvjiL93pt/Yv8QrLqwe8RHZiAgUV QIBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506324; x=1757111124; 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=HnsU2jXPlSI8IOQgo0w2ao2ecU4o+zzanQ1qk+jqfDE=; b=b42EZF74isGLHrZg7Zj++Oehi4mcsFAIkdiKmveY/0Jag4ASZyvDw9mgYjyGOwXIBc +rDak3fXK9rd1uXT1qaxR3We52nGcbd7lckt4EpA5oodXI8+IHFhDda1mkAGBV8eVWUC 9NtrGvYdXDAZ2KHAKYeBsT7O3AL6Jtkrrc5Nfp7PUKcH7uTMshCT6GBOrWnR94PJzNmp gTFy8jLdQ5AfOcX91/91ssfkhXnv/lk4XxTLkx84vpaJ3g+4S43KtpbOX4a3+9u74Nfy VffsQJWMm4gT3xGmx1B5A8FZotlFrenb4QfKG+blFS67ocHTUvCgvwQzhMcGV2R6VyiH pROw== X-Gm-Message-State: AOJu0YymZEv88DTO+6auXaCligpdjPiuGV4oAZE3UNcpSyFykSEYpFDJ F22tHhWEd2HbApz2OQ42OTtCbGoW5MnJDNNJMGa1C8C1ywD7Ctqps9VO7JFEdRpChuwO2UaAiop ARjzehv8= X-Gm-Gg: ASbGncvYURbU6eP2mMnK0VIxKgk+UF9jOXj0LvFPt/kXah6zLaJLFbzrFVcuIfBTeSW IOs/7OpGW2Z7MwdCpqpTQX3jrCoM/EP07FJb9V4MoT1OhyQYM1XGEpwJzvhD78cHl3Shjg7rsip 3kTbutOcxCloNEOoeFLb8vOa1e8I/ADxcp1MU1vEJrB5cqntB0A3TOzZPuCWNtYkMVOQXkJlkBa A4dlI9uxDbWrK4AmE3UV9d9vnM8Ld5UDVKauabj2s/VJDItRTnQChi7GQ1zzsnqCWwa2JGkikF8 GH+5Ub7BQBghgw/895Q84zoBdwnbnjYcwVfTYT9zYbhw+7KkEiasuF5vpCT6q84nZDMQcs+0JrL +OQIXBSRF+0jEi6UHtO2o7ATLpncvSfndJIuK+0zqopHVCPhaoZXTtaUlyJM1 X-Google-Smtp-Source: AGHT+IFcfrLEQRbmyIsiaOjSOt3d2a8otQPPXp/1zyxZ4hYFDEo9NubRQgv9Kenl3Qf1++QTIkpyNA== X-Received: by 2002:a17:90b:3c0e:b0:31f:ca:63cd with SMTP id 98e67ed59e1d1-328154121f0mr298747a91.2.1756506324126; Fri, 29 Aug 2025 15:25:24 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 21/91] linux-user: Move elf_core_copy_regs to {i386, x86_64}/elfload.c Date: Sat, 30 Aug 2025 08:23:17 +1000 Message-ID: <20250829222427.289668-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::1035; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1035.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1756570546488124100 Content-Type: text/plain; charset="utf-8" Move elf_core_copy_regs to elfload.c. Move HAVE_ELF_CORE_DUMP, ELF_NREGS, target_elf_gregset_t to target_elf.h. For now, duplicate the definitions of target_elf_greg_t and tswapreg. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/i386/target_elf.h | 15 +++++++ linux-user/x86_64/target_elf.h | 15 +++++++ linux-user/elfload.c | 77 ---------------------------------- linux-user/i386/elfload.c | 24 +++++++++++ linux-user/x86_64/elfload.c | 34 +++++++++++++++ 5 files changed, 88 insertions(+), 77 deletions(-) diff --git a/linux-user/i386/target_elf.h b/linux-user/i386/target_elf.h index 44dde1ac4a..eb286868e1 100644 --- a/linux-user/i386/target_elf.h +++ b/linux-user/i386/target_elf.h @@ -10,5 +10,20 @@ =20 #define HAVE_ELF_HWCAP 1 #define HAVE_ELF_PLATFORM 1 +#define HAVE_ELF_CORE_DUMP 1 + +/* + * Note that ELF_NREG should be 19 as there should be place for + * TRAPNO and ERR "registers" as well but linux doesn't dump those. + * + * See linux kernel: arch/x86/include/asm/elf.h + */ +#define ELF_NREG 17 + +typedef abi_ulong target_elf_greg_t; + +typedef struct target_elf_gregset_t { + target_elf_greg_t regs[ELF_NREG]; +} target_elf_gregset_t; =20 #endif diff --git a/linux-user/x86_64/target_elf.h b/linux-user/x86_64/target_elf.h index 498c3f7e4e..74a77d94cd 100644 --- a/linux-user/x86_64/target_elf.h +++ b/linux-user/x86_64/target_elf.h @@ -10,5 +10,20 @@ =20 #define HAVE_ELF_HWCAP 1 #define HAVE_ELF_PLATFORM 1 +#define HAVE_ELF_CORE_DUMP 1 + +/* + * Note that ELF_NREG should be 29 as there should be place for + * TRAPNO and ERR "registers" as well but linux doesn't dump those. + * + * See linux kernel: arch/x86/include/asm/elf.h + */ +#define ELF_NREG 27 + +typedef abi_ulong target_elf_greg_t; + +typedef struct target_elf_gregset_t { + target_elf_greg_t regs[ELF_NREG]; +} target_elf_gregset_t; =20 #endif diff --git a/linux-user/elfload.c b/linux-user/elfload.c index af31a34594..e4f821f8c8 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -153,49 +153,6 @@ typedef abi_int target_pid_t; #define ELF_CLASS ELFCLASS64 #define ELF_ARCH EM_X86_64 =20 -#define ELF_NREG 27 -typedef struct target_elf_gregset_t { - target_elf_greg_t regs[ELF_NREG]; -} target_elf_gregset_t; - -/* - * Note that ELF_NREG should be 29 as there should be place for - * TRAPNO and ERR "registers" as well but linux doesn't dump - * those. - * - * See linux kernel: arch/x86/include/asm/elf.h - */ -void elf_core_copy_regs(target_elf_gregset_t *r, const CPUX86State *env) -{ - r->regs[0] =3D tswapreg(env->regs[15]); - r->regs[1] =3D tswapreg(env->regs[14]); - r->regs[2] =3D tswapreg(env->regs[13]); - r->regs[3] =3D tswapreg(env->regs[12]); - r->regs[4] =3D tswapreg(env->regs[R_EBP]); - r->regs[5] =3D tswapreg(env->regs[R_EBX]); - r->regs[6] =3D tswapreg(env->regs[11]); - r->regs[7] =3D tswapreg(env->regs[10]); - r->regs[8] =3D tswapreg(env->regs[9]); - r->regs[9] =3D tswapreg(env->regs[8]); - r->regs[10] =3D tswapreg(env->regs[R_EAX]); - r->regs[11] =3D tswapreg(env->regs[R_ECX]); - r->regs[12] =3D tswapreg(env->regs[R_EDX]); - r->regs[13] =3D tswapreg(env->regs[R_ESI]); - r->regs[14] =3D tswapreg(env->regs[R_EDI]); - r->regs[15] =3D tswapreg(get_task_state(env_cpu_const(env))->orig_ax); - r->regs[16] =3D tswapreg(env->eip); - r->regs[17] =3D tswapreg(env->segs[R_CS].selector & 0xffff); - r->regs[18] =3D tswapreg(env->eflags); - r->regs[19] =3D tswapreg(env->regs[R_ESP]); - r->regs[20] =3D tswapreg(env->segs[R_SS].selector & 0xffff); - r->regs[21] =3D tswapreg(env->segs[R_FS].selector & 0xffff); - r->regs[22] =3D tswapreg(env->segs[R_GS].selector & 0xffff); - r->regs[23] =3D tswapreg(env->segs[R_DS].selector & 0xffff); - r->regs[24] =3D tswapreg(env->segs[R_ES].selector & 0xffff); - r->regs[25] =3D tswapreg(env->segs[R_FS].selector & 0xffff); - r->regs[26] =3D tswapreg(env->segs[R_GS].selector & 0xffff); -} - #if ULONG_MAX > UINT32_MAX #define INIT_GUEST_COMMPAGE static bool init_guest_commpage(void) @@ -232,39 +189,6 @@ static bool init_guest_commpage(void) =20 #define EXSTACK_DEFAULT true =20 -#define ELF_NREG 17 -typedef struct target_elf_gregset_t { - target_elf_greg_t regs[ELF_NREG]; -} target_elf_gregset_t; - -/* - * Note that ELF_NREG should be 19 as there should be place for - * TRAPNO and ERR "registers" as well but linux doesn't dump - * those. - * - * See linux kernel: arch/x86/include/asm/elf.h - */ -void elf_core_copy_regs(target_elf_gregset_t *r, const CPUX86State *env) -{ - r->regs[0] =3D tswapreg(env->regs[R_EBX]); - r->regs[1] =3D tswapreg(env->regs[R_ECX]); - r->regs[2] =3D tswapreg(env->regs[R_EDX]); - r->regs[3] =3D tswapreg(env->regs[R_ESI]); - r->regs[4] =3D tswapreg(env->regs[R_EDI]); - r->regs[5] =3D tswapreg(env->regs[R_EBP]); - r->regs[6] =3D tswapreg(env->regs[R_EAX]); - r->regs[7] =3D tswapreg(env->segs[R_DS].selector & 0xffff); - r->regs[8] =3D tswapreg(env->segs[R_ES].selector & 0xffff); - r->regs[9] =3D tswapreg(env->segs[R_FS].selector & 0xffff); - r->regs[10] =3D tswapreg(env->segs[R_GS].selector & 0xffff); - r->regs[11] =3D tswapreg(get_task_state(env_cpu_const(env))->orig_ax); - r->regs[12] =3D tswapreg(env->eip); - r->regs[13] =3D tswapreg(env->segs[R_CS].selector & 0xffff); - r->regs[14] =3D tswapreg(env->eflags); - r->regs[15] =3D tswapreg(env->regs[R_ESP]); - r->regs[16] =3D tswapreg(env->segs[R_SS].selector & 0xffff); -} - /* * i386 is the only target which supplies AT_SYSINFO for the vdso. * All others only supply AT_SYSINFO_EHDR. @@ -281,7 +205,6 @@ void elf_core_copy_regs(target_elf_gregset_t *r, const = CPUX86State *env) =20 #define VDSO_HEADER "vdso.c.inc" =20 -#define HAVE_ELF_CORE_DUMP #define ELF_EXEC_PAGESIZE 4096 =20 #endif /* TARGET_I386 */ diff --git a/linux-user/i386/elfload.c b/linux-user/i386/elfload.c index ef3a6c35d2..279aeb8116 100644 --- a/linux-user/i386/elfload.c +++ b/linux-user/i386/elfload.c @@ -3,6 +3,7 @@ #include "qemu/osdep.h" #include "qemu.h" #include "loader.h" +#include "target_elf.h" =20 =20 const char *get_elf_cpu_model(uint32_t eflags) @@ -23,3 +24,26 @@ const char *get_elf_platform(CPUState *cs) family =3D MAX(MIN(family, 6), 3); return elf_platform[family - 3]; } + +#define tswapreg(ptr) tswapal(ptr) + +void elf_core_copy_regs(target_elf_gregset_t *r, const CPUX86State *env) +{ + r->regs[0] =3D tswapreg(env->regs[R_EBX]); + r->regs[1] =3D tswapreg(env->regs[R_ECX]); + r->regs[2] =3D tswapreg(env->regs[R_EDX]); + r->regs[3] =3D tswapreg(env->regs[R_ESI]); + r->regs[4] =3D tswapreg(env->regs[R_EDI]); + r->regs[5] =3D tswapreg(env->regs[R_EBP]); + r->regs[6] =3D tswapreg(env->regs[R_EAX]); + r->regs[7] =3D tswapreg(env->segs[R_DS].selector & 0xffff); + r->regs[8] =3D tswapreg(env->segs[R_ES].selector & 0xffff); + r->regs[9] =3D tswapreg(env->segs[R_FS].selector & 0xffff); + r->regs[10] =3D tswapreg(env->segs[R_GS].selector & 0xffff); + r->regs[11] =3D tswapreg(get_task_state(env_cpu_const(env))->orig_ax); + r->regs[12] =3D tswapreg(env->eip); + r->regs[13] =3D tswapreg(env->segs[R_CS].selector & 0xffff); + r->regs[14] =3D tswapreg(env->eflags); + r->regs[15] =3D tswapreg(env->regs[R_ESP]); + r->regs[16] =3D tswapreg(env->segs[R_SS].selector & 0xffff); +} diff --git a/linux-user/x86_64/elfload.c b/linux-user/x86_64/elfload.c index 88541ea45e..76cf5c1509 100644 --- a/linux-user/x86_64/elfload.c +++ b/linux-user/x86_64/elfload.c @@ -3,6 +3,7 @@ #include "qemu/osdep.h" #include "qemu.h" #include "loader.h" +#include "target_elf.h" =20 =20 const char *get_elf_cpu_model(uint32_t eflags) @@ -19,3 +20,36 @@ const char *get_elf_platform(CPUState *cs) { return "x86_64"; } + +#define tswapreg(ptr) tswapal(ptr) + +void elf_core_copy_regs(target_elf_gregset_t *r, const CPUX86State *env) +{ + r->regs[0] =3D tswapreg(env->regs[15]); + r->regs[1] =3D tswapreg(env->regs[14]); + r->regs[2] =3D tswapreg(env->regs[13]); + r->regs[3] =3D tswapreg(env->regs[12]); + r->regs[4] =3D tswapreg(env->regs[R_EBP]); + r->regs[5] =3D tswapreg(env->regs[R_EBX]); + r->regs[6] =3D tswapreg(env->regs[11]); + r->regs[7] =3D tswapreg(env->regs[10]); + r->regs[8] =3D tswapreg(env->regs[9]); + r->regs[9] =3D tswapreg(env->regs[8]); + r->regs[10] =3D tswapreg(env->regs[R_EAX]); + r->regs[11] =3D tswapreg(env->regs[R_ECX]); + r->regs[12] =3D tswapreg(env->regs[R_EDX]); + r->regs[13] =3D tswapreg(env->regs[R_ESI]); + r->regs[14] =3D tswapreg(env->regs[R_EDI]); + r->regs[15] =3D tswapreg(get_task_state(env_cpu_const(env))->orig_ax); + r->regs[16] =3D tswapreg(env->eip); + r->regs[17] =3D tswapreg(env->segs[R_CS].selector & 0xffff); + r->regs[18] =3D tswapreg(env->eflags); + r->regs[19] =3D tswapreg(env->regs[R_ESP]); + r->regs[20] =3D tswapreg(env->segs[R_SS].selector & 0xffff); + r->regs[21] =3D tswapreg(env->segs[R_FS].selector & 0xffff); + r->regs[22] =3D tswapreg(env->segs[R_GS].selector & 0xffff); + r->regs[23] =3D tswapreg(env->segs[R_DS].selector & 0xffff); + r->regs[24] =3D tswapreg(env->segs[R_ES].selector & 0xffff); + r->regs[25] =3D tswapreg(env->segs[R_FS].selector & 0xffff); + r->regs[26] =3D tswapreg(env->segs[R_GS].selector & 0xffff); +} --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756569473; cv=none; d=zohomail.com; s=zohoarc; b=CQM2XF5MbLwxaFm+PupyjMHnJ9lHY/kNKR/0QiBpaNeYIvJw0kL1v8zOQjnWUmEytKLsB3UYujUT9wE5c87HZMiqCjqgUDIuv5y6KJXMUH0r6jf1Z56ZOiy9jzq1lilJbQPNsyyTEWVYXJZgbUVXs7vdxYQlXYNaX0Fs0NsNPtg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756569473; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=dZ69fieo27ga4u9iCgxP9hhIT5qNBs4sxkqT2Bndt4s=; b=QTMKuaORoUBjizam+X49B2nPKin+vpSlIPnWgkWV+Qlb3/JKGqag2Y/rKLMiu7cFdUJcGWDkZq/Ok0Jvp55p2dFenrd/I5mHygJztNFcY31E/uAU/7ByJwomeQLblLUf8I8jfh42dwnAHoZhM7I8HRKhgJ6D74DRt0Dlji0Llh8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756569473714654.369214417967; Sat, 30 Aug 2025 08:57:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNiS-0004Eb-IB; Sat, 30 Aug 2025 11:42:08 -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 1us7XH-00038a-S6 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:32 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7XF-0002y5-0R for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:31 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-7723bf02181so237179b3a.1 for ; Fri, 29 Aug 2025 15:25:28 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.25.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:25:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506326; x=1757111126; 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=dZ69fieo27ga4u9iCgxP9hhIT5qNBs4sxkqT2Bndt4s=; b=MNqdGrc2hW+WrecDDKXJiuq2+tcIwWQicW49S9LwCqItwhq+yzgp0KLEjmMUzPyhe3 GHX6kVzMePuvnJCGztmXeEnfFw079ioJTvehQbSzNrtvQEfBziZ9RT0HdL319oJ227Gb 5Pe0Vw4SFdPWycpu95ujcF2uLfUiIjF40OfNeKwjqgEnQgYRhnj6GL/00ESClvJlrFg8 KY4e0FwPzjahVP2WtqoQcMoIDeFnPO17K1rePKh3mD6nVMo+ZIVXng1ZWPmALhUYp1va 6Uk9slq/PokNsSnaYFnp845EmQ8C6t5J1kerQCO/Abl520n89uU2R6agUUzHITQCzwAD +90w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506326; x=1757111126; 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=dZ69fieo27ga4u9iCgxP9hhIT5qNBs4sxkqT2Bndt4s=; b=Zh+1z9EkO7mh/akYL1JHffQVfEmuAqmIFjXfPyPoIVWnpT2fRsh0V9iWFdoKDSjwL1 k6gYmUVKI7M0RGbYnAp4oiYy8MJebpbZx7gIRjgl2dn4zqaa17qHlBv+NdUqXjF0L988 tkX+VLc1WEb5E3p5+HrNtaLTgEmyuQIhmuiXRnMxqX88U2KU5OT3FV2OrhUNx8QT0jYr pdL5Zmp3jkNINp1TH6zr70aaoP71+pjy/l+AGbCngHoYUCSEvE3TdK+rZnT6xuNKzz5N NIPqeVgzMjVyUmlUFT9z0UJ7WiVTAkNIgirG39vhU5iMwlZ9plExYQx7Pp9u2xPc5Xx4 p6Lw== X-Gm-Message-State: AOJu0YyB0Q2tNNBqdTL/0hZsyAMG4rMoScaAk5SnOcd+tBt7pgRBNres RQAwaOQ9rjV6okJMZ2uP3Nkl03VdaKCxAq22YClxy9jD68fVfmqaquOmxCjL+1YO1y62dltdCSR K0oXxGfE= X-Gm-Gg: ASbGnctB4m6vG7aCa4YWbFtAsHQLwPSO+Oc81q4/nFpDhqZ/cY5nYtqLU/UgZ9MYYcr I7KAYHpYEg9HCxxo2PtEf8zEBn06MtSOzVkNZwcjIsEa8ITdwt4hRM7YkQrIoUGiE0szCFTImiM cKpN9JsEHd5PDJ1WNbpnAWwbnnY/UBNGpiTJ9SZImMaiwPloLnlkTyDAH/6jCgqy3z5JT15R34l Sndh42ieFomjXdxHYSl2DTMMpcuiFSdOeEtYQ1flienkQKlGo69qfdjHLaE86PK/3LnuPHLc81i 1VLJ0No++Pb+sb7YuKAliSqwhmZXIF7VmzvC5q4jTlX/oC2ojjgsIe20048qP3H3JZKDtXMo8V+ 4r8AqEX4lZGCeGz+tB4DwHAsPJyvqZEaIQi2mbcr3UErvwT8radgx+vGcMabhfYg2ckb3BJk= X-Google-Smtp-Source: AGHT+IHXoCHiUkh17itETcYBz3HYtHS1p6uyTOydKlY/p2qT0JnWOKxK/AR214x5gVB8/7gegctbHw== X-Received: by 2002:a05:6a20:938c:b0:243:a000:5be3 with SMTP id adf61e73a8af0-243d6dce65emr339133637.8.1756506326502; Fri, 29 Aug 2025 15:25:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 22/91] linux-user: Move elf_core_copy_regs to arm/elfload.c Date: Sat, 30 Aug 2025 08:23:18 +1000 Message-ID: <20250829222427.289668-23-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756569475597116600 Content-Type: text/plain; charset="utf-8" Move elf_core_copy_regs to elfload.c. Move HAVE_ELF_CORE_DUMP, ELF_NREGS, target_elf_gregset_t to target_elf.h. For now, duplicate the definitions of target_elf_greg_t and tswapreg. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/arm/target_elf.h | 8 ++++++++ linux-user/arm/elfload.c | 12 ++++++++++++ linux-user/elfload.c | 15 --------------- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/linux-user/arm/target_elf.h b/linux-user/arm/target_elf.h index 856ca41b16..94db3738e8 100644 --- a/linux-user/arm/target_elf.h +++ b/linux-user/arm/target_elf.h @@ -11,5 +11,13 @@ #define HAVE_ELF_HWCAP 1 #define HAVE_ELF_HWCAP2 1 #define HAVE_ELF_PLATFORM 1 +#define HAVE_ELF_CORE_DUMP 1 + +typedef abi_ulong target_elf_greg_t; + +#define ELF_NREG 18 +typedef struct target_elf_gregset_t { + target_elf_greg_t regs[ELF_NREG]; +} target_elf_gregset_t; =20 #endif diff --git a/linux-user/arm/elfload.c b/linux-user/arm/elfload.c index 7de1f13f4b..47fe16a1a6 100644 --- a/linux-user/arm/elfload.c +++ b/linux-user/arm/elfload.c @@ -4,6 +4,7 @@ #include "qemu.h" #include "loader.h" #include "target/arm/cpu-features.h" +#include "target_elf.h" =20 =20 const char *get_elf_cpu_model(uint32_t eflags) @@ -199,3 +200,14 @@ const char *get_elf_platform(CPUState *cs) =20 #undef END } + +#define tswapreg(ptr) tswapal(ptr) + +void elf_core_copy_regs(target_elf_gregset_t *r, const CPUARMState *env) +{ + for (int i =3D 0; i < 16; ++i) { + r->regs[i] =3D tswapreg(env->regs[i]); + } + r->regs[16] =3D tswapreg(cpsr_read((CPUARMState *)env)); + r->regs[17] =3D tswapreg(env->regs[0]); /* XXX */ +} diff --git a/linux-user/elfload.c b/linux-user/elfload.c index e4f821f8c8..72a291e51f 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -218,21 +218,6 @@ static bool init_guest_commpage(void) #define ELF_CLASS ELFCLASS32 #define EXSTACK_DEFAULT true =20 -#define ELF_NREG 18 -typedef struct target_elf_gregset_t { - target_elf_greg_t regs[ELF_NREG]; -} target_elf_gregset_t; - -void elf_core_copy_regs(target_elf_gregset_t *r, const CPUARMState *env) -{ - for (int i =3D 0; i < 16; ++i) { - r->regs[i] =3D tswapreg(env->regs[i]); - } - r->regs[16] =3D tswapreg(cpsr_read((CPUARMState *)env)); - r->regs[17] =3D tswapreg(env->regs[0]); /* XXX */ -} - -#define HAVE_ELF_CORE_DUMP #define ELF_EXEC_PAGESIZE 4096 =20 /* The commpage only exists for 32 bit kernels */ --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756575204; cv=none; d=zohomail.com; s=zohoarc; b=AZNTlmKgDnwRPkXdzFuBukcK7ZSTDbcy69S+duq379JOc4aABmLSGmozeXCbK8x/ZHd4kmyKuqSZfl9MXdXbSP0YrxczEBTxsRzKOVNicIiMwfSP/vBAL0UIZnXdmc8vF+o4siRz8BQdyco13YNk54PhFnJdjlnuBf8ojibVLro= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756575204; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=pIvyX9Uw0MOR4o33m8mEn78tjghKzoKbIlp80HImooc=; b=frsS73l9i2SrhOWTPNW5ww40hSUW7klKanYQAL7Pn3/sN1IhCIf6wSedbyyIoZrwnN/jWnyTQP+92Ey3QY8bY93tTRbSNqket5CsMc6QY8rkA8aHnF6pM34SMaxZDyaCD4TSPHtaaCkNk9z3NYGk8S5QF4TAeuKojS8SZC+486s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756575204296236.4048839531174; Sat, 30 Aug 2025 10:33:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNkB-0000qL-QB; Sat, 30 Aug 2025 11:43:56 -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 1us7XJ-00038y-8C for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:34 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7XG-0002yc-QP for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:32 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-7722d6cc437so1100264b3a.0 for ; Fri, 29 Aug 2025 15:25:30 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.25.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:25:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506329; x=1757111129; 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=pIvyX9Uw0MOR4o33m8mEn78tjghKzoKbIlp80HImooc=; b=Jb7l+JNuWYszugxGoQxvRL7rtJRJgZwLS1hx3khHrSVuZcX/fdWhSoIkVeAkWBBxsd gFnOfIHm9zdaEKikJLMqd4e3eoZwxijJ0HgkKCDTWKdchGty6KFstr9fV2ZzhHkGsb20 /TjyQxVQPIeWXn8Yl565a82kCHht4q7c78wYA9g+pyz/iikfROseWH7W4+plPMpm4a8/ VtU5mgqQOngOnzGi1C1vS9G6ZLh4CyUfwucrBiiI62a/nQ+citCUElxfmhW+Bc4qKvp7 2raFqhyiZlVOcfWHL48NlrA+CvwvZWiPR4NA5EadWP+iXQ5iQerMk/L95DZEzWlwhg09 LTYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506329; x=1757111129; 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=pIvyX9Uw0MOR4o33m8mEn78tjghKzoKbIlp80HImooc=; b=TnZkebI+3DwuNeM/2MwrzDICaRBXjGzESJohl7gXR271vlQ6XPRPjQkiYQK6lZ1c0A Nt4aA5sk1yRbfjsU8+SCaymHubzRV6AV6MxFI3pKlWGEFKbUki18an7jTFbfgc8Zmp1U TCtFB7Ae+KbmGNCzXe5JUdVWFS5dF4M9sKmwUzsZbRTQeiBBr28iQiTtZhSJaXofkgJK gNjs09wsqYFTrP/xpZL0RGEh1cYawqT6VCzrc+WNlXhGhn6VyrWV5eDxPV0U8tTIQm1X DNchpR8L20KUHvCI4V9AKS+pSecP6kcZpnGEDEI4uPrHmJZnGMovS4zm2+I+k9UGFCSD cIOg== X-Gm-Message-State: AOJu0Yxpq3jcGMoErCwQvD4kJUKD4YkLuJf7J3DCMEF6a48JJlCObBOZ dO+Ud3QDTXs2YrNcGO2aV5KyzowKJUZIj5bAZp4Ifi7J2hOck6SdaxO7JiLlWzXfEgjU71YAcNj 5LIAqnHg= X-Gm-Gg: ASbGncsC7d2KNLEn8ZHPSOr+7hmx7LOrueG4AMLOZ0vQFGspDpB66+EXkxm8IaQUBer m6q8wd1W2iZfAjmDiGnaFMxqr8hVhDzija5rreezzfmyNIqSOcSK+KrzFqWfDjkic3FrXJd+rz0 dRS+lMHYWRMK0gq/6QEh5McjNmuTaYtRkDNA0tdumqT1equEHyN3iR05Zt9AS3QdFBf8QGuxGqY 8m16Rc8dmCB6T+gyQtwZJk+IQVQ1U0NXMqT8VZ9qUqabV0PyuXQYSEngJGPOKOWhLzz5uMpX+gx 1bM3qnbUhbZg0U5oI+khFceFvq/bI68BkRFFMju4QZ+i1fsjFwyFvOCWP5x41liuc/DN3d8+rtz LIV0uRf0ACJRVbYA9KlS68ZIyamiQvYjQEqDfuxpgC1vekkyWh/DmAWj1uUTBvQJaGWiOZUA= X-Google-Smtp-Source: AGHT+IEwgIS+Z+e0yU+C0gZutmLeAqwiPGbgyGjRYBk+QJQcRp8QcacEMYWTE8sOV2N5lqb+UBaJRA== X-Received: by 2002:a05:6a21:6daa:b0:243:78a:82d0 with SMTP id adf61e73a8af0-243d6f7eed5mr262460637.29.1756506328859; Fri, 29 Aug 2025 15:25:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 23/91] linux-user: Move elf_core_copy_regs to aarch64/elfload.c Date: Sat, 30 Aug 2025 08:23:19 +1000 Message-ID: <20250829222427.289668-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756575205256124100 Content-Type: text/plain; charset="utf-8" Move elf_core_copy_regs to elfload.c. Move HAVE_ELF_CORE_DUMP, ELF_NREGS, target_elf_gregset_t to target_elf.h. For now, duplicate the definitions of target_elf_greg_t and tswapreg. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/aarch64/target_elf.h | 8 ++++++++ linux-user/aarch64/elfload.c | 12 ++++++++++++ linux-user/elfload.c | 15 --------------- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/linux-user/aarch64/target_elf.h b/linux-user/aarch64/target_el= f.h index dee79ce0c6..b0728a1008 100644 --- a/linux-user/aarch64/target_elf.h +++ b/linux-user/aarch64/target_elf.h @@ -11,5 +11,13 @@ #define HAVE_ELF_HWCAP 1 #define HAVE_ELF_HWCAP2 1 #define HAVE_ELF_PLATFORM 1 +#define HAVE_ELF_CORE_DUMP 1 + +typedef abi_ulong target_elf_greg_t; + +#define ELF_NREG 34 +typedef struct target_elf_gregset_t { + target_elf_greg_t regs[ELF_NREG]; +} target_elf_gregset_t; =20 #endif diff --git a/linux-user/aarch64/elfload.c b/linux-user/aarch64/elfload.c index 1030cb8094..00550f9fdf 100644 --- a/linux-user/aarch64/elfload.c +++ b/linux-user/aarch64/elfload.c @@ -4,6 +4,7 @@ #include "qemu.h" #include "loader.h" #include "target/arm/cpu-features.h" +#include "target_elf.h" =20 =20 const char *get_elf_cpu_model(uint32_t eflags) @@ -347,3 +348,14 @@ const char *get_elf_platform(CPUState *cs) { return TARGET_BIG_ENDIAN ? "aarch64_be" : "aarch64"; } + +#define tswapreg(ptr) tswapal(ptr) + +void elf_core_copy_regs(target_elf_gregset_t *r, const CPUARMState *env) +{ + for (int i =3D 0; i < 32; i++) { + r->regs[i] =3D tswapreg(env->xregs[i]); + } + r->regs[32] =3D tswapreg(env->pc); + r->regs[33] =3D tswapreg(pstate_read((CPUARMState *)env)); +} diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 72a291e51f..017346b82d 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -291,21 +291,6 @@ static const VdsoImageInfo *vdso_image_info(uint32_t e= lf_flags) #define ELF_ARCH EM_AARCH64 #define ELF_CLASS ELFCLASS64 =20 -#define ELF_NREG 34 -typedef struct target_elf_gregset_t { - target_elf_greg_t regs[ELF_NREG]; -} target_elf_gregset_t; - -void elf_core_copy_regs(target_elf_gregset_t *r, const CPUARMState *env) -{ - for (int i =3D 0; i < 32; i++) { - r->regs[i] =3D tswapreg(env->xregs[i]); - } - r->regs[32] =3D tswapreg(env->pc); - r->regs[33] =3D tswapreg(pstate_read((CPUARMState *)env)); -} - -#define HAVE_ELF_CORE_DUMP #define ELF_EXEC_PAGESIZE 4096 =20 #if TARGET_BIG_ENDIAN --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756569589; cv=none; d=zohomail.com; s=zohoarc; b=YKl3bYiuisZbdJc579+KQZGDc6ZWGc5HHepinIE9Ch6hmscbAeua2T0n/5oB3kcGKCuO52iMMSmNnSzLsbeBaSL1642dCl/tscebPUgq9mxxHf34d4r6h9r4BScl4vLMPp2vs+huewme6wGWoEMWyht0tq+v7j3/Ak9Plo7DsYo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756569589; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=84/JK3DP1F/+ND6QYYiYK3M7/bjEXR8Zh3F4CzLGSok=; b=aJiZ2cN6M75YrPvUnj6SzJf2iNxIq/+NyW0BSWjtXS9Unum5Yy6Kf0pU/FWGYIgwzerhdpk72Vq1BubXpMCwcn/QOrPbawEvBtyv46JfibzQXwbC/aRNuhzxqAxl/gez0z1KTU9jzfBTwU1i760ff10gskONZqWH7rDzHlX5cIM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756569589080469.49924263095784; Sat, 30 Aug 2025 08:59:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNkF-0001DY-GO; Sat, 30 Aug 2025 11:44: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 1us7XL-00039a-GM for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:35 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7XJ-0002zN-8U for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:35 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-771ed4a8124so2659893b3a.2 for ; Fri, 29 Aug 2025 15:25:32 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.25.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:25:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506331; x=1757111131; 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=84/JK3DP1F/+ND6QYYiYK3M7/bjEXR8Zh3F4CzLGSok=; b=iSxClwJnqTuc1QEQ3KSJ5Bg+qboTK5z5Zr1svxgWTS1L2CxWRoKXPelJDraKQjduyn cfWsU5RM+5LMk6oh15ceMLXJQBxFujnzKNsFynXFma8G3s+KTki1jDLupDzXtGGVw3mi XFxqWqYeS5t4cFZlr8vPfsZvgkgaHjSS9RZQraRzJUTVjN7fy/7iq96KpU4Lr0zdm3pZ n7qG3xGmmMlAiyhRoWBXr4io0VG6wcr0tNsLKyDxYYFIl96kO13J4s3CPRuTi+kclaXV WIgJyz8VFAFXGR5FQjScA8yQu42qkFoMaxfN0tMSeYQdgSg7FB46U04qaDkiUYxvuF1i FdhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506331; x=1757111131; 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=84/JK3DP1F/+ND6QYYiYK3M7/bjEXR8Zh3F4CzLGSok=; b=L7blKPaTY0cxB1wBF5zIbDExYaj+zZoeFZLu0k2kv6KifsLaHIvJlLrrqm8L1hIq9p K6PbDjNLoPVRRfEpv3UpE7X5zy7jm2VXvjIWuPGl8nMOSSyGpwhb1JnOYt04zSDSnTsT lMAOvc2I6dNZMBPq3wxrq6qyDlI0MKlqkx2ep4mhO8A6P0DIuPpPEGi4kYi0RiF6uP+y 9LoVvPNVMAyens0x/5PSSpc8TFlLHM1yme+GpMzxarLBnQOh95SeYLSgJFsN4I/TxEf5 iG8q89ZxIfjSIeCttmBFriy3CFPGQ5f+6YeIbl3F9rlLuNZ71yr08eSfSYS4KHQzRHBz Hv/A== X-Gm-Message-State: AOJu0YygKb3T2P7TrL5pcdZM5JG2zT3Ez2O5cuQsr3GIbZvFbz0nPSus MSVZ6mt4Pcg/nceQwsrv3Q5JpCb5c95F+61YL1NqYDR/ta8h2ZyM8yQWysHLHE2KVPBXu99i1L6 HCb8dszg= X-Gm-Gg: ASbGnct0POOm8us3t87NbAR3vxMuGwC1elSWtHTc9SWPuM+Drv+vO8cXu6BWHVRAy3r Mte1lKlaTC8yjYAYiwT+ewP8OelDfz4hSn0XwrLUxAczHpJh8XENQnjg5JjcVplmFFbU1YsLW8r i1h1cmve3Sm8Id3oZw7V8mxOZz4igi7IkPpyIFjMr79ruiqZODeQym8lipRRFyoz8h7JZU+BVnj E6NSO6ilbIYItuUe+F6hs3H7uKgTvwiuzAWlA4cUdqhY3xNmyb1j/kujgoq+YZnN4INA9GIi+LR HZ+Y8Hq+D2H2kBjzTp+FEPPt9zbRdkdNx4Ny9D8uNm3OBwxpviIzuIZ3bVy72NhMhk3VBXJkGx2 qyxS4RQZy/XX0Lbvhhzg8Zr4bSxgOxcsnWnLeLJ/kzE318o3NLxsN/L6jPjGF X-Google-Smtp-Source: AGHT+IHdXy8KIUP3GzO0bFfdGMPxBM3nu1cp/u8esQGz4igqaMSGdXrzBzB2iX+MWccfrUpWtqmM8w== X-Received: by 2002:aa7:88c8:0:b0:771:f852:452e with SMTP id d2e1a72fcca58-7723e4033afmr223752b3a.29.1756506331374; Fri, 29 Aug 2025 15:25:31 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 24/91] linux-user: Move elf_core_copy_regs to ppc/elfload.c Date: Sat, 30 Aug 2025 08:23:20 +1000 Message-ID: <20250829222427.289668-25-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756569590881116600 Content-Type: text/plain; charset="utf-8" Move elf_core_copy_regs to elfload.c. Move HAVE_ELF_CORE_DUMP, ELF_NREGS, target_elf_gregset_t to target_elf.h. For now, duplicate the definitions of target_elf_greg_t and tswapreg. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/ppc/target_elf.h | 9 +++++++++ linux-user/elfload.c | 26 -------------------------- linux-user/ppc/elfload.c | 22 ++++++++++++++++++++++ 3 files changed, 31 insertions(+), 26 deletions(-) diff --git a/linux-user/ppc/target_elf.h b/linux-user/ppc/target_elf.h index 4203a89d66..72615553ea 100644 --- a/linux-user/ppc/target_elf.h +++ b/linux-user/ppc/target_elf.h @@ -10,5 +10,14 @@ =20 #define HAVE_ELF_HWCAP 1 #define HAVE_ELF_HWCAP2 1 +#define HAVE_ELF_CORE_DUMP 1 + +typedef abi_ulong target_elf_greg_t; + +/* See linux kernel: arch/powerpc/include/asm/elf.h. */ +#define ELF_NREG 48 +typedef struct target_elf_gregset_t { + target_elf_greg_t regs[ELF_NREG]; +} target_elf_gregset_t; =20 #endif diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 017346b82d..d1d0a112fb 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -361,32 +361,6 @@ static const VdsoImageInfo *vdso_image_info(uint32_t e= lf_flags) NEW_AUX_ENT(AT_UCACHEBSIZE, 0); \ } while (0) =20 -/* See linux kernel: arch/powerpc/include/asm/elf.h. */ -#define ELF_NREG 48 -typedef struct target_elf_gregset_t { - target_elf_greg_t regs[ELF_NREG]; -} target_elf_gregset_t; - -void elf_core_copy_regs(target_elf_gregset_t *r, const CPUPPCState *env) -{ - int i; - target_ulong ccr =3D 0; - - for (i =3D 0; i < ARRAY_SIZE(env->gpr); i++) { - r->regs[i] =3D tswapreg(env->gpr[i]); - } - - r->regs[32] =3D tswapreg(env->nip); - r->regs[33] =3D tswapreg(env->msr); - r->regs[35] =3D tswapreg(env->ctr); - r->regs[36] =3D tswapreg(env->lr); - r->regs[37] =3D tswapreg(cpu_read_xer(env)); - - ccr =3D ppc_get_cr(env); - r->regs[38] =3D tswapreg(ccr); -} - -#define HAVE_ELF_CORE_DUMP #define ELF_EXEC_PAGESIZE 4096 =20 #ifndef TARGET_PPC64 diff --git a/linux-user/ppc/elfload.c b/linux-user/ppc/elfload.c index a214675650..114e40a358 100644 --- a/linux-user/ppc/elfload.c +++ b/linux-user/ppc/elfload.c @@ -3,6 +3,7 @@ #include "qemu/osdep.h" #include "qemu.h" #include "loader.h" +#include "target_elf.h" =20 =20 const char *get_elf_cpu_model(uint32_t eflags) @@ -129,3 +130,24 @@ abi_ulong get_elf_hwcap2(CPUState *cs) =20 return features; } + +#define tswapreg(ptr) tswapal(ptr) + +void elf_core_copy_regs(target_elf_gregset_t *r, const CPUPPCState *env) +{ + int i; + target_ulong ccr =3D 0; + + for (i =3D 0; i < ARRAY_SIZE(env->gpr); i++) { + r->regs[i] =3D tswapreg(env->gpr[i]); + } + + r->regs[32] =3D tswapreg(env->nip); + r->regs[33] =3D tswapreg(env->msr); + r->regs[35] =3D tswapreg(env->ctr); + r->regs[36] =3D tswapreg(env->lr); + r->regs[37] =3D tswapreg(cpu_read_xer(env)); + + ccr =3D ppc_get_cr(env); + r->regs[38] =3D tswapreg(ccr); +} --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756570714; cv=none; d=zohomail.com; s=zohoarc; b=OstRAXHzrsMDn3/RNACtfjEwYNqGagMvZ8JD+gk/LAA3+OVbXlgWjjewYyL5XZgUom8KaaJwiJAKBmBQd0fv2j3+bLJRXZY+oq8Q+AWmnC0s1E881TDtq3AEr2kqD3KowFRLKLk6jdBugyQNKsVxL4dpvFIBtap2bEHDuD+O0aA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756570714; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=WfGPN4/CleWn6sgibqL120GdBiTvuQNA01BElWGoypk=; b=hPzvMBZrAtp46jnyWfkdIsuxUV+AgGuhON5mtsw4T0StZsQFjUvCaWpXxZsHB2/UgKFUp6fTmtdsvFawldyjqM3e+nfSDjsnlie9TNEvw/helOOspYmCXHDV+fL6mrbaSEPfGwCbr8FeYK7AE+D2SFVSjS+SgyX6bTHGRAvScpE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756570714090269.14845804015647; Sat, 30 Aug 2025 09:18:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNkJ-0001Xa-1t; Sat, 30 Aug 2025 11:44:03 -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 1us7XP-0003AU-H4 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:40 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7XN-0002zq-Ge for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:39 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-7722d6cc437so1100307b3a.0 for ; Fri, 29 Aug 2025 15:25:36 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.25.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:25:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506334; x=1757111134; 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=WfGPN4/CleWn6sgibqL120GdBiTvuQNA01BElWGoypk=; b=qwBvAjQyBkcrtI6/t8BJigRdkEUiqO2+9Fqc4p/R5R70WQtJXU1Z7R4vuDajO3qxrz +ht3LB5WAlPEpEI7x3cAK5L4+pr48CJGZiRVDaiISo1HszeyW1fgYlDKO3XsunsOM2BC MJ8J2a4KkA0HLVA7PqRDsUzAT/ZwsXAVhyDYwT2Fszf1tiCfSJL67Ie1a9y3pGuRsjXe mxOO+PbjKPxSj6BSd/5lH4ZZX1FM31tmAGCwtZDycJ2vruZC5c9j/bjN+mTbhYfx7Ev3 pWeYnnf0GnVpbS6r5i6365GjrIzsLT76utSo5c/Azi97EX9MgqC90QJTLUdexLSt8TLa MA1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506334; x=1757111134; 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=WfGPN4/CleWn6sgibqL120GdBiTvuQNA01BElWGoypk=; b=d7OEZDqORaBzN1O4htGynZeScPqYLR/T28fZjiT8n4zY8gUqBKXHN5f1AX1atYx1ik 2mgFPzX/uONsagBPi8Uur/hH8gjzw5ZMitLcz8wEI4kDu8gI61jJF2X0qmzuaCSqWuyo KxKunSH2O2uZx08kIhqG3ei6beTxNyU8qnuk+WkOQN1XQeAiRILUIGw9FEefQcpu88YR UNAPEsPYT6fh38XrE8l4BEC+E1b17w6lXmoYfMu90B13zA5x/2PcprxyfP0Ux/H4HTTI LeAw0uy37UIFHhKxNp/OwPszaAoP3CJbV8ekcHOKDZkLSE1/Bz0IJvvdtzD2kpTGXJGg o3ag== X-Gm-Message-State: AOJu0YyghtO38ecM0gzPol/UZwz88gEivZwtn1uNu4lhgUoLI/umZWLS k0WK3i6bExQYh2Wq433zsarlluIS50zZVfXMfWUpcWTZKKLkEnvfyV4Px9wQb+FmG2l0OE2Qsi0 2pnxWNVI= X-Gm-Gg: ASbGnctRJ/l3kvj9c4YHwRVexKRYzAIePAFqnLif+ItDFN3usSqM/y5CE1GhoCkK536 JJd+F0bWg2X3NlJ5X5zc1b4fuOxZI5SOvVELw+m0ChtVSbhHrtnS3+elGdaueIaaEiNEN6R6AZQ 6ZF3T9Pm//DNvZsa/WcIkRQ7Rjn3KGmND5iYSiS05SX5EVaUQL3w3U8s+XZv3VvTOxEzffmru88 JeeV5dS2ENlMj6gVXVyw0GrjoaSfZKgMpslqd8MfI5RG7/I4PZl8GdDei5wR5ODLR3j2iJIt4QE 1yOlz+IRKzBPq0OQEpIpFSTRG/SVy5XKDV1bajhL4VNoPY1EUjq4X1iBYGa9Q0z+/MmqrLes6Yq LOUySleWNbhmKiklMfmZGNSH/zQfu5eyJ3J3Ppcr9q4hkIhU2keYisAMkLt9V X-Google-Smtp-Source: AGHT+IEvDIRIIWhAJWxqg6k6PRAUibtL7TOOH1n3H3Y1DBUJcQcYXCHH6HQAB6MoGi/R1fb5j/QAQg== X-Received: by 2002:a05:6a00:2314:b0:771:58e:5b1e with SMTP id d2e1a72fcca58-7723e387aadmr234757b3a.12.1756506333859; Fri, 29 Aug 2025 15:25:33 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 25/91] linux-user: Move elf_core_copy_regs to loongarch64/elfload.c Date: Sat, 30 Aug 2025 08:23:21 +1000 Message-ID: <20250829222427.289668-26-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42b; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42b.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756570716081116600 Content-Type: text/plain; charset="utf-8" Move elf_core_copy_regs to elfload.c. Move HAVE_ELF_CORE_DUMP, ELF_NREGS, target_elf_gregset_t to target_elf.h. For now, duplicate the definitions of target_elf_greg_t and tswapreg. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/loongarch64/target_elf.h | 9 +++++++++ linux-user/elfload.c | 25 ------------------------- linux-user/loongarch64/elfload.c | 21 +++++++++++++++++++++ 3 files changed, 30 insertions(+), 25 deletions(-) diff --git a/linux-user/loongarch64/target_elf.h b/linux-user/loongarch64/t= arget_elf.h index eb17927325..90bca4499d 100644 --- a/linux-user/loongarch64/target_elf.h +++ b/linux-user/loongarch64/target_elf.h @@ -8,5 +8,14 @@ =20 #define HAVE_ELF_HWCAP 1 #define HAVE_ELF_PLATFORM 1 +#define HAVE_ELF_CORE_DUMP 1 + +typedef abi_ulong target_elf_greg_t; + +/* See linux kernel: arch/loongarch/include/asm/elf.h */ +#define ELF_NREG 45 +typedef struct target_elf_gregset_t { + target_elf_greg_t regs[ELF_NREG]; +} target_elf_gregset_t; =20 #endif diff --git a/linux-user/elfload.c b/linux-user/elfload.c index d1d0a112fb..4acd7b9ffe 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -383,31 +383,6 @@ static const VdsoImageInfo *vdso_image_info(uint32_t e= lf_flags) =20 #define VDSO_HEADER "vdso.c.inc" =20 -/* See linux kernel: arch/loongarch/include/asm/elf.h */ -#define ELF_NREG 45 -typedef struct target_elf_gregset_t { - target_elf_greg_t regs[ELF_NREG]; -} target_elf_gregset_t; - -enum { - TARGET_EF_R0 =3D 0, - TARGET_EF_CSR_ERA =3D TARGET_EF_R0 + 33, - TARGET_EF_CSR_BADV =3D TARGET_EF_R0 + 34, -}; - -void elf_core_copy_regs(target_elf_gregset_t *r, const CPULoongArchState *= env) -{ - r->regs[TARGET_EF_R0] =3D 0; - - for (int i =3D 1; i < ARRAY_SIZE(env->gpr); i++) { - r->regs[TARGET_EF_R0 + i] =3D tswapreg(env->gpr[i]); - } - - r->regs[TARGET_EF_CSR_ERA] =3D tswapreg(env->pc); - r->regs[TARGET_EF_CSR_BADV] =3D tswapreg(env->CSR_BADV); -} - -#define HAVE_ELF_CORE_DUMP #define ELF_EXEC_PAGESIZE 4096 =20 #endif /* TARGET_LOONGARCH64 */ diff --git a/linux-user/loongarch64/elfload.c b/linux-user/loongarch64/elfl= oad.c index 911352840f..832890de10 100644 --- a/linux-user/loongarch64/elfload.c +++ b/linux-user/loongarch64/elfload.c @@ -3,6 +3,7 @@ #include "qemu/osdep.h" #include "qemu.h" #include "loader.h" +#include "target_elf.h" =20 =20 const char *get_elf_cpu_model(uint32_t eflags) @@ -61,3 +62,23 @@ const char *get_elf_platform(CPUState *cs) { return "loongarch"; } + +#define tswapreg(ptr) tswapal(ptr) + +enum { + TARGET_EF_R0 =3D 0, + TARGET_EF_CSR_ERA =3D TARGET_EF_R0 + 33, + TARGET_EF_CSR_BADV =3D TARGET_EF_R0 + 34, +}; + +void elf_core_copy_regs(target_elf_gregset_t *r, const CPULoongArchState *= env) +{ + r->regs[TARGET_EF_R0] =3D 0; + + for (int i =3D 1; i < ARRAY_SIZE(env->gpr); i++) { + r->regs[TARGET_EF_R0 + i] =3D tswapreg(env->gpr[i]); + } + + r->regs[TARGET_EF_CSR_ERA] =3D tswapreg(env->pc); + r->regs[TARGET_EF_CSR_BADV] =3D tswapreg(env->CSR_BADV); +} --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756573596; cv=none; d=zohomail.com; s=zohoarc; b=dsyoZoTEBkD3M5W3HnT5nFlGYIJJ5aIOsH7g8v/TN2V/NdQp+Ob6XZPaEuknSSD+Znlw2j1JSv41piOV85OjuyWB2/Tq84rMCo17uazA6yBlmS1STDLIKKrW6kDQ6Y9agVdeRG+Fl/3BcTrgIL9x+nQM0mWqzELFnFKZ0fbjyP4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756573596; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=QYivKMLETGkzoEANM6kKEvsA5P64eDk8ymUZjDNO9+Y=; b=jnhLUEnb4i1PzUx7p4nAWkQ14g2j7ocovz2BGeoOBW8r1+hiFUYpihlS4wjk2UWfvD9YHumsNF+QsvwjgSnlD4lO2LvhUiGgs+kv+2GdUk6qixybWIqEBsv3SUjFiUTHFQaxtXVS0rl+MERm2SiePncl0srs4T1aDS9qBqGZg0I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756573595998883.7925846714251; Sat, 30 Aug 2025 10:06:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNkK-0001lb-Hw; Sat, 30 Aug 2025 11:44:04 -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 1us7XQ-0003Ah-Aa for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:40 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7XO-00030O-8U for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:40 -0400 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-76e1fc69f86so2837536b3a.0 for ; Fri, 29 Aug 2025 15:25:37 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.25.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:25:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506336; x=1757111136; 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=QYivKMLETGkzoEANM6kKEvsA5P64eDk8ymUZjDNO9+Y=; b=foch5G25B2mx/Kvr5U/3rUowWnJ1PRUIrWIydVvYLMfrkecJKTDMmQr08Ufj34Hpr2 BerlrlxY+Ek8xsK8g+x9PIdZPXvqgueE1XbEgmeki9WJLrSQ/uQS4WWz7HkU5CUI0A3M VdRHF3y810dVhVY2SScO2OIe5AdSqvMJEKatWCuwHr80yJJNXCWgfCiD8MW9Oof281pH VfcJNyVt3xrZOeqqy22ocVr9yZSVBp7oFn9n9WRe5UUYj8OLH01u+Q20Sz7WMVsJhca5 d+pQKvpQseUTLm94WXKwYmvZqIN40eBIPRNYZbKcA73S40I9MxWVFfj6X7xnFWGU+Jvb V2+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506336; x=1757111136; 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=QYivKMLETGkzoEANM6kKEvsA5P64eDk8ymUZjDNO9+Y=; b=BqCMQ7laic3ihtTuzBg+bnomgdjTvgLtdaKaQZu/9Bxn583RUzq9RTNaRT4Yz62onk Ulw6KPhzGnPnAZFDrmAb9D9oNrrS8fg1/4Cngg4i0YXdF9KyWAFk0cSJOjVEvokKmp5A l+XjXLpPWKmIqdZXDNJRkUv/hV3RBJwhiPOILYy0foPAVVZlWey2fkaQfhNl+TH5jt8M cBYkhgCEEqalMuAJmtHkfFy2veZT4IolUTrEXBxjxv4ngBWyg62E74OD1b5Mp+6R+dFr oeNjtHuAxP6YwoVI4P3v9S0O6c9/AsSCvzsMnmwzuB7sUlsGo5HMVs4m1l9G17jjX0i9 E/lw== X-Gm-Message-State: AOJu0YxzYoRvoeEvs0F/j5EpX9RtxaOTbDisX3cLUNBrVNtAKp0CDMCv AEosQS37GZISmIsSPNY2bURu+NPM7gNyHtxokeW74arEEObNSFHR+ZKklSXoB2bpZgpLLnaQB4b spK2t2IU= X-Gm-Gg: ASbGncsSWASd6VsS78J1o9yoZEbgD72N35gEwPLxNs2oDmuiMXBCNRZcKlhi42LqhX8 Eznsq9Cz2YHpm5qBDgnhTnidiFOMD2UR6YYvSCxOLkocxJWD/M0JMUcVGyci5oVhMMxSJ0RtW0e z9CXOX6Lr1hxdGlUdrW4FIMdfnANEJSephUejFibsVxedub2vfpmtvakpmdkXmD/CIdUpf0/LFS pviCjYtuR3Dvwc9Qngbjapy71f5xv2+Mdx4d2EerL76ULOmemjct6KVIENRch290yAfC2PapqJH TNE8eBnISmwnN2aOsuwR2avtrhGUnQ69Q6+vDuxo+y9hx7gCwlxlSEIWXEiWeKwhRmVTOgPxJa/ BrcBTlcdNzyHp0O0mCaQH8fdMa2LVMhZxyCdLoAI4H3ZkAKjT8VjyWAkIrElJ X-Google-Smtp-Source: AGHT+IG3MURXW7D20+bIWpWjjZ9CaCFehSIiwBkPTfvgVKjoFN0V87VYX56YRZ9n1zSHLz8FT2ICaA== X-Received: by 2002:a05:6a20:938c:b0:23d:48fc:652b with SMTP id adf61e73a8af0-243d6e009b3mr284662637.12.1756506336140; Fri, 29 Aug 2025 15:25:36 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 26/91] linux-user: Move elf_core_copy_regs to mips/elfload.c Date: Sat, 30 Aug 2025 08:23:22 +1000 Message-ID: <20250829222427.289668-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::433; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x433.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756573596853124100 Content-Type: text/plain; charset="utf-8" Move elf_core_copy_regs to elfload.c. Move HAVE_ELF_CORE_DUMP, ELF_NREGS, target_elf_gregset_t to target_elf.h. For now, duplicate the definitions of target_elf_greg_t and tswapreg. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/mips/target_elf.h | 9 +++++++ linux-user/mips64/target_elf.h | 13 ++++++++++ linux-user/elfload.c | 46 ---------------------------------- linux-user/mips/elfload.c | 46 ++++++++++++++++++++++++++++++++++ 4 files changed, 68 insertions(+), 46 deletions(-) diff --git a/linux-user/mips/target_elf.h b/linux-user/mips/target_elf.h index 08e699c085..f767767eaa 100644 --- a/linux-user/mips/target_elf.h +++ b/linux-user/mips/target_elf.h @@ -10,5 +10,14 @@ =20 #define HAVE_ELF_HWCAP 1 #define HAVE_ELF_BASE_PLATFORM 1 +#define HAVE_ELF_CORE_DUMP 1 + +typedef abi_ulong target_elf_greg_t; + +/* See linux kernel: arch/mips/include/asm/elf.h. */ +#define ELF_NREG 45 +typedef struct target_elf_gregset_t { + target_elf_greg_t regs[ELF_NREG]; +} target_elf_gregset_t; =20 #endif diff --git a/linux-user/mips64/target_elf.h b/linux-user/mips64/target_elf.h index 24bb7fcd3f..046a165eef 100644 --- a/linux-user/mips64/target_elf.h +++ b/linux-user/mips64/target_elf.h @@ -10,5 +10,18 @@ =20 #define HAVE_ELF_HWCAP 1 #define HAVE_ELF_BASE_PLATFORM 1 +#define HAVE_ELF_CORE_DUMP 1 + +#ifdef TARGET_ABI_MIPSN32 +typedef abi_ullong target_elf_greg_t; +#else +typedef abi_ulong target_elf_greg_t; +#endif + +/* See linux kernel: arch/mips/include/asm/elf.h. */ +#define ELF_NREG 45 +typedef struct target_elf_gregset_t { + target_elf_greg_t regs[ELF_NREG]; +} target_elf_gregset_t; =20 #endif diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 4acd7b9ffe..5a3a5cfc39 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -403,52 +403,6 @@ static const VdsoImageInfo *vdso_image_info(uint32_t e= lf_flags) #define elf_check_abi(x) (!((x) & EF_MIPS_ABI2)) #endif =20 -/* See linux kernel: arch/mips/include/asm/elf.h. */ -#define ELF_NREG 45 -typedef struct target_elf_gregset_t { - target_elf_greg_t regs[ELF_NREG]; -} target_elf_gregset_t; - -/* See linux kernel: arch/mips/include/asm/reg.h. */ -enum { -#ifdef TARGET_MIPS64 - TARGET_EF_R0 =3D 0, -#else - TARGET_EF_R0 =3D 6, -#endif - TARGET_EF_R26 =3D TARGET_EF_R0 + 26, - TARGET_EF_R27 =3D TARGET_EF_R0 + 27, - TARGET_EF_LO =3D TARGET_EF_R0 + 32, - TARGET_EF_HI =3D TARGET_EF_R0 + 33, - TARGET_EF_CP0_EPC =3D TARGET_EF_R0 + 34, - TARGET_EF_CP0_BADVADDR =3D TARGET_EF_R0 + 35, - TARGET_EF_CP0_STATUS =3D TARGET_EF_R0 + 36, - TARGET_EF_CP0_CAUSE =3D TARGET_EF_R0 + 37 -}; - -/* See linux kernel: arch/mips/kernel/process.c:elf_dump_regs. */ -void elf_core_copy_regs(target_elf_gregset_t *r, const CPUMIPSState *env) -{ - int i; - - for (i =3D 0; i <=3D TARGET_EF_R0; i++) { - r->regs[i] =3D 0; - } - for (i =3D 1; i < ARRAY_SIZE(env->active_tc.gpr); i++) { - r->regs[TARGET_EF_R0 + i] =3D tswapreg(env->active_tc.gpr[i]); - } - - r->regs[TARGET_EF_R26] =3D 0; - r->regs[TARGET_EF_R27] =3D 0; - r->regs[TARGET_EF_LO] =3D tswapreg(env->active_tc.LO[0]); - r->regs[TARGET_EF_HI] =3D tswapreg(env->active_tc.HI[0]); - r->regs[TARGET_EF_CP0_EPC] =3D tswapreg(env->active_tc.PC); - r->regs[TARGET_EF_CP0_BADVADDR] =3D tswapreg(env->CP0_BadVAddr); - r->regs[TARGET_EF_CP0_STATUS] =3D tswapreg(env->CP0_Status); - r->regs[TARGET_EF_CP0_CAUSE] =3D tswapreg(env->CP0_Cause); -} - -#define HAVE_ELF_CORE_DUMP #define ELF_EXEC_PAGESIZE 4096 =20 #endif /* TARGET_MIPS */ diff --git a/linux-user/mips/elfload.c b/linux-user/mips/elfload.c index c353ccc1ad..6e884911af 100644 --- a/linux-user/mips/elfload.c +++ b/linux-user/mips/elfload.c @@ -4,6 +4,7 @@ #include "qemu.h" #include "loader.h" #include "elf.h" +#include "target_elf.h" =20 =20 const char *get_elf_cpu_model(uint32_t eflags) @@ -122,3 +123,48 @@ const char *get_elf_base_platform(CPUState *cs) } =20 #undef MATCH_PLATFORM_INSN + +#ifdef TARGET_ABI_MIPSN32 +#define tswapreg(ptr) tswap64(ptr) +#else +#define tswapreg(ptr) tswapal(ptr) +#endif + +/* See linux kernel: arch/mips/include/asm/reg.h. */ +enum { +#ifdef TARGET_MIPS64 + TARGET_EF_R0 =3D 0, +#else + TARGET_EF_R0 =3D 6, +#endif + TARGET_EF_R26 =3D TARGET_EF_R0 + 26, + TARGET_EF_R27 =3D TARGET_EF_R0 + 27, + TARGET_EF_LO =3D TARGET_EF_R0 + 32, + TARGET_EF_HI =3D TARGET_EF_R0 + 33, + TARGET_EF_CP0_EPC =3D TARGET_EF_R0 + 34, + TARGET_EF_CP0_BADVADDR =3D TARGET_EF_R0 + 35, + TARGET_EF_CP0_STATUS =3D TARGET_EF_R0 + 36, + TARGET_EF_CP0_CAUSE =3D TARGET_EF_R0 + 37 +}; + +/* See linux kernel: arch/mips/kernel/process.c:elf_dump_regs. */ +void elf_core_copy_regs(target_elf_gregset_t *r, const CPUMIPSState *env) +{ + int i; + + for (i =3D 0; i <=3D TARGET_EF_R0; i++) { + r->regs[i] =3D 0; + } + for (i =3D 1; i < ARRAY_SIZE(env->active_tc.gpr); i++) { + r->regs[TARGET_EF_R0 + i] =3D tswapreg(env->active_tc.gpr[i]); + } + + r->regs[TARGET_EF_R26] =3D 0; + r->regs[TARGET_EF_R27] =3D 0; + r->regs[TARGET_EF_LO] =3D tswapreg(env->active_tc.LO[0]); + r->regs[TARGET_EF_HI] =3D tswapreg(env->active_tc.HI[0]); + r->regs[TARGET_EF_CP0_EPC] =3D tswapreg(env->active_tc.PC); + r->regs[TARGET_EF_CP0_BADVADDR] =3D tswapreg(env->CP0_BadVAddr); + r->regs[TARGET_EF_CP0_STATUS] =3D tswapreg(env->CP0_Status); + r->regs[TARGET_EF_CP0_CAUSE] =3D tswapreg(env->CP0_Cause); +} --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756569208; cv=none; d=zohomail.com; s=zohoarc; b=IPS+rtkjagOzb14mJAJzDSq+y/NHKKHU060t5TqNJQUP5r69GLm2THqs29WdsQvTFaTT4snq1nrsXf0EQdiXk+Op5ZVjrQBokY7urh80PYWC3kcSCj0PmyAsHeFw+Jg+jcnl69BeUmbQfEX619N68vxTGGFguqvdW3atxJmatmY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756569208; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=x+Vi/O4BRs2S0eMYdKKxaAFZ166C21NyMikDLosj6Q0=; b=a2S7XgmvSWEGqUx5XvsWZEQYonMMJB+h1hcexEZfbtLidw8h4DMnGWyjqdDCHlDwyAQT/Ghde2xTMBzGLUKQwRjXP46BllaGz44h++LLkFv8/d6RYiB1gXVGg++G8ZDWWv4/Yi8Oanug3i3b8p3RUhJYlCjB0X69wbcm2vmT+5M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756569208266422.06557598131417; Sat, 30 Aug 2025 08:53:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNkL-0001tl-WA; Sat, 30 Aug 2025 11:44:06 -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 1us7XS-0003CY-Lp for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:42 -0400 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7XQ-00030p-OF for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:42 -0400 Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-b47173749dbso1933650a12.1 for ; Fri, 29 Aug 2025 15:25:40 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.25.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:25:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506338; x=1757111138; 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=x+Vi/O4BRs2S0eMYdKKxaAFZ166C21NyMikDLosj6Q0=; b=VJCKqbitnjyiT8NkSAagmrS75ZZZRDRuQyZdzmR7LqhxYI34T65fSPKPaMsQlDYhvU IbkfkTuTu3DGh/gLxQY/ms/nm8rqpMcesmRRqzOIsEcF7VPoTegxzCx9UNvJuEZi0G1R aEHF75Fl2URHifE08nluh7nV8V+Oj2OCLXNh8hm9ZB08zpXXyTNhgvOP2eEhF4QdfQLb /AcAdvXz7AM7se0I+H8A4SmikBkkr3XrOXlxqqshjguwwLIvt5oaHSHNgbPIW2R1JaE4 Ks/l2b7LWAUV9qEpSyGBCji5RNy953mk3DcmmZ7nfxsWE6UGT4pZJtqWgQspUTJngAK4 cQUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506338; x=1757111138; 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=x+Vi/O4BRs2S0eMYdKKxaAFZ166C21NyMikDLosj6Q0=; b=Q1YimQsxY1fGpi1DgfLLy87UzxKBrlZyDzyXC2TVyUuKUZ2vDDtDVNWCi8ugcut/RU Y+jnumQO4T1SQRZbj1eb2YhErGK7906ph6Gguzuvwdf+jXKeKrtE6SK9RIp+XhMEJA5H 2GiPlIuIdIcJfJCltLZ/p0GZg9omEgcMzJv98q/HPl0GJ3dyaym/yxNLmjPA5IXz5yjr /gNEsb3TWRZF48aljBeZ6MbNwwz+fXJtRfLf4rQi6V6DealFY4akBcFwkett9mzSY1NM 6M/zOEIFVnQ6keYsiiHK/6LI77IJPVQlmnneKoVwkupx1Zm8tI5cG8SXR88fTdkbIEVV wGgQ== X-Gm-Message-State: AOJu0YyRdhP6Chy0AiwNC5z/tFENIQPvyf+ZBhdXt+jPeBMukmAQl4lL ZzJMhmHs3BamYr6plG7QLVEv8AxjF/D/gBdO12OaOfkptFOjLQyeyJIy7iUJLbDlNltarD2cm7W Ja3KK4Q8= X-Gm-Gg: ASbGncvL73M7S2QUkNOhWoXKU4qwBKupoV0JCyWVU0pUvOTuxdMoRRsMYXB3hBeqqOr 4PhudftDiAa2cMwNOZcL8isFhi6fYzJy96Cjodn7ok7HJl2deZzshpsrH76PMl9M42nayHO2Yl8 xdpdaU05GF19wWA7r4dFr6+as4foWmqcNJ9hHaB1pTk4SX9PxoC9aIWyVKAs/t4ms+SC16w6dma 33QA8aMxse7TxPVknharA0/MfNToxMo9fB9SV4obh8fn9r/a2gUtlhSo7/cCEUSbzziK+SZsa9c gEcDVl4QD/SYFhydlig5elYGcZXKsIAN58pc4pFEurbUvTV9rnCjGt+SCvW5M+U56eCITj5zN9j Y3qzfMUSGukUH8p0wUCpVQtw/N44ZJfTTQd17jx5DeWcTu3HG59eqrdrqYqK5NExyO3M3D5U= X-Google-Smtp-Source: AGHT+IHWKwz+92sPbVmaHEBS2hVGhK2jZAOyLxfLYHn2SaIHkNZqoMdpDQIdJCA3AvPtZsdemi2Z7g== X-Received: by 2002:a05:6a21:9989:b0:243:78a:8280 with SMTP id adf61e73a8af0-243d6f8e6e2mr285357637.56.1756506338512; Fri, 29 Aug 2025 15:25:38 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 27/91] linux-user: Move elf_core_copy_regs to microblaze/elfload.c Date: Sat, 30 Aug 2025 08:23:23 +1000 Message-ID: <20250829222427.289668-28-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756569210637116600 Content-Type: text/plain; charset="utf-8" Move elf_core_copy_regs to elfload.c. Move HAVE_ELF_CORE_DUMP, ELF_NREGS, target_elf_gregset_t to target_elf.h. For now, duplicate the definitions of target_elf_greg_t and tswapreg. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/microblaze/target_elf.h | 9 +++++++++ linux-user/elfload.c | 21 --------------------- linux-user/microblaze/elfload.c | 17 +++++++++++++++++ 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/linux-user/microblaze/target_elf.h b/linux-user/microblaze/tar= get_elf.h index bfe2997fd2..cc5cc0477e 100644 --- a/linux-user/microblaze/target_elf.h +++ b/linux-user/microblaze/target_elf.h @@ -8,4 +8,13 @@ #ifndef MICROBLAZE_TARGET_ELF_H #define MICROBLAZE_TARGET_ELF_H =20 +#define HAVE_ELF_CORE_DUMP 1 + +typedef abi_ulong target_elf_greg_t; + +#define ELF_NREG 38 +typedef struct target_elf_gregset_t { + target_elf_greg_t regs[ELF_NREG]; +} target_elf_gregset_t; + #endif diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 5a3a5cfc39..96ed6b6515 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -416,27 +416,6 @@ static const VdsoImageInfo *vdso_image_info(uint32_t e= lf_flags) =20 #define ELF_EXEC_PAGESIZE 4096 =20 -#define HAVE_ELF_CORE_DUMP -#define ELF_NREG 38 -typedef struct target_elf_gregset_t { - target_elf_greg_t regs[ELF_NREG]; -} target_elf_gregset_t; - -/* See linux kernel: arch/mips/kernel/process.c:elf_dump_regs. */ -void elf_core_copy_regs(target_elf_gregset_t *r, const CPUMBState *env) -{ - for (int i =3D 0; i < 32; i++) { - r->regs[i] =3D tswapreg(env->regs[i]); - } - - r->regs[32] =3D tswapreg(env->pc); - r->regs[33] =3D tswapreg(mb_cpu_read_msr(env)); - r->regs[34] =3D 0; - r->regs[35] =3D tswapreg(env->ear); - r->regs[36] =3D 0; - r->regs[37] =3D tswapreg(env->esr); -} - #endif /* TARGET_MICROBLAZE */ =20 #ifdef TARGET_OPENRISC diff --git a/linux-user/microblaze/elfload.c b/linux-user/microblaze/elfloa= d.c index b92442dfeb..89250dbd63 100644 --- a/linux-user/microblaze/elfload.c +++ b/linux-user/microblaze/elfload.c @@ -3,9 +3,26 @@ #include "qemu/osdep.h" #include "qemu.h" #include "loader.h" +#include "target_elf.h" =20 =20 const char *get_elf_cpu_model(uint32_t eflags) { return "any"; } + +#define tswapreg(ptr) tswapal(ptr) + +void elf_core_copy_regs(target_elf_gregset_t *r, const CPUMBState *env) +{ + for (int i =3D 0; i < 32; i++) { + r->regs[i] =3D tswapreg(env->regs[i]); + } + + r->regs[32] =3D tswapreg(env->pc); + r->regs[33] =3D tswapreg(mb_cpu_read_msr(env)); + r->regs[34] =3D 0; + r->regs[35] =3D tswapreg(env->ear); + r->regs[36] =3D 0; + r->regs[37] =3D tswapreg(env->esr); +} --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756573508; cv=none; d=zohomail.com; s=zohoarc; b=L2EXFOFGS2+hYJ5HZj+NmE6bTX7KBGgztC3oFELyH2OyjmImGMxSYcloZOchs4GR47TF7MiZhGVzcBLvr+mkrNFHhjPnq7Qyair/92LkJ4SuQRzWt9ZLYvcHvcMnMfb7pd1nnHffoIWGVyDekW31XrW4ygzOOfekM6uSAz6mv4s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756573508; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=mgN2LnuzViCzcnpZUHVNvtv/OHauCjd5CrV1japv59M=; b=lv5RbsD6bo/VrGhccI0PPjPXlUtvf944M9MK+6SlcFyV8gFfK1G5/C/+65ghb8mYsKtCWWaDv/+ys20/vgH5lw7iAHf/9gk5S+/2OfYm9AhQllx7H17v0k1DEzs7wlbZ/ICThJPF3tR7pjLkqWfaPjfBpzcofLGE9mYChkZnMe8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756573508253287.92775294647527; Sat, 30 Aug 2025 10:05:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNkM-0001v4-1c; Sat, 30 Aug 2025 11:44:06 -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 1us7XU-0003DG-BB for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:44 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7XS-00031U-FQ for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:44 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-7718408baf7so2550797b3a.3 for ; Fri, 29 Aug 2025 15:25:42 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.25.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:25:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506341; x=1757111141; 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=mgN2LnuzViCzcnpZUHVNvtv/OHauCjd5CrV1japv59M=; b=GDfNSxDCQ/+/7FyA1D+etWLiygBepxU+Ul4ue7GGEpRDNd5PkM9Ub3kf50QXjj1+lG i31YWp60rq3P9/t2VxRGNIR/lpeO6kMLEp366BOBhKkYKSjyZoTWQVYENuObWbI0YTTO VhOZKWQjE/+1r3OF/Rq6AHHJU4/fsF1gpUWU1cNtCFuGT83dYCCR78dZi9NHAuMCiOZh UpHEKenvJw85E7jI03/pkHk3KprTG7n/ZyGIGnkUplCeEKCNmk/IluXTOQEtTPt99/4o 5lFZq3upes2DO9Pa/TuXtXZboEs7uMY8Gz7vg0yqQJESqj5TL/8hlTLV+4DWm8x2VKzV 6NIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506341; x=1757111141; 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=mgN2LnuzViCzcnpZUHVNvtv/OHauCjd5CrV1japv59M=; b=PAuC/3GHy0hyUAVAPGFZSPJkyYWoUM99F688UZ2Eu6zGH8iwITVRIXAK6bo1WQ+ztq TLk3nWuZKjj1x93doaOMpXCF40ypHtubYVjlhGOxbicZ0DW5XP/zpG9Dnr+zES4gIxkl 3HQg3dKcjOgQ1kyF1qYVs89/6CRvRo3bgCPJqs5BiHheIr+5uwjtOX1EdAZpcNkeIoEs 432pUJzJ9aDNdj0oceyQ3TYkRoGFzOv/W3Ro31XfnGzQtmB/FdErYA+ioR5+eH3uNvlR Ep+vU4yv76S5mm9VAnSSb3v955GdW4k4mfFsGwOsMA6i/SS1NHRYsuyyRWip1p8MxY8P lPEw== X-Gm-Message-State: AOJu0YyV3UQ5uX2cbSyOOX6R2tdgUTTD8RtDS2kEEHU2t66+CSJCYsdD 9fPCYPS6WhZgX4b7x7N7TLTq3/r+fv08NgHyhMmFSyi44i5z+BxFG4zh64b7OGYiPKxiBRazUu/ OYar3wZY= X-Gm-Gg: ASbGnct3gs8J+SDnhGlKQ6aCtCvuqIqCSKTwRjV4Z6SZQYPMy5Ns+kwjFUTD+vvyeFj RPLb0PDPlrDC7mhY4uZHUyEbhys1q7GEjA8BWxsxEfnRRgJywCi3cNDGxqIJRU0LFh08TKF9n1z owMz6gZAVYh3Tdlp4SARhwtQtgQXIugmtEb5EY64nb6FV0GTaXMh5+OTsCpoB7vuy5gTvbWbnzy KzXLXxroS2NKKuyGjTJgtlKPj/IPwARIO4n1FsiTdmFLuJjLt2L5As31uUfU4EZm3Y/nkuquULa ETY6pccn4Hg6mOllk6m5Qz80e9yfpBvsJbtSa+H2LGjJuR6yaJRHNBEZFwdZvyR6HxZd2zohrkP MXyQgVoMy8pCWIUxR2RHQU49d3tIb4SyTxZOntM/yj7n2HF3NMfmgL1QG5WlyCyb1/KHkEDY= X-Google-Smtp-Source: AGHT+IHzOKkfQNo0hhifstjr125apHK+QovfqFJY1An2qObfiG8bFVdm0yoJ1tVicBXeQrPZNmnr8g== X-Received: by 2002:a05:6300:210d:b0:243:aca2:e500 with SMTP id adf61e73a8af0-243d6f062d9mr318066637.29.1756506341001; Fri, 29 Aug 2025 15:25:41 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 28/91] linux-user: Move elf_core_copy_regs to openrisc/elfload.c Date: Sat, 30 Aug 2025 08:23:24 +1000 Message-ID: <20250829222427.289668-29-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756573509779124100 Content-Type: text/plain; charset="utf-8" Move elf_core_copy_regs to elfload.c. Move HAVE_ELF_CORE_DUMP, ELF_NREGS, target_elf_gregset_t to target_elf.h. For now, duplicate the definitions of target_elf_greg_t and tswapreg. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/openrisc/target_elf.h | 10 ++++++++++ linux-user/elfload.c | 16 ---------------- linux-user/openrisc/elfload.c | 12 ++++++++++++ 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/linux-user/openrisc/target_elf.h b/linux-user/openrisc/target_= elf.h index b34f2ff672..e97bdc11ed 100644 --- a/linux-user/openrisc/target_elf.h +++ b/linux-user/openrisc/target_elf.h @@ -8,4 +8,14 @@ #ifndef OPENRISC_TARGET_ELF_H #define OPENRISC_TARGET_ELF_H =20 +#define HAVE_ELF_CORE_DUMP 1 + +typedef abi_ulong target_elf_greg_t; + +/* See linux kernel arch/openrisc/include/asm/elf.h. */ +#define ELF_NREG 34 /* gprs and pc, sr */ +typedef struct target_elf_gregset_t { + target_elf_greg_t regs[ELF_NREG]; +} target_elf_gregset_t; + #endif diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 96ed6b6515..8c3ef41312 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -424,24 +424,8 @@ static const VdsoImageInfo *vdso_image_info(uint32_t e= lf_flags) #define ELF_CLASS ELFCLASS32 #define ELF_DATA ELFDATA2MSB =20 -#define HAVE_ELF_CORE_DUMP #define ELF_EXEC_PAGESIZE 8192 =20 -/* See linux kernel arch/openrisc/include/asm/elf.h. */ -#define ELF_NREG 34 /* gprs and pc, sr */ -typedef struct target_elf_gregset_t { - target_elf_greg_t regs[ELF_NREG]; -} target_elf_gregset_t; - -void elf_core_copy_regs(target_elf_gregset_t *r, const CPUOpenRISCState *e= nv) -{ - for (int i =3D 0; i < 32; i++) { - r->regs[i] =3D tswapreg(cpu_get_gpr(env, i)); - } - r->regs[32] =3D tswapreg(env->pc); - r->regs[33] =3D tswapreg(cpu_get_sr(env)); -} - #endif /* TARGET_OPENRISC */ =20 #ifdef TARGET_SH4 diff --git a/linux-user/openrisc/elfload.c b/linux-user/openrisc/elfload.c index b92442dfeb..bb5ad96711 100644 --- a/linux-user/openrisc/elfload.c +++ b/linux-user/openrisc/elfload.c @@ -3,9 +3,21 @@ #include "qemu/osdep.h" #include "qemu.h" #include "loader.h" +#include "target_elf.h" =20 =20 const char *get_elf_cpu_model(uint32_t eflags) { return "any"; } + +#define tswapreg(ptr) tswapal(ptr) + +void elf_core_copy_regs(target_elf_gregset_t *r, const CPUOpenRISCState *e= nv) +{ + for (int i =3D 0; i < 32; i++) { + r->regs[i] =3D tswapreg(cpu_get_gpr(env, i)); + } + r->regs[32] =3D tswapreg(env->pc); + r->regs[33] =3D tswapreg(cpu_get_sr(env)); +} --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756570834; cv=none; d=zohomail.com; s=zohoarc; b=CdUralDKi/m9S0lLG2LwNkpDRUifobYHFUdIobQstETNsRPv7RmXXBrmvh2aPETu7N4zE8JiC/Mtocx/yhS82pnVCuuF611uniPz/OFNWOOLVs+u6ZVuniTh1wqbBdnAfk8XBeswrgn4X7WhuIr2WXEFHoW0+6FNWhkbLd9eY/k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756570834; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=MsoQMsrVjyuGG6ZN+wMiGIbmgF1Jyx473twY5pZoe2U=; b=I8gv0DTIi3ozWED/zU+REoltRI4/5AvIR2H43gFutIXPYB9cSSAvuZ5LxfMR9/uioARiiFYcG5xd5HgCnYOKGjbIG25Z82n8JwsOBZaSmD4uaAkLjDDR4N+r101s6lP1exKigfQj0OHwnwckBxR+uAWD2A9HOqSVtxGZ5u1ZLvs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756570834056138.01535396513577; Sat, 30 Aug 2025 09:20:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNib-0004Ud-Mw; Sat, 30 Aug 2025 11:42:20 -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 1us7XZ-0003FG-6f for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:49 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7XV-000326-Gf for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:47 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-7722f2f2aa4so1413750b3a.1 for ; Fri, 29 Aug 2025 15:25:44 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.25.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:25:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506343; x=1757111143; 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=MsoQMsrVjyuGG6ZN+wMiGIbmgF1Jyx473twY5pZoe2U=; b=wC0lOI8HniL+/btzwQ+wShkrssion4eEhPkN+HvE9gmiYG2Alsovufa+UMWddWW96b ZEOkgy4tlWROFETdRueijxjdOg1BGtcNDuCuWRA1ML90C0aMmwXFTraJPSLB3mZJuZnf 1PtATZt289kG9FeqAuAi8TdGxnU5PxAjQHM2BGNQvBBoXp/ca4gHAHQw27nSdRT8Zqho qHYqX3bm8pkAaiGD1klcBDk3eOXC4GagGSngOlfKDuXJ5PtV3KWLlwFYq7pfDFUg/pyi MZ+rIWuS5uZflxEptOmqslMB6WmttvzdDFKatEVvDtu3tUeeMxtEpJEo4VeF9LdhETZc fsaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506343; x=1757111143; 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=MsoQMsrVjyuGG6ZN+wMiGIbmgF1Jyx473twY5pZoe2U=; b=aZCrg990ctiqNvZqcJkyDvRof7RcqREuvzj5XqDJt0i1tC51ZmA3Tw479eGiLUaoRj wf3Y1+gLVnzrEE4LhHxqy+Xys/fbf3sgUeRKTwx0igesvYFaBkMHlUdL2X2stoDtm/lg CUr2yvKgYnfe0BWOgLtOUC8bw4SzASff4v5brGNl9r96+822221xdNJU2BSZqwFGSu/4 PhrxEJZgUE1sm0tkrSH769Xdex8ZvZSBMpCylWyNzga7ujaRSnoAUYv8VSvaAqGnB1dH j+C7m6lc7HEn2caz1W2MVdnlYmmdVeYeaR8EuQhWrm8jzCbKb/uqIQpfdWs3PgB/mGTW D1ng== X-Gm-Message-State: AOJu0Yx5fRGfQPIvijm/gRW3B0ijxVyjPYDV1DIfjd7CjHmu41CxdPE8 XD0zoAr8jHcg+Q3JujYv7Q4v8MWklGCF89oOFgmRa9CxGxhnIZ/NtWJwE647akKhUJlt5zS/PkO qHhcvGLk= X-Gm-Gg: ASbGncv6TcPQRAEV/Gfm7f6c7ta6zJa8rp5UoX36SQlInNIPlVnBzsWFE+4nBqdP1DX qkRgrhe0ZfG/F2tTR/IiYWtXfDlqbgbggCfMxSgXLtaGlau+WosgcFP5ukJBk6dLscOsaVj7+O1 wHtbS/9x7KDZcOPy4m7c/gKw1TtTqG4gU44x7Uzd+5l1X9Yww5nN3b3ST9feA3hlCzTbuYWm0zE 8HesnpldGvt+cZLhU375fwgyS7s+LCHdv+UOsBhxwsTkoah2064iN6C0nUR1BMqr8R+w+iXtap3 7kVFjeDl4S5V8bViQXwoXDDjOsm4HOTHsc0c9KHsoZEeG5dbKevU2ZtyBhIF95fvZSuJMH7mW2b WkJ5VcW8RLuTdqwDnVei51uSQgX0VLdXjXEd+4UQCa4daAdL1zz/p7We0FS0rlzNWbtn5//E= X-Google-Smtp-Source: AGHT+IFv39DWESwntg1BlGiGmdtDQWeBJWUevEShFnpzBLXNSqX5I6+g0chApMb1Fe94NNlf4sDdNQ== X-Received: by 2002:a05:6a20:2586:b0:220:3870:c61e with SMTP id adf61e73a8af0-243d6dcea40mr347643637.4.1756506343492; Fri, 29 Aug 2025 15:25:43 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 29/91] linux-user: Move elf_core_copy_regs to sh4/elfload.c Date: Sat, 30 Aug 2025 08:23:25 +1000 Message-ID: <20250829222427.289668-30-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756570835353116600 Content-Type: text/plain; charset="utf-8" Move elf_core_copy_regs to elfload.c. Move HAVE_ELF_CORE_DUMP, ELF_NREGS, target_elf_gregset_t to target_elf.h. For now, duplicate the definitions of target_elf_greg_t and tswapreg. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/sh4/target_elf.h | 9 +++++++++ linux-user/elfload.c | 33 --------------------------------- linux-user/sh4/elfload.c | 29 +++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 33 deletions(-) diff --git a/linux-user/sh4/target_elf.h b/linux-user/sh4/target_elf.h index badd0f5371..f7443ddbac 100644 --- a/linux-user/sh4/target_elf.h +++ b/linux-user/sh4/target_elf.h @@ -9,5 +9,14 @@ #define SH4_TARGET_ELF_H =20 #define HAVE_ELF_HWCAP 1 +#define HAVE_ELF_CORE_DUMP 1 + +typedef abi_ulong target_elf_greg_t; + +/* See linux kernel: arch/sh/include/asm/elf.h. */ +#define ELF_NREG 23 +typedef struct target_elf_gregset_t { + target_elf_greg_t regs[ELF_NREG]; +} target_elf_gregset_t; =20 #endif diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 8c3ef41312..69532faddb 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -433,39 +433,6 @@ static const VdsoImageInfo *vdso_image_info(uint32_t e= lf_flags) #define ELF_CLASS ELFCLASS32 #define ELF_ARCH EM_SH =20 -/* See linux kernel: arch/sh/include/asm/elf.h. */ -#define ELF_NREG 23 -typedef struct target_elf_gregset_t { - target_elf_greg_t regs[ELF_NREG]; -} target_elf_gregset_t; - -/* See linux kernel: arch/sh/include/asm/ptrace.h. */ -enum { - TARGET_REG_PC =3D 16, - TARGET_REG_PR =3D 17, - TARGET_REG_SR =3D 18, - TARGET_REG_GBR =3D 19, - TARGET_REG_MACH =3D 20, - TARGET_REG_MACL =3D 21, - TARGET_REG_SYSCALL =3D 22 -}; - -void elf_core_copy_regs(target_elf_gregset_t *r, const CPUSH4State *env) -{ - for (int i =3D 0; i < 16; i++) { - r->regs[i] =3D tswapreg(env->gregs[i]); - } - - r->regs[TARGET_REG_PC] =3D tswapreg(env->pc); - r->regs[TARGET_REG_PR] =3D tswapreg(env->pr); - r->regs[TARGET_REG_SR] =3D tswapreg(env->sr); - r->regs[TARGET_REG_GBR] =3D tswapreg(env->gbr); - r->regs[TARGET_REG_MACH] =3D tswapreg(env->mach); - r->regs[TARGET_REG_MACL] =3D tswapreg(env->macl); - r->regs[TARGET_REG_SYSCALL] =3D 0; /* FIXME */ -} - -#define HAVE_ELF_CORE_DUMP #define ELF_EXEC_PAGESIZE 4096 =20 #endif diff --git a/linux-user/sh4/elfload.c b/linux-user/sh4/elfload.c index 99ad4f6334..71cae9703e 100644 --- a/linux-user/sh4/elfload.c +++ b/linux-user/sh4/elfload.c @@ -3,6 +3,7 @@ #include "qemu/osdep.h" #include "qemu.h" #include "loader.h" +#include "target_elf.h" =20 =20 const char *get_elf_cpu_model(uint32_t eflags) @@ -36,3 +37,31 @@ abi_ulong get_elf_hwcap(CPUState *cs) =20 return hwcap; } + +#define tswapreg(ptr) tswapal(ptr) + +/* See linux kernel: arch/sh/include/asm/ptrace.h. */ +enum { + TARGET_REG_PC =3D 16, + TARGET_REG_PR =3D 17, + TARGET_REG_SR =3D 18, + TARGET_REG_GBR =3D 19, + TARGET_REG_MACH =3D 20, + TARGET_REG_MACL =3D 21, + TARGET_REG_SYSCALL =3D 22 +}; + +void elf_core_copy_regs(target_elf_gregset_t *r, const CPUSH4State *env) +{ + for (int i =3D 0; i < 16; i++) { + r->regs[i] =3D tswapreg(env->gregs[i]); + } + + r->regs[TARGET_REG_PC] =3D tswapreg(env->pc); + r->regs[TARGET_REG_PR] =3D tswapreg(env->pr); + r->regs[TARGET_REG_SR] =3D tswapreg(env->sr); + r->regs[TARGET_REG_GBR] =3D tswapreg(env->gbr); + r->regs[TARGET_REG_MACH] =3D tswapreg(env->mach); + r->regs[TARGET_REG_MACL] =3D tswapreg(env->macl); + r->regs[TARGET_REG_SYSCALL] =3D 0; /* FIXME */ +} --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756576427; cv=none; d=zohomail.com; s=zohoarc; b=hxtL4AKYjmr9zGWfXdIkTuNVM+rTD7UgNPglVcZGhb+4H2D5mufQ4NoTY8sPXMJ9o4SdHDaGbPj9ze5OZw+l4EZ5uZVD8CrTemCCEUbYiAyxVikuADbNHFKNzwP94zw4RwXBDp3Nf9eRBM8+FZbEw0yktxnlT7qXXzNXzNlTJhg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756576427; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=yxM1TKQLG9007cv3kPvK0tgDNKw7VDbffsV5cWbtYRI=; b=ef79etIDF/7PWzdn22pYBaA/Tew5U8Ol8axua691sAzXku6JRWTlAxJrCT935uLuB4HGj5+rG6BXIDtVJ0KoIl2la/uEk1aqCbP7hZf/vZwEgsv6+IucGGr1oAHy15lBjX3H8+oeWCHG5JuJvzYApbDh/SsE5s3Ku/iUWe0RuCM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756576427312221.05630298870494; Sat, 30 Aug 2025 10:53:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNkQ-0002Ku-Ic; Sat, 30 Aug 2025 11:44:10 -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 1us7Xa-0003G5-Vv for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:51 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7XY-00032U-Mp for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:50 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-76e1fc69f86so2837575b3a.0 for ; Fri, 29 Aug 2025 15:25:48 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.25.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:25:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506346; x=1757111146; 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=yxM1TKQLG9007cv3kPvK0tgDNKw7VDbffsV5cWbtYRI=; b=y4d0RRy2BbpmIsyW7/OkgdBIOyeGA+XT6v2JLzsdRd78N9YaFF/uFICaZTnzfcrOMT iY73lRQCm7gRk+WD9xxVt0u3OjKqcFXcVWm9tIu/jxcPTiAH+m6nNrcCH5tX1mGxl0lR LBsN5pvJ/QZq3L3qQqFTtFmbsnxn6kJ2B2oiLLZvVdqJ4dITS791b5QB2Ih9Fy/NACss tU8DGPEOsaSDwEWS1nKGrEmbXEbmqmii2CB1vwaJt8Q9FrKVzyDkTiFl1o4GVZAOKx1s FSQTpKZ+i1e5LOOzgGLpwjvzHfhlpyKluNEx+rqM4KGXwv7YeJatPzuRwxzmRBRbH8Jd DzDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506346; x=1757111146; 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=yxM1TKQLG9007cv3kPvK0tgDNKw7VDbffsV5cWbtYRI=; b=WL5A1iFSkZAVRHm+d9P8N75u9MGfWPzjpuOROowLLJIht/leUFTKEtZbvkepOBOO0A Y2HcWaRSl5oJiZsbqLgg3n3sAlC49plv9oi9Swk9jHujuFtbCuLzYW0LcwLZUYByDcEg F82UVYmiJXSM9dZsjts76eOEhK6zHKywcYgy1M4O/MB1Z0jaihcur6/VEXDt4qxEd1U4 B6u1vLfqjl4iZt5eCQLcq/u5ytl/WEZsNcPtGB9PDqAoKemgOhtKKiH9KU1gsgIFSQ3K nBycIB7vArjv6S7FP50HosdhNuIOYBU3quZIe8E7zgwsAlcAR7BBBysND30fV6Nt5RcE 2aAg== X-Gm-Message-State: AOJu0YzYcf8z4BeY+lvsvwkYzbkiYxsKVb/Va5ofTC9aQJo5IPSi6Fct zJkHK5JVLb3LcdkXArwaYZuJUUb3USiCsGD3IgoCjjbwiqRnvxM14b/OvUf5fKRyEQbNbgF3tbt LgumuziU= X-Gm-Gg: ASbGncvSKO8c3bJBIL/0f+VioAFdYEoJ4m7Kj5GuhlsWIOylIQmsAciPCVO3pP6YoMR ADUlsUihUoG/NMkSvpqi7TocM/WVdU+hM5+SR51rHPkCymg1VL0kOH/DFgKSHvePA9oNGyvzi8W UqfMH6JY7ElIsl/lpV9uTfLKSOQVUXHxbU0sIOtmROSxaoT3hdLjsKpNwHdPjnJxknsUuPpJins MDy5wNVhwU3bs5LwjqPd+u4f9r+GBcjNERO5GmloaXviAAHdNfecw8jEwFB9cOvxvUX9gN9QTl3 J5SB3BLzBtztyY+A9I5CtB8b5CzP3ApUaX20IMpuwApOS11WWvddFtA8TVo/32XGIGX4czLNS+A MerZ8t/lLY9WR9BEOHlCN6l/U900Ay6OlW/UDlK6+4wnQNzzvyVyPbxxQl4fB5JVqtbzjgUA= X-Google-Smtp-Source: AGHT+IG3lgJ5t2JD2VSt9zVdohPY6YwiTqj+mpq5R2UUWDSZr6LctUq3x4Xwsl+BkOL5l5qBMRFdJw== X-Received: by 2002:a05:6a20:2585:b0:243:b31a:5945 with SMTP id adf61e73a8af0-243d6f7eacdmr242448637.26.1756506345870; Fri, 29 Aug 2025 15:25:45 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 30/91] linux-user: Move elf_core_copy_regs to m68k/elfload.c Date: Sat, 30 Aug 2025 08:23:26 +1000 Message-ID: <20250829222427.289668-31-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756576428525124100 Content-Type: text/plain; charset="utf-8" Move elf_core_copy_regs to elfload.c. Move HAVE_ELF_CORE_DUMP, ELF_NREGS, target_elf_gregset_t to target_elf.h. For now, duplicate the definitions of target_elf_greg_t and tswapreg. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/m68k/target_elf.h | 10 ++++++++++ linux-user/elfload.c | 31 ------------------------------- linux-user/m68k/elfload.c | 27 +++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 31 deletions(-) diff --git a/linux-user/m68k/target_elf.h b/linux-user/m68k/target_elf.h index 62ff9d38d4..cd6908ab57 100644 --- a/linux-user/m68k/target_elf.h +++ b/linux-user/m68k/target_elf.h @@ -8,4 +8,14 @@ #ifndef M68K_TARGET_ELF_H #define M68K_TARGET_ELF_H =20 +#define HAVE_ELF_CORE_DUMP 1 + +typedef abi_ulong target_elf_greg_t; + +/* See linux kernel: arch/m68k/include/asm/elf.h. */ +#define ELF_NREG 20 +typedef struct target_elf_gregset_t { + target_elf_greg_t regs[ELF_NREG]; +} target_elf_gregset_t; + #endif diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 69532faddb..e92c424faf 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -442,37 +442,6 @@ static const VdsoImageInfo *vdso_image_info(uint32_t e= lf_flags) #define ELF_CLASS ELFCLASS32 #define ELF_ARCH EM_68K =20 -/* See linux kernel: arch/m68k/include/asm/elf.h. */ -#define ELF_NREG 20 -typedef struct target_elf_gregset_t { - target_elf_greg_t regs[ELF_NREG]; -} target_elf_gregset_t; - -void elf_core_copy_regs(target_elf_gregset_t *r, const CPUM68KState *env) -{ - r->regs[0] =3D tswapreg(env->dregs[1]); - r->regs[1] =3D tswapreg(env->dregs[2]); - r->regs[2] =3D tswapreg(env->dregs[3]); - r->regs[3] =3D tswapreg(env->dregs[4]); - r->regs[4] =3D tswapreg(env->dregs[5]); - r->regs[5] =3D tswapreg(env->dregs[6]); - r->regs[6] =3D tswapreg(env->dregs[7]); - r->regs[7] =3D tswapreg(env->aregs[0]); - r->regs[8] =3D tswapreg(env->aregs[1]); - r->regs[9] =3D tswapreg(env->aregs[2]); - r->regs[10] =3D tswapreg(env->aregs[3]); - r->regs[11] =3D tswapreg(env->aregs[4]); - r->regs[12] =3D tswapreg(env->aregs[5]); - r->regs[13] =3D tswapreg(env->aregs[6]); - r->regs[14] =3D tswapreg(env->dregs[0]); - r->regs[15] =3D tswapreg(env->aregs[7]); - r->regs[16] =3D tswapreg(env->dregs[0]); /* FIXME: orig_d0 */ - r->regs[17] =3D tswapreg(env->sr); - r->regs[18] =3D tswapreg(env->pc); - r->regs[19] =3D 0; /* FIXME: regs->format | regs->vector */ -} - -#define HAVE_ELF_CORE_DUMP #define ELF_EXEC_PAGESIZE 8192 =20 #endif diff --git a/linux-user/m68k/elfload.c b/linux-user/m68k/elfload.c index 561ac5b3b3..2970ff7dec 100644 --- a/linux-user/m68k/elfload.c +++ b/linux-user/m68k/elfload.c @@ -4,6 +4,7 @@ #include "qemu.h" #include "loader.h" #include "elf.h" +#include "target_elf.h" =20 =20 const char *get_elf_cpu_model(uint32_t eflags) @@ -16,3 +17,29 @@ const char *get_elf_cpu_model(uint32_t eflags) /* Coldfire */ return "any"; } + +#define tswapreg(ptr) tswapal(ptr) + +void elf_core_copy_regs(target_elf_gregset_t *r, const CPUM68KState *env) +{ + r->regs[0] =3D tswapreg(env->dregs[1]); + r->regs[1] =3D tswapreg(env->dregs[2]); + r->regs[2] =3D tswapreg(env->dregs[3]); + r->regs[3] =3D tswapreg(env->dregs[4]); + r->regs[4] =3D tswapreg(env->dregs[5]); + r->regs[5] =3D tswapreg(env->dregs[6]); + r->regs[6] =3D tswapreg(env->dregs[7]); + r->regs[7] =3D tswapreg(env->aregs[0]); + r->regs[8] =3D tswapreg(env->aregs[1]); + r->regs[9] =3D tswapreg(env->aregs[2]); + r->regs[10] =3D tswapreg(env->aregs[3]); + r->regs[11] =3D tswapreg(env->aregs[4]); + r->regs[12] =3D tswapreg(env->aregs[5]); + r->regs[13] =3D tswapreg(env->aregs[6]); + r->regs[14] =3D tswapreg(env->dregs[0]); + r->regs[15] =3D tswapreg(env->aregs[7]); + r->regs[16] =3D tswapreg(env->dregs[0]); /* FIXME: orig_d0 */ + r->regs[17] =3D tswapreg(env->sr); + r->regs[18] =3D tswapreg(env->pc); + r->regs[19] =3D 0; /* FIXME: regs->format | regs->vector */ +} --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756569949; cv=none; d=zohomail.com; s=zohoarc; b=ed/I+MheG+JZ0QUad4mds7OWBcY2I/el1QiDOhlObXcjiz7yeE1m48rswebNLqZN7Y/rfORHKf9RM/kHVU9ACyZBzgQ9rPZHoiK4bM3Tpd+iu87qTfiJ7+A+ndKMNTrw7n0zmG9+FJkgCAhhQSa0qyjC/8cK9PJO44As/U+8ItI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756569949; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=YYxqF2F6v3t7TS6Jb1MS7S2soDKim5Oxkz9J/sWMYeQ=; b=KPN0fIOEnybc6GotnD6R7cUeuM4sl/b+/iYtqll4NVMR1YkXMzJaWjQH+rl+eSB9+Sh5xXA0f/JxH05LkLG0V89sKnyQMr20div1B6E9ZVsSCey7+acSBukDUJZMOptTXDKsRjdhWf6Rod4BXUbgBJ4TIpDztK3dQFauR1KiVXQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756569949315931.3778458942301; Sat, 30 Aug 2025 09:05:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNis-00050g-6O; Sat, 30 Aug 2025 11:42:37 -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 1us7Xc-0003GW-7K for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:52 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7Xa-00032z-8x for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:51 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-76e1fc69f86so2837595b3a.0 for ; Fri, 29 Aug 2025 15:25:49 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.25.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:25:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506348; x=1757111148; 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=YYxqF2F6v3t7TS6Jb1MS7S2soDKim5Oxkz9J/sWMYeQ=; b=SoQNecr0Pb6WBxEzg90zpWxCMyca6vU7bu0slU1c3MTVvPnJKLK7PLR4irKr7GxbZf gtzoZKqn4qm1CfJY5i0rfocybK120TgM6PeNnIq1vjd6OJRspssGMvsYDfSwRnGIWpGt r+NnU/V7+5w3EyvaPBZrIi3sjcHi20YTxVrON4Qvbw4qq9sLjRMCITmQ6okeGv67DD6E VBC2YeYa2CgZa1xcLJWcM3q8EIXUIkHSwAdAHHM0ZRiOAZxIzQan4y9rB+bXoveVv2BX VsomCQHdJk4teIgqtXcpVidDB6LsA0VtLoggC7/1tqbusG5y7OEr2BaIEoF6wWrEpcG+ zP0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506348; x=1757111148; 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=YYxqF2F6v3t7TS6Jb1MS7S2soDKim5Oxkz9J/sWMYeQ=; b=vEp7yAYykMgxxzUxIG+odJZbC4R07ICxXl/FRfIeJLo4h6e8RBkDpwVxSX03uPNZt9 OQxBBg10kqc886ncUReRFHP80nRiJEGdoUF0rL4zbphryVSaFzqvUIwKQElH3BY2eBaK F3r6ZcbQi3kHKlWYKJpBdbJhTYLAqvFMEJdaYhKu8YadtPq3l3VtsEcXr584bd2JCFnj vuc7kHsrPmj1ATkWI1uYCQiBMmuWGEg35srnTq5UxmYJufehqSmxhG3uTPPU2tl6uzk/ xi4h5yPxf29OdPSQ578oezwaHY/WfPhuODTax1OT+Cwt9aRUYkIbqKztjWFpLLHP+JV9 kuEw== X-Gm-Message-State: AOJu0YxViACRna2pG5qAilqGFIl4xkbgNiCnmO+OupXSx3PRFBU9YG7/ DqZ5I57zu89ZzHvTdXOI4u2dCiqxJ6ipY4pEtn3dScrQZKPeFDv974qWRmUr9zVmtbiMekjWpyA e6/ji8g8= X-Gm-Gg: ASbGncvRxkCgfA9eEoC8olGAWm5jqjItcp9Ajn9vpW0Sv8BySgNQfs3MM8q8QmFLfgg yQKN4Wnr88ubA4wcED10gFpNHCZ5sSn3PiF7T0713pDhmdM2v/ijb5JVoa+pwX6/GpKKt99dzZy JGKY3fS3/KXRDTVnvcCT5+zvktC7dIiFHbf2/WvFjxAWhfK+Osd/nRZShj7NoBGozAR3EIZD7eD gV3xWojzUyDlNZjo/5Gd1HpfDK52KIsa/DCc7pV0W4rB9wkSvoMfzMdLW+odoGFym7ZJDVP7H8z yHyR9/rGi7f2vADHPUV7FtuBfbxJ7Ob4LuMtglyAXvCTTulE+lUo+jYQcfPRQmDs2GuixbeVoAk FJhR+rbm0hf0YXFaId9dGcGFxHC4DCfEKdOJAR+f6PA+MAMV7BDLBsCVsM7MaMlyXpTcu7mfvlj WQd2C3pA== X-Google-Smtp-Source: AGHT+IFabL8BX3LTI6GMneMFc6E+Q20MxzWHGe/W45d1z5F09NJIvyXULLHfTVcJmbS7Q5zocEiHDg== X-Received: by 2002:a05:6a20:6a08:b0:243:a467:52c7 with SMTP id adf61e73a8af0-243d6dc18ccmr330002637.4.1756506348202; Fri, 29 Aug 2025 15:25:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 31/91] linux-user: Move elf_core_copy_regs to s390x/elfload.c Date: Sat, 30 Aug 2025 08:23:27 +1000 Message-ID: <20250829222427.289668-32-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756569951495124100 Content-Type: text/plain; charset="utf-8" Move elf_core_copy_regs to elfload.c. Move HAVE_ELF_CORE_DUMP, ELF_NREGS, target_elf_gregset_t to target_elf.h. For now, duplicate the definitions of target_elf_greg_t and tswapreg. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/s390x/target_elf.h | 9 +++++++++ linux-user/elfload.c | 32 -------------------------------- linux-user/s390x/elfload.c | 28 ++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 32 deletions(-) diff --git a/linux-user/s390x/target_elf.h b/linux-user/s390x/target_elf.h index cebace949a..b7d863ee66 100644 --- a/linux-user/s390x/target_elf.h +++ b/linux-user/s390x/target_elf.h @@ -9,5 +9,14 @@ #define S390X_TARGET_ELF_H =20 #define HAVE_ELF_HWCAP 1 +#define HAVE_ELF_CORE_DUMP 1 + +typedef abi_ulong target_elf_greg_t; + +/* See linux kernel: arch/s390/include/uapi/asm/ptrace.h (s390_regs). */ +#define ELF_NREG 27 +typedef struct target_elf_gregset_t { + target_elf_greg_t regs[ELF_NREG]; +} target_elf_gregset_t; =20 #endif diff --git a/linux-user/elfload.c b/linux-user/elfload.c index e92c424faf..7c783b74d4 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -461,38 +461,6 @@ static const VdsoImageInfo *vdso_image_info(uint32_t e= lf_flags) #define ELF_DATA ELFDATA2MSB #define ELF_ARCH EM_S390 =20 -/* See linux kernel: arch/s390/include/uapi/asm/ptrace.h (s390_regs). */ -#define ELF_NREG 27 -typedef struct target_elf_gregset_t { - target_elf_greg_t regs[ELF_NREG]; -} target_elf_gregset_t; - -enum { - TARGET_REG_PSWM =3D 0, - TARGET_REG_PSWA =3D 1, - TARGET_REG_GPRS =3D 2, - TARGET_REG_ARS =3D 18, - TARGET_REG_ORIG_R2 =3D 26, -}; - -void elf_core_copy_regs(target_elf_gregset_t *r, const CPUS390XState *env) -{ - int i; - uint32_t *aregs; - - r->regs[TARGET_REG_PSWM] =3D tswapreg(env->psw.mask); - r->regs[TARGET_REG_PSWA] =3D tswapreg(env->psw.addr); - for (i =3D 0; i < 16; i++) { - r->regs[TARGET_REG_GPRS + i] =3D tswapreg(env->regs[i]); - } - aregs =3D (uint32_t *)&(r->regs[TARGET_REG_ARS]); - for (i =3D 0; i < 16; i++) { - aregs[i] =3D tswap32(env->aregs[i]); - } - r->regs[TARGET_REG_ORIG_R2] =3D 0; -} - -#define HAVE_ELF_CORE_DUMP #define ELF_EXEC_PAGESIZE 4096 =20 #define VDSO_HEADER "vdso.c.inc" diff --git a/linux-user/s390x/elfload.c b/linux-user/s390x/elfload.c index 79ceaba51d..4113273b72 100644 --- a/linux-user/s390x/elfload.c +++ b/linux-user/s390x/elfload.c @@ -4,6 +4,7 @@ #include "qemu.h" #include "loader.h" #include "elf.h" +#include "target_elf.h" =20 =20 const char *get_elf_cpu_model(uint32_t eflags) @@ -66,3 +67,30 @@ const char *elf_hwcap_str(uint32_t bit) =20 return bit < ARRAY_SIZE(hwcap_str) ? hwcap_str[bit] : NULL; } + +#define tswapreg(ptr) tswapal(ptr) + +enum { + TARGET_REG_PSWM =3D 0, + TARGET_REG_PSWA =3D 1, + TARGET_REG_GPRS =3D 2, + TARGET_REG_ARS =3D 18, + TARGET_REG_ORIG_R2 =3D 26, +}; + +void elf_core_copy_regs(target_elf_gregset_t *r, const CPUS390XState *env) +{ + int i; + uint32_t *aregs; + + r->regs[TARGET_REG_PSWM] =3D tswapreg(env->psw.mask); + r->regs[TARGET_REG_PSWA] =3D tswapreg(env->psw.addr); + for (i =3D 0; i < 16; i++) { + r->regs[TARGET_REG_GPRS + i] =3D tswapreg(env->regs[i]); + } + aregs =3D (uint32_t *)&(r->regs[TARGET_REG_ARS]); + for (i =3D 0; i < 16; i++) { + aregs[i] =3D tswap32(env->aregs[i]); + } + r->regs[TARGET_REG_ORIG_R2] =3D 0; +} --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756569527; cv=none; d=zohomail.com; s=zohoarc; b=fCkFovHK8B83CZuc8P9N5wzZWrwea2Ld5nGbu6tERFFKCVeeTIPCdPeof52d/YZZuOBp9ivKpnL6Oq5sMWcRnOxvNgAAvfO2R4/iZwcd2bLwA1KZXBpwySDZUyCMBYUq4c2MWxfDWXagU1k2mBUQ1PmzvLOwa6RQJByRuGoG18o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756569527; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=cqY7gg7nNkpb5GHdIFMfU/GOMdyhe7cpOkiV9a020oI=; b=MPxyfzXZwkroE6dcyKHNANA9Nni0Xr8pjxXQBbjxgbQDVn3k8+dYyYJ6nvvpP5m4ErWTxQEeT0eF7A6DhILzt3WdPZp16Ucp0LlK/S/U73co1dHnoi+1d8jzvGumpneYn19jNkC/WLwCwKDC3envfEdAUhha8Ex8y56id6an1ps= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756569527132235.0680937021806; Sat, 30 Aug 2025 08:58:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNkS-0002XS-0e; Sat, 30 Aug 2025 11:44:12 -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 1us7Xe-0003HE-1j for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:54 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7Xc-00033S-11 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:53 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-7720b23a49fso2928358b3a.0 for ; Fri, 29 Aug 2025 15:25:51 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.25.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:25:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506350; x=1757111150; 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=cqY7gg7nNkpb5GHdIFMfU/GOMdyhe7cpOkiV9a020oI=; b=ntZrbFlCd3QAVJ9obkbx+v12YNLAIwgmcKjPmlGQWggzw3Jw8xXZOLzD5QfdE9rL/T 7Rl0oiJJCH/Icq4dbJTjWlpP0eIRapm/dhAfet53bb4bu8jbkk4j0QI70XAg71QYm4we fC2cajpGcNghd39bZQfnJHHDoxDbJCr4bLn+P+2jLdb6JoCnLB4vaLP5rtbyLW8Tt4Uy /ciDT5bi/3tlOEYbfmvjx8H4zs9rQBLspGSC+M1gj0AIlyElfRz/pFofkza/8uZCRqce yeDI+SLXpa1eCkraF1+rXbMPamSO8su8uTL94zeuptkQHDi0ar7qiGRnVImW9y1foH3W oeYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506350; x=1757111150; 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=cqY7gg7nNkpb5GHdIFMfU/GOMdyhe7cpOkiV9a020oI=; b=LdRN8Ufj9qm4oVQM5Pr/fxZ2q5TY+3S7/HSQcf2b+Wh6ygKvhP1iP53le4yBUr5FqO oXqFnEG60J7JKYwU9oiOUv+1xtA/aYKZd0w3SHxCwAICmKgTMQk5qMz8ySxQTw8BJwPD BuNEd+Y/3+TIUx3oS7uSRu8P2U06t50g3LLJR/SsXH81L9ml3PzVeg3kNwKrjYfocukR JdMKqk4H/149niyq5S/nd+zSIAFYgcI5OibnFJrNLMRazRCC0BrtzKWS7AqQb+Uv9yHg VStcl/thrS6kyuEuFTd1GIkVhSOfT8vWhPxRsN2/83YAGKJuU5POMNPLHiM8FyiVENMV f30w== X-Gm-Message-State: AOJu0Yw1PPFsECdkG4L6yW9y1NF6CJwRdfB+AZSXNaBcLN30VT+8eWOg /5/3YGMpDTkL/t3c+jeV6VzB/97DqJt2K3nOw74BP08EDVMo8diOFmUTNL2uM5GUfKpWp6Jgb5c vIgrOGrU= X-Gm-Gg: ASbGncu0+4E2rkdLMLBBvtAPied2U1U3AWNTMpyF366KewNDfR188/HeEThh5SGXSD9 Xm6ZZBcy/ifZc0cl29y9lwT/2x5PBYoQQmUGlkF9dww/cB3RYtVu/GTp3Axu1bAHS0Ka/ICcU3t VLu2SAnq+zrDEhJ+MPk206NQSNLVTh+dWCATqdoYU8BysWO1WXaKQhRpPvEW5s+n6ezm2F70tZd 62F2yCry4GyyYwH68Z6pY5WkS/f87ZuljJYpygUfPEnxyiCbxeqJ4e75xdWUpESzRKYHKTnXn5o xuZL01OR3XctUka7hYta97jcxglZVP+a8u6E2onCMRqcuZJRDWCtgLrWcy2Wz33vW6AvXCGsK+J +eXE9ob77w8VKxSFj5E0JRW7pu4ESfHN7evaAabbk6oef6OXSmJ/Fu7uJ7cA5 X-Google-Smtp-Source: AGHT+IEr3xMyN8CuUgxJDbjgp4BXX6Q8+EAxdW/6VGLTbJXHaAURIjiINs+B4NO6LvnBbv1KJv5AIQ== X-Received: by 2002:a05:6a20:914c:b0:243:bf79:b121 with SMTP id adf61e73a8af0-243d6f7e67bmr297892637.52.1756506350454; Fri, 29 Aug 2025 15:25:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 32/91] linux-user: Move elf_core_copy_regs to xtensa/elfload.c Date: Sat, 30 Aug 2025 08:23:28 +1000 Message-ID: <20250829222427.289668-33-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756569528188116600 Content-Type: text/plain; charset="utf-8" Move elf_core_copy_regs to elfload.c. Move HAVE_ELF_CORE_DUMP, ELF_NREGS, target_elf_gregset_t to target_elf.h. For now, duplicate the definitions of target_elf_greg_t and tswapreg. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/xtensa/target_elf.h | 10 +++++++++ linux-user/elfload.c | 39 ---------------------------------- linux-user/xtensa/elfload.c | 35 ++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 39 deletions(-) diff --git a/linux-user/xtensa/target_elf.h b/linux-user/xtensa/target_elf.h index 2c55c22e14..43e241aac1 100644 --- a/linux-user/xtensa/target_elf.h +++ b/linux-user/xtensa/target_elf.h @@ -8,4 +8,14 @@ #ifndef XTENSA_TARGET_ELF_H #define XTENSA_TARGET_ELF_H =20 +#define HAVE_ELF_CORE_DUMP 1 + +typedef abi_ulong target_elf_greg_t; + +/* See linux kernel: arch/xtensa/include/asm/elf.h. */ +#define ELF_NREG 128 +typedef struct target_elf_gregset_t { + target_elf_greg_t regs[ELF_NREG]; +} target_elf_gregset_t; + #endif diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 7c783b74d4..5cdbdc20d9 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -531,45 +531,6 @@ static bool init_guest_commpage(void) #define ELF_CLASS ELFCLASS32 #define ELF_ARCH EM_XTENSA =20 -/* See linux kernel: arch/xtensa/include/asm/elf.h. */ -#define ELF_NREG 128 -typedef struct target_elf_gregset_t { - target_elf_greg_t regs[ELF_NREG]; -} target_elf_gregset_t; - -enum { - TARGET_REG_PC, - TARGET_REG_PS, - TARGET_REG_LBEG, - TARGET_REG_LEND, - TARGET_REG_LCOUNT, - TARGET_REG_SAR, - TARGET_REG_WINDOWSTART, - TARGET_REG_WINDOWBASE, - TARGET_REG_THREADPTR, - TARGET_REG_AR0 =3D 64, -}; - -void elf_core_copy_regs(target_elf_gregset_t *r, const CPUXtensaState *env) -{ - unsigned i; - - r->regs[TARGET_REG_PC] =3D tswapreg(env->pc); - r->regs[TARGET_REG_PS] =3D tswapreg(env->sregs[PS] & ~PS_EXCM); - r->regs[TARGET_REG_LBEG] =3D tswapreg(env->sregs[LBEG]); - r->regs[TARGET_REG_LEND] =3D tswapreg(env->sregs[LEND]); - r->regs[TARGET_REG_LCOUNT] =3D tswapreg(env->sregs[LCOUNT]); - r->regs[TARGET_REG_SAR] =3D tswapreg(env->sregs[SAR]); - r->regs[TARGET_REG_WINDOWSTART] =3D tswapreg(env->sregs[WINDOW_START]); - r->regs[TARGET_REG_WINDOWBASE] =3D tswapreg(env->sregs[WINDOW_BASE]); - r->regs[TARGET_REG_THREADPTR] =3D tswapreg(env->uregs[THREADPTR]); - xtensa_sync_phys_from_window((CPUXtensaState *)env); - for (i =3D 0; i < env->config->nareg; ++i) { - r->regs[TARGET_REG_AR0 + i] =3D tswapreg(env->phys_regs[i]); - } -} - -#define HAVE_ELF_CORE_DUMP #define ELF_EXEC_PAGESIZE 4096 =20 #endif /* TARGET_XTENSA */ diff --git a/linux-user/xtensa/elfload.c b/linux-user/xtensa/elfload.c index e35ba69a10..49e709a094 100644 --- a/linux-user/xtensa/elfload.c +++ b/linux-user/xtensa/elfload.c @@ -3,9 +3,44 @@ #include "qemu/osdep.h" #include "qemu.h" #include "loader.h" +#include "target_elf.h" =20 =20 const char *get_elf_cpu_model(uint32_t eflags) { return XTENSA_DEFAULT_CPU_MODEL; } + +#define tswapreg(ptr) tswapal(ptr) + +enum { + TARGET_REG_PC, + TARGET_REG_PS, + TARGET_REG_LBEG, + TARGET_REG_LEND, + TARGET_REG_LCOUNT, + TARGET_REG_SAR, + TARGET_REG_WINDOWSTART, + TARGET_REG_WINDOWBASE, + TARGET_REG_THREADPTR, + TARGET_REG_AR0 =3D 64, +}; + +void elf_core_copy_regs(target_elf_gregset_t *r, const CPUXtensaState *env) +{ + unsigned i; + + r->regs[TARGET_REG_PC] =3D tswapreg(env->pc); + r->regs[TARGET_REG_PS] =3D tswapreg(env->sregs[PS] & ~PS_EXCM); + r->regs[TARGET_REG_LBEG] =3D tswapreg(env->sregs[LBEG]); + r->regs[TARGET_REG_LEND] =3D tswapreg(env->sregs[LEND]); + r->regs[TARGET_REG_LCOUNT] =3D tswapreg(env->sregs[LCOUNT]); + r->regs[TARGET_REG_SAR] =3D tswapreg(env->sregs[SAR]); + r->regs[TARGET_REG_WINDOWSTART] =3D tswapreg(env->sregs[WINDOW_START]); + r->regs[TARGET_REG_WINDOWBASE] =3D tswapreg(env->sregs[WINDOW_BASE]); + r->regs[TARGET_REG_THREADPTR] =3D tswapreg(env->uregs[THREADPTR]); + xtensa_sync_phys_from_window((CPUXtensaState *)env); + for (i =3D 0; i < env->config->nareg; ++i) { + r->regs[TARGET_REG_AR0 + i] =3D tswapreg(env->phys_regs[i]); + } +} --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756572818; cv=none; d=zohomail.com; s=zohoarc; b=lRb4oiGEEMgWqmudZJh2MfgUkl84pnKSxYRTVFYUhI/0NSejFmpGlo9h80PLRdXd5oRNKMzQXQYn6nJxWvulpP9atIMUUKFjpR/DQ2VVlqOEdOHw8eaBlTsNc8YjuQNA4bSpXmti+o2LHPvvDC+A7wfjgYfDhFjHOtygdyCN6lg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756572818; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=tEbv4UWAVeKRp024G0xm5LxqRj77iPoKwjPkrVlHe68=; b=G0reSjdUFx5mM7zoXr1ES+giwiWgJTx/VXp7GfrXLu1ImAuWBPYdxApKznv5MAxSfgo5VeNOEbvVIfN6kIaLMf6NZ/L59tBdLnmYjXXq10ZqQl9OReWUPqVM3w0ytRVhS/3yjw3RMfW1LAFt5wzX9ohTXaILDUL1PIAVuqvu6SI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756572818519806.7553204053493; Sat, 30 Aug 2025 09:53:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNkW-0002t8-O8; Sat, 30 Aug 2025 11:44:17 -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 1us7Xi-0003Ii-Fk for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:58 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7Xe-000347-JS for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:25:57 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-772301f8a4cso1238859b3a.3 for ; Fri, 29 Aug 2025 15:25:53 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.25.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:25:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506353; x=1757111153; 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=tEbv4UWAVeKRp024G0xm5LxqRj77iPoKwjPkrVlHe68=; b=gNAonUr65n0ON59NaDQ+6ryZbCjngrlT58Sotrz7YrvOhjIJ7bnDHGp8Ix1umzWanw 1Bmxj5GegAgIjUa0SEyqBdoOvC6eOyRXt0nR5iq/Yp8bnl9Ng9tEB2qg7pNVcU6N3PN/ NcLzdvOd1RieIHnzhUBwfEM3mN1YhwjUuyjW7KNjI5ogt9jFrsM6cABNeARLHCOWE6Pi yYi83BsiiRW40asZArbcVhUU/T6gMyoDRHhkE/VVLgncnz77yripXKbexk2r7nCWQZQ1 zMNyBmD4ud3Fz8JbHOSkNebPzvlMB4oH5MYZjeF0Sx1I9nirUXm2ycdQRtpztA9prN02 ih8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506353; x=1757111153; 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=tEbv4UWAVeKRp024G0xm5LxqRj77iPoKwjPkrVlHe68=; b=ErUt3274oQAPBR2+44F9wqWYFH+d2j0JmLWEpdZS9VOTwMC8wm7bpHk3bcnO5HMcsH rG4L7HL9pxlXxTYmvvnYOJk9CT/OeRICDi58tI34IPFpxdrh6zSQub7S2ZpwXdClvWo6 c3zWD1gkXbcdxzRQP/rC+tSsbowT3ftcWeDhudvnQF8Ag+8FBsokWImuelrj94H1a1vF hpyIlGvGV1qb33n5bbpDwpW3gSYlUvWKkIQxUiD/MdghgQUrW97zExP6IG82bF56Iead YuZ9BktMSBF5KukZjHJRVImoS7GJ5Wj09UEdsRbW/ornXSxq42LIq6XkRvGzJrF5Tb/D GZzw== X-Gm-Message-State: AOJu0Yy7SNUu6DvpU1pQNp/JRDscN8SB8y+TShFgB3v/nuyZlpdP7QSU g07j5nbDve6r56V9LxWxxeeHqMCYFJkmjSYNe9+jJKvNhvwp8ned/fKej0GR53qYWVi7p6mp1dg 01SXZ06o= X-Gm-Gg: ASbGncvU7YO7GJvqmPkYxXmoK0tl55c3qxyVuxXPMdzXYTBWy//gq0APZG/yEWyIayM pTCaHz1AKqSp/sjBMB/IG5j8qfReJfEkbT/ENZNQMUziG7qOKPV4nO0XeYwB2Jb4p6g1dL56SkK TW5HR9z+2tVsc0f0RJwW+H8SC0GQaf/9HQGIcbqH2LpNLCBdDM6DFgHzIhEfVrz8sFVn1fhnFQS SHKkdZ4lJWraXNYXTl/TGWNXVhglHRnkrBPJMQUOuuqfoZJDaE9h5X4odxIe4yUkJF4Ri7Mh+7V rO/Pb98SBa7wH+23VFTZz9DZGsk9NfsBJRx2Gxclsbozfo6jR4F0VGrbdWVsJ08zHV5OCyD4Z+T KwD8q8OBkiF63/rbWfVWxKuwMX7iDc7wiWIHiiz1FQOkP8c3sLkRbeOhKSA09 X-Google-Smtp-Source: AGHT+IGuz+/A7UoWMl7Gx2tlriuWxIVfZEKuI1LJUCd8whbOmBT9WYWyNADPKVbO1IBJW4TwfYEwmg== X-Received: by 2002:a05:6a00:18a7:b0:772:6d:428 with SMTP id d2e1a72fcca58-7723e3c3127mr236631b3a.27.1756506352833; Fri, 29 Aug 2025 15:25:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 33/91] linux-user: Remove target_elf_greg_t, tswapreg from elfload.c Date: Sat, 30 Aug 2025 08:23:29 +1000 Message-ID: <20250829222427.289668-34-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756572819245116600 Content-Type: text/plain; charset="utf-8" These are no longer used within the generic file. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/elfload.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 5cdbdc20d9..07d83c674d 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -130,14 +130,6 @@ int info_is_fdpic(struct image_info *info) #define ELF_DATA ELFDATA2LSB #endif =20 -#ifdef TARGET_ABI_MIPSN32 -typedef abi_ullong target_elf_greg_t; -#define tswapreg(ptr) tswap64(ptr) -#else -typedef abi_ulong target_elf_greg_t; -#define tswapreg(ptr) tswapal(ptr) -#endif - #ifdef USE_UID16 typedef abi_ushort target_uid_t; typedef abi_ushort target_gid_t; --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756571052; cv=none; d=zohomail.com; s=zohoarc; b=R0PW0vwsw/FDnM6x36EDry56FinKmaBXbYWeqG3Pn7PGpJT8ICBP16IZCoxAhzFNk435bkx/CxA6wcxNIrh7523rpBZbLdqI0G0SzammtvXqOMtDMdFi7BKk+GcH4UJJf8SHulBCeFPTBLKUM8xjvflxXMhF2DRh+yqCPYr0GKk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756571052; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=nTd/CMDn/bEFaBpaiDSBMhnHX1YzDFeRbUC6vLpJVLI=; b=cRg8V06Z6vYY7EPS8zAtivPuQhZ5TvWW5LbpzNGib+UsunpvsS7jSqjMlKcaafCQhkfHs9QoCMEgibde+CtWSTaQSDoQw6R7UGANxVUh8h87YJAz2NfJKFDKkDXTizaK4/zt0TuuTmQIuptC6Awp2/0iPEXlZ9u7+3isZL4dnDQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756571052545485.4639096942252; Sat, 30 Aug 2025 09:24:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNkO-000259-VM; Sat, 30 Aug 2025 11:44:09 -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 1us7Xn-0003K9-BE for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:26:03 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7Xg-00034S-Vc for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:26:02 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-7704799d798so2203686b3a.3 for ; Fri, 29 Aug 2025 15:25:56 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.25.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:25:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506355; x=1757111155; 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=nTd/CMDn/bEFaBpaiDSBMhnHX1YzDFeRbUC6vLpJVLI=; b=tKzv+uKtlDrZXrouYazlvCIkP91KY0JFcfxQdm2doISH98zH8N+mU5kGXWq+NlCEc5 KmOgs1czWlMrvl8601+Uzkah+wPhuNZ6ToaFO1iF81DKAU5sFKrzbl17rVbVpyTTUGo6 +9ll84pq4AH5lTeeHkl0EPWYNInaFYIOL8/s2HcHI99/tazI2vK8w8ELxf0zZg6aYYae uWHJxNmuETIhIGpaxYKuZIQOF2lUAF8ppVNcvfeBj0XAltbDeV9TR8/KhqK5IIecaufZ NkRb5ZWpTnbvPi1cRk7G5r79SfpJ+IlwTDlgojVQhkNFDmb5PUwbGvP8m+KaDK01yrP9 bYiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506355; x=1757111155; 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=nTd/CMDn/bEFaBpaiDSBMhnHX1YzDFeRbUC6vLpJVLI=; b=n/IC6YG9Xf0VfGqouBMRTUlqBvhDVwEtP8mG5Q1jyB9cRn8T4E4MK0/HwrAZ2NwwJ2 GwKcnvtqzvSiUDwqiGTTQkrQ5iqCSQ58ymEAl/UfYUw7BIlVR711Qob2EYkx+pImsPsg Z3SE+5E2WsZFmDdr+6l8Xc1lkRAzIepP5hQk43hrpr7IQrmSRo/vdX6ldgFgILSuph6r 2UKF2kDCH2C5ZVH44Vb7fRn0VdTtY2VfclOgeeIbBpYNWgDvLLgYyIBek0J45A/Lcqw2 PQU084o0Hwk2v8chNcVu7/pFL+VZi/ktG7WFHw2ganFABYxUpxKIsUszA9WOor+egj5D zodQ== X-Gm-Message-State: AOJu0Yz9PRzO/gFELBgfrkLajRTZT3cWkEaJUs+8kwITfNItNcy0Qm+2 iIKN3ONW3FaJ1QTciCWrKEZWVi44eNytqsURz06tefwJVR++kZIo1RhphjCeP6Xx0ZTbSBs+kmO bAroUn2g= X-Gm-Gg: ASbGncv9fT/42sMpjIidOkyaTc/AtS3sCbry3kff0Nm83RA4e1IYsOR5ThpW0ij0nPd xc1xLFEvumAt+Fp1L7MtZsqVt6CIXpupAwc+pU32zeSSpcPGBlIdTGuCEZbwpD0MXqWLpoUh0HF q4k1PoAP4+jkUS8+e7/sli/fVVuUpIzWW/zMZbfBUXy+mM5fKAVHalPsYWYA7g+2yl8LVxM1Cff OIFR+mnSBufDnul1JNmA+9P4G47RU6QhPa3xso1eKKIMcqRAsiCP4joe1/5/P7dDKFX/wDJwSTF JLLzrICF5CdR93B/d0uJg3hpl6v0xLc4/1CjQ9IIWMEH99GTIuaYL2I6ik6LbD/kzJkzJVUF3Ml +1E1ZzrGgwJwxIJffot+02GqvkLUuPSfLRBVQBBik4Wo3hd17oPHVlP3PzUWL X-Google-Smtp-Source: AGHT+IH7IHz58A81Dl+/dl5kGV83sXo1S00A1BsqHIErLEfT5T2QBB2L2lrEDPz4U4rNoGMSoy/9sA== X-Received: by 2002:a05:6a00:3d14:b0:76e:7ae9:e86b with SMTP id d2e1a72fcca58-7723e3f372bmr244909b3a.27.1756506355096; Fri, 29 Aug 2025 15:25:55 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 34/91] linux-user/i386: Create target_ptrace.h Date: Sat, 30 Aug 2025 08:23:30 +1000 Message-ID: <20250829222427.289668-35-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756571054198116600 Content-Type: text/plain; charset="utf-8" Remove the target_pt_regs structure from target_syscall.h. Add target_user_regs_struct to target_ptrace.h, which is what is actually used by ELF_CORE_COPY_REGS; the layout of the two structure definitions is identical. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/i386/target_ptrace.h | 32 ++++++++++++++++++++++++++++++++ linux-user/i386/target_syscall.h | 18 ------------------ 2 files changed, 32 insertions(+), 18 deletions(-) create mode 100644 linux-user/i386/target_ptrace.h diff --git a/linux-user/i386/target_ptrace.h b/linux-user/i386/target_ptrac= e.h new file mode 100644 index 0000000000..bc57926f25 --- /dev/null +++ b/linux-user/i386/target_ptrace.h @@ -0,0 +1,32 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef I386_TARGET_PTRACE_H +#define I386_TARGET_PTRACE_H + +/* + * Note that arch/x86/include/uapi/asm/ptrace.h (struct pt_regs) and + * arch/x86/include/asm/user_32.h (struct user_regs_struct) have the + * same layout, though the exact types differ (int vs long vs unsigned). + * Define user_regs_struct because that's what's actually used. + */ +struct target_user_regs_struct { + abi_ulong bx; + abi_ulong cx; + abi_ulong dx; + abi_ulong si; + abi_ulong di; + abi_ulong bp; + abi_ulong ax; + abi_ulong ds; + abi_ulong es; + abi_ulong fs; + abi_ulong gs; + abi_ulong orig_ax; + abi_ulong ip; + abi_ulong cs; + abi_ulong flags; + abi_ulong sp; + abi_ulong ss; +}; + +#endif /* I386_TARGET_PTRACE_H */ diff --git a/linux-user/i386/target_syscall.h b/linux-user/i386/target_sysc= all.h index aaade06b13..c214a909a6 100644 --- a/linux-user/i386/target_syscall.h +++ b/linux-user/i386/target_syscall.h @@ -5,24 +5,6 @@ #define __USER_CS (0x23) #define __USER_DS (0x2B) =20 -struct target_pt_regs { - long ebx; - long ecx; - long edx; - long esi; - long edi; - long ebp; - long eax; - int xds; - int xes; - long orig_eax; - long eip; - int xcs; - long eflags; - long esp; - int xss; -}; - /* ioctls */ =20 #define TARGET_LDT_ENTRIES 8192 --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756571135; cv=none; d=zohomail.com; s=zohoarc; b=mgsEBICqxfd79zi99sY4QldgyzW3jqkK6Y6HtNvBLYXSXhY3w9Jwumo5XG19McjJB/PqRW4dqw6udD0fCPWh9lpaDwjzI18P6sKd0XTXjbN8rPvRAHFQJnfBkODBwzVlxAAK8AuWf79MAr0971+r+SInMSYh52hc6UiLFSmbvlg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756571135; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=raLliw9+6K/4QAn0lcXOMniTQTtlGTsbPtgysxv1u4Q=; b=hWZWQgYgwk/0e60xF0g5YCI48Xq8iAOIpo+6oh+GmisgUflL8HNR83LpjolmfK4UoNJH1GmuUjhABnkDJw+0DlSMF6gD6Aa39+epFe2AZejlZB/V7yG7+iy+0rDvmRAiBV2vNAxsGrZz6hXEXa01OEqHhMIWiEi7iqv5MjkwqBo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756571135547432.4893988673714; Sat, 30 Aug 2025 09:25:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNj4-0005ZS-Uy; Sat, 30 Aug 2025 11:42:47 -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 1us7Xr-0003LX-GO for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:26:07 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7Xn-000352-DZ for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:26:07 -0400 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-771f69fd6feso2996523b3a.1 for ; Fri, 29 Aug 2025 15:26:00 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.25.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:25:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506357; x=1757111157; 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=raLliw9+6K/4QAn0lcXOMniTQTtlGTsbPtgysxv1u4Q=; b=Mroq0OuUJ7XQYXzk5ysU611Nroc9hfRjbQuhXxnxBzsAygGOH06HQRwN8qj9gRtfTJ k6xSQ1GGHMJUHYQktEZGpamFzlZ4rP6ier92D9UkNhqCfer7j3pbo0z/VpAdwuHLSUYc eo0ADAHyHi+RpHfNoIwqDAv91JL3YkVsdiYOb0ls9r1DRKn75TsSLd/D5qjGgU4Uynpe I9S08NOcMxiolCw5iTEi9zTGFmTR//VfwC/9h8thwFaECgdBzw7O0M/6HWtiIV49oC2N /mGre95bzQ6YELmunNS85Yfj9I8WlUNk9ui2bq44ie695r4AF7Fjk1xveA10HYjsrLUv 2WLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506357; x=1757111157; 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=raLliw9+6K/4QAn0lcXOMniTQTtlGTsbPtgysxv1u4Q=; b=aWgAuv2oObfQruVE5rQIgKGaoWboJJAyBKE6TzdjHFUvfAy0j6GX+OhotlewJJrtFE SE7QhwpeYLpSDYLv8OWK7qHVKcbp7KkU40xjYbMW+KqBmiVbFv5u5ut1Q/JLFFHtjsid KgWOWzkwAOVTShsBNcBWdTZQOMhV9B43GV7NYZr2pQzyBp2f5MbovnwBVnb/Gh2EgqFM 1a/pT+dmdtw0FLqG4sg56wPZH0RHnC0IDctH/v/wZoffBNmSbTfwM97Yr2dH9zTJyHpD Sq5fMhmRO22lnLDBJ4Yss8ii1fpEdYO7yJAk9Hm1lOKV+AhEoGC6v0qQnNa6+VYXOn7/ 567A== X-Gm-Message-State: AOJu0YxBEaehevApgFnzqDfDntOXbzmQMgxF0579vF6fQuB1NvFTbpfw d9Cl362IvInt7oprO4rwDgSJITTTjSHWZ19lVzzBfdDWGe5AWUxuucDbBsNBW9lTGy1RbilitGW gL7MQIEY= X-Gm-Gg: ASbGnctV5sRdmgRGr2qNUS9IVC3s9uBrNF7Te/NLFJEwHBWorDWgF3NiGGxAci6E4w4 RUkwgbeNCD5V8KU+X5JTLgrbkNUlyK5WbzHjV5NoqHVQn+WTzTpiQ3oyjanYuuxc4SRKwBQWFMX THbsOS9uf1bVUx3O7+7Iw4ZkMJ0gKYwylJebZBr8f+CQXgptXJsSD1ES/ZAgy6xOO6nLoQWxVWb g8atD4ksZDECQJN4CXStW+JHFIyw1q/0mVnQF5QnusVE4W5y6YUrRK3egiXKu0u+ctyB6zkRi/G EgDe1dW29W9EGohT8m3M4jX16MMkBSQ2d58ywf6avkOF/4kY671SCnsfMmxm23/+gmQzlpqqeuA Ol5G+TWV++xm6BWAEc6UuqlAvqSfdAJSzT3XONPsdnSy1ssQC+1/GiLwHh7FsX+a/kAHmeto= X-Google-Smtp-Source: AGHT+IFv0TRP/oTPWigSWCkLJeqaag+vDaGGpqbLjAO1j4WlMCOsU++LG8ghzJ2al8806xpq8h5SQg== X-Received: by 2002:a05:6a00:188f:b0:76c:2ef8:7536 with SMTP id d2e1a72fcca58-7723e21f752mr244025b3a.5.1756506357533; Fri, 29 Aug 2025 15:25:57 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 35/91] linux-user/i386: Expand target_elf_gregset_t Date: Sat, 30 Aug 2025 08:23:31 +1000 Message-ID: <20250829222427.289668-36-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756571137332116600 Content-Type: text/plain; charset="utf-8" The comment re ELF_NREG is incorrect or out-of-date. Make use of the fact that target_elf_gregset_t is a proper structure by using target_user_regs_struct. Drop target_elf_greg_t and tswapreg. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/i386/target_elf.h | 14 +++++--------- linux-user/i386/elfload.c | 36 +++++++++++++++++------------------- 2 files changed, 22 insertions(+), 28 deletions(-) diff --git a/linux-user/i386/target_elf.h b/linux-user/i386/target_elf.h index eb286868e1..f89ac0b611 100644 --- a/linux-user/i386/target_elf.h +++ b/linux-user/i386/target_elf.h @@ -8,22 +8,18 @@ #ifndef I386_TARGET_ELF_H #define I386_TARGET_ELF_H =20 +#include "target_ptrace.h" + #define HAVE_ELF_HWCAP 1 #define HAVE_ELF_PLATFORM 1 #define HAVE_ELF_CORE_DUMP 1 =20 /* - * Note that ELF_NREG should be 19 as there should be place for - * TRAPNO and ERR "registers" as well but linux doesn't dump those. - * - * See linux kernel: arch/x86/include/asm/elf.h + * See linux kernel: arch/x86/include/asm/elf.h, where elf_gregset_t + * is mapped to struct user_regs_struct via sizeof. */ -#define ELF_NREG 17 - -typedef abi_ulong target_elf_greg_t; - typedef struct target_elf_gregset_t { - target_elf_greg_t regs[ELF_NREG]; + struct target_user_regs_struct pt; } target_elf_gregset_t; =20 #endif diff --git a/linux-user/i386/elfload.c b/linux-user/i386/elfload.c index 279aeb8116..26b12001a3 100644 --- a/linux-user/i386/elfload.c +++ b/linux-user/i386/elfload.c @@ -25,25 +25,23 @@ const char *get_elf_platform(CPUState *cs) return elf_platform[family - 3]; } =20 -#define tswapreg(ptr) tswapal(ptr) - void elf_core_copy_regs(target_elf_gregset_t *r, const CPUX86State *env) { - r->regs[0] =3D tswapreg(env->regs[R_EBX]); - r->regs[1] =3D tswapreg(env->regs[R_ECX]); - r->regs[2] =3D tswapreg(env->regs[R_EDX]); - r->regs[3] =3D tswapreg(env->regs[R_ESI]); - r->regs[4] =3D tswapreg(env->regs[R_EDI]); - r->regs[5] =3D tswapreg(env->regs[R_EBP]); - r->regs[6] =3D tswapreg(env->regs[R_EAX]); - r->regs[7] =3D tswapreg(env->segs[R_DS].selector & 0xffff); - r->regs[8] =3D tswapreg(env->segs[R_ES].selector & 0xffff); - r->regs[9] =3D tswapreg(env->segs[R_FS].selector & 0xffff); - r->regs[10] =3D tswapreg(env->segs[R_GS].selector & 0xffff); - r->regs[11] =3D tswapreg(get_task_state(env_cpu_const(env))->orig_ax); - r->regs[12] =3D tswapreg(env->eip); - r->regs[13] =3D tswapreg(env->segs[R_CS].selector & 0xffff); - r->regs[14] =3D tswapreg(env->eflags); - r->regs[15] =3D tswapreg(env->regs[R_ESP]); - r->regs[16] =3D tswapreg(env->segs[R_SS].selector & 0xffff); + r->pt.bx =3D tswapal(env->regs[R_EBX]); + r->pt.cx =3D tswapal(env->regs[R_ECX]); + r->pt.dx =3D tswapal(env->regs[R_EDX]); + r->pt.si =3D tswapal(env->regs[R_ESI]); + r->pt.di =3D tswapal(env->regs[R_EDI]); + r->pt.bp =3D tswapal(env->regs[R_EBP]); + r->pt.ax =3D tswapal(env->regs[R_EAX]); + r->pt.ds =3D tswapal(env->segs[R_DS].selector & 0xffff); + r->pt.es =3D tswapal(env->segs[R_ES].selector & 0xffff); + r->pt.fs =3D tswapal(env->segs[R_FS].selector & 0xffff); + r->pt.gs =3D tswapal(env->segs[R_GS].selector & 0xffff); + r->pt.orig_ax =3D tswapal(get_task_state(env_cpu_const(env))->orig_ax); + r->pt.ip =3D tswapal(env->eip); + r->pt.cs =3D tswapal(env->segs[R_CS].selector & 0xffff); + r->pt.flags =3D tswapal(env->eflags); + r->pt.sp =3D tswapal(env->regs[R_ESP]); + r->pt.ss =3D tswapal(env->segs[R_SS].selector & 0xffff); } --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756570391; cv=none; d=zohomail.com; s=zohoarc; b=G8oWYXvjpc6/fphNmGhHVMnl7KksP7fcXRThNm48yQSTS3zQeMUA19zz8QZQv0DYpnyBk0jmbOZYS3QQXHrrrVfH/yidHsw+/Lh3QSdu1rw2e+0NSxYM9GdioFACYqn0kPv9uTFBr+iIkbevg6b3Cpz3x2NnymCQJP3PzLhhOeo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756570391; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+ReZ7WgJ9Kfc6uVECmtmJ6F8sDeee2buwnq/LwK97Qc=; b=ORfwMqVMibLYNOwlWBFBEt3HAK/wbI2jXZs2rcRx2q8PudZ4yDs0LuqHh5uohaN4gStSpPtJbURaTxyvzIaCiUvGnuzRMUcexXTTCPmTpjW4ORscMoBkNJ2S4YpvQ5DYttlwMP0h21qG9SS2jCGLNYvkha4wt7ZYFBC4vwF8C60= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 175657039152795.8327170933303; Sat, 30 Aug 2025 09:13:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNj1-0005Mm-2t; Sat, 30 Aug 2025 11:42:43 -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 1us7Xq-0003LG-Rs for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:26:07 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7Xn-000359-Mi for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:26:06 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-771ed4a8124so2660168b3a.2 for ; Fri, 29 Aug 2025 15:26:01 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.25.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:25:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506360; x=1757111160; 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=+ReZ7WgJ9Kfc6uVECmtmJ6F8sDeee2buwnq/LwK97Qc=; b=ordxxAWeYEx5PdrymvJdg2EkYUIPVfurZ9X0QKnmWpvfMs7FCKi1UENLzxLvM26uBx nT6HuXiSYyZakMCq495FjBolD499h6SdWdN58y607YxNHkSUELl4UtSpvPkrDU2q9hpy dhUM+kBXkvV+Fv4HaLJxyV7iLargb5CxyVhuwd+Xc4+JI4Oi0figGLmffCJeJbhzVXXO SYHIQKoKYURHxxLHTZPSXkaEMVOO10ajDxmTlYAs/5PtnfVnXwIZmwh0sqk7ZgzxAPhR XidLOKXME/L/tFoq5kIE9tyeXTs5hbtPo0hXK0BBNlmTOVRK477PDwrJByFEl8c5Xgtt czHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506360; x=1757111160; 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=+ReZ7WgJ9Kfc6uVECmtmJ6F8sDeee2buwnq/LwK97Qc=; b=oXaTXA/Sjh5O/Dx8u7bLz3x70TrL6Ls8ZcTNwtWqa6HWIuWFodS1CR/id4e48kygZR KFZHEiMiATvkWm9z0Kr6bfi7sb6isf4UGYan10Olw5YJmXx+McJLriF5so1OoIuEWIYc D0cu+IZ1UosUdL2m+IVf+ra9q+t2bBlSJ38qHGp0E8CkeJM6C7Vy8Oe36XdBVyuOUKX2 0MTetiHEJdId1OBo0/RvzQLhP5dIoj9Jjt0Ornj4fa4F6mwzPQ5W83XvYkbEIaDTvdbw 8WT2ZZEZoefvRGwHDqPZhobKBW8Hxsv15TO/f7WZR/urUrBs5ClBWzGHgsq+/W0A+EVm w/Og== X-Gm-Message-State: AOJu0Yxy4ANWy8LQcdQR1fxKoUkxC9BjdWjVxo91S0wgeYt3n6niukN6 o94uQD13WmAap+iNFMcCwE8qTFFlKaHq4Pfk9m9Pqg4DPY0WBp4LjUx6788ryLTS+yzWhF+X9JE mhkz+95M= X-Gm-Gg: ASbGncufDH7Gh4jTaEM+EPZFy7pX5wh4PokAhxCPRZM5tZ+rS06yXP4O6CJ9l/E5m8o NHZCqpLN6Ez6Bt9EsLXqWHs68Os8BEf2PRXOZlA/os86DOSYQvx3CbAgvg+ZbOkXZWXNhZjgzHg lHULh5OV8ZJiCH2aauntt/xNcvyzUPxOGxRrAISYaeQpYuK515vvHVVRXH1rnUaePjGD2pi/y59 75JGJiXTXarKZQf71hJqXkUDQmU2KBIIMhVezLqP17NUhVcryKG3vj4RbI8ETQqBHsQOoriJZxM bwJ/XX3b32g0BfW1+SSX9CNiDM963mRnqVx98cCgQhP+vOGb/u2DgQLNPeKyEYcVCwmvlUBgEnC /StTWkDJ+3TpP6M9QOI4LzUaKNEBpCc08BZJDo3vPmm2dz2mJ0TFnq55mIrkK X-Google-Smtp-Source: AGHT+IHjpedYRsSb6Oexc0gaRzDKnAcxoo94fd8+OQw2+hVVoswl4cTG1v7VRyVhW0PaCvXNM7Dtbw== X-Received: by 2002:a05:6a00:2e1f:b0:76e:7ae5:ec90 with SMTP id d2e1a72fcca58-7723e3b28cemr206091b3a.26.1756506359762; Fri, 29 Aug 2025 15:25:59 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 36/91] linux-user/x86_64: Create target_ptrace.h Date: Sat, 30 Aug 2025 08:23:32 +1000 Message-ID: <20250829222427.289668-37-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756570392797124100 Content-Type: text/plain; charset="utf-8" Remove the target_pt_regs structure from target_syscall.h. Add target_user_regs_struct to target_ptrace.h, which matches what is actually used on x86_64. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/x86_64/target_ptrace.h | 40 ++++++++++++++++++++++++++++++ linux-user/x86_64/target_syscall.h | 28 --------------------- 2 files changed, 40 insertions(+), 28 deletions(-) create mode 100644 linux-user/x86_64/target_ptrace.h diff --git a/linux-user/x86_64/target_ptrace.h b/linux-user/x86_64/target_p= trace.h new file mode 100644 index 0000000000..33527127cb --- /dev/null +++ b/linux-user/x86_64/target_ptrace.h @@ -0,0 +1,40 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef X86_64_TARGET_PTRACE_H +#define X86_64_TARGET_PTRACE_H + +/* + * The struct pt_regs in arch/x86/include/uapi/asm/ptrace.h has missing + * register values and is not used. See arch/x86/include/asm/user_64.h. + */ +struct target_user_regs_struct { + abi_ulong r15; + abi_ulong r14; + abi_ulong r13; + abi_ulong r12; + abi_ulong bp; + abi_ulong bx; + abi_ulong r11; + abi_ulong r10; + abi_ulong r9; + abi_ulong r8; + abi_ulong ax; + abi_ulong cx; + abi_ulong dx; + abi_ulong si; + abi_ulong di; + abi_ulong orig_ax; + abi_ulong ip; + abi_ulong cs; + abi_ulong flags; + abi_ulong sp; + abi_ulong ss; + abi_ulong fs_base; + abi_ulong gs_base; + abi_ulong ds; + abi_ulong es; + abi_ulong fs; + abi_ulong gs; +}; + +#endif /* X86_64_TARGET_PTRACE_H */ diff --git a/linux-user/x86_64/target_syscall.h b/linux-user/x86_64/target_= syscall.h index fb558345d3..68f55f8e7b 100644 --- a/linux-user/x86_64/target_syscall.h +++ b/linux-user/x86_64/target_syscall.h @@ -4,34 +4,6 @@ #define __USER_CS (0x33) #define __USER_DS (0x2B) =20 -struct target_pt_regs { - abi_ulong r15; - abi_ulong r14; - abi_ulong r13; - abi_ulong r12; - abi_ulong rbp; - abi_ulong rbx; -/* arguments: non interrupts/non tracing syscalls only save up to here */ - abi_ulong r11; - abi_ulong r10; - abi_ulong r9; - abi_ulong r8; - abi_ulong rax; - abi_ulong rcx; - abi_ulong rdx; - abi_ulong rsi; - abi_ulong rdi; - abi_ulong orig_rax; -/* end of arguments */ -/* cpu exception frame or undefined */ - abi_ulong rip; - abi_ulong cs; - abi_ulong eflags; - abi_ulong rsp; - abi_ulong ss; -/* top of stack page */ -}; - /* Maximum number of LDT entries supported. */ #define TARGET_LDT_ENTRIES 8192 /* The size of each LDT entry. */ --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756569978; cv=none; d=zohomail.com; s=zohoarc; b=mvKtvTeHgf+LeIwIPUh4o0uPpTibPbnL5frfk5DSQk+Uugp0F8ka4i3QNVe9Qb8x9eRzWjiqXTMZeC45h2UTZ5uUjYFdfH5amUb7SB7Q1KjS8928Kp2dEVgEKDkjD5tf/+ShcRHBGgPwmEFXPbjOKHU/9BDMxOctqzHTINmmThU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756569978; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ONuJMYbWeJBxnsdiR21d/u0rs2Fxlc0F9a0zKzHjW5k=; b=fpAIflUyBOrXBoHKfA9ur9B89a/D2hPpwx0gD1xue4kf7A+yXiPMm1aV8ZarfZRmN+4jtZvzCtU2RydqsnwLItMGfLXu2DMhDIVEDvwq0BjWTEuGWo+s+0nktEsEOT1cgpGpNcTF/MQbu6mOSe/RelWrjggD7P6S1eYqWa17oeM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756569978732105.44640892370012; Sat, 30 Aug 2025 09:06:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNks-0003Fu-E7; Sat, 30 Aug 2025 11:44:40 -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 1us7Xt-0003MX-Ob for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:26:09 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7Xq-00035O-W5 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:26:09 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-7704f3c46ceso2332811b3a.2 for ; Fri, 29 Aug 2025 15:26:03 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.26.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:26:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506362; x=1757111162; 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=ONuJMYbWeJBxnsdiR21d/u0rs2Fxlc0F9a0zKzHjW5k=; b=X2ODpboL5v4WbWHjjpxuM0WWXVz7ffqEuRyaKA3TomFqUgmSHLTeE51SonN39QfFZ8 TvJp/i4uqxxKB0vVgJS5plAT2Js4GbC0umM5y2yg0Nrp1iivwXfatBshKYIRedI0koC9 5wPIq0diH8VTcGwxyNjCeqMO95nUNthdewojtwVPM2Ath5sM1yVbw5CGKqMgH/viuN5h JXUcHPiiO09Q8zJJERTFo8DzoLHZpPT1RccUOlzg2oycHas1otT+5uw+jUDYPKjoJvC4 ZdjeRZIuPdD5iPKEbeiv0iV57Fob0EyWpEtR6ffUk62YjQeUBjZcJjHanqUra6p4LcI9 U8TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506362; x=1757111162; 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=ONuJMYbWeJBxnsdiR21d/u0rs2Fxlc0F9a0zKzHjW5k=; b=H3cKwhOcP879BkYItBnuBxiDMMgHil0cbCSna0wxOce3Q+6Wc7vRIBXciFAxMYiY68 I70+/AkQrxSyQ5oUdT15pMexUqsafd8zGrSlaVEgdmir4qi2wocNvojYqxX8aMeq5kIg /rpV5Mh1BruOn3NDDedySdGYY9Q5U5hD0hbWUrvhEWgkuYu/J/2+JNFK27N18ml50URH fOXWYDH6L4hdjY8x4Z6ejYkHWMTzCOTEqoA7h1nbP70db36pEpnFfVo3/zk1DNcN9XlQ 1+OvklEN/TiRq+KNtIM54u8wEYt5p//dALHRF+ZUDB8vFiyRN9pZh0MUYidTW9XioYO5 rDsw== X-Gm-Message-State: AOJu0Yw26Aga27w7bjzTnw57efPYaj2KrRl/7b7kDJWNIgHkSvuZ8SqZ uYng/qp0vZNM7sP9z7PrUUyWM7lcpGBLVg+3rPu/w6r2z3h557KqUQio9jnoK1rLIb1Le835KzO B63Trszo= X-Gm-Gg: ASbGncsioTEznlfSDlkxXYGnkmQSalCUU3bMW8M6C2zuqwdOl61bzPbPeHLqG4ajpNE vt/OLeqASKxhKQu1pmnnZQOVHc60heaYsZwJhjuI0MyMdkFho9qoeo4bvtaL36yB3aYsa1sqJA0 kkHRQm4Fru/uz4clg9DWZkxcwCtPJu06v+j9Lo1bBL6/WznmNjfzDeYyATlOmvjdLG6dkvkj/8s e7xLX70HKTS1vFlSvwbH1ikc3/dozmxRzrhKn7HarJzsZDIgidooyILKR1lzN6KNFavt1fr0BJ0 ZHsIxfEMoIsFtH33R79/WqHYDTx2IK9EyZF98YsTT3peeXA8Lci72VfiAJEIRomF6AdlReU84Wh qDbih57zCy6TS1a2KcaMMefbiwg1/72wmg2epsPLW5KFlA3m/dpeQdiMBq6O1QrKnJZt/WX0= X-Google-Smtp-Source: AGHT+IFXmQDhPk38WNvt28oOKknLPkRYuZ1s5ejkcls1p9jH4PbcFE4Lqg3NtL/tULsl1G7vf2CiJg== X-Received: by 2002:a05:6a00:3e18:b0:76b:cf2b:18bf with SMTP id d2e1a72fcca58-7723e21eccfmr288527b3a.2.1756506362092; Fri, 29 Aug 2025 15:26:02 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 37/91] linux-user/x86_64: Expand target_elf_gregset_t Date: Sat, 30 Aug 2025 08:23:33 +1000 Message-ID: <20250829222427.289668-38-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756569979247116600 Content-Type: text/plain; charset="utf-8" The comment re ELF_NREG is incorrect or out-of-date. Make use of the fact that target_elf_gregset_t is a proper structure by using target_user_regs_struct. Drop target_elf_greg_t and tswapreg. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/x86_64/target_elf.h | 14 +++------ linux-user/x86_64/elfload.c | 56 ++++++++++++++++------------------ 2 files changed, 32 insertions(+), 38 deletions(-) diff --git a/linux-user/x86_64/target_elf.h b/linux-user/x86_64/target_elf.h index 74a77d94cd..32a9eec431 100644 --- a/linux-user/x86_64/target_elf.h +++ b/linux-user/x86_64/target_elf.h @@ -8,22 +8,18 @@ #ifndef X86_64_TARGET_ELF_H #define X86_64_TARGET_ELF_H =20 +#include "target_ptrace.h" + #define HAVE_ELF_HWCAP 1 #define HAVE_ELF_PLATFORM 1 #define HAVE_ELF_CORE_DUMP 1 =20 /* - * Note that ELF_NREG should be 29 as there should be place for - * TRAPNO and ERR "registers" as well but linux doesn't dump those. - * - * See linux kernel: arch/x86/include/asm/elf.h + * See linux kernel: arch/x86/include/asm/elf.h, where + * elf_gregset_t is mapped to struct user_regs_struct via sizeof. */ -#define ELF_NREG 27 - -typedef abi_ulong target_elf_greg_t; - typedef struct target_elf_gregset_t { - target_elf_greg_t regs[ELF_NREG]; + struct target_user_regs_struct pt; } target_elf_gregset_t; =20 #endif diff --git a/linux-user/x86_64/elfload.c b/linux-user/x86_64/elfload.c index 76cf5c1509..18d632ec34 100644 --- a/linux-user/x86_64/elfload.c +++ b/linux-user/x86_64/elfload.c @@ -21,35 +21,33 @@ const char *get_elf_platform(CPUState *cs) return "x86_64"; } =20 -#define tswapreg(ptr) tswapal(ptr) - void elf_core_copy_regs(target_elf_gregset_t *r, const CPUX86State *env) { - r->regs[0] =3D tswapreg(env->regs[15]); - r->regs[1] =3D tswapreg(env->regs[14]); - r->regs[2] =3D tswapreg(env->regs[13]); - r->regs[3] =3D tswapreg(env->regs[12]); - r->regs[4] =3D tswapreg(env->regs[R_EBP]); - r->regs[5] =3D tswapreg(env->regs[R_EBX]); - r->regs[6] =3D tswapreg(env->regs[11]); - r->regs[7] =3D tswapreg(env->regs[10]); - r->regs[8] =3D tswapreg(env->regs[9]); - r->regs[9] =3D tswapreg(env->regs[8]); - r->regs[10] =3D tswapreg(env->regs[R_EAX]); - r->regs[11] =3D tswapreg(env->regs[R_ECX]); - r->regs[12] =3D tswapreg(env->regs[R_EDX]); - r->regs[13] =3D tswapreg(env->regs[R_ESI]); - r->regs[14] =3D tswapreg(env->regs[R_EDI]); - r->regs[15] =3D tswapreg(get_task_state(env_cpu_const(env))->orig_ax); - r->regs[16] =3D tswapreg(env->eip); - r->regs[17] =3D tswapreg(env->segs[R_CS].selector & 0xffff); - r->regs[18] =3D tswapreg(env->eflags); - r->regs[19] =3D tswapreg(env->regs[R_ESP]); - r->regs[20] =3D tswapreg(env->segs[R_SS].selector & 0xffff); - r->regs[21] =3D tswapreg(env->segs[R_FS].selector & 0xffff); - r->regs[22] =3D tswapreg(env->segs[R_GS].selector & 0xffff); - r->regs[23] =3D tswapreg(env->segs[R_DS].selector & 0xffff); - r->regs[24] =3D tswapreg(env->segs[R_ES].selector & 0xffff); - r->regs[25] =3D tswapreg(env->segs[R_FS].selector & 0xffff); - r->regs[26] =3D tswapreg(env->segs[R_GS].selector & 0xffff); + r->pt.r15 =3D tswapal(env->regs[15]); + r->pt.r14 =3D tswapal(env->regs[14]); + r->pt.r13 =3D tswapal(env->regs[13]); + r->pt.r12 =3D tswapal(env->regs[12]); + r->pt.bp =3D tswapal(env->regs[R_EBP]); + r->pt.bx =3D tswapal(env->regs[R_EBX]); + r->pt.r11 =3D tswapal(env->regs[11]); + r->pt.r10 =3D tswapal(env->regs[10]); + r->pt.r9 =3D tswapal(env->regs[9]); + r->pt.r8 =3D tswapal(env->regs[8]); + r->pt.ax =3D tswapal(env->regs[R_EAX]); + r->pt.cx =3D tswapal(env->regs[R_ECX]); + r->pt.dx =3D tswapal(env->regs[R_EDX]); + r->pt.si =3D tswapal(env->regs[R_ESI]); + r->pt.di =3D tswapal(env->regs[R_EDI]); + r->pt.orig_ax =3D tswapal(get_task_state(env_cpu_const(env))->orig_ax); + r->pt.ip =3D tswapal(env->eip); + r->pt.cs =3D tswapal(env->segs[R_CS].selector & 0xffff); + r->pt.flags =3D tswapal(env->eflags); + r->pt.sp =3D tswapal(env->regs[R_ESP]); + r->pt.ss =3D tswapal(env->segs[R_SS].selector & 0xffff); + r->pt.fs_base =3D tswapal(env->segs[R_FS].selector & 0xffff); + r->pt.gs_base =3D tswapal(env->segs[R_GS].selector & 0xffff); + r->pt.ds =3D tswapal(env->segs[R_DS].selector & 0xffff); + r->pt.es =3D tswapal(env->segs[R_ES].selector & 0xffff); + r->pt.fs =3D tswapal(env->segs[R_FS].selector & 0xffff); + r->pt.gs =3D tswapal(env->segs[R_GS].selector & 0xffff); } --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756577569; cv=none; d=zohomail.com; s=zohoarc; b=Uv9zUCc1HICj8oUvMiMZUi50lzKU0Qq6BVy5tFZyDvWdTE0iPJvmk5R76WsaQXucAdPTUk7ujDD+CJrhP9dqV+7FXspWJRFpvOE+Hy2mu/Y8zzUL9RMYrkxznOj/PV3AzwdmrvMwSX7l3/qls5GVYvp8Ua//aJOQClq2JouwACo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756577569; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=TkQfzRBVz9LGX2QM0Sbr4ZLF3ewH7Bmx5RrPOumx3wA=; b=Z9GIrly0cpv3esUHyN5H/gPNUxuLba54PJzvYUI8vglTa26666CLB6UIp3OHT7ziT0zubkukbHjsvok62oUgZJIr/9YspeBaQtrtdIKncgXc8CFbPcc199y9T3Xhh29W4PUIyLCS7Vz+eOcMDlk2qcyuldBU0+s30sINF/BVihM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756577569086798.1160430114305; Sat, 30 Aug 2025 11:12:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNkR-0002Qb-Ci; Sat, 30 Aug 2025 11:44:11 -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 1us7Xu-0003N9-MR for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:26:10 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7Xs-00035l-Ms for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:26:10 -0400 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-77238cb3cbbso565449b3a.0 for ; Fri, 29 Aug 2025 15:26:07 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.26.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:26:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506364; x=1757111164; 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=TkQfzRBVz9LGX2QM0Sbr4ZLF3ewH7Bmx5RrPOumx3wA=; b=vkYwxBD/HzkyO9LxjvYUKvHT8qp2c525/oPrbeLH3Ea85tkEzqXSdsI7ThTe7EpNYp Q4fXymwDNA/rvSeQQXkC4w/mOOmfXGc5bnXDTU210otB4N/LVNyikUogGoufv2W1RkTk DfHg3Fm1uoZpySgIu0t2T+iLEMaB2zGDQ25qHYjbjixg6qkG/j2dQVIu6tma3tKjFlOi 9jN0mVkVPF76FxpQ9B6TuEeZprWuOd1loRz4VNkwCs1K+uzF6EFWJvSyRoyLJyuPi7Ve O7g0G4URO7VQtvd9uPJcYSRVZPxgoUQ1vHUdvigoiB7Z4RE3HGDnO5DGdlssZC5L4nNZ K18Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506364; x=1757111164; 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=TkQfzRBVz9LGX2QM0Sbr4ZLF3ewH7Bmx5RrPOumx3wA=; b=Up3gry7fPRZzSVsU3lRijyVDz1XVuskjIRBuzp99ziAp8s5uQZagc/CyfISMmMFXS0 /iAmMn5v4Eg2Sd7MXBNnRcx5TQThOxsKI2wUyMsqwO3iQbYcgP3tjS0W91M0x4vAAKjQ QyX+dnfA9iXGnKZv/JPMYhU/A6JHQTXn3B3qdWhLulLjM5157m7Ta+/0OHj7DTIgjL2N OoC6FRDfRNYqEGpHlP8DPlmUkU6V8FfcYVjhiHS/OAZPxQW9lCOcXg/6epjZDxSgGByo mAA6SpEybyaP767AT8D+vfuRpU/8tqO0DwcV3NPeRZ7ZPaozWAww5CTVYbT06/jSqfTu siiQ== X-Gm-Message-State: AOJu0YwZDMbstTzDAZhrGeEuMTVIrb8RtMbupbIUwrW6AvwQcXDHbl6b T1DSlrF9UkwvpF6H5U5yxcz31FY+Ts7H2HWm2E5HBYx7znKF8AFadZOWAazuEXOzmJ2X0i7Yn4i txmV3r5Q= X-Gm-Gg: ASbGncvPSa8q10CGa+ltysOJhrXTpQZ5gg7QhGEfPP4W5gbSoQfsPYfJhCpZBfI50zA 4BORG7uvKQIbG1YJ/nXBVTAQ6kaKU0ddBpEmewcJzYe2Gf8owFzV2bJz4iIZOmv5Ux7wqvxGlSp Dgwxsrmbz6jenSpFwg6cn6Kv9IL6IQ7o0gWCABrg1ja9oONbXtAMNURXCT8kPW82GdIqiq+HIP3 xqQWD9Jw/+Ylg0g3ekNmZASqxxHchbOlnjoNd7T+ONxPzfmyjtu8mvyWg6eunxwE5kIMZdD5xd0 4I7YWTwxUEO+iY9wLgY5Hb9QitSX42GrPIXNsIVfs0dYWVjlbpvlhaOzM0rYsQ+ckyuzLD75KLF uQAZVKQ68x23PyyGseS0rKWV4A0PESpFVqxyMYj3864d7zmOvcwyDqVmsK4Uy X-Google-Smtp-Source: AGHT+IFslxS34ToofJkY0hOlSq4LPxUvYgT4UtQfkr/mOMBTE1PRYeZoQclUZj3HV8ICHVmfgRVS1A== X-Received: by 2002:a05:6a00:3e18:b0:772:3c9:ce3e with SMTP id d2e1a72fcca58-7723e21f348mr265665b3a.7.1756506364417; Fri, 29 Aug 2025 15:26:04 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 38/91] linux-user/x86_64: Fix dump of fs_base, gs_base Date: Sat, 30 Aug 2025 08:23:34 +1000 Message-ID: <20250829222427.289668-39-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756577570211116600 Content-Type: text/plain; charset="utf-8" We were storing the selector, not the base. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/x86_64/elfload.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-user/x86_64/elfload.c b/linux-user/x86_64/elfload.c index 18d632ec34..12de1c54c7 100644 --- a/linux-user/x86_64/elfload.c +++ b/linux-user/x86_64/elfload.c @@ -44,8 +44,8 @@ void elf_core_copy_regs(target_elf_gregset_t *r, const CP= UX86State *env) r->pt.flags =3D tswapal(env->eflags); r->pt.sp =3D tswapal(env->regs[R_ESP]); r->pt.ss =3D tswapal(env->segs[R_SS].selector & 0xffff); - r->pt.fs_base =3D tswapal(env->segs[R_FS].selector & 0xffff); - r->pt.gs_base =3D tswapal(env->segs[R_GS].selector & 0xffff); + r->pt.fs_base =3D tswapal(env->segs[R_FS].base); + r->pt.gs_base =3D tswapal(env->segs[R_GS].base); r->pt.ds =3D tswapal(env->segs[R_DS].selector & 0xffff); r->pt.es =3D tswapal(env->segs[R_ES].selector & 0xffff); r->pt.fs =3D tswapal(env->segs[R_FS].selector & 0xffff); --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756573262; cv=none; d=zohomail.com; s=zohoarc; b=m3GI+nvBQDegN+LjwU+xz7s/SdroXR3I0RtAn8M2oV8/LeEXkXCiisvOCygMesR0f6TpOVlxE9fjDlD6sXWDrStrDs+Q18qGf5UIz0jk90j2YRxzQmTRQvGUnVBjGKNJoSNkkBfa0Qf23vdMxMeXjQwZse8XTcoL7S3zI877xoE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756573262; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=OeyuONIhn7M8m2f6ZvIYRj5UQSQ10lMaLgBMOA9lrAQ=; b=jku5pXqXqLWIiVNtB9W9sZj1fQ4FDSKmjzV+n/Y+uSDVtiD2GQpj6ofDePJIwiosoo0ivuGVdZlX/g27usZk+/b0yMQirs98z8eJxuYZNrzPhlSPu+jhEAl3+SE0C0pOZma8TsjrzSu52ICZDYcpoJ+vtg9TM8ftf0VUEuoUbs0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756573262835770.6976339416535; Sat, 30 Aug 2025 10:01:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNkx-0003i7-4Y; Sat, 30 Aug 2025 11:44:43 -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 1us7Xv-0003Na-SY for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:26:11 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7Xt-000369-Oi for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:26:11 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-772301f8a4cso1239015b3a.3 for ; Fri, 29 Aug 2025 15:26:09 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.26.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:26:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506367; x=1757111167; 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=OeyuONIhn7M8m2f6ZvIYRj5UQSQ10lMaLgBMOA9lrAQ=; b=KfXWy/Fm63w12nVyFiO/slR4AWu/Rig9AwK1e1TAFLqJmLF75EMN6eTxuY30SSW/M2 SN3vgQAz1pkvZhPLuQtOIXOYXK0l9cIsgqInZQ+2eVCRaDxbFNvzDPN8vQYMu7OtGIJY Q/Hz5/oPtrnyJiCEfm8YhPKEysjglKZZ9EGN4sJKDN6vn0WsLUfMrLcF+/0VDFB45ayt jXmlgL6hDkHBeIO1WUb1BQYA/peMa3+F6HfzAQqu3RpaMnftPDISmZFtafCOeJossNIu t180Yda3JbCN/lWic62Trhi87bS0A8xHtzazB+yydQpXEgQhA0WjG5yzP75HeslJl6rz bHMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506367; x=1757111167; 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=OeyuONIhn7M8m2f6ZvIYRj5UQSQ10lMaLgBMOA9lrAQ=; b=bqgUF1YcX7i1IRL5AGD53ij+97O9zOqv6/udyNCHHRrU/gzRsSouw0hBjGBZh1hGkj aV92IFN4Oe0BeDTh288Y0ByP8Ju6A8Wr9OFlYuJeGzfph0xqn2T20L7ROW2b/Z+Tr1iE sXqDt7TUc2Syt49BWfeDEs3kXONuecmaYVSuyzTi2QAAft++vIOGLKaJ71k0cM4T3P3I ooRE7cp337aHczK1HL9AClY/O8hiLn/APybNUatwftjrmq1KR+ABIjJ8fvwir7U815Z+ CwIEhTC/qUavrQIrilsNTO8EfxHfN23LaxwwgisabYby7p2R8zz6HbXrEbal1A+gu4pt MbeQ== X-Gm-Message-State: AOJu0YwhtkS0ceC2NXGG+Mrt5Xazz4RMzKqyYfvtHHKZS5FRTFsh2sqb L1PDSxWQkbpACvkAXHEamMxzxQXc0ttRup1PzcrIvQkh/ByY5xGqbySP2MTg4FTRLTE8bxPGzQd eHaBsXkc= X-Gm-Gg: ASbGncsbr/2GZ+CKWE6S7PGMkyIgcuWFtBT/KcQvM1oNJdatVumIWwm2QOk+Z3CCejK hcMdEXSWTfNMlgYTuGHqfQGHDgjxSlnMYvuVPsqB4QkZn5h7pSv/XPRFLG+sLheIZAcbXLLXG/p +ZJ8YEMzg6TtgOYLm8hb9PtHFspki9mAUjE9qNAMkIY8KK0sSGsSfBPlilPekXkT/ThRZKO+oxh HpPM7fQRYLZwGhMh/mHgnryNqB0RRDuqLoXw4bjFKKXh2K0s9sWijiHoDw61baIWlU54A6XuzdS P7wbSRZchT6uLr/SCeI7vG4S5NvXjOnbwyDmJIInI0HYMqS7EMYuyRcbeusmtwINjBtich2qw0I PSPxGtOpiPwJfVsFTiCH3Cm0GxG6Abvod2cc3DG11IeBslqo6wkYVnq0M2oue X-Google-Smtp-Source: AGHT+IFDccpDkN0i3dfJVEAzM3vxk3oC/yNuHoZorujCn2LTVTMReAddkuNEhLofihMoiepXIRj2TQ== X-Received: by 2002:a05:6a00:460e:b0:772:fc2:be71 with SMTP id d2e1a72fcca58-7723e338532mr275928b3a.20.1756506366734; Fri, 29 Aug 2025 15:26:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 39/91] linux-user/aarch64: Create target_ptrace.h Date: Sat, 30 Aug 2025 08:23:35 +1000 Message-ID: <20250829222427.289668-40-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756573264859124100 Content-Type: text/plain; charset="utf-8" Move the target_pt_regs structure from target_syscall.h, and rename to target_user_pt_regs, to match what's in ptrace.h. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/aarch64/target_ptrace.h | 14 ++++++++++++++ linux-user/aarch64/target_syscall.h | 7 ------- 2 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 linux-user/aarch64/target_ptrace.h diff --git a/linux-user/aarch64/target_ptrace.h b/linux-user/aarch64/target= _ptrace.h new file mode 100644 index 0000000000..10681338ba --- /dev/null +++ b/linux-user/aarch64/target_ptrace.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef AARCH64_TARGET_PTRACE_H +#define AARCH64_TARGET_PTRACE_H + +/* See arch/arm64/include/uapi/asm/ptrace.h. */ +struct target_user_pt_regs { + uint64_t regs[31]; + uint64_t sp; + uint64_t pc; + uint64_t pstate; +}; + +#endif /* AARCH64_TARGET_PTRACE_H */ diff --git a/linux-user/aarch64/target_syscall.h b/linux-user/aarch64/targe= t_syscall.h index c055133725..bd05f6c7fe 100644 --- a/linux-user/aarch64/target_syscall.h +++ b/linux-user/aarch64/target_syscall.h @@ -1,13 +1,6 @@ #ifndef AARCH64_TARGET_SYSCALL_H #define AARCH64_TARGET_SYSCALL_H =20 -struct target_pt_regs { - uint64_t regs[31]; - uint64_t sp; - uint64_t pc; - uint64_t pstate; -}; - #if TARGET_BIG_ENDIAN #define UNAME_MACHINE "aarch64_be" #else --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756570313; cv=none; d=zohomail.com; s=zohoarc; b=P5A4A8zCyNTBGhT8eyO2Na60RLW66MBMaL0EP1DJhD88hKvTbooYsbvtkb96s7x8m+IlOAFZIu159Rk72e+WCu758ETDQz2gJn1wskUW1jXTJIYCZZixGM7hq9fR7GADYjF6Tbp35y1sL1BPBPVGLNTikUZcWL4SLQeCKzF/GKE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756570313; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=2g9oIt4VPwMetgB/wVKiRncFietrLuZrsmH8GdIqkvs=; b=GxYg4JXKKrv5GCUChmaJSib4G3yoLm2amxWnMbQv3He5W6oqhekz1d69qCp8B+Og7i3ayBNWd2kdqid2ZS6C6GFATZrBVQZXUdLLFQnoZYfiAFayYXLTAk3Umu5T83DcGr/lTwH7II0ATxAASqIh09wX2STqDGmat4oao1s/SF8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756570312925283.1127772125975; Sat, 30 Aug 2025 09:11:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNkV-0002gg-Rn; Sat, 30 Aug 2025 11:44:16 -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 1us7au-0004Fd-Qo for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:17 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7as-0003XC-IL for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:16 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-771f90a45easo2234846b3a.1 for ; Fri, 29 Aug 2025 15:29:13 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.29.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:29:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506552; x=1757111352; 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=2g9oIt4VPwMetgB/wVKiRncFietrLuZrsmH8GdIqkvs=; b=kWYK/NHc80krr3Mm6Bo8YLGguTp5JoW3H4/pmNFNr6u1JKAvPz/l0ypZeuBpjB0ybA Y1SQ+5KKc4h3cpV2tFUDVvKA4X6NIwmFe6WAq2QzqyQNexY8tU1W+ioLqouXkEQXL7Vu 5n6rtXKf57CIV6YpmkQzRpcFrP8gDEAL9Hk2Gg9mGEixpGgfJQ3cac7emZTjUhaiaE2W qz1XVJ+/Wyts2iH3uz01mLY6YKikht0KoGNUb/J3MUITGhCiVzun9VNB9CaVFtxzb4fV DEbrTRCr3ExbE5d0HrI5CdSGaLWVAYnVkoDw2jVVUFj2MIDdsjNTq4/IyVhcq+nF8vF4 QhRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506552; x=1757111352; 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=2g9oIt4VPwMetgB/wVKiRncFietrLuZrsmH8GdIqkvs=; b=dgvSxg4MV/9m2jowNMqxG6Nwy+9mL6Nx95cmyhUz75dN2nfGd5M+j5r3btikn/ehZt 744pWaobZv/qNpRY1LOslU9MPWCw9sr/6mIEPIKBrNVJJ3OClypL0zZFOeka0C6QHAA/ 8H8pwJZk5qcMvM+RcaB5ODI87NTtHMtgSFP0CyoO48+oHOVMXLJcceAj/0C8wDQXNGvC Rn2cubovIf4dUsXH3xwRfZph37LpJrC2HNsRHq33y4abn201yyxk0DXF2GWf0RviumYL nZU8tclqjl7QhiVWQAvktragw2Kjq1ViWgt0Q9Nd+orAhVgXDmNGSdSzofymzNylPJz7 9k4g== X-Gm-Message-State: AOJu0YwQOoBUVnfHcEaXIVT7+mwAjL1RzDDbYxxS+ThfzD0ZqhEHaePt xQA7WA/t1LnmQF+36HVmDorqjalD6pGLkaOsFOQ0cW7wm/mYYfRtggIPHNCHbMBGQyvD3nBEOiM q4O9xUbw= X-Gm-Gg: ASbGncsqYQ+XgQdjInzB0UAGPUrHR3KpZCHr0iBWTI3k8M/Spq4rg3XtUSHQ8zoFLXu LPIVzQ+hhpg+Yh8emNYNbmjnmLYUTyzyvS0U1D7PQEF53nxMPWHNCcRqLUxIA6dNFgXDPXUEcRA /vTwMg3X2nK/C58Nz1KgGGLh/2eBZr3A1BPmhV1sy7q1gx78l6+usKeusiD6bfm7TQvLO/JYPyU yerOM9P0/9Kvw0nUEGpJKdrWxohmsgzrVZjSqs0/NnJDp7Fo9D4fPHYXZZFW2b2rrWx9+6Bs039 vEuwhJA7OaABCkOlC4amUPPIZKBH3UnrBXaqNQ4dL3Hja+eUja0W6nS7MBIbScad5OdojyiJiGs agPacovO78B4RVqeu2QZc+GaS7/sWHTgrn7+4YjvN8+IESAPvd502YYFxZumUo6e1uU0c4RpK31 KGPdJsBwDm X-Google-Smtp-Source: AGHT+IHI6U/jfzqaT+L/sJRm1f3mhmnEACaC8NmzV2UuJS40DasTHyIwCw8EofxDV2xxrqU5JIdZMA== X-Received: by 2002:a05:6a21:32a8:b0:243:bd98:de64 with SMTP id adf61e73a8af0-243d6f02826mr297189637.28.1756506552510; Fri, 29 Aug 2025 15:29:12 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 40/91] linux-user/aarch64: Expand target_elf_gregset_t Date: Sat, 30 Aug 2025 08:23:36 +1000 Message-ID: <20250829222427.289668-41-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42c; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42c.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756570313773124100 Content-Type: text/plain; charset="utf-8" Make use of the fact that target_elf_gregset_t is a proper structure by using target_user_pt_regs. Drop ELF_NREG, target_elf_greg_t, and tswapreg. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/aarch64/target_elf.h | 11 +++++++---- linux-user/aarch64/elfload.c | 11 +++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/linux-user/aarch64/target_elf.h b/linux-user/aarch64/target_el= f.h index b0728a1008..9eb8bb547e 100644 --- a/linux-user/aarch64/target_elf.h +++ b/linux-user/aarch64/target_elf.h @@ -8,16 +8,19 @@ #ifndef AARCH64_TARGET_ELF_H #define AARCH64_TARGET_ELF_H =20 +#include "target_ptrace.h" + #define HAVE_ELF_HWCAP 1 #define HAVE_ELF_HWCAP2 1 #define HAVE_ELF_PLATFORM 1 #define HAVE_ELF_CORE_DUMP 1 =20 -typedef abi_ulong target_elf_greg_t; - -#define ELF_NREG 34 +/* + * See linux kernel: arch/arm64/include/asm/elf.h, where + * elf_gregset_t is mapped to struct user_pt_regs via sizeof. + */ typedef struct target_elf_gregset_t { - target_elf_greg_t regs[ELF_NREG]; + struct target_user_pt_regs pt; } target_elf_gregset_t; =20 #endif diff --git a/linux-user/aarch64/elfload.c b/linux-user/aarch64/elfload.c index 00550f9fdf..07a0c3f844 100644 --- a/linux-user/aarch64/elfload.c +++ b/linux-user/aarch64/elfload.c @@ -349,13 +349,12 @@ const char *get_elf_platform(CPUState *cs) return TARGET_BIG_ENDIAN ? "aarch64_be" : "aarch64"; } =20 -#define tswapreg(ptr) tswapal(ptr) - void elf_core_copy_regs(target_elf_gregset_t *r, const CPUARMState *env) { - for (int i =3D 0; i < 32; i++) { - r->regs[i] =3D tswapreg(env->xregs[i]); + for (int i =3D 0; i < 31; i++) { + r->pt.regs[i] =3D tswap64(env->xregs[i]); } - r->regs[32] =3D tswapreg(env->pc); - r->regs[33] =3D tswapreg(pstate_read((CPUARMState *)env)); + r->pt.sp =3D tswap64(env->xregs[31]); + r->pt.pc =3D tswap64(env->pc); + r->pt.pstate =3D tswap64(pstate_read((CPUARMState *)env)); } --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756574631; cv=none; d=zohomail.com; s=zohoarc; b=MNM6LNH3oVf2KIWSN9pBIqSfRaH1KSUXyEJa3+D0eRRBiJj/PnxP/RknQxAmj65Rr6l/98zFUpqdJ06Im78mt5XxREIixD4bkDGiIfTi1uD2SMkoMCA/L7xI1E2S1LiogPwdI4X+jmNpNeUECXUwnAn4ATi4vroYiuTSBry4qSE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756574631; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=j+3RJP5x9tU8ncpZPQyYYeZqq72wzhFyUN/VD6LAv/I=; b=izNWC2+ym8TUphxBB7TaLY6/OOuws1m6tIuQftmAQwvQu+HYvNNwaAUHnzgZfbRORVQZw40Dn2tmTq/xORJCRiyplebf27t9BVqtjAbzcUxrU8l3mzQ6J1OjLNjBvmpqX8wvlO0722Soun0veOUlbWrPm7uUyKOtPnKEvgf+p+w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756574631046431.76174780918325; Sat, 30 Aug 2025 10:23:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNjE-0006JF-EO; Sat, 30 Aug 2025 11:42:56 -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 1us7aw-0004GH-TT for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:18 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7av-0003XX-1b for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:18 -0400 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-249036375a1so12721175ad.2 for ; Fri, 29 Aug 2025 15:29:16 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.29.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:29:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506555; x=1757111355; 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=j+3RJP5x9tU8ncpZPQyYYeZqq72wzhFyUN/VD6LAv/I=; b=odsO8lIG0nWpn+1MgQfxjtN2I0Av9zQAaWYr9NZpZNJiMFUvxEyC0sXDkMxXAzV13B qTBdwfiF0YmImM2gZ62hxpLI2AkqyhSUK/eAJgP37IQ3bFZ+gYpgER8lmhBp541gcPAC fWY8rrtmOvTl7auZZRRzfz7dXJWjS6JuR0tmrvjLGNbFKQrQ1TqdtygdKHDTSSnJeHkb a0lnVdcdP5rJdTy8km6LODM5F6NG7ETTCYCnwSXwVy6s3xmGzgwqly2koepTolQzgHRv 4tE5kwzh2t04RlKZIcBsgrehWZeDgePYTw2XC1PncWtPX7NU558/iZdD3ywO15smeyXQ laaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506555; x=1757111355; 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=j+3RJP5x9tU8ncpZPQyYYeZqq72wzhFyUN/VD6LAv/I=; b=M05SopPDPsMdyzPpgWCDO4Nc3ROATXeATpo1/uuDc4VGNtCcdhanju0oLFWngNFOA+ MWmkfMj8T5cQKgUV+GjK4SOJZxWyOYFkUc+mIHXzwzf3CKDTrUv5NBhXPzLcOftoGrEF JTIr+Ntg6aKpP9XBUGINpOBGKbDAlhoMmhHTbMnD+bQwuCp9lsXKVuGht+XqlYnmWA5M sIotoMPXI+LM0atMLYCxCpFebLwnpJPE7m1F15cG+8gClcjeQGjekbItxLyWu2GQFGlY VEqDv3DTxaUaF6BUtGksw5rHCfG38evx+yh/TOU5a6YaQxHa5f2bscPOmVGhGN5Oj45K Ee9Q== X-Gm-Message-State: AOJu0Yxat+nzalbswb8Uq+w+9e7oUI09QftwBNnyY/Ro+pal1eCMRCCH o9krLfLrdWACM59fuKVNYKxYsmrW1/uWlmFiHrkgWC1gZ/CTEkluYL1AsxVqUNhNXmChDEhvTGf KcxFheqc= X-Gm-Gg: ASbGncvqRrKf3xHsPb+WgJsni7aS8JIffcWTXRkKtGx4i+brDLRgJ+15W58Rz6fsFxz vJiuELNPxruYrt7W7Tbw5ZRDKPpmJ9MHX7S+5PY3mOWHfnIFWKZ9HDCx0vjVDdug95vgqt0u3LM o4w9NaL4R+UB9lbyfE+LJij9k4K+RX2IEy2Qn8S+eMPt8loTMk4Mr5cT9y+lCWLvINvXC4uzjQb rXAahafxtdFbSL+KkLga0A0AQ7yrHB4uwVZHq50a+kWJDq19H3AjE9HdwLluUuC+AFTx6hjAYCM RN02kYZSho7Tj6wVfIrpXHVjqdgmwtj7b3FQnJyk3y7CIroE4lwehg7/LRft6f/pGSQPNHzVdlS beeoxoxOlv9Lsq4PpYeV0lwF1JAQPvBhqZx32K37XFmXXgsH7O/6Znnx9FupN58INv4eI3jo2Hl wTwFvDtefn X-Google-Smtp-Source: AGHT+IHnjkNG9qt5wJsnT0QLChkzMgJgJveOKVma1uWzbaIb7ST5IP9yKEaEtSMsw4l8C0lSqX+sBw== X-Received: by 2002:a17:903:3c45:b0:248:f762:865b with SMTP id d9443c01a7336-24944b196e1mr2620265ad.28.1756506554857; Fri, 29 Aug 2025 15:29:14 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 41/91] linux-user/arm: Create target_ptrace.h Date: Sat, 30 Aug 2025 08:23:37 +1000 Message-ID: <20250829222427.289668-42-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756574632780116600 Content-Type: text/plain; charset="utf-8" Move the target_pt_regs structure from target_syscall.h. Replace the array with proper structure fields. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/arm/target_ptrace.h | 16 ++++++++++++++++ linux-user/arm/target_syscall.h | 8 -------- 2 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 linux-user/arm/target_ptrace.h diff --git a/linux-user/arm/target_ptrace.h b/linux-user/arm/target_ptrace.h new file mode 100644 index 0000000000..1610b8e03c --- /dev/null +++ b/linux-user/arm/target_ptrace.h @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef ARM_TARGET_PTRACE_H +#define ARM_TARGET_PTRACE_H + +/* + * See arch/arm/include/uapi/asm/ptrace.h. + * Instead of an array and ARM_xx defines, use proper fields. + */ +struct target_pt_regs { + abi_ulong regs[16]; + abi_ulong cpsr; + abi_ulong orig_r0; +}; + +#endif /* ARM_TARGET_PTRACE_H */ diff --git a/linux-user/arm/target_syscall.h b/linux-user/arm/target_syscal= l.h index 412ad434cf..8c4ddba717 100644 --- a/linux-user/arm/target_syscall.h +++ b/linux-user/arm/target_syscall.h @@ -1,14 +1,6 @@ #ifndef ARM_TARGET_SYSCALL_H #define ARM_TARGET_SYSCALL_H =20 -/* this struct defines the way the registers are stored on the - stack during a system call. */ - -/* uregs[0..15] are r0 to r15; uregs[16] is CPSR; uregs[17] is ORIG_r0 */ -struct target_pt_regs { - abi_long uregs[18]; -}; - #define ARM_SYSCALL_BASE 0x900000 #define ARM_THUMB_SYSCALL 0 =20 --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756571216; cv=none; d=zohomail.com; s=zohoarc; b=iUDjg5AvWOeRqgKOuSj9nUCZpng8bEb/zoCZRz/AOofG4yb/54MCgSuljJmtTKPU6OAECK5skjWmE3eRaePqhDyKXhpRVPi3OCpnyTEPviHg3MgTJdGRTKNPzqF2EQUTp/SItdx8a1EM7TSMsO6yXTtjKThX54aGf7vUun8T/Fs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756571216; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=AP3J9qKby1OMNQJiAFiOcVBRXyp/SS6GtQpkHS/dPHw=; b=JlqVtmTcJ0P/fdhaKH8pfBr/LTcz6W4w4WknZ2IW1EMdhvFq41LxdTW7KD+AYEkomlvS1p887UGlnaBpuGcqwVZfRc8v7xjHD8oxVI3dKZkD/K+mfUPtXUiIRyaplpeFbS+4gI2n1LiBtXyMS9jSSPTAgnleOMc7Wa7BGAQYg/8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756571216545317.8380472854477; Sat, 30 Aug 2025 09:26:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNl3-0003zQ-Gm; Sat, 30 Aug 2025 11:44:49 -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 1us7ay-0004HU-N6 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:20 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7aw-0003Xz-Lw for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:20 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-772301f8a4cso1240832b3a.3 for ; Fri, 29 Aug 2025 15:29:18 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.29.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:29:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506557; x=1757111357; 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=AP3J9qKby1OMNQJiAFiOcVBRXyp/SS6GtQpkHS/dPHw=; b=idEMasJF1UxIZoUo5ZMfNFn2ts05OLUqT+u1sFdssQJPFLrOErWKDPf6Cbft/TNHuV qtegpkGlq9a8i2tMADsXERsm6JceMaIo5o8A4AKz1oIfJLSaubxsaNy3EXPorCnpvN11 F/9q005U+Yy62EpAeDBXk3cS1pl5VlVKhgh1gkjYoeOYsCiXSAolqnF2BhmLGvZMBpnt YC5599NxKnZSpuVfu/JfaHWKX5SyCX54B1id/pW4bXbqYe2Fona5AGPpB5gdGnzVRU/R EAdaq5SHV7WV5ItJazY7NjBn4aIu5cQ+eTSL3pKNmTqjW7+9vswjItUYz3XHbbbioihw nyWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506557; x=1757111357; 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=AP3J9qKby1OMNQJiAFiOcVBRXyp/SS6GtQpkHS/dPHw=; b=BnUKFUJEHOkJt6Ma0GGq2m55RbJh5eVWwOOQDPJUdOdEK3B17Ftp7wsNF+UWs8z/ry sHANd+uTq0sDYRe0u++oStQGIzfRbynZTqxh/djJBs9TmeqYKHoxEW2RXaZPyDJqKQgj uQbDMYNKkQbdVcvJ/CIqHYMBzVCbVLAEdNg8+jPQ7MUDM6B5wGmPfxBWrpwAXNBlfxwz pVFltlOgC9XDI5Z/tuhH55ZwErOj8WblheVKnJEGDp4ByktXsxxpkRvefiqNt1Iu0Ga4 UejaTnjsJFHfDNdXYOdxPO+ntHtq64GRL3lnT5T7veYIj9NtJalvD/ioICp0J0DI4DkU UUnQ== X-Gm-Message-State: AOJu0Yw0vBsOOcYWgE5zL3N0BZJBc1D8I0ZylAd/Um4YLRRuyA4+gT5F OM2umj87YZecFhwbf17ROkNQnm6WgSrqpIQrSsjpZ2KO7Xt4h01JSSOqcF+XtNKhwVtyZFfPuvp D+bdNUSY= X-Gm-Gg: ASbGncsS7NxpyLPTeCOVmIVlqn5gPvtw1ETeEzzizBDMED+1zEOOJOddWEc1PoWMq+q N/EgJinbsgLGUoC3abqibP7aTSI0gcJC+CjX7YvpQIOJwrf0pufrdtda+XkrEhXF6nIwK5YvPf1 62PJeLgYBuzHrSIL0DcQQeFjAhkPnoA2IDR+EiKJ0DlRFjDk397ukjwPU2iQ5OesCMHQYCzhsq5 z5Gtxo8bczWXf1LdWg3ZGO+CvGpVEpkxK8YVKxFhkK2YHyuOQnokJtMM5hnj6kvTv5vc5cGNc9R AE1AaXVK9eMHIcq85QppKnu7fYDtoFCBQasU3pDQHit/d1HEg8U7VpRYE5Q8Vuij1/uHPwQUxdo wspoVuDRMPmgbgUvPmYbS2kEUwPqT5QfaAfCeziw1FK/qb4AK7QKjoKa2+AYXNTCN9YVpqOqhEg == X-Google-Smtp-Source: AGHT+IEa6eetv8ynUcsmbNH8zrqpnfWr8q0f7fSa1pkpk2Z3R0PRtnHqZyrSq22QUPAcuoXympBM9A== X-Received: by 2002:a05:6a00:4fcd:b0:76b:f0ac:e7b2 with SMTP id d2e1a72fcca58-7723e276f61mr292009b3a.13.1756506557215; Fri, 29 Aug 2025 15:29:17 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 42/91] linux-user/arm: Expand target_elf_gregset_t Date: Sat, 30 Aug 2025 08:23:38 +1000 Message-ID: <20250829222427.289668-43-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756571217767124100 Content-Type: text/plain; charset="utf-8" Make use of the fact that target_elf_gregset_t is a proper structure. Drop ELF_NREG, target_elf_greg_t, and tswapreg. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/arm/target_elf.h | 11 +++++++---- linux-user/arm/elfload.c | 8 +++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/linux-user/arm/target_elf.h b/linux-user/arm/target_elf.h index 94db3738e8..fa8f8af2f3 100644 --- a/linux-user/arm/target_elf.h +++ b/linux-user/arm/target_elf.h @@ -8,16 +8,19 @@ #ifndef ARM_TARGET_ELF_H #define ARM_TARGET_ELF_H =20 +#include "target_ptrace.h" + #define HAVE_ELF_HWCAP 1 #define HAVE_ELF_HWCAP2 1 #define HAVE_ELF_PLATFORM 1 #define HAVE_ELF_CORE_DUMP 1 =20 -typedef abi_ulong target_elf_greg_t; - -#define ELF_NREG 18 +/* + * See linux kernel: arch/arm/include/asm/elf.h, where + * elf_gregset_t is mapped to struct pt_regs via sizeof. + */ typedef struct target_elf_gregset_t { - target_elf_greg_t regs[ELF_NREG]; + struct target_pt_regs pt; } target_elf_gregset_t; =20 #endif diff --git a/linux-user/arm/elfload.c b/linux-user/arm/elfload.c index 47fe16a1a6..f811c2f07a 100644 --- a/linux-user/arm/elfload.c +++ b/linux-user/arm/elfload.c @@ -201,13 +201,11 @@ const char *get_elf_platform(CPUState *cs) #undef END } =20 -#define tswapreg(ptr) tswapal(ptr) - void elf_core_copy_regs(target_elf_gregset_t *r, const CPUARMState *env) { for (int i =3D 0; i < 16; ++i) { - r->regs[i] =3D tswapreg(env->regs[i]); + r->pt.regs[i] =3D tswapal(env->regs[i]); } - r->regs[16] =3D tswapreg(cpsr_read((CPUARMState *)env)); - r->regs[17] =3D tswapreg(env->regs[0]); /* XXX */ + r->pt.cpsr =3D tswapal(cpsr_read((CPUARMState *)env)); + r->pt.orig_r0 =3D tswapal(env->regs[0]); /* FIXME */ } --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756570731; cv=none; d=zohomail.com; s=zohoarc; b=mLBIJu3L+8Vcd8Gfqd5RrlXTe+ZMtI81U9nNrcJknWl1KRjugth1FAhgj/7RLHVqH3DpXQLEMxZb+RbD2e4Oci2hkX+JZMwLtAGoYFgq40XMivfDet0/Intdv66QwiSBDEsDM/HKu94mxk/bA4YY7NP7oGeqHaJ/I6mln9EgJ0s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756570731; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=H3bbg5AFbtq7L124G12DBzxKL6BZSQnnF4rpCn0+fQQ=; b=hsMYdIlU627Hx7uyPfMLU88D0gnRgYMKgLXLaZXGNcQidcJAQThAZ4S+tV2WX1oBhRygH3c4ueIyWvHrYAUz6lzrCt9KcXaXyi/rY1YrGHo8WIHK/7xAuYum1g1OkKWqvBcvHVq9c1dYxYpeDuhzg1OHyaaeIYBe+uMXk3x7ybA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17565707312501002.0038164647895; Sat, 30 Aug 2025 09:18:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNjJ-0006dE-Vq; Sat, 30 Aug 2025 11:43:02 -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 1us7b1-0004IX-9q for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:23 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7ay-0003Ya-Ui for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:22 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-7722d6cc437so1101894b3a.0 for ; Fri, 29 Aug 2025 15:29:20 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.29.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:29:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506559; x=1757111359; 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=H3bbg5AFbtq7L124G12DBzxKL6BZSQnnF4rpCn0+fQQ=; b=DMXgba/Y32nvdowNn85vQdT++nRmNTiwUALWdkF0CabDCufV/XqTIlHaGFTUKJfwHB J6APvuNtMFQXznKEfgEXfTTzjtW46m9nRDYxirq/c9YOymjdTFzfu/BJ1OfUDtXg0tr/ S1Uun8EuNKfCoLUEVf6nSBgu0GQ0OyEVR7TgKdkWMLEFGyrhdO3fSDX+APEwieNF8+4Q tplkWrCJCfw8EwedZu08rGQ4JApD+w7ct6xXKq6e6hQXIniH4Ghs5TpLntxpOmHVlUyE IJHRU1vhPeVDjjZP5UC1VSXM8IUqYpjWIjJXXcKR8BP1Ot14rnj9nAMvXKbjOaorwCEq zInA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506559; x=1757111359; 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=H3bbg5AFbtq7L124G12DBzxKL6BZSQnnF4rpCn0+fQQ=; b=bu4huavl88Nz9eug6NpeFo52Aj5Y2aTsmTyt3J/dZpo7USiYufB5p+ckmnBu35Kpyd 2Kfse7pKPpr4lqXx+b00elf+tBrAuASTE+QKNr1BnlN0ugvBkAA8/swsuWZIa5PEEfN3 stsurGDjBA3rzE9rBxXYZ0RHq+ZyHAvVR08NsCnxKQcY8q+qXPLeBXEt4ZIeOCbTp57N IWCKynWBFDIYrMqoKAhR+zHtH1qkS1nNNKCIjpmuZb8yD8+YO6u0Ly6kFWLX1GPmlE18 L62Mc4QLpwzE/gNH6QiuuT1VpweHlnO3XS931g0sjClXzWnm39CUl/Wj3sUXuEgJ16EK pCvg== X-Gm-Message-State: AOJu0YxhTExXCdMdIY9AyTy/lKfNebmBlODU0oA2eMRKhObjDB1hEZbp XysIcsk2j3/vxZt8dvacc+wYEp/o0/wozXTVvKZU0FmmU8YYUfrXRmS5QEl9PeZOKxGIbHVBi6b bGWcyER0= X-Gm-Gg: ASbGncukv48EKO0RbGSj965vcLUuYv8CRhwim8/ZN88lA09hd8sIPyV+5xYLEZsYc5v h2nkkpUruqyIZsiSIqJZq6vnV2uNmRN86z6LV+6cd6VFLv9ZDApWpuvtG+5bf6ymNT49wAbIYKU LyRYOCV4g7jTJ1IzXu3PQr5UExN9TWUgRltmCZ0DXInuNXxCKxfR9L6vT1KSvxijexqAg4ylDc4 +PA4tMM1KM97NPoxe6ktdUx7IQRdWG/lAha8oViuCriVs+PHwA7buqOTJlXCH2DMfIhKdr95i18 8QWfrXDYHYeR+5U250NJkG9CRrDJ3FtgPCQzUzhK3ywdohmLNIOEemPhPMnwpw49OasC1G8yCrq NbbE2In1/75RRsl+G/aIrHl16k7bAHg4xuX6BMQzoDrFuPCRRdK1CkbGB2n8BF7UIZh5zGqkGRQ == X-Google-Smtp-Source: AGHT+IHZH9yj4SO2nAArUVD5Zzc5trfglirqg9hnQu/xVYDW05WmMa4JJ8bupAaqQ/WTqiHbWJHZvQ== X-Received: by 2002:a05:6a00:138e:b0:76e:7ab9:a239 with SMTP id d2e1a72fcca58-7723c5c841bmr974296b3a.16.1756506559445; Fri, 29 Aug 2025 15:29:19 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 43/91] linux-user/loongarch64: Create target_ptrace.h Date: Sat, 30 Aug 2025 08:23:39 +1000 Message-ID: <20250829222427.289668-44-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756570732302116600 Content-Type: text/plain; charset="utf-8" Remove the target_pt_regs structure from target_syscall.h. Add target_user_pt_regs to target_ptrace.h, which matches what is actually used on loongarch64. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/loongarch64/target_ptrace.h | 15 +++++++++++++++ linux-user/loongarch64/target_syscall.h | 23 ----------------------- 2 files changed, 15 insertions(+), 23 deletions(-) create mode 100644 linux-user/loongarch64/target_ptrace.h diff --git a/linux-user/loongarch64/target_ptrace.h b/linux-user/loongarch6= 4/target_ptrace.h new file mode 100644 index 0000000000..2578e09207 --- /dev/null +++ b/linux-user/loongarch64/target_ptrace.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef LOONGARCH64_TARGET_PTRACE_H +#define LOONGARCH64_TARGET_PTRACE_H + +/* See arch/loongarch/include/uapi/asm/ptrace.h. */ +struct target_user_pt_regs { + abi_ulong regs[32]; + abi_ulong orig_a0; + abi_ulong csr_era; + abi_ulong csr_badv; + abi_ulong reserved[10]; +}; + +#endif /* LOONGARCH64_TARGET_PTRACE_H */ diff --git a/linux-user/loongarch64/target_syscall.h b/linux-user/loongarch= 64/target_syscall.h index 39f229bb9c..f7ced7b2be 100644 --- a/linux-user/loongarch64/target_syscall.h +++ b/linux-user/loongarch64/target_syscall.h @@ -8,29 +8,6 @@ =20 #include "qemu/units.h" =20 -/* - * this struct defines the way the registers are stored on the - * stack during a system call. - */ - -struct target_pt_regs { - /* Saved main processor registers. */ - target_ulong regs[32]; - - /* Saved special registers. */ - struct { - target_ulong era; - target_ulong badv; - target_ulong crmd; - target_ulong prmd; - target_ulong euen; - target_ulong ecfg; - target_ulong estat; - } csr; - target_ulong orig_a0; - target_ulong __last[0]; -}; - #define UNAME_MACHINE "loongarch64" #define UNAME_MINIMUM_RELEASE "5.19.0" =20 --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756572333; cv=none; d=zohomail.com; s=zohoarc; b=D4QFdgb/j+cpp1DY5YnauOpDIIJ7TzeP4IWPlHiOogVJJn/KsNpVejaelrf3joOktpxBTnFCO0oL6ESyWHjMv6BXlDh0Iq+Ruyc9ITVI7Dfh3kw4tblpEz/A1N/XG2MprSTu7o0gJo7Y3LXhJeLMZcOUzI+cm6D/z0VXfXsjGSA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756572333; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=44Ix+VHgXVTpI6uZhrpTffYIwF1OKTl8a2mFmzwrnbA=; b=b1NgodFF5vkDhvqs+WtBU8G4jEAFU05gwapvhnvCBaVP5i0nsU1zJBAaIu93kFMv+ipzGHVjxvjK3Y3lCgfC2RJgC6Rhq1/yyAHTy5Pp9AR3kdOGQhVq++nI+piJueAB21H/3zjsCC6llw9ud2AUstdIIHO3U3NypT7DSs2lVZI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756572333547939.5728692720445; Sat, 30 Aug 2025 09:45:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNjj-00074r-Le; Sat, 30 Aug 2025 11:43:29 -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 1us7b3-0004JK-Ge for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:25 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7b1-0003Ys-Kd for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:25 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-77238cb3cbbso566798b3a.0 for ; Fri, 29 Aug 2025 15:29:23 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.29.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:29:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506562; x=1757111362; 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=44Ix+VHgXVTpI6uZhrpTffYIwF1OKTl8a2mFmzwrnbA=; b=OUWxlZeXhQ+OksSL4Wv5+uLAkNRNtx+7SQJgC+Svoqkw/czbOuYpNv2F1uH7VqpNqv 50JsGbh5VYMwgt/QnZBrYZQYC7+8nQzebNuNzyFvRUrz3KNjZ/BJrao+Wopexu7jT6YP gY4+jEJ08OSSMVbU4D9cHv0UVuR5DTAytcupncI70bzYzVoZ0VWs+xpYNqTIok1f8arh e4xW8D2pVXfBlJhDX7QjFplpJIZqwoCS5b6FHA+jX/WgwvZCm4p/DnRgqILCBwRCXGrR h6EOsSz4Skd5W82kN9q6tXCfeylSAfftxfzkmd73gI9snuP/BW5sxeeqmtla0a9B3yXZ grfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506562; x=1757111362; 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=44Ix+VHgXVTpI6uZhrpTffYIwF1OKTl8a2mFmzwrnbA=; b=JdhMfGtSD8tWv1r/ThfJjIU0OD4nSgy1mCr110wX1+P2Bb4VUYUZaGmnSVPCnSro5w p1xSP4jfa3wu+E+cKN0z3RdlBXYzsJ5gD94cEAY5AJO0vFhkjtKIEkCtmJc/2kNaeJAb UObZZWL65NcNUfZm4bXpOHcXgHKAc64j8MmY5mq1Utt0UIEa/429qv6MzOvgv0rtgwWK Bu6hnqnpZyTBKzl/z7d8ADPGOvzquiTTUFMzGliwpl2i6qgOMBJ85qOO1kiAjO13eKxW S09KNhmHg5JdqDDBISzZLFJS+TA0WMI84mZqV4V8yt43mUyOGQeiwXXP3u/Wj1OzCQIs 3FAg== X-Gm-Message-State: AOJu0Yybqjh3zSdcLg4At/+gRZMG25VVaEK0k0W4VP3SIhidbUeGYnpP TyQ2h4QBgXFMezFgTvYWBfWXwbya68Xwjf7nPMX68+5vbLxeECE+Qt1V992jWmVonHl7ztAiVmT dG/8IyHA= X-Gm-Gg: ASbGnctSL9qtBKFza4Ky6m3Xk6BDqw0Lnwl1OGb/wckV8spXVXNzvXuIWRmZF1z+C6U YVJeeEfdU9z422Y51fF2YUi6tFZkBiZ82Bgp2DDKmEYg4DoBIHSauVH7V+d9ubd6xTUXbHZ7w8q wlc6drnPZvlkqpXMB1VJ4IHhupXCuSgcIausUnYyKcUjTRXTVX7DLk5SWOriaUCeKUWW6BLdPy4 /TqdtSwHEUaGtHRjriQx+raCwcvi7JsyBWCT41d98yn/Qwvn4ROA/6iSYhchaXAUvydA2MXy/ew VJFxzQnpDSPzQBlnhzZP/7mtJYSqY0bnwQhDH9vDshhYnl1lQX7QR+wxZTUOMg5Co9ZUi1sMI3Z MMl8G59pCBdlSNiK6FVD+fNdzQu0r6gt2smmeoWReze71XK/dYDYaqbDbRHwQipyZvZ3C3ITLQQ == X-Google-Smtp-Source: AGHT+IGnVXiRIPZQD6tCla+NrBkNO6hf6RTbibcT5TPifnoijN2zqamSCKFRSja+5zU/FWDGzb5FCg== X-Received: by 2002:a05:6a00:2ea1:b0:772:2869:14d3 with SMTP id d2e1a72fcca58-7723e376d64mr238317b3a.20.1756506561711; Fri, 29 Aug 2025 15:29:21 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 44/91] linux-user/loongarch64: Expand target_elf_gregset_t Date: Sat, 30 Aug 2025 08:23:40 +1000 Message-ID: <20250829222427.289668-45-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756572336316124100 Content-Type: text/plain; charset="utf-8" Make use of the fact that target_elf_gregset_t is a proper structure. Note that the kernel's uses an array, and then it has a bunch of defines to create symbolic offsets. Modulo some reserved fields, which we do not implement here, this is the same layout as struct user_pt_regs. Drop ELF_NREG, target_elf_greg_t, and tswapreg. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/loongarch64/target_elf.h | 7 +++---- linux-user/loongarch64/elfload.c | 14 ++++---------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/linux-user/loongarch64/target_elf.h b/linux-user/loongarch64/t= arget_elf.h index 90bca4499d..1f40419af2 100644 --- a/linux-user/loongarch64/target_elf.h +++ b/linux-user/loongarch64/target_elf.h @@ -6,16 +6,15 @@ #ifndef LOONGARCH_TARGET_ELF_H #define LOONGARCH_TARGET_ELF_H =20 +#include "target_ptrace.h" + #define HAVE_ELF_HWCAP 1 #define HAVE_ELF_PLATFORM 1 #define HAVE_ELF_CORE_DUMP 1 =20 -typedef abi_ulong target_elf_greg_t; - /* See linux kernel: arch/loongarch/include/asm/elf.h */ -#define ELF_NREG 45 typedef struct target_elf_gregset_t { - target_elf_greg_t regs[ELF_NREG]; + struct target_user_pt_regs pt; } target_elf_gregset_t; =20 #endif diff --git a/linux-user/loongarch64/elfload.c b/linux-user/loongarch64/elfl= oad.c index 832890de10..ce3bd0c607 100644 --- a/linux-user/loongarch64/elfload.c +++ b/linux-user/loongarch64/elfload.c @@ -65,20 +65,14 @@ const char *get_elf_platform(CPUState *cs) =20 #define tswapreg(ptr) tswapal(ptr) =20 -enum { - TARGET_EF_R0 =3D 0, - TARGET_EF_CSR_ERA =3D TARGET_EF_R0 + 33, - TARGET_EF_CSR_BADV =3D TARGET_EF_R0 + 34, -}; - void elf_core_copy_regs(target_elf_gregset_t *r, const CPULoongArchState *= env) { - r->regs[TARGET_EF_R0] =3D 0; + r->pt.regs[0] =3D 0; =20 for (int i =3D 1; i < ARRAY_SIZE(env->gpr); i++) { - r->regs[TARGET_EF_R0 + i] =3D tswapreg(env->gpr[i]); + r->pt.regs[i] =3D tswapreg(env->gpr[i]); } =20 - r->regs[TARGET_EF_CSR_ERA] =3D tswapreg(env->pc); - r->regs[TARGET_EF_CSR_BADV] =3D tswapreg(env->CSR_BADV); + r->pt.csr_era =3D tswapreg(env->pc); + r->pt.csr_badv =3D tswapreg(env->CSR_BADV); } --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756570535; cv=none; d=zohomail.com; s=zohoarc; b=g7VvUwqOtwa2HBG1BfoXt4uSVP1HNtGOiY5S1/GQRQf5H0+5wF1uO2R3Q2n/Fz8KlDXSt9Qimzo3eeS8w1QbH6Uw2BuFZJJilirfa5xFwVpBuwGfVhAmBS8DTqsEsZg3QBGU6/VPl1L0Iy0j9J05g3QXnMsKh5G4SPY3/ckOO7E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756570535; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=8jb6JFkIYnDNTTWSsePdZAuaMtcjYsIqbTSzxW0KOgk=; b=YTIL6GFzRCPAcnGRRdNrtO+rlxpLxQBdlBl+xsQpL+z7UzR559ZAkGN8JDei9NoCO6Pjs2ocxIw47OzXmJrCrpnguMeT5xvtUKFnFXa/cx1MwzJAKL4cl5yC11G2xaI3sSPjpKs8K/uRmAqTT9KnyWQxSV+7pe+J296xBM4t8KI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756570535779688.9789917687041; Sat, 30 Aug 2025 09:15:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNkr-0003B8-Kq; Sat, 30 Aug 2025 11:44:38 -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 1us7b5-0004Kd-ER for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:27 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7b3-0003ZM-GQ for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:27 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-76e4fc419a9so2756459b3a.0 for ; Fri, 29 Aug 2025 15:29:25 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.29.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:29:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506564; x=1757111364; 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=8jb6JFkIYnDNTTWSsePdZAuaMtcjYsIqbTSzxW0KOgk=; b=lwd517LhNnfs84tjRc4dd4KneZ9mFRQi4c/fBUj8NkwWbcaAa5jD6wVIlO2jBG8e8W lZNCqTCrjcv1rMPNRjenmsud7ayBkM2HmdjaDRduS9WT/aokt3LY4qoDamujkxYhtRvx agFQ/9Ur8RPAiC923wksQJYGAQQmCq/bcgwUgphuzJDq9s6CqjNSd9yD0IEWR9+Ht0L7 pPOLEPBnVWnSAYdjgQAMCNBRNvWZOTpMP3I37oUBOCrNygQM54ywKJXpKmo3byqNYLB2 kNYoInAES1OHlIGJxZrp5e/HfyhWflXGzCgXpKk9kPwBtvWwh5D+zrsSkGNrCgIOwMo2 3PnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506564; x=1757111364; 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=8jb6JFkIYnDNTTWSsePdZAuaMtcjYsIqbTSzxW0KOgk=; b=aSb9LYjQFBLXl867SEiyy1a/eq9YpcXYUaOqNjVlWiElrTbkspFwM+epF90es9mz3t e0g27r/dqI1N6+74R3dthEf+S3W0GQeg/ZP+BErnKgpwVOHwwqG1cKRJ2uUfjc9GokOU Dy+1uQe3WyyUS6MI39A6s8vyMwmCe5mRZu8cLPxJFMunK1FKFS4gr1CdsWUFUcT8YEoU aG8o3xaduzbAtSL74o/uAIxUMhuIBk6/fgEeqzvB6q1+wQ1C356aS1QVTMU8YK3sRSHV ab+xLB9mjCO+/n/qa+lJmRot6PkFlQDUJoH8ZoGVNy/3MPw5fx4M/Yu8+1JiRk7Re9xl i4pA== X-Gm-Message-State: AOJu0Yy+ztHWf6riRhE6g71gYTb56DBafAztGp4UGCfQqJS3mdeMP7Bv +ia1VDbi4PchuZM8oyz5rGn2ZD+i/2HnlQ+d2PTwjvjL7U/J7SO9BPwLZWkCBfFZvUPS6DuHjC2 Ha6abdBg= X-Gm-Gg: ASbGncs80n7lEDGUMorucK33vS7pjUjDaASF9pdAxKu5C3Q0PkQ9kQgJ1wIm99B7i6h 56aojsu+9/h3tSq/f/9Bonz/6fbqZRNtaXdv57RGf2D+IIM8DaO7kfvtT/lyowuOSpcZ7tStjJ+ 40avc/Gj6lecs/piUSjhhzsf8cVEHrGzIKEAWxgMzYxygOrAVEUJuEm/mhYGPcAKvPVZ7udC4BR mnFc3EK9altEPuAFfRlV+axJId1Rg2k+h4fT3QpmKW6gjJMkMTTa3hrImiHSuF34Xw+fWC82d11 u1dUOGrgevvWbLlGUvmILNBw1vQmX7cq9M1ZREUU6qddog8jVU7jyZCf7i5ZLobPvT6PXXWt6m8 SdOvmGIzUO7AmAqwcM7mCBQtIacG8AzdZADnMVVPZJYCCFOPI0wdybn4Nyy/7psqnzrsSvvaomA == X-Google-Smtp-Source: AGHT+IGTlrmk8JEz8CqYJzr+5/eGwYzuUpA9KHBUhOm51NWYExovweXMBNLlaxVLYVBiGy5pociGKw== X-Received: by 2002:a05:6a00:1709:b0:76e:987b:1dc with SMTP id d2e1a72fcca58-7723e275d14mr257706b3a.12.1756506563978; Fri, 29 Aug 2025 15:29:23 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 45/91] linux-user/m68k: Expand target_elf_gregset_t Date: Sat, 30 Aug 2025 08:23:41 +1000 Message-ID: <20250829222427.289668-46-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756570538190124100 Content-Type: text/plain; charset="utf-8" Make use of the fact that target_elf_gregset_t is a proper structure. Drop ELF_NREG, target_elf_greg_t, and tswapreg. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/m68k/target_elf.h | 24 ++++++++++++++++----- linux-user/m68k/elfload.c | 42 +++++++++++++++++------------------- 2 files changed, 39 insertions(+), 27 deletions(-) diff --git a/linux-user/m68k/target_elf.h b/linux-user/m68k/target_elf.h index cd6908ab57..0737412cee 100644 --- a/linux-user/m68k/target_elf.h +++ b/linux-user/m68k/target_elf.h @@ -10,12 +10,26 @@ =20 #define HAVE_ELF_CORE_DUMP 1 =20 -typedef abi_ulong target_elf_greg_t; - -/* See linux kernel: arch/m68k/include/asm/elf.h. */ -#define ELF_NREG 20 +/* + * See linux kernel: arch/m68k/include/asm/elf.h, where + * elf_gregset_t is mapped to struct user_regs_struct via sizeof. + * + * Note that user_regs_struct has + * short stkadj, sr; + * ... + * short fmtvec, __fill; + * but ELF_CORE_COPY_REGS writes to unsigned longs. + * Therefore adjust the sr and fmtvec fields to match. + */ typedef struct target_elf_gregset_t { - target_elf_greg_t regs[ELF_NREG]; + abi_ulong d1, d2, d3, d4, d5, d6, d7; + abi_ulong a0, a1, a2, a3, a4, a5, a6; + abi_ulong d0; + abi_ulong usp; + abi_ulong orig_d0; + abi_ulong sr; + abi_ulong pc; + abi_ulong fmtvec; } target_elf_gregset_t; =20 #endif diff --git a/linux-user/m68k/elfload.c b/linux-user/m68k/elfload.c index 2970ff7dec..423d1f680a 100644 --- a/linux-user/m68k/elfload.c +++ b/linux-user/m68k/elfload.c @@ -18,28 +18,26 @@ const char *get_elf_cpu_model(uint32_t eflags) return "any"; } =20 -#define tswapreg(ptr) tswapal(ptr) - void elf_core_copy_regs(target_elf_gregset_t *r, const CPUM68KState *env) { - r->regs[0] =3D tswapreg(env->dregs[1]); - r->regs[1] =3D tswapreg(env->dregs[2]); - r->regs[2] =3D tswapreg(env->dregs[3]); - r->regs[3] =3D tswapreg(env->dregs[4]); - r->regs[4] =3D tswapreg(env->dregs[5]); - r->regs[5] =3D tswapreg(env->dregs[6]); - r->regs[6] =3D tswapreg(env->dregs[7]); - r->regs[7] =3D tswapreg(env->aregs[0]); - r->regs[8] =3D tswapreg(env->aregs[1]); - r->regs[9] =3D tswapreg(env->aregs[2]); - r->regs[10] =3D tswapreg(env->aregs[3]); - r->regs[11] =3D tswapreg(env->aregs[4]); - r->regs[12] =3D tswapreg(env->aregs[5]); - r->regs[13] =3D tswapreg(env->aregs[6]); - r->regs[14] =3D tswapreg(env->dregs[0]); - r->regs[15] =3D tswapreg(env->aregs[7]); - r->regs[16] =3D tswapreg(env->dregs[0]); /* FIXME: orig_d0 */ - r->regs[17] =3D tswapreg(env->sr); - r->regs[18] =3D tswapreg(env->pc); - r->regs[19] =3D 0; /* FIXME: regs->format | regs->vector */ + r->d1 =3D tswapal(env->dregs[1]); + r->d2 =3D tswapal(env->dregs[2]); + r->d3 =3D tswapal(env->dregs[3]); + r->d4 =3D tswapal(env->dregs[4]); + r->d5 =3D tswapal(env->dregs[5]); + r->d6 =3D tswapal(env->dregs[6]); + r->d7 =3D tswapal(env->dregs[7]); + r->a0 =3D tswapal(env->aregs[0]); + r->a1 =3D tswapal(env->aregs[1]); + r->a2 =3D tswapal(env->aregs[2]); + r->a3 =3D tswapal(env->aregs[3]); + r->a4 =3D tswapal(env->aregs[4]); + r->a5 =3D tswapal(env->aregs[5]); + r->a6 =3D tswapal(env->aregs[6]); + r->d0 =3D tswapal(env->dregs[0]); + r->usp =3D tswapal(env->aregs[7]); + r->orig_d0 =3D tswapal(env->dregs[0]); /* FIXME */ + r->sr =3D tswapal(env->sr); + r->pc =3D tswapal(env->pc); + /* FIXME: regs->format | regs->vector */ } --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756570100; cv=none; d=zohomail.com; s=zohoarc; b=HPe/Q8jHd47uGkQXIF4hBy9r7QQOQRlGieK2Qft27g8zFIg34UMajTk8yZU0pNzMsHThV30Pl00u35kGTJ4+NF7tq/HQFjOtaSyQJxIaYznaTQnTGs7cxOIJiB4zop4xCKUNTdYyeN+bWEzCMgwoVtFsjOrjH0rLRPWSOu0TEYM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756570100; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=QlDgwUU7iro35Dw3IbxLfzqVXXSRk7ljNX2J//jX8Lk=; b=FBOsYUk3y1LTdCZY/DZDbIyJJo4Y/CNxSHAFmw70sCpMDXFQHA8RIpzmV0zRuPp1A3Q0Vuk65m5gname43ymikNiynPdBfhcNow/MoLtndnuO2tftLQqg32SPtKlOefpRMVJRduhhN7wGw1zk44WIGXRrDNfbCH3temntI6A4uE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756570100381738.8916659228591; Sat, 30 Aug 2025 09:08:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNkw-0003aY-CG; Sat, 30 Aug 2025 11:44:42 -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 1us7b8-0004Ld-33 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:30 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7b6-0003Zi-00 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:29 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-7723cf6e4b6so123868b3a.3 for ; Fri, 29 Aug 2025 15:29:27 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.29.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:29:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506566; x=1757111366; 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=QlDgwUU7iro35Dw3IbxLfzqVXXSRk7ljNX2J//jX8Lk=; b=pQfBJOaWVyce8wnBgUNMPY2ZgIXrmfSLZMjdmdtjDbMsusYjf2SiUpjhvh8azluuSV umjWQ08rlJqb9GUiO+JPSZ4xQOvo93x7gUMdIguSla9Rg2WyB/MhvM6iy6DzNOCw90vI tpifIH4nmipjMKfpaqgUTsLBsKO+mXqeODKHIkSCSguTOXmKWut6CGqi80APSST1OhN/ 0DybEjP5SW4EIgzQ563wRgUWfBDYXnRS9/GR82mTnmjF8f7633sRiTWUpL+h0cZIxBAE olD0tJbFGcSfoJni6MjY1T/ihLyUym4YQDKIWvaV6TsY5xEdy4FMxBmavjxAcvc2WQfT 4jRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506566; x=1757111366; 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=QlDgwUU7iro35Dw3IbxLfzqVXXSRk7ljNX2J//jX8Lk=; b=a5etd0Wz1FpSPqP4D9uA5S8SdQby6o0qfyuE7XXfTzl8SdnKbEwa7ooeR6Jn4TMzT+ UzsgZo4LT8OLoKAaiuyBoz7n+WukPm9P2Eq0jJVkk7lP6PUajopDgIawq02E2w+1UzX4 o6ElvzsRC+tkkwYFHgQKFn/KwHySJn0DTQKkxCOdjO9dQ1YRhGVHfiMAw4nnDbu+PoHH 6O3ZwzSxJoes6D+Ixxm2Pl4PffjyO671mvk5fNXfUxnIMjxge2IhSoQFwKUthU7Ua6gU KEJ8HPdcpAkO48e8LP/cclObdmErm3APsZKl0BwIv9LK1bya5scFvdKs9AKBc5s3JG82 lxjw== X-Gm-Message-State: AOJu0YwRRbvDc0ZUGCs7dQATQQ6MAgyvvp5TOHnGB3VC5JiU7IhXK3IZ 0vfaRimmBw7zxqi4BQ7C5O9gJaGqmcQBKWa5uwYU5e7V488G6yzJNKpQaidtJJhZSRXFj3hPGy8 U851bh7M= X-Gm-Gg: ASbGnctMRuCNBCjgKUJzJpPpCzo6zw1quXlVYqmXjjYoWMOo+NFq10jbEG83VysLD+V jgW+588OOlN+7w1BK1kDo+DeBWBsSzdwrpHjSUiuLxUJKCYaPDy/V/OmyEiLNCAW0GRsXmbLzTb 9m4FIUaFhMDEt9JbeSrQX2tApKDTKMH2n17VQO4VGnTS4imWgXqit1SSbcChk9ckcHET9owDV19 xMfEvCHZs0mAIsbha7EHSf10WB0lRAsLSp5gZYF/dmvNuubbbtoAv4aUDgQYqjiYUe7cejQTW6K TF1hYKzWZMrCh4Tj1VPhg43i1AceYdPlZLrEikYN6hJJy9jGM0y9mmCufdg/xRCBXyOWzbWxVgR SVfLcW/jh/MUKAEHrWTi8BWt/KMoj/bQuBqNTV7mbojbLxCycA+17H1uXC3xfgSs= X-Google-Smtp-Source: AGHT+IEiRtXICVGlbnYgCvBpAY9E3iqUaHqBIwhX1IEZLctmfAtdBySfTc5xasB/Dr3lGp9FYWJQgg== X-Received: by 2002:a05:6a20:3944:b0:243:be7c:2d62 with SMTP id adf61e73a8af0-243d6dd4decmr299835637.11.1756506566221; Fri, 29 Aug 2025 15:29:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 46/91] linux-user/microblaze: Create target_ptrace.h Date: Sat, 30 Aug 2025 08:23:42 +1000 Message-ID: <20250829222427.289668-47-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756570100956116600 Content-Type: text/plain; charset="utf-8" Move the target_pt_regs structure from target_syscall.h. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/microblaze/target_ptrace.h | 50 ++++++++++++++++++++++++++ linux-user/microblaze/target_syscall.h | 44 ----------------------- linux-user/microblaze/signal.c | 1 + 3 files changed, 51 insertions(+), 44 deletions(-) create mode 100644 linux-user/microblaze/target_ptrace.h diff --git a/linux-user/microblaze/target_ptrace.h b/linux-user/microblaze/= target_ptrace.h new file mode 100644 index 0000000000..a46c8cb7bc --- /dev/null +++ b/linux-user/microblaze/target_ptrace.h @@ -0,0 +1,50 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef MICROBLAZE_TARGET_PTRACE_H +#define MICROBLAZE_TARGET_PTRACE_H + +/* We use microblaze_reg_t to keep things similar to the kernel sources. = */ +typedef uint32_t microblaze_reg_t; + +struct target_pt_regs { + microblaze_reg_t r0; + microblaze_reg_t r1; + microblaze_reg_t r2; + microblaze_reg_t r3; + microblaze_reg_t r4; + microblaze_reg_t r5; + microblaze_reg_t r6; + microblaze_reg_t r7; + microblaze_reg_t r8; + microblaze_reg_t r9; + microblaze_reg_t r10; + microblaze_reg_t r11; + microblaze_reg_t r12; + microblaze_reg_t r13; + microblaze_reg_t r14; + microblaze_reg_t r15; + microblaze_reg_t r16; + microblaze_reg_t r17; + microblaze_reg_t r18; + microblaze_reg_t r19; + microblaze_reg_t r20; + microblaze_reg_t r21; + microblaze_reg_t r22; + microblaze_reg_t r23; + microblaze_reg_t r24; + microblaze_reg_t r25; + microblaze_reg_t r26; + microblaze_reg_t r27; + microblaze_reg_t r28; + microblaze_reg_t r29; + microblaze_reg_t r30; + microblaze_reg_t r31; + microblaze_reg_t pc; + microblaze_reg_t msr; + microblaze_reg_t ear; + microblaze_reg_t esr; + microblaze_reg_t fsr; + uint32_t kernel_mode; +}; + +#endif /* MICROBLAZE_TARGET_PTRACE_H */ diff --git a/linux-user/microblaze/target_syscall.h b/linux-user/microblaze= /target_syscall.h index 43362a1664..66f5a9ebe2 100644 --- a/linux-user/microblaze/target_syscall.h +++ b/linux-user/microblaze/target_syscall.h @@ -4,50 +4,6 @@ #define UNAME_MACHINE "microblaze" #define UNAME_MINIMUM_RELEASE "2.6.32" =20 -/* We use microblaze_reg_t to keep things similar to the kernel sources. = */ -typedef uint32_t microblaze_reg_t; - -struct target_pt_regs { - microblaze_reg_t r0; - microblaze_reg_t r1; - microblaze_reg_t r2; - microblaze_reg_t r3; - microblaze_reg_t r4; - microblaze_reg_t r5; - microblaze_reg_t r6; - microblaze_reg_t r7; - microblaze_reg_t r8; - microblaze_reg_t r9; - microblaze_reg_t r10; - microblaze_reg_t r11; - microblaze_reg_t r12; - microblaze_reg_t r13; - microblaze_reg_t r14; - microblaze_reg_t r15; - microblaze_reg_t r16; - microblaze_reg_t r17; - microblaze_reg_t r18; - microblaze_reg_t r19; - microblaze_reg_t r20; - microblaze_reg_t r21; - microblaze_reg_t r22; - microblaze_reg_t r23; - microblaze_reg_t r24; - microblaze_reg_t r25; - microblaze_reg_t r26; - microblaze_reg_t r27; - microblaze_reg_t r28; - microblaze_reg_t r29; - microblaze_reg_t r30; - microblaze_reg_t r31; - microblaze_reg_t pc; - microblaze_reg_t msr; - microblaze_reg_t ear; - microblaze_reg_t esr; - microblaze_reg_t fsr; - uint32_t kernel_mode; -}; - #define TARGET_CLONE_BACKWARDS #define TARGET_MCL_CURRENT 1 #define TARGET_MCL_FUTURE 2 diff --git a/linux-user/microblaze/signal.c b/linux-user/microblaze/signal.c index f6d47d76ff..7aef781314 100644 --- a/linux-user/microblaze/signal.c +++ b/linux-user/microblaze/signal.c @@ -21,6 +21,7 @@ #include "user-internals.h" #include "signal-common.h" #include "linux-user/trace.h" +#include "target_ptrace.h" =20 struct target_sigcontext { struct target_pt_regs regs; /* needs to be first */ --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756571266; cv=none; d=zohomail.com; s=zohoarc; b=nvsAKbZqAms97dBGnpFoukqQCGReAl37LxUivf5L/WerwMyXW5lc8E33n0rJK3FgK6oSY5uh+H5yCoQiH8oZQYHUW6wqmUf9sUFKXR0jzkiH0N6cK3x5qc08fFvztk3g6uMpeRVKRoYkvsxlpDpwEcCLci+NTYoUeM5xEGlet3U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756571266; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0b8XApD11uS49cAycox2dUykst7Wjzbv/b7G4vIsl14=; b=U0ZUXy2r0xq7yXbj0Vf119sDbWTL1a4NP4Ze11hYw7nkR49RN3BvpGd7p6+k1vZOoncQLpq+36aYnnxNcqhgqjNrDg2qo0Bso215mJdKHHMrtp4Xj9nVsFS0uSShILA+AqwSw0VK6blTarQe7HR1VZDNt3G1XB4fsZr5mWaUNj4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756571266470806.1650345463896; Sat, 30 Aug 2025 09:27:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNky-0003nU-Jh; Sat, 30 Aug 2025 11:44:44 -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 1us7bA-0004MI-LJ for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:32 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7b8-0003a5-J3 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:32 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-771e987b4e6so2093269b3a.2 for ; Fri, 29 Aug 2025 15:29:29 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.29.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:29:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506568; x=1757111368; 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=0b8XApD11uS49cAycox2dUykst7Wjzbv/b7G4vIsl14=; b=NnCzgKEQk5n2SyLKoj5TsoIDvLQjYq2SHXsb0iNyMab3W985RiviLo0fRszusjB/Ca riOanlBTu+t614TVWwTrbKeUqlXhDUeEoslN9IkeWB1Pro+FwVb3K35tee4qZBgibDjn FhOFIy9iAQWKWoHbxyzPmzVAlyuDGjEiWUJekVKcjMFIx7LLoeaGbMI1Ho0Bj2imOcWG MERUwj3Jre/pcX3jkWhYlJV86F8ulyO5FNSuaB4K1JjWQYg5wSu0L95xqndQ2jbitv0n dmhcPXcDS0aI8Aw8Wxy3HoQ5FPbgJ34DT/RaKmj7Q9mDG6gkJiDc3f10Jtrt5ZQjq/WG cNlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506568; x=1757111368; 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=0b8XApD11uS49cAycox2dUykst7Wjzbv/b7G4vIsl14=; b=gFQ/MXgrgPt9XwVO11WFbXymqS4+yMUYMbPbusQY8HwEOmGyxcIvuiyTORJxndq7MP IzdpLBg18A1tgosCooiSawXSC3FFjOhsjdJ/C9fO3ShK22fCOkgdIpRjhAeLo3iWQUix pqPoNphcRjWspw3Y1T1yr3qLesqIiP8lZHT/wf1EpcuyHGZcwTwvDm3la5gAIdelfy5c 8Q/PTZOpUAYgCHNXht+Fn4WKDh32uk9Ij+DjzoE59Peqrs31ssTdP+6qKOLF41obGqR3 DloieQCcb6aVPPtEQdTxoznTl3GN9crIpwUnWV+qlVzS2EnhMfAWqgGkV/moQ3f/OoMJ IIYA== X-Gm-Message-State: AOJu0Yz1DhOej7etjg8SCTep5o3q5OTdIv7zJjTM9fXKnlR9ERsvDdnU LbE+PBLRBNo+7LqjeDRVcft9Nnhm6AvSmlh8Vsw5O2jBWWTNFAsdfgttkTdZB3bFXqvI5MsgUJF YMjU+zNM= X-Gm-Gg: ASbGncvG9U27W13KWC7dC9sWGJEtfVMefZxunAihPEMGqpAjVvl6pA/k28oUVCVgJ8t ApX1GysR4mNOPeTjocXaEON7rZ/jkYWzQtGmst0H83EGRBb7ahVb2R9fDayc65sltMNKfX4uEMt IbzeH3bZtcd2Fa6rp0eIy7V0Zfz/lLgmPwr0oBqZgFWmfvniqH3ALhd9QpclE5BH3MBMj6yKv1A QUGsoH8mQMMr3bVxS8KbuLHcSRUezwJtt/776SxJgoMdKr9bqkHA9LSzEPD/DUjsrMBwgwrj7mA x+vFXBx3NNhwn/xFQx/CBu0vw2wirRPWwodMGMSs+w7OR59TKJjUCDCZ6Ab8gN3aiiK57BoAIjt 7ddF5TujaZebfTgZzutusej1Qx2lQc16JR5O3V2MalEgoOD6cx1rCTMOqVlQopO8= X-Google-Smtp-Source: AGHT+IF86UjIpExCZf9kfvKrOOhbrRzG3nHakxqS988SQdXc/rTUTl1bVPoBIkjXSqg/rCBBfP+E9g== X-Received: by 2002:a05:6a00:4b11:b0:772:2ca8:9378 with SMTP id d2e1a72fcca58-7723e341374mr278060b3a.21.1756506568476; Fri, 29 Aug 2025 15:29:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 47/91] linux-user/microblaze: Fold target_pt_regs.r* to an array Date: Sat, 30 Aug 2025 08:23:43 +1000 Message-ID: <20250829222427.289668-48-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::435; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x435.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756571268609116600 Content-Type: text/plain; charset="utf-8" Separately enumerating all 32 registers is not helpful. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/microblaze/target_ptrace.h | 34 +------------ linux-user/microblaze/signal.c | 70 +++------------------------ 2 files changed, 8 insertions(+), 96 deletions(-) diff --git a/linux-user/microblaze/target_ptrace.h b/linux-user/microblaze/= target_ptrace.h index a46c8cb7bc..ead913e5a4 100644 --- a/linux-user/microblaze/target_ptrace.h +++ b/linux-user/microblaze/target_ptrace.h @@ -7,38 +7,8 @@ typedef uint32_t microblaze_reg_t; =20 struct target_pt_regs { - microblaze_reg_t r0; - microblaze_reg_t r1; - microblaze_reg_t r2; - microblaze_reg_t r3; - microblaze_reg_t r4; - microblaze_reg_t r5; - microblaze_reg_t r6; - microblaze_reg_t r7; - microblaze_reg_t r8; - microblaze_reg_t r9; - microblaze_reg_t r10; - microblaze_reg_t r11; - microblaze_reg_t r12; - microblaze_reg_t r13; - microblaze_reg_t r14; - microblaze_reg_t r15; - microblaze_reg_t r16; - microblaze_reg_t r17; - microblaze_reg_t r18; - microblaze_reg_t r19; - microblaze_reg_t r20; - microblaze_reg_t r21; - microblaze_reg_t r22; - microblaze_reg_t r23; - microblaze_reg_t r24; - microblaze_reg_t r25; - microblaze_reg_t r26; - microblaze_reg_t r27; - microblaze_reg_t r28; - microblaze_reg_t r29; - microblaze_reg_t r30; - microblaze_reg_t r31; + /* Note the kernel enumerates all 32 registers. */ + microblaze_reg_t r[32]; microblaze_reg_t pc; microblaze_reg_t msr; microblaze_reg_t ear; diff --git a/linux-user/microblaze/signal.c b/linux-user/microblaze/signal.c index 7aef781314..e874e4def1 100644 --- a/linux-user/microblaze/signal.c +++ b/linux-user/microblaze/signal.c @@ -51,75 +51,17 @@ struct target_rt_sigframe { =20 static void setup_sigcontext(struct target_sigcontext *sc, CPUMBState *env) { - __put_user(env->regs[0], &sc->regs.r0); - __put_user(env->regs[1], &sc->regs.r1); - __put_user(env->regs[2], &sc->regs.r2); - __put_user(env->regs[3], &sc->regs.r3); - __put_user(env->regs[4], &sc->regs.r4); - __put_user(env->regs[5], &sc->regs.r5); - __put_user(env->regs[6], &sc->regs.r6); - __put_user(env->regs[7], &sc->regs.r7); - __put_user(env->regs[8], &sc->regs.r8); - __put_user(env->regs[9], &sc->regs.r9); - __put_user(env->regs[10], &sc->regs.r10); - __put_user(env->regs[11], &sc->regs.r11); - __put_user(env->regs[12], &sc->regs.r12); - __put_user(env->regs[13], &sc->regs.r13); - __put_user(env->regs[14], &sc->regs.r14); - __put_user(env->regs[15], &sc->regs.r15); - __put_user(env->regs[16], &sc->regs.r16); - __put_user(env->regs[17], &sc->regs.r17); - __put_user(env->regs[18], &sc->regs.r18); - __put_user(env->regs[19], &sc->regs.r19); - __put_user(env->regs[20], &sc->regs.r20); - __put_user(env->regs[21], &sc->regs.r21); - __put_user(env->regs[22], &sc->regs.r22); - __put_user(env->regs[23], &sc->regs.r23); - __put_user(env->regs[24], &sc->regs.r24); - __put_user(env->regs[25], &sc->regs.r25); - __put_user(env->regs[26], &sc->regs.r26); - __put_user(env->regs[27], &sc->regs.r27); - __put_user(env->regs[28], &sc->regs.r28); - __put_user(env->regs[29], &sc->regs.r29); - __put_user(env->regs[30], &sc->regs.r30); - __put_user(env->regs[31], &sc->regs.r31); + for (int i =3D 0; i < 32; ++i) { + __put_user(env->regs[i], &sc->regs.r[i]); + } __put_user(env->pc, &sc->regs.pc); } =20 static void restore_sigcontext(struct target_sigcontext *sc, CPUMBState *e= nv) { - __get_user(env->regs[0], &sc->regs.r0); - __get_user(env->regs[1], &sc->regs.r1); - __get_user(env->regs[2], &sc->regs.r2); - __get_user(env->regs[3], &sc->regs.r3); - __get_user(env->regs[4], &sc->regs.r4); - __get_user(env->regs[5], &sc->regs.r5); - __get_user(env->regs[6], &sc->regs.r6); - __get_user(env->regs[7], &sc->regs.r7); - __get_user(env->regs[8], &sc->regs.r8); - __get_user(env->regs[9], &sc->regs.r9); - __get_user(env->regs[10], &sc->regs.r10); - __get_user(env->regs[11], &sc->regs.r11); - __get_user(env->regs[12], &sc->regs.r12); - __get_user(env->regs[13], &sc->regs.r13); - __get_user(env->regs[14], &sc->regs.r14); - __get_user(env->regs[15], &sc->regs.r15); - __get_user(env->regs[16], &sc->regs.r16); - __get_user(env->regs[17], &sc->regs.r17); - __get_user(env->regs[18], &sc->regs.r18); - __get_user(env->regs[19], &sc->regs.r19); - __get_user(env->regs[20], &sc->regs.r20); - __get_user(env->regs[21], &sc->regs.r21); - __get_user(env->regs[22], &sc->regs.r22); - __get_user(env->regs[23], &sc->regs.r23); - __get_user(env->regs[24], &sc->regs.r24); - __get_user(env->regs[25], &sc->regs.r25); - __get_user(env->regs[26], &sc->regs.r26); - __get_user(env->regs[27], &sc->regs.r27); - __get_user(env->regs[28], &sc->regs.r28); - __get_user(env->regs[29], &sc->regs.r29); - __get_user(env->regs[30], &sc->regs.r30); - __get_user(env->regs[31], &sc->regs.r31); + for (int i =3D 0; i < 32; ++i) { + __get_user(env->regs[i], &sc->regs.r[i]); + } __get_user(env->pc, &sc->regs.pc); } =20 --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756571197; cv=none; d=zohomail.com; s=zohoarc; b=a8Pg9jiw+9NCJUCJVKuDe9gz+7Q+Z8gSi61P1utwVtpC3CzOZY8NfQZY5JGAORwY6uxHTPnt/qc122gyM3ZpEroYSVannZ1bKHfL19uJ/KQRTi/qTmk10PSY1slv/CKggEyoqzs4osacbhE30NCLTR4dW8/OeUbqY4Ivnz4bS5U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756571197; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=sa3b2TMivSD6XM1tsMuoQHxNMdNW+gXzNJQ+o4QofYU=; b=fZdFeEzebKbOKIcNHniYXZ6QNZiCwrGNNbTBWMxTTjyJCvicggg9D4g5R8ol2Bx9y5TMHcI37bwjZeJQusuxizr27YL5ud1+pMv5t7yWv1ucOO99+/tzre1sv0o1/L/ZNMcef+/b1R64e6iBOsrzVsIbXjZhbdt5rDcTFwuqF5s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756571197488442.7101785955648; Sat, 30 Aug 2025 09:26:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNl3-00041b-Th; Sat, 30 Aug 2025 11:44:50 -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 1us7bD-0004Nj-Dt for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:35 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7bB-0003aY-3r for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:34 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-7723cf6e4b6so123900b3a.3 for ; Fri, 29 Aug 2025 15:29:31 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.29.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:29:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506571; x=1757111371; 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=sa3b2TMivSD6XM1tsMuoQHxNMdNW+gXzNJQ+o4QofYU=; b=TjGjwO87K6+IEaBvP1dugeIOtl3VXDnuLMGhkTNfKmqiHlT1+tcoSH8CamnMFbmQY1 tdCluo2RzARwNnlNFyR+Yy43S43V3EYBDzIhof/FIGSR9j1O6yu+LMg5EgsjRi9kWPAO eGgiqprkpWZ06KttX7zMdBuWD6AosPBHIC3T2fI850zFve9w1widaAa6X3YQHGWtP+fN RbJN/f6k/2q4HdNMf0q/QsOLozGqsLTEGw8R/ggv69pWgzQ0F6lUcOA+vZAmJDlvkvb2 PS14QEdWH+giabeC6Vzga7oBtMVhrAODs+wPUcwwUFVK9DwJ6vuBRmYrGk51/VSUpUMW xYhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506571; x=1757111371; 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=sa3b2TMivSD6XM1tsMuoQHxNMdNW+gXzNJQ+o4QofYU=; b=SXV6Eq7frXW8MuufyW00F2vO28Vc0lSDTcvh2+T3zddjPnf0uRkpu4C3s+edJnr43K kzT7PW0exPIj+YCgGYVpNiHfnx1oGIEamfJt4eWXJm648+jFD5tYRmiYVaYaYyL/+nUh GF8RBdB6FXCqXyfjHUiSIf0a/k7y9S/nOSTtC3tj39Yw8BhDSII3E+jNhy8j2k7eC47W NE3himMqFNocvN/wtPeRrxriU7vb9gc7/OGzAozbJ03wERk/D2/rZkYO3RTMuEHdSYOL WyC0SvxaOFQsez9PjOftJjEe5a9ztpPaRqqkZX3ljfOGNwm5cLSFmASL8Uh2TwONfvF6 ZcMg== X-Gm-Message-State: AOJu0YwA4FFKBEjPBedEmlkrmCko0S1SM6ElMFBeJ9mt3laj72hOp+Qn 5QojNJHXg704fjv9hYgmP6wS5Xium73L8IJQqkDeBTdnq8qD6AQ0gt0dNufqrThKStaUWRiuS6l a43zp3vg= X-Gm-Gg: ASbGncv9xcWISrHisJlHrOiW6E0Tgo66XN57D61Ppg5N+a2hm/mYHtzIt6Usqrao/+T WWhQEwiV1N9shTjKY+iSbZZ+J6Lhw8Oc7oYWLxzYPyEgBP0ng72169RSo9XXiiGJfU7850CsjGo h+2+WKmemLWplEHn0cU10vE1+ITDepxrjnCbhj9b1r4m1rsvq4GY5T2q/JHC1Wj5qB4gu8VykJn cacPKW6woQRdNSHbj4xFdb/BuXSJPpu1AH8FPXkvVw3OgfaJxR25YKOz1tNHFwUO7LnPpXGdyAb u8Yf6hxFoBHPtoc6ZdhQMffNC+r0uVl3s1rYDikCh5vGbRzJmN4Srl1QiVvfWlIXQ99ghGLO7b4 LfDx/UrU1yesm6JZaZxFBp1EVMk0hSr35Pr+Z6SsX6Zr9AhzFLIoNBUfN+JooG5A= X-Google-Smtp-Source: AGHT+IFjL7GGVQWYbRsmQQvFaR0YcRM55PYADd6V8BiFEPpKZ1A7UT1PsubbI67GMXtDZxxv+Y29Uw== X-Received: by 2002:a05:6a20:42a3:b0:243:d471:51e1 with SMTP id adf61e73a8af0-243d6f37f73mr284392637.42.1756506570826; Fri, 29 Aug 2025 15:29:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 48/91] linux-user/microblaze: Expand target_elf_gregset_t Date: Sat, 30 Aug 2025 08:23:44 +1000 Message-ID: <20250829222427.289668-49-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756571197860116600 Content-Type: text/plain; charset="utf-8" Make use of the fact that target_elf_gregset_t is a proper structure. Drop ELF_NREG, target_elf_greg_t, and tswapreg. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/microblaze/target_elf.h | 11 +++++++---- linux-user/microblaze/elfload.c | 14 +++++--------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/linux-user/microblaze/target_elf.h b/linux-user/microblaze/tar= get_elf.h index cc5cc0477e..56de77d4f3 100644 --- a/linux-user/microblaze/target_elf.h +++ b/linux-user/microblaze/target_elf.h @@ -8,13 +8,16 @@ #ifndef MICROBLAZE_TARGET_ELF_H #define MICROBLAZE_TARGET_ELF_H =20 +#include "target_ptrace.h" + #define HAVE_ELF_CORE_DUMP 1 =20 -typedef abi_ulong target_elf_greg_t; - -#define ELF_NREG 38 +/* + * See linux kernel: arch/microblaze/include/asm/elf.h, where + * elf_gregset_t is mapped to struct pt_regs via sizeof. + */ typedef struct target_elf_gregset_t { - target_elf_greg_t regs[ELF_NREG]; + struct target_pt_regs pt; } target_elf_gregset_t; =20 #endif diff --git a/linux-user/microblaze/elfload.c b/linux-user/microblaze/elfloa= d.c index 89250dbd63..7eb1b26d17 100644 --- a/linux-user/microblaze/elfload.c +++ b/linux-user/microblaze/elfload.c @@ -11,18 +11,14 @@ const char *get_elf_cpu_model(uint32_t eflags) return "any"; } =20 -#define tswapreg(ptr) tswapal(ptr) - void elf_core_copy_regs(target_elf_gregset_t *r, const CPUMBState *env) { for (int i =3D 0; i < 32; i++) { - r->regs[i] =3D tswapreg(env->regs[i]); + r->pt.r[i] =3D tswapal(env->regs[i]); } =20 - r->regs[32] =3D tswapreg(env->pc); - r->regs[33] =3D tswapreg(mb_cpu_read_msr(env)); - r->regs[34] =3D 0; - r->regs[35] =3D tswapreg(env->ear); - r->regs[36] =3D 0; - r->regs[37] =3D tswapreg(env->esr); + r->pt.pc =3D tswapal(env->pc); + r->pt.msr =3D tswapal(mb_cpu_read_msr(env)); + r->pt.ear =3D tswapal(env->ear); + r->pt.esr =3D tswapal(env->esr); } --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756570467; cv=none; d=zohomail.com; s=zohoarc; b=lC2+KQiEe2pLBBYvR57iLvc0u7/CfDsIaIxg3U5Xzlm8tAll7b4RxxIZfqN4+SgeXcOyg1Ah8ijkrRS6akZQQ1QtC+RQ3KwyzGTyCiPzJ4mKhvQZErER99IOEyhemMGSlulbS9fD5yGtfITLjj+rB8o9O0LOlm5p64273AyG66g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756570467; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=yTZxpZcicsbz3TLYAdHyPjm1fzfLXoCF8L5rsece6PM=; b=gV3pCUYYYd4YMFwHQdym3Wv8lYNyziCeIRTM5MqeALc9TEG3kprhhS155iDRG2u0lUVSsXmJA4u/mRG9qRJYWQ7KmDtQUZELmGIWbzSRr0jCR3wzf1Obw1YT+gQCyIgN57bRrhLpQdZSq0YKA3s7P9xNuiW7MCMRPVvvLA+jpFQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 175657046719122.569841562695274; Sat, 30 Aug 2025 09:14:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNjw-0007R6-D9; Sat, 30 Aug 2025 11:43:40 -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 1us7bF-0004OS-N6 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:37 -0400 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7bD-0003au-6t for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:37 -0400 Received: by mail-pj1-x102c.google.com with SMTP id 98e67ed59e1d1-32326e67c95so2848679a91.3 for ; Fri, 29 Aug 2025 15:29:34 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.29.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:29:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506573; x=1757111373; 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=yTZxpZcicsbz3TLYAdHyPjm1fzfLXoCF8L5rsece6PM=; b=omql6CQzKM7/Z672E2B4+NEsagSGxAUuSCqJvB99hFmx/Co7PGtsBNl1Wq34zbkpmf yUKZRdCqxqfIHQkES62t7PbS9huI1SPGMPUv3gqfwx5LST427WSG6es1hFTq48iIQrWj mzDcCNFrP6vI4ze9QbWDEZ6s/D7uJ6ErZQKY2ObtQc/NyWEys1b4Brfy4W8wrVGe7mut PS5l9S9VoqDg5r6n6KJhogsNlHNTMIVP0K0bD/jVUuD1jMZmMzfUHvDz6RKWI5zPFfpQ jcJeCOOxcWyg9vvUBVSUNgRi4+3VLIPNcWM1FpXn3S44DSjrq+oK92q4yjPIY9HzWRXI kDmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506573; x=1757111373; 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=yTZxpZcicsbz3TLYAdHyPjm1fzfLXoCF8L5rsece6PM=; b=ly3cnVClWXwUzAKVl/Le33GQPrsgR+QBV5xL0ii0WL4FqepDDiORgG6APH67AezgzA gG/TPoCekGulzcogsEBdzgKT3CfdJtub6jmk8kSBvemF9TH9SvjGypz+LPSkwkBFv2ea PZqEfkv1WAtHIw6BHQANppF9/c4yhs2N+neibp0G9NCY8YA6BOzNIWOEhtN3RbjjRguS tgXby6DrfkpmQn088itK0sjo2n3DpM3iJ1lbzydKdzf2XlfR1aT7GN6BfkuheqcsWcSE VbKyg+OX+OAk1fTeCu7fiIezJE/kNvg+aoavm1cweX8iEcA+pJ9JpCx8AadnvPZwnNKK 85gA== X-Gm-Message-State: AOJu0YydzuPuG7lOJbrVBCGt0gOyvb0Cqie7ZHzDmXc5Scu29jqFxZ09 tKbnhPIQLa9r5GWr8RHGa37bKhGUHX+Donxh7Qfyn78usunNGUhA9cLc0cUnyefj+TMFUV/WUZy 1E9vM6EM= X-Gm-Gg: ASbGnctc5VSaDqiN1bessxBqYJ2HJXWge0L/ERPcvQkyiCQba4lYXk3fql6/KKBg4S8 oDf8HmVGo4XWgVvbCxsPZcD3iByM17DZEqzipizbKKNhbpXKbv00fIIc1qA91H+rJ7m9k0Q2kNF CuL2JMejRz5tvCmCB91R4Y6kwyS40YVz0rll4q7yxLibLugfuu+zPN2ZOZvg/DGSkoyscS3zjyH p13pKkFH3eMzPJR6RsSfaNoRlFiGf1qRwNNDepj0kc8oNKm4a9FdHS7p6buBQgGbr5jorDeeoDc dEFt7QJMjSaDPF1fZMMNswJGCbbFni4cBcNlfb81g+CWitRq2DOB2irEbF2OnNBmhOpVXUB6gZn 2p9zUg6ddIvnNuaOz73nTFVo411345dSlgTIDwhu4rP7RPD/hq1Fg7LSzm9GNnCY= X-Google-Smtp-Source: AGHT+IGGFdEhxje/nzZMPj23DQnHAPYbn/TkIn2QPSYaa/lkKMNtrAIIv1WCGX7vtgLvOASM4Jhy6Q== X-Received: by 2002:a17:90a:e7cd:b0:328:d94:174 with SMTP id 98e67ed59e1d1-32815412b69mr277545a91.5.1756506573113; Fri, 29 Aug 2025 15:29:33 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 49/91] linux-user/mips: Create target_ptrace.h Date: Sat, 30 Aug 2025 08:23:45 +1000 Message-ID: <20250829222427.289668-50-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::102c; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102c.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756570469476124100 Content-Type: text/plain; charset="utf-8" Move the target_pt_regs structure from target_syscall.h. Fix the incorrect ordering of the fields. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/mips/target_ptrace.h | 17 +++++++++++++++++ linux-user/mips/target_syscall.h | 19 ------------------- linux-user/mips64/target_ptrace.h | 16 ++++++++++++++++ linux-user/mips64/target_syscall.h | 16 ---------------- 4 files changed, 33 insertions(+), 35 deletions(-) create mode 100644 linux-user/mips/target_ptrace.h create mode 100644 linux-user/mips64/target_ptrace.h diff --git a/linux-user/mips/target_ptrace.h b/linux-user/mips/target_ptrac= e.h new file mode 100644 index 0000000000..2f63b27ac4 --- /dev/null +++ b/linux-user/mips/target_ptrace.h @@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef MIPS_TARGET_PTRACE_H +#define MIPS_TARGET_PTRACE_H + +struct target_pt_regs { + abi_ulong pad0[6]; + abi_ulong regs[32]; + abi_ulong lo; + abi_ulong hi; + abi_ulong cp0_epc; + abi_ulong cp0_badvaddr; + abi_ulong cp0_status; + abi_ulong cp0_cause; +}; + +#endif /* MIPS_TARGET_PTRACE_H */ diff --git a/linux-user/mips/target_syscall.h b/linux-user/mips/target_sysc= all.h index 08ead67810..dfcdf320b7 100644 --- a/linux-user/mips/target_syscall.h +++ b/linux-user/mips/target_syscall.h @@ -1,25 +1,6 @@ #ifndef MIPS_TARGET_SYSCALL_H #define MIPS_TARGET_SYSCALL_H =20 -/* this struct defines the way the registers are stored on the - stack during a system call. */ - -struct target_pt_regs { - /* Pad bytes for argument save space on the stack. */ - abi_ulong pad0[6]; - - /* Saved main processor registers. */ - abi_ulong regs[32]; - - /* Saved special registers. */ - abi_ulong cp0_status; - abi_ulong lo; - abi_ulong hi; - abi_ulong cp0_badvaddr; - abi_ulong cp0_cause; - abi_ulong cp0_epc; -}; - #define UNAME_MACHINE "mips" #define UNAME_MINIMUM_RELEASE "2.6.32" =20 diff --git a/linux-user/mips64/target_ptrace.h b/linux-user/mips64/target_p= trace.h new file mode 100644 index 0000000000..41f0bf6c1c --- /dev/null +++ b/linux-user/mips64/target_ptrace.h @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef MIPS64_TARGET_PTRACE_H +#define MIPS64_TARGET_PTRACE_H + +struct target_pt_regs { + target_ulong regs[32]; + target_ulong lo; + target_ulong hi; + target_ulong cp0_epc; + target_ulong cp0_badvaddr; + target_ulong cp0_status; + target_ulong cp0_cause; +}; + +#endif /* MIPS64_TARGET_PTRACE_H */ diff --git a/linux-user/mips64/target_syscall.h b/linux-user/mips64/target_= syscall.h index 358dc2d64c..9135bf5e8b 100644 --- a/linux-user/mips64/target_syscall.h +++ b/linux-user/mips64/target_syscall.h @@ -1,22 +1,6 @@ #ifndef MIPS64_TARGET_SYSCALL_H #define MIPS64_TARGET_SYSCALL_H =20 -/* this struct defines the way the registers are stored on the - stack during a system call. */ - -struct target_pt_regs { - /* Saved main processor registers. */ - target_ulong regs[32]; - - /* Saved special registers. */ - target_ulong cp0_status; - target_ulong lo; - target_ulong hi; - target_ulong cp0_badvaddr; - target_ulong cp0_cause; - target_ulong cp0_epc; -}; - #define UNAME_MACHINE "mips64" #define UNAME_MINIMUM_RELEASE "2.6.32" =20 --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756570386; cv=none; d=zohomail.com; s=zohoarc; b=McFtVeJcAGMXQiUbM4Wxp5yccm6e6CmTy2/TY2+WO6Z7I/EDwb+JDMTWVJi9z4DzY0/Tp57wRoIocaqGu87lGkue4IP123LjcBUGtEknVudf2GgrgGtKshWs7Lb4qg77Qb5O8Ak2IeP62ZTJXvEk99D0F9mM7Hgc35lyS5LDOmM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756570386; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/S/XybhJsScwh2XgsdTT+la9BSjFbURn2C6teEPj7h4=; b=UN1dYp8y7mh2kTBD3VbGrGpBmfJ3OvqDANcffubMuy6SrIIaStyloV29fw1jJql99JUEG9YaS5vnJV6QjcoTBVuYZuN6A8U/jsT0tQX8sA069sgaD9gPn1bIzuBEeLhTTI34nGBEyursmMWLb9DAHwAFQz8yjaUQYxESnwRJkmQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756570386370749.4306445680165; Sat, 30 Aug 2025 09:13:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNjy-0007oU-UB; Sat, 30 Aug 2025 11:43:43 -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 1us7bI-0004PE-6c for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:40 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7bG-0003bR-76 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:39 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-770530175b2so2070039b3a.3 for ; Fri, 29 Aug 2025 15:29:36 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.29.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:29:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506575; x=1757111375; 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=/S/XybhJsScwh2XgsdTT+la9BSjFbURn2C6teEPj7h4=; b=YKFWkli/D6KfQLbG+XySZQ+LbVkIzCqbv5THd13TA10pY8mF4wlEAQ7JEHrQEqGHdI GRTRRluBYzrnsW/N36kmlGHLlvxyGraQQy/Vlx9PNHt9eqvEXeBYoeaVT2k5/oATcwlX PISwfM3vS3HDnU2M2ovtAB62iwCCF9ow9iuZv59I9XruuWtsIi64tUnWyZnxvJWUaVKD VhbvlKwvr3TCbheet+Mn+tmk8wD/OkM+flLkHWp1mHR+WzUwzJZgptslX3Lg7Gzm9JZC qVJ9Rm2Ffh3HhEwyqm0rmUA7UA9V9i1/h1SX/kSCngLjR/gSTNStkf1P9FiUe7WAw9Dj M41g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506575; x=1757111375; 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=/S/XybhJsScwh2XgsdTT+la9BSjFbURn2C6teEPj7h4=; b=Vvw8osPwPKRe6c7rXQ+wCzqnq/aeVl01FMfiUeBvfeJbIbo84elKbhnsyiDL7SR1hc zL/L9XbLHIYP0myyIWCCRwCA1IbmNIQzR4iXzps9QJ/xiKkTsYYEpdPXGAsKvnu9z52x +rt07Imn5hfNzn13JTOLu0r0xEszjd89leTm2HTcDlERh9uZsG3s6RzCzLNMaRKHT4aC MuG3/RlcGfWqj3hr2wwbD3En3H8FfdryRTJx/SBQVPzcxJ4pa1JFuIenLf3eAF/qc3CY rsSaSB1BdvLfrdD5crnIZ+Pi1KrtohpQjYqooBEWF53mvcmid8T4HDOCEPZjD5AwMXmM WFJg== X-Gm-Message-State: AOJu0Yxi6hFPXUjYfMXkKq3PEGocOWJ13suBjD+ADkSb/TQCoPqfkL0Z Caji3ca3d80l6S5enVV55rHoqJQHlJZGHrxdZoy5C1FkgsrlAe93K4ro5k5XOfWQLdzTT6LqO2s Fa0Uujsg= X-Gm-Gg: ASbGnctl/jpAqQxy8+s6ySjiWxpBRUDjpJ1GJrdD6iovCSnWnjs4psBibCrg3RoBRCQ YQ73Gd9xi6ZmeuJfVU2okQuY9tPrCjA4LdIf30Qa8xogKWRNG6Dz8IGY/ESYdhrgnX6xM/2pZw8 ugoaNXJxXv5da31jdIPM9jo2cBeFf3oFHD/k27TRtwDKEWYWTNLvN2kh7LkHHwH+bSxl9wGoo7E GI3/2T1DG+wfaedb+SSnAnVicRPSv0Su6tyNDqTQ0rLxKo4eHwEmn62oiXA+CqDlptosfYwsmTq ZsHarccZ3yWJpcWnaCYwdVf1u8JZ8209/LStpeaW/tvP4q/Rz8UQEoO72jCb+1Q3IQMVDR8aAis m8mL9Y6JhVjYHXJkZo+s7o2+65yf+UDisMOPUQXCa8R4aAY+qZBTi+862/TpSc5Y= X-Google-Smtp-Source: AGHT+IE010/6CsZCWu/yw5UNWPL1a3KMm+cdGEcmI7MFkFMtvwT/WSr+ZlZgWNhtjTuvteb/AJjRzQ== X-Received: by 2002:a05:6a00:23ca:b0:770:57c4:e959 with SMTP id d2e1a72fcca58-7723e22d449mr271737b3a.9.1756506575503; Fri, 29 Aug 2025 15:29:35 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 50/91] linux-user/mips: Use target_ulong for target_elf_greg_t Date: Sat, 30 Aug 2025 08:23:46 +1000 Message-ID: <20250829222427.289668-51-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756570388278116600 Content-Type: text/plain; charset="utf-8" Make use of the fact that target_elf_gregset_t is a proper structure. The target_ulong type matches the abi_ulong/abi_ullong selection within mips64/target_elf.h. Drop ELF_NREG, target_elf_greg_t, and tswapreg. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/mips/target_elf.h | 10 ++++--- linux-user/mips64/target_elf.h | 14 +++++----- linux-user/mips/elfload.c | 48 +++++++--------------------------- 3 files changed, 22 insertions(+), 50 deletions(-) diff --git a/linux-user/mips/target_elf.h b/linux-user/mips/target_elf.h index f767767eaa..a4b7fadbd6 100644 --- a/linux-user/mips/target_elf.h +++ b/linux-user/mips/target_elf.h @@ -8,16 +8,18 @@ #ifndef MIPS_TARGET_ELF_H #define MIPS_TARGET_ELF_H =20 +#include "target_ptrace.h" + #define HAVE_ELF_HWCAP 1 #define HAVE_ELF_BASE_PLATFORM 1 #define HAVE_ELF_CORE_DUMP 1 =20 -typedef abi_ulong target_elf_greg_t; - /* See linux kernel: arch/mips/include/asm/elf.h. */ -#define ELF_NREG 45 typedef struct target_elf_gregset_t { - target_elf_greg_t regs[ELF_NREG]; + union { + abi_ulong reserved[45]; + struct target_pt_regs pt; + }; } target_elf_gregset_t; =20 #endif diff --git a/linux-user/mips64/target_elf.h b/linux-user/mips64/target_elf.h index 046a165eef..67bc963134 100644 --- a/linux-user/mips64/target_elf.h +++ b/linux-user/mips64/target_elf.h @@ -8,20 +8,18 @@ #ifndef MIPS64_TARGET_ELF_H #define MIPS64_TARGET_ELF_H =20 +#include "target_ptrace.h" + #define HAVE_ELF_HWCAP 1 #define HAVE_ELF_BASE_PLATFORM 1 #define HAVE_ELF_CORE_DUMP 1 =20 -#ifdef TARGET_ABI_MIPSN32 -typedef abi_ullong target_elf_greg_t; -#else -typedef abi_ulong target_elf_greg_t; -#endif - /* See linux kernel: arch/mips/include/asm/elf.h. */ -#define ELF_NREG 45 typedef struct target_elf_gregset_t { - target_elf_greg_t regs[ELF_NREG]; + union { + target_ulong reserved[45]; + struct target_pt_regs pt; + }; } target_elf_gregset_t; =20 #endif diff --git a/linux-user/mips/elfload.c b/linux-user/mips/elfload.c index 6e884911af..e0c50f50ed 100644 --- a/linux-user/mips/elfload.c +++ b/linux-user/mips/elfload.c @@ -124,47 +124,19 @@ const char *get_elf_base_platform(CPUState *cs) =20 #undef MATCH_PLATFORM_INSN =20 -#ifdef TARGET_ABI_MIPSN32 -#define tswapreg(ptr) tswap64(ptr) -#else -#define tswapreg(ptr) tswapal(ptr) -#endif - -/* See linux kernel: arch/mips/include/asm/reg.h. */ -enum { -#ifdef TARGET_MIPS64 - TARGET_EF_R0 =3D 0, -#else - TARGET_EF_R0 =3D 6, -#endif - TARGET_EF_R26 =3D TARGET_EF_R0 + 26, - TARGET_EF_R27 =3D TARGET_EF_R0 + 27, - TARGET_EF_LO =3D TARGET_EF_R0 + 32, - TARGET_EF_HI =3D TARGET_EF_R0 + 33, - TARGET_EF_CP0_EPC =3D TARGET_EF_R0 + 34, - TARGET_EF_CP0_BADVADDR =3D TARGET_EF_R0 + 35, - TARGET_EF_CP0_STATUS =3D TARGET_EF_R0 + 36, - TARGET_EF_CP0_CAUSE =3D TARGET_EF_R0 + 37 -}; - /* See linux kernel: arch/mips/kernel/process.c:elf_dump_regs. */ void elf_core_copy_regs(target_elf_gregset_t *r, const CPUMIPSState *env) { - int i; - - for (i =3D 0; i <=3D TARGET_EF_R0; i++) { - r->regs[i] =3D 0; - } - for (i =3D 1; i < ARRAY_SIZE(env->active_tc.gpr); i++) { - r->regs[TARGET_EF_R0 + i] =3D tswapreg(env->active_tc.gpr[i]); + for (int i =3D 1; i < ARRAY_SIZE(env->active_tc.gpr); i++) { + r->pt.regs[i] =3D tswapl(env->active_tc.gpr[i]); } =20 - r->regs[TARGET_EF_R26] =3D 0; - r->regs[TARGET_EF_R27] =3D 0; - r->regs[TARGET_EF_LO] =3D tswapreg(env->active_tc.LO[0]); - r->regs[TARGET_EF_HI] =3D tswapreg(env->active_tc.HI[0]); - r->regs[TARGET_EF_CP0_EPC] =3D tswapreg(env->active_tc.PC); - r->regs[TARGET_EF_CP0_BADVADDR] =3D tswapreg(env->CP0_BadVAddr); - r->regs[TARGET_EF_CP0_STATUS] =3D tswapreg(env->CP0_Status); - r->regs[TARGET_EF_CP0_CAUSE] =3D tswapreg(env->CP0_Cause); + r->pt.regs[26] =3D 0; + r->pt.regs[27] =3D 0; + r->pt.lo =3D tswapl(env->active_tc.LO[0]); + r->pt.hi =3D tswapl(env->active_tc.HI[0]); + r->pt.cp0_epc =3D tswapl(env->active_tc.PC); + r->pt.cp0_badvaddr =3D tswapl(env->CP0_BadVAddr); + r->pt.cp0_status =3D tswapl(env->CP0_Status); + r->pt.cp0_cause =3D tswapl(env->CP0_Cause); } --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756569587; cv=none; d=zohomail.com; s=zohoarc; b=U7CAPw6N2A7M3BmXmVhvQcSoQGJd6Npaqwf05Tg0d8PTi1E+zmDDyOhLtOz7KhkfebLwoevnstYgsUg1lAPHfVyLLi6UJqMNLvGnPc12tz1rzcN2XeWZSdwISRyhBdVQgGtHqwIukZGrokdvVLOEMbFbdOlWL+cf3qL1JbxNrzo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756569587; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=hEu/Jd/KzuMLh+1O07NzkMG0vtLdDubGRA+9tMz/IuQ=; b=cVnVsPlV1SX+ago123SUtxmopibbTbj8ap9/2r/nCrcrKqROFkzHgcWmfN9EcPDm5bhFa75CIB1NbheyxGvE/rel+IDXVbp2JciGvesjUWpY0WCxaGEow7yrSkimxXAtp1u3SLCzCIscc5WFOyVKBG9mrHHEFMgYhXwTfWy/0+8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756569587848987.1884760794911; Sat, 30 Aug 2025 08:59:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNk1-00084C-58; Sat, 30 Aug 2025 11:43:46 -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 1us7bJ-0004Pv-OM for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:41 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7bH-0003c3-FH for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:41 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-77238cb3cbbso566920b3a.0 for ; Fri, 29 Aug 2025 15:29:39 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.29.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:29:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506578; x=1757111378; 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=hEu/Jd/KzuMLh+1O07NzkMG0vtLdDubGRA+9tMz/IuQ=; b=zAydEpOQW1gq4nOnjJfAiXX+HotuKYzS2jb1nyQOA4eyx03o+jIJFj4NO9I/3NQJxs hyb840dWO7HVHiAf4Bk0KMIPcH93TLtCNbXGDW7IH/sh5/5H3hoFALxdfnXNz7b45dWu S7tibfWPHDE3lSqj1BNwLjTb3PyUPdXDJKYLHuoaLotyqdy7rafDGHOrx3voX5X62ent +xnxNTry1OsC5Zl9CpC69wXJQqvfSWMFy43xWDZP6HGIO+vaK0W54YOgX0GftoDsOIoy /OuYeJrut+PmCsYyHIfCvR8sav5wzs3bB5UXmANijFQkg6HPL66WP5Woj20MxyO6vH8M v8uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506578; x=1757111378; 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=hEu/Jd/KzuMLh+1O07NzkMG0vtLdDubGRA+9tMz/IuQ=; b=GSP4TEXNom52tXv50r7zv1Z/LoNQcxf3A/kGTinKQAwh537KHl4OqqB8ydalPIZ4PC t3FoKpU8uW4AkliNk1VQDkxRfITrzB9d2ifEyq+DWaRzGWfvwqdPBXALK82o1jtSsS8F jSvq1Gcgfnr5EbZTLpGb0T5RTe/vdnBqOH5viN7BWVplFOquqnAGlZdryB1Eh+vV6sj2 5rjJ7At9H5GGXCx0+THp2l4EllxM/cngygJ0AisUb4xqJ9aONODUYzmE5wujGgBntdr3 AI0YnPXBjVKHr+G9dzFh0FWsFZ8K8wr0TP1rC1Swvo+oWZeqi4WecdmcxYbrmR0z4A1v 2HEQ== X-Gm-Message-State: AOJu0YxgK5Qwa0jiP8kJrPrx1Vz65tu+BAUZGD10YgIv1ZvseH9y0KtN tjz/aTTScejmbQOsWueRljvpNdCZaLFIQY5pqz2JLjUeqzBvxY7d4iEvfDDUPp/w+cC6MgDOzQg gufCjkB4= X-Gm-Gg: ASbGncuN7B8pLAQQtJFSYccg+I5R0JR8YBoZPCTbjFbYhKc/uw7QaAjj0Bhl/yZ6X9p qECUCR5M2mYf+qRQN+E8FaP1kPHReygRxFlH+DqYFnR2sK1x1wt3HqlFMKF27I4gnAN/LBBBpqh SPvZN6CGqE2xW7Jba6sOdNFnfDlM9Rp95sQTanAmL+TZsXvTvfmoUYm7TGZyIni+vk6D0a8Ln9A McWHOSwFjAwxsKZHT3fpia6Meh+FjXml6u6IZNFE79lwTK+01M64eRnvm6bALbu6Tg5z9JFfS9E DHHELrxWIgXBRpK6fiqRfeBMGS7pJqQUhJDhGnY7OSQt+HPMVIDYtB7NKjzAco8uwQjW40UvcLP 41Ce/mifKHBpEHBEFt5wWH3EYJeyypyCsjcRWObrvep6k/XY0Lu6U+C6XOa1/WL7k0psJoUmOAM 2zyOwX2Bik X-Google-Smtp-Source: AGHT+IHQ9xcNrneHa9ylxk59nTdyuFRCRmYWLC3rdyfVR4/RTPM355ZvaQudYLw7z9OvZpzXQGN0gA== X-Received: by 2002:a05:6a00:390c:b0:76e:8cf4:7bc4 with SMTP id d2e1a72fcca58-7723e3c8c40mr233123b3a.26.1756506577893; Fri, 29 Aug 2025 15:29:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 51/91] linux-user/openrisc: Create target_ptrace.h Date: Sat, 30 Aug 2025 08:23:47 +1000 Message-ID: <20250829222427.289668-52-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756569589431124100 Content-Type: text/plain; charset="utf-8" Move the target_pt_regs structure from target_syscall.h and rename to target_user_regs_struct, obviating the comment. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/openrisc/target_ptrace.h | 13 +++++++++++++ linux-user/openrisc/target_syscall.h | 11 ----------- linux-user/openrisc/signal.c | 3 ++- 3 files changed, 15 insertions(+), 12 deletions(-) create mode 100644 linux-user/openrisc/target_ptrace.h diff --git a/linux-user/openrisc/target_ptrace.h b/linux-user/openrisc/targ= et_ptrace.h new file mode 100644 index 0000000000..563c648525 --- /dev/null +++ b/linux-user/openrisc/target_ptrace.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef OPENRISC_TARGET_PTRACE_H +#define OPENRISC_TARGET_PTRACE_H + +/* See arch/openrisc/include/uapi/asm/ptrace.h. */ +struct target_user_regs_struct { + abi_ulong gpr[32]; + abi_ulong pc; + abi_ulong sr; +}; + +#endif /* OPENRISC_TARGET_PTRACE_H */ diff --git a/linux-user/openrisc/target_syscall.h b/linux-user/openrisc/tar= get_syscall.h index 7fe5b73d3b..c8394e9dcd 100644 --- a/linux-user/openrisc/target_syscall.h +++ b/linux-user/openrisc/target_syscall.h @@ -1,17 +1,6 @@ #ifndef OPENRISC_TARGET_SYSCALL_H #define OPENRISC_TARGET_SYSCALL_H =20 -/* Note that in linux/arch/openrisc/include/uapi/asm/ptrace.h, - * this is called user_regs_struct. Given that this is what - * is used within struct sigcontext we need this definition. - * However, elfload.c wants this name. - */ -struct target_pt_regs { - abi_ulong gpr[32]; - abi_ulong pc; - abi_ulong sr; -}; - #define UNAME_MACHINE "openrisc" #define UNAME_MINIMUM_RELEASE "2.6.32" =20 diff --git a/linux-user/openrisc/signal.c b/linux-user/openrisc/signal.c index cb74a9fe5e..40249095f2 100644 --- a/linux-user/openrisc/signal.c +++ b/linux-user/openrisc/signal.c @@ -21,9 +21,10 @@ #include "user-internals.h" #include "signal-common.h" #include "linux-user/trace.h" +#include "target_ptrace.h" =20 typedef struct target_sigcontext { - struct target_pt_regs regs; + struct target_user_regs_struct regs; abi_ulong oldmask; } target_sigcontext; =20 --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756571187; cv=none; d=zohomail.com; s=zohoarc; b=hYacxJCw5kGON8mwr/CdW5+xncGUO9WyYVzNhL8wuinxMliEf3vR2w7sXgHG2mCM59n6rMhvpqE8icvWwl8YKo4G+HT3OPv91W8NTJ+kQiQuYkOcG7NzW38GPUHxRzcJnHoRJ9xypU3Cgrgp6N+MuGorgUuGikSiYJDQ8/eC1M0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756571187; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZvEXEx1VDU0jBpHbT/irolqC9K1ixlWLmUyzXXcC9HM=; b=Z/lwxVoyNy0aNQlQn1Uub8Oq/rtvSMJRg3XPnnfz9/zyPJQhbiJfxBjiqZEsHasvXqGG1IHS7Y99Us0zb/i/KGOaKJAm8c16P9RDli6ciL/zDgCcxNV4gfxcFoXdOwZViXQfEX0n9ywf/sSJrK4znJ7AVOZpQso0LgTHhyYM3Gg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 175657118723642.93864716670919; Sat, 30 Aug 2025 09:26:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNk4-0008Vv-Rc; Sat, 30 Aug 2025 11:43:48 -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 1us7bL-0004QU-QY for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:44 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7bJ-0003cS-TE for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:43 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-76e2ea933b7so2376482b3a.1 for ; Fri, 29 Aug 2025 15:29:41 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.29.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:29:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506580; x=1757111380; 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=ZvEXEx1VDU0jBpHbT/irolqC9K1ixlWLmUyzXXcC9HM=; b=oMgCcIkuac9LBfuU9IVHee/NxscD4MVjk0OjJDEJ5LFCxN8SewJLaAI9lQE+kPkwzM gxmoHPDYsDB3sgLuZ4lWJogQBPNSiiXz1ut+ghqGmjP5DUIjSOqq52gwIi6TlrRfiazx y+keABRTbmG7D6IETMNp1CCPzhlp7pXeK+LOmRmQ7bOT8ZV0Nqtp3/IcmXkdUbuzHDiO JlVN6lE16GWNFnKipdevGmpOB92i4rHseNSMgj04iE//mmyOmPafxRSVqpArxX4rByeZ W9QwZ9NVitRzjhLi/dSLeK6Xz4/LutIPHR/uJbkeIiuNyZmmv6N6SuyZ2OEnQhlvzc7X Mmbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506580; x=1757111380; 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=ZvEXEx1VDU0jBpHbT/irolqC9K1ixlWLmUyzXXcC9HM=; b=CKVS4qEokNQHVXSQzAwURsJx7HemL9cpI5v/U9ylWe3U7aztBbUpDOHbNfVyO/VopC scMjkEnHzbUA7d0E4uLPZzQvqtLx1dsJOiNga1fTP/fiCV8Cu/kbUFnobXVpd3N3acbq IV7ORqpD4AVYyvrUHAQAA+NRoVgblfIUjoAIfyQdR9ZOVJb56v81PFwzmrUU8n75SXvs b0pvNzgHmO7ODo/MYT3tq9D7JLbjBSXLfyD0E/M8rqjTPYBtiicIMCtzG959DwkQaBAX PfDlYYwekmjm0ONm5k11YDjmmQJEzrwXZl5GvT52mMYBds/VGGIOH0f5yHaE2Xf3nPVj zDgw== X-Gm-Message-State: AOJu0YxTyX7ZSW1/+WBvPsU/mTWiEbd+yUDGhWBfkY18HXc2qQgpTxF2 BF+GmioTQU8p9MHXA3mONzL0Ezf+aj4AnTjnWEhZMnsRZ092GL1+P2G04AfQnFyOQLfV7cDb/xh 94RKnYeo= X-Gm-Gg: ASbGnctirE3oOgst9xAaU+w2pFLzEPL9B85fDrzBR5uG9JW6thfdQJdwdAMl7sKkJs2 tcsJ7JgfoT6xrpqDAVRoDxMASHmLZI1VR1FZyv50pdoM9f0DVAOKilq/xzm/S62b/99UTGXkW8W +vSfGkJZjUFFMKm7AqU+b5hka0kuseLcH5KW4rF+wjhT2RgLL8sh/8vUbst90nVOtsW7NaezHve Ko4pjxnkeIQjogYf5yXFv3pRlc756SSPVJjAvUFRJcV65cwpmVCBGfOtM7NUa+WFYLjgXtaaRnn M6zd70/wFlEVq4HAbFg5yIHWG3SQbYaxaX1zLW6uleB5XBA7RK2uzAxOj37c9JX8P1y5L0HznkL nCcn9mREtNISZYv2p3l92D/7G8UDuhbAJHbej1DyiamiSmGYyF0Izvn6o01UBJGc= X-Google-Smtp-Source: AGHT+IGsPhj+9a92VfeXy3JySQVgtmDptO1QR/UjL0azYG2JNCkmvO8RbUxzJyOWR0p0+c5dIvAb3g== X-Received: by 2002:a05:6a00:3c8e:b0:772:1fa1:be50 with SMTP id d2e1a72fcca58-7723e33708amr305116b3a.9.1756506580120; Fri, 29 Aug 2025 15:29:40 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 52/91] linux-user/openrisc: Expand target_elf_gregset_t Date: Sat, 30 Aug 2025 08:23:48 +1000 Message-ID: <20250829222427.289668-53-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756571187759116600 Content-Type: text/plain; charset="utf-8" Make use of the fact that target_elf_gregset_t is a proper structure. Drop ELF_NREG, target_elf_greg_t, and tswapreg. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/openrisc/target_elf.h | 12 +++++++----- linux-user/openrisc/elfload.c | 8 +++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/linux-user/openrisc/target_elf.h b/linux-user/openrisc/target_= elf.h index e97bdc11ed..ad80e4b41a 100644 --- a/linux-user/openrisc/target_elf.h +++ b/linux-user/openrisc/target_elf.h @@ -8,14 +8,16 @@ #ifndef OPENRISC_TARGET_ELF_H #define OPENRISC_TARGET_ELF_H =20 +#include "target_ptrace.h" + #define HAVE_ELF_CORE_DUMP 1 =20 -typedef abi_ulong target_elf_greg_t; - -/* See linux kernel arch/openrisc/include/asm/elf.h. */ -#define ELF_NREG 34 /* gprs and pc, sr */ +/* + * See linux kernel: arch/openrisc/include/uapi/asm/elf.h, where + * elf_gregset_t is mapped to struct user_regs_struct via sizeof. + */ typedef struct target_elf_gregset_t { - target_elf_greg_t regs[ELF_NREG]; + struct target_user_regs_struct pt; } target_elf_gregset_t; =20 #endif diff --git a/linux-user/openrisc/elfload.c b/linux-user/openrisc/elfload.c index bb5ad96711..6bf02bf58d 100644 --- a/linux-user/openrisc/elfload.c +++ b/linux-user/openrisc/elfload.c @@ -11,13 +11,11 @@ const char *get_elf_cpu_model(uint32_t eflags) return "any"; } =20 -#define tswapreg(ptr) tswapal(ptr) - void elf_core_copy_regs(target_elf_gregset_t *r, const CPUOpenRISCState *e= nv) { for (int i =3D 0; i < 32; i++) { - r->regs[i] =3D tswapreg(cpu_get_gpr(env, i)); + r->pt.gpr[i] =3D tswapal(cpu_get_gpr(env, i)); } - r->regs[32] =3D tswapreg(env->pc); - r->regs[33] =3D tswapreg(cpu_get_sr(env)); + r->pt.pc =3D tswapal(env->pc); + r->pt.sr =3D tswapal(cpu_get_sr(env)); } --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756569557; cv=none; d=zohomail.com; s=zohoarc; b=gtC7Ss392V7OcTJftj7I2rc1bWyVFSb6pfNKxBHwZsvnH2Va2z/WKwhA9Uu8KrArbTsVraKdkYb4fK4XgSBr887ZWnpGpGq04NG+dMoo6nOP51RQ8rV+dh7hOOWvsMOKjBQfhIgEYMZr2jpxbDD+Nt+72jBFP1f8GCf/oPvoD5Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756569557; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=iygv8tGHGS6Phz8vrjGWEgdybmn9tz5c134WHcDFPJg=; b=jgRsEwDXqCraH+XD6621twykg7yT/NTdyI3VOCVKAL9LXBrItlRNhTbPRODRf13+L3tamgmySV/XGXt1ZG7wJJN9Dh82nmzvVJxlMvIGy+EZRuWwa0trXAWFrZlP+BePJKhB+W9WogI316h/Gk06Uak6i38QIif30M9r3r5Lg7U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756569557697475.0439698464345; Sat, 30 Aug 2025 08:59:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNlG-0004PT-4E; Sat, 30 Aug 2025 11:45:02 -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 1us7bO-0004RU-RK for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:46 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7bM-0003cu-5e for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:45 -0400 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-7722e0ca299so859847b3a.1 for ; Fri, 29 Aug 2025 15:29:43 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.29.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:29:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506582; x=1757111382; 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=iygv8tGHGS6Phz8vrjGWEgdybmn9tz5c134WHcDFPJg=; b=cUEVZVG9FE6I2VMj+gnvAaJip1JEn5Iym4fUzby2eN6bSWKQnO6jiw0s9Ojlwkw8Et PDWqb69Nz5UsaCUXN3gEPakWFpDaSw1dngkFty6rCmOUDEHq78c5Zsa5QS9UhOULncCl WI/vbhtT5/qg2nGbU7xKo9NJdLMsqkTUzgo5zTsvr24XXC6ayQTzhBeOUt0NXL7TESk0 PqLqNeKUtmG9aXK4dPFIbBuummPqzuarcw4GQ5qKnMrCG07yqdpUyfjP8CZBRWrds/BG wWyIQbL+rXw0Tz4bwg9W5oYTlWrbCXcCEj4g2tJeURwAab7T2XWTUJWEM0Qh/5t9B6hj VFtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506582; x=1757111382; 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=iygv8tGHGS6Phz8vrjGWEgdybmn9tz5c134WHcDFPJg=; b=Eef5CDPQzdA81rnns80DeaxoBDdILpxIRnLqM1xpbthA7RjHo0Q8hfa83F7/dWR/jD nWes7L+sKF1gGToKvqfPasCuKbahC6AbtqaiQzFUorb8sOzrv+wkoNmlqnSqO1ZdLlrF YGT3K6kXJFQREGDacKJ/viJ1ga8Nm3QHoEmpfG5/Gqp723IInu73vXFuHhV0u6s27dyU Qtie3FAZDeIbWE/h0CUsYYBZWwRGSJgccxjo+6TV+iSQCQ5jF1KffeSn3ayMIweWFdJY 4jY/fozRIsF/bxbcyNSxXF2wby12H7FSRULiS9+T152RrHJWAZ7LTIPWdOABUZtFBPFo RsGg== X-Gm-Message-State: AOJu0YzOhygV7oXh3s6LITYsPjvbWjD4+Xt17ikdACyNrQmKCgGyc1xr E9FJiL4Zb4VLHGzLVymSsl04xCLIr6dwLvv/9ZzRjGS1qKzgm4J2oPea/MGjerXrHjjNEX4WGx4 D98PBl8U= X-Gm-Gg: ASbGnctG6QzbDx9C860GXu/zQf7V+syuQpkmstlrkyNM2ZZEIdYMPONj4x5fCWVIBqz wKeOU+vj4wBsaGrQ+IjBSXCgVtQXh/1xh0KwLZQtwZ95c2QPDkwAvfxBvYNfeS4F5QxPaWAutyE shbBBpvcEXvu+JhtAF7vmAEOWIa2L5IIQ0TcPH3j7578bjpGu/epqE8nThOaMMMGf91oC+pDEHp LBnnn6T0EXRh28qRmqvV45Vp5bJ6/xlfqiZWrh0K967yypJ6i9NWp9KWh4CxGDKL+Cc3n2sTzKK 5bUoeUeWZ6XFfvJDtgWlt6fmKzX1BVdtz+u0IcHS17aS1LbgYhpfi8QvLf/dlWnc1HVnYc2f1PE kEp6QB+n9ohzukNwqwJVpubA+A4Kjc273Vzy5XDPODy80nr2tEwXf8ouSuERW+2/YFglLDWThuw == X-Google-Smtp-Source: AGHT+IG/cwRp+gj+FqK7hJBUYU/RING2vYRLnVzHqn+4AvBykZYQxtEvpHMgKVPSKuhbRdbHwwOwIg== X-Received: by 2002:a17:903:2f8c:b0:249:37b2:8630 with SMTP id d9443c01a7336-2493ee070bcmr9887275ad.5.1756506582435; Fri, 29 Aug 2025 15:29:42 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 53/91] linux-user/ppc: Create target_ptrace.h Date: Sat, 30 Aug 2025 08:23:49 +1000 Message-ID: <20250829222427.289668-54-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756569558978124100 Content-Type: text/plain; charset="utf-8" Move the target_pt_regs structure from target_syscall.h. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/ppc/target_ptrace.h | 26 ++++++++++++++++++++++++++ linux-user/ppc/target_syscall.h | 28 ---------------------------- 2 files changed, 26 insertions(+), 28 deletions(-) create mode 100644 linux-user/ppc/target_ptrace.h diff --git a/linux-user/ppc/target_ptrace.h b/linux-user/ppc/target_ptrace.h new file mode 100644 index 0000000000..df77bfde73 --- /dev/null +++ b/linux-user/ppc/target_ptrace.h @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef PPC_TARGET_PTRACE_H +#define PPC_TARGET_PTRACE_H + +struct target_pt_regs { + abi_ulong gpr[32]; + abi_ulong nip; + abi_ulong msr; + abi_ulong orig_gpr3; /* Used for restarting system calls */ + abi_ulong ctr; + abi_ulong link; + abi_ulong xer; + abi_ulong ccr; +#if defined(TARGET_PPC64) + abi_ulong softe; +#else + abi_ulong mq; /* 601 only (not used at present) */ +#endif + abi_ulong trap; /* Reason for being here */ + abi_ulong dar; /* Fault registers */ + abi_ulong dsisr; + abi_ulong result; /* Result of a system call */ +}; + +#endif /* PPC_TARGET_PTRACE_H */ diff --git a/linux-user/ppc/target_syscall.h b/linux-user/ppc/target_syscal= l.h index 77b36d0b46..976b4bb7e9 100644 --- a/linux-user/ppc/target_syscall.h +++ b/linux-user/ppc/target_syscall.h @@ -20,34 +20,6 @@ #ifndef PPC_TARGET_SYSCALL_H #define PPC_TARGET_SYSCALL_H =20 -/* XXX: ABSOLUTELY BUGGY: - * for now, this is quite just a cut-and-paste from i386 target... - */ - -/* default linux values for the selectors */ -#define __USER_DS (1) - -struct target_pt_regs { - abi_ulong gpr[32]; - abi_ulong nip; - abi_ulong msr; - abi_ulong orig_gpr3; /* Used for restarting system calls */ - abi_ulong ctr; - abi_ulong link; - abi_ulong xer; - abi_ulong ccr; -#if defined(TARGET_PPC64) - abi_ulong softe; -#else - abi_ulong mq; /* 601 only (not used at present) */ -#endif - /* Used on APUS to hold IPL value. */ - abi_ulong trap; /* Reason for being here */ - abi_ulong dar; /* Fault registers */ - abi_ulong dsisr; - abi_ulong result; /* Result of a system call */ -}; - /* ioctls */ struct target_revectored_struct { abi_ulong __map[8]; /* 256 bits */ --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756569551; cv=none; d=zohomail.com; s=zohoarc; b=fKQeOPcxtpQgH/d6+PoR8gumGL0wLzyGvj0v9cz88woJgzZr3LdaGaO5+ViYQUqDi8L223638c2ZQt75HY5EmRUmosnrCNzSO5H1JYtN8FYGFBrNVusRPtGY9IcBBAijCa13Ot+WU1ofMAJQPPcU9HTPETCk3XkWl4BJo6lMv+o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756569551; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=QqPfbNKA06t+UTNS9gbkWsyk9nvfuwNoDjToDAtDRNI=; b=ehkDUnAPGfZ8/APr5bMtywQh9CeBP124WRW+r/PU/IfqBDk8ga8tN5X26TcQW5rFGXea60sCsJ+GAvYJAU8ZPxanJwsP0TaTMaBmt9wYYv2uy2hd4QBCGB8jfObRvfCB2ryYSLot6+fWmPii0tqCDCrxo/litSc/DBDECXwfKm8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756569550957702.4899191765635; Sat, 30 Aug 2025 08:59:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNlF-0004PO-Oi; Sat, 30 Aug 2025 11:45:02 -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 1us7bQ-0004Rw-Eo for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:48 -0400 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7bO-0003dN-Ix for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:48 -0400 Received: by mail-pj1-x1031.google.com with SMTP id 98e67ed59e1d1-32326e20aadso2799751a91.2 for ; Fri, 29 Aug 2025 15:29:46 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.29.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:29:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506585; x=1757111385; 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=QqPfbNKA06t+UTNS9gbkWsyk9nvfuwNoDjToDAtDRNI=; b=cfH1/YNnM7ueY9b6kmxrTMqijaEdkuiGOjTTo19357L2BGvYNd5K1SJ3lmvk37Dg0u PEGhaiFhsK/S7iHCmFW3cDiR37x7x8bH+nCXoJL6tmFhuZYAzbwo5zEaziuFNQ9gvO/T EBOyMu7sbFWbOwwX8Z4vAvgq6Jtz4bq5r+MciA9Oobs7b9nRtqd37WP+roEt93kD2b8E IKyeroVnD6HTFdLANHF/OJDqEY9InBCOq0iXvlyathlsXXvzlgxkKpkNDyuXUDX0jXc4 7AZtjBe87ZtbY0EepTUodMw0jHOl9lHYtIGwoL0Uz7cLbo3KsqIf7ZyH6xxlKV7YTbY+ WY4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506585; x=1757111385; 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=QqPfbNKA06t+UTNS9gbkWsyk9nvfuwNoDjToDAtDRNI=; b=TtWWc1oE8gxxsG71LR0deh3XKonu55kWLeyPldJOWK+1XPYvFz0c73fJNYg1dRel4J jI73VcXT95ZCnyz3N1gFKtVqLOOiJqEIPTphEjbe3BHGJ/BSC7b3J+Knax0/zNRBloSb 5KlM6dHtkKVXEsuhPeXpu+qhdGdxi+M6jKHgkRHuxwbSA88BB7LZTyUX9AgkNCkWacl2 gVleFgT17GhxAUvofkh/nuhtACL4yvhvzcaEqKwrTY7xAEbpJPoSZaaA6AhWTWJYJdP3 +tx0fzHjbQZoXgGwW9xn0PZGaNhmjBaZVLYHas2S4ra5D11w24FtRv12jkUPC2HnysHK O2nQ== X-Gm-Message-State: AOJu0YxdYkVVOKNiJCRT790Rj62tHeew4KyZzY7XjNj2nPVvgcox9IFb +DaTf54gi2L9Gc29rnPLkPcwNg0PTwR6ApVZNDe6B5fQpj9WT1UvEwTKVWBUEQFOWNiTSU0yjuH c/vAc/24= X-Gm-Gg: ASbGncsoeCn0prO7BO30sPfgTJYigXG5Qhw0wXzEWmyRZcFc34Z0pLFmmXxYa6l47Gh r1dfIHHxu70RJQPn55GMJNzWw0PYflDZ71FLMkQE+bi/HzwLb6s0jZcCj70YZtIHpO9cCc5bwsV lt7FgiTFETRmMD+FXHSEeVR36OIVvMHNGOLxlBhgN1+YcPG+dz2rTENhRQqXtnc/ov6lEFep9EG pRmQhcguo+7aIZNsfMyOa8g8okB3Ys0ximDXI9Etnrxnj67BOAyW1Bi2S+4LfSZ7lHmNjNea7NI 4W5Zaft2oUdywwU75z3cvJxQY7h97lRQRrSS1oMCTJycv86x0YODOHGnRnG2d0gCx/Y/Rv2duly t7g1v9prnjvGW+Ey4tfXXxP4GUi1pm8qhCKhv6NwZVGSJEEa5iA6wT2wW3wqoqdMNlzGYf1Y+qg == X-Google-Smtp-Source: AGHT+IGjufkwQUUanUyORsttC84G+hr8V9R7SW4SGGrxSxe5gNtjBygtE4g9RHTKqS1VPXNI2NS5jg== X-Received: by 2002:a17:90a:d606:b0:327:dcab:d4f0 with SMTP id 98e67ed59e1d1-328156bac20mr335354a91.19.1756506584872; Fri, 29 Aug 2025 15:29:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 54/91] linux-user/ppc: Expand target_elf_gregset_t Date: Sat, 30 Aug 2025 08:23:50 +1000 Message-ID: <20250829222427.289668-55-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::1031; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1031.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756569552554116600 Content-Type: text/plain; charset="utf-8" Make use of the fact that target_elf_gregset_t is a proper structure. Drop ELF_NREG, target_elf_greg_t, and tswapreg. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/ppc/target_elf.h | 16 +++++++++++----- linux-user/ppc/elfload.c | 23 ++++++++--------------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/linux-user/ppc/target_elf.h b/linux-user/ppc/target_elf.h index 72615553ea..2a61cd2896 100644 --- a/linux-user/ppc/target_elf.h +++ b/linux-user/ppc/target_elf.h @@ -8,16 +8,22 @@ #ifndef PPC_TARGET_ELF_H #define PPC_TARGET_ELF_H =20 +#include "target_ptrace.h" + #define HAVE_ELF_HWCAP 1 #define HAVE_ELF_HWCAP2 1 #define HAVE_ELF_CORE_DUMP 1 =20 -typedef abi_ulong target_elf_greg_t; - -/* See linux kernel: arch/powerpc/include/asm/elf.h. */ -#define ELF_NREG 48 +/* + * The size of 48 words is set in arch/powerpc/include/uapi/asm/elf.h. + * However PPC_ELF_CORE_COPY_REGS in arch/powerpc/include/asm/elf.h + * open-codes a memcpy from struct pt_regs, then zeros the rest. + */ typedef struct target_elf_gregset_t { - target_elf_greg_t regs[ELF_NREG]; + union { + struct target_pt_regs pt; + abi_ulong reserved[48]; + }; } target_elf_gregset_t; =20 #endif diff --git a/linux-user/ppc/elfload.c b/linux-user/ppc/elfload.c index 114e40a358..0d54da9803 100644 --- a/linux-user/ppc/elfload.c +++ b/linux-user/ppc/elfload.c @@ -131,23 +131,16 @@ abi_ulong get_elf_hwcap2(CPUState *cs) return features; } =20 -#define tswapreg(ptr) tswapal(ptr) - void elf_core_copy_regs(target_elf_gregset_t *r, const CPUPPCState *env) { - int i; - target_ulong ccr =3D 0; - - for (i =3D 0; i < ARRAY_SIZE(env->gpr); i++) { - r->regs[i] =3D tswapreg(env->gpr[i]); + for (int i =3D 0; i < ARRAY_SIZE(env->gpr); i++) { + r->pt.gpr[i] =3D tswapal(env->gpr[i]); } =20 - r->regs[32] =3D tswapreg(env->nip); - r->regs[33] =3D tswapreg(env->msr); - r->regs[35] =3D tswapreg(env->ctr); - r->regs[36] =3D tswapreg(env->lr); - r->regs[37] =3D tswapreg(cpu_read_xer(env)); - - ccr =3D ppc_get_cr(env); - r->regs[38] =3D tswapreg(ccr); + r->pt.nip =3D tswapal(env->nip); + r->pt.msr =3D tswapal(env->msr); + r->pt.ctr =3D tswapal(env->ctr); + r->pt.link =3D tswapal(env->lr); + r->pt.xer =3D tswapal(cpu_read_xer(env)); + r->pt.ccr =3D tswapal(ppc_get_cr(env)); } --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756570702; cv=none; d=zohomail.com; s=zohoarc; b=VotlfZWvIOYWYaYa0jQtyEgwm4ItaC8BKembW4eEBvmEUm3uzDEGFsAqEnG2oHKmAVD/My3R3we/6vY+lq0RDzP5Hs6YKKPd8Sa8f/NWxRoJUDuidwOfeofmCSw1y11okthkL33rVODPGnfUyMg4OPtPP2DskQcmaLvvtAID3kU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756570702; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=3onby7ODl2TCu42msIZ4L7gUXb7Wcm8sz19Cp/OMZ60=; b=VX2UI7iBYH6mI+hx+1EXC/VQyFAiywwMdd2sAWHaARcnfDFMBW5JJ1zEyfjOBL81jnJQkimpTYBeScqwoheCxMIX2/OXv1I7kerzCmciM+wN5c4lEwrgLqjSa05BwNfgu11b8ikI1hmxV0xioy/JBPNupLz3gdMb1XwMVR5bITM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756570702750640.3649298982496; Sat, 30 Aug 2025 09:18:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNk7-0000KC-Nu; Sat, 30 Aug 2025 11:43:51 -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 1us7bW-0004Ue-Ce for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:54 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7bQ-0003dq-Q9 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:54 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-7723cf6e4b6so124029b3a.3 for ; Fri, 29 Aug 2025 15:29:48 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.29.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:29:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506587; x=1757111387; 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=3onby7ODl2TCu42msIZ4L7gUXb7Wcm8sz19Cp/OMZ60=; b=gzi7wQsX+trfK73h6ZkLAKMjrUAvXJ2ujQdTzxDluT/Ey6ulVerEvOaozRGFjEMAZY PjuignkV/2Q+TWcdymayRdy2ErCQrNYO/e3sadAqQ4vGU9h0fAPiPCPMOJidnmnY5lc9 pok3HY2xouLVVjwowD+/t9/Thtx7yuqwGQEtBlk9snGtb6HN58uiRtgxuEZH2ZDasmsc VUQBVIygP6x0pTe8JIXvB6mdzvOBxZWk+TYDmfLd+tnRNH3k9vUZn3sODFteY+ajsPLk +CIWF5sLYNFkJFS+RmuNHa9Dd5kBFcA3xXMJMDhVJSCdwRMIT6/jOUXsnS8HwVpxG7Rk EnOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506587; x=1757111387; 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=3onby7ODl2TCu42msIZ4L7gUXb7Wcm8sz19Cp/OMZ60=; b=FhjFSEI98ShMqWeLldrFpzTu6ZcviW63Nvk4ZyFn5acEPKRhkAlL6vfkg7rPewcftc I5VocoI2aKyzYqi3Lf8uh82jsHkzHFh/oXchRzcT8J7OB8n5MqH2Rd/SIZAIsmJFszn1 mlCBfoXGObSlEyOkeJvBkBjuK+mKBNuetm3HLkg6fuTH7E8dOeEYFMht+a+NCDdJ5oSh KmEq1ksSPzhw71ofRCbUT9+nk2wIgnKXLIom/MO8gIcvhTcr7AjDdkFZiojFuL0C/zJe 6tv2502sZBVvb0wip+aRBqOz/XEsLl83kWYecS00nvYIJx2vkKNNwH6bWHy3DrvgNwqG lVGQ== X-Gm-Message-State: AOJu0YyQ5oXgQ+0sYgo8pKs2ejwKW9+9R2tI/HpfOIpuZWahO6VxEvEw rN2PqpKnD4xRsGAzYNKbXUkrsZ7ZQY22ai12eI462rZlXnaepCRU1QhqIHMflPqMdmektZ3aYN3 /v9tkW1I= X-Gm-Gg: ASbGncup9pOA83JoMZgKvOKUGWRzwyJKIvNAbxUNFc8w5wb+xUQSujoSrvdKIceVn4C x3Sn2ekxzw0QwS8GwrAFjpBYD+varJX6NzVTLrCx9fWdIC0FDqiye5uT4wIFAksZpM+J7eY11Bk K3VHtKkFIM95sP91BqSP4Pik9iDYCKHkE02/H6XvcAUOXt+l2ETkHb/p2QA9EwUKr31Wmvb7fpc WoG1w6ubGbdqJepIWIAZWmARcwJsEPtC3OgLgO+2JHXq9CbhhrgyNN+wdtUxb6rlGkklf6/lq8N dTrTSSBPW0/4rWOVObCjxDOoIxZyD7HOyDVwgk6g/locmgQr+r7BbwBesuVdUcfLoNzH4xgDsjk m/xQ/67lnqMlzxW8aMwcxxTYUuRSDHGb544CTq1ct8hpE+CPh8xF80/cRTy+lhhGi6srLvp7KLg == X-Google-Smtp-Source: AGHT+IGe2431O6pHDl5KA933x5Avz1pR5Zn940gDknHMBnfvEebVlzWxw+t4iYKJiTCHCfn7klo+HA== X-Received: by 2002:a05:6a20:72a8:b0:243:78a:82a4 with SMTP id adf61e73a8af0-243d6f7e69cmr317879637.58.1756506587363; Fri, 29 Aug 2025 15:29:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 55/91] linux-user/s390x: Create target_ptrace.h Date: Sat, 30 Aug 2025 08:23:51 +1000 Message-ID: <20250829222427.289668-56-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756570703973116600 Content-Type: text/plain; charset="utf-8" Move target_psw_t to target_ptrace.h. Note that abi_ulong already has an attribute for 8-byte alignment, so there's no need to carry another on target_psw_t. Remove the target_pt_regs; add target_s390x_reg to target_ptrace.h, which matches what is actually used. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/s390x/target_ptrace.h | 18 ++++++++++++++++++ linux-user/s390x/target_syscall.h | 22 ---------------------- linux-user/s390x/signal.c | 1 + 3 files changed, 19 insertions(+), 22 deletions(-) create mode 100644 linux-user/s390x/target_ptrace.h diff --git a/linux-user/s390x/target_ptrace.h b/linux-user/s390x/target_ptr= ace.h new file mode 100644 index 0000000000..a5ceb75a74 --- /dev/null +++ b/linux-user/s390x/target_ptrace.h @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef S390X_TARGET_PTRACE_H +#define S390X_TARGET_PTRACE_H + +typedef struct { + abi_ulong mask; + abi_ulong addr; +} target_psw_t; + +struct target_s390_regs { + target_psw_t psw; + abi_ulong gprs[16]; + abi_uint acrs[16]; + abi_ulong orig_gpr2; +}; + +#endif /* S390X_TARGET_PTRACE_H */ diff --git a/linux-user/s390x/target_syscall.h b/linux-user/s390x/target_sy= scall.h index 4018988a25..f01f9a0baa 100644 --- a/linux-user/s390x/target_syscall.h +++ b/linux-user/s390x/target_syscall.h @@ -1,28 +1,6 @@ #ifndef S390X_TARGET_SYSCALL_H #define S390X_TARGET_SYSCALL_H =20 -/* this typedef defines how a Program Status Word looks like */ -typedef struct { - abi_ulong mask; - abi_ulong addr; -} __attribute__ ((aligned(8))) target_psw_t; - -/* - * The pt_regs struct defines the way the registers are stored on - * the stack during a system call. - */ - -#define TARGET_NUM_GPRS 16 - -struct target_pt_regs { - abi_ulong args[1]; - target_psw_t psw; - abi_ulong gprs[TARGET_NUM_GPRS]; - abi_ulong orig_gpr2; - unsigned short ilen; - unsigned short trap; -}; - #define UNAME_MACHINE "s390x" #define UNAME_MINIMUM_RELEASE "2.6.32" =20 diff --git a/linux-user/s390x/signal.c b/linux-user/s390x/signal.c index df49c24708..96d1c8d11c 100644 --- a/linux-user/s390x/signal.c +++ b/linux-user/s390x/signal.c @@ -22,6 +22,7 @@ #include "signal-common.h" #include "linux-user/trace.h" #include "vdso-asmoffset.h" +#include "target_ptrace.h" =20 #define __NUM_GPRS 16 #define __NUM_FPRS 16 --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756571921; cv=none; d=zohomail.com; s=zohoarc; b=GTgmQQKfFmNf0QGArJxBf1EdriuKtpwhZvr1CC0E/tLaFsbOcGe4lfZV95ClhdgshzLLW2Udr/vWzOfEoHvif8wcKaP4+udeA9tXIyu9JfYN7v4o4bMtOcsraNpy/SV77CuyfrCz3SYYEpyOAVtelA4Zd1ie4tgsIBdricMnYFo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756571921; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=TQEcJTT7KxKo513q/VtGBlaErUnfHZO8KB5vUddw60o=; b=mR8WaVscqHXChGjpyD3KtjNCFyVHccJDMOKOHfhiTguBIDkBYmNwIxKKuaWmTbkg9ALDVOFdMMVdYpuWNix7EMRG1RPAoGx8fcsczDuwu7BsBblQN/k5+GytscWzo64i8/uLCSuPpIpU3GVP5b9nwTdkc9KCvlArJ3WFTQAT9r4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756571921832623.8980460544642; Sat, 30 Aug 2025 09:38:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNlM-0004ob-IG; Sat, 30 Aug 2025 11:45:09 -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 1us7bV-0004UP-QE for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:53 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7bT-0003eI-8H for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:53 -0400 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-771eecebb09so3480515b3a.3 for ; Fri, 29 Aug 2025 15:29:50 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.29.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:29:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506590; x=1757111390; 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=TQEcJTT7KxKo513q/VtGBlaErUnfHZO8KB5vUddw60o=; b=m+V+gih3vOacEsT/q8Rau9bfRxoqbW/iqoPDp3kmkL81I6Z2XskUP5CRa2q2O/Uk+r 6uF890OmqhzC+LnlnCKk8I5Ftz05+5z3Tah8j15hVjGMEebvk7hIyPM/Te0f6JEkANEa D2pUDJRAKoG5YBzMBIy661+GN8Pyssp+ljxy2JLwQsDq8Ecigg0oMYdpFYT3rFzOjyR+ doPpEI6o4ZKFmlGV1NnVGdvM4jJZ+cjI9XiAzt1KyuYlYa56+khUd+KJfp4AEwExceYn FLx0qHwHpf5sQmN9a5hwti7D/Ljyz8KEmlXPHvs0//62oQSlmKSXyGZye/hTH9TgWHEq EpAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506590; x=1757111390; 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=TQEcJTT7KxKo513q/VtGBlaErUnfHZO8KB5vUddw60o=; b=O7avYvhmTmeDvYYCEIsxz6NsVfcBzZopyt4u65I6Z2rXfb4TpqbC42+0fHv6yrYzzu ck7IIeXblD7ApZkvvh0dlx+ZoiUhl79IXFMFsdopkP5EVVEDkKlxOJ1Ge0i7Tm76jegR V+5wposdUnFFqriXtbhrIgcSVvqShj56Jkoc6pPsi8vWYQERhLCrBlnjDAPnsKvvmlA8 Ctoe7fELjB5BNmoaoc57kRWjH4mYa1kQCM89FwoG/uxYDKiNvrnOapseTTkk+gb+mqFI 3M3ElBE6Xzh1Wh9Ye/n2CTxvUjGHXnE2CByqCS2DTxWiEeaYz2pqi3A3s4djW0vBXTJr jTGA== X-Gm-Message-State: AOJu0Yy2ErFE8N29aoCCJzVjbWuktJr6SLGsMnWEjV1wvw25rtvC6c1A AazEwqxiKRDJ6ajccM2hInmUrCJbC2P2MTIozIqr23rw7fYyRrMFjO/+Id0v6kVy1PLwettRLg+ 2nE3xVoE= X-Gm-Gg: ASbGncslJX+h6QPBFZf/LgjWCJ0CYqPouYDAxMqAyjrfcKTKZOtoX9Gj0lvqo9Cv9bT bkSVKMJt4Sj/+bL9gTVy51c8UMLTL/9biOC1Bvzbev9mWC6z7goOiwjFNhQqOzkgn/RNTdgMaW1 +eSfn8KY7FD7B0g2fjE2RC6Pg+9xDWtUdRcL7EG4+xeFSh4bqasStjDyp23JoqhP2Z/Fkzi0WXQ JXEyYMhk3NZ1bFgzfSVL4/+sCYNikws8NdmIU1wXZb18rL/hif4wcFPDGoLuGueiWFTH31O7V3M TNVucDk/UOLvRZZoOfjS/4QfyGfggj95n6h3hlm8wufmqbUEFnz/m6UI247JttWqmbPxaQWMZxb iyYJ9y/UV6yFEldPslb7d2prLNjmbgozDqs4+JFja3xXNNFfpQHttuiv1/412Uk6d0OKML1IEbw == X-Google-Smtp-Source: AGHT+IG+AUm9+euy6mP52to8wU/OJpIBaw3hjE2F6To7AGnabgL273wue8jRDm4RrjzgGS32VLVXcA== X-Received: by 2002:a05:6a00:cc9:b0:771:f567:5bd2 with SMTP id d2e1a72fcca58-7723e3b13d3mr266556b3a.22.1756506589773; Fri, 29 Aug 2025 15:29:49 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 56/91] linux-user/s390x: Expand target_elf_gregset_t Date: Sat, 30 Aug 2025 08:23:52 +1000 Message-ID: <20250829222427.289668-57-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756571923579124100 Content-Type: text/plain; charset="utf-8" Make use of the fact that target_elf_gregset_t is a proper structure. This lets us drop the ugly cast to uint32_t* in the middle. Drop ELF_NREG, target_elf_greg_t, and tswapreg. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/s390x/target_elf.h | 12 +++++++----- linux-user/s390x/elfload.c | 28 +++++++--------------------- 2 files changed, 14 insertions(+), 26 deletions(-) diff --git a/linux-user/s390x/target_elf.h b/linux-user/s390x/target_elf.h index b7d863ee66..670c7b3eed 100644 --- a/linux-user/s390x/target_elf.h +++ b/linux-user/s390x/target_elf.h @@ -8,15 +8,17 @@ #ifndef S390X_TARGET_ELF_H #define S390X_TARGET_ELF_H =20 +#include "target_ptrace.h" + #define HAVE_ELF_HWCAP 1 #define HAVE_ELF_CORE_DUMP 1 =20 -typedef abi_ulong target_elf_greg_t; - -/* See linux kernel: arch/s390/include/uapi/asm/ptrace.h (s390_regs). */ -#define ELF_NREG 27 +/* + * See linux kernel: arch/s390/include/asm/elf.h, where + * elf_gregset_t is typedef'd to struct s390_regs. + */ typedef struct target_elf_gregset_t { - target_elf_greg_t regs[ELF_NREG]; + struct target_s390_regs pt; } target_elf_gregset_t; =20 #endif diff --git a/linux-user/s390x/elfload.c b/linux-user/s390x/elfload.c index 4113273b72..27109279e2 100644 --- a/linux-user/s390x/elfload.c +++ b/linux-user/s390x/elfload.c @@ -68,29 +68,15 @@ const char *elf_hwcap_str(uint32_t bit) return bit < ARRAY_SIZE(hwcap_str) ? hwcap_str[bit] : NULL; } =20 -#define tswapreg(ptr) tswapal(ptr) - -enum { - TARGET_REG_PSWM =3D 0, - TARGET_REG_PSWA =3D 1, - TARGET_REG_GPRS =3D 2, - TARGET_REG_ARS =3D 18, - TARGET_REG_ORIG_R2 =3D 26, -}; - void elf_core_copy_regs(target_elf_gregset_t *r, const CPUS390XState *env) { - int i; - uint32_t *aregs; - - r->regs[TARGET_REG_PSWM] =3D tswapreg(env->psw.mask); - r->regs[TARGET_REG_PSWA] =3D tswapreg(env->psw.addr); - for (i =3D 0; i < 16; i++) { - r->regs[TARGET_REG_GPRS + i] =3D tswapreg(env->regs[i]); + r->pt.psw.mask =3D tswapal(env->psw.mask); + r->pt.psw.addr =3D tswapal(env->psw.addr); + for (int i =3D 0; i < 16; i++) { + r->pt.gprs[i] =3D tswapal(env->regs[i]); } - aregs =3D (uint32_t *)&(r->regs[TARGET_REG_ARS]); - for (i =3D 0; i < 16; i++) { - aregs[i] =3D tswap32(env->aregs[i]); + for (int i =3D 0; i < 16; i++) { + r->pt.acrs[i] =3D tswap32(env->aregs[i]); } - r->regs[TARGET_REG_ORIG_R2] =3D 0; + r->pt.orig_gpr2 =3D 0; } --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756573626; cv=none; d=zohomail.com; s=zohoarc; b=aZyLfLgNLYD5XurixPY0+3ZTlrfL4skiymvB51Yl/70VmQFocdj6OSYvdU/YumSJghnBMEbPeelhtw430RAT9+p/KL7RtL1oMYq+LRYhPjzd1+/O4hsgG3LBfE87xG2yi1u7PYSSXBJAwt+IHRM707BBGc+F+VSXpqvtbFEuZvM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756573626; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=e8tFEvO+ZoPBCLNHGonW69VnjHHVqS7I0HfatvFevHQ=; b=TEYK19swmx4bwxCXKW0gqxAk/sAQFKsaG6BG2rZH9fHQ8B88wcHZrBOFBxIGOv/2z/4liQSeFk8kUdcIW8CqWxuBqOCy3zKcfX1YPVmvmh9IU1p7w9VaGDtCuPIxHuCGz5vVlYqlBC0l6k8uG7Tubxb8vRBK1KpnfgIgPeHYYtA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756573626593432.00367641763637; Sat, 30 Aug 2025 10:07:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNlM-0004od-Ie; Sat, 30 Aug 2025 11:45:09 -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 1us7bY-0004VS-Js for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:56 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7bV-0003em-TE for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:56 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-7722e0ca299so859909b3a.1 for ; Fri, 29 Aug 2025 15:29:53 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.29.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:29:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506592; x=1757111392; 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=e8tFEvO+ZoPBCLNHGonW69VnjHHVqS7I0HfatvFevHQ=; b=g1BS7kwKVo6P+wV+DH5Ky+pLSVuJPYyifM39CFZScF2Ephz7hFkN5wG8j8sK/Isb0F 7ZtGX2s9cOnxPOcJC91qE6J2VhraOYlClkFzIlBvNwe/lmQdTx4ZTTzttzZ0NpVKctsP 5uq4xxQwDUna74x3iFeM/yf+GgYcrzFt1RcJ4Dm37skqneuKYTu+oqwAjn+rIK5obNHB Gxgepruki2NVS4PX0fnwKQcpZ9ZmfFc16ZwQW/+6bgF5hBVVev54sp1Gw42fvN9+ANx0 d/5myRhoOJVkd3cM2oQwELdJkjup6upYPPZbgOUvRuwdUOzD8Gj9YUlrAsYQuOAPalH2 axmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506592; x=1757111392; 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=e8tFEvO+ZoPBCLNHGonW69VnjHHVqS7I0HfatvFevHQ=; b=F963b+PVpfzxQtmwaxPNG886OVFqAPUVwaihVASkLpNPoy99jvvhm5SCA/7PFDeg9S DHWYzeCOUfexodOvPKUdjpbULrkWAFMnbkyYq9NPU47eDEanC27F/x//6FY9UmmeU1f8 O6m03kK0AQFn5sIWh2yJtSVc6HxQq4HQvToniaQKP5ReGVGNzqatd4SPCs4Y3DT2vsge IMEWDjKp7N28flT7GAb6Hx07zZNNDO3vxtt9R9Wscn6DI6yP+Bv1ikYLY0pxKymehH8Z qFCSkUdpQJ/abbSDegEHlSyHCDcaksPIo6rvJpNrMmyuC6lnnBUqJqHGOpfcscYxpyQI ibfA== X-Gm-Message-State: AOJu0YwYuG+Bm/0wQtAOaTaRRkiej5bssG/pqZWiuHo6+8h9uJuKw5ZY rQWVapCHPShZu57qFCU+ODdS9eosURnqkum9r/pe3PvPbuPYZpLM9cgtGJe5W7z62kous1hPoy2 IznbhS34= X-Gm-Gg: ASbGncsXhpo8VIEe5b+FDiCMYsvs0DvQuNYZVPgqlRKuOdAew0qTg3M4DIMWx4NUMjc ItptVTRPwlH9BF1rjrfT5+mbi4dy1F+CuB0IJYmEpQ5xiO3T+YdA5uZN8n9gfDwZuRbTNaBLobV DhNjqsfN/kiJoabiMnt+/Bmqx42tjmwz3kbXs6FDbUby8YQXV0mzMBDXti+HMZSRtEdF1Ols9B8 x+vC8ybbZGhx4Hq8WBWFylzz2E2wChp2gz7+ohHS0Q0nqCJAXiKPGu/MVZKTRaGzMmAC08acuY+ Zyj+A/SRaQ7X6scIerJpzM02EkXzvaq53siuzmZ0fkpSeBquPZZT7kqAQKM0MJMEkhdJ2MBeYah ywjeYQt0+OFVCOBWwo3rPDgT2TJiUxNHKtH7AjEMiF20xN9XmAx5jUKiN/QuBO6NLf/1Ki7oc0V pXSb4rrQJ/ X-Google-Smtp-Source: AGHT+IH8wlKqXSGb5ZQPZk+vvoapDAb4ZHvfdVVQPdPxGYeE4KjdlYOGeKAYG0/KuxWnib2kdqRVSA== X-Received: by 2002:a05:6a20:12ce:b0:243:9587:a774 with SMTP id adf61e73a8af0-243d6f7ef50mr290905637.28.1756506592154; Fri, 29 Aug 2025 15:29:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 57/91] linux-user/sh4: Create target_ptrace.h Date: Sat, 30 Aug 2025 08:23:53 +1000 Message-ID: <20250829222427.289668-58-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42c; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42c.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756573626958116600 Content-Type: text/plain; charset="utf-8" Move target_pt_regs to target_ptrace.h. Convert to abi_foo types. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/sh4/target_ptrace.h | 18 ++++++++++++++++++ linux-user/sh4/target_syscall.h | 11 ----------- 2 files changed, 18 insertions(+), 11 deletions(-) create mode 100644 linux-user/sh4/target_ptrace.h diff --git a/linux-user/sh4/target_ptrace.h b/linux-user/sh4/target_ptrace.h new file mode 100644 index 0000000000..b80218526b --- /dev/null +++ b/linux-user/sh4/target_ptrace.h @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef SH4_TARGET_PTRACE_H +#define SH4_TARGET_PTRACE_H + +/* See arch/sh/include/uapi/asm/ptrace_32.h. */ +struct target_pt_regs { + abi_ulong regs[16]; + abi_ulong pc; + abi_ulong pr; + abi_ulong sr; + abi_ulong gbr; + abi_ulong mach; + abi_ulong macl; + abi_long tra; +}; + +#endif /* SH4_TARGET_PTRACE_H */ diff --git a/linux-user/sh4/target_syscall.h b/linux-user/sh4/target_syscal= l.h index 148398855d..2f3557742d 100644 --- a/linux-user/sh4/target_syscall.h +++ b/linux-user/sh4/target_syscall.h @@ -1,17 +1,6 @@ #ifndef SH4_TARGET_SYSCALL_H #define SH4_TARGET_SYSCALL_H =20 -struct target_pt_regs { - unsigned long regs[16]; - unsigned long pc; - unsigned long pr; - unsigned long sr; - unsigned long gbr; - unsigned long mach; - unsigned long macl; - long tra; -}; - #define UNAME_MACHINE "sh4" #define UNAME_MINIMUM_RELEASE "2.6.32" =20 --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756570471; cv=none; d=zohomail.com; s=zohoarc; b=ANTK1rgZNmOGcJnF2gmy7D0praAc7R03L8lVQv65Ep1YJRb3GeF9PtmoIJ0NCs63zm2NAzBSWxt+ULtlWt8pQD3SZOJjSd5ZNmvXWYu3Ln8XhH68qNk+K2N8w0MTL8adR5qRrz3LuuJ/G8Dea4Yawpk0077Y6vKeKf7DCGNZ54w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756570471; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=tG/u4gMgVdHuU3y+QT/1m5OPOu2oxTo9ZF2y570v/1o=; b=SYmX1xezAZ09BhKzxlwsF1AUuUgcxdBd+aYnteGJegi4Aen4ZREAfnZTD1/LSFK2gZove/gsDuFi3mCq1RwuBR/1pvYNcfGOIM6G2JAuIsXvfgK1SyrUX3hfrms++E52r984StobK4RlFX309CUiG+JgNs//U7TjkaIrgeR9c7A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756570471614368.7248303421645; Sat, 30 Aug 2025 09:14:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNm5-0005iD-Oq; Sat, 30 Aug 2025 11:45:54 -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 1us7bZ-0004Vt-VJ for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:57 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7bY-0003fR-40 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:29:57 -0400 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-77201f3d389so2807539b3a.2 for ; Fri, 29 Aug 2025 15:29:55 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.29.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:29:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506594; x=1757111394; 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=tG/u4gMgVdHuU3y+QT/1m5OPOu2oxTo9ZF2y570v/1o=; b=SExUCg2+f7sWtgpG/v8IYa1aLCmN3+zVlfPCrAtn5gekeuGZPmgdIRdQJJRFqs7npV StGlrwtH37twlGRxSFyXSKm8cHRQM94zh1lczULwPiSo4+ZOEGpozruih4p+qB1lu6+Q LrKbWeVGK9jjMsZ1yzzxdM7Kba1PBUd3TGDIwwlUumUhPHUe2N0FAc6pN3B9EliGmbVI Hm7/Fg5l0srFIWhMfy7ij9Yokmo/qUfDh8xVsfp4UcFdBoSWTw8L98Hfkzq9WdNMDmYO mxGbhr0pYT36iZty0MCNKj8+F8JdD0DrNAoibWBy7Pk7jpBKwHbJhofFdtkeU0g83FzY /SHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506594; x=1757111394; 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=tG/u4gMgVdHuU3y+QT/1m5OPOu2oxTo9ZF2y570v/1o=; b=FCezxlKaOke1kX7b1+aENkB4QoZbW/b5WVrcKjf1sLaPcZZ8C1iOjCDWVr89rUUtRf qBwItB3gmrxki++wGzpdWP5z2foYsFgiazjTvGIiGsMtRD8poS960+qBuAwuXbav32yI N83y9mCYwLX1tAh4RUINSXkw3QCpWj6HgLZQW7C9FsVuRhIDLXo6P4/gcjEX3wI1cpor Z3nW0ISFYFCV1QFtqFpuwQhajJEXIuXDCwDwFfCuQESR4gdKbgJJoSJbYLLjbdhyTuTC 1BUZgSVtK+ue32ii5W+nStBJEpIyDa4/5CTlSFdU0PjqbsaBRmtfkVTqvTVIP7U8mr/F bg+Q== X-Gm-Message-State: AOJu0YxAchStZTOMP59FZpoF4akCB4GVk/eFxh05WWCYbIXRpSfpqoDH QAAPOtjg+eafVQapG9PeM5Bg8uKvhmeB1TmH26ESHDopVsNwW3SSu9Ux2Y3TWXC1RhBxfeF2xUM mw5rjdpc= X-Gm-Gg: ASbGncv4myS53pvmb/hcwY4nXxGX9+HM1/uNF6uckuTQuI4HAmlGDnxcGOSVf6EmUeo LCuD3FiG411osaLub+Zcb5i8ANsrJ9D/OgDjYXbegdpnmLD2SGOx9TO6aZnRsfIqPpAQP1lb5b5 x2oWQYpUflOaSTZRRD1dpYCSoV49X5p4/Qw5slcSKLgyO2x9Pms/3Q01dbEq8/QUEtfOJiAkd+M wwlpbeFPKrfzX8nq7VLxnFyWjYNpbfiJzIHDrIGb2recG0FI8nVVD5+Wz7VmR2ZeMwudwc5F6Gi 7xzn0TozYg03JezsuHJD+FxFw4nVn2dcKeH/yZlkvccjhDU4uBgo5JGD51IkYAIjmQAboNh+voh 7tx3cUG5C6o6KxzOqS4DPYviRrhMg1sEffMBBzjnrrbYgrtAuafs7Fo6YKJfjTzY= X-Google-Smtp-Source: AGHT+IH4WC17JZ8g/4tacjLrv4oy5oVbmLdhDNOARtFHS/wAqQFsADX2KBry4HxlAze4gf2flqg5oA== X-Received: by 2002:a05:6a00:c95:b0:771:f4d4:24fa with SMTP id d2e1a72fcca58-7723e3390c8mr321978b3a.18.1756506594628; Fri, 29 Aug 2025 15:29:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 58/91] linux-user/sh4: Expand target_elf_gregset_t Date: Sat, 30 Aug 2025 08:23:54 +1000 Message-ID: <20250829222427.289668-59-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756570473400116600 Content-Type: text/plain; charset="utf-8" Make use of the fact that target_elf_gregset_t is a proper structure. Drop ELF_NREG, target_elf_greg_t, and tswapreg. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/sh4/target_elf.h | 12 +++++++----- linux-user/sh4/elfload.c | 28 +++++++--------------------- 2 files changed, 14 insertions(+), 26 deletions(-) diff --git a/linux-user/sh4/target_elf.h b/linux-user/sh4/target_elf.h index f7443ddbac..fd3ae68a01 100644 --- a/linux-user/sh4/target_elf.h +++ b/linux-user/sh4/target_elf.h @@ -8,15 +8,17 @@ #ifndef SH4_TARGET_ELF_H #define SH4_TARGET_ELF_H =20 +#include "target_ptrace.h" + #define HAVE_ELF_HWCAP 1 #define HAVE_ELF_CORE_DUMP 1 =20 -typedef abi_ulong target_elf_greg_t; - -/* See linux kernel: arch/sh/include/asm/elf.h. */ -#define ELF_NREG 23 +/* + * See linux kernel: arch/sh/include/asm/elf.h, where + * elf_gregset_t is mapped to struct pt_regs via sizeof. + */ typedef struct target_elf_gregset_t { - target_elf_greg_t regs[ELF_NREG]; + struct target_pt_regs pt; } target_elf_gregset_t; =20 #endif diff --git a/linux-user/sh4/elfload.c b/linux-user/sh4/elfload.c index 71cae9703e..ddf2aaaed7 100644 --- a/linux-user/sh4/elfload.c +++ b/linux-user/sh4/elfload.c @@ -38,30 +38,16 @@ abi_ulong get_elf_hwcap(CPUState *cs) return hwcap; } =20 -#define tswapreg(ptr) tswapal(ptr) - -/* See linux kernel: arch/sh/include/asm/ptrace.h. */ -enum { - TARGET_REG_PC =3D 16, - TARGET_REG_PR =3D 17, - TARGET_REG_SR =3D 18, - TARGET_REG_GBR =3D 19, - TARGET_REG_MACH =3D 20, - TARGET_REG_MACL =3D 21, - TARGET_REG_SYSCALL =3D 22 -}; - void elf_core_copy_regs(target_elf_gregset_t *r, const CPUSH4State *env) { for (int i =3D 0; i < 16; i++) { - r->regs[i] =3D tswapreg(env->gregs[i]); + r->pt.regs[i] =3D tswapal(env->gregs[i]); } =20 - r->regs[TARGET_REG_PC] =3D tswapreg(env->pc); - r->regs[TARGET_REG_PR] =3D tswapreg(env->pr); - r->regs[TARGET_REG_SR] =3D tswapreg(env->sr); - r->regs[TARGET_REG_GBR] =3D tswapreg(env->gbr); - r->regs[TARGET_REG_MACH] =3D tswapreg(env->mach); - r->regs[TARGET_REG_MACL] =3D tswapreg(env->macl); - r->regs[TARGET_REG_SYSCALL] =3D 0; /* FIXME */ + r->pt.pc =3D tswapal(env->pc); + r->pt.pr =3D tswapal(env->pr); + r->pt.sr =3D tswapal(env->sr); + r->pt.gbr =3D tswapal(env->gbr); + r->pt.mach =3D tswapal(env->mach); + r->pt.macl =3D tswapal(env->macl); } --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756569479; cv=none; d=zohomail.com; s=zohoarc; b=JAnijfVj7uRr2Somjn0owvqaiTuIbmq5b/tqgUYFYelIQyPpp7nAi9kfpGL/A7XXoewFX4GVWEkyjTJv8d7Z2DwSCYgntxO97cfGRyqkRQxmyO6Z+5HxlGyGi63tzqoUbonwcSeTIADCu3WGGVVieQC9PZdiUab0KJ+35mJFvRw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756569479; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=dOwGWo4Z+bzLEdzdQNxxesTvr7Xf0qOSF3IPu5R89Jw=; b=lU/H3EIGnYkM7eqPedcRpmmwJdcC/wMYTCYdj6bUgrfH2nlNHLxpWTAM93DP+LWTOSwmtvX9mW3E3Yvh1/0fleow6LTG7vA/CStsaVP/SJat3kJmAR/ybv8LFgvcGZwlIhiVBxcx34TLLoSH9gvdexRDZJGvTBWHTOeHvhfdgBI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756569479910461.4651833026554; Sat, 30 Aug 2025 08:57:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNlw-0005dy-Ax; Sat, 30 Aug 2025 11:45:45 -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 1us7bc-0004XJ-Hz for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:00 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7ba-0003g0-N4 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:00 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-7722c88fc5fso1116445b3a.2 for ; Fri, 29 Aug 2025 15:29:58 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.29.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:29:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506597; x=1757111397; 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=dOwGWo4Z+bzLEdzdQNxxesTvr7Xf0qOSF3IPu5R89Jw=; b=uc7KlEm+FyfI5YsLZFw6kVESbbL+1B1N9oDSn6JSKidham52ngqhF9BIj4Tm56tbQn Ztj07omEFT6jnJ6fRwtX0YB4fAkpJLy+ob7jmgcfHOMnHzF4xLjRJsHkqLuWUBhJgPEu H0aqU/oQghQimWq6f303UvFF5IWs39mS+uY12q2QL58KMNBCY+ydi3Xdxc+Yed11jbE3 YKRlT7WDcG8vZfsgFNjcpZcRXwdj1OzXjYWHUBB/oaHJqDXixzs2mP1414znU3D+Qo35 gtDlrYO5BmU7yRs7cGX8ZTRDG9f+p687mvTryjhz+oXoQ9/WN++kUcXq6w2whhtQzk7A 2rOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506597; x=1757111397; 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=dOwGWo4Z+bzLEdzdQNxxesTvr7Xf0qOSF3IPu5R89Jw=; b=GUGXHQgVbehUOrU8YPKRd1oMKdO/+E4rPcy/axehgIvbCIEBt+RcCWjiJZGwPmGHIM HKpZ262+KT2qbT/qscv4dFTlvG8+RjQ5p8Zf2ybnY1nw8zScL7b0UA+m5KN89fVvpaWl W/QJ8IGVbIl+uTyhmwTvZps8HszZl4WNq9F0VJrW1o2xvhyOBST/fO0Ko2d5RirBQzju TkYOCr3hvJdexoWBHzaWQMViBUKk//2yL30sV5EWkHzW4m3oIVnvEP1I0dVUPAbgMgHE b53MvuM4gHZsT1a20a2xaeYnNaUJvF7FFaK5HQyxSkyCVrw5pOKNadHAbUQt0OucBpLo RNkQ== X-Gm-Message-State: AOJu0YwoUCeephA004mTmrG5euAwOnOtmxH3Kl+745FiA9tBRpMioCQC ErWj+b2oalv2HDXXdk6KEMALiEsQvy61svRT5DZaHnRjElk9pVzLz90v+n8kR/hFtwgX4Ypa8t1 /FkCdLaY= X-Gm-Gg: ASbGnctgtxy9UwOsnTmZGtMI/ERbueg0tGX/G0TJak+3nif7QRJtljMNdjfo6nschzL uH9MOoJr7DshlxrA241Ps4SjkRocC9M37rcs+D4169VBp3Ni/Mo61+M676Kkz3LcriptGmfm7+3 iDtGNrXwyHRBovI9ErJz5iJXsGEiHQGHabWdpiZ9y24+ktGtdeDMmWvyGd+eRSKcbGDdBXgewYH qcFrWmzp5h4GS0NUDF/eIfaq6QOk+J5Ap8Ebapz3z3+P2kZNCyEn2sY0YVZP1zGhsIWmV60EWLj oLIup2fyLyp4nZtLM60fueOpbRqiLCOx9Cc4p3LBvpQTwk1vdq/+EK7ofB0niOvDCRHl9VtF5z3 8KPktmf8hSlCY3P05MkFiSKWwoFMbvGrLzluZ4pZuD90kVz1Zf/7UsYnzduM6LnE= X-Google-Smtp-Source: AGHT+IGQAyBMmV+mwUsJntoN793RWJN52YEyZguk6+1CHLoom9A+Ke4UJdiNg2H5qGDunI6pk2J7LA== X-Received: by 2002:a05:6a00:1a87:b0:772:114c:bcbb with SMTP id d2e1a72fcca58-7723e1f1804mr356575b3a.4.1756506596942; Fri, 29 Aug 2025 15:29:56 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 59/91] linux-user/xtensa: Create target_ptrace.h Date: Sat, 30 Aug 2025 08:23:55 +1000 Message-ID: <20250829222427.289668-60-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756569482037124100 Content-Type: text/plain; charset="utf-8" Remove the target_pt_regs; add target_user_pt_regs to target_ptrace.h, which matches what is actually used. Remove xtensa_reg_t and xtregs_opt_t. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/xtensa/target_ptrace.h | 22 +++++++++++++++++++ linux-user/xtensa/target_syscall.h | 35 ------------------------------ 2 files changed, 22 insertions(+), 35 deletions(-) create mode 100644 linux-user/xtensa/target_ptrace.h diff --git a/linux-user/xtensa/target_ptrace.h b/linux-user/xtensa/target_p= trace.h new file mode 100644 index 0000000000..32443d0dee --- /dev/null +++ b/linux-user/xtensa/target_ptrace.h @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef XTENSA_TARGET_PTRACE_H +#define XTENSA_TARGET_PTRACE_H + +/* See arch/xtensa/include/uapi/asm/ptrace.h. */ +struct target_user_pt_regs { + uint32_t pc; + uint32_t ps; + uint32_t lbeg; + uint32_t lend; + uint32_t lcount; + uint32_t sar; + uint32_t windowstart; + uint32_t windowbase; + uint32_t threadptr; + uint32_t syscall; + uint32_t reserved[6 + 48]; + uint32_t a[64]; +}; + +#endif /* XTENSA_TARGET_PTRACE_H */ diff --git a/linux-user/xtensa/target_syscall.h b/linux-user/xtensa/target_= syscall.h index afc86a153f..5d4352a4d1 100644 --- a/linux-user/xtensa/target_syscall.h +++ b/linux-user/xtensa/target_syscall.h @@ -8,41 +8,6 @@ =20 #define MMAP_SHIFT TARGET_PAGE_BITS =20 -typedef uint32_t xtensa_reg_t; -typedef struct { -} xtregs_opt_t; /* TODO */ - -struct target_pt_regs { - xtensa_reg_t pc; /* 4 */ - xtensa_reg_t ps; /* 8 */ - xtensa_reg_t depc; /* 12 */ - xtensa_reg_t exccause; /* 16 */ - xtensa_reg_t excvaddr; /* 20 */ - xtensa_reg_t debugcause; /* 24 */ - xtensa_reg_t wmask; /* 28 */ - xtensa_reg_t lbeg; /* 32 */ - xtensa_reg_t lend; /* 36 */ - xtensa_reg_t lcount; /* 40 */ - xtensa_reg_t sar; /* 44 */ - xtensa_reg_t windowbase; /* 48 */ - xtensa_reg_t windowstart; /* 52 */ - xtensa_reg_t syscall; /* 56 */ - xtensa_reg_t icountlevel; /* 60 */ - xtensa_reg_t scompare1; /* 64 */ - xtensa_reg_t threadptr; /* 68 */ - - /* Additional configurable registers that are used by the compiler. */ - xtregs_opt_t xtregs_opt; - - /* Make sure the areg field is 16 bytes aligned. */ - int align[0] __attribute__ ((aligned(16))); - - /* current register frame. - * Note: The ESF for kernel exceptions ends after 16 registers! - */ - xtensa_reg_t areg[16]; -}; - #define TARGET_MCL_CURRENT 1 #define TARGET_MCL_FUTURE 2 #define TARGET_MCL_ONFAULT 4 --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756571021; cv=none; d=zohomail.com; s=zohoarc; b=RmFU8f324ynYkW8QmVh5ooj8iQqA4wFgWFUgFKaPjdxZMUznfJS3ZdlptzBp3TVN0bDoSKhBP/p+4NkGJtgDFGzTrJdrQfdIeZl2s57tkXOmq9b09Lun9A/sLPmRxuGIcpawoAufvKCZJj51/QEXKixqOEhKGt+4YudxLWjwBSM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756571021; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=12YsfvP3/VIIWGpVMmOPs3wywmK/KwLEm63b9p2gpgs=; b=iH1jGnNTMLC0fyRhcVQ2zI1wO+f+VvUg7SIFYvYmCdFiyU49VfvOhp9aM5NsUle0ASFGSjFRLJYmSN3HnV4jgzTMVPq5a9+xFwSZQPReZO1asWkxQXJIamIEO8NIiI7fxAP9m9VtPy5SRyR9be7jMveEKqzuaX4OR7Jr4523Dus= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756571021091261.5101664903516; Sat, 30 Aug 2025 09:23:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNm8-00061i-MT; Sat, 30 Aug 2025 11:45:57 -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 1us7bi-0004dc-6O for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:06 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7bc-0003gX-KS for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:05 -0400 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-7723bf02181so238871b3a.1 for ; Fri, 29 Aug 2025 15:30:00 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.29.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:29:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506599; x=1757111399; 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=12YsfvP3/VIIWGpVMmOPs3wywmK/KwLEm63b9p2gpgs=; b=TetSHgqS754of3NfzHBo7Equy4WHteXmQHZZXyxbvfiK3JKL2yimUM+ZOzpvoh9XRm siGJ7Yj5EQhfPwLX45VCBRiZbK/2LDd0ibAubsZ5bfAXU9cMeQp7lkhFn80OAmr1h4r6 cClR3f4IIRajF9rikRRITaI0nINSpHEywSvLPqgMLNIDWK/qTYX7rty1E5KIFQilRfDD cCkjoh+OziGg/o/miDbPrkY8LlamdHIF5ONio7NAu2pF9GJr/tUshfv95vUDD9EBvgBW 0KC0y0PetjtxYaJyzCaxWPa6F3Vjv4HLwnU6zjBPmSKPi0tAKE9d3nWkUeIICoB+EONu TJnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506599; x=1757111399; 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=12YsfvP3/VIIWGpVMmOPs3wywmK/KwLEm63b9p2gpgs=; b=JM8RNdVDxui8+TeerJKNdwh4USsw1MpWqjSeoAQBtZarqPTo1/sp4r6AKIE0ZsU6ny gmemI3kKfwsF1enU19RI1WbIS9g7TSpOkcDTi8Rqol5FpEe3bC12yD3pUcpwv0g456RL BWFSk8MUr8tbQOCzRmvTuVm46NsOBBO7aaxegsLEGR5vAuJyB5t7Anydbhsk33lTbzrw Kl/0R+2pyIur0zB3Q0hs1jaJRqkUERNp9Zym19k/WOnNXE/Aa896mYgV9Cb8ooU7e2Fk 6U7oUVWSresBX9WlfD73Ud8Z1QuF1teNn818bcFmFnG7Do4Q0fr0j7eAIa+PydGAIt+y aadA== X-Gm-Message-State: AOJu0YyUVfg/Ta05h8lplk2Gs+hcU1tJdo07UFKr/NSfXkLH7F6My/nH 5f45f80szMNiDYfYx1eSFSvsFwVs+Jx95tFinwxlhYF2MLeVwSN/1/YYf8kJdNqrrO3dUKlPiPI mFp9x88M= X-Gm-Gg: ASbGncuo6LU9ngHmtuVFVTvMc187Yp65lyBcexN0x3sTt8JGA1L3GwV9GuAc5fsonSR 4NmXY65fNpd6/L+jHcFlYdeYFaegsjNvtFeOoPgpxSQmqVQA1NUHuuuY8zuUq1vSfM3yT8yWAUB WSKOg5Uk4CB/UE1iGvPD1+kVPmDfghUmZTbyHwpueeH7YopWuZqP4TP/XdDTCJhshM3ou3VUP9R zLz/jTZAOJo05J3G3giFGME+7athUa4VyMijeko58g3Pae39mp3vUKNVzLvAR/NLnvSXd33vO14 un3aVOACbo1zHZLQYatCbWG1mxY5pAgMA+IcQIW7lyDbuQBhaddeuZnxN7/wXG74TWL2J4pUavn F8IMpdNSqkw77eDjo/Pgs8FVH9GJqOIWpEfr685PxYscu7ciKNhGnPylN0wAgwWVWPI801u47Og == X-Google-Smtp-Source: AGHT+IFPcnUxN+Lu1N/qR0jgUThS70SRQT+EiLlXzmoss4JtxdGGhpiw/wDGccvuRCr2kc6m1elJ6w== X-Received: by 2002:a05:6a00:bd90:b0:770:5736:4ecb with SMTP id d2e1a72fcca58-7723e38bf74mr269307b3a.28.1756506599181; Fri, 29 Aug 2025 15:29:59 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 60/91] linux-user/xtensa: Expand target_elf_gregset_t Date: Sat, 30 Aug 2025 08:23:56 +1000 Message-ID: <20250829222427.289668-61-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::433; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x433.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756571023607124100 Content-Type: text/plain; charset="utf-8" Make use of the fact that target_elf_gregset_t is a proper structure. Drop ELF_NREG, target_elf_greg_t, and tswapreg. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/xtensa/target_elf.h | 12 ++++++----- linux-user/xtensa/elfload.c | 39 +++++++++++----------------------- 2 files changed, 19 insertions(+), 32 deletions(-) diff --git a/linux-user/xtensa/target_elf.h b/linux-user/xtensa/target_elf.h index 43e241aac1..850a7206a5 100644 --- a/linux-user/xtensa/target_elf.h +++ b/linux-user/xtensa/target_elf.h @@ -8,14 +8,16 @@ #ifndef XTENSA_TARGET_ELF_H #define XTENSA_TARGET_ELF_H =20 +#include "target_ptrace.h" + #define HAVE_ELF_CORE_DUMP 1 =20 -typedef abi_ulong target_elf_greg_t; - -/* See linux kernel: arch/xtensa/include/asm/elf.h. */ -#define ELF_NREG 128 +/* + * See linux kernel: arch/xtensa/include/asm/elf.h, where elf_gregset_t + * is mapped to struct user_pt_regs via typedef and sizeof. + */ typedef struct target_elf_gregset_t { - target_elf_greg_t regs[ELF_NREG]; + struct target_user_pt_regs pt; } target_elf_gregset_t; =20 #endif diff --git a/linux-user/xtensa/elfload.c b/linux-user/xtensa/elfload.c index 49e709a094..68aeed855f 100644 --- a/linux-user/xtensa/elfload.c +++ b/linux-user/xtensa/elfload.c @@ -11,36 +11,21 @@ const char *get_elf_cpu_model(uint32_t eflags) return XTENSA_DEFAULT_CPU_MODEL; } =20 -#define tswapreg(ptr) tswapal(ptr) - -enum { - TARGET_REG_PC, - TARGET_REG_PS, - TARGET_REG_LBEG, - TARGET_REG_LEND, - TARGET_REG_LCOUNT, - TARGET_REG_SAR, - TARGET_REG_WINDOWSTART, - TARGET_REG_WINDOWBASE, - TARGET_REG_THREADPTR, - TARGET_REG_AR0 =3D 64, -}; - void elf_core_copy_regs(target_elf_gregset_t *r, const CPUXtensaState *env) { - unsigned i; + r->pt.pc =3D tswap32(env->pc); + r->pt.ps =3D tswap32(env->sregs[PS] & ~PS_EXCM); + r->pt.lbeg =3D tswap32(env->sregs[LBEG]); + r->pt.lend =3D tswap32(env->sregs[LEND]); + r->pt.lcount =3D tswap32(env->sregs[LCOUNT]); + r->pt.sar =3D tswap32(env->sregs[SAR]); + r->pt.windowstart =3D tswap32(env->sregs[WINDOW_START]); + r->pt.windowbase =3D tswap32(env->sregs[WINDOW_BASE]); + r->pt.threadptr =3D tswap32(env->uregs[THREADPTR]); =20 - r->regs[TARGET_REG_PC] =3D tswapreg(env->pc); - r->regs[TARGET_REG_PS] =3D tswapreg(env->sregs[PS] & ~PS_EXCM); - r->regs[TARGET_REG_LBEG] =3D tswapreg(env->sregs[LBEG]); - r->regs[TARGET_REG_LEND] =3D tswapreg(env->sregs[LEND]); - r->regs[TARGET_REG_LCOUNT] =3D tswapreg(env->sregs[LCOUNT]); - r->regs[TARGET_REG_SAR] =3D tswapreg(env->sregs[SAR]); - r->regs[TARGET_REG_WINDOWSTART] =3D tswapreg(env->sregs[WINDOW_START]); - r->regs[TARGET_REG_WINDOWBASE] =3D tswapreg(env->sregs[WINDOW_BASE]); - r->regs[TARGET_REG_THREADPTR] =3D tswapreg(env->uregs[THREADPTR]); xtensa_sync_phys_from_window((CPUXtensaState *)env); - for (i =3D 0; i < env->config->nareg; ++i) { - r->regs[TARGET_REG_AR0 + i] =3D tswapreg(env->phys_regs[i]); + + for (unsigned i =3D 0; i < env->config->nareg; ++i) { + r->pt.a[i] =3D tswap32(env->phys_regs[i]); } } --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756575238; cv=none; d=zohomail.com; s=zohoarc; b=I2G+Kr/3+NNj2Zx6J+ZTv/WCAsKTCHTArFz2PQzGchRoPYA0ZyNepM0rcwMp5b6K49J7VoD9LV7AsYM/mJbFJdeRacoXsWCFjrKFgEhddup8f+V+FOpe7xIatdt4Pac8lTHz8nX/OZgTBWNOEPS61dG/FNIblYrT+hHCWOSGsNE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756575238; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=MwqnKORhrH73/9/V7Ir0ecWiuCaz2yy8YxhnqnhXci0=; b=SNCn0DAnKFoCQHJnjIkvGOXAM4GwwPR5g0/CP2rwBKJO2pnrmwKzSB0elVwYqKwNNSCtpBHWi+g0cbc9sJBCHMjOTt03yZ+KZjNdiBGUBhKkX2avF6OEyVlnzn1eezqAJ0t1VuPr0naUOSqYkTB72UEiu5KnEbSHaq/BNZw+yHA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756575238501451.2435709570459; Sat, 30 Aug 2025 10:33:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNkB-0000pt-FM; Sat, 30 Aug 2025 11:43:55 -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 1us7bh-0004aH-Jt for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:05 -0400 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7bf-0003hD-E0 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:05 -0400 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-7722f2f2aa4so1416251b3a.1 for ; Fri, 29 Aug 2025 15:30:02 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.29.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:30:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506601; x=1757111401; 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=MwqnKORhrH73/9/V7Ir0ecWiuCaz2yy8YxhnqnhXci0=; b=afZpGtMvN9lDvQA3QQCc5iXqrf18+g9Ndd7w8CCBzgGqc5ZqGqND1BG8sUMa7td4AZ 4eLgsMA6NfMZzbuIrfvPEvVLwbyMBPXwNu5xZojwW4OHbdh7uuvo24E4oPOghhp/rZfC 5lyZkwhAgHJAUiofB/x64y+8nKM897vnQ8umjBh40UJPH11Jhd4LRZihDY1j0hBPKfsC bRQPYDU0FrxaAlQUojcTLppjWqucBRaViBhGWITIsnOnr5lh8kPaxYzZjOevYgSgM1Rv cu225QjWUe/+J9ck8NhfJErucI2BHybuy3fbIMS5AvpOoN9lrEqpKUHou4R/7F5Sq+LW 1NNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506601; x=1757111401; 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=MwqnKORhrH73/9/V7Ir0ecWiuCaz2yy8YxhnqnhXci0=; b=gM1Bax5KkQhzS+y98/BgUiVXS4Cyw5i4JqyGMjSWVEBb/kM3BhGOdkfjuuq1eq8sKm gbFxVxtTA6y8PM2WXO6Qxs0YgvOp4NXyZAiImp6RwN6lLgms7sNU3osQ6M51K7XVSpsa bSRFrHYZO83OJRpg7g7pCVRLblgUtacLEMQBeECFjKtt5Bb9oRNn39WsiPJQiHbWDlzO qbHWLdJnZl8znBPXOo8gqIfjyDJZMpqW5B0BaauoF8rXET+g9F17kDsu1+BWsbJs5Z/m 2d2jpOqujqo1hRewUHAdfKzTXnoxgDNcxg+V/QsI/82ivOpCA3H/ESxl4m72oaXC56JO tvNQ== X-Gm-Message-State: AOJu0YwEiLqg4j7YjZ9Fj263I6Jwo7PWnKfAqbaat3JhZd4zJqF3IewP kKvadeag9Ky4OWkrHHJ5ILGf/LaQxvvE9HRPftmKGEUWUyxFsb8F+CRo0OGliO2TKXvsI8SzuO5 oDMatsHA= X-Gm-Gg: ASbGnctjyM5jWRFHi2BCaTWGs5qFmBIjVcya5MvER57BAZjPxabW9LlEwns8WOvT/Kb rHWXC5iOitwZRz8sUctmaH6oEkZrhZE//ospPh+eXUfgnOwDOCzAtyD+O+rECoHSu/8dRR8jfAp uynGqKA4kNwdze/I6JbMKQA5/ScJzBQLfVWulzyF6AvacoQR7YPe9AFLC5X24gNY/27smq00bzF DE9GNO25oA9pZ/MrCsZohGJCIG40uyLP+FqhT/LH4lT4KtMINfnE7Ftkg9r+7vMy9RZV01zsVV7 vWzLm/THIwwkrJqDa8LaqUBGydHi3TGGYLgwhnXwMuAjlBbdbZPvd+dZM6dflmdqgxJyhmIZ5vX lX1+uKT7qnrwE6JrD62Ue2scGXU8BJjeemRgv+lzStAx9GPADUt2HMgD/jSjOVrg= X-Google-Smtp-Source: AGHT+IEYCYqgou01c8+SK+LIwu5csiILMNPNa+WFuTFTsMuBmPq+SeluHW0/Wg5/sLHlfklGMUfBBw== X-Received: by 2002:a05:6a00:1786:b0:76e:7ae5:ec91 with SMTP id d2e1a72fcca58-7723e3bf26bmr267594b3a.27.1756506601470; Fri, 29 Aug 2025 15:30:01 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 61/91] linux-user: Move init_guest_commpage to x86_64/elfload.c Date: Sat, 30 Aug 2025 08:23:57 +1000 Message-ID: <20250829222427.289668-62-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::429; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x429.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756575240566116600 Content-Type: text/plain; charset="utf-8" Rename INIT_GUEST_COMMPAGE to HAVE_GUEST_COMMPAGE to match the other HAVE_* defines. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/loader.h | 3 +++ linux-user/x86_64/target_elf.h | 1 + linux-user/elfload.c | 23 +---------------------- linux-user/x86_64/elfload.c | 20 ++++++++++++++++++++ 4 files changed, 25 insertions(+), 22 deletions(-) diff --git a/linux-user/loader.h b/linux-user/loader.h index 8f4a7f69ac..98015fba7d 100644 --- a/linux-user/loader.h +++ b/linux-user/loader.h @@ -105,6 +105,9 @@ const char *elf_hwcap_str(uint32_t bit); const char *elf_hwcap2_str(uint32_t bit); const char *get_elf_platform(CPUState *cs); const char *get_elf_base_platform(CPUState *cs); +#if defined(TARGET_X86_64) +bool init_guest_commpage(void); +#endif =20 struct target_elf_gregset_t; void elf_core_copy_regs(struct target_elf_gregset_t *, const CPUArchState = *); diff --git a/linux-user/x86_64/target_elf.h b/linux-user/x86_64/target_elf.h index 32a9eec431..f05b1d4dba 100644 --- a/linux-user/x86_64/target_elf.h +++ b/linux-user/x86_64/target_elf.h @@ -13,6 +13,7 @@ #define HAVE_ELF_HWCAP 1 #define HAVE_ELF_PLATFORM 1 #define HAVE_ELF_CORE_DUMP 1 +#define HAVE_GUEST_COMMPAGE 1 =20 /* * See linux kernel: arch/x86/include/asm/elf.h, where diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 07d83c674d..0ba75a83b3 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -145,27 +145,6 @@ typedef abi_int target_pid_t; #define ELF_CLASS ELFCLASS64 #define ELF_ARCH EM_X86_64 =20 -#if ULONG_MAX > UINT32_MAX -#define INIT_GUEST_COMMPAGE -static bool init_guest_commpage(void) -{ - /* - * The vsyscall page is at a high negative address aka kernel space, - * which means that we cannot actually allocate it with target_mmap. - * We still should be able to use page_set_flags, unless the user - * has specified -R reserved_va, which would trigger an assert(). - */ - if (reserved_va !=3D 0 && - TARGET_VSYSCALL_PAGE + TARGET_PAGE_SIZE - 1 > reserved_va) { - error_report("Cannot allocate vsyscall page"); - exit(EXIT_FAILURE); - } - page_set_flags(TARGET_VSYSCALL_PAGE, - TARGET_VSYSCALL_PAGE | ~TARGET_PAGE_MASK, - PAGE_EXEC | PAGE_VALID); - return true; -} -#endif #else =20 /* @@ -1215,7 +1194,7 @@ static abi_ulong create_elf_tables(abi_ulong p, int a= rgc, int envc, #else #define HI_COMMPAGE 0 #define LO_COMMPAGE -1 -#ifndef INIT_GUEST_COMMPAGE +#ifndef HAVE_GUEST_COMMPAGE #define init_guest_commpage() true #endif #endif diff --git a/linux-user/x86_64/elfload.c b/linux-user/x86_64/elfload.c index 12de1c54c7..1e7000c6bc 100644 --- a/linux-user/x86_64/elfload.c +++ b/linux-user/x86_64/elfload.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu.h" #include "loader.h" #include "target_elf.h" @@ -21,6 +22,25 @@ const char *get_elf_platform(CPUState *cs) return "x86_64"; } =20 +bool init_guest_commpage(void) +{ + /* + * The vsyscall page is at a high negative address aka kernel space, + * which means that we cannot actually allocate it with target_mmap. + * We still should be able to use page_set_flags, unless the user + * has specified -R reserved_va, which would trigger an assert(). + */ + if (reserved_va !=3D 0 && + TARGET_VSYSCALL_PAGE + TARGET_PAGE_SIZE - 1 > reserved_va) { + error_report("Cannot allocate vsyscall page"); + exit(EXIT_FAILURE); + } + page_set_flags(TARGET_VSYSCALL_PAGE, + TARGET_VSYSCALL_PAGE | ~TARGET_PAGE_MASK, + PAGE_EXEC | PAGE_VALID); + return true; +} + void elf_core_copy_regs(target_elf_gregset_t *r, const CPUX86State *env) { r->pt.r15 =3D tswapal(env->regs[15]); --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756572272; cv=none; d=zohomail.com; s=zohoarc; b=bzH4cI4R/euVSEtzjUX+icMacH/HA2fqyAui8BIGLsvu0QsM2ZQylryg3KEXMVO/j2t/AFdscqzdFJAkZJMWun1CP4Q5wRO/1n7kFC84gIg36fpBQ2yC4V3WnaROaHoIGUQDgyG3ZDD/ZR10l+sV1nNM3mzhdgimdnsD+csHuHI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756572272; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=FKxMYOztX3yzcXwsVljsK6LJXRCdoI1IIVbZGiH0hNo=; b=gFpQyQciOU9otEKKtnV8trUsFSTq8pYysewkNchkZAu/QuGExwTorakY8vEwosrF06o/cWQN+/0w3ApUKRbrdVqc+TBmB5KdC3T077+O8TyOQsyGVcQSlOAJ/rv25BYgV4c41eh8EbG2fsVI4uxnouVDwU51z74X9ksd1k0Lq4s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756572272429165.24906802341002; Sat, 30 Aug 2025 09:44:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNkF-0001Dj-WE; Sat, 30 Aug 2025 11:44: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 1us7bk-0004lr-68 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:08 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7bh-0003po-E3 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:07 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-7718408baf7so2552711b3a.3 for ; Fri, 29 Aug 2025 15:30:04 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.30.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:30:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506603; x=1757111403; 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=FKxMYOztX3yzcXwsVljsK6LJXRCdoI1IIVbZGiH0hNo=; b=I0vAozCzejMpjIWRhezJ7fufE7YQf4aDul2YKe6rPDRSVFw2TsJe9BJgQpVajxCmvI DAhaUkr7e9l5kwkodumbuuzugwcT7eZwx2+xi1wA7NCc4f4PjkV6jyneOiRlq+yD8AuM IUioVIyes7lW/onpIPeZsLcyjfti2gzBcNz9PoOrmLPj1iJL+ULvSVrThbWaUpgP4ckN zINytd6uHKhvaAwRWo1yq546+i6ZKZdeOUd4k9ip3vBcSCtwZ5smf5frQNvaZ0qrSTgD N6B0K7EoRNMe55iYJjPLTn/E8LCqjsTIn/QL0M/oLF7h8hT8OvhgLcwE/hQczcVO8ho9 EZkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506603; x=1757111403; 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=FKxMYOztX3yzcXwsVljsK6LJXRCdoI1IIVbZGiH0hNo=; b=SCkIS4gmbcK+uCfvSIh/E34L/vsdeCO6ii/1p8OBsBFRaTEmnC7pYhhgPpLKspRax0 i85VKA+lBszQOJufitCMu1qhz5bxE/hNCd/FwVm45aWlrYIXUMhbrZeNjyK4lItMWaFB magmvH1FOIRo8oaYDbw+eQDeQWdzVN8shpm07ei6jKlzUt2OVJOKW7hWozAGgD6SdkG4 xC7eoABpHAM8/v7ZN8B1Yb+AjRbn5t+JwBITxh0td7I9pEvVLouI/uuBJhuTT0mys5W7 v4A4kP44OMDei/QKK0BWUJMWcyMcXf25iMRGKS1Bx6hoxEoiALFU3ytehmYHqMFRNXVZ m3LA== X-Gm-Message-State: AOJu0YydojApRvH+xFJNFDyLtGY/P2UT8feHROeAvgB8uqn8RUA8Tz3P bilFbWM3gm9HMTAxoDOqkiGBoBNOuSQIZdCq4yW3OzuAj8/7ZlwkBipbLttSkNXQ4+F58WYAD93 hh7oyj/g= X-Gm-Gg: ASbGncvYTxjNJBLmAJO4kKoQ1liVDUvHcdJQstlv9dLmfnp31TxRgMC5ZEKHkaRfptM B5Bmc3oAGLjRSJiLorN0eD6x2cW5ctkucBVilCIVomF1N9CaPO5Cf5hJQhkLp3qgWoxBgNsTGKV /8O3og3wZzsFZa71S8U99G7vXCg4rWzPQupDnMANroJxEWQFsW5WDJdAgH6Gpvz+7MdFCY73gfY PC3+mEVePMZfFXIm4uIXg+D4N56sgoELt4NKH7HonSie8BNaqg7kpfDmTgoe83Il6KtAs/rgAXY j4lnVPIL9I/uKEA2paLHkrFtjpovcZyiZ61MOvsy9SDmJPLO/J8jgH5A7SGfCgVul3XwZPATYiZ BQRVl5NDFINPAvdRl6gj56J1jRhwdzyGRI7XFiH8FcAfSNoi0YT9hE0V2gGgCF40= X-Google-Smtp-Source: AGHT+IEdmH8gDzbPE7uBp5Nvdn1uSzcedWmXetOh73odoiu+kw1t+SpOeZQ7mc+G9DSQ7QKsCX5oEg== X-Received: by 2002:a05:6a21:3396:b0:243:15b9:7655 with SMTP id adf61e73a8af0-243d6f40f0dmr271666637.47.1756506603628; Fri, 29 Aug 2025 15:30:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 62/91] linux-user: Move init_guest_commpage to arm/elfload.c Date: Sat, 30 Aug 2025 08:23:58 +1000 Message-ID: <20250829222427.289668-63-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756572274485116600 Content-Type: text/plain; charset="utf-8" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/arm/target_elf.h | 2 ++ linux-user/loader.h | 2 +- linux-user/arm/elfload.c | 46 +++++++++++++++++++++++++++++++++++ linux-user/elfload.c | 48 ------------------------------------- 4 files changed, 49 insertions(+), 49 deletions(-) diff --git a/linux-user/arm/target_elf.h b/linux-user/arm/target_elf.h index fa8f8af2f3..5f81a43efb 100644 --- a/linux-user/arm/target_elf.h +++ b/linux-user/arm/target_elf.h @@ -15,6 +15,8 @@ #define HAVE_ELF_PLATFORM 1 #define HAVE_ELF_CORE_DUMP 1 =20 +#define HI_COMMPAGE ((intptr_t)0xffff0f00u) + /* * See linux kernel: arch/arm/include/asm/elf.h, where * elf_gregset_t is mapped to struct pt_regs via sizeof. diff --git a/linux-user/loader.h b/linux-user/loader.h index 98015fba7d..0c2cc556c3 100644 --- a/linux-user/loader.h +++ b/linux-user/loader.h @@ -105,7 +105,7 @@ const char *elf_hwcap_str(uint32_t bit); const char *elf_hwcap2_str(uint32_t bit); const char *get_elf_platform(CPUState *cs); const char *get_elf_base_platform(CPUState *cs); -#if defined(TARGET_X86_64) +#if defined(TARGET_X86_64) || defined(TARGET_ARM) bool init_guest_commpage(void); #endif =20 diff --git a/linux-user/arm/elfload.c b/linux-user/arm/elfload.c index f811c2f07a..1205687976 100644 --- a/linux-user/arm/elfload.c +++ b/linux-user/arm/elfload.c @@ -3,6 +3,8 @@ #include "qemu/osdep.h" #include "qemu.h" #include "loader.h" +#include "user-internals.h" +#include "target_elf.h" #include "target/arm/cpu-features.h" #include "target_elf.h" =20 @@ -201,6 +203,50 @@ const char *get_elf_platform(CPUState *cs) #undef END } =20 +bool init_guest_commpage(void) +{ + ARMCPU *cpu =3D ARM_CPU(thread_cpu); + int host_page_size =3D qemu_real_host_page_size(); + abi_ptr commpage; + void *want; + void *addr; + + /* + * M-profile allocates maximum of 2GB address space, so can never + * allocate the commpage. Skip it. + */ + if (arm_feature(&cpu->env, ARM_FEATURE_M)) { + return true; + } + + commpage =3D HI_COMMPAGE & -host_page_size; + want =3D g2h_untagged(commpage); + addr =3D mmap(want, host_page_size, PROT_READ | PROT_WRITE, + MAP_ANONYMOUS | MAP_PRIVATE | + (commpage < reserved_va ? MAP_FIXED : MAP_FIXED_NOREPLACE), + -1, 0); + + if (addr =3D=3D MAP_FAILED) { + perror("Allocating guest commpage"); + exit(EXIT_FAILURE); + } + if (addr !=3D want) { + return false; + } + + /* Set kernel helper versions; rest of page is 0. */ + __put_user(5, (uint32_t *)g2h_untagged(0xffff0ffcu)); + + if (mprotect(addr, host_page_size, PROT_READ)) { + perror("Protecting guest commpage"); + exit(EXIT_FAILURE); + } + + page_set_flags(commpage, commpage | (host_page_size - 1), + PAGE_READ | PAGE_EXEC | PAGE_VALID); + return true; +} + void elf_core_copy_regs(target_elf_gregset_t *r, const CPUARMState *env) { for (int i =3D 0; i < 16; ++i) { diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 0ba75a83b3..2281853c57 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -191,54 +191,6 @@ typedef abi_int target_pid_t; =20 #define ELF_EXEC_PAGESIZE 4096 =20 -/* The commpage only exists for 32 bit kernels */ - -#define HI_COMMPAGE (intptr_t)0xffff0f00u - -static bool init_guest_commpage(void) -{ - ARMCPU *cpu =3D ARM_CPU(thread_cpu); - int host_page_size =3D qemu_real_host_page_size(); - abi_ptr commpage; - void *want; - void *addr; - - /* - * M-profile allocates maximum of 2GB address space, so can never - * allocate the commpage. Skip it. - */ - if (arm_feature(&cpu->env, ARM_FEATURE_M)) { - return true; - } - - commpage =3D HI_COMMPAGE & -host_page_size; - want =3D g2h_untagged(commpage); - addr =3D mmap(want, host_page_size, PROT_READ | PROT_WRITE, - MAP_ANONYMOUS | MAP_PRIVATE | - (commpage < reserved_va ? MAP_FIXED : MAP_FIXED_NOREPLACE), - -1, 0); - - if (addr =3D=3D MAP_FAILED) { - perror("Allocating guest commpage"); - exit(EXIT_FAILURE); - } - if (addr !=3D want) { - return false; - } - - /* Set kernel helper versions; rest of page is 0. */ - __put_user(5, (uint32_t *)g2h_untagged(0xffff0ffcu)); - - if (mprotect(addr, host_page_size, PROT_READ)) { - perror("Protecting guest commpage"); - exit(EXIT_FAILURE); - } - - page_set_flags(commpage, commpage | (host_page_size - 1), - PAGE_READ | PAGE_EXEC | PAGE_VALID); - return true; -} - #if TARGET_BIG_ENDIAN #include "elf.h" #include "vdso-be8.c.inc" --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756572022; cv=none; d=zohomail.com; s=zohoarc; b=egibfILAyMgc8DaYuKjCcxwfOh3avjki8RV5wYHU1Spl8bx/bsrew7S146oSeHjmavtXPSDPY7BIloxMy70eeVxp3gn7jgNEo7eI6JhiYO9hauSNOYjAGXY/wdvcF8Tbg7KvpQz3o3S6DJnzrLbGnz3zbN5+aiR/zyCldCgnvEw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756572022; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=iohwGQx+PJHpsLcgRWLe+gDcmZ33+kolO8wPf1tJJvc=; b=KIYfGWipp2BG5god39QXt1zmMMNCrDcVVpf48C9axyp8qKK1cySVVeqgDImSPVRXRZe+VcFoGxWB9DVBK1ho9H/vj49/2C2BAXghNM/LxRCJrfu1lt5TOhMvpzASHorFZlNMTwiYUCUdhRkCj83OUEYpkAifQgXiRmDi6gjecgQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756572021987518.8265333461547; Sat, 30 Aug 2025 09:40:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNkJ-0001Xc-2f; Sat, 30 Aug 2025 11:44:03 -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 1us7bm-0004oZ-1c for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:10 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7bk-0003uG-0t for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:09 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-76e4f2e4c40so2302077b3a.2 for ; Fri, 29 Aug 2025 15:30:07 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.30.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:30:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506606; x=1757111406; 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=iohwGQx+PJHpsLcgRWLe+gDcmZ33+kolO8wPf1tJJvc=; b=wGvxw+sdOkyVcdcdURyvaeQHnAIxJ4L2hWjbW/l+tH06ndfXjsZZ6hVQ0Af7ZJvfCu RJQMynOvE6Bk4ljkRFqygpfqnMgYiVS9z+CT50bpfHaIKqkpBI4pZUSs8WKbPwfI37ol yllsuUwwlpXwllw9ZjTju+/MVzzSVLAMyflMPX+6DByBsCR9ENOqRe8lIEG1IrZvywMs qzdOY5Ex5pc3GJMqPXEu1C2ITOl/K8Fjv8inv17u2qgg9u3tuXIGpB4C5fqMqh4YjnmG Pea5oUU8CeFWhAaaT5eo4PT8iRoI1WoHSEy8BwnFN1ChHBCwVNBgPK4SiAvEQSY9p9nA ER6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506606; x=1757111406; 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=iohwGQx+PJHpsLcgRWLe+gDcmZ33+kolO8wPf1tJJvc=; b=n4bd92CO9QpuhCtl5Y+ig1E4Ku3783c4puJEi7r2cyOLzY0GGcDED0SSkNLv9d6PXs D+akBx2FdPQuNgNigwn2eh1hCcQQYal931z7fZAkxq8C9dXpdBCL2evs59H0MqJpHXpX eDj1V2zyqA/x35mHuol2Z5ZU8m3X6dkQA+q2t9Afb0RIs39nIeM5u+z/d257zRzyuVbE mCKFvODkxhJrfZAjYSUnR1C4yPhFigjXupqVGyUcyg3gK6zqqGxqeTZD+22ftorGnhtO cdH8hgW1dOxoiOPhVu/+AQ3QoCjCB1CS2XxWpqskM1VmeewPYWju5XVorJPjv6k422we ZuLw== X-Gm-Message-State: AOJu0YwnNNKJNTxwo9Z1AMxH//v8xT1I/f2Ui8/fKN/fbxQYZtiMxoF7 Ap0m3zyvRM7Hm0moiKan2Evo1QGWfI9I4jilLPgBTBvO8lpp7bOuhlhB/mH1YAC5OPA8Df2AF4l Fqv0pp10= X-Gm-Gg: ASbGncubv+DjfM45SrGtBhdDR2GgXCLgJI2v//9n6V7/RiT2GCXCAnFWi9lUyB7cwz/ zhsQ4841KYetair669mJ4EN73y1lrjJWR3AMz0cza9a04mInlBNkt7k1/4yY020Ym0TDSwpSeUi iMu0oXCpBhBKNO7MQqKuod4Xe6robRUwRsGWExKO++DWRYroKWEZgzBo4shyayfGjTi3qADZIP7 p/eJX9NGIhGjLhABU6MF4ZJfSxaxNVpxpZ/0UrNxzCBeCAbUnn7bA4JbBjYMwpJwHZZe6ZE8Xnm E46adk8VyWp5eVWh1gUuvn6V7zrN/o1Xt7HYToYtqYHWQBPDcSt1RoGliLYyQcmpxrJsTOIFHrH mGaJmkJZiI7OCxml+QDzZiO9WBu8vhMWKpMCPYkpzWjP6Cbd5B6LBnCrGTdO2RqfxMT3nhE7JiA == X-Google-Smtp-Source: AGHT+IG+NXNTK7jtChrQagzOK2TVUWHSH9Pqb1sC4hO2IUqtFpUsV2raqHuWyF4RIWdkzZV0aqzUww== X-Received: by 2002:a05:6a00:3e0c:b0:76b:fab4:6456 with SMTP id d2e1a72fcca58-7723e308c8emr282439b3a.21.1756506605879; Fri, 29 Aug 2025 15:30:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 63/91] linux-user: Move init_guest_commpage to hppa/elfload.c Date: Sat, 30 Aug 2025 08:23:59 +1000 Message-ID: <20250829222427.289668-64-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756572023455116600 Content-Type: text/plain; charset="utf-8" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/hppa/target_elf.h | 2 ++ linux-user/loader.h | 2 -- linux-user/elfload.c | 32 -------------------------------- linux-user/hppa/elfload.c | 31 +++++++++++++++++++++++++++++++ 4 files changed, 33 insertions(+), 34 deletions(-) diff --git a/linux-user/hppa/target_elf.h b/linux-user/hppa/target_elf.h index 85be00584d..b654758afa 100644 --- a/linux-user/hppa/target_elf.h +++ b/linux-user/hppa/target_elf.h @@ -10,4 +10,6 @@ =20 #define HAVE_ELF_PLATFORM 1 =20 +#define LO_COMMPAGE 0 + #endif diff --git a/linux-user/loader.h b/linux-user/loader.h index 0c2cc556c3..c3b8f92e23 100644 --- a/linux-user/loader.h +++ b/linux-user/loader.h @@ -105,9 +105,7 @@ const char *elf_hwcap_str(uint32_t bit); const char *elf_hwcap2_str(uint32_t bit); const char *get_elf_platform(CPUState *cs); const char *get_elf_base_platform(CPUState *cs); -#if defined(TARGET_X86_64) || defined(TARGET_ARM) bool init_guest_commpage(void); -#endif =20 struct target_elf_gregset_t; void elf_core_copy_regs(struct target_elf_gregset_t *, const CPUArchState = *); diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 2281853c57..25f29e60de 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -415,38 +415,6 @@ static const VdsoImageInfo *vdso_image_info(uint32_t e= lf_flags) =20 #define VDSO_HEADER "vdso.c.inc" =20 -#define LO_COMMPAGE 0 - -static bool init_guest_commpage(void) -{ - /* If reserved_va, then we have already mapped 0 page on the host. */ - if (!reserved_va) { - void *want, *addr; - - want =3D g2h_untagged(LO_COMMPAGE); - addr =3D mmap(want, TARGET_PAGE_SIZE, PROT_NONE, - MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED_NOREPLACE, -1,= 0); - if (addr =3D=3D MAP_FAILED) { - perror("Allocating guest commpage"); - exit(EXIT_FAILURE); - } - if (addr !=3D want) { - return false; - } - } - - /* - * On Linux, page zero is normally marked execute only + gateway. - * Normal read or write is supposed to fail (thus PROT_NONE above), - * but specific offsets have kernel code mapped to raise permissions - * and implement syscalls. Here, simply mark the page executable. - * Special case the entry points during translation (see do_page_zero). - */ - page_set_flags(LO_COMMPAGE, LO_COMMPAGE | ~TARGET_PAGE_MASK, - PAGE_EXEC | PAGE_VALID); - return true; -} - #endif /* TARGET_HPPA */ =20 #ifdef TARGET_XTENSA diff --git a/linux-user/hppa/elfload.c b/linux-user/hppa/elfload.c index 9dd3fe092a..018034f244 100644 --- a/linux-user/hppa/elfload.c +++ b/linux-user/hppa/elfload.c @@ -3,6 +3,7 @@ #include "qemu/osdep.h" #include "qemu.h" #include "loader.h" +#include "target_elf.h" =20 =20 const char *get_elf_cpu_model(uint32_t eflags) @@ -14,3 +15,33 @@ const char *get_elf_platform(CPUState *cs) { return "PARISC"; } + +bool init_guest_commpage(void) +{ + /* If reserved_va, then we have already mapped 0 page on the host. */ + if (!reserved_va) { + void *want, *addr; + + want =3D g2h_untagged(LO_COMMPAGE); + addr =3D mmap(want, TARGET_PAGE_SIZE, PROT_NONE, + MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED_NOREPLACE, -1,= 0); + if (addr =3D=3D MAP_FAILED) { + perror("Allocating guest commpage"); + exit(EXIT_FAILURE); + } + if (addr !=3D want) { + return false; + } + } + + /* + * On Linux, page zero is normally marked execute only + gateway. + * Normal read or write is supposed to fail (thus PROT_NONE above), + * but specific offsets have kernel code mapped to raise permissions + * and implement syscalls. Here, simply mark the page executable. + * Special case the entry points during translation (see do_page_zero). + */ + page_set_flags(LO_COMMPAGE, LO_COMMPAGE | ~TARGET_PAGE_MASK, + PAGE_EXEC | PAGE_VALID); + return true; +} --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756571331; cv=none; d=zohomail.com; s=zohoarc; b=FrqEF1L28KAvsEdrxEXKwXDOLHvKmtrFLn9WpIYm1OmM6xpYlLIuafjc/8x3Z64BhenvCuiVHAFWw77ytFUiQNHsn9TIkcwn9WMan63xOJ3WmorpV7T93mdkIEAJZErHqPiiDFt/zMxt/A8jq/pXQKNK5FLAkAtSZQN7COZcYCQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756571331; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/5ZB4KmZVQ2PXnRTjB721lcPMBvmO4keQCU+w332d1U=; b=Ewm2oj6tVuMNAmMnggGr8l6ldcyvAPhtx/sCLUpZ0uqjk3Ff2Y1LRZ7vbSxBjk2GpnrwkdP8xjxRcY4eZADY/n7s1zP264HIFop8P/7AnrZSQ2yHHFXiRKQrX8FKENfA3E0sINRU03ovVdMzJrRzOWHcx/ErDwy5jo1+l+D3NKE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756571331731579.7453977710919; Sat, 30 Aug 2025 09:28:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNmA-0006BA-5N; Sat, 30 Aug 2025 11:45:58 -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 1us7bp-0004qW-KL for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:13 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7bn-0003up-Q7 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:13 -0400 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-76e2ea933b7so2376705b3a.1 for ; Fri, 29 Aug 2025 15:30:10 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.30.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:30:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506609; x=1757111409; 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=/5ZB4KmZVQ2PXnRTjB721lcPMBvmO4keQCU+w332d1U=; b=EvvyauHAW5i8EcEA45vOOzdXPcvKpUeIA8RcYZOW0qLNHX/gVd1jVJe5f2c1kyplQg 2XGgkO3PdyIKki/kFu/rFd2a1JWW/mLdqz30W+69ZmuJYuaFjtotwthVLyuIjymgNziL +yl2r/kO+X21qSp+Zq8XSzDoBjQdgu0fFklRbTriYemFrtycNhIaa0VemoTyeeDgK8jG ZOW6JpI4HHkbn8TCR8OiDPlC5jfX+VpcWrbFn+pYO5hX0sF3Qz0LoVvu02kG7k6zdB0D BrL5PzBE7KEu88t1ysTGAzBTn06IxJ007A4xu9uaxVHxA/+jtYhIXda/vNgoDniHm6PO /EbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506609; x=1757111409; 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=/5ZB4KmZVQ2PXnRTjB721lcPMBvmO4keQCU+w332d1U=; b=fOmIFmbujqo55ybSOzIz0AyJkp/ccx4y5rO3awNA8pihLhIO9i8IF8yWIpFiTf1DB6 KDxaCHNTxsu6XhQ/1Y62tPIlDV2pcYnONoJIGMq6CV/P2hOMUma1puFcaYE3CTkCf8SZ un8UE0BY5gNgz2ciWbrAn21vjaRoWdNemPjuq9MrvhdvcJRyuji83jC8wb7EUx8Mbubp NK6IU6yZ2OtOZCFHKgWdGzFqJRK9cKx8jtY2sn/vyinmdiurpAMzd7bD9LCiRKRtK16w s6hK8Eqtg/0ZOj569jkyyXUzs1bsLugAi7zy6g8hKPbRz5hhrIEaS96fnR1T8K3FCBWr Pc7w== X-Gm-Message-State: AOJu0Yw+sdZURAVKxTneRnxBHLd+EIU+qBbvdW1hOGwPXYjyA4O//AA7 xSG5pJZ6Peaz1NXkUHDJVVpsss0EugIXhqFEVfd9t/3CaALInpLfb8mR9czrhix3a/BCPiGu+8+ 6upkzwUw= X-Gm-Gg: ASbGncvr9ARd+8oHH8So8fNRT5AM1T/CB2DSKdGS57PkU0RAQhSMIKPwWuEh7Jvekoh okg6Ujyx3t/tB8+E4PtTkR8O7IvPEvMdYBwH/o6ZsPLpiP8NNWXEi/J44S81ZkTwA90nhchyzS4 gI44+7YeC/XEeZ4uOw8wzkUall+KrG8n2QSni2IPNvLc/VdBuZ8ymcxPh/Qy/vuP1U+sYKvGFoE QyhypQ2YBE75oMxUQSVRlD0xJ1RPCVRhFg5jhtk+P+hJX/y5k8VyPUVhfKupd2fXFQVjOoy/ZEZ R+VpmH/+LQEdJdgyqRP9qjGBfKbrq9SOmoXKCmjGbJwVSEZe7KbQy9b0qQmJpVKaOEX7yTd6WBH qQqWdl0NLHic3+FXLQsaQEkdPJIIcsCxEU08uHaDWDZWoZx4iHyTHD/7Z6JZIWDdvQxWsRKUXAA == X-Google-Smtp-Source: AGHT+IGHqgg7wkZ0kwEJIR3d73aTGX5O9uPbcVO3nbt03uQkEXvz/39vWmDcEo7uMgunVpjSxO0J8w== X-Received: by 2002:a05:6a00:21c9:b0:736:4e14:8ec5 with SMTP id d2e1a72fcca58-7723e3374d8mr254396b3a.11.1756506608810; Fri, 29 Aug 2025 15:30:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 64/91] linux-user: Replace init_guest_commpage macro with function Date: Sat, 30 Aug 2025 08:24:00 +1000 Message-ID: <20250829222427.289668-65-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756571333363124100 Content-Type: text/plain; charset="utf-8" Turn the fallback macro into a function. This will produce a link error if the other macros are set up incorrectly. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/elfload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 25f29e60de..81bf05f581 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -1115,7 +1115,7 @@ static abi_ulong create_elf_tables(abi_ulong p, int a= rgc, int envc, #define HI_COMMPAGE 0 #define LO_COMMPAGE -1 #ifndef HAVE_GUEST_COMMPAGE -#define init_guest_commpage() true +bool init_guest_commpage(void) { return true; } #endif #endif =20 --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756571670; cv=none; d=zohomail.com; s=zohoarc; b=XInAobleagbY/16Mzv5MRPFnT8lzI/HXhLgQozx6CZQ7VjRZG5umXwDaYRIjfNoAJxNKNgmgVJt1NKEA63DcIy2QkWdOmPT/DX9COMY1QiKisIxpRFUL8LwryYSjYgzBginXa1sgyN2rhPySMo8yybjqDTVhZA4piyGse/G1/9w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756571670; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=aJ5D76Lv5/JEWH6fy1PlED+PdSmiXzdOglOZPBl9O+8=; b=OX3TOyFgYiEVwA4NNr3pnUcpdPjdSj7xi4p9TZxcb7B158IYTVnA1EI4JAz0WGMhfZqBJK6whL0pVhiALasgelCH9+UyONWlLUxQsYQcVoU8oJBJGGpiyhIQGR21eCQppZ/vnmzPIr8TBW7pKvJGAwMOts7BmxhHZDekrSNswJg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756571670849453.2369823650638; Sat, 30 Aug 2025 09:34:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNmL-0006f4-4j; Sat, 30 Aug 2025 11:46:09 -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 1us7br-0004rH-CI for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:15 -0400 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7bp-0003vO-1M for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:15 -0400 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-772301f8ae2so956414b3a.0 for ; Fri, 29 Aug 2025 15:30:12 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.30.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:30:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506611; x=1757111411; 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=aJ5D76Lv5/JEWH6fy1PlED+PdSmiXzdOglOZPBl9O+8=; b=f4eK4rsYCkGXfgp+oTuvliwrJzOGy0hGkE/aRQIF4kRqaxolW/a+En9Tsulcg9qt03 dJ+EseXCbo3pdALjLEhKd56nDBRuwSORC3iUVjL4bTRNkINg1xXmOZs/nx53aKu9FOxq 1r8uZiBYbVlm0RSOa/gbFUX+YYqUCDrr4dJcEYJxMu5ow5eI8sVxO5aWIovarYTXtUmh xiGangUVAjIkbTTcpmeyhuAPMtr8yQcxkYGNYyIJuSoqOBCIz1L8tOWwA23/u0Fwa7g8 xjtSgW1kPZW9w8Zb8+0qn+Z+N6KWaAIECpvh4efrmLP28iRXVXZ+eX3CsZamMIJwSqoa N8vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506611; x=1757111411; 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=aJ5D76Lv5/JEWH6fy1PlED+PdSmiXzdOglOZPBl9O+8=; b=t0fA35PQZ9JXP3s005pqYy02cpo5OTzcHBpcx0mQOaRoc8RWQtz0D2OUbbh4Yvvd9k Rf5EZ4ssqAokbRohB2BQkKMOZ9XE71/yFQyKaMzX5n2O3iVUpaOAvHodLA6IVtKWCvuD N7kQz+xrejRx3SC17Lt/tnQe3MM5hQURBvCABdi9U6wq8AcnjS/MD3JStobSZcW5VhUO DCvMEn3x940B7btefj+TkHDp5jB42bPzliTj5mI1Egcuwkh8RhIdYLxX+p31Gwm2b1ia g6Wlk3UaLb78/e/Pv0BU864lQOQLaggDdHLEjx5M/Khsw5M3m9gQnlXkQyJ8CoRTm1Fk Ofxw== X-Gm-Message-State: AOJu0YyTDNXr1Qz2AWvJYzewflgrFUJOa2nPYe+alh9Fty79jiRVaPPO 2sONJ7/t2aVqPMLH2gMDBfBH8XB3O8eZjO4Gqqqmqel/G59+VqUC/kfzqYOyd+RnWM00ynlgBuA r5Rx1234= X-Gm-Gg: ASbGncvygG3Mnfxz+d6z2xzCRTvJ1xrmuYNUNpSfVbMDD72TFrf3nxX3ttDzUdM2qWF 6j9of9Johu/zvreuhcnhJF6w57ILbLaP2iCAC8zh/EUDTrJ3ZM+fFINrVYVCt9Q0KSRei/4Q2qI bequwJ0QxdD1zhBOFo4rEvKhXXQPKwCjouLfChfbmLFCETFJv6LmLkvQmL/f+fwxTPnRn11YU40 gGqGtP55HvFQP0XxEqm24lLj4010qfCeEm36Zf74vMRSocINFArwp/2CvptF9B6PcdUwl79CD17 ZU3Nss6w6TBb8GAiUFpi7wC/Ne0ReinWA5P86IQSryElISkhwavgLzKhVymgFmaptzT1eY82G+m 0CZ4RT2DxAcMKX0+QQEk2HOvt3UoamdL4lsK4HeJzagSqjQ8WK079aUd8suo7voY= X-Google-Smtp-Source: AGHT+IEpowwrHFZcLyyHfRkXbdBN2JNVx61pj1DgboF4W162iRzTXMY0pSsk/Ns09PDHNc3YZLCVuA== X-Received: by 2002:a05:6a20:431a:b0:243:a682:9d1f with SMTP id adf61e73a8af0-243d6dff535mr323263637.19.1756506611116; Fri, 29 Aug 2025 15:30:11 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 65/91] linux-user: Move get_vdso_image_info to arm/elfload.c Date: Sat, 30 Aug 2025 08:24:01 +1000 Message-ID: <20250829222427.289668-66-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::429; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x429.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756571672902124100 Content-Type: text/plain; charset="utf-8" Rename from vdso_image_info to avoid a symbol clash. Define HAVE_VDSO_IMAGE_INFO to signal the external definition exists. Provide fallback versions for other targets. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/arm/target_elf.h | 1 + linux-user/loader.h | 12 +++++++++++ linux-user/arm/elfload.c | 20 ++++++++++++++++++ linux-user/elfload.c | 41 ++++++++----------------------------- 4 files changed, 42 insertions(+), 32 deletions(-) diff --git a/linux-user/arm/target_elf.h b/linux-user/arm/target_elf.h index 5f81a43efb..19fdfa2f2c 100644 --- a/linux-user/arm/target_elf.h +++ b/linux-user/arm/target_elf.h @@ -14,6 +14,7 @@ #define HAVE_ELF_HWCAP2 1 #define HAVE_ELF_PLATFORM 1 #define HAVE_ELF_CORE_DUMP 1 +#define HAVE_VDSO_IMAGE_INFO 1 =20 #define HI_COMMPAGE ((intptr_t)0xffff0f00u) =20 diff --git a/linux-user/loader.h b/linux-user/loader.h index c3b8f92e23..2175dd4e0a 100644 --- a/linux-user/loader.h +++ b/linux-user/loader.h @@ -110,4 +110,16 @@ bool init_guest_commpage(void); struct target_elf_gregset_t; void elf_core_copy_regs(struct target_elf_gregset_t *, const CPUArchState = *); =20 +typedef struct { + const uint8_t *image; + const uint32_t *relocs; + unsigned image_size; + unsigned reloc_count; + unsigned sigreturn_ofs; + unsigned rt_sigreturn_ofs; +} VdsoImageInfo; + +/* Note that both Elf32_Word and Elf64_Word are uint32_t. */ +const VdsoImageInfo *get_vdso_image_info(uint32_t elf_flags); + #endif /* LINUX_USER_LOADER_H */ diff --git a/linux-user/arm/elfload.c b/linux-user/arm/elfload.c index 1205687976..308ed23fcb 100644 --- a/linux-user/arm/elfload.c +++ b/linux-user/arm/elfload.c @@ -7,6 +7,7 @@ #include "target_elf.h" #include "target/arm/cpu-features.h" #include "target_elf.h" +#include "elf.h" =20 =20 const char *get_elf_cpu_model(uint32_t eflags) @@ -255,3 +256,22 @@ void elf_core_copy_regs(target_elf_gregset_t *r, const= CPUARMState *env) r->pt.cpsr =3D tswapal(cpsr_read((CPUARMState *)env)); r->pt.orig_r0 =3D tswapal(env->regs[0]); /* FIXME */ } + +#if TARGET_BIG_ENDIAN +# include "vdso-be8.c.inc" +# include "vdso-be32.c.inc" +#else +# include "vdso-le.c.inc" +#endif + +const VdsoImageInfo *get_vdso_image_info(uint32_t elf_flags) +{ +#if TARGET_BIG_ENDIAN + return (EF_ARM_EABI_VERSION(elf_flags) >=3D EF_ARM_EABI_VER4 + && (elf_flags & EF_ARM_BE8) + ? &vdso_be8_image_info + : &vdso_be32_image_info); +#else + return &vdso_image_info; +#endif +} diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 81bf05f581..aed390ebb3 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -40,15 +40,6 @@ #define TARGET_ARCH_HAS_SIGTRAMP_PAGE 0 #endif =20 -typedef struct { - const uint8_t *image; - const uint32_t *relocs; - unsigned image_size; - unsigned reloc_count; - unsigned sigreturn_ofs; - unsigned rt_sigreturn_ofs; -} VdsoImageInfo; - #define ELF_OSABI ELFOSABI_SYSV =20 /* from personality.h */ @@ -191,23 +182,6 @@ typedef abi_int target_pid_t; =20 #define ELF_EXEC_PAGESIZE 4096 =20 -#if TARGET_BIG_ENDIAN -#include "elf.h" -#include "vdso-be8.c.inc" -#include "vdso-be32.c.inc" - -static const VdsoImageInfo *vdso_image_info(uint32_t elf_flags) -{ - return (EF_ARM_EABI_VERSION(elf_flags) >=3D EF_ARM_EABI_VER4 - && (elf_flags & EF_ARM_BE8) - ? &vdso_be8_image_info - : &vdso_be32_image_info); -} -#define vdso_image_info vdso_image_info -#else -# define VDSO_HEADER "vdso-le.c.inc" -#endif - #else /* 64 bit ARM definitions */ =20 @@ -1973,14 +1947,17 @@ static void load_elf_interp(const char *filename, s= truct image_info *info, load_elf_image(filename, &src, info, &ehdr, NULL); } =20 -#ifndef vdso_image_info +#ifndef HAVE_VDSO_IMAGE_INFO +const VdsoImageInfo *get_vdso_image_info(uint32_t elf_flags) +{ #ifdef VDSO_HEADER #include VDSO_HEADER -#define vdso_image_info(flags) &vdso_image_info + return &vdso_image_info; #else -#define vdso_image_info(flags) NULL -#endif /* VDSO_HEADER */ -#endif /* vdso_image_info */ + return NULL; +#endif +} +#endif /* HAVE_VDSO_IMAGE_INFO */ =20 static void load_elf_vdso(struct image_info *info, const VdsoImageInfo *vd= so) { @@ -2311,7 +2288,7 @@ int load_elf_binary(struct linux_binprm *bprm, struct= image_info *info) * Load a vdso if available, which will amongst other things contain t= he * signal trampolines. Otherwise, allocate a separate page for them. */ - const VdsoImageInfo *vdso =3D vdso_image_info(info->elf_flags); + const VdsoImageInfo *vdso =3D get_vdso_image_info(info->elf_flags); if (vdso) { load_elf_vdso(&vdso_info, vdso); info->vdso =3D vdso_info.load_bias; --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756570068; cv=none; d=zohomail.com; s=zohoarc; b=neuZQPNWd6V8VXUpFGqFXni/n6qZNbElQvTHq11pM7fBrQLKLe8HLUk+zufq5OcbRI8gJ72OsVl6/VUi1OHlqIDneHCm/CSNiiCtDZIN2i82M5KOqMqIq7HqjhN3dJ4Ha/GQU6HYuT927sOBVUCytGRBrMKUpm1JprhK7sWFWdY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756570068; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=suVoDXWExnW7HRwC1OURW6XQc8WcncInBLooRnaEt8k=; b=TnTkw95KT2IKR5BvWLuG9sR7eJjkBtQZMxYy2y0nL+v98EfVwRqFdEfzpcoHW7YkSmu5xS1Fcscl8wrzR/fUIOvJTlXmvs6zoH/0C/UtETFDjTY/O4gW7KEAWaIoVCsaqijyMJXf/A11/BYHA+aS+sFX+LKDT00njUJ7IfSc3MI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756570068481609.3645058174592; Sat, 30 Aug 2025 09:07:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNmC-0006Pr-KN; Sat, 30 Aug 2025 11:46:07 -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 1us7bu-0004sO-N4 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:18 -0400 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7bs-0003vz-MU for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:18 -0400 Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-32326e2f0b3so2136002a91.2 for ; Fri, 29 Aug 2025 15:30:15 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.30.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:30:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506613; x=1757111413; 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=suVoDXWExnW7HRwC1OURW6XQc8WcncInBLooRnaEt8k=; b=uaRCzHQoZ5DjNhu8BHVoXhY0w6LfdEEHxy5mZL1+e2Gmzq8SYvHi0PBDLX0NDCj4wv yvNzL40f38kGIwhVyV8XIyzPriucwcb/OPVu3OcWjK2ovm7YMP2hXIdk6CGmLFPga6ys nAUZCNT/WETa8JZNjnzZ7Yyv0Paq1da7Ecc+dZbsUxPoGLTEhxpdCi4W6gpmDht+JEbO V9qgdnClL9SCpYNf4fyxQfnpGnLUX3bwaUWF8J8DXD0Q5RpYOcuZ+KX6suWE4uc82/n0 y6zkBXdWPSQq1fwHw9/34YpmbIC/9i06zXAtirJLIMvfcIaZinUXSLwz5b12gnkI2CI/ TWPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506613; x=1757111413; 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=suVoDXWExnW7HRwC1OURW6XQc8WcncInBLooRnaEt8k=; b=O53t5gyf+aOyEIsSFLENlE/YTQfzaYoMp2Yb5mgCj/Qxa2CAz6ikchg6Q38icCiIMs zK2AsUbHVT3oYXDBjjXWV1VeSxP0xQnEz7SJsN2YspIuqmMiJcaowR0wmEO0O40jzS5A DaM6TVOYgPa1TkZzthPYNOnB/KoEDW4h2vrKFoKc6cqRKmPFWw2KrIaKNWpZzrNxu0Vx KNNvt2HK6CqnxfBff8caq3oxEf2NUs6+Qvz6Xnjt8IFQGKIMKo6shGs/nevPL406DEzw JdL87ddeCTrD4bJyyMuSlpJxNJZJ0sjO+6sk3ToGPFZ8Bg+/sUglWJQRuBRQT6ofL0G8 gcTQ== X-Gm-Message-State: AOJu0YwieuMz0swdIat6ma9Xz/Bz/Kbn4THnhlgDsn4janKVoTcGhV8K PtgS8bcNCdrqUbsuaq91YU+H4UuA24oFoBjx0VZskyAB/q8JwCjaXDLs6OkAapU1+0lAhp/WX5g 63w9hBkY= X-Gm-Gg: ASbGncuJ4zOX1soU9jPWW7GvYUm/1AcuJuWwogl8g08h+0jZDkqWnzmWe9mvyl2zK/h 5lOY2AbBSzJBciFVNFhTf5EA+a+PdTmBe0MaeiZnl5dTh/ZVo6ALUWulZ/XuM1FdA08eMqGh4zC qKGs7AQBHU3htN/4zcb49AP7rd0WPaM03JYavqJuXZS3uusiClJR7j8A7dAFxrAN0uYgdN6UrDd 5CduA+acMWm257ynzGRAa+XLPucBM47BZnR5mP/kdI+b+PCanB08Gpu8ltm26Zxm4si1iDpxkpr MTccJNgiNQ+R3wMz5gmqu6xjIB1tKvKn4oZjVlBlgadVIzFHaGi4qQm2IxIoq5ShPVkTIBQoBQq qBXMBTKG0xiQNryd3+7SGFqOVph5ZMwz36tUQgf5B2wSgn8EkX+ZKwa6l0Id4jSE= X-Google-Smtp-Source: AGHT+IHTWlwfLuZcPbwgDHx2mkbAw9zI2JXZ+8E7s3rKZsdBH3yHNEN2AH/BV0+s2OV4HtkWM3lLew== X-Received: by 2002:a17:90b:1b12:b0:323:7e80:8818 with SMTP id 98e67ed59e1d1-328156e5627mr326129a91.37.1756506613530; Fri, 29 Aug 2025 15:30:13 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 66/91] linux-user: Remove ELF_EXEC_PAGESIZE Date: Sat, 30 Aug 2025 08:24:02 +1000 Message-ID: <20250829222427.289668-67-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756570070499116600 Content-Type: text/plain; charset="utf-8" Use TARGET_PAGE_SIZE instead. If the target page size may vary, using a different fixed size is wrong. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/elfload.c | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index aed390ebb3..59e6605e36 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -167,8 +167,6 @@ typedef abi_int target_pid_t; =20 #define VDSO_HEADER "vdso.c.inc" =20 -#define ELF_EXEC_PAGESIZE 4096 - #endif /* TARGET_I386 */ =20 #ifdef TARGET_ARM @@ -180,16 +178,12 @@ typedef abi_int target_pid_t; #define ELF_CLASS ELFCLASS32 #define EXSTACK_DEFAULT true =20 -#define ELF_EXEC_PAGESIZE 4096 - #else /* 64 bit ARM definitions */ =20 #define ELF_ARCH EM_AARCH64 #define ELF_CLASS ELFCLASS64 =20 -#define ELF_EXEC_PAGESIZE 4096 - #if TARGET_BIG_ENDIAN # define VDSO_HEADER "vdso-be.c.inc" #else @@ -258,8 +252,6 @@ typedef abi_int target_pid_t; NEW_AUX_ENT(AT_UCACHEBSIZE, 0); \ } while (0) =20 -#define ELF_EXEC_PAGESIZE 4096 - #ifndef TARGET_PPC64 # define VDSO_HEADER "vdso-32.c.inc" #elif TARGET_BIG_ENDIAN @@ -280,8 +272,6 @@ typedef abi_int target_pid_t; =20 #define VDSO_HEADER "vdso.c.inc" =20 -#define ELF_EXEC_PAGESIZE 4096 - #endif /* TARGET_LOONGARCH64 */ =20 #ifdef TARGET_MIPS @@ -300,8 +290,6 @@ typedef abi_int target_pid_t; #define elf_check_abi(x) (!((x) & EF_MIPS_ABI2)) #endif =20 -#define ELF_EXEC_PAGESIZE 4096 - #endif /* TARGET_MIPS */ =20 #ifdef TARGET_MICROBLAZE @@ -311,8 +299,6 @@ typedef abi_int target_pid_t; #define ELF_CLASS ELFCLASS32 #define ELF_ARCH EM_MICROBLAZE =20 -#define ELF_EXEC_PAGESIZE 4096 - #endif /* TARGET_MICROBLAZE */ =20 #ifdef TARGET_OPENRISC @@ -321,8 +307,6 @@ typedef abi_int target_pid_t; #define ELF_CLASS ELFCLASS32 #define ELF_DATA ELFDATA2MSB =20 -#define ELF_EXEC_PAGESIZE 8192 - #endif /* TARGET_OPENRISC */ =20 #ifdef TARGET_SH4 @@ -330,8 +314,6 @@ typedef abi_int target_pid_t; #define ELF_CLASS ELFCLASS32 #define ELF_ARCH EM_SH =20 -#define ELF_EXEC_PAGESIZE 4096 - #endif =20 #ifdef TARGET_M68K @@ -339,8 +321,6 @@ typedef abi_int target_pid_t; #define ELF_CLASS ELFCLASS32 #define ELF_ARCH EM_68K =20 -#define ELF_EXEC_PAGESIZE 8192 - #endif =20 #ifdef TARGET_ALPHA @@ -348,8 +328,6 @@ typedef abi_int target_pid_t; #define ELF_CLASS ELFCLASS64 #define ELF_ARCH EM_ALPHA =20 -#define ELF_EXEC_PAGESIZE 8192 - #endif /* TARGET_ALPHA */ =20 #ifdef TARGET_S390X @@ -358,8 +336,6 @@ typedef abi_int target_pid_t; #define ELF_DATA ELFDATA2MSB #define ELF_ARCH EM_S390 =20 -#define ELF_EXEC_PAGESIZE 4096 - #define VDSO_HEADER "vdso.c.inc" =20 #endif /* TARGET_S390X */ @@ -376,8 +352,6 @@ typedef abi_int target_pid_t; #define VDSO_HEADER "vdso-64.c.inc" #endif =20 -#define ELF_EXEC_PAGESIZE 4096 - #endif /* TARGET_RISCV */ =20 #ifdef TARGET_HPPA @@ -396,8 +370,6 @@ typedef abi_int target_pid_t; #define ELF_CLASS ELFCLASS32 #define ELF_ARCH EM_XTENSA =20 -#define ELF_EXEC_PAGESIZE 4096 - #endif /* TARGET_XTENSA */ =20 #ifdef TARGET_HEXAGON @@ -2697,7 +2669,7 @@ static int wmr_fill_region_phdr(void *opaque, vaddr s= tart, phdr->p_flags =3D (flags & PAGE_READ ? PF_R : 0) | (flags & PAGE_WRITE_ORG ? PF_W : 0) | (flags & PAGE_EXEC ? PF_X : 0); - phdr->p_align =3D ELF_EXEC_PAGESIZE; + phdr->p_align =3D TARGET_PAGE_SIZE; =20 bswap_phdr(phdr, 1); d->phdr =3D phdr + 1; @@ -2805,7 +2777,7 @@ static int elf_core_dump(int signr, const CPUArchStat= e *env) offset +=3D size_note("CORE", sizeof(struct target_elf_prpsinfo)); offset +=3D size_note("CORE", sizeof(struct target_elf_prstatus)) * cp= us; note_size =3D offset - note_offset; - data_offset =3D ROUND_UP(offset, ELF_EXEC_PAGESIZE); + data_offset =3D TARGET_PAGE_ALIGN(offset); =20 /* Do not dump if the corefile size exceeds the limit. */ if (dumpsize.rlim_cur !=3D RLIM_INFINITY --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756570090; cv=none; d=zohomail.com; s=zohoarc; b=b2tCUAb2TfECx3pIuxx6d9Q6ouJ8HF7jHCg2qi1GNJi1Fm4Lx/Nrm1beOnE5nQoicCmLt34PXEzG4rbHDezkAI04TBaft9e8joB9QkFmXpjn83+mO9DqQHDDsliHIotbUkGyxpJtd8JgKYEkiYMhvH/Xfn3WwagHVln6OV3xvok= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756570090; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=jy4YLGNWV0R4ND2Aq+PHs1ssPj/3u/mwblyCWLL2x1w=; b=A2tpOssvjd9AeiVBRHN67sRcJFL2ftfrGM8xEF+fILNXjgjKVH6ALNCRLufTTJ4gsNgCiD1KJD0KMCsrfE45ioFshDLf3DCaXGEDlPr7sKjkupuFXM7zk5VWLgzq9GtgCUgZA8q4Dan3g2LpqgDfJZzgfesykw5mSRf4BaS0/vk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 175657008996559.29601584570173; Sat, 30 Aug 2025 09:08:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNmP-00073H-8K; Sat, 30 Aug 2025 11:46:14 -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 1us7bx-0004tr-Id for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:21 -0400 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7bu-0003wd-Uq for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:21 -0400 Received: by mail-pj1-x102d.google.com with SMTP id 98e67ed59e1d1-32326793a85so2132410a91.1 for ; Fri, 29 Aug 2025 15:30:18 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.30.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:30:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506616; x=1757111416; 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=jy4YLGNWV0R4ND2Aq+PHs1ssPj/3u/mwblyCWLL2x1w=; b=pkX1JEQXdqDnBdXrlf5FGfj2huNU2nc8MIeYq1P2rWs59f9ozFfa+gO69jAsoY78GG Jt7OwA8cJR/IwCNz33kFrCQ3a/YwyqLVNdqhgO0lr0C1htx93EiKN87f0+v04t6t/o7E PnZhXxvvnzQAP4zda+/Gyz2us5fxSa/XErCuwfCLbjr1eCq5TOQz0+sz4bSyuEyP/OEg LOGaPCQ+M6YF57OjcoxWN9RtwnOVcwXoAPk7PK/TKGMQmYmDO6MVzqJ1HipbUb2dgmGz JEbYeKVhcWx/0w/PZdM6ESSFs2p6boNxLrIkg6eVbcGYY8lRD3euHbiPzhUAmFXReTYi +uAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506616; x=1757111416; 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=jy4YLGNWV0R4ND2Aq+PHs1ssPj/3u/mwblyCWLL2x1w=; b=bPJrFVHPW/JPF+CLob+0FlG7jV7zVpZnRiMveCUatb6Rp1ZvGBX9+nw/6yyGgftdjk mF9dB7SshGmebR8Mb7i/GnGPP7V+VZz478dTnC3uMakZLiMdHtlgzy4kPDSSDNlV0llQ TRI5NYTlJG35Mlkm1pBJYObk64szcJNF0seJvIO+mLAj1wCHt6qr8Dcii6L9dhWV+7VE JVvjeyJCXDN1HynxT3EV5jST6wWKzDXrQ41Imy8ZkKkfhg5QQKpRKihzpFFJt+cpHPVq Z2AR4wMGa2NI/fetd1fKTG1KAt01CjG2jSejNQzUXEejAIXIN+96KOhQD5flzmxe2TnM LTXw== X-Gm-Message-State: AOJu0YyrglhoHwpxPZD2OKXyDkHG70AQ9yNjSevtYOVBCTJb3pl1IkMy GdqihyTA8BUFcLKJ+LoH4A5i4R8wl8Skc86qF5FnW/0FYRTtKRxpbmyhmxX8U6vQnqoq/iSJZxY tPpzINoI= X-Gm-Gg: ASbGncu2PJXUWyH6cw1j06bSL+Phd9Yqv+Bb8Ux+oHHVQDr2w0LfqS42+p628gSPvF9 ZTpkyqigvozNCi3xM0BGAnaK2Ai3OiR4Z1hS9/MKb11xwKAWiTxD3J/w4TJDjqssprrw60/P2RL sfwPPE6v2KxxlKLkXj69sh3gNelDh1dZZOUaVKn1nJDTieJFYsh4E7HMKAiyHiGuVbsYKsJhCXA Mae9cOHmUM49qZ/XURTCf4XoFdL3lkGW4mvx6VtrQn2glc9qKlnhuqhyLD4190xMbc/r9RPjook aNqxNs72UR2UdiTmJJiqkpR8H/Sm66UR5IgWhjGrJG2roISe5LdeMvoPs/pf+ZgBW8wWp8qi0Bj d5+4YhPc0VFA/3aufExeet2zUTsb9qzm4g51JL7X9Uv+heNSJX/xcX+9yxSARguf8TgHMuITCQw == X-Google-Smtp-Source: AGHT+IH4V5GIIlIa+vcW7Ss7tjLJRJ6DhBrmVXZ/xH+hYGT+MXDpoXB23o5LvpLo1dg43VDCs2ek9g== X-Received: by 2002:a17:90b:2ec8:b0:327:5081:d5d0 with SMTP id 98e67ed59e1d1-328156bac3dmr300898a91.19.1756506615899; Fri, 29 Aug 2025 15:30:15 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 67/91] linux-user: Remove redundant ELF_DATA definitons Date: Sat, 30 Aug 2025 08:24:03 +1000 Message-ID: <20250829222427.289668-68-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::102d; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102d.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756570091144124100 Content-Type: text/plain; charset="utf-8" We already provide ELF_DATA based on TARGET_BIG_ENDIAN. Remove the extra definitions from openrisc and s390x. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/elfload.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 59e6605e36..8ff9f83bb8 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -305,7 +305,6 @@ typedef abi_int target_pid_t; =20 #define ELF_ARCH EM_OPENRISC #define ELF_CLASS ELFCLASS32 -#define ELF_DATA ELFDATA2MSB =20 #endif /* TARGET_OPENRISC */ =20 @@ -333,7 +332,6 @@ typedef abi_int target_pid_t; #ifdef TARGET_S390X =20 #define ELF_CLASS ELFCLASS64 -#define ELF_DATA ELFDATA2MSB #define ELF_ARCH EM_S390 =20 #define VDSO_HEADER "vdso.c.inc" --=20 2.43.0 From nobody Sun Sep 28 15:28:22 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 175657097713546.97135471402635; Sat, 30 Aug 2025 09:22:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNmO-0006xa-Mr; Sat, 30 Aug 2025 11:46:13 -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 1us7by-0004u4-H3 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:22 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7bw-0003xE-88 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:21 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-77238a3101fso446973b3a.0 for ; Fri, 29 Aug 2025 15:30:19 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.30.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:30:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506618; x=1757111418; 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=i5SCOArTMDFn9DLEGEULkPg//35bBeOm8KVxr1J+Y1U=; b=PrRiRjqObu6k1y6ucg6yLj0yH+QpFiHR+zNRS1Rf6hwVWjF3MY1bn+0pQUFVekjogN j+++2cE0Lc4+MMzk3Ws6fDOaz6gEdKEJ30EqRnp1hZLrgYTuBQPWL2gllc94cR4Tv0at onRSRcXD3p/eFdMbFVr/MdvSuhLg561HdUmpDSIicoPJ9bJgNyQ0JApBS61B5ybSLs/0 HvDhNIq31qy9ajGVYe+5fef9hKGkqow9ZOumAhFAp5GiLMXZf/PvQqhQQ1g7YopfzG8s ownBjzrgKhYjaAcXd0rxpmQlQktZsbMPVYB7/K77rN1Kl+6pgvYPhqmS7vsRMe3CbOcR fAAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506618; x=1757111418; 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=i5SCOArTMDFn9DLEGEULkPg//35bBeOm8KVxr1J+Y1U=; b=v3kfpJ5w+4v5pvdcpwKjwHZNIQiPcDVacHWgOlm8+XXRSFOtkm9WPaiXxuzz3YnARz yn16cZJwSvODfEtgJXlTtlXh6Sp2U9hqyg9pCxqNLsN3G/gojInqeILzXK4+HerDpiOb 41eKRLo40Dta6Omn0D0cKHJ67dt6klJO0HV1qgT2k4nQTpq4bl2KZTBhik24ec9brGR6 njcIaDZnCEG4OZw3cb3zPk10p3SZJcZFdgOR/ov26NPkN5b0PdXUoqZ3V8PFiw9hpQD8 MIhYTBZb/HKcLlC56nQdvjMk9okLbUoMQjVzZkXZgspIipBbMOgO363R9aYlbSS4kX0w I63Q== X-Gm-Message-State: AOJu0YxMauMH16hqmpJs9Zo9+isJPxrSYOouKLvCfERD29VW1T4USA4O feDNXvqzTIePw1Y5THhwazFhRr3v6IHivRg0+IjNALjdoZe/IggNknFyfYjxJPS2JMIaTfK9lSA aOL/DGn8= X-Gm-Gg: ASbGncvjrmOw7+FBIoKm+NotUIG42raQ63+ts9m7a0LHgj/dDO+Wu2E6WLQKyyNIsXQ daABWbPlevDctDSGubA+TX456eZ38EqioZOYnfp3KnP6q0Hoc8IxP8yX+TA7F02Aywe9Hmh++Aq +qrA8JJIxst24I/SvtbSgN3in91WoA1cIXOnPdxbWTG7MfejAGRzLBdRd8ygqhfgzDWR3uFVb8l qKE2AChO+ng4FoUQWCPUEjN0xWigh1PUZuRNhnLmQqkn3zJDUaCZQNWpi9UtlHQRmZIyTDxfIoN Uwsd4wHHHUb2FTh6sD4rNtQzEb0f308YVaptjTbHy5XD9alKa3Ksh7HnFkkoLGs5I6bwGFU7OpO c44F+YT1VCrYqMy9rqMPG27sseUxTcFYJZ87bcJBSTBYivt/YDY+ZxtRuwDjFrdJ/27xY+s0mjA == X-Google-Smtp-Source: AGHT+IHnLcVs8VfGcJ6d49H84Xa3TxphBlKu9sh6/uO8dLQmJ1TKiteY44vBX1BMtnSp5AYRiQmpxw== X-Received: by 2002:a05:6a00:889:b0:771:e434:6c80 with SMTP id d2e1a72fcca58-7723e257d88mr301810b3a.11.1756506618264; Fri, 29 Aug 2025 15:30:18 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 68/91] linux-user: Move elf parameters to {i386, x86_64}/target_elf.h Date: Sat, 30 Aug 2025 08:24:04 +1000 Message-ID: <20250829222427.289668-69-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1756570979203124100 Content-Type: text/plain; charset="utf-8" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/i386/target_elf.h | 22 +++++++++++++++++++ linux-user/x86_64/target_elf.h | 4 ++++ linux-user/elfload.c | 39 ---------------------------------- 3 files changed, 26 insertions(+), 39 deletions(-) diff --git a/linux-user/i386/target_elf.h b/linux-user/i386/target_elf.h index f89ac0b611..dc58c0017a 100644 --- a/linux-user/i386/target_elf.h +++ b/linux-user/i386/target_elf.h @@ -10,6 +10,11 @@ =20 #include "target_ptrace.h" =20 +#define ELF_CLASS ELFCLASS32 +#define ELF_ARCH EM_386 +#define EXSTACK_DEFAULT true +#define VDSO_HEADER "vdso.c.inc" + #define HAVE_ELF_HWCAP 1 #define HAVE_ELF_PLATFORM 1 #define HAVE_ELF_CORE_DUMP 1 @@ -22,4 +27,21 @@ typedef struct target_elf_gregset_t { struct target_user_regs_struct pt; } target_elf_gregset_t; =20 +/* + * This is used to ensure we don't load something for the wrong architectu= re. + */ +#define elf_check_arch(x) ((x) =3D=3D EM_386 || (x) =3D=3D EM_486) + +/* + * i386 is the only target which supplies AT_SYSINFO for the vdso. + * All others only supply AT_SYSINFO_EHDR. + */ +#define DLINFO_ARCH_ITEMS (vdso_info !=3D NULL) +#define ARCH_DLINFO \ + do { \ + if (vdso_info) { \ + NEW_AUX_ENT(AT_SYSINFO, vdso_info->entry); \ + } \ + } while (0) + #endif diff --git a/linux-user/x86_64/target_elf.h b/linux-user/x86_64/target_elf.h index f05b1d4dba..f3c09bb8da 100644 --- a/linux-user/x86_64/target_elf.h +++ b/linux-user/x86_64/target_elf.h @@ -10,6 +10,10 @@ =20 #include "target_ptrace.h" =20 +#define ELF_CLASS ELFCLASS64 +#define ELF_ARCH EM_X86_64 +#define VDSO_HEADER "vdso.c.inc" + #define HAVE_ELF_HWCAP 1 #define HAVE_ELF_PLATFORM 1 #define HAVE_ELF_CORE_DUMP 1 diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 8ff9f83bb8..73ca6c681e 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -130,45 +130,6 @@ typedef abi_uint target_gid_t; #endif typedef abi_int target_pid_t; =20 -#ifdef TARGET_I386 - -#ifdef TARGET_X86_64 -#define ELF_CLASS ELFCLASS64 -#define ELF_ARCH EM_X86_64 - -#else - -/* - * This is used to ensure we don't load something for the wrong architectu= re. - */ -#define elf_check_arch(x) ( ((x) =3D=3D EM_386) || ((x) =3D=3D EM_486) ) - -/* - * These are used to set parameters in the core dumps. - */ -#define ELF_CLASS ELFCLASS32 -#define ELF_ARCH EM_386 - -#define EXSTACK_DEFAULT true - -/* - * i386 is the only target which supplies AT_SYSINFO for the vdso. - * All others only supply AT_SYSINFO_EHDR. - */ -#define DLINFO_ARCH_ITEMS (vdso_info !=3D NULL) -#define ARCH_DLINFO \ - do { \ - if (vdso_info) { \ - NEW_AUX_ENT(AT_SYSINFO, vdso_info->entry); \ - } \ - } while (0) - -#endif /* TARGET_X86_64 */ - -#define VDSO_HEADER "vdso.c.inc" - -#endif /* TARGET_I386 */ - #ifdef TARGET_ARM =20 #ifndef TARGET_AARCH64 --=20 2.43.0 From nobody Sun Sep 28 15:28:22 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 175657353597849.08933299357125; Sat, 30 Aug 2025 10:05:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNkK-0001le-Iy; Sat, 30 Aug 2025 11:44:04 -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 1us7c0-0004vG-6r for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:24 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7by-0003xo-Bf for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:23 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-7722c8d2846so952164b3a.3 for ; Fri, 29 Aug 2025 15:30:21 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.30.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:30:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506620; x=1757111420; 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=aA1CZlBtF0AEUKR5am9ISxGmf8nS3Sm9ZoDdoUGF74o=; b=RiE5iJx87Q2MXw26Fknc49p6RE9hjqbb3eDWybETgbz4OnDQhJoaZbdiNvAON3wMCb IreBVZWUiJaup1VENMuhOXIxK8vc3PkA6qIObyuRpZVSBXqHkPqYiuwn4sKZV+usNeCi eK+K4z3oEVf4A2AjRwasgLVcSf259NbeAq6PVpitW1sBIZuKd3wePNpxoHksZ/E6PN8F ZZeV9ULO+70es35GE+k0GvWlBgjVjBdl/wFmddRjErW5tj2GCqpyVT6LZqnWqdiaq5G9 8Zcb/4Iv35yCNXQrbBoqKfsBPLLGvBW+pHmNQihCQr8yMcDEkCT81nQqFXOGcs1uH/b4 h1dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506620; x=1757111420; 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=aA1CZlBtF0AEUKR5am9ISxGmf8nS3Sm9ZoDdoUGF74o=; b=RZlFipUb1oGzF1V/fQdlA4QHfXO6rWhGG0mTZNyKHKTrWz6PcYgf8k6i57A5BPjoAj oEJVvv3ce+M3X1f+Zic2TOELHsdQseYg+Ks3LU5epjfGaccQQlWYuXycQ4fpSM7WdLdW StP5+PNd3MittlCVvt9NdL/zmaFqYRR6YREb5BHYJYLtXnGGtLNc0IF4oWKT7D5XlgTn ZH7FKmHA0cs8yUHfsEHrOwD553OeMTf8v6SikMbb+rW+JaWW/FVuqMdgqTIC+ceItDb0 YI9SBOyJ9OWZKhDVvmyn+SHxzRGDyYFT41O3zCKtT+t/VtCwYGs83c7GMO3LYvEAMgjr yEMw== X-Gm-Message-State: AOJu0YwEcZ9Aw1ZHn4W2ALcQA4HwJmGYQ3mzxXNV8VhkMx0tt8QmAeid eEPcWvIkvY7wiPgA7VUQpXg2uPa0EB7fdnhZsyLFwt0gjPnX481Ay/rZvUlfCNcbfnHjPXYC93T 6k69XTco= X-Gm-Gg: ASbGncuUMpMeSrPu+dB2HlZ5UtEX9en7LluOgV8nEU4+tvrX+CEnTU+YoHhqhOInHE7 n8WR1v85ggc1vA3qhQYMI2pPn19X1fP/i9bEJxi5TYhyu2/USibKnzt/k9GbhbNsl1Sv1WsKwpM AEeh6wI3E5DVWAvINghvyKBrx+93YRpL1r3zNZGsfeA6Ap/mT4iLXv78ibd+8cBQIoaww4TkxAN pkeJbSSU7kuarSqeaGJvbZSWdGeGrk66zLEntMbywVC75E2xc77UnpMAxUDzhsDu+0rk5SFCHei 94D5Dr8x4CLE7mPH5R8oDOgD61Bc1GE2b8yd8mYsiJ+pfF0RgwYPqh3wU7thNT8O11Y5YyK2Pdi JGkQ87QhMPpBm92g3kz4EfYckINVTSwf1iX+8IrAYoQxmcnVewSTb+LAeWpa91O8= X-Google-Smtp-Source: AGHT+IGXdP/ZiBMTkhhhoNqqiQu2fjiDWTqvmfSpmyjMpBg07qA0aH4FjpStiygm6M2IInJCzWKiUg== X-Received: by 2002:a05:6a00:1746:b0:772:bdb:276c with SMTP id d2e1a72fcca58-7723e3949e9mr273014b3a.25.1756506620515; Fri, 29 Aug 2025 15:30:20 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 69/91] linux-user: Move elf parameters to {arm, aarch64}/target_elf.h Date: Sat, 30 Aug 2025 08:24:05 +1000 Message-ID: <20250829222427.289668-70-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1756573537946124100 Content-Type: text/plain; charset="utf-8" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/aarch64/target_elf.h | 9 +++++++++ linux-user/arm/target_elf.h | 4 ++++ linux-user/elfload.c | 25 ------------------------- 3 files changed, 13 insertions(+), 25 deletions(-) diff --git a/linux-user/aarch64/target_elf.h b/linux-user/aarch64/target_el= f.h index 9eb8bb547e..3c9fef9378 100644 --- a/linux-user/aarch64/target_elf.h +++ b/linux-user/aarch64/target_elf.h @@ -10,6 +10,9 @@ =20 #include "target_ptrace.h" =20 +#define ELF_ARCH EM_AARCH64 +#define ELF_CLASS ELFCLASS64 + #define HAVE_ELF_HWCAP 1 #define HAVE_ELF_HWCAP2 1 #define HAVE_ELF_PLATFORM 1 @@ -23,4 +26,10 @@ typedef struct target_elf_gregset_t { struct target_user_pt_regs pt; } target_elf_gregset_t; =20 +#if TARGET_BIG_ENDIAN +# define VDSO_HEADER "vdso-be.c.inc" +#else +# define VDSO_HEADER "vdso-le.c.inc" +#endif + #endif diff --git a/linux-user/arm/target_elf.h b/linux-user/arm/target_elf.h index 19fdfa2f2c..d871d6d665 100644 --- a/linux-user/arm/target_elf.h +++ b/linux-user/arm/target_elf.h @@ -10,6 +10,10 @@ =20 #include "target_ptrace.h" =20 +#define ELF_ARCH EM_ARM +#define ELF_CLASS ELFCLASS32 +#define EXSTACK_DEFAULT true + #define HAVE_ELF_HWCAP 1 #define HAVE_ELF_HWCAP2 1 #define HAVE_ELF_PLATFORM 1 diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 73ca6c681e..838d7199a6 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -130,31 +130,6 @@ typedef abi_uint target_gid_t; #endif typedef abi_int target_pid_t; =20 -#ifdef TARGET_ARM - -#ifndef TARGET_AARCH64 -/* 32 bit ARM definitions */ - -#define ELF_ARCH EM_ARM -#define ELF_CLASS ELFCLASS32 -#define EXSTACK_DEFAULT true - -#else -/* 64 bit ARM definitions */ - -#define ELF_ARCH EM_AARCH64 -#define ELF_CLASS ELFCLASS64 - -#if TARGET_BIG_ENDIAN -# define VDSO_HEADER "vdso-be.c.inc" -#else -# define VDSO_HEADER "vdso-le.c.inc" -#endif - -#endif /* not TARGET_AARCH64 */ - -#endif /* TARGET_ARM */ - #ifdef TARGET_SPARC =20 #ifndef TARGET_SPARC64 --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756572310; cv=none; d=zohomail.com; s=zohoarc; b=GaLEjOPlLa//jIWP7koAQuNJkDyeNM9OV9DLEVhI4A7k/4G3vGpCLjKaYN8oFvqKAMCErBi8wKYLJnDzHWns6LLh52OHErZioeG5868KyTunKLvSW6+wRIh5mhilEX/ItKChmo8WcZ2MdCcejK1BBuY0ZU5ZRMC0nEhLXQzQX4Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756572310; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=D1To9kj0NUReaVQ1Qmnz3yHyScg57OYykVcZq9vtj4w=; b=gUccbPvQ4vk1+kb0O8CZXG/yY8KyNFKqoKyGjsGUSLWeu9sdKtjT+lR4h6+RMqpjxHZKWfaISJBF050t/l3QO7HiURvulfYyaSR17mIo7awjH5g+Iw+3KQFga9QPktrnCCtyrGAiw/J7bDlDDVTfNHdcr2goXfcYjGgr/JS/Quc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 175657231090763.8360245831301; Sat, 30 Aug 2025 09:45:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNkM-0001tf-26; Sat, 30 Aug 2025 11:44:06 -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 1us7c3-0004wJ-6H for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:27 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7c0-0003ya-Dj for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:26 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-772301f8ae2so956499b3a.0 for ; Fri, 29 Aug 2025 15:30:23 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.30.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:30:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506623; x=1757111423; 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=D1To9kj0NUReaVQ1Qmnz3yHyScg57OYykVcZq9vtj4w=; b=Ux3B7Z5iB8RCKOxfAoMcqbx3uNyPTxIHWSTWR0D0Q3qAaVxeSd8tmI9YGAcB2DJlI2 hGj+tin9jRzAYJPAfCeLWHU6u4UYqkO4p3oUiD6pl1/am4hZH/29uw+brNBoj+2ItCTr FLAqy+ikvG4CQlE0vj0MKqPAPFhjajHXLDdh/Pai0xb4aFwn2mz3mhivn4PEvsLLzXA9 pvbF1YXK8x4bgnuA5hkeErUYO+HThFRd5s1o/9nNamCEJSwJ63Nk1FCDFEwgvVXH1xcF 1fGU/iQGYIsgYmWxY1q2bbgA7A9duDEKAsmzv/lKo4q5yrSo2MPEt6mOapiPRSPp6Ymv VSxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506623; x=1757111423; 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=D1To9kj0NUReaVQ1Qmnz3yHyScg57OYykVcZq9vtj4w=; b=hC0oD4iGtQFSWFLsE2kw8owWzsWDk7LEuzwVOVYLzttF8Q5sMzRyf6ojozgZinD6JA IdY88m4qZ0G8EgojQ9JyhjPBU7CyphX4WQF5bYlOZ5XyKSIVbtrVQcsIgrMx0Mz9kKsb QZNMS408xuF30woqHLXdS8o0NHb28iZW9YmXx9WhfstMPF1sPxadVeNMdM8pKJxM1ir3 kAeYJO3KlqtBUD1rq7aSUq3pAhj30ek7jdWrV6w594DjrAfmoQtWv9g5pMsy6bEH+LRW tcr80vbrM7R9CRAxgcBSecPQrfj6PKQRyrSxkdNpatpnDooPeo3XnGluF01i/dTT5Pag OmBQ== X-Gm-Message-State: AOJu0Ywpxj0ZQi8AIfvVrmvfK7+WD8vocw+OCb25+afkTv+ewuQtSF1S HPolFYgZYH3dignC/QETE9DGzMRTH2ig8LmvGCJs+nQPnIsQdsIhufS4slTsq+0XQhc7lAU35CH Z96JYmGI= X-Gm-Gg: ASbGncvOJRQUtH4AUJco02pxGg++GZp/SWa77Q1g7bHGDZl07VeoDQtt1Cjlcabegke JEsGMYUoiWsq2+mNHe/28FFFtwkYzrYbbSfu+gColGB7CwqlJR2Y3vnmcjAR58L1LTGm2ouzPlI W/GJdUMnq74wYwfQKc2nKAp6m8ZSl2J/hWdHE6czqyf6Uy+Ttdr9Q2h9M29zkheT+1OUQO4WlUY DLQo772fkh715aYoB6+dQDnw3rbVlrIBgMJ0Dv1VEghGMqFBjwY4G1PTDQVrx+aWFK4Se/tQNt1 ICFgEc4NW6LDeKGPn1+NbDG87J0Rg1EbKtGsVoKQPo7xCTzejSh3bS6XN2OSDca/zogPOq2raHa Bdr87r5nr6wVhnur3pUUeNAeOvStTiMBRsHvJ3mocn98/U6DiT79fuW6ZYFo3yjqjocJWLc7WgA == X-Google-Smtp-Source: AGHT+IHFw8y/4ANnMi6XjLjNZnxowhfDVKAfeOHfDlt0B18sX62Okf6hpzZCVw2CrNmbtiGZ/Uyj8A== X-Received: by 2002:a05:6a00:178f:b0:771:ea9d:119b with SMTP id d2e1a72fcca58-7723e39f658mr290934b3a.29.1756506622878; Fri, 29 Aug 2025 15:30:22 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 70/91] linux-user: Move elf parameters to sparc/target_elf.h Date: Sat, 30 Aug 2025 08:24:06 +1000 Message-ID: <20250829222427.289668-71-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756572312790116600 Content-Type: text/plain; charset="utf-8" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/sparc/target_elf.h | 11 +++++++++++ linux-user/elfload.c | 15 --------------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/linux-user/sparc/target_elf.h b/linux-user/sparc/target_elf.h index b7544db0a1..f89c708c46 100644 --- a/linux-user/sparc/target_elf.h +++ b/linux-user/sparc/target_elf.h @@ -8,6 +8,17 @@ #ifndef SPARC_TARGET_ELF_H #define SPARC_TARGET_ELF_H =20 +#ifndef TARGET_SPARC64 +# define ELF_CLASS ELFCLASS32 +# define ELF_ARCH EM_SPARC +#elif defined(TARGET_ABI32) +# define ELF_CLASS ELFCLASS32 +# define elf_check_arch(x) ((x) =3D=3D EM_SPARC32PLUS || (x) =3D=3D E= M_SPARC) +#else +# define ELF_CLASS ELFCLASS64 +# define ELF_ARCH EM_SPARCV9 +#endif + #define HAVE_ELF_HWCAP 1 =20 #endif diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 838d7199a6..ccdd87aa12 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -130,21 +130,6 @@ typedef abi_uint target_gid_t; #endif typedef abi_int target_pid_t; =20 -#ifdef TARGET_SPARC - -#ifndef TARGET_SPARC64 -# define ELF_CLASS ELFCLASS32 -# define ELF_ARCH EM_SPARC -#elif defined(TARGET_ABI32) -# define ELF_CLASS ELFCLASS32 -# define elf_check_arch(x) ((x) =3D=3D EM_SPARC32PLUS || (x) =3D=3D EM_SPA= RC) -#else -# define ELF_CLASS ELFCLASS64 -# define ELF_ARCH EM_SPARCV9 -#endif - -#endif /* TARGET_SPARC */ - #ifdef TARGET_PPC =20 #define ELF_MACHINE PPC_ELF_MACHINE --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756576572; cv=none; d=zohomail.com; s=zohoarc; b=FGGcUxBE+jPDqXq0dlgPj7uFCFkjrIS4Ir5ZwN0hcrs2FrVDamJGKz1EVviL2qcPJPBuTyCwFpHIHWO/H/S93HOG5xOvxBvZkM8rNKE+whbCf1hjKT3Rc/vheq4RHP856D/chkF7CNGhZn+RykzN3+v8/lAjasgQ61S+WZo39TM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756576572; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=wZDPXdfsmxBIOUaB++qruH/yHWhEuoUSA6jOwZM9P+A=; b=ZDyyRQAeQFsWkCAmFX8ezBX/EKntsXBlX9LuClQmArd0Xnm7Zum/NY33iktTqhmchE2EQQOFSkKujPv0e/+p2MHK9fXy7I8nyw7GQ1fQSFp/IpZ7cGFQB/HFMSnfmPYp7EIpj27MOm5J23g4rNMGkQ3fD7ryvqP0PrZGgkQQN5E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756576572562735.1136263774866; Sat, 30 Aug 2025 10:56:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNkN-00024I-5y; Sat, 30 Aug 2025 11:44:07 -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 1us7c5-0004x8-Ap for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:29 -0400 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7c3-0003zG-1a for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:29 -0400 Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-b4c53892a56so2197078a12.2 for ; Fri, 29 Aug 2025 15:30:26 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.30.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:30:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506625; x=1757111425; 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=wZDPXdfsmxBIOUaB++qruH/yHWhEuoUSA6jOwZM9P+A=; b=ETp6MoalgxdIJvFyjOPo9SHlM8KzKDYD3SA+uxQ5NCGvJ0/ZZ102EFNxSYT/jRWTTe SQ78WyBl6yPhXmq9hTaeDqAQLeZfN1HNZDyNZzX9nujENJkwkRGHWWyPQiSeSvSwRA3Y vtNYXsCW6PVt0dZ07eNRAQF8nAOZMH3+7khzPEQRn01AGGQZSQT0cVGS0seILa5VntXN DAtWs2SQcin3xiHJB8ebTtieHCJ3loSOvmS4+jgGCveQW0TlO/DsMVgFH4nzHvZJzsTh jdw+Y4WGk2B8AaJBagMcfTuOc5sWNbkt9u4T/NGh5mL3OXXd0E/DONOm5b3BW3cM5smy WqVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506625; x=1757111425; 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=wZDPXdfsmxBIOUaB++qruH/yHWhEuoUSA6jOwZM9P+A=; b=vbbQXwrRZItbsGBBL96MnaBPVwaoL53cn7H2DI1VoHB9aDodIXDebt+pBx8mgyRRVI bWQMzNjaiQdAN7kf9Lo6ODBbU3N+icyG9YAf2Nwm2FqhTKdgRlKxKMGa1O5p1YCGb0WV T7FXKxDU+dbMvdUfPqIjuTyYvh+oIvghQih7RHhSsYUgTqFKTePKqwi88YmUduHsOGd8 WfwVgpvsZrIPyfCE7PkPNG3KqhMCstAVYtYdq9ajfTbMCZYI/wkdvdEII/Nrsd5pH+cX rS343yhE8rQ6xn2Zjw6lR4YFzYtLWTpktBIwBpTFKPjE70u4J2kdkf4lO5HdPCCBX+/y WzwQ== X-Gm-Message-State: AOJu0YzNFjuMwUP+30/+vuA+jBv8S2mhJJQO4AsLXEezp/5CTOM7Bdkn uP913+MUob0t7qNaUe1iZth46+0JhtsTBqzHHdHu3wK+DlEi/dnw0PJ5WnDATkUKacf8PSt09iF h3TGOtWs= X-Gm-Gg: ASbGncv2d7DaFRGnOD1TopGNTsw5NfSN0njAQizv3IO3WLWrWdylQAvIEmzwswmrhEr gs2HjcoPltrp4qeOuGnZXMqpnnihqEUb6Qf5B/nyEyB/+y0tfgngM4ZBurZRc51N5v62hJCvikH 2wTBxFcjFzK9XkeP5bXBOpubif23xdxHQRmLVIK02niw1l7CUGlKlMNYYZ1M+LwMWeVOhYfuMwT tX1Ia0+1SgxF20VGCONJUlBk2dXNCo1XzwgWQcw7edQ0Gml+He7baqaPPAYU8ojHQMuLs26ELFu ziZBRkQ1ZUn3XwVjhhxeJVpL25XwuhMhi35mmdlcFpenKcD6XIkhczMSiTi+KkJss1QP2MyPhk6 3H5V3fN6qGCi5v7st736sjBXYxRkljwv3u0ZN5FvCOA+oVlc1tCLQkhoNpe3gC662vtImMt+zVQ == X-Google-Smtp-Source: AGHT+IEED1U3Dbk26jwOcheD3Xah11zb1ZhstKva4PGt2+GzTsTuyDSlcobBR6ROrWx8r9yK5Kw6Ow== X-Received: by 2002:a05:6a20:2449:b0:243:a21c:3730 with SMTP id adf61e73a8af0-243d6f036c7mr301398637.31.1756506625214; Fri, 29 Aug 2025 15:30:25 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 71/91] linux-user: Move elf parameters to ppc/target_elf.h Date: Sat, 30 Aug 2025 08:24:07 +1000 Message-ID: <20250829222427.289668-72-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::52b; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52b.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756576574253116600 Content-Type: text/plain; charset="utf-8" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/ppc/target_elf.h | 43 ++++++++++++++++++++++++++++++ linux-user/elfload.c | 53 ------------------------------------- 2 files changed, 43 insertions(+), 53 deletions(-) diff --git a/linux-user/ppc/target_elf.h b/linux-user/ppc/target_elf.h index 2a61cd2896..9a47f18fb8 100644 --- a/linux-user/ppc/target_elf.h +++ b/linux-user/ppc/target_elf.h @@ -10,6 +10,17 @@ =20 #include "target_ptrace.h" =20 +#define ELF_MACHINE PPC_ELF_MACHINE + +#ifdef TARGET_PPC64 +# define elf_check_arch(x) ((x) =3D=3D EM_PPC64) +# define ELF_CLASS ELFCLASS64 +#else +# define ELF_CLASS ELFCLASS32 +# define EXSTACK_DEFAULT true +#endif +#define ELF_ARCH EM_PPC + #define HAVE_ELF_HWCAP 1 #define HAVE_ELF_HWCAP2 1 #define HAVE_ELF_CORE_DUMP 1 @@ -26,4 +37,36 @@ typedef struct target_elf_gregset_t { }; } target_elf_gregset_t; =20 +#ifndef TARGET_PPC64 +# define VDSO_HEADER "vdso-32.c.inc" +#elif TARGET_BIG_ENDIAN +# define VDSO_HEADER "vdso-64.c.inc" +#else +# define VDSO_HEADER "vdso-64le.c.inc" +#endif + +/* + * The requirements here are: + * - keep the final alignment of sp (sp & 0xf) + * - make sure the 32-bit value at the first 16 byte aligned position of + * AUXV is greater than 16 for glibc compatibility. + * AT_IGNOREPPC is used for that. + * - for compatibility with glibc ARCH_DLINFO must always be defined on PP= C, + * even if DLINFO_ARCH_ITEMS goes to zero or is undefined. + */ +#define DLINFO_ARCH_ITEMS 5 +#define ARCH_DLINFO \ + do { \ + PowerPCCPU *cpu =3D POWERPC_CPU(thread_cpu); \ + /* \ + * Handle glibc compatibility: these magic entries must \ + * be at the lowest addresses in the final auxv. \ + */ \ + NEW_AUX_ENT(AT_IGNOREPPC, AT_IGNOREPPC); \ + NEW_AUX_ENT(AT_IGNOREPPC, AT_IGNOREPPC); \ + NEW_AUX_ENT(AT_DCACHEBSIZE, cpu->env.dcache_line_size); \ + NEW_AUX_ENT(AT_ICACHEBSIZE, cpu->env.icache_line_size); \ + NEW_AUX_ENT(AT_UCACHEBSIZE, 0); \ + } while (0) + #endif diff --git a/linux-user/elfload.c b/linux-user/elfload.c index ccdd87aa12..526c90e2c1 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -130,59 +130,6 @@ typedef abi_uint target_gid_t; #endif typedef abi_int target_pid_t; =20 -#ifdef TARGET_PPC - -#define ELF_MACHINE PPC_ELF_MACHINE - -#if defined(TARGET_PPC64) - -#define elf_check_arch(x) ( (x) =3D=3D EM_PPC64 ) - -#define ELF_CLASS ELFCLASS64 - -#else - -#define ELF_CLASS ELFCLASS32 -#define EXSTACK_DEFAULT true - -#endif - -#define ELF_ARCH EM_PPC - -/* - * The requirements here are: - * - keep the final alignment of sp (sp & 0xf) - * - make sure the 32-bit value at the first 16 byte aligned position of - * AUXV is greater than 16 for glibc compatibility. - * AT_IGNOREPPC is used for that. - * - for compatibility with glibc ARCH_DLINFO must always be defined on PP= C, - * even if DLINFO_ARCH_ITEMS goes to zero or is undefined. - */ -#define DLINFO_ARCH_ITEMS 5 -#define ARCH_DLINFO \ - do { \ - PowerPCCPU *cpu =3D POWERPC_CPU(thread_cpu); \ - /* \ - * Handle glibc compatibility: these magic entries must \ - * be at the lowest addresses in the final auxv. \ - */ \ - NEW_AUX_ENT(AT_IGNOREPPC, AT_IGNOREPPC); \ - NEW_AUX_ENT(AT_IGNOREPPC, AT_IGNOREPPC); \ - NEW_AUX_ENT(AT_DCACHEBSIZE, cpu->env.dcache_line_size); \ - NEW_AUX_ENT(AT_ICACHEBSIZE, cpu->env.icache_line_size); \ - NEW_AUX_ENT(AT_UCACHEBSIZE, 0); \ - } while (0) - -#ifndef TARGET_PPC64 -# define VDSO_HEADER "vdso-32.c.inc" -#elif TARGET_BIG_ENDIAN -# define VDSO_HEADER "vdso-64.c.inc" -#else -# define VDSO_HEADER "vdso-64le.c.inc" -#endif - -#endif - #ifdef TARGET_LOONGARCH64 =20 #define ELF_CLASS ELFCLASS64 --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756575241; cv=none; d=zohomail.com; s=zohoarc; b=X2Xuh+qgZWQxBrdFmmI29yS4sjpt3NrKjt1X+vmnt0DVUTXna6qcVDCkP3NIcuSpizbWAuuyzxcfaev7nrK/soaTn0cfm0L8LGsdvAJK5+uWV6fJQbdgyL9j3Gv2o2blyGIm3eC9G1g1QM99a5FlT+yZCSmkruhFlCeccy9JOYA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756575241; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=82O/q6SOg6fPNxHum5GoY4Fkyit9vffS6lSAVI/TIpA=; b=boUbmIQkbnFfelcqjMkXbmZFwsXfUdzlzBbRKp6uSPNM/ELAJmATc4ZKtrcxEZrCvW0/rV+cmT+90dY9gK/lWW71GM88Vs30ALlAvDW2wef7wLhOMhVAfI0PRMnUhqjfGn8PqLRP6+N/cuvMrDP55cIjfByYpPJoszbl2tH8XNU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756575240988751.19428153488; Sat, 30 Aug 2025 10:34:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNmT-0007WQ-E3; Sat, 30 Aug 2025 11:46:17 -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 1us7c7-0004xq-6M for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:31 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7c5-0003zu-34 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:30 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-771fa8e4190so1832833b3a.1 for ; Fri, 29 Aug 2025 15:30:28 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.30.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:30:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506628; x=1757111428; 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=82O/q6SOg6fPNxHum5GoY4Fkyit9vffS6lSAVI/TIpA=; b=QP1zGj03SnNl6D4dVbIfKq9Cqud4Kcpgz8jF4C4timX9GnOUh2sw/BSiCjeK6uPm6z OwlgWJ2kLLm7gKiiosdRsazShNX+3HpkOE/JRVQR76AZNxemUPbr2OOYC8irsG3hJPjL 2cv400EDTglEBRDe7Hu0Hn3LdYt/p7ML/EoTEt/Z0R3ICyAiffztzuykAdrat8BnWtgQ Kc//e2yb7ZZSrhWf/MbpQ3CGYOUZPoVnNa0HXyuxufu35V3kZZb1ToGzz9p5Wve0LNns bvDCH1R02Q6II8Zj6tWTCIJ+R51b3d6kb56qTh5ZwVfvf7c4XGlrXH+io1t1PRPCLKw2 xR5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506628; x=1757111428; 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=82O/q6SOg6fPNxHum5GoY4Fkyit9vffS6lSAVI/TIpA=; b=stVm3B6AFSQpP/2/S616CxEHXsTEfvW7vQf3SMIfj1dv4b8Ml3F7LHL5CV01bUixIJ xLV94xUj5G+vs9QbDzuAgp/LVSAKVegHYLg8JNTD/0/43Mjkk4T1PpiYriptogt+KrBW BVoPJN73W9rYO60qMMActDwEk4IcYyBGoYfDV/Wt1WN2f+oWX3HRk5K5TcSNuDjiPwyU V9DM/a6UJSfNTy49wAW7gOftQ4b6V8+gNqVJ5Mut1y5lurTk2RlA/O7G8cjUjhfwf80C LuXzUgFknZV5vYkjLM/6sxmIE18i+wriyL+E2cNawdk9QRlfbeL4h5Hh2QYbBHuCCtnd mgKA== X-Gm-Message-State: AOJu0Yy3XlcfV4PAVR3lfL7L8b6PkfyXXkvMzFEKSB28GsX4evQD6btn FbYRnKKnUzsJX8dS0YG+YxsM8GMDxpPMsb+SEgfNlgu0+pKgkUpdso5dzLYUo/mUxyc7bTsHd4R 9xk8VQrA= X-Gm-Gg: ASbGncsOcgVAS/wDJMh9j7gGRe0qhMVmmXPaM+jAI/9nigsLNPViSD65TJJ2tloS6Np duxtTrYlI5w56dAvreW9MkOGc3cOUvZXCq3oze6Df8KuPgh9syFwXAKvdI8FXbrEU8rwtsqveZe 0droO767tMu6FW0D7dz66Ra6o6FzENbP5rRXOEYKKhL5obKZ7Zbk2/2+wljYs4EoFhpp5MY0Miz Sez7phnovSgjBuSrljEiixAlrA6pU3DDceulgCIGBFxh/jpWoU29Uf78Y+Zjqfaa9q0LAJB9EyY SWCqQ0Bt8om0+IWZE/0Uf3hfaByctOSz0HDydK2Ivg1XrdUeGJjHmXxInW8OjIKMLeLPeh0X7en Hf96CQjfzYmnMuxhDkrtiu018fdX7jnu5HUW50Bn9S8l6pu06qkP56ULsQuFfB/k= X-Google-Smtp-Source: AGHT+IEgIMv6fEAd21ssiPotE6tubmy3PZRphl3JuVYabGuWJJP+i4okyLcLBPb/Ej9sYkd/4jvUZw== X-Received: by 2002:a05:6a20:244c:b0:243:c23c:85cc with SMTP id adf61e73a8af0-243d6ddb139mr365963637.7.1756506627675; Fri, 29 Aug 2025 15:30:27 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 72/91] linux-user: Move elf parameters to loongarch64/target_elf.h Date: Sat, 30 Aug 2025 08:24:08 +1000 Message-ID: <20250829222427.289668-73-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42b; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42b.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756575243619124100 Content-Type: text/plain; charset="utf-8" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/loongarch64/target_elf.h | 6 ++++++ linux-user/elfload.c | 12 ------------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/linux-user/loongarch64/target_elf.h b/linux-user/loongarch64/t= arget_elf.h index 1f40419af2..47bf51a41c 100644 --- a/linux-user/loongarch64/target_elf.h +++ b/linux-user/loongarch64/target_elf.h @@ -8,6 +8,12 @@ =20 #include "target_ptrace.h" =20 +#define ELF_CLASS ELFCLASS64 +#define ELF_ARCH EM_LOONGARCH +#define EXSTACK_DEFAULT true +#define elf_check_arch(x) ((x) =3D=3D EM_LOONGARCH) +#define VDSO_HEADER "vdso.c.inc" + #define HAVE_ELF_HWCAP 1 #define HAVE_ELF_PLATFORM 1 #define HAVE_ELF_CORE_DUMP 1 diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 526c90e2c1..a4005c44ef 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -130,18 +130,6 @@ typedef abi_uint target_gid_t; #endif typedef abi_int target_pid_t; =20 -#ifdef TARGET_LOONGARCH64 - -#define ELF_CLASS ELFCLASS64 -#define ELF_ARCH EM_LOONGARCH -#define EXSTACK_DEFAULT true - -#define elf_check_arch(x) ((x) =3D=3D EM_LOONGARCH) - -#define VDSO_HEADER "vdso.c.inc" - -#endif /* TARGET_LOONGARCH64 */ - #ifdef TARGET_MIPS =20 #ifdef TARGET_MIPS64 --=20 2.43.0 From nobody Sun Sep 28 15:28:22 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 175656963137447.37591835155661; Sat, 30 Aug 2025 09:00:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNmU-0007XD-Ip; Sat, 30 Aug 2025 11:46:19 -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 1us7c9-0004ym-89 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:33 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7c7-00040U-FF for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:33 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-771e987b4e6so2093729b3a.2 for ; Fri, 29 Aug 2025 15:30:31 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.30.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:30:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506630; x=1757111430; 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=WNzxAeN5cYMiVF+TCph1Cnt9S/tSQ/8beWQa5LB/yac=; b=L2HF5bKsoj1jCuz7Ubg/v/U87FAzc9/1gbCUG6pY9QPjaYVTWr3eGMDjvsleo/Xur/ sFCiUUPFeAM7N2oSljlw+lv/ozip0/ES0jb0LalLZEIZHLsEXRnT2sULuaz8QhtPNgrB bS14+FMmL6bBWphX7a2XWusY0Ts+fM9eN286EMsvlud08tiUkIUHwpbUhCLesTLYSxzK i3+w2T0bZg/7bspkPdW06An/cusXN9lPYVFLNEFSpeGbibYaCQNVtpOE+hBqf/WNKGef ButuWKB/DWhfcDmjxfgR4kOWCevAlKuWEDkHI3zDmClTPzQSloyEKs5lNM5wP1UGUQYr 9jMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506630; x=1757111430; 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=WNzxAeN5cYMiVF+TCph1Cnt9S/tSQ/8beWQa5LB/yac=; b=icPqaZWTsbCh63xrvYtvshNpCULXLLu1xz4I9Vy0fAVeKVGwpMeuq96cjBgmZEKo2O GchMh6Tr5ypO+n1VW2KorgR2loNmQGjqAHPaxQXEjp2JI9rK47INiSmPtJazOGHNDTuw zSu6nChqwGgE72btPXzlcwN2ZQ4cWUgjCEsDErmOT30bQELG6xoMfaWClYtnTgVQQsve 2Z+5H5LAltXcaW8UNE2PsbzJ4FX14i/Mk0+mogkiobq8ENFhQj/jfTtYxWdBsHi7ugZz FtYPdB/j1yksN9w66I7kuvIczCSxi17O4QTw0wjlkYioJyJZJroCbZIig6G+9hubpaeK GxHA== X-Gm-Message-State: AOJu0YxtIlUI9v80bSBG0lkbX7+cflU9n1QyOl/Fp5SMolaLJ4w75XMh Hx0jY9iyehD31t1zoYgbg23cDgfn4JkZh65MKJEBSRcrj/6KgEFqDpcFV2pXOpiz9aKSUOvikgc Pa8AcP20= X-Gm-Gg: ASbGncvUUh0dpF7mo/dDC20fkm5Vljp7wd2MmwQxU3WnFXX3VJi9+xgscL+vkSKt5bp KkMGydQxrlfEYIkfX/RdeEHDJM4evC1DuF9s4BojFWa7EM0/qNE9roPRWdlzPv1h5Refy2J/UBw zMVBfcR+4o7whlZNCIbD8r+kk9cLfE8keVwnPhRK6LBYcLMEJ4vlJNnNn4I8rOYlmrGOIaHicKh vxmcn5hSFxv2ZIhrZwm3eaOhzFOjR7dh38sB3L1SEN1q2XOZVYbr5SBx2BUwd3YPmiPC2b8VNc4 7Ccyg/CMuDfzJPFIkzorsPzlpaKaYcJZVcRqsw+CVpMr/b+TavDgRGm+jtjf6VMFnGaAxsH0TG/ rlDc+pksmVu8vNMbo+OPBm9IHXG32QBD9TEDRjU63f2EPVoFhEWecKs+2rlf9+jwKi6Y9qiVcSA == X-Google-Smtp-Source: AGHT+IHPB3d9t3uZ0w7HXkGZyhm9/Ho4SYmyxATfA/XPEuDPuXmBU+7f3UUkc4AIFJPuZsKA+1MEKw== X-Received: by 2002:a05:6a00:240c:b0:771:f8b5:d93 with SMTP id d2e1a72fcca58-7723e38c01dmr252847b3a.27.1756506629925; Fri, 29 Aug 2025 15:30:29 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 73/91] linux-user: Move elf parameters to {mips, mips64}/target_elf.h Date: Sat, 30 Aug 2025 08:24:09 +1000 Message-ID: <20250829222427.289668-74-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1756569633492116600 Content-Type: text/plain; charset="utf-8" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/mips/target_elf.h | 4 ++++ linux-user/mips64/target_elf.h | 10 ++++++++++ linux-user/elfload.c | 18 ------------------ 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/linux-user/mips/target_elf.h b/linux-user/mips/target_elf.h index a4b7fadbd6..f400bc2fdb 100644 --- a/linux-user/mips/target_elf.h +++ b/linux-user/mips/target_elf.h @@ -10,6 +10,10 @@ =20 #include "target_ptrace.h" =20 +#define ELF_CLASS ELFCLASS32 +#define ELF_ARCH EM_MIPS +#define EXSTACK_DEFAULT true + #define HAVE_ELF_HWCAP 1 #define HAVE_ELF_BASE_PLATFORM 1 #define HAVE_ELF_CORE_DUMP 1 diff --git a/linux-user/mips64/target_elf.h b/linux-user/mips64/target_elf.h index 67bc963134..c455985a76 100644 --- a/linux-user/mips64/target_elf.h +++ b/linux-user/mips64/target_elf.h @@ -10,6 +10,16 @@ =20 #include "target_ptrace.h" =20 +#define ELF_CLASS ELFCLASS64 +#define ELF_ARCH EM_MIPS +#define EXSTACK_DEFAULT true + +#ifdef TARGET_ABI_MIPSN32 +#define elf_check_abi(x) ((x) & EF_MIPS_ABI2) +#else +#define elf_check_abi(x) (!((x) & EF_MIPS_ABI2)) +#endif + #define HAVE_ELF_HWCAP 1 #define HAVE_ELF_BASE_PLATFORM 1 #define HAVE_ELF_CORE_DUMP 1 diff --git a/linux-user/elfload.c b/linux-user/elfload.c index a4005c44ef..a67147d43b 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -130,24 +130,6 @@ typedef abi_uint target_gid_t; #endif typedef abi_int target_pid_t; =20 -#ifdef TARGET_MIPS - -#ifdef TARGET_MIPS64 -#define ELF_CLASS ELFCLASS64 -#else -#define ELF_CLASS ELFCLASS32 -#endif -#define ELF_ARCH EM_MIPS -#define EXSTACK_DEFAULT true - -#ifdef TARGET_ABI_MIPSN32 -#define elf_check_abi(x) ((x) & EF_MIPS_ABI2) -#else -#define elf_check_abi(x) (!((x) & EF_MIPS_ABI2)) -#endif - -#endif /* TARGET_MIPS */ - #ifdef TARGET_MICROBLAZE =20 #define elf_check_arch(x) ( (x) =3D=3D EM_MICROBLAZE || (x) =3D=3D EM_MICR= OBLAZE_OLD) --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756569952; cv=none; d=zohomail.com; s=zohoarc; b=dnI75o+4FahRXZ+X00zXXoAZfLbIR70jLiYtdoacOikd8Q1LZ+wDbcbsmYTvE1a4V8KGOGdGaAyxupYUz3u6LTAMEuSr6e2geXid6FNc1yNLwS3ZOuGHcxFXFaHzDeZt7HQehfDj3ELTsbAUy1V+Dcv6j+rXHMIz9otLLltr3hU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756569952; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=gXwv+ZFBmnLT3vqO0wpKBBBu8DiiTjaPnesjLL2Fb9A=; b=UInQHj8N7Zuwt2V0frMdoWrrCXodNvRYwp6Kq+xfBYOOn4M59nRGlumZ1luluMU3ld7WCNln+jFKYz4/IiDaRIVn9O+uBFiufmkm+YX49X+LZOUTd+v7Z9UfZ4UL1+D3Ml4D3jWaUKO+MTcwOH1x3AZLuqaCcySGtYvif00cACI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756569952871315.2586215125041; Sat, 30 Aug 2025 09:05:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNkP-0002J8-TZ; Sat, 30 Aug 2025 11:44:09 -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 1us7cB-0004zW-IE for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:35 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7c9-00041A-Me for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:35 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-76e4fc419a9so2756908b3a.0 for ; Fri, 29 Aug 2025 15:30:33 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.30.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:30:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506632; x=1757111432; 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=gXwv+ZFBmnLT3vqO0wpKBBBu8DiiTjaPnesjLL2Fb9A=; b=m98BXMe8kRcCtYKZIx4da1kZPNnidO9/rVgN2NQ8c743n5aL7Bghm7qciNtYzxF92u NrR/hhT6pvKr9YpIcPjX6Wr/jdnchNfExYpsuqZGXrWjFro6VYfj4YVq/qyJLfFirvLX ChUFUclDFP5Zn/UdLaMANh4Wecvx/25kbGQKPp5Y7XOUg2zosO1/xHJYwQBcJcUSyLim +kWSuGZD8o8Op3MRsFUl9yk4ZGf6EAReRjUecFRyJDqEHzo+w5Dluaqc73cKPT4380Xy 0AUb1AikYM4KY61oZG8HXrgIghN+Q5kns2JxDCx23Ms/iLKsLk+SFsFp9De/SA42k+i/ eZkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506632; x=1757111432; 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=gXwv+ZFBmnLT3vqO0wpKBBBu8DiiTjaPnesjLL2Fb9A=; b=ERtGL2dxxroQxC3/Y1VzmnKFaHHnKoHNPsNhY4PpOzZx6Jxv6tMHlFqjO6cX2rx8wP xLrMmpus2IPPscX+IvQDYIYhs6Q5wrier+9L+Z753MNZ8z3RyeQBE39dJt7Aq4xnXzFH 97Yd3byw4xwIOEnzo8pr+B1h0Vxsu0zjRELsNVTj+vzeX7jyb53HqABPRYqOsMJ1I/2i W9A9/H6aZ8kxKHYKjNKNxU8HPhk1qAnguQT6N/nm+YK0CVAh0DMMM8KdgSyFoT4JDHQV ydxw+R9d/FEAU6nZ4hK4IKqISbu3VZbX9yaUpSIJ2407fB9ym4V7yfeqxJ+AUgBG/36Y USuw== X-Gm-Message-State: AOJu0YxYhVOVApUKH4k0xWj0bJORnaCxXStYtjj4V7gao6SQK5+kBrAn 1VOcf/sUPU2Z4E08QmzwBnogcnMak20+C2bLBxCfQtMqLJCRhnBuYESniDOKY+WBbtT2kfLp7qJ 6D5ZjXPk= X-Gm-Gg: ASbGncsSxeiJKchxNvcM1X0qT6rGMQbtSHO0u4GErO0voM5ag+r2NkcDWWJAqnBmjrJ rBeO9A+c/eO3PhIcU1pKvNId3YMYY5yTX/JTURr0OLUGlPtKwjAbmO5gkizbeOWo3JaS+vtz5Fe 0kVqjqLuqPyA5YZeyO8e/EI1OrUOuQP4kSzI5v0XdDMhROMml0pdcdtzuXlRstUPjP+rBY+eWz3 neKB2Szw0Jsdirbl6k5kM5uE4Y26AxdlBnJ9lAdp/4qaIzrdyyRdS60ACvMQjvjluisHdoNiV9v jqQ7VcpkaG4tZk2m5L9G/oEkyQ0dJfoLL4kDutrPAc2s66KSeo8X1KzuiuhjsqTBpArAXoEteP7 dGh8ExW5bPYrZmflFI2zfkAEsFm406UBNHMjdojd03M7RcIeHgipebWHJbFpMCcqXJmZIyd86RT i0eqR9fx28 X-Google-Smtp-Source: AGHT+IHeqZiJ3E3GiJlHjmDaxhPUJntWt9YsEZ4jcJai70QuXxLvOovFXr9Z6BniHxeOKcXPPUWhBQ== X-Received: by 2002:a05:6a20:1584:b0:243:aec9:41cb with SMTP id adf61e73a8af0-243d6e009femr341480637.17.1756506632202; Fri, 29 Aug 2025 15:30:32 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 74/91] linux-user: Move elf parameters to microblaze/target_elf.h Date: Sat, 30 Aug 2025 08:24:10 +1000 Message-ID: <20250829222427.289668-75-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756569954935116600 Content-Type: text/plain; charset="utf-8" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/microblaze/target_elf.h | 5 +++++ linux-user/elfload.c | 9 --------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/linux-user/microblaze/target_elf.h b/linux-user/microblaze/tar= get_elf.h index 56de77d4f3..a622cd8e43 100644 --- a/linux-user/microblaze/target_elf.h +++ b/linux-user/microblaze/target_elf.h @@ -10,6 +10,11 @@ =20 #include "target_ptrace.h" =20 +#define ELF_CLASS ELFCLASS32 +#define ELF_ARCH EM_MICROBLAZE + +#define elf_check_arch(x) ((x) =3D=3D EM_MICROBLAZE || (x) =3D=3D EM_MIC= ROBLAZE_OLD) + #define HAVE_ELF_CORE_DUMP 1 =20 /* diff --git a/linux-user/elfload.c b/linux-user/elfload.c index a67147d43b..6c8771d804 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -130,15 +130,6 @@ typedef abi_uint target_gid_t; #endif typedef abi_int target_pid_t; =20 -#ifdef TARGET_MICROBLAZE - -#define elf_check_arch(x) ( (x) =3D=3D EM_MICROBLAZE || (x) =3D=3D EM_MICR= OBLAZE_OLD) - -#define ELF_CLASS ELFCLASS32 -#define ELF_ARCH EM_MICROBLAZE - -#endif /* TARGET_MICROBLAZE */ - #ifdef TARGET_OPENRISC =20 #define ELF_ARCH EM_OPENRISC --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756577474; cv=none; d=zohomail.com; s=zohoarc; b=RBExDOhak/k/5kwhgXV03QcfMuXl3LYHngMTSaWO56B2arf7ivJS6B1wiXAlH8kM818MSWZ9q2bX6YGvw8XUohq7i+HZDPLKTlO2P2nfw9gvEF8eOu/1K/yHz0dxjkrYO5BTBj+wTH0E8WlRlwUhzrj/kx8Cyy3v0/tw6oxLTas= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756577474; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=lowHNs0QIQ4pb8gQYo2rhZhqRLDHpO1LE/Cpq00H8f0=; b=gWTiPfqz1X23F884msq7c3uwGpf3fI9fLQXObPZI2NQgiQzGCd0B2zWh/FSHuryBszLUDQF44skU/tr7ny5BKLpRYrkSMoAk6ZBz6r8nQIjacH0TNBVYuswxhZVVwDlO53BAmYFr+/DxeArALJt2iZb/6FEiI5/GS3w9X/UcDrk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756577474459354.0369318050954; Sat, 30 Aug 2025 11:11:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNkR-0002VZ-KY; Sat, 30 Aug 2025 11:44:11 -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 1us7cD-0004zv-Kx for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:39 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7cB-00041g-Qw for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:37 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-771f90a45easo2235600b3a.1 for ; Fri, 29 Aug 2025 15:30:35 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.30.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:30:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506634; x=1757111434; 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=lowHNs0QIQ4pb8gQYo2rhZhqRLDHpO1LE/Cpq00H8f0=; b=ZFemviTs0Alg/ZdcKrwhTUImlzJ2SvrUfVWQ0CEuuBQHn6anrzfkfQa8cHz2pvmeAz YqATdjZDg6c4XT3wgDiSlu2vfpU/j1v1tz9FXaObcZ8oj5kUGvT8EdrzOgKaT6UTSCr6 42uI3N8czC+Tt9M2Za3wyD46E2irPHGJt0qoSeu38jfrGl4/SipbK48hCNOzCJq+K+k4 kKc21iatN+uloNx0fVnDTsX4aO7O5lNsmk3CRb1FKpDQbmt2UUvRqH0u1Sq/tERBnA4Q 0u95I2gb3LZD89f4eUnz7w5V+xEWin2YUz+G1H+V7+GnLFBHGfuy122vFBNSv92GLp+y gZJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506634; x=1757111434; 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=lowHNs0QIQ4pb8gQYo2rhZhqRLDHpO1LE/Cpq00H8f0=; b=YofYzm+/+b4g3oRRUxweNilV2bwnpdRQnz748ZULNQEwqAkSVamFLGkc+xBGY0vjpd yBe08QxMAYl/zaSByGm9e6e6y15teD6zQilmpSchWnQy3hl0NPtBcvByN2ow58lSs/Jt DqWAMraJwN2xB3NBqL8iTgBneIX5pRuPEBk5AIAChMDR3OS8Xgh0I6+x56tmLobi0o97 VdlLjipMb+TkLLLmJHeBvJGb7d9N0cxD1zqMvMZ2+26eU2b5DlIsX1Sm3NVcVXu0cpNX 5xJyuZGwRRSQeHhDk08mBn5z1pQf7+Vn9J/h82v1LUFMuDmlrcjHNUsK3OV9DsRQhHyX ++xA== X-Gm-Message-State: AOJu0YzERC2mAyv7iWa2gBUI7MsK4kDIGuTc2XOXZvYm0s6dkBoPrBZg NTUYdl88vWyjsUD3FYnNSumv5q4MKAChqTDKhqdQuVXcPTWmC8QjkO1rdMRz6tKt1l9qQKe9jxU iDx9ldeI= X-Gm-Gg: ASbGncuuW/Frc87ZROLEvZnSW4jCIU20KhJXt0+ohYrzmIqyH3gLQ4jKaJCRmxoZ2W5 46Ysrvu5CwmRgd7Aa49QtMV8Uh0SfYemCUcahRlfQ+5Jb2HX9u6SZ4CRoCldM0PzPcPrqLX966i 7bklpDqgJjHNQX8WRq/poDatL+UWdFXT+H545IYOU1nT9xdwdAj3FsrEw4mFv/xH3NHc6ghg33Q fqrzjIMBaFiyEK3Gwd9ggKcfab+ifmrxpNurfhRGX5dDlBAo/usgPQvYl/oY50nB3gxGghlU7Gs w2JJLkW0NLSNFndhd4xkU1n00NcWpPG+9eYwV1ntPKU9XhD8rKqLL+i5Tl1qxFC+fOLmnjQcnGK DlA5VFkJdTKOwnzkxySpYiSQtRM9MuZuyzO1j2CrMXD/6KYuZxvXiFUuPF/25/aw= X-Google-Smtp-Source: AGHT+IHVPuJYhQjRxJNIkWzGnVz47GMqSwcr6dCnUDpBo3EL+TR2CsSecz9fTUDA7SfSj/ZioM8UIg== X-Received: by 2002:a05:6a00:14d6:b0:76b:c9b9:a11b with SMTP id d2e1a72fcca58-7723e21e594mr291155b3a.3.1756506634329; Fri, 29 Aug 2025 15:30:34 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 75/91] linux-user: Move elf parameters to openrisc/target_elf.h Date: Sat, 30 Aug 2025 08:24:11 +1000 Message-ID: <20250829222427.289668-76-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756577476190124100 Content-Type: text/plain; charset="utf-8" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/openrisc/target_elf.h | 3 +++ linux-user/elfload.c | 7 ------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/linux-user/openrisc/target_elf.h b/linux-user/openrisc/target_= elf.h index ad80e4b41a..ed9739380f 100644 --- a/linux-user/openrisc/target_elf.h +++ b/linux-user/openrisc/target_elf.h @@ -10,6 +10,9 @@ =20 #include "target_ptrace.h" =20 +#define ELF_ARCH EM_OPENRISC +#define ELF_CLASS ELFCLASS32 + #define HAVE_ELF_CORE_DUMP 1 =20 /* diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 6c8771d804..d0993621c1 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -130,13 +130,6 @@ typedef abi_uint target_gid_t; #endif typedef abi_int target_pid_t; =20 -#ifdef TARGET_OPENRISC - -#define ELF_ARCH EM_OPENRISC -#define ELF_CLASS ELFCLASS32 - -#endif /* TARGET_OPENRISC */ - #ifdef TARGET_SH4 =20 #define ELF_CLASS ELFCLASS32 --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756569352; cv=none; d=zohomail.com; s=zohoarc; b=AL6+fwK5Pkza4OF2sLSKIZjSCe6QJAYWBvFetj/c+4Kz0mV4EgYd8p4LD/fl2qwn9c899qdZxVf6Eq233AxZQXzLrQgaeo64oEtXdWTHGnSxne0om2a25nbfCelA8vN6FGQPswiAfMT56/cNCVKcxFpoax1P4I2rLW5lyXfkvNk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756569352; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=nTQnacEh/bavu4Iz6YuAlqixOQk5hLWfu3s3/rNKivg=; b=l4Wv7kaLdGYGEKDn/woM2NBJ2/YoAMHx7kyXV7+aNW9nPEWQDb771AOPEwrDrcxb+NDlincc0xh2l8QO0LVnovPY3RvFZJHJbmmHwec/zDewox/iCX12M63wWkiH4wZAu/vW20nfJ0TUImMOjklq6+Y3jSxrBUu7kuiQS66lMrE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756569352544514.7319012140185; Sat, 30 Aug 2025 08:55:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNmZ-00081f-Ec; Sat, 30 Aug 2025 11:46:23 -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 1us7cH-00050r-1r for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:41 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7cF-00042D-5y for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:40 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-76e2ea933b7so2376941b3a.1 for ; Fri, 29 Aug 2025 15:30:37 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.30.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:30:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506637; x=1757111437; 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=nTQnacEh/bavu4Iz6YuAlqixOQk5hLWfu3s3/rNKivg=; b=AwegcnjpNBE5oPyThjyvZtSC7eusCjo/FuWVlcbKuYrFxWb/acwrUERD5DFC8xp/EU HQVIE6ivkCf+zWXNHK/JiYv5t7G3cZJCK9KC7WENeIk9hz3DUe35uB+c9wv9N7B/yJFe yRd3R7mQ8s7nwjKWoqqUqJ9yjEW7YE1GxdlYOo+WJmj19ftoPZMJYEVsprxhiBcFnMs0 B3SUm6aA14jn5guHufKJyrhkfA6LTRlZLEEYQv7ecUNnDVriGouwmK+rDgXjE3lzqX/X dAomUpdhqRXZH/NfeyxT88w/Mf/Uw6ZQYU+yo57+fYR8pp4f/lJnEuSW1XGCW/9Z3362 AEeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506637; x=1757111437; 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=nTQnacEh/bavu4Iz6YuAlqixOQk5hLWfu3s3/rNKivg=; b=DzFTZB2xwbnAgM9DE1dFxatQ/YWKMs3wsAXt9Sb21p5aXYQNP6MwJSlzeQWmjnuUwT m884vsSxiIiDLpxzzEfqQKFZN0469NRosPlix9xk2hhUc65S8KgURs1+EbffU9wbkSUA 9qEuFbQFC921a7HTbh05nB7MXAfqGVgJwKPDwouxdHN+sle+WjBIfqnHCy+JDRxha637 zv+Ik3+RXOkKZNdbsVFKjAKPwYguuwZbvub+MGoN8Mlx0srIWmxqwj+E7lcHjQa9JC5z gD1vQ8aTTu8zu+/TRSw4pFaz89P8m3iZRPvgusgutnDV5zrzS28UkgVVOtVmTKroslVM 7DuA== X-Gm-Message-State: AOJu0YwqFUIf+3+oldrj2MISzk0Wm/lNDfGmnK6pamsvsulaHQjEqXVB hwsXhieZOjHKhY/nwXYJLkVMWquw9bpHN2jdJJw0XQ5qN1SLtM+mBeYB40FsWUNIS0vBbdOtG0B hd6euunM= X-Gm-Gg: ASbGnctIu+rzULoVsDiLV2UXLlt4EjwH0973nuXzlOAgVKNYlEEf0jQauMI6qZKQvVu GZxQuwE2D+C1wfXyQiyeYxq//TFrkc1vAsc2PmN91x7iqfrRgM2a7dsro8JTpKX4wqGpRbH8mTo i1D3BLDj8Svuig5cto3aXdiBCkvNwvgQW5ImypuQ7WDq3XN2N7tx1RsytPuxnDImde/3pyW7dqz wGkP2a3zzRgTCkPmIv2BkWpPVh+NjnZ287CrAvGCp3w+pitqSsKF/Qggvyd4hYk4aGc4Y7TtnmW dRsxp5CpKOT5M1tnN+0m0y26lY9KKQsOu1t1VZsiXt4zz/H+UbkVEbbaGagycCxFW1bXRfnK8HG 8XhXDFhWsN8cFYqivg8K+kEdbVvrHF92IkYihCOTJRGwT1vc6IO4vB8btGRjUozg= X-Google-Smtp-Source: AGHT+IF1c2cBBB1YMUnPrz9xgZP/vv4P8i8g8kfA43cZXe3EYLd2FzyVNPIAe8IejMaQqKCXZdPRbw== X-Received: by 2002:a05:6a00:2b86:b0:76b:f7da:2704 with SMTP id d2e1a72fcca58-7723c503bc8mr564755b3a.11.1756506636685; Fri, 29 Aug 2025 15:30:36 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 76/91] linux-user: Move elf parameters to sh4/target_elf.h Date: Sat, 30 Aug 2025 08:24:12 +1000 Message-ID: <20250829222427.289668-77-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756569354614124100 Content-Type: text/plain; charset="utf-8" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/sh4/target_elf.h | 3 +++ linux-user/elfload.c | 7 ------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/linux-user/sh4/target_elf.h b/linux-user/sh4/target_elf.h index fd3ae68a01..61aea237c4 100644 --- a/linux-user/sh4/target_elf.h +++ b/linux-user/sh4/target_elf.h @@ -10,6 +10,9 @@ =20 #include "target_ptrace.h" =20 +#define ELF_CLASS ELFCLASS32 +#define ELF_ARCH EM_SH + #define HAVE_ELF_HWCAP 1 #define HAVE_ELF_CORE_DUMP 1 =20 diff --git a/linux-user/elfload.c b/linux-user/elfload.c index d0993621c1..1a6e81394c 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -130,13 +130,6 @@ typedef abi_uint target_gid_t; #endif typedef abi_int target_pid_t; =20 -#ifdef TARGET_SH4 - -#define ELF_CLASS ELFCLASS32 -#define ELF_ARCH EM_SH - -#endif - #ifdef TARGET_M68K =20 #define ELF_CLASS ELFCLASS32 --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756570670; cv=none; d=zohomail.com; s=zohoarc; b=T+lSYjQt8beXUBC8v5b8MqOd4z6XialxjUhLU/j5txAW6g1oDNcpfrjF6cpT/dF6fJDZc8mrbsvIbTbY78fVNU7slViTbBLdYHzQVEuRlFoGFACHOex0XluXsNolKyvX1F+WSP/xTLBjhI9wotsnglBRzX1PUgz1hTi1QHRg0eM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756570670; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=opS1/MQaTNLhtHvSC8J3as0oJFPKDsl0TAly/SBB3gk=; b=SB0Gnbuk5K3BVmKxkjUT5redpb+lowYciLnVaWkTBfVhwgtkWbL8C1LprVZLf25fB8yR0KJu24V0UDwCbSNfmQ+3P5f7qv/j6bfclenl2iGmPw4nsSAZJ1lpJJLH4blMZkZJPF9WcHGiKIZxlY5PpX3Hm/UQjM/kw2HWYSnAtjE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756570670693961.7077291491986; Sat, 30 Aug 2025 09:17:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNmb-0008EA-Jj; Sat, 30 Aug 2025 11:46:25 -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 1us7cI-00051W-Tk for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:47 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7cG-000434-Tm for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:42 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-77201f3d389so2808021b3a.2 for ; Fri, 29 Aug 2025 15:30:40 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.30.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:30:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506639; x=1757111439; 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=opS1/MQaTNLhtHvSC8J3as0oJFPKDsl0TAly/SBB3gk=; b=Z+PJBcTJPOLmjmA2RHy7KcBVV9nesJftV7R34njAYjwTJppdNPD4kGR4hJ7BPsia1H t8FBUpGjg+IZkeW9D3h7OAuSUVpNFzovwEtdShM56J7KcZTcYLR9opvpuk371YC8DcGu z+hK2pvJHLXxoro4Q6XjSPf0l30frtoY4Otah6hwxI7g2iuJnqylQMJqNyj+X90mq1Ex UUyygDMI7uRVYcpLoRxpRnCnuzNNMqj4G084TK1+a2lty8GrSWa+9oBrN9uMLn0F3UxZ GuJ48z44w7tHP1pinOmqX9fD7pk4ZtxKOZ52ae6/5cVUZ2Dv7s9rvD3CMcyXKbCR5x35 VGzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506639; x=1757111439; 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=opS1/MQaTNLhtHvSC8J3as0oJFPKDsl0TAly/SBB3gk=; b=iAjVc2vGbACmzPaRDvnbFtjqeyHtdrhINVd/egbDVftb2xjdka43kScqPQiTj6YKJM dkPIfVzcR60wl4JXWzUwKsZKh+oPNa2KaLT2irmXWD7WGeatg3LswP21b7qp/45Hslpu NuWKWlT9xZJjnDm/RNZZ4/MD/ewkuz93gARSkZOIUeA0NxVFQ0mLAMV3cTFFRNRuJvHP 6SJtLqBqLUFOSPzBqaDx+BVLHFXf0n39sN2k55Lw5y2yag22hNYRHdVTB68uDmRHsUlc BAKcc86AiOiKkXZFCmxRdfzlIIV211rZDDNzmKYvyfPXA/6M7Spccn4YWfT6rlaJ7XGC evMQ== X-Gm-Message-State: AOJu0YwnZ1cPvnHCF/57czvUPjS9ViJ16rSLTWjZV8gaoG40MrTd1t20 4Qe2k/GehkszJAmJgzAx8gOhC1jWaqHyiCAnyEFw1v1eGxrEvQBsE4xX0hM67h1p6orin6h66fD LU/A2p1U= X-Gm-Gg: ASbGncuSkly3+LZG5Z+xXw1hrxijFgjQJF/9NjDqEdYE76el9/GOzalqLDoGyrU2CIg tdIpd1DHxb7r1/XW/ssgBHReTJVgMDe9/oDy8bWlZu1h9USqYq5hK3XN+IK/8PnN3nv5sUvP5Rv DRHRsrbeVpu0erGlFs2XwVA0crkvdiyGNlR2/8mcQeEsFj5U3E8SFOnzcmcZm9AwQpP8/FQ6aYh EtNKB8JTJL+kE+s8LpibErUjT06M6FLbVNd2YRGPBNJUqocR3qNaB5WZCcEICkAtpx3U37Sh0V/ o54/90bb0nTGBGY0gy3crVnVN+626zegbdzLxGCZ76LQAqLaqiTC1nH85IQfzm8CBzXlOi1otGz VJivbCVSJADDxckAgIhECA+1I1wDi+lKL9z+yLcwUSxNlPtDLALrGnwGrRjLJe2/p4HG/F94N5w == X-Google-Smtp-Source: AGHT+IGj5p8VWfnI7VTFWkeDM5p3xFzLej1t3JuCIYmrSN33XgXmdlOyFs0esai0tvRtQizh8TDWHw== X-Received: by 2002:a05:6a00:2381:b0:771:f69a:c426 with SMTP id d2e1a72fcca58-7723e276e5dmr329053b3a.14.1756506639233; Fri, 29 Aug 2025 15:30:39 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 77/91] linux-user: Move elf parameters to m68k/target_elf.h Date: Sat, 30 Aug 2025 08:24:13 +1000 Message-ID: <20250829222427.289668-78-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756570673747124100 Content-Type: text/plain; charset="utf-8" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/m68k/target_elf.h | 3 +++ linux-user/elfload.c | 7 ------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/linux-user/m68k/target_elf.h b/linux-user/m68k/target_elf.h index 0737412cee..073c85becc 100644 --- a/linux-user/m68k/target_elf.h +++ b/linux-user/m68k/target_elf.h @@ -8,6 +8,9 @@ #ifndef M68K_TARGET_ELF_H #define M68K_TARGET_ELF_H =20 +#define ELF_CLASS ELFCLASS32 +#define ELF_ARCH EM_68K + #define HAVE_ELF_CORE_DUMP 1 =20 /* diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 1a6e81394c..a3757c595e 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -130,13 +130,6 @@ typedef abi_uint target_gid_t; #endif typedef abi_int target_pid_t; =20 -#ifdef TARGET_M68K - -#define ELF_CLASS ELFCLASS32 -#define ELF_ARCH EM_68K - -#endif - #ifdef TARGET_ALPHA =20 #define ELF_CLASS ELFCLASS64 --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756573727; cv=none; d=zohomail.com; s=zohoarc; b=N1KEA3G68AZD1sTe0IeYQifkg3RIGN9VVwaODlXBUTOT1aQF2vfWC5ZV2aeKdpCDIE4CYYDvGDqAtXycXJ269jjuyB1Ib5Qzu4rMjv/KTc1cDByjGtutavVg94XW28jq5rUscfUlPf3f/CCPrH7Z/zVdUgFGx/QpQcKj4Txs8fI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756573727; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=KLhobKMRxEo0CbtdUR911qjNXLbwZnrIInwr1urPJ3M=; b=WXNsW8iOmxTxQ0bmgHb2jB1B1CibR2A6A+hOk+GUIyXaaPYhNmte9OmoUNYLZ6omU8J65ImdACZ9LtRoACI11oCgZfVeB3c2TawQ2NKdCK5ce3z5649fX+mb+1V3d5uyPFPt6PFHilXn3B8V8IKAUlipXS2NrP/s5rztpURAyTo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756573727171551.3190551494032; Sat, 30 Aug 2025 10:08:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNkW-0002l0-7I; Sat, 30 Aug 2025 11:44:16 -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 1us7cM-00052N-N7 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:47 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7cJ-000440-9k for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:45 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-7723bf02181so239188b3a.1 for ; Fri, 29 Aug 2025 15:30:42 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.30.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:30:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506642; x=1757111442; 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=KLhobKMRxEo0CbtdUR911qjNXLbwZnrIInwr1urPJ3M=; b=dswB6ha7mX1FusRJ+p7CLWegTAhEXjyKRMqoQbglhayMNUSMTyJ6Xiu6Ylcho0r4cO UMEpKMkcwpeeoJ63cSfGJdxMG1kbQTKR8vlwou/xJlEVhU5LQiK0UNot94tY7NQ4eewP vjqfeC7cK0B1iGJxZAmzeJdeR7NnOhsN8TrInPckRIoiRRe1q01vEGprmD3xOwvzVr3S rkTDlpeOIBtVasrSkc1T+rWAHpSRx5F+kLSA11uTFxYMV1WMRINQ59LIHSj9y87kU9nQ 9PVMhAbJB4pT2zm0+gNhHT/0R23qG2L72dqaJJP7pCn0ES9fjzWHWFxrdOovJqTOYCpv prsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506642; x=1757111442; 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=KLhobKMRxEo0CbtdUR911qjNXLbwZnrIInwr1urPJ3M=; b=gidHCE2xaCZdMJUnYdLpYePpEifIfwpnvfAlcD7r+bkAdUVKsyQi7NQAF/1Ez/Tsbl tjLA7lQKo3DN0wCkf9EF0UfzplnovDfBMtV07qhsj8dan+ikwvRbMCgIxCco/eFPL7/C EuHTquATEEmejczcgMkuiA9q0B69DW6XDCiCgJZPDqnAHiuP+m81ZxN9s+pL9CLThj3o hWHqcNmhpVK9UeE28G+0a7o5r1Kw2P8sxoeAxgWxGZKrv146ybBG04ezuzz2wj59AuNL zZr+iK0U2nMUItkAPZyzBLGB2ugBO6djs4hwFnCr/Y0LSzSWvZ+UnTlcp3oKELSudmCG ZlIQ== X-Gm-Message-State: AOJu0YwxEH0F/H35qWkkeb+wcbkoTJlhG5KfsZtncJP8rcOoEc4v46jd INr4HSb1CF2rs6iIOO0fNnl8Xf89zF0FVvqLjaT3SH1k8iVl5eoeHnp+e2o1xz8/IB4/oLk1f+w W/ErRiUk= X-Gm-Gg: ASbGnctULSlY6SGSn4EXZn6oij5h2tsIIEZyvcgHw0SgX2sdaqiyQo5jOr7GwZ+Y2uc 0zjzQuT9J3/DTFvallYA+tqYNxVfevcGryqAjjvQubmybbDQKloCk6F0ukiaaWdhN9VxHGoEz/6 gECq1gIHM0AVaxJT4S4aD+/hFfc6vZGXQzoUGNO7wK82FC+EGPzALNv1GhCDZt8ooskTk/TAxDv 4CPLyYnBf28pAwGKNFtfHXh4SVyKoOhze31qANSfr29PG07MCH4BlKKCDDReStUiadOYtLgpEnR argxnKwIGA7KRmiAIoeTppfkmlL52wYQ8G3EgRlgvGKbluSz1ThZCTCwxvcDd10xEos5/cNoOL1 gxLvipE4vSfYXXJjJW+Xrr+HCvDxv7qJWHVo4NsKox3GraQcCvn6iC2O+WlmfeKg= X-Google-Smtp-Source: AGHT+IHe1tVkgqI/kaM7X09veNursxaJ8EbfVYQDXGNCuOBQkg2NdEu4iuTHR5HSDnWdjAHjk1rFXQ== X-Received: by 2002:a05:6a00:1404:b0:770:556d:32e8 with SMTP id d2e1a72fcca58-7723e3502d7mr329538b3a.24.1756506641637; Fri, 29 Aug 2025 15:30:41 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 78/91] linux-user: Move elf parameters to alpha/target_elf.h Date: Sat, 30 Aug 2025 08:24:14 +1000 Message-ID: <20250829222427.289668-79-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756573728259124100 Content-Type: text/plain; charset="utf-8" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/alpha/target_elf.h | 3 +++ linux-user/elfload.c | 7 ------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/linux-user/alpha/target_elf.h b/linux-user/alpha/target_elf.h index 52b68680ad..f9d6372c9f 100644 --- a/linux-user/alpha/target_elf.h +++ b/linux-user/alpha/target_elf.h @@ -8,4 +8,7 @@ #ifndef ALPHA_TARGET_ELF_H #define ALPHA_TARGET_ELF_H =20 +#define ELF_CLASS ELFCLASS64 +#define ELF_ARCH EM_ALPHA + #endif diff --git a/linux-user/elfload.c b/linux-user/elfload.c index a3757c595e..aff800baff 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -130,13 +130,6 @@ typedef abi_uint target_gid_t; #endif typedef abi_int target_pid_t; =20 -#ifdef TARGET_ALPHA - -#define ELF_CLASS ELFCLASS64 -#define ELF_ARCH EM_ALPHA - -#endif /* TARGET_ALPHA */ - #ifdef TARGET_S390X =20 #define ELF_CLASS ELFCLASS64 --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756571528; cv=none; d=zohomail.com; s=zohoarc; b=LpILekC0XKoKd6U/1YRlbG9E8jnCjdETaxcE4Og3UxrNxEuHiTRi9TdVEwEdgTushVZmXiqHjE4DlXAldAfxIM0TifI18XD01CqN0tzLEsLfe6n7/sbL0fO9rLaUnRnNXrWltlCLc4cL459GoKprLc1dS11ksnF50Xm2B7Zn5Zk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756571528; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=FxucZH2VlyVQTK5f+n6yVv5JTT2Ms4zzKCkkvcbLT78=; b=ZnQX/mxP8qXkfvfjH17Q/pGtY590kNsMGJal/4fIZPc90Erx5GTO8dIp60kUSIQl8EYg4I6MxZ6pKxAipPmnB2CaGsaC5oOEaK4TU9iJtSXYrh0ggcnAvWSWljpCrChz8PBFrtpIQH1vRFFw3luWtJGjaZFIWHA/f2X3Xn6tt5E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17565715282201018.9514231182834; Sat, 30 Aug 2025 09:32:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNkr-0003Ep-Mg; Sat, 30 Aug 2025 11:44:38 -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 1us7cO-00053G-Go for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:48 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7cM-00044n-D7 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:30:48 -0400 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-7722d6cc437so1102534b3a.0 for ; Fri, 29 Aug 2025 15:30:45 -0700 (PDT) Received: from stoup.. (122-150-204-179.dyn.ip.vocus.au. [122.150.204.179]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a4bb5dasm3364297b3a.55.2025.08.29.15.30.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:30:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506644; x=1757111444; 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=FxucZH2VlyVQTK5f+n6yVv5JTT2Ms4zzKCkkvcbLT78=; b=w7rjNtFFCJcJipiqCru+KGQrdHYmWzbRC75jsRpd3Pr4mfyRv2Qa9OHflqNaId4QSl LSwqhw3QdaVWeiRHCcjD0BmEXDnMyuP1eTeTqfJZgsGcQS3vmA/n8CWfoymXhyITtUzD wuGr5PbH326TL0nfdiqlF5qiQ6Qwj139ERFtSBf6sdexdiQ95wADYbLL1gBAcZYidcmq sbxnJHgqKnnlq1S8wNydL6dCnF7Z0U5W376B719bzPDEArPZn6rSPDo+c8KZ6Fm+E1Wh ASMF6l/heQ9yLMbGcHEr6NzTwteP19v583KsY0HDX/JvfdGciZgGejie/W4+NI3bT5Z/ T0nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506644; x=1757111444; 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=FxucZH2VlyVQTK5f+n6yVv5JTT2Ms4zzKCkkvcbLT78=; b=iiLC19KjfcZwuykiazYWfVsvNsmYy/8sXWZLgx2OaCLj96drWqn/2+jKxxL+zabEzq 3+e50gBEWhr/bGyApoGAyWhUz/MkXisgrhFX1eHo1Xd+Ff643Is7dhHPWr4jEo9m4N4i ghsJnVFa95agcVXBqVC205g0rKpmmK+GPyObZA0NUZeDjsx9/XwcScQHv0OsmR56+TgX 5k6366EpO29BW9BNLv2hzRZ45fG1uFxcX62sZJ+qaIzHtfMad1VCHNE02HEQuTyxlDDP lTXHh5b/5HPXddjhvJkHvSvAiyBTUNNoWUsRCXIKWir1weoVTxJEWPZCsCAx+g2pxilG g0fQ== X-Gm-Message-State: AOJu0YyV56kQ3bKtl/T/Xr941xZScGqLFBYBETi+O4RsRQ7KCNgufTkp AjtH0XnzET+8hvz7eTbp5yALVUJKLRmWINrg1QZaw4p/itlzqL4edRxnN+mBTItfgz105CM+Xop W6zBaDMw= X-Gm-Gg: ASbGncvbz/jv4VccDsy0xQwZZen40f4eORXVY6y3VgeK/VcrH+WDYaGEZUpx9KYLPOA LmvHvgoCzLTmEmmx8I5m+m4cG1hj9HoPBLB/JVyFn8E5OvPfb99fbx8gCddylEL3p3pAjt6EDdm g3nwBqEWagn8K2qYwboaO15cNwMNGrBbTpBALssDehQFeGCP6OkfVe0Ao8NYFzDBod9K8gOTSId GZCjYiafXAQ2Mc4p4adO7p1JifdlboGWpMD8YoTTB7bRJsk7/fehs7sNldgzpEB+agZq/yB6bLB 0o2+HTLY4qoPEFBFPKLuVP/SfFutJkRoG93UDBoclD2bO9/jxBtuANA8s37ABeeLh0SaF3zK0sN OwGPG1qiT7y0bT3lcAYbsYa+48cGg73KXJMV/71RSqRP4KVZ1rJWWdKiGZ+XAFMw= X-Google-Smtp-Source: AGHT+IEsK57VTmdlAgmlhoPtyCsy3K7DE967cJwQ6bE19yvnQfmQAVuWnHKnuNOQK3diTe5/m4UWVw== X-Received: by 2002:a05:6a00:4709:b0:76e:277c:32f7 with SMTP id d2e1a72fcca58-7723c504870mr642479b3a.9.1756506644038; Fri, 29 Aug 2025 15:30:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 79/91] linux-user: Move elf parameters to s390x/target_elf.h Date: Sat, 30 Aug 2025 08:24:15 +1000 Message-ID: <20250829222427.289668-80-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756571529277124100 Content-Type: text/plain; charset="utf-8" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/s390x/target_elf.h | 4 ++++ linux-user/elfload.c | 9 --------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/linux-user/s390x/target_elf.h b/linux-user/s390x/target_elf.h index 670c7b3eed..b23e46ab46 100644 --- a/linux-user/s390x/target_elf.h +++ b/linux-user/s390x/target_elf.h @@ -10,6 +10,10 @@ =20 #include "target_ptrace.h" =20 +#define ELF_CLASS ELFCLASS64 +#define ELF_ARCH EM_S390 +#define VDSO_HEADER "vdso.c.inc" + #define HAVE_ELF_HWCAP 1 #define HAVE_ELF_CORE_DUMP 1 =20 diff --git a/linux-user/elfload.c b/linux-user/elfload.c index aff800baff..705d726922 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -130,15 +130,6 @@ typedef abi_uint target_gid_t; #endif typedef abi_int target_pid_t; =20 -#ifdef TARGET_S390X - -#define ELF_CLASS ELFCLASS64 -#define ELF_ARCH EM_S390 - -#define VDSO_HEADER "vdso.c.inc" - -#endif /* TARGET_S390X */ - #ifdef TARGET_RISCV =20 #define ELF_ARCH EM_RISCV --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756569754; cv=none; d=zohomail.com; s=zohoarc; b=Z8Ah7H3iGkZch81glo8glXixizrYlwaZtlzLsJlW6mi0iZdqqjq9yRIfB0Ytv+kcxh87hNMsOgiQFhUQmVmzgbNcDWEgvbl5CLAdEHWG7pRsDc5DCXCuvJL4W5FXhrwC90Dm9h/THy4c0Yucc/Kb6d+wY6YiKoGp77MszGGT4A4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756569754; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Ehuepqbbm1Pb/ucVF5IT0BiMjGQDJEiKUXOOtANgHtk=; b=YBP70HZIVGHbB8IeD3PVdj3ufg9M4PIZ6P/esvyz3AGfgKH35TIMoPcDpO5WG0ywfQszZVjKwrX0DLEI7MpXW7YODvpenjXPNpYx6TMC1S4cm1IZ1uPmAXHNaOMpRkY1qQmPZQ525uSJmleIcRI22LY/GuLigTa/C+2B1Qe2Ebk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756569754586233.84363971237997; Sat, 30 Aug 2025 09:02:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNmd-00007l-V2; Sat, 30 Aug 2025 11:46:28 -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 1us7fN-0005vU-5W for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:33:53 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7fL-0004kn-6Z for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:33:52 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-771e987b4e6so2095219b3a.2 for ; Fri, 29 Aug 2025 15:33:50 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a269f27sm3449728b3a.12.2025.08.29.15.33.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:33:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506830; x=1757111630; 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=Ehuepqbbm1Pb/ucVF5IT0BiMjGQDJEiKUXOOtANgHtk=; b=WSh2EOgMX8L89JL5UKOPeq9pEKyJ/vlXPcbAsrIGKe93a+LJX09FUpdCbruwEkABu6 +hRmd+zm2J58WYFgD8hrvM6KVuimuxDv2wz/rn0ORx9Gx5Oq7GDEfEam376OLc7naflZ X9K4NxVAipA5514tvP4fuZnzZdbiT8yySCMNohf5uMUZQLgKsgGtY+Mj38IYQfMmmZnJ 4VYEO/i+8UZQcqVhWMPPGu+0dHcsWXRtvR9A/cMctxKaaTyD5QZFLSxMl9dCmdOA7Bkf gstG9ehYwKv1hy8nu0h09XJ6jy7XGPoHot3eowh6WacldLCtXfYJaLe2X0P4byCd7g3s V/HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506830; x=1757111630; 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=Ehuepqbbm1Pb/ucVF5IT0BiMjGQDJEiKUXOOtANgHtk=; b=iuR4B8kTAtTwtNc+eulQ2UIvPAJsUFEmRqps4CMdJ78e2H93VsTVjPhlA32MHyeKMj RlH6BlpAGxbFhn7T2bNdmHkpDU9rKci/hyG//6QeVSX0xllyDPTHx2wHeWSnKokT8Ols M5n03+3Yr8kBPttHowWQqTUhIOYhBBD7DGESHvEB6D4SmtdhP2PYkqMkc7bk6/Ar0+gu /s3apt0ST5u1X0gngt96yFtqgSqWnrcW+BGBwREN64RnSVjTcsXUxOktEfvKgzdrHNt+ H6/Pzb4cR14eBKbMqggCNV7jYFJjus5OX+MT12/KzV/0wRmFVe9GlCd0bdZpKvrWbv0k AygQ== X-Gm-Message-State: AOJu0Yxf/+I9vFRHQH7lsaLi8036Ok1pDUvN3lSF78iq2GybCEdD7N3P S8sZATP7nLH5BZwof77Fiopq+7dJmAVYAYtXHeMy0Q07OgN7VLffPBmalOTRR88+i3I1ERnoDHm Xe/J7VrA= X-Gm-Gg: ASbGnctvOfXsGTRKZSeLzqPw63lEqNhTBtTnp+yvPWtFhaGD+H5JyEDpR76/ROeyw+O W3ukAE6687sZxOWpygCwnjUNlICc2S5OTe7iKbXzHkNnO5cuTuianaQABa0MmFmH/0hIdAvKEhA 1IZoegrgfd8oELJVFqzY2M+WBB4Ln/XdC1H/5hXCpIJ2NwF/+EvuxZSziSWh9QtPlvUcBVxXVEJ DvZiEL9lEXvD8W/ukK+OX1ouzwxE0cfsfdEcVkTH0AtPF80PCR7wibTTwhTAaWnYikcTj4/D1PI gjAVdDfIN2IOZnG604OcpYT1q8ZbggoOzJ/f54+YHMDf5ooeCiBziaWaI1mrPay5VaspldiTftw gDfiNu/QXMsObN9AN1qdmSQPEISszE3CDDDITx/5uqlD4dQXcW5HFbh3+JseR X-Google-Smtp-Source: AGHT+IGnkBb/UdwDIGtDE9/rdtjgkj+MFXrkVyYyI1/dn4U4xOH7U9+C99hEVGdmJMACTJbR4QU2Cg== X-Received: by 2002:a05:6a00:1495:b0:772:177:d442 with SMTP id d2e1a72fcca58-7723e309f7emr306041b3a.20.1756506829714; Fri, 29 Aug 2025 15:33:49 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 80/91] linux-user: Move elf parameters to riscv/target_elf.h Date: Sat, 30 Aug 2025 08:24:16 +1000 Message-ID: <20250829222427.289668-81-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756569756773116600 Content-Type: text/plain; charset="utf-8" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/riscv/target_elf.h | 10 ++++++++++ linux-user/elfload.c | 14 -------------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/linux-user/riscv/target_elf.h b/linux-user/riscv/target_elf.h index 48d9af557b..51b8def1d1 100644 --- a/linux-user/riscv/target_elf.h +++ b/linux-user/riscv/target_elf.h @@ -8,6 +8,16 @@ #ifndef RISCV_TARGET_ELF_H #define RISCV_TARGET_ELF_H =20 +#define ELF_ARCH EM_RISCV + +#ifdef TARGET_RISCV32 +#define ELF_CLASS ELFCLASS32 +#define VDSO_HEADER "vdso-32.c.inc" +#else +#define ELF_CLASS ELFCLASS64 +#define VDSO_HEADER "vdso-64.c.inc" +#endif + #define HAVE_ELF_HWCAP 1 =20 #endif diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 705d726922..6e476d5308 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -130,20 +130,6 @@ typedef abi_uint target_gid_t; #endif typedef abi_int target_pid_t; =20 -#ifdef TARGET_RISCV - -#define ELF_ARCH EM_RISCV - -#ifdef TARGET_RISCV32 -#define ELF_CLASS ELFCLASS32 -#define VDSO_HEADER "vdso-32.c.inc" -#else -#define ELF_CLASS ELFCLASS64 -#define VDSO_HEADER "vdso-64.c.inc" -#endif - -#endif /* TARGET_RISCV */ - #ifdef TARGET_HPPA =20 #define ELF_CLASS ELFCLASS32 --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756573017; cv=none; d=zohomail.com; s=zohoarc; b=G2wnIwhjhRD+zZJuVjv0+ktb4TUnjYH7hwVWDeLeUgYgL3MKPSD3nBQzpzZdMjc4Bd1BuKErA9JsnkQOvrf82Cj05L2Ku4rK4t8yc39i9zESnszZYe6zqQB0hT+FBVppLXezTHgHQ+vvwAdn3O4dJ6ciN8XIz0bnJtI1CyTW2l4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756573017; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+fMdc66z+1eXUdLndIT85qIQpM1j8AYTmXXRdsfc7RE=; b=BlvXqw5yfMJUzFUJd7QODjx443DLWEWwOJKjVQ6v4z4FUQJz2I0q+AMKjk0EFezQV+mVX0ukUdWGULWvbqQpQ/OGj2VjjfVQTYcGi50ZaGb3qkaAq/6DtWqdJn7ICC/FGM6YAy0A9OUrBoDtcfEryLhejfstv/ih4EgtCbzXu1s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756573017091299.44806464017006; Sat, 30 Aug 2025 09:56:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNme-0000II-Q9; Sat, 30 Aug 2025 11:46:29 -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 1us7fP-0005w7-DX for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:33:55 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7fN-0004lB-MJ for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:33:55 -0400 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-76e4f2e4c40so2303419b3a.2 for ; Fri, 29 Aug 2025 15:33:53 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a269f27sm3449728b3a.12.2025.08.29.15.33.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:33:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506832; x=1757111632; 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=+fMdc66z+1eXUdLndIT85qIQpM1j8AYTmXXRdsfc7RE=; b=HAu8iDM0jYa5tEIA/Q8YNLxncwMEWL+SK+p205CtHZ0yQOH9/lZ7MstDTMOEVgov3N eHinGo5uztPRY05X9iGZoIz2ujKCbMAaqzFnU8mGpWoRqpxrdnbwkVTOsCCdFhQtJYFy 3lOXQSrD+Nn3NRtHpQJ/GDFFkEvZ22JOjgRuAtEbAT7GuNkDP4sbr8VqeW8VCd4LlOa/ Sv/SGXgUqYmSNa458N2q2vt1K30a4f8JTxl6Z0rS/p4I/+zRLuEsk+Q9pEMJV+eNP7eV OW91MdhSaM8rMWtHhuaVGPRYR9t96U9tMX4gNqkO7rdqfQXd0ESAVjRteSRBu5QU90IW Oy9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506832; x=1757111632; 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=+fMdc66z+1eXUdLndIT85qIQpM1j8AYTmXXRdsfc7RE=; b=MVU/iBCxlkZH1W/JaYH4HPoVt9h9jUInrY5uB5DDz7h+Ml+x7E61IU3xn6NjzwlHJu fm4iW+SP1UmDIZojiaQyG3cOAhbVYRi0UfpdGLmDLwyyimvGD1uFP3iJ7D7XgMhtshh0 n+WVUQT6hBoCYjKWyrvf3yZRi6adiB92Dw7WAejXYH9ozIKAHWYrJok3YydTU+ZAHg9G DxZvo7+EWAowz+VMFatRNoDy9nNkRi6f4dRNo42cZ5Ajs3Jt6HCYElMDQGnAhF/Ftm07 RgY3rtxq/PKAmW9ET/vqkdesSEYCDgIPn8b+7J6hb5aox+sMncK1LoK/LMNr5scbJdA2 7w2g== X-Gm-Message-State: AOJu0YwynTLua7hVBnVBHTHHeyGgbxpuGwH9q5gQXzA+7Z9PCWE5tAo5 sSjA680ZVumDi5PJY/92npZXvxLcUaniCBENUdKGzotAyzxHCcfckzBPVEWAIjOCH5Zi/r65yrS j2XB/R7E= X-Gm-Gg: ASbGncveRN4dsjCBssqW/zGu2WZW4PptsFQ+SOPnyyumdZHwn78c2rUumGUOBUjKxi1 CgiQ5QOXZYOnQeZq+kiWCgadd9JFpiAIZW9rPtOOEosR7zeusNaJzvLHXTzZ/XPkdP0Lnua8Dyu qPJfPsUbu+8zwsQqLg0yQyMSH04PlDOPlQtnVoyLrBahIdt+iGryk9DJbF9ouS+1ZZM9aV/q1m1 R0mGZb/cUn0JJX3gURK5Zthq+ALVGCRiZ3Rr8luFazRbZ20+jdn/zU80rR6PxLmszpCx/DRVOD7 Cdlo4levD9iFxqaZ7d2sBJjYdpaAIa9H/fg6l5cqBrT+5chJq/hl0lbdbe3x32QkIsXOBZDjWBa cwAPUC4ae85F4WQA0/FVjw7z2tD58PQ1aYMFAHIx1saAyon0sZ6HoNR2B3fyO X-Google-Smtp-Source: AGHT+IFpRBdEX9Yv/4QZkNROckNsLzQmKMPuN0vO4L3eMt8Ze280X7zxJ5Px6ETw7WPsfYEzTdhlnQ== X-Received: by 2002:a05:6a20:938e:b0:243:969d:a7f2 with SMTP id adf61e73a8af0-243d6f42133mr316867637.45.1756506832043; Fri, 29 Aug 2025 15:33:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 81/91] linux-user: Move elf parameters to hppa/target_elf.h Date: Sat, 30 Aug 2025 08:24:17 +1000 Message-ID: <20250829222427.289668-82-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756573017906116600 Content-Type: text/plain; charset="utf-8" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/hppa/target_elf.h | 6 ++++++ linux-user/elfload.c | 11 ----------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/linux-user/hppa/target_elf.h b/linux-user/hppa/target_elf.h index b654758afa..9b6363a0a7 100644 --- a/linux-user/hppa/target_elf.h +++ b/linux-user/hppa/target_elf.h @@ -8,8 +8,14 @@ #ifndef HPPA_TARGET_ELF_H #define HPPA_TARGET_ELF_H =20 +#define ELF_CLASS ELFCLASS32 +#define ELF_ARCH EM_PARISC + #define HAVE_ELF_PLATFORM 1 =20 #define LO_COMMPAGE 0 +#define STACK_GROWS_DOWN 0 +#define STACK_ALIGNMENT 64 +#define VDSO_HEADER "vdso.c.inc" =20 #endif diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 6e476d5308..6732011332 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -130,17 +130,6 @@ typedef abi_uint target_gid_t; #endif typedef abi_int target_pid_t; =20 -#ifdef TARGET_HPPA - -#define ELF_CLASS ELFCLASS32 -#define ELF_ARCH EM_PARISC -#define STACK_GROWS_DOWN 0 -#define STACK_ALIGNMENT 64 - -#define VDSO_HEADER "vdso.c.inc" - -#endif /* TARGET_HPPA */ - #ifdef TARGET_XTENSA =20 #define ELF_CLASS ELFCLASS32 --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756570727; cv=none; d=zohomail.com; s=zohoarc; b=b9IOTn21Dfd2PzSsGRgvrGqqMHR7rpmfoBm7kXz+bQI6vWtiheLXsN5eQwbTh7ntUzWn1H/2rMb8Ku7KHo2a9M6BQTkCIsqrtlFBJtELpC0KAG1+M+TlI0s1+WRdQiwgwfaKMB4wFDu/2VGL791xXLX/FWQ/2wcPxZf0LnHRaU8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756570727; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=RaHhTTN035qJQGqD9PdDzeeKvrzQJZLWIQNdo5Ia4sA=; b=LVoQOHYkLs6zK93VsQEKuT45tlCRYHsssusngCYdmLxfrQJS0ObqMZTc3Tb1nxquN6hrbfkov2yDlAQBv3mDOgbH4ne4CLsC59mfBMM21EaxTTpzbk46qs56JBtsb5tkmDqc6MqYAv2dYtmntNRNDJMij3C7xn6/c2fS/GgdS6I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756570727421850.3455213768136; Sat, 30 Aug 2025 09:18:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNmm-0000lq-S9; Sat, 30 Aug 2025 11:46:37 -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 1us7fR-0005wY-Ec for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:33:57 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7fP-0004lo-Nz for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:33:57 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-772301f8a4cso1243681b3a.3 for ; Fri, 29 Aug 2025 15:33:55 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a269f27sm3449728b3a.12.2025.08.29.15.33.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:33:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506834; x=1757111634; 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=RaHhTTN035qJQGqD9PdDzeeKvrzQJZLWIQNdo5Ia4sA=; b=gBUMcRQGPv1B30v+Z1yVnruEjzfVXAWMd46y2l/QjLN6ErmUiB++yOC2XfBHyIhfcf rHE4RpllK2hKVuyvEZak8o8Nbs3/pbBhXYhypV1zASIWO3NswBJ60TgaVwlhSJIKNjsM JyOetQX/RhkP5uKVqFBmePXSYmJYCOr91TL2ddfY4DecKheMSp1chIeXuGtOcW1tuWIX t4zOVpTwxFIJyGhcY18CP8EtDk8HnmPjbIdxp3hsd7cujle0ofYJ3TJzke4bUW9MZfWS 39OugKfSDkdLUbtyxby8M08htyiv8d5UFuEdwK1MiKJdkjiGFtwWLEMzPllUEad7EZnI GttA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506834; x=1757111634; 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=RaHhTTN035qJQGqD9PdDzeeKvrzQJZLWIQNdo5Ia4sA=; b=la9g2YU3JGU3zUPdKh+uxapgl72U/1EM80SD0o2A6TxkVDN2C306xFnAsE/D4OY7gd Y0zSpsYirIqx23st/TqXc1CHR8SPvjkzkQvjkCBvZTBdy+AzPFDsKFR6wOb2L3IxRZ4s ZTXe8h0E7PUFb5A9dC2g1xD4r4/fRiqx7zb/ie11eV2RxaLcig6zaNpmFrFilwtPdwQs npUgTq735CcuOARmKlAUPh/KT3xD1Cug6NMP/GU3xwmpOAv0c0buOuO7hHMvzDzO9zzn by6bMwnrZwqrYJBoPNz8/BvzAHRW62sKeA2dVeaJCrmh86Uj9jxEDbA5K2dtrxmeBNvI Sv0w== X-Gm-Message-State: AOJu0YzrJMyRJArBw4Rl0lUIggamP38S6TJHRl+ZiIbTc1wa3183ZO+U xl+rwsLS06XiW9vXMCy8QVjkowdX3sT7awlumrCccXdMeLH8LWSzUTjg8RbQoKfsRFbL+37M/Uy GPswk1To= X-Gm-Gg: ASbGnctZzvElyR2Ipu9XZba8k7Y0XrC6JbjJJkJyoDarXHxoq/+sMeCd41BlR1nCkeS HDp3UL5DY21aFBvb2rmnL9WnrVYwk5eaFT2ZVU2Dp6k9fJcYWG+ykcqbU+z9Q3+hXIYnTWqYhUQ qsg5FmPBIk8q3xI92JaaMWD9SuSt4dB7L7AXVNZ2Qw0YByWYk84sWPEp6Xx85bma4rCenISmFUl nsX3IjCqv6Tuto8TVWvVwGzCPSqBWbYi73g2Lf7X2IXOBh/s5iyRgpOFMvlqSxakf3jAxLH7PX3 3MZ3kxbONFxka9CDDuk9pkrKcHM3O1il2E1HuGF5tYLvm3JziCR36wLNGg3cWeYiie85B4ORfqk fY+KfbzukirSXuw/H3zQ7nl8XmpLPohN5OfuWIMb4MMoIYR32vjKFN93LLiJ1 X-Google-Smtp-Source: AGHT+IGmseJGsTd0zgn/XlqafGxQhicGY1B7D+KmUsouVID7LDnS4KSLPcdeCXcFeFkpbCkJoJPXlA== X-Received: by 2002:a05:6a00:2e08:b0:76b:f8ee:4eaa with SMTP id d2e1a72fcca58-7723e24ff0cmr277132b3a.9.1756506834292; Fri, 29 Aug 2025 15:33:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 82/91] linux-user: Move elf parameters to xtensa/target_elf.h Date: Sat, 30 Aug 2025 08:24:18 +1000 Message-ID: <20250829222427.289668-83-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756570728163116600 Content-Type: text/plain; charset="utf-8" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/xtensa/target_elf.h | 3 +++ linux-user/elfload.c | 7 ------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/linux-user/xtensa/target_elf.h b/linux-user/xtensa/target_elf.h index 850a7206a5..0689e79be5 100644 --- a/linux-user/xtensa/target_elf.h +++ b/linux-user/xtensa/target_elf.h @@ -10,6 +10,9 @@ =20 #include "target_ptrace.h" =20 +#define ELF_CLASS ELFCLASS32 +#define ELF_ARCH EM_XTENSA + #define HAVE_ELF_CORE_DUMP 1 =20 /* diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 6732011332..804a819471 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -130,13 +130,6 @@ typedef abi_uint target_gid_t; #endif typedef abi_int target_pid_t; =20 -#ifdef TARGET_XTENSA - -#define ELF_CLASS ELFCLASS32 -#define ELF_ARCH EM_XTENSA - -#endif /* TARGET_XTENSA */ - #ifdef TARGET_HEXAGON =20 #define ELF_CLASS ELFCLASS32 --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756571232; cv=none; d=zohomail.com; s=zohoarc; b=I+RKiSFExPnE6lAKU9AnsihZY/LkjZFuKpYyx32vnUbnhOpqRnbk6z242PkYKQLN94tjnRIgDz/4RKYg5G0b0ju7pFiU1ZSTXKRyd6sT6Dh1mYMTGijDhFZQFUUDVXD7ZOVNjFGYuYM/sN4mqcDW/KTgzXsGCHdbJ9dF/oWsm4M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756571232; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=s2UyNXYokJ6TnLyjAm0R/ws5bbTquqkinE1D7/JLlk4=; b=g20IHhEKw+EPKkB0L/JBk61EopXVf/msLDQQ6HRexhrQmU57qwflmqiiZBAmJNtMK9pth0oKt7lbZE4acV7uy1EGkvDPkFeTjzjeUIWOr7BY+FSoJel4sLzOEGhx3ryNNBgDhpuXLEg2ulMFx1BPpw0dwpOjS468w4SindkvsWk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756571232246867.8026331021064; Sat, 30 Aug 2025 09:27:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNl4-000432-Dg; Sat, 30 Aug 2025 11:44:51 -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 1us7fT-0005xb-OD for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:33:59 -0400 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7fR-0004mN-Up for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:33:59 -0400 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-7722d6cc437so1104094b3a.0 for ; Fri, 29 Aug 2025 15:33:57 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a269f27sm3449728b3a.12.2025.08.29.15.33.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:33:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506836; x=1757111636; 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=s2UyNXYokJ6TnLyjAm0R/ws5bbTquqkinE1D7/JLlk4=; b=Ji2ns9FtYV/OLVzizotyvDWoSF7c/kZPGGGBMKPIagZgwqbBwmVo6h6ReVygjTaXzE JGv8v2r5ey20xFjTDLpnITiIO819V5KySIws0S57boyUUCnZ32f9Mi2ZGdxzcNALRu9Y afa1x0UNOc/VuXQFxAhBcGYSg9c0Smz7UccPOROysPrQMYY1r+jMP2ysTggrXccffBTc n9GEHh8vAnLAjMJezWXtQ3NNpO77UVThw7kveNvsHFKGN1p8hmhu22DMr8AgPFA/kfWr /OmtAJqxBmypUBx5a/w3x+KQFz4xyrQdLki1qPavhfWXLwC7GZTZDVXd5rP2RnftG6Tx Ha2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506836; x=1757111636; 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=s2UyNXYokJ6TnLyjAm0R/ws5bbTquqkinE1D7/JLlk4=; b=YOPROSOdafWadUiGL5fRort5d92T2ms4OJkaq/YxEtnvHpLMKGizWTyvIypQX1h01L rKPbw61plqSeenhCe8/uPwF3ZHtpIXG2OLl/019Q0zgbqw5lv2jqJxJPb/WO9ZNPMJiP obAmshLxC30RGZaOptdnVKN5vqbWviDrhSGnwsD8GtYXwpB1a+CbFj1ZjQVvOYvKv/X8 +LA6UJAXuNxyRaFQLF0wWIPzvdrhqZ/pgUyHpU/rKHb+LCGnFk4NJbpZDcTEfBjtt2z8 vktoDjvQTyj9Kn2/ckMYoRxultnbxwndIZsgJ3s7o2xQVVoD+T0fGkMRaUt0No+PQO0Q 66Qg== X-Gm-Message-State: AOJu0Yw7fPlnSEdAH2W5K0cLhd5/nI5KU24/QzLQ+K8uKZXnjlSGDZIR NQkxE9Lofadb7MNhhlpE5QT3j7SdFMf7UMbZeKUlV8svUMQFjn7lvWdoCxGUd6uB3kJujK1rLiJ Yq8kzp8A= X-Gm-Gg: ASbGncvnbYuteG5RieIyiO7e+4a/X2Ek1FzmQqQVsflIOTkI5fOs/jXHYpH5EIYJwXs caitg3veDR+iel//20UuwQhrUuYmOGTb/3nZ9GFFDaNV2RYYHGMnBLx2LSq6m7LmX/tCv7zH9Xt GBRbTf87wi1RYxA0K49lRM2/8x44+W7viaodNj+srTP3JyoH9kRv6KMbf09Tr08Fr2rOppiX8wc 287JWZFdRc8zB/WQLFjtHuMtGwgzGAaLKsLTBTM/+Pi29nwwOSt/tLVWFTHKD0TqmnpaxallE32 Be2OAWQbMOCsw+tQJzkpjegEqephEZIXTnkhrEv2cTwtqe0DXod3i4+DFHmmW6fPffOXvVVu/lg deRcfB/m/S5y9FHqJ+iiycQl8S4CfEfUPhdRDnqKkDnPImWO1gpyMcawHM2eN X-Google-Smtp-Source: AGHT+IHMQtZIQBN1gTKasqostZ+bTW/5Tj5hJxZmCpZfP3jgwGuKmg1Z4dad2yTQ18FTgNM6EeUcUw== X-Received: by 2002:a05:6a00:2e86:b0:76c:5781:2c01 with SMTP id d2e1a72fcca58-7723e0d39f1mr278862b3a.0.1756506836442; Fri, 29 Aug 2025 15:33:56 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 83/91] linux-user: Move elf parameters to hexagon/target_elf.h Date: Sat, 30 Aug 2025 08:24:19 +1000 Message-ID: <20250829222427.289668-84-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::429; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x429.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756571234255116600 Content-Type: text/plain; charset="utf-8" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/hexagon/target_elf.h | 3 +++ linux-user/elfload.c | 7 ------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/linux-user/hexagon/target_elf.h b/linux-user/hexagon/target_el= f.h index eccf207f6b..a9f6d77fc6 100644 --- a/linux-user/hexagon/target_elf.h +++ b/linux-user/hexagon/target_elf.h @@ -18,4 +18,7 @@ #ifndef HEXAGON_TARGET_ELF_H #define HEXAGON_TARGET_ELF_H =20 +#define ELF_CLASS ELFCLASS32 +#define ELF_ARCH EM_HEXAGON + #endif diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 804a819471..33c4214c95 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -130,13 +130,6 @@ typedef abi_uint target_gid_t; #endif typedef abi_int target_pid_t; =20 -#ifdef TARGET_HEXAGON - -#define ELF_CLASS ELFCLASS32 -#define ELF_ARCH EM_HEXAGON - -#endif /* TARGET_HEXAGON */ - #ifndef ELF_MACHINE #define ELF_MACHINE ELF_ARCH #endif --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756576546; cv=none; d=zohomail.com; s=zohoarc; b=ORg+YnQxHSXj7Dg+y2ehVwaDJH+HVWftRd5ZriRq2AbFcn9bxeLGiju2ObqDQdWTiYVQ1viNmsXlSk7JErBDUeajOKf4ibWGkGhcWXj5PEXpub9XhkFh7c/O219vz4935UDxVg7xVcJTqIEC3vb/FJlE274i0gyeFBZ/VmUy2l4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756576546; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Rcp3Y/ahWqBXeCFKyNRSqhcGvHiW+LHciB8CqwGC3iY=; b=jDOvqiYj1oG+FtFOSgc/yWf1LE3vMrxCE3yG3ThCuCe0awc/wB1F7V0LrsZsF7KIIDSOJrom3zpUSWXBQOo9MbOpARiEsPh39PEGdSjLMj51bPwDb42vERVXIfJCRbnJTIsss+Ww2qCbvznBU7rqcGg8YVeJ0GKBDWRzAd6zM3U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756576546809577.7427874584736; Sat, 30 Aug 2025 10:55:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNmp-0000yb-6K; Sat, 30 Aug 2025 11:46:39 -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 1us7fX-0005z5-DI for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:34:03 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7fU-0004mp-Kv for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:34:02 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-76e6cbb991aso2494489b3a.1 for ; Fri, 29 Aug 2025 15:34:00 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a269f27sm3449728b3a.12.2025.08.29.15.33.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:33:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506839; x=1757111639; 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=Rcp3Y/ahWqBXeCFKyNRSqhcGvHiW+LHciB8CqwGC3iY=; b=r7N224AwoyUqDph654N2Ny80eanj3YFxQ1nS3SmDIb8kKXLGl+eJMpMQ0j7tvrLn/l hJOsgYKQXSLYco2Yxw2mTo3Yl+iGQEuZcF9vq/V3XoYj2KtQos/dWD6n7pAGsGIHTjCS PJcLO6hd38XqonaB0r+TVKBHVYd5QaLdSHdLFg4MBRfMjn2AFkOl1QM40X7riCPYCQrD Q+K1LUHOZM2CRpch/tveLAUNF1oYDT9EwFVPnoJQBH3RTNl/oQrMD8EmdMBzHIWH3iE6 24WxxTP3hWCijtE3JOMM7hj62Z1uEuSQiEm419Pc5gf+DLxdD/aOGSumaqZoU9TwqhOy oMXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506839; x=1757111639; 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=Rcp3Y/ahWqBXeCFKyNRSqhcGvHiW+LHciB8CqwGC3iY=; b=Kj8rY2n99Py3VkvSA/Wjs0Q7Dd53ANqXrkFkOJMV3NO9hZbgyYQBDCc8vC7gVRXyrW HeozI75Moo9uvjUWampRB0oNdADaZxIpzBVZZtLB1WQ6UGsp5NopebKG/swq4J5X1Wqs kyiFvVK4e1L9UmP/eAqVfOSymG1O7KwNW+E0zLFf2GPlDO8yH7JHLSNTga4WEAn4KdvV 8H1O9AyRcSqkh5vdhlBAwBc6okmA0t58MfhPQETG1+ECI2vG/MVcxAx/9Ot0vklbEisa Y5NODa+UbxTgq3H8DiPxcsjfXlnUQ266PqOVIRrzE9MVZfuBc/NJozHlXEnZ7bWmWDDv 7zGQ== X-Gm-Message-State: AOJu0Yy9w/m1janEKvooL0SlJ7sUMn/4GxCzfy6ckvHRPjZ8PF5ozC7w KMOU+yXVhlcIgYolbo//hjJzMjHYl3MMq32ExTnGUO+90RQvd1o6bmv/PM2M3cFZrlzq/KuDG5G D3K1y6cI= X-Gm-Gg: ASbGncvWoSZWhC8KJnYCuOMhwyEd7IqkZirxl6XIleXCS4qZJJ/SkVXHAzcdQNT6XLa 9lg+Oy6U7Yz3PP2D4kQ8HbrrDuReqDBiT3QJx97HCeRlLHavUCi/PlIiM3B5e31vOSR4QtEWe8U CR7sdgHkYUJLpHk4UML5OmxjtsEciZbegUU9vde0CMIJJp4fqUFQG/8/CR7Wgs8NFvF0wVkZwb7 R97sqrCrujnPNzbY9sugdXwRpjNebNLjtA2JpDJbFc1uC0VAstkqlmX/4CPSSI+XEYzouYRX5MH nsXfQhnO0zplMXyXV7R8FI7X1tySbCff/L47PtZZGn+uvG92IC27VZaRW1K/t9BrbzBwMMJFhnN ORtrj+lxuATiCIzxBQVuhG6DQPXF0jz00xP59jRn23UUJlgfOoYesf8nPH+Qx X-Google-Smtp-Source: AGHT+IGE0EjMBe6TW7mZJDsht+u48sCGBz+zyNQHbdg7d+N0Ae/dOREfsKeBZPVfCydKyDysmdxhnQ== X-Received: by 2002:a05:6a00:8d4:b0:76e:99fc:db8d with SMTP id d2e1a72fcca58-7723e1eee4amr304333b3a.3.1756506838622; Fri, 29 Aug 2025 15:33:58 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 84/91] linux-user: Standardize on ELF_MACHINE not ELF_ARCH Date: Sat, 30 Aug 2025 08:24:20 +1000 Message-ID: <20250829222427.289668-85-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756576549984124100 Content-Type: text/plain; charset="utf-8" PowerPC was the one outlier that defined both ELF_ARCH and ELF_MACHINE; ELF_ARCH was defined incorrectly, necessitating the definition of elf_check_arch. However, the elf file header field in question is called e_machine, so ELF_MACHINE is in fact the better name. Mechanically change most target/target_elf.h files, then adjust ppc/target_elf.h manually. Do not provide a default for ELF_MACHINE. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/aarch64/target_elf.h | 2 +- linux-user/alpha/target_elf.h | 2 +- linux-user/arm/target_elf.h | 2 +- linux-user/hexagon/target_elf.h | 2 +- linux-user/hppa/target_elf.h | 2 +- linux-user/i386/target_elf.h | 2 +- linux-user/loongarch64/target_elf.h | 2 +- linux-user/m68k/target_elf.h | 2 +- linux-user/microblaze/target_elf.h | 2 +- linux-user/mips/target_elf.h | 2 +- linux-user/mips64/target_elf.h | 2 +- linux-user/openrisc/target_elf.h | 2 +- linux-user/ppc/target_elf.h | 2 -- linux-user/riscv/target_elf.h | 2 +- linux-user/s390x/target_elf.h | 2 +- linux-user/sh4/target_elf.h | 2 +- linux-user/sparc/target_elf.h | 4 ++-- linux-user/x86_64/target_elf.h | 2 +- linux-user/xtensa/target_elf.h | 2 +- linux-user/elfload.c | 6 +----- 20 files changed, 20 insertions(+), 26 deletions(-) diff --git a/linux-user/aarch64/target_elf.h b/linux-user/aarch64/target_el= f.h index 3c9fef9378..9ec51f6237 100644 --- a/linux-user/aarch64/target_elf.h +++ b/linux-user/aarch64/target_elf.h @@ -10,7 +10,7 @@ =20 #include "target_ptrace.h" =20 -#define ELF_ARCH EM_AARCH64 +#define ELF_MACHINE EM_AARCH64 #define ELF_CLASS ELFCLASS64 =20 #define HAVE_ELF_HWCAP 1 diff --git a/linux-user/alpha/target_elf.h b/linux-user/alpha/target_elf.h index f9d6372c9f..864dc6e2e6 100644 --- a/linux-user/alpha/target_elf.h +++ b/linux-user/alpha/target_elf.h @@ -9,6 +9,6 @@ #define ALPHA_TARGET_ELF_H =20 #define ELF_CLASS ELFCLASS64 -#define ELF_ARCH EM_ALPHA +#define ELF_MACHINE EM_ALPHA =20 #endif diff --git a/linux-user/arm/target_elf.h b/linux-user/arm/target_elf.h index d871d6d665..12cdc8e5a7 100644 --- a/linux-user/arm/target_elf.h +++ b/linux-user/arm/target_elf.h @@ -10,7 +10,7 @@ =20 #include "target_ptrace.h" =20 -#define ELF_ARCH EM_ARM +#define ELF_MACHINE EM_ARM #define ELF_CLASS ELFCLASS32 #define EXSTACK_DEFAULT true =20 diff --git a/linux-user/hexagon/target_elf.h b/linux-user/hexagon/target_el= f.h index a9f6d77fc6..f81ae3895a 100644 --- a/linux-user/hexagon/target_elf.h +++ b/linux-user/hexagon/target_elf.h @@ -19,6 +19,6 @@ #define HEXAGON_TARGET_ELF_H =20 #define ELF_CLASS ELFCLASS32 -#define ELF_ARCH EM_HEXAGON +#define ELF_MACHINE EM_HEXAGON =20 #endif diff --git a/linux-user/hppa/target_elf.h b/linux-user/hppa/target_elf.h index 9b6363a0a7..76930c9369 100644 --- a/linux-user/hppa/target_elf.h +++ b/linux-user/hppa/target_elf.h @@ -9,7 +9,7 @@ #define HPPA_TARGET_ELF_H =20 #define ELF_CLASS ELFCLASS32 -#define ELF_ARCH EM_PARISC +#define ELF_MACHINE EM_PARISC =20 #define HAVE_ELF_PLATFORM 1 =20 diff --git a/linux-user/i386/target_elf.h b/linux-user/i386/target_elf.h index dc58c0017a..c3caad68b9 100644 --- a/linux-user/i386/target_elf.h +++ b/linux-user/i386/target_elf.h @@ -11,7 +11,7 @@ #include "target_ptrace.h" =20 #define ELF_CLASS ELFCLASS32 -#define ELF_ARCH EM_386 +#define ELF_MACHINE EM_386 #define EXSTACK_DEFAULT true #define VDSO_HEADER "vdso.c.inc" =20 diff --git a/linux-user/loongarch64/target_elf.h b/linux-user/loongarch64/t= arget_elf.h index 47bf51a41c..b988592993 100644 --- a/linux-user/loongarch64/target_elf.h +++ b/linux-user/loongarch64/target_elf.h @@ -9,7 +9,7 @@ #include "target_ptrace.h" =20 #define ELF_CLASS ELFCLASS64 -#define ELF_ARCH EM_LOONGARCH +#define ELF_MACHINE EM_LOONGARCH #define EXSTACK_DEFAULT true #define elf_check_arch(x) ((x) =3D=3D EM_LOONGARCH) #define VDSO_HEADER "vdso.c.inc" diff --git a/linux-user/m68k/target_elf.h b/linux-user/m68k/target_elf.h index 073c85becc..b997fa0b6d 100644 --- a/linux-user/m68k/target_elf.h +++ b/linux-user/m68k/target_elf.h @@ -9,7 +9,7 @@ #define M68K_TARGET_ELF_H =20 #define ELF_CLASS ELFCLASS32 -#define ELF_ARCH EM_68K +#define ELF_MACHINE EM_68K =20 #define HAVE_ELF_CORE_DUMP 1 =20 diff --git a/linux-user/microblaze/target_elf.h b/linux-user/microblaze/tar= get_elf.h index a622cd8e43..1ec91ea5a9 100644 --- a/linux-user/microblaze/target_elf.h +++ b/linux-user/microblaze/target_elf.h @@ -11,7 +11,7 @@ #include "target_ptrace.h" =20 #define ELF_CLASS ELFCLASS32 -#define ELF_ARCH EM_MICROBLAZE +#define ELF_MACHINE EM_MICROBLAZE =20 #define elf_check_arch(x) ((x) =3D=3D EM_MICROBLAZE || (x) =3D=3D EM_MIC= ROBLAZE_OLD) =20 diff --git a/linux-user/mips/target_elf.h b/linux-user/mips/target_elf.h index f400bc2fdb..157306f7a0 100644 --- a/linux-user/mips/target_elf.h +++ b/linux-user/mips/target_elf.h @@ -11,7 +11,7 @@ #include "target_ptrace.h" =20 #define ELF_CLASS ELFCLASS32 -#define ELF_ARCH EM_MIPS +#define ELF_MACHINE EM_MIPS #define EXSTACK_DEFAULT true =20 #define HAVE_ELF_HWCAP 1 diff --git a/linux-user/mips64/target_elf.h b/linux-user/mips64/target_elf.h index c455985a76..061471a0f1 100644 --- a/linux-user/mips64/target_elf.h +++ b/linux-user/mips64/target_elf.h @@ -11,7 +11,7 @@ #include "target_ptrace.h" =20 #define ELF_CLASS ELFCLASS64 -#define ELF_ARCH EM_MIPS +#define ELF_MACHINE EM_MIPS #define EXSTACK_DEFAULT true =20 #ifdef TARGET_ABI_MIPSN32 diff --git a/linux-user/openrisc/target_elf.h b/linux-user/openrisc/target_= elf.h index ed9739380f..e8554f5339 100644 --- a/linux-user/openrisc/target_elf.h +++ b/linux-user/openrisc/target_elf.h @@ -10,7 +10,7 @@ =20 #include "target_ptrace.h" =20 -#define ELF_ARCH EM_OPENRISC +#define ELF_MACHINE EM_OPENRISC #define ELF_CLASS ELFCLASS32 =20 #define HAVE_ELF_CORE_DUMP 1 diff --git a/linux-user/ppc/target_elf.h b/linux-user/ppc/target_elf.h index 9a47f18fb8..22854cf52f 100644 --- a/linux-user/ppc/target_elf.h +++ b/linux-user/ppc/target_elf.h @@ -13,13 +13,11 @@ #define ELF_MACHINE PPC_ELF_MACHINE =20 #ifdef TARGET_PPC64 -# define elf_check_arch(x) ((x) =3D=3D EM_PPC64) # define ELF_CLASS ELFCLASS64 #else # define ELF_CLASS ELFCLASS32 # define EXSTACK_DEFAULT true #endif -#define ELF_ARCH EM_PPC =20 #define HAVE_ELF_HWCAP 1 #define HAVE_ELF_HWCAP2 1 diff --git a/linux-user/riscv/target_elf.h b/linux-user/riscv/target_elf.h index 51b8def1d1..dbbfdf54d3 100644 --- a/linux-user/riscv/target_elf.h +++ b/linux-user/riscv/target_elf.h @@ -8,7 +8,7 @@ #ifndef RISCV_TARGET_ELF_H #define RISCV_TARGET_ELF_H =20 -#define ELF_ARCH EM_RISCV +#define ELF_MACHINE EM_RISCV =20 #ifdef TARGET_RISCV32 #define ELF_CLASS ELFCLASS32 diff --git a/linux-user/s390x/target_elf.h b/linux-user/s390x/target_elf.h index b23e46ab46..ef5edbd860 100644 --- a/linux-user/s390x/target_elf.h +++ b/linux-user/s390x/target_elf.h @@ -11,7 +11,7 @@ #include "target_ptrace.h" =20 #define ELF_CLASS ELFCLASS64 -#define ELF_ARCH EM_S390 +#define ELF_MACHINE EM_S390 #define VDSO_HEADER "vdso.c.inc" =20 #define HAVE_ELF_HWCAP 1 diff --git a/linux-user/sh4/target_elf.h b/linux-user/sh4/target_elf.h index 61aea237c4..d9e253d425 100644 --- a/linux-user/sh4/target_elf.h +++ b/linux-user/sh4/target_elf.h @@ -11,7 +11,7 @@ #include "target_ptrace.h" =20 #define ELF_CLASS ELFCLASS32 -#define ELF_ARCH EM_SH +#define ELF_MACHINE EM_SH =20 #define HAVE_ELF_HWCAP 1 #define HAVE_ELF_CORE_DUMP 1 diff --git a/linux-user/sparc/target_elf.h b/linux-user/sparc/target_elf.h index f89c708c46..6b0cac3caf 100644 --- a/linux-user/sparc/target_elf.h +++ b/linux-user/sparc/target_elf.h @@ -10,13 +10,13 @@ =20 #ifndef TARGET_SPARC64 # define ELF_CLASS ELFCLASS32 -# define ELF_ARCH EM_SPARC +# define ELF_MACHINE EM_SPARC #elif defined(TARGET_ABI32) # define ELF_CLASS ELFCLASS32 # define elf_check_arch(x) ((x) =3D=3D EM_SPARC32PLUS || (x) =3D=3D E= M_SPARC) #else # define ELF_CLASS ELFCLASS64 -# define ELF_ARCH EM_SPARCV9 +# define ELF_MACHINE EM_SPARCV9 #endif =20 #define HAVE_ELF_HWCAP 1 diff --git a/linux-user/x86_64/target_elf.h b/linux-user/x86_64/target_elf.h index f3c09bb8da..840bddf5ec 100644 --- a/linux-user/x86_64/target_elf.h +++ b/linux-user/x86_64/target_elf.h @@ -11,7 +11,7 @@ #include "target_ptrace.h" =20 #define ELF_CLASS ELFCLASS64 -#define ELF_ARCH EM_X86_64 +#define ELF_MACHINE EM_X86_64 #define VDSO_HEADER "vdso.c.inc" =20 #define HAVE_ELF_HWCAP 1 diff --git a/linux-user/xtensa/target_elf.h b/linux-user/xtensa/target_elf.h index 0689e79be5..1bf8f2a14a 100644 --- a/linux-user/xtensa/target_elf.h +++ b/linux-user/xtensa/target_elf.h @@ -11,7 +11,7 @@ #include "target_ptrace.h" =20 #define ELF_CLASS ELFCLASS32 -#define ELF_ARCH EM_XTENSA +#define ELF_MACHINE EM_XTENSA =20 #define HAVE_ELF_CORE_DUMP 1 =20 diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 33c4214c95..c481759710 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -130,12 +130,8 @@ typedef abi_uint target_gid_t; #endif typedef abi_int target_pid_t; =20 -#ifndef ELF_MACHINE -#define ELF_MACHINE ELF_ARCH -#endif - #ifndef elf_check_arch -#define elf_check_arch(x) ((x) =3D=3D ELF_ARCH) +#define elf_check_arch(x) ((x) =3D=3D ELF_MACHINE) #endif =20 #ifndef elf_check_abi --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756573536; cv=none; d=zohomail.com; s=zohoarc; b=e5mnA3N0JiMGj0qbshcAz1HMTL583qoma54kyH/UWM9PZvbkYB+mV09ts80aNXUONWYi7PekFcohV7bJunDxbn4f5MrWrluyw3BZ/En/jxFXVn1wWgOYSGBT0O0WoopHlBfF9noebSU+MBs9wkrLav5qSBmCPgztEYfavwIMS8Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756573536; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=8dFA+iOgaYu1Yp+iyHb7dj9EIpfvh5RMeLLnbPXUmtU=; b=bsuaUXzNlYhsOwWdjEs+HpuHnxNUwzKDOlhliHuN7ahrnnWrkkbsQd9IeuJSssRAV1RlpQK2BYJ/3o1OrS4VY8gyC6qlyqtt9Rq60MCFkVygbrD6//iFyob29KGmGmhtRuMVfww/jeSo/0cDMhr1zMUe4KoRv81Vu2ORfSARsxo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756573536015339.96660489410306; Sat, 30 Aug 2025 10:05:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNmh-0000TC-Tn; Sat, 30 Aug 2025 11:46:31 -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 1us7fY-000603-Vm for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:34:05 -0400 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7fX-0004mz-75 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:34:04 -0400 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-771fa8e4190so1833982b3a.1 for ; Fri, 29 Aug 2025 15:34:02 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a269f27sm3449728b3a.12.2025.08.29.15.33.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:34:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506841; x=1757111641; 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=8dFA+iOgaYu1Yp+iyHb7dj9EIpfvh5RMeLLnbPXUmtU=; b=pdK+0CVD4Vd8lY7PLZCLhOeAy8jGM/TkMjk6E4po/GOV8AFDMPuyC/3bG3NHCmFAgY +qotGSWMpAfiIMlHGe6w78bcWjzknf4tf9+qk3EMedStBH0/Gvkz7Zk7B7bD/0TSuOTw hyqEJHR0SzYVXjDgxwaVNWgYB3Ta2VKopJ/eItmgXBP4DIeJZFUyn7XkOombK47N+0jc C9UZg1WUMcVoPn47hRVddao9Wwrdp1iJNeo7FMzpn8ihtYy4kNlhcBZjzCZrCCIpZnAx NQ8kVZG9UbC6AK9KknnROk5BtCSEi4xGEjZisTl7UH9f5RPffqmklFmg4hvz/+Coho8A QtPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506841; x=1757111641; 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=8dFA+iOgaYu1Yp+iyHb7dj9EIpfvh5RMeLLnbPXUmtU=; b=SiDm9gwiPTHQ+oOm0FaFKOLGScQOOigML0ZeH2Hva4pGaXYgsAvQKAuJoC3kH5hn4Y mMBu3JhWZ0gXrLO5G6jUabWtqlmbzKvh+l6UVie4FfmYc8DrpZIdQic09U42M+auDCCY 0AJv8vugyx8CQQscADnxxSg0UX6tCiwi6cIee52n2Zrg+D+lzcOCeVpPDa7rP9hu7XU+ wqdeQK4xcHnMBpVr3XRPqe4/OBdtRcuKaX0JCZiKMgNnEPSGqpN1EaIQq2/FXpCXPncH nO97V4ssuBkH1e+vRKEFce2YG+IQE66I3g+DVcYVoh36ZAjkufDcBGXDNbIo53zC4AA9 0nsQ== X-Gm-Message-State: AOJu0Yw1bXYpYiVMA1XcvA4OJVxzWKzGXVDafnKFOXFrMXqgwu2XH6V4 npX9u0I3YWSnXzDBxLePE1GjdPIvzmgxjqd1FQe4BUyAVuD2H2uwzHPc8NUuKN3Qg6ujwj9RxpB SfV6RKvM= X-Gm-Gg: ASbGncsYDYgJe8FS+kXeUrlfW18G7O68H5mPKUrNNiWe1tLg/2EUu3KZBImnlX9vljr VCNPolbrXmcVq3ps0NtlJkbw5mkRP44ELnq0bU797GpTyM9gocU7spJG1tIPJ/2yTgKf2dxYZ5f OLuTWOjXmXcXCwlHI+oMXjgM6X7g2HQqvQlUuaf/U9ytWuzIE1e/LX+c2fmairOY48ThInqbRmP 7s+UtDw0Wi2zB/mokK2k4T/jHTtjKCyibOKu48hi8B+vB+jRHUoLTW3bzuBANK/zadwgJIImCX1 rkkApeCdLU2D5dC4VyjyFl2LaCu7Z1daH3ceW1hpZEgxnPqHusG+8xlAuMvtuVJlBUDvUS3CBPq Q1GpqJPfNuUe9BTjtSjXEdbyNd12o8J6+VLkgjqG19dEG7l/wSw6q/bxbDOqX X-Google-Smtp-Source: AGHT+IGHwmLrN8Ei8WzENk1GQIFxs6KAS0rOJ+63Vy6tXOQMwBAa/MgwddHf4kvawFD6YuWm1oPfVw== X-Received: by 2002:aa7:88c8:0:b0:76b:e936:607 with SMTP id d2e1a72fcca58-7723e0d3420mr260921b3a.0.1756506841051; Fri, 29 Aug 2025 15:34:01 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 85/91] linux-user: Rename elf_check_arch Date: Sat, 30 Aug 2025 08:24:21 +1000 Message-ID: <20250829222427.289668-86-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::429; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x429.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756573537992124100 Content-Type: text/plain; charset="utf-8" Rename to elf_check_machine to match ELF_MACHINE. Remove the unnecessary definition for loongarch64. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/i386/target_elf.h | 2 +- linux-user/loongarch64/target_elf.h | 1 - linux-user/microblaze/target_elf.h | 2 +- linux-user/sparc/target_elf.h | 2 +- linux-user/elfload.c | 6 +++--- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/linux-user/i386/target_elf.h b/linux-user/i386/target_elf.h index c3caad68b9..eafac8f382 100644 --- a/linux-user/i386/target_elf.h +++ b/linux-user/i386/target_elf.h @@ -30,7 +30,7 @@ typedef struct target_elf_gregset_t { /* * This is used to ensure we don't load something for the wrong architectu= re. */ -#define elf_check_arch(x) ((x) =3D=3D EM_386 || (x) =3D=3D EM_486) +#define elf_check_machine(x) ((x) =3D=3D EM_386 || (x) =3D=3D EM_486) =20 /* * i386 is the only target which supplies AT_SYSINFO for the vdso. diff --git a/linux-user/loongarch64/target_elf.h b/linux-user/loongarch64/t= arget_elf.h index b988592993..3aa8c83958 100644 --- a/linux-user/loongarch64/target_elf.h +++ b/linux-user/loongarch64/target_elf.h @@ -11,7 +11,6 @@ #define ELF_CLASS ELFCLASS64 #define ELF_MACHINE EM_LOONGARCH #define EXSTACK_DEFAULT true -#define elf_check_arch(x) ((x) =3D=3D EM_LOONGARCH) #define VDSO_HEADER "vdso.c.inc" =20 #define HAVE_ELF_HWCAP 1 diff --git a/linux-user/microblaze/target_elf.h b/linux-user/microblaze/tar= get_elf.h index 1ec91ea5a9..7b3ef70d23 100644 --- a/linux-user/microblaze/target_elf.h +++ b/linux-user/microblaze/target_elf.h @@ -13,7 +13,7 @@ #define ELF_CLASS ELFCLASS32 #define ELF_MACHINE EM_MICROBLAZE =20 -#define elf_check_arch(x) ((x) =3D=3D EM_MICROBLAZE || (x) =3D=3D EM_MIC= ROBLAZE_OLD) +#define elf_check_machine(x) ((x) =3D=3D EM_MICROBLAZE || (x) =3D=3D EM_MI= CROBLAZE_OLD) =20 #define HAVE_ELF_CORE_DUMP 1 =20 diff --git a/linux-user/sparc/target_elf.h b/linux-user/sparc/target_elf.h index 6b0cac3caf..7827767bcb 100644 --- a/linux-user/sparc/target_elf.h +++ b/linux-user/sparc/target_elf.h @@ -13,7 +13,7 @@ # define ELF_MACHINE EM_SPARC #elif defined(TARGET_ABI32) # define ELF_CLASS ELFCLASS32 -# define elf_check_arch(x) ((x) =3D=3D EM_SPARC32PLUS || (x) =3D=3D E= M_SPARC) +# define elf_check_machine(x) ((x) =3D=3D EM_SPARC32PLUS || (x) =3D=3D E= M_SPARC) #else # define ELF_CLASS ELFCLASS64 # define ELF_MACHINE EM_SPARCV9 diff --git a/linux-user/elfload.c b/linux-user/elfload.c index c481759710..aa0eed6dea 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -130,8 +130,8 @@ typedef abi_uint target_gid_t; #endif typedef abi_int target_pid_t; =20 -#ifndef elf_check_arch -#define elf_check_arch(x) ((x) =3D=3D ELF_MACHINE) +#ifndef elf_check_machine +#define elf_check_machine(x) ((x) =3D=3D ELF_MACHINE) #endif =20 #ifndef elf_check_abi @@ -346,7 +346,7 @@ static bool elf_check_ident(struct elfhdr *ehdr) This has to wait until after bswapping the header. */ static bool elf_check_ehdr(struct elfhdr *ehdr) { - return (elf_check_arch(ehdr->e_machine) + return (elf_check_machine(ehdr->e_machine) && elf_check_abi(ehdr->e_flags) && ehdr->e_ehsize =3D=3D sizeof(struct elfhdr) && ehdr->e_phentsize =3D=3D sizeof(struct elf_phdr) --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756573608; cv=none; d=zohomail.com; s=zohoarc; b=NmnjbASND8WTTbEGkg/NZW7q/uYkDHQ9FKMqLDFoVDhK4tvPuaZnUd+wXi7qvqhvQ8LOu7fP2ko3s46Ar5lPt7VLCHHdgtQoISad9HScvnCSxB5M4LqsLYlxdb7K0IlUmrU9WiZ4CC46itiuX9n0UAR05KcqCZTh6EZt5ejqxkE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756573608; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=j/6x1HXP1N+S4ifQMLcnaTaBv3fLHAqVhSKu6p0/+oM=; b=KMW+U+n+G2OWulBkG/gGhqH8qwnuEK1k7bxdnQiPtS9FiU3PsgxWMOHb0QkBEKU5QKxvzNX+RAQ6299zEDrqM0b00y4B0hJ/8JBxR+FVv3Gfto7jvzd334c/PZYBPZrUJLNsYnwcmv4YFD0I1ORU40BLf6f/wa1vc9rjj2tkGgw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756573608379645.405750843337; Sat, 30 Aug 2025 10:06:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNmr-0001KM-IN; Sat, 30 Aug 2025 11:46:41 -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 1us7fa-00060V-Kt for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:34:06 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7fY-0004nH-N2 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:34:06 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-771ed4a8124so2664227b3a.2 for ; Fri, 29 Aug 2025 15:34:04 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a269f27sm3449728b3a.12.2025.08.29.15.34.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:34:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506843; x=1757111643; 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=j/6x1HXP1N+S4ifQMLcnaTaBv3fLHAqVhSKu6p0/+oM=; b=VQrkHT2ZvN6qtDCbFP/FQrAr3NQDsRVUJ4q0FJhZCapj8kiqBtNvMxQdM+OmEJRZFe o7rO7KchBdDshmRrpwUE8mN98m6TuNTF+HJb9mgWj3UBYR1R5nJ/WKN0xFWBt8Km8YAS +JJwG+jBAh3VEPheKJUJgm9//WWxwr0XJnE7B4QIcelnkZFXgbBCaQydf91lCE73Mjv5 N5XbXYLJrIKF+T73aI8AChs2m3Yj+pnJBL/TPoR3/O+lwo3ooUyuiGUogn9cxCnc2Q8c al/ocdODKmj65d4S9s3kl9CkEos4fVK4Skiw9SiI6r7SSFLP5qTcZSvv3aFpj07Mra4D tSXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506843; x=1757111643; 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=j/6x1HXP1N+S4ifQMLcnaTaBv3fLHAqVhSKu6p0/+oM=; b=rg7ajxbLPVYqlqG2tsiKWUKBDqKKOrb5hPxlZvOJ+0peCuYzfPpRWmXTXFl9nVtQ4K 1XSt54wh7Hu04OyneGntyDPY5N7Ld4zIhaT/pPFY6/RYU2juDYOTlc+uhl7Mj04dj6Im OxBobm5QTypdCpMiJDe8z8KXfQMcMJvkh8/x3PZD2DCk5jxFU+iAMYaOPYPJg9CQVf1V uaH7+WcV8QRQ3Ceawo8o05/HuFK1uTOAQsWbRZJgvbDIg/jM/RSs2dKGDCzbkP+pbkGa 9+QFLdDrxnprC29Ce7ERdz4lVrc9Nk0jfNS0p/lXAa6THyE3d0u77cncdw7wBLPne3CZ BwuA== X-Gm-Message-State: AOJu0YzdzXkKdAqrR8J5hmQ0nkN6ztFu0+I85NsNDOekUGOOdnPWrPA/ 9FRPUEbh6fwWQaUgDfMNbS/WCc7Vh83fH6z439YJI26URVm4BrSLN+Lh/RfT4Ehu3kR3UjbW69b 2CaaIFw8= X-Gm-Gg: ASbGncsDc9Qa/hIzJun8/Yj/9wD3NKZkJ4XvZSoVADIig/kk5TWcJTaUQUsza143WYt 0qYrSKAJk1UlQ/Pa6xe8ltifygZuw/1k5GC6ZROyeCRaztFHfMnvnlhuq3iNQfgVYlqoiOUBHbh hEzBEqeaVTqUPmReq+pEKxo47PKvYqmY7IEK1UW0t5b+jLjU5ErBN917KL34a7UgOWxc2ZkDwx4 5w3yNBjA+K/9Jd+KdrrEZ6qvXIYcU7azWBNIb79NJnagvwZu7+INYwR8mVeUtDz+ka0CBlEaXdr kqCQSBn+D0VWevGKtUlKyJvvtnfQCry/vjlsqg4M83kMtodaSFrp2gCGuO5cxbUAIV16X6GEibU aQtvy8m35h9QW8qlAhewmCdRZIEgjU+6X1zFDZnzJf7DN8Rk9OHjxknZuyrzr X-Google-Smtp-Source: AGHT+IGHUnjIPp/Y7vIP1XlmJkCKJ7eaakme0CSKZSUwUCZGEiC4bG0p7372ZXhRfkfns+zWpdjTeA== X-Received: by 2002:a05:6a00:1825:b0:771:e8be:8390 with SMTP id d2e1a72fcca58-7723e2769dcmr323335b3a.14.1756506843315; Fri, 29 Aug 2025 15:34:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 86/91] linux-user: Remove ELIBBAD from elfload.c Date: Sat, 30 Aug 2025 08:24:22 +1000 Message-ID: <20250829222427.289668-87-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756573608749116600 Content-Type: text/plain; charset="utf-8" The last use of this fallback was removed in 8e62a71738bc. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/elfload.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index aa0eed6dea..c0326928d4 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -110,11 +110,6 @@ int info_is_fdpic(struct image_info *info) #define MAP_DENYWRITE 0 #endif =20 -/* should probably go in elf.h */ -#ifndef ELIBBAD -#define ELIBBAD 80 -#endif - #if TARGET_BIG_ENDIAN #define ELF_DATA ELFDATA2MSB #else --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756570208; cv=none; d=zohomail.com; s=zohoarc; b=DAXptOf/DkY4EM/4/2aXJkaL06ETGm9ASlTDhoDTAYQqtlkMuEibjb5BexrMKU/Vstw2dEa6VaJg/yba6WRpXV3ZGfKU62OKSjF/ja7ZTq1mU44AJ8ZP8ti8oR9VyM/9J6QuxnIC4y/NrHVctRcS1cIuoGFBIiawR5eZKIOCUhE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756570208; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7XkK8vg61qwmI34q6ceU14P1e/6apOaEvxBAxU5ibvs=; b=AmCYmEnm5rSAJXWzUB1fhOb+xWykwFI6WqiANdb/D35R6rBKz/YfpbE3b4p63MNVEMK3gh8tj16rcrNwbG0/cbV4r07ZRBxNpdIoHrmXHF9drejnAvQSLlCSoyqOYeYOLXLd7g1Ru84B7OVDPQ8bmJv1ZlSs/Ad3WLsoJfKXHyo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756570208272493.0701143165885; Sat, 30 Aug 2025 09:10:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNmw-0001aq-3i; Sat, 30 Aug 2025 11:46:46 -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 1us7fc-00061E-P0 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:34:08 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7fb-0004no-2f for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:34:08 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-770530175b2so2071525b3a.3 for ; Fri, 29 Aug 2025 15:34:06 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a269f27sm3449728b3a.12.2025.08.29.15.34.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:34:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506845; x=1757111645; 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=7XkK8vg61qwmI34q6ceU14P1e/6apOaEvxBAxU5ibvs=; b=OYxj7k5KEXuO6m4UP7YBX65Xs0h6lrWc/X7jiaZYpYVWDz5mZsXXCceqNn0xdzX+qW pAxtwO/YqreE1L4cwiIYn7xpY3jNNQWqcOZks51p7THAFo68R89BwrlboioiMAH/eZVB XlyZAGKDyc4UZZjf0lQxM/Ur/YGYG6v9ZWQ35hp0/sKRrCPZEtfnyPhINc59qQi1SUYs sN9WPnxVZ9eeq/VqXgTECHlsLnEhu1YPq2g7/H9MabcF03gqw21O5F21ioIQMPSXPMOu s21cVy/cDPOdd9lVfvytwNLoS3PyyI5avbRz/vqDiBs2JCfaGGnZrtyKruRwSZzw2e4d 031g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506845; x=1757111645; 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=7XkK8vg61qwmI34q6ceU14P1e/6apOaEvxBAxU5ibvs=; b=M62uuSG5d9ukvWfCwZboflV4mkfoj2zAy+lYEI97MUSLon3LyQWMwdG5KegxAN7yYk Pwf4cHdb1kPyEGyleJCOQk61ZFFRhgcVqxPBQ43TN+lMCtAuDvi5yQJ+AWKH+kjVVBTt AFcNzwztNxucwjRjCfLmsDhYG/DS1dbm0eD6P3hU4RI+ltdQ2svI4/22sfsMh1iZIS9Y EUr4KY97luifSPferGlSpHzRQ5/t93BOsZSXslCPliXzfGKPaXtvn6cDWMAjIyz/N1JT oXp1CEoSc1mUJHLwB8+V6nRQYm6PISo3vMH4TwIL8xSjpUuaSHYOb+9ejDgVkThwGaIE +H9A== X-Gm-Message-State: AOJu0YxTe+x8x5LBDMfUnDObJ6XgcZVtScexiT/shgCv6hxTunuG6yCZ md2iBNlIXN+BiXNOqMFH4i9AWpzbrYOxbIJVot/Vhp29t9DD+3YN099aU/Ontyv3zuhV+pUyZT/ T4+qOwdI= X-Gm-Gg: ASbGncvSI5yP+nwbqJ3cLwV/h1sIQeg7TkFQIXqet+3vFFjEzU8YRp4vknxP/btf74G z58IbLF/dRKUj0NMCwKJ1PWrp1QQ0axJvCwHZ/BQR2r/TIq0f/IgJVy/WuOtxIRJXKjyDU9OhVz B+lpDbmaSpeWXIqYy0bjT7rGqrikkRISvpMILaUB7oh63zYGg+RBiOf7Bl9Hr/yvSwN+Jn7/Ek4 Ym3ngb08nsYAeGC8nCE5z22pR75VANWYlITY/pgrs8TiRhZonhs4aLgFY/slD/6zq0jsm1JQL48 v4qxG8G9oetN4acjWuwQv5WpleOnW0mj/Ro4+PweSC6CZgcx2ghEBQnVUJ3OYKWUMcbiLPYiyVB BAf9Ss5mv5JzKnGSP9oYedkbQwNR3vKdEup9foDXC5MrzFi+LJGrXNFUirVKaOQrBLrSQMU8= X-Google-Smtp-Source: AGHT+IHVSxQZ5y0gb4g2u7MRwgZGEBGctSR71Gja1kKIxdng7NIKML3muyVD9RGE359hrhcMUJoK9A== X-Received: by 2002:a05:6a20:3d82:b0:243:6f4e:fba0 with SMTP id adf61e73a8af0-243d6ddbde4mr366695637.4.1756506845549; Fri, 29 Aug 2025 15:34:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 87/91] linux-user: Remove MAP_DENYWRITE from elfload.c Date: Sat, 30 Aug 2025 08:24:23 +1000 Message-ID: <20250829222427.289668-88-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756570210564124100 Content-Type: text/plain; charset="utf-8" The last use of this fallback was removed in bf858897b769. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/elfload.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index c0326928d4..8b92fba0f0 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -105,11 +105,6 @@ int info_is_fdpic(struct image_info *info) return info->personality =3D=3D PER_LINUX_FDPIC; } =20 -/* this flag is uneffective under linux too, should be deleted */ -#ifndef MAP_DENYWRITE -#define MAP_DENYWRITE 0 -#endif - #if TARGET_BIG_ENDIAN #define ELF_DATA ELFDATA2MSB #else --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756571769; cv=none; d=zohomail.com; s=zohoarc; b=OIKu8V61Xeq6kya303z7HYUTx+HmmRFN3fNi4vlacUnBClPTt6QlqSCHWMg9+YDuKHZUTIDI5wBuCzUzFNMxZreIwzCEFMzZ+bYF3cefUnsXXsmz+roUad6nNETfnr9DOXoOB1TDOwaJy5gKQpUBuRPCQXl416QCT8BmkkKAMoE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756571769; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=VAlclsw7NdwMNzDXXMYCt62TrsWhB1wwPrwu4zLwNMI=; b=cW0XjyWRdYQvVCznkMvW7MHeCetIec1+m6jEQG4CYxg+sCUOX3Lc72q5nMrbGz8lOdDR3/m4/dcszqEN6SWcEQT+gwafIzvBnxn9QQ3iBz5JzFcpGF3YtdB2zhReFjZqDWA5LKubbktAwAG3xU55NUva2dQ9WyXzCyLpSyVlPcs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756571769111739.1588027709616; Sat, 30 Aug 2025 09:36:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNn1-00021L-4z; Sat, 30 Aug 2025 11:46:51 -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 1us7ff-000620-7m for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:34:11 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7fd-0004oO-De for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:34:11 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-77201f3d389so2809989b3a.2 for ; Fri, 29 Aug 2025 15:34:08 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a269f27sm3449728b3a.12.2025.08.29.15.34.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:34:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506848; x=1757111648; 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=VAlclsw7NdwMNzDXXMYCt62TrsWhB1wwPrwu4zLwNMI=; b=pDZZGygO90TmO0j5s4ERQ7Y8ofEN8yhCDGezzpUo/cYR1pXjPzU1+yRnuvaw5MHdpI JbsFPJl1A43ULaOb1RFAzwTdMkTkevIq+3Sed6nXjOmOuwVZR+MiBf3i5HYeKJjnlCEp +1VxKuwoNbhnj2kXm6gDjer2x0/JqcR3aM5u1vWAk0GWgzR620+nprAWAtbN7Z7AT1Ib KCGQkN/M44mo/hHNGo2sA9GJ1Yexg0TSkcyr3VKSh6xRQqOsr7mJhPVC+gnMyx31A+Gc BbOKZB+wdG2dMd9DzSdtHWNyMuggIW0u4/MDo7Qyl5ldwtpXkdJ+1OKsuo+ZO623ALO0 H+fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506848; x=1757111648; 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=VAlclsw7NdwMNzDXXMYCt62TrsWhB1wwPrwu4zLwNMI=; b=kjH5Ho1ZeEPdmrrG4qmOBLT57ulPy7xwiUd1ZXm92xIzbWz3R/bT3N8OUD6LPd3Si+ wIAKqo7RnhGPni6dBOb/kPlAygSOHyx0llY+c5bmoCfIzhzVzJs+Y/ptbOaAVT1T85SF xoZs6oZVSqWL2bUnVdCJa75sdRk8+smLnM5CQ7/ZkW5ugmzk8GEASxZ+vjOmQjqfQsuE Tw/5+abML+GXy+3EdD2mXpVZfVROvAbTzNbnkBeHZLGvMrAsUN34GZHIQjCzYcWBaaLR dqrPQBk4Vzngbe6wVLh1xzDvWgwLwKv5b0cznpWwymBNoPPaxFHrIly+KVHwAG7L8r/y djcg== X-Gm-Message-State: AOJu0YzpEtSOZ9UGKfSYYinevTyldf+5G3Vj1NReFMLlMtRJomfGGLbq GP6tbuDZTszg2VzFlPKN1nU6sotaZCUBL/dDCumWlqNR/OnIiB7rb2+aUwL6+37VEYtvvxM/r4f zOub4EXc= X-Gm-Gg: ASbGncs5EWzHKYKpGlGOZhZEByh0Ic9Rc4p5Zw6zWSIXPRmuHkt0GBG+RCf1OVKJqtc xE3U29DG6NnaN7LmDJ6SAROkMqRrWm3fQo1kEcbKyhnFquxM7ZAak/MAuUfBPgg9UPZMPzQF1HY mH/fXa6B9VIfaDkIpkxOBwyJTSiFzmVfXxrHgP7mhBlxqdZAWE1+InzFEYxck0AFkyihU21g073 lC48cUL0nUpfFbJvJVdW0T3rpwZmx+gAccmirTxIA1pq7F5d3mKEV5VH1AUSRNGB599KO261mxq 9ya3cLEShbgWu1qTHJvNsOTJMQ5N7lBpv8C75S0yFkXPxxuyOFtYQGccnDgkb1vqkSiWbYQAIs8 tpBj3MzohcSdPSbGIPvjzZqPzqH5w535WUMD96uU85HtlzopCdOAGk6BRuCEo X-Google-Smtp-Source: AGHT+IEL2ygKto+vBNNkaZ7xM8ckllHe65N6Ft9ion7vFRJNc3DycYXoPDwmPcu3HlkGxvbvyIBP7A== X-Received: by 2002:aa7:8895:0:b0:772:3b9d:70f0 with SMTP id d2e1a72fcca58-7723e21a808mr293281b3a.2.1756506847916; Fri, 29 Aug 2025 15:34:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 88/91] linux-user: Move arch_parse_elf_property to aarch64/elfload.c Date: Sat, 30 Aug 2025 08:24:24 +1000 Message-ID: <20250829222427.289668-89-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756571771922124100 Content-Type: text/plain; charset="utf-8" Rename the controlling macro to HAVE_ELF_GNU_PROPERTY to match the other HAVE_* macros. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/aarch64/target_elf.h | 1 + linux-user/loader.h | 5 +++++ linux-user/aarch64/elfload.c | 18 +++++++++++++++ linux-user/elfload.c | 39 +++++++-------------------------- 4 files changed, 32 insertions(+), 31 deletions(-) diff --git a/linux-user/aarch64/target_elf.h b/linux-user/aarch64/target_el= f.h index 9ec51f6237..4cdeb64b0d 100644 --- a/linux-user/aarch64/target_elf.h +++ b/linux-user/aarch64/target_elf.h @@ -17,6 +17,7 @@ #define HAVE_ELF_HWCAP2 1 #define HAVE_ELF_PLATFORM 1 #define HAVE_ELF_CORE_DUMP 1 +#define HAVE_ELF_GNU_PROPERTY 1 =20 /* * See linux kernel: arch/arm64/include/asm/elf.h, where diff --git a/linux-user/loader.h b/linux-user/loader.h index 2175dd4e0a..e42b8fa1e3 100644 --- a/linux-user/loader.h +++ b/linux-user/loader.h @@ -122,4 +122,9 @@ typedef struct { /* Note that both Elf32_Word and Elf64_Word are uint32_t. */ const VdsoImageInfo *get_vdso_image_info(uint32_t elf_flags); =20 +bool arch_parse_elf_property(uint32_t pr_type, uint32_t pr_datasz, + const uint32_t *data, + struct image_info *info, + Error **errp); + #endif /* LINUX_USER_LOADER_H */ diff --git a/linux-user/aarch64/elfload.c b/linux-user/aarch64/elfload.c index 07a0c3f844..8076968251 100644 --- a/linux-user/aarch64/elfload.c +++ b/linux-user/aarch64/elfload.c @@ -1,10 +1,12 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ =20 #include "qemu/osdep.h" +#include "qapi/error.h" #include "qemu.h" #include "loader.h" #include "target/arm/cpu-features.h" #include "target_elf.h" +#include "elf.h" =20 =20 const char *get_elf_cpu_model(uint32_t eflags) @@ -349,6 +351,22 @@ const char *get_elf_platform(CPUState *cs) return TARGET_BIG_ENDIAN ? "aarch64_be" : "aarch64"; } =20 +bool arch_parse_elf_property(uint32_t pr_type, uint32_t pr_datasz, + const uint32_t *data, + struct image_info *info, + Error **errp) +{ + if (pr_type =3D=3D GNU_PROPERTY_AARCH64_FEATURE_1_AND) { + if (pr_datasz !=3D sizeof(uint32_t)) { + error_setg(errp, "Ill-formed GNU_PROPERTY_AARCH64_FEATURE_1_AN= D"); + return false; + } + /* We will extract GNU_PROPERTY_AARCH64_FEATURE_1_BTI later. */ + info->note_flags =3D *data; + } + return true; +} + void elf_core_copy_regs(target_elf_gregset_t *r, const CPUARMState *env) { for (int i =3D 0; i < 31; i++) { diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 8b92fba0f0..12d4873212 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -166,41 +166,18 @@ const char *get_elf_platform(CPUState *cs) { return N= ULL; } const char *get_elf_base_platform(CPUState *cs) { return NULL; } #endif =20 -#include "elf.h" - -/* We must delay the following stanzas until after "elf.h". */ -#if defined(TARGET_AARCH64) - -static bool arch_parse_elf_property(uint32_t pr_type, uint32_t pr_datasz, - const uint32_t *data, - struct image_info *info, - Error **errp) -{ - if (pr_type =3D=3D GNU_PROPERTY_AARCH64_FEATURE_1_AND) { - if (pr_datasz !=3D sizeof(uint32_t)) { - error_setg(errp, "Ill-formed GNU_PROPERTY_AARCH64_FEATURE_1_AN= D"); - return false; - } - /* We will extract GNU_PROPERTY_AARCH64_FEATURE_1_BTI later. */ - info->note_flags =3D *data; - } - return true; -} -#define ARCH_USE_GNU_PROPERTY 1 - -#else - -static bool arch_parse_elf_property(uint32_t pr_type, uint32_t pr_datasz, - const uint32_t *data, - struct image_info *info, - Error **errp) +#ifndef HAVE_ELF_GNU_PROPERTY +bool arch_parse_elf_property(uint32_t pr_type, uint32_t pr_datasz, + const uint32_t *data, struct image_info *info, + Error **errp) { g_assert_not_reached(); } -#define ARCH_USE_GNU_PROPERTY 0 - +#define HAVE_ELF_GNU_PROPERTY 0 #endif =20 +#include "elf.h" + struct exec { unsigned int a_info; /* Use macros N_MAGIC, etc for access */ @@ -1233,7 +1210,7 @@ static bool parse_elf_properties(const ImageSource *s= rc, uint32_t prev_type; =20 /* Unless the arch requires properties, ignore them. */ - if (!ARCH_USE_GNU_PROPERTY) { + if (!HAVE_ELF_GNU_PROPERTY) { return true; } =20 --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756569839; cv=none; d=zohomail.com; s=zohoarc; b=XkrsfyVcnk1DPzNkOnGPm42YrIsibJI1kkfcWBjL3RHGrpvLP/ACajlM8z2TmQX3j6yolvXMvhidHt3DPsdEMEMdIudwxQqvr+74dtbDqUirPG3Nxg9Y+fDAhwfYnOWFCQnpjcuWqER1e6L/4yaTNtWpY121Vi3GhncfSwjRWO8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756569839; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=mz6bnQ9hxSSK9MxglRgob/YBCdo1CFs/IVNS4H+kiuE=; b=JunDIMO7Vdke14GRl0n34MVqX822eUcnRWXL9J85nuvlKPQRW/w/+8gNh0azuYRxgkn2HAvFlGkflbVNsKKpFCwc3nx8b+QAu6zulpji6c/1Zg2VbPWR3rHeX3yC9Q2YHVbnd+OYjtba27kqGtsNnDH4jORA96d7IBFZQqQmjDM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 175656983920585.54051856725266; Sat, 30 Aug 2025 09:03:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNnS-0002Ug-GI; Sat, 30 Aug 2025 11:47:20 -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 1us7fh-00063D-G1 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:34:13 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7ff-0004pF-K8 for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:34:13 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-7722d6cc437so1104233b3a.0 for ; Fri, 29 Aug 2025 15:34:11 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a269f27sm3449728b3a.12.2025.08.29.15.34.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:34:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506850; x=1757111650; 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=mz6bnQ9hxSSK9MxglRgob/YBCdo1CFs/IVNS4H+kiuE=; b=OvHKxGx962cfI9kU/3nt0ifAn7WQVVPfRQx1AcIwtI6pjemKbNR2aSFVnbPG+7efXN JXG09kqfO+197lgBmWVe/diK5xzq3xxGUjjK+Dn7j6Ob7fvCegkRJipLZ1QvuzkXgVaN k5MkX1Mp/2HlPi0jyoPOurmBx3Hep62ky6NWQ/EViVu/e/gEBsWrieXag2Zis/vxiBKO xdA69Ani3ARys3snztfkGUYhRI6H9zFhKjiF/xHbXtvIy9N1rU1ksOkDtIH7moXYyIlP jw/JBVmSRnuLF+6gx3b1kA+M8Wrzu7YiIVaksxkdULFHf7GKnMbsTFK3nZZBYpLZsEqG ajAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506850; x=1757111650; 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=mz6bnQ9hxSSK9MxglRgob/YBCdo1CFs/IVNS4H+kiuE=; b=El3xV0091S2CI1k11RT1wLdV+Pxv/OgANA7fPe0c+rzr3/hQ1KHVTQ9mL78nGDFHPy 5S8Xb+5JzU60D4h8dITY9zIO1y05UCWROEw5b76Qb0qoQ3f+/RIsSG58e1suSediJaPY wmf/94+lp8affuKmNiOkiWpLoATKSn7bWi/AmlBD5T8ZAVHtXy3y2wSnhe/GAhS7UFxQ XSWAdDny21xBYvqWe9h+/0V+fNqqXD4EYSEO93+Khkgp1GZZozSkxfL4SnaHaariArxT rAeQYOz8RB+xIbdtsy3E7torw8QD2zfcuk71sYrjoeeQWXfG5doqrB0QvQeAFf5jMgr3 E61w== X-Gm-Message-State: AOJu0Yzg7dIJ5asNvftN2gcvneAYnqvv2z/5XgxJZHx1iqS/nJ+OYf4g oi9c0cVxAAA64aIE2Ick4i8zY///BrfC4Y9hScL1ldGBhS74CWURH2jX1d74z62Uz2ava8+2LKg vD+Q7cys= X-Gm-Gg: ASbGncs0c2pPOWLliypcoEq7BF92kZt5QIq5xJPRmJtmLkxvNaqQPsS45/TpEZr/InV QaWu1tesyVXaK005bKqD4ggrdkRHe2f0CV3P6iCedyj4kPRTsnaFqt7n3hQakIA9cSwJ1CjZSFt Mts/FU2w0eooMItlL2pkhIfweI3aAz36zUrkpsqRXYf3YVle16unDpGU7b7MD2Ya3jyaLLkPAtF QfK5lWUowPppHMWrQARWy8W16/OpPX05sxTfneyTV7Dl9WXU1f2UzXqbGt0D9kolOJYA08rhVqo Z2x2GfPIMifX5gZPd+pOoTHPrgXpJFpPlxZXtdTEHXKIHgr///TfuKNtogDGL7KQ3JWwgGeKsvx 6qUVL135m0+tbeQ+Nh97Oif6pkp9/yS/hVgNpiKYO3xcNgKS45ly5oUAyUe6JwPrQGuaH6sE= X-Google-Smtp-Source: AGHT+IFyTby7rDMCWFrZ4CTvBphHkAfAL9urxPF+TjYZQzecC8KWGyV16+vbC1BAY9ngBtP7NweZHQ== X-Received: by 2002:a05:6a00:4709:b0:76e:277c:32f7 with SMTP id d2e1a72fcca58-7723c504870mr649732b3a.9.1756506850167; Fri, 29 Aug 2025 15:34:10 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 89/91] linux-user: Remove a.out declarations from elfload.c Date: Sat, 30 Aug 2025 08:24:25 +1000 Message-ID: <20250829222427.289668-90-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42b; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42b.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756569839612116600 Content-Type: text/plain; charset="utf-8" These should have been removed with the rest of the stub a.out support in b9329d4b5321, though they were not in use even then. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/elfload.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 12d4873212..26c090c95d 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -178,25 +178,6 @@ bool arch_parse_elf_property(uint32_t pr_type, uint32_= t pr_datasz, =20 #include "elf.h" =20 -struct exec -{ - unsigned int a_info; /* Use macros N_MAGIC, etc for access */ - unsigned int a_text; /* length of text, in bytes */ - unsigned int a_data; /* length of data, in bytes */ - unsigned int a_bss; /* length of uninitialized data area, in bytes = */ - unsigned int a_syms; /* length of symbol table data in file, in byte= s */ - unsigned int a_entry; /* start address */ - unsigned int a_trsize; /* length of relocation info for text, in bytes= */ - unsigned int a_drsize; /* length of relocation info for data, in bytes= */ -}; - - -#define N_MAGIC(exec) ((exec).a_info & 0xffff) -#define OMAGIC 0407 -#define NMAGIC 0410 -#define ZMAGIC 0413 -#define QMAGIC 0314 - #define DLINFO_ITEMS 16 =20 static inline void memcpy_fromfs(void * to, const void * from, unsigned lo= ng n) --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756569635; cv=none; d=zohomail.com; s=zohoarc; b=QP5SR2mG2gnqp/keRWCgc6gNTfcdL+/rgz7daG7psxARQI/XKD3Y48DK2UJKfDLTTTwY+wf4TIVlNPsjatuH3HpX+dEqDW1ZNGbo0JKCF0PY7DaXv48UoQpH/4EllXjtUUrLVz8KkMgMpmGTPzdxQwIBAJDea3i/LUPBJT9hBR8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756569635; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=j2EBPaDljgDIO9u5Mh4leNghXkurvR/xAf8Yp62jKtQ=; b=TOQDpoDTx6+a7VDiuR3Yga1PFK0rzI9WK+wzgL68EJHi5706NVTrpJlb48tLoMfgkPLwyp+IfS/EocJMhSNQxEBnmFzj9fdB0FCWN9fOcHNCLpd3wnIce8tgJpDDl9qxzqWrBjZF2w90h2OjQbR3LX9aKAHWUcHNlrS4jLpdkB0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756569635861906.2070903686994; Sat, 30 Aug 2025 09:00:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNlG-0004PS-40; Sat, 30 Aug 2025 11:45:02 -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 1us7fj-00063i-JN for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:34:15 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7fh-0004pj-QT for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:34:15 -0400 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-771ff6f117aso2308275b3a.2 for ; Fri, 29 Aug 2025 15:34:13 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a269f27sm3449728b3a.12.2025.08.29.15.34.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:34:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506852; x=1757111652; 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=j2EBPaDljgDIO9u5Mh4leNghXkurvR/xAf8Yp62jKtQ=; b=aQDuF3DywjbHHh5exFzlowafr2QSFPtlS8QQK6UhC61A/U+mmmlMSMeuz7qxPKRijN xt9rAU9yZwPcd7zRrlAYlgMgrZDJh1BRZE2bWm+gwjEb5D7dTZj/9kg0wPSuiyU/tWNY loOOc/aMFZGttFlVBu/cI53/T/g0kOAB9Gy1bRLN4BRBrGIzb0xi9t56QCJFSeQCWZ7W fjKcYyQ3FftPvgn+D2zV+Doy7GBo/ZFlEunJs5Q9yF80MpDOhKWzB1Jjd6tIt99IbLbQ ycz/ta3FxsoS6JcGtEwnccfYQAPy3wUInnnqNRImh5rm7bu68zzJ1Q7rmuNWPSnhnGdl WkQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506852; x=1757111652; 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=j2EBPaDljgDIO9u5Mh4leNghXkurvR/xAf8Yp62jKtQ=; b=LR5ksayJMgyV5zfFe/Oq2IF+TmMwzBWUS7adCFbys+g1K1gYrYEmktyz+dLVp+n3DA AXMgq0jnZkHy4Tu+YHzNeylVbOHUsx1VUWB/NjqjL9F5ME8b2i6NOD6Ak45kjW2kQlEz 2EPfiHGsLu40RFjj+KaI/tCFh4RGXhlZxg5IdAOVDKpEALtULlXC/wVEPEKZm5VcRD1q GbhhVaXw3d4quc+N77YlV/8+xwVDxijeAGLRvz0qG/kwiGXeuePVw95FOFs57/YHBaW6 z+BjiWywHno5j/Ls+LB7FnXGmAOMophxVmlVG5NkTRP4zj0fSYsaCNwt4wgWl60iJ8C0 SLjg== X-Gm-Message-State: AOJu0Yz3R+JZNI6bhWtafvgVLJcswCtRfFn5K98uCIC0vbYUYgFNjCj+ vLn7m9mgQ1avieRnD32Jm58+kyy9KJmdUFBg85D5Z8H1BPgDVRbNtU7+liPJNSOuPDGSotajTN3 eGox1c/s= X-Gm-Gg: ASbGncvmVoj0LqXWrByQfhT0a4B9ZYgkgwX9DfYvmKifgQnHMXWTFdwF/YClAoRjZ1V ytOrCYC14RrIXldDytIv99g+1jx7dXuQ4reRufrDast5RhaHYWXpXUpYgNInpbI+pPah5dltzGL XejjZsOT7UQ9uWCkpZREMG/bu8v5IRnBi2Spx1a8vGTlMeSzAyhXSySqoXitdfJAvzKZPt1JJ9z 8Mx4/94EXEhdq+P9UdJM9iy5UVjgYqyp9fevXTdX4sWjAnW7M7yiHfkoF5uLTP84pAN3J3vjtXb PE5irHQpLenPBYGyOUvGg1KwyCcGvroo5m8cPHVKOYnq3m9JaoayMGiSrEOVQfHtScyEbzx782S byRLz/63K7ZUUISf681tcsZC92/GysmmWuOpdryn4ewZE5F61B2Qkzmj0vsPh X-Google-Smtp-Source: AGHT+IG4PtpAVcmQHSTWx1FlxByOrpw/xNmmo9wZJGBUd1NCA7s6Q0E6TuZeEnvH4JvJqx9bqG0Vww== X-Received: by 2002:a05:6a20:3d07:b0:243:9587:a75c with SMTP id adf61e73a8af0-243d6f7ec6cmr305660637.59.1756506852280; Fri, 29 Aug 2025 15:34:12 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 90/91] linux-user/sparc: Create target_ptrace.h Date: Sat, 30 Aug 2025 08:24:26 +1000 Message-ID: <20250829222427.289668-91-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756569637491116600 Content-Type: text/plain; charset="utf-8" Move target_pt_regs to target_ptrace.h. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/sparc/target_ptrace.h | 24 ++++++++++++++++++++++++ linux-user/sparc/target_syscall.h | 19 ------------------- linux-user/sparc/signal.c | 2 ++ 3 files changed, 26 insertions(+), 19 deletions(-) create mode 100644 linux-user/sparc/target_ptrace.h diff --git a/linux-user/sparc/target_ptrace.h b/linux-user/sparc/target_ptr= ace.h new file mode 100644 index 0000000000..a4d5416c1f --- /dev/null +++ b/linux-user/sparc/target_ptrace.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef SPARC_TARGET_PTRACE_H +#define SPARC_TARGET_PTRACE_H + +/* See arch/sparc/include/uapi/asm/ptrace.h. */ +struct target_pt_regs { +#if defined(TARGET_SPARC64) && !defined(TARGET_ABI32) + abi_ulong u_regs[16]; + abi_ulong tstate; + abi_ulong pc; + abi_ulong npc; + uint32_t y; + uint32_t magic; +#else + abi_ulong psr; + abi_ulong pc; + abi_ulong npc; + abi_ulong y; + abi_ulong u_regs[16]; +#endif +}; + +#endif /* SPARC_TARGET_PTRACE_H */ diff --git a/linux-user/sparc/target_syscall.h b/linux-user/sparc/target_sy= scall.h index e421165357..a90ed2983a 100644 --- a/linux-user/sparc/target_syscall.h +++ b/linux-user/sparc/target_syscall.h @@ -1,25 +1,6 @@ #ifndef SPARC_TARGET_SYSCALL_H #define SPARC_TARGET_SYSCALL_H =20 -#if defined(TARGET_SPARC64) && !defined(TARGET_ABI32) -struct target_pt_regs { - abi_ulong u_regs[16]; - abi_ulong tstate; - abi_ulong pc; - abi_ulong npc; - uint32_t y; - uint32_t magic; -}; -#else -struct target_pt_regs { - abi_ulong psr; - abi_ulong pc; - abi_ulong npc; - abi_ulong y; - abi_ulong u_regs[16]; -}; -#endif - #ifdef TARGET_SPARC64 # define UNAME_MACHINE "sparc64" #else diff --git a/linux-user/sparc/signal.c b/linux-user/sparc/signal.c index 8181b8b92c..d339f89928 100644 --- a/linux-user/sparc/signal.c +++ b/linux-user/sparc/signal.c @@ -21,6 +21,8 @@ #include "user-internals.h" #include "signal-common.h" #include "linux-user/trace.h" +#include "target_ptrace.h" + =20 /* A Sparc register window */ struct target_reg_window { --=20 2.43.0 From nobody Sun Sep 28 15:28:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756570393; cv=none; d=zohomail.com; s=zohoarc; b=JXjnw/WnYCzeGATlmrRFXjGsGUcm7W823mnQ30I/wqVC+y431hnKeEREQxeK9A6juyIDuhoZsBB+FISOWqyW4VWX1rwZHHhhQs99m3b4UbL+UwaEQFdD/lsFBdikP6myqiR2cMCTj+MglU1gLuqJGKspfFAZNSUWsgUcxW8uNiU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756570393; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=prtlyWLbDAwBX5YWvmSgUP1Zf7BeweKUjDWIIAQ/vSE=; b=YpaHSm/9bzzHvDjqnZkoPXlr+gyFaHE0B/qwmcZcJkXWB0mZ3dTMCnw/ubdyic8SrFYWsa7Nf7nvpH+R2zM8Te/I5MuBTfXUqsh+AG27OOUOqZt5VIszGzwjpjt2d/7hwnzCxeH8vMpoO9AFx/BrQ1TKEl0AW13VtKlMjAVO7PE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756570393441901.28802712079; Sat, 30 Aug 2025 09:13:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNmo-0000tO-F9; Sat, 30 Aug 2025 11:46:38 -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 1us7fm-00064W-Db for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:34:18 -0400 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7fk-0004qA-FF for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:34:18 -0400 Received: by mail-pj1-x1036.google.com with SMTP id 98e67ed59e1d1-327ceef65afso2290735a91.0 for ; Fri, 29 Aug 2025 15:34:16 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a269f27sm3449728b3a.12.2025.08.29.15.34.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:34:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506854; x=1757111654; 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=prtlyWLbDAwBX5YWvmSgUP1Zf7BeweKUjDWIIAQ/vSE=; b=AGnsnw9s8scL4GYxeVV0yostv/y++xJmEFpjY56fy9sXC+KuVvDMdD3SaUg0P1ABDk Y42feKhX8KIIFMuwrafQMYkAN/fVdTnln0MlEohZI1BhtEIw51dNyUzqctA+xTymQjVT DwDg+JPC8n38Jo9L8VOGs+S0dstp9KEw74q1TOAeTBS6+RxDz6MfOJswlh6/215WE5R4 p2AiuKPoL2AFG9eIaRfZPBZzTmGzv2ng+gf4NltxrQfubTehpTWDTTA0XkwXVDL1Xhj0 zRpwTQgeJ6IN5NOKDkVH+gr1Dak3hpxdwGDG5Y2oYhO6nWF6nr6sUcweuKy6D7j0TWkJ wpGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506854; x=1757111654; 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=prtlyWLbDAwBX5YWvmSgUP1Zf7BeweKUjDWIIAQ/vSE=; b=LljAKIVGHEoLMeFfbV6u8sZE5JG3fBm0vx9kmlRFlLYb3S5kAn+85X8kIjzVGZCYUN mdyvz+tCxy1oqp0JEr0XOkamk9W3bM3873UpEX+K+9b8yIBz3sjlrnu3qQcsYdkgbey5 vAnB2Ns6sU73UvmmsYfcpO0vzVsEmjAjKzKPEddagwYBUtxfeVWyJf5hgHAAe5HoDdil WIl8zT0TVKx5Tch+iUmD+e4ZHGqYc8tjuuQUuOI1ZSgI8LUAs/0V30AYYnYUaYfhxivm 8p0FcuESzbHnPzYEs951YdW2mH1jyP93Gpz42PXYswXIuY113DML4f+/vgNm+1Q6I5kr AkvA== X-Gm-Message-State: AOJu0YzwaF/IOVVTAKD7sDZUMT22zNU2Sc3jZzLdBpRAAbBVnGHb2MiV U+LfRa2i9O9HvYRfUVkiIL70MYVS1M3RR5jlbo0BzJS8rWE7hrSNOBDUWABYhI4ZejJINTZh3Mo ESsGbX/4= X-Gm-Gg: ASbGncvmAMnZbKr3UGEtPYBggXWhtVgDYMwKxYAQ8UaPFLpZVC0d3ySBkxmK5lRVmQM sxG4Cchu//0Cb/iPUT2l1ZDOgYmLrcyZ7THN7BZU/0IZ+myphDSIkbWzeUFvmqSiYSA7sB+dogP LiJ33Ye0RRgtkieIE2FEABsehHSphWjbxN0tBAGW6lOdXuPr6CSek7HNbFuPycZOYxVK9SpgDM/ Ey3ks90wn/YOR2TJLU29m1RgohAbRkQcIFgRySDReIzUEe5aVxN3gXcjtb6g03fyt9Qv0RMBov7 xCl394fOxlfePW8VZCxEvW0fz4QTCi5fNwlVg5EwZtG2YWbKVrS+mAzadSSsuzcQp5s05E+cjCp ez/1fWasJzVY7DGdLuLSwdCUD9QkBD25Ig+eZVfZ1ivA6k3lSclqg2eb38q2ui1DL9H1YvWc= X-Google-Smtp-Source: AGHT+IHtrN4I9hR/1JrnADJArYKWgBwyPdgs777zfCk2cbecIVtkomkZWXI3dS7BhqYw+FT2zsLeQQ== X-Received: by 2002:a17:90b:3b8f:b0:325:cce7:f65b with SMTP id 98e67ed59e1d1-328156cfb93mr364988a91.29.1756506854578; Fri, 29 Aug 2025 15:34:14 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 91/91] linux-user: Remove target_pt_regs from target_syscall.h Date: Sat, 30 Aug 2025 08:24:27 +1000 Message-ID: <20250829222427.289668-92-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::1036; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1036.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756570394454116600 Content-Type: text/plain; charset="utf-8" All target_pt_regs which have not been broken out to target_ptrace.h by this point are unused. Remove them. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/alpha/target_syscall.h | 40 ----------------------------- linux-user/hexagon/target_syscall.h | 5 ---- linux-user/hppa/target_syscall.h | 18 ------------- linux-user/m68k/target_syscall.h | 16 ------------ linux-user/riscv/target_syscall.h | 35 ------------------------- 5 files changed, 114 deletions(-) diff --git a/linux-user/alpha/target_syscall.h b/linux-user/alpha/target_sy= scall.h index fda3a49f29..53706b749f 100644 --- a/linux-user/alpha/target_syscall.h +++ b/linux-user/alpha/target_syscall.h @@ -1,46 +1,6 @@ #ifndef ALPHA_TARGET_SYSCALL_H #define ALPHA_TARGET_SYSCALL_H =20 -/* default linux values for the selectors */ -#define __USER_DS (1) - -struct target_pt_regs { - abi_ulong r0; - abi_ulong r1; - abi_ulong r2; - abi_ulong r3; - abi_ulong r4; - abi_ulong r5; - abi_ulong r6; - abi_ulong r7; - abi_ulong r8; - abi_ulong r19; - abi_ulong r20; - abi_ulong r21; - abi_ulong r22; - abi_ulong r23; - abi_ulong r24; - abi_ulong r25; - abi_ulong r26; - abi_ulong r27; - abi_ulong r28; - abi_ulong hae; -/* JRP - These are the values provided to a0-a2 by PALcode */ - abi_ulong trap_a0; - abi_ulong trap_a1; - abi_ulong trap_a2; -/* These are saved by PAL-code: */ - abi_ulong ps; - abi_ulong pc; - abi_ulong gp; - abi_ulong r16; - abi_ulong r17; - abi_ulong r18; -/* Those is needed by qemu to temporary store the user stack pointer */ - abi_ulong usp; - abi_ulong unique; -}; - #define UNAME_MACHINE "alpha" #define UNAME_MINIMUM_RELEASE "2.6.32" =20 diff --git a/linux-user/hexagon/target_syscall.h b/linux-user/hexagon/targe= t_syscall.h index 7f91a4abc7..d9c94737a5 100644 --- a/linux-user/hexagon/target_syscall.h +++ b/linux-user/hexagon/target_syscall.h @@ -18,11 +18,6 @@ #ifndef HEXAGON_TARGET_SYSCALL_H #define HEXAGON_TARGET_SYSCALL_H =20 -struct target_pt_regs { - abi_long sepc; - abi_long sp; -}; - #define UNAME_MACHINE "hexagon" #define UNAME_MINIMUM_RELEASE "4.15.0" =20 diff --git a/linux-user/hppa/target_syscall.h b/linux-user/hppa/target_sysc= all.h index 9a8f8ca628..4b21e85371 100644 --- a/linux-user/hppa/target_syscall.h +++ b/linux-user/hppa/target_syscall.h @@ -1,24 +1,6 @@ #ifndef HPPA_TARGET_SYSCALL_H #define HPPA_TARGET_SYSCALL_H =20 -struct target_pt_regs { - target_ulong gr[32]; - uint64_t fr[32]; - target_ulong sr[8]; - target_ulong iasq[2]; - target_ulong iaoq[2]; - target_ulong cr27; - target_ulong __pad0; - target_ulong orig_r28; - target_ulong ksp; - target_ulong kpc; - target_ulong sar; - target_ulong iir; - target_ulong isr; - target_ulong ior; - target_ulong ipsw; -}; - #define UNAME_MACHINE "parisc" #define UNAME_MINIMUM_RELEASE "2.6.32" #define TARGET_CLONE_BACKWARDS diff --git a/linux-user/m68k/target_syscall.h b/linux-user/m68k/target_sysc= all.h index 8d4ddbd76c..3ca0231c70 100644 --- a/linux-user/m68k/target_syscall.h +++ b/linux-user/m68k/target_syscall.h @@ -1,22 +1,6 @@ #ifndef M68K_TARGET_SYSCALL_H #define M68K_TARGET_SYSCALL_H =20 -/* this struct defines the way the registers are stored on the - stack during a system call. */ - -struct target_pt_regs { - abi_long d1, d2, d3, d4, d5, d6, d7; - abi_long a0, a1, a2, a3, a4, a5, a6; - abi_ulong d0; - abi_ulong usp; - abi_ulong orig_d0; - int16_t stkadj; - uint16_t sr; - abi_ulong pc; - uint16_t fntvex; - uint16_t __fill; -}; - #define UNAME_MACHINE "m68k" #define UNAME_MINIMUM_RELEASE "2.6.32" =20 diff --git a/linux-user/riscv/target_syscall.h b/linux-user/riscv/target_sy= scall.h index 7601f10c28..69a7b753eb 100644 --- a/linux-user/riscv/target_syscall.h +++ b/linux-user/riscv/target_syscall.h @@ -8,41 +8,6 @@ #ifndef LINUX_USER_RISCV_TARGET_SYSCALL_H #define LINUX_USER_RISCV_TARGET_SYSCALL_H =20 -struct target_pt_regs { - abi_long sepc; - abi_long ra; - abi_long sp; - abi_long gp; - abi_long tp; - abi_long t0; - abi_long t1; - abi_long t2; - abi_long s0; - abi_long s1; - abi_long a0; - abi_long a1; - abi_long a2; - abi_long a3; - abi_long a4; - abi_long a5; - abi_long a6; - abi_long a7; - abi_long s2; - abi_long s3; - abi_long s4; - abi_long s5; - abi_long s6; - abi_long s7; - abi_long s8; - abi_long s9; - abi_long s10; - abi_long s11; - abi_long t3; - abi_long t4; - abi_long t5; - abi_long t6; -}; - #ifdef TARGET_RISCV32 #define UNAME_MACHINE "riscv32" #define UNAME_MINIMUM_RELEASE "5.4.0" --=20 2.43.0