From nobody Sun Sep 28 15:25:45 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=1756383393; cv=none; d=zohomail.com; s=zohoarc; b=MXP9CD3Uar3OIrGlnkmZ0KEX75lf+QBnIJ8W79TFhxMGqi3o8LVGOwuCXmrwNSO8Gm6iOxKEkYAGMG5pg/ggHpI7UzUpQNe6almMGM7R2Dp4Hdk1W1bzxV53pYdT0j97tQKVaPw4cxWTA8x3w8RreINLm+9vQJUDz+rSOs5JNXI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756383393; 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=2iLTU2Od33oMP9jF0MYnO7hKypI+OnHyTOWI0bio9z0=; b=XE8AL6eHySD1cFsldJp/NEs3I1Z/8RbpQc2ETNTTnJ5PhAjAJSEY9fu+NxZd0s6WfHiDwmW8+XQTbAY0z8PCCBWXl52mplIJk8JCADtJcYGpEDn4JsWzNTxu+/Thhe9wrsord/M+VzKiVCo1XEaLMlaUYqYdayMnD8Z//NrOElE= 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 1756383393620566.1093570106644; Thu, 28 Aug 2025 05:16:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbQy-00023U-Mr; Thu, 28 Aug 2025 08:08: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 1urbQu-00021I-MY for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:08:48 -0400 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbQs-00076h-V1 for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:08:48 -0400 Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-32326e09f58so911051a91.2 for ; Thu, 28 Aug 2025 05:08:46 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.08.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:08:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756382925; x=1756987725; 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=2iLTU2Od33oMP9jF0MYnO7hKypI+OnHyTOWI0bio9z0=; b=PSYq0UfRh8umX4WxqT0p9wHEMyW7fiiFzEv23FcTo9EjJO0TLpZ0jEiStDyTKfhen8 uZRaqUeJnhGvDDqaCoAI11cc147m/c1ubTusc/AO5Tzk6wJGapRpbTkjIwCkLob38y30 dX4DO4SAyObP4xmQNRqTpo/HwWABlIZ5PFGhN0QMpzuVLwl8QcjV8f43YE0U8eVXGPKf 8NJCKuXrfQS4AnRh0xVhIe/vFz9eQLD22CRLEafVdMnINQTiwSiVoKIVCxpqAvSI/IbH ruL+UqDdU0G6TtKQOdq73gsQLmmwv6VdlStA50RWKHNLo/012ze/9hshQyyD3HHxuNKk 6o2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756382925; x=1756987725; 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=2iLTU2Od33oMP9jF0MYnO7hKypI+OnHyTOWI0bio9z0=; b=XM/RwlKwdGCyjThjTNpu1CuBLg9ml5K2ksyTTBK21KGW06AMeG97YGVfkpTtxzFUiL xyL5IiOf5LuTg/HzKb+tH+MUT5vnKJ1/UzXslxNAvECwtNWyYMJ8Qw9HoSPqzXSUPNB0 oUMIwrha8jD32gnEaNasqwNAvrjVJKA285wNjluTgv7bz2Y1T1bgpsntmWzXqpKnx6Nt 5Aei8TL4scrUGp/7lYdQM15U6eLnbsQ92bnhvRix74dohLINsLSVIGaGfJcBEcBAnDLI gmpakloE9NthHrVrq1mVrtl9PY35Y46xcLWw/9wagFa7M47ZMt2Vttj+iXksGJNrjkxb /qPw== X-Gm-Message-State: AOJu0YyAEOgYAqVIVIsN8xtdXkqN4hOTxEdIJhoNTHG+fFNGHSwrpKs9 3Hlfj7lZjze+bmr+/576NvIPKAKMW/CGz3beHUoEgxH3OELSq93ykhK8+XpquRjCNT6HPw4EQsJ 8J4Mg//c= X-Gm-Gg: ASbGnctyHRMGb3E0xjpfE7+qcOYh/LLthCCSR/Ep1shSx7fk3cU3qclOUkikY9Bt0K1 mF8Qxq8o3c0uemuV7W9dcyWyoJjQEM4uBfP01S28C/b043RkXKYgzROzbWB3yM/A9l1HrikTAhC k3rhou6sZQ4afzNcXFa4mWj54bA9b09NEja4d6ZFJUJ2IVVlGGUSG+rAE46BjVOovkUk30//peb fNeNE2enq9ecnmLulZ19GD1sb5uRK3TFKgK5xWFzwXilsVSH7746mr1ye9sx8Qb3NCNYXmLRhdQ nWHH3nNUNYOk35DKFv1dKhsTadnBmdpIFEJQfg1XM4dFnQtKyZudSzDlSF69TJ5sIY7CmoSgndf UCLT3ATca0c3J0wxB7b5lL7rQrw== X-Google-Smtp-Source: AGHT+IH7ghq5yEyNDPaJ2fD5WRV4we5dOZnJDV8il6kOkqZ+rshKaHfZFLihicsc4aFM/hvB6oplwg== X-Received: by 2002:a17:90b:2f47:b0:321:9628:ebf5 with SMTP id 98e67ed59e1d1-32517d1ffbcmr29080246a91.30.1756382925016; Thu, 28 Aug 2025 05:08:45 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 01/87] linux-user/x86_64: Convert target_elf_gregset_t to a struct Date: Thu, 28 Aug 2025 22:07:10 +1000 Message-ID: <20250828120836.195358-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::102b; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102b.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: 1756383395740116601 Content-Type: text/plain; charset="utf-8" A structure typedef may be abstract, while an array typedef cannot. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756382966; cv=none; d=zohomail.com; s=zohoarc; b=k0f4gKrDYn0AxyuWGDxxXzkX8yIBEh0gqMkSDHxSrZzDxaa5/ntmN0ghtiQLztIbLZEMNpM5nJEL58w09h5dmtpN7/2ZaDAUvhASyTudY6hCYlODvgYFSFnTmqY7GpZaTPDDQIA7VrA2qZwnSFi3KONgNxCd81bN9adnWykw1Uk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756382966; 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=Ckoa7Q5fRbN89GH2lVEP8QY0piD/Udg3SNC690VSxXY=; b=PqwnVU4nTNWjXmK5fZF3bfEyY4BI1XrxL9edmKVYF6rdXtHB4VwqODznuB8SDqNy9s5B83jZY5XCwMs8kaPJboEE3HK60FLQ184GJuTOv3RSlyxg75Qpxa+Y3YWMHXc3Fr81IHOJ/wMx8rFdigkd+Amrt7mKi+h6LaSayBcCUA8= 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 1756382966328129.63245710807962; Thu, 28 Aug 2025 05:09:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbR1-00025A-Aw; Thu, 28 Aug 2025 08:08: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 1urbQw-00021z-UJ for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:08:51 -0400 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbQv-00077L-5U for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:08:50 -0400 Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-32326e202e0so785485a91.2 for ; Thu, 28 Aug 2025 05:08:48 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.08.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:08:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756382928; x=1756987728; 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=Ckoa7Q5fRbN89GH2lVEP8QY0piD/Udg3SNC690VSxXY=; b=R5xXhwbQWB6hjTlWpiaBr0XNXSO6vXtJsxudH3LeObA1PKqPRKyYpeMYTPAZl6Dgxh 2h8JsV3Bm2diMKW7VgZQu3EE6Zfhg3ylrkJdZAIGH+tqU/RYUkwC/gHvP/1HpMk4YvQL PBZLAcU6OhXwLCGMLZbLXJ5aSCQTufSTihAQYt+37d83c9eRITv9nw25Su7J/lQKL+0i QUDXkecfeGsy+0Q8TA/Yj7dlT8r0S+r82kYWSuD03qnuRwSWT6g5A7ScTGQfrW3cq+co aZbFOA+f41oK8cpKLR0I9kRNW/VJVD8SkOcJMz2aAiv5/r21xehA6q7RZnYz+zp66nNc x42g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756382928; x=1756987728; 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=Ckoa7Q5fRbN89GH2lVEP8QY0piD/Udg3SNC690VSxXY=; b=b9is5fORSQXPvngx3hi0TKI/c1mYAjrA1Rm0I6tRT2Mas/ZJReZyW5v2sJY4AUWgD1 dxARVP68JiYPBZ6aBGroRatxOfqLJ4H8Od6YstyzuxtUsrrFtZjkUc4aaVkAaDu5iNXu +xXA3iq6dblMtoioC/QDk2xXFMwO3KsxuxcPVNZKj6viEpSowNhVWmQ901XDOQvRsHCs GN7vhbWBF2zN00IfCxPmyZRM2I4dQ56Ow87UWHdlLiVNLpB/O2hIp2tUUwt6cW9b8Te+ otyL5BnjTBljCR6190cZifssTslHEWym9/S0JS6SF3jBS6WBBkmDkAjaWRbjmiTTGIVf muVg== X-Gm-Message-State: AOJu0YwaW9y646lR1BwUrCiFTjkrcxnr4fVF9zF+/JSosY6+f95Zsi7b DZGN2zrVKE3f4qoJPc6ygOetWzx/WWBuRsHpHYjGK4G6eZHFzQeUB82Y6PjeYyv2GErOMJpXNhM MuZZFpuQ= X-Gm-Gg: ASbGncvDVuZh8ocFiQ6WP7HxWxxRFYVV8qot4FEWLVvqd5C1u57BffQk1wwCCHg98aa ZfbUQ72Q+rQmVBtnfMTxJ6tmgfWtPZ9zwHIhcsB5tQ2lN8LInhUon85iQKnsuEHGMjo0al8tyxY baBE6bpi+Gkpj0gXoLMTihz+P/Z7u2fNu/VSohKr9qNNJ58UPk/Q1Kqbp9TGXYcBwQzt2iqSB87 DnxFRNxLCIaCL4jsRYfHESXsQbjm/Qht4v1I4D2cMRnn2QpT7Wsr/g4VblzznxNeId9TK+wq+qt mWAR7WZfcAxDY2SOt+v2wnKFnbcDwubV0iA2Rg+XtqDAG2ySrub3GppdJKjgU/LUDN56EMauOMk RBxmBju1DTeAnUJQK0J8yIfIWpkr3JE5WLTtOnZfR5LT21yY= X-Google-Smtp-Source: AGHT+IEkjeUv4U6m3vHercS3wQLx83aU+J0oB+4FthlKrzutKRXGZrORYTEW7xvnojSc5zEjTZjSsA== X-Received: by 2002:a17:90b:5863:b0:327:ba78:e96e with SMTP id 98e67ed59e1d1-327ba78eb9dmr1362554a91.13.1756382927625; Thu, 28 Aug 2025 05:08:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 02/87] linux-user/i386: Convert target_elf_gregset_t to a struct Date: Thu, 28 Aug 2025 22:07:11 +1000 Message-ID: <20250828120836.195358-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::102a; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102a.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: 1756382967858116600 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756383178; cv=none; d=zohomail.com; s=zohoarc; b=gI3XJECHH0qi/b6cD0mEtBd5W5vdXDzVUYhjpfYfgpAAh79ziyjV5aHtTuwdwKuX7N9gii7sqgdr+cjlUnhr3e6cOn3LvZmZ0UcgIJ+SWPlyjO9DqsmK5ozUO3Jqyc+9ceH38f6A9zH+TwsjFb11NLKr05tnEEcg1dX6hdkGM88= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756383178; 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=qsirV2GKPgHnqs4+QGNqjVOSgh24YvjEMX/IQK9m7yI=; b=GyQdo8si1z00b5iFkZ1juSb3G3jLMwDTjjPlvGoP4LPVt5GmNug3/9J/1KCp4uryTZW5Pj94bUb5OPV28Cktsh+ZIiRpMV4MiayKdWo8n7FCuwC0gfAAZLXQMLCjRI0xxRS9WQ3cDGcy7mCDuMHTHHewSGO6BiS+wminPwVdfmg= 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 SMTP id 1756383178882906.628833970892; Thu, 28 Aug 2025 05:12:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbR2-00025t-AX; Thu, 28 Aug 2025 08:08: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 1urbQz-00024D-UF for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:08:54 -0400 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbQx-00077q-NZ for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:08:53 -0400 Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-32326793a85so753255a91.1 for ; Thu, 28 Aug 2025 05:08:51 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.08.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:08:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756382930; x=1756987730; 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=qsirV2GKPgHnqs4+QGNqjVOSgh24YvjEMX/IQK9m7yI=; b=zFAQ2ep8KNEMNVcbN8r1kUdI9sJuToQv+d42YPPAMGxfJ1qwGZ75d4GRY5s6Py2ec8 m6h0mt8rF43zHMDQ+s3cuPN9JYURJR4pJcUmkjHqSxXRZx6mil578YLOqpy/NieakO3H E9rsvMFAJE4dSjiXVppXB0xoQUchefUWFfhjnTPgc0RKHGNSobiLkB7DusnUx5EBL1Lx DbkgojvB9csJXewTRCoyd9cs2BYMCmFQ/a0383Whcrltsw1TQbyBfYYfv+0xHimZ0cCx tLALLcGKMtwArbcfegAIOqTOvyF+cp+P5rmaYiefPOAd95ddSgj3bpJiwfrnaDBuh9KN S1UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756382930; x=1756987730; 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=qsirV2GKPgHnqs4+QGNqjVOSgh24YvjEMX/IQK9m7yI=; b=BMkVGZDBUOySw7rMtGeM7rt73w14HhInlDjQifHnSfRK46wLjUKHVgZAb9ZicGVaJe dVyr94lWHJqyWAywi/MhsD0HmGJnOL5N7EYEct/P2RCbOF2SjlIUE4c0gnD6IezBC79S wjkAHFzuOAvngCshkRKkTWAKxiORr65p4lURNlMY03jjX1xFv+TpXNcO4Fr3gQnpoOim zW7+fiYDtXFQ1AYs+LU40JkoBcMSt3FXaKjHjFxCq4ll3c6ocFVdUHrUC8wsx/YrChhX lAMNPzu583V2B3563mOfx9j810r/xGoF7GrAvtQLLCuLpsJ5hVVwJsHJj9vFYKLZxR9w kQ6A== X-Gm-Message-State: AOJu0YyjPdK2IN415TcxlAVVpL5s3JWAYLaQ/mY+IU9edPalx5McBfN3 dvmyO/u7K+feYUoA1JX2BCCQAc472/QC5rTx3w9XqEOTIm2HpRYyeBKkLrGHNPkt3nGt7+Al/ED 0rVM06yM= X-Gm-Gg: ASbGncsUjAqcJDtGS+kmchgZOitp5ov3ENTbrOLGHQXQnwGw58wofuAhNEwBB9w2WNq pbITmt4w31MqjcLy+IdzF+OSSrhOo9L8+Plxcn9BrAMBosdhVhM/1RlNEXXIFIv+vQGfazA6rLo f68P8xWbCguTchLddIDdN+e+vJXWHfUIQfEXteV4jo2U/cxZ4xG0lZQEMEV1YUZL9TEPHuzNMlA h6Ki8ozFnHkVUzzc8T35iHzqSYxEXVxKDl8x3hkTbZYkRhzyZok6KNTMaSkPimUi7baBVQfhDgD EgWbkfkS78QOhksUyT5nLvXKvefNBSDLpQhiMKYtVXK7MSLbs3LSZLOenG3oa8KcrDcXWD/RsdW 0Jo5W99GWW+umpaqSGzxOqu0v/yQBYCvntZjHqxp9i9uTLd4= X-Google-Smtp-Source: AGHT+IHtpd0qGJiRtgTFSBNPBeE5rneqEsH5828VmmeXccicg/k6vELyeieBufjr4Hm2eGqTewLoKQ== X-Received: by 2002:a17:90b:3ec9:b0:327:5360:5b0e with SMTP id 98e67ed59e1d1-3275360615cmr10338410a91.30.1756382930051; Thu, 28 Aug 2025 05:08:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 03/87] linux-user/arm: Convert target_elf_gregset_t to a struct Date: Thu, 28 Aug 2025 22:07:12 +1000 Message-ID: <20250828120836.195358-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::1029; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1029.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: 1756383180988116600 Content-Type: text/plain; charset="utf-8" While we're at it, loop over the general registers rather than open-code them. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756383120; cv=none; d=zohomail.com; s=zohoarc; b=ZsTBL/6OH6uo+gJcOG1Exuh7WuJGY/dAakeTwuGuAuSAtvQvRSTUON4H9flIbkBa/+HLgV6VakGbr7WatmEAQdOFeKTcKjX6fZxpToqZJun+foPheDhMDzXp9p3rmvN32PkDAG04cvE4Xo7KSdtNRW3d0vowv2onx9XEiPpndEg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756383120; 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=d1p9ZZX2L4dPqSAnciIvd5Ttg4kPY8+u2dEvBtnDYjk=; b=ILGoUMkMxVYA4xqBsmfbX7eVLuSt9jnL3MiuhXKFT3cUALNd17nO7I2LoAI/pI0IUvoM+/JFnPxdWKP3zNNLFUNM2JOSgE4tgPvVe0+Qm7MhbA3FjF8q2MxsGoSYpJXvYbIE60KsmuJISo13LaH9FX1Wga73QIjdA0YQA9o50xk= 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 1756383120970116.70063501639913; Thu, 28 Aug 2025 05:12:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbR4-00026H-C5; Thu, 28 Aug 2025 08:08: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 1urbR1-00025M-DQ for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:08:55 -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 1urbQz-00078e-Rx for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:08:55 -0400 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-771fa65b0e1so470117b3a.0 for ; Thu, 28 Aug 2025 05:08:53 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.08.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:08:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756382932; x=1756987732; 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=d1p9ZZX2L4dPqSAnciIvd5Ttg4kPY8+u2dEvBtnDYjk=; b=r/R14EADdYHgEsbJXilUD3DxCmVf00dX3zPnfrMlwb1Qa9tIKVx+G5Pij0L0ysKSvX yJ7Ys7OuInJJhsBo1nuhi1qO8seGXehERsNTrNPu2S4WtUPnpke0V7CRPwMZG+uUZVWQ FLGyDFvr9d7GM/EtNku7FgxHVMEh3dZbvUe0TPAOfoMb70xs2eM57LIo592nC5NqzWbA tjfxWqj5lNgohc3G6gNhIxRbZPlVBI2qZFEuAj5H4qTJ6gHW5vz8H2TUvhqtSKuyHHDW tF5IpFscHIxmaPS0W8K3v6CgLu1y3p2im0BrFMhu8X00bEzgw3dQjbYS3SrDYd0gPVU0 R/vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756382932; x=1756987732; 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=d1p9ZZX2L4dPqSAnciIvd5Ttg4kPY8+u2dEvBtnDYjk=; b=S1ysb9ExjfDSWThUtBsepywGoXvdmSD7aksyZU1Syes1iiY3Pjy+ofEZGu1gbI0IpX kWYKqtn7TThrD3hmjlQOcYXGk6n0jTN24Fyv+jEu3Ojxx3XP4OqISzSA17PArGNAZ8cb l+PtZhLLjln6GWoYaxulqM4BVRU5S7xjjOHKRgIRSATDK2VAvoEYUiBkZ+SJtTck+zZs ISUf1Jf9xoHJ9NQymyTCZj9apFy/4Lr7d2zLOm69nCoR+PwFxlNh2BmMKi2Dyo9RNlg3 gnQlSTLWnsYDX2Pyz88mI3Fbelh7Hu9f5fEdHnpQr0zWMyhIoczQ3hJLeeovkzHZF668 EM1g== X-Gm-Message-State: AOJu0YwwJpszlnZm5Fe0GxPpld8eUOchGeSbyfzXg2+V1e0LzAyHWtql tVskioze/OeG/pqmPWSh0rjMV7X70GwSUUKd1DyYzbk4FEHHafjXFVIWx83P3hwyayfEkPounpL nh36QzJI= X-Gm-Gg: ASbGncug6QAGVcbN8bjDDYBJaTbjVPaDvSY4P03WVuXStew0oQOCb5Iq6S6mK27zveE 4Yok6ToAfVSvdN2Y6J9l/vVJTgiXa0liH7Bm3n4u5uqbMTgezucOOw4iLUfVSjtyQxmR6pkbF0n N3wenl8mdaPHpNFKxFK13/ZZ7HTLFd7DuilvhtGjIr4hgO5PbM4ruZERZpNBFdrLOSRBMGCt0ic Lp/mquWbb0FeJF0nd99lSZ5nv8yd1i+Jp5r+QZt0YFEXGTNXwlEjgihSqjZrZiT9utWUyFZ9Ngh t8tKqqnJG+Oy8H9v8PhSleBott+p6K4gUok19h4g+6nbL7PukdHPElIf7Gb/JnFP9Hit4ViLeTL n4DCG4PxKBI0WHJN6IcqQ7Oeu1w== X-Google-Smtp-Source: AGHT+IHFFHjx+C55KJuRdYBIHtFG5cyaA9gpC4S9p02Sv4UjfZmxOyEKd1X7Fk5Si2aShu67XSiDlA== X-Received: by 2002:a05:6a20:3d12:b0:243:7cff:6251 with SMTP id adf61e73a8af0-2437cff65ccmr19817741637.26.1756382932365; Thu, 28 Aug 2025 05:08:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 04/87] linux-user/aarch64: Convert target_elf_gregset_t to a struct Date: Thu, 28 Aug 2025 22:07:13 +1000 Message-ID: <20250828120836.195358-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756383122352116600 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756382990; cv=none; d=zohomail.com; s=zohoarc; b=MKYyQwQCTZXbXfTqqJp0inyrGHlR7GCXZQH6A5rDkQNjfn96biu7udJqqSU8Q6EiHT1yIqlthov0klEIjSBkjxNi7A5NCL/16pRileAfgRON/CeOcTIZkdn5JFpvvzsO+yp4A3tGvP6kNcnV1ihoGgC9Qmq7GNetfBPByEUsLhA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756382990; 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=IwLQkscBvVNvwc673PSbY9v8qD5Nq2dzCHYPuN8qxPU=; b=ffmx4aq9ojLp/YgkivdHRx+UznVSi5UjOVGWIv4AmrG6jzHKCyD3ocdEu2xj1LAeuZAkcPSoR8QgRon3jCSP4yMjzubckMrE+EQyRJaJTV3YlDEZ0ki73xinOkPRMG1Er9kow3AxF2R9d+v0ZiJzlgrGZTHTXJsG7CPaqDI17gA= 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 1756382990563619.6134269845787; Thu, 28 Aug 2025 05:09:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbR8-00028D-2R; Thu, 28 Aug 2025 08:09: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 1urbR5-00026w-6P for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:08:59 -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 1urbR2-00079A-An for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:08:58 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-7704f3c4708so1043916b3a.1 for ; Thu, 28 Aug 2025 05:08:55 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.08.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:08:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756382935; x=1756987735; 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=IwLQkscBvVNvwc673PSbY9v8qD5Nq2dzCHYPuN8qxPU=; b=OX7z24IJYA6KzFjviLEo5WkiPmf4YN3O+FUXg9jlMT4eZxFVfPY/+Z5DkDnyzhhE3P v797yVNJ92TKVcyQzvizqZfkjdr/IOAjzluPrMttz3jNa4Hgm0n3x/AGqE56FtitHkyp gR6XFt1H4smyfuKDRXWXKlY46ZObn2sdYeRhfCePR34H0IglxZRQuFSZTqrAzX6EIkak N9RxFe9vDWGhTlbm+s2+MGy39UXlIy9UmcCM8SX9n8KAAI5ZviO0RTn53JHJRvk1Tpcy 7p4XuhoHGoowTypGaK2v+89IcBxn2pM5NYcD91VNgJDilYsXoPFUs6sU5WUxx4GIpndx 512Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756382935; x=1756987735; 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=IwLQkscBvVNvwc673PSbY9v8qD5Nq2dzCHYPuN8qxPU=; b=iBo6pUQIFYOoo+F5T+V/XGgSQ0sZEJbu468UChuTdZao5vZD5B0Fc7nkGmJVEiYKQd VpIBS9xgk4yLb00TEMGsB6SyFHF0j9q8d38ZqD6ATYPceaMsm+550zycacTsxig6rJ9q F9FtWFF5FQjrVbey+cabEhz1x4mlAqfCVc2MIwGoJvV8OnxAKFBXUMm2AzDD9OI8DjBO xa5ynZOWZE/T0VlWO5q1Xi2jZ/cqFfYJOn15PrjPq0+oy+U7gdXmSNGNTIdR5DD4Db3r BsoLr30oyeNkhrebdbOLm9YvdmFxTTJ0s3BJNsv4uzm9Kz8vc9XrtM7gd3qAyQSM4ecQ 86ug== X-Gm-Message-State: AOJu0YyC9Kdnjx63Vsr5OwJkIAnTND1jxin/jXJJ+BVYERapIwy1/7RH gdXIP4TF5Hlpj2CYe0OxFLsEsCBskHksClPQNrM38yJ/RMrHrdSEvMCnhSk6VOZWCt0SSA4cAKt ypITMz0g= X-Gm-Gg: ASbGncvWkFwZY8n/KOqUPV1mJKO+wiJQufejnMBJ5JniF1O1Bhi1kajhu0qN6ufILPD clZECpMPvcMxDdjU6PQWlcb5ukPKqCkmlhq2M1cisqstacoxMlFF0iAwUPbcFowUxFGLVhqpmsc vMexa6TI7CP+zlOn4gsAR/SmGbdPkW1531tA2u8ZenPF0f4Jy/LQfgfGu7phyPhlE6S1pz5uEIM B4Z/x0HelhEhGBd1p5Xcp5qixjUZcRpxG9/HjwETpseKkHm88IeMKhF49HZVcYuIeSie0c+KXOA qAHfMU1tUyLH/YfeapBsGxg8+fovhZoT2ekpUdbLMQ19jRRJLE90hHZbWdsxRMKp4geHCGMhFXT DpuwZ8gCefc8vxUAzz5f5aXpDJA== X-Google-Smtp-Source: AGHT+IElX5MKHiC3QY96XfI26sd1yfDlci2fl1xXvaXb4nv1xUzmSNakm30i603iHoQRIxNyRWBU/Q== X-Received: by 2002:a05:6a20:7d9d:b0:243:78a:82ab with SMTP id adf61e73a8af0-24340d5e496mr33336068637.51.1756382934629; Thu, 28 Aug 2025 05:08:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 05/87] linux-user/ppc: Convert target_elf_gregset_t to a struct Date: Thu, 28 Aug 2025 22:07:14 +1000 Message-ID: <20250828120836.195358-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756382992621124100 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756383080; cv=none; d=zohomail.com; s=zohoarc; b=i2EgeY7xlUdRdKauRejTBYVp1TNSgOhuRO7LHZ/fHHpi4ojvdtZqK+F5F9jWsngRKtniifNctJAW62XVSnZJhNVq40Qb/bNSOel31alJc0U6V13Z7+jeQKZrVaizthEICMEVyGDEVOeGJnrU9ShIzUjXIAy/ZXMPZJ8K6dRwmPM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756383080; 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=jt6xNOoMoilOu9VAC1hwFlkp8outxIc7YKLXOAVEdWY=; b=g5eFy2hc41aCHGirTVHio2zyHPZ82fQ5hlLdu0ofIQ3m2pVj7+8HL4bNOG0vT7oKiNUpHE9a6Q1EmP4p4EIe7/B8X4esaSC32G1aJXRBrvIioY+LWbbfpLgKm3PDu4U+Sb2OfVLitpTcaQFhs8Z9NvbjTrdTL1+Z28k8TwTW5lY= 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 1756383080845763.0888649511318; Thu, 28 Aug 2025 05:11:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbRC-000290-Mw; Thu, 28 Aug 2025 08:09: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 1urbR6-000281-Lc for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:00 -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 1urbR4-00079g-HX for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:00 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-7720f231174so773388b3a.1 for ; Thu, 28 Aug 2025 05:08:58 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.08.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:08:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756382937; x=1756987737; 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=jt6xNOoMoilOu9VAC1hwFlkp8outxIc7YKLXOAVEdWY=; b=aUizyAgE7yGfVeBQxWQ87fpN//BuGGvGG33S5EkIkvYYtCq0hid2dA8V+8kXUR6ghj 96NxiJhlQt60dLH76s0+wM8ghFeklnLtJFnfR/JSXHGAMKiTZ/89hhkN4ThHRxKzaHKw pDRtSNxs9QGFZVq9MfR72Vr6NyPbpazzym1YITZtuCwyrlS3BBEHxNWRygwBBVbzZmH3 FYYGQ7n8EiGuaN0zW7MOpgcNXh9nZmysJD3gImf2GIOpTo39WbZLKK3c6ppuFM4MNefL 8WswSulbWrnIHi5YUa7GiUk5VigEjww4ULqq2iS0K/TR8OXf5KXxFc3HUbLrlIZY0ILB mlOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756382937; x=1756987737; 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=jt6xNOoMoilOu9VAC1hwFlkp8outxIc7YKLXOAVEdWY=; b=X5ysBhdbYR+Jj0JGEo12B3A3gdRQp9dW/sTrWeUd0Ty0xWS79FG4keg7gG836ZL6b+ 2Qep8QLxicxa2jaznJ+pOGhaXOszR4ogavlpN9eFPir3kAreBC9fC0CJbnLmIIMvb9wS lCGNhcsGqtrb7ZEJAHxhzZdxHXJEuLR4dAkIquv4ZkelhOJgQKogwSxcZ37jpwwVsx9b VpiCMLscgAEVI3kUHT9tD7fr0cITDGWDTZmQgM+NOA192ocHzUO+MTySaWJ1V/+SjeRy DAcoN03Dl3L5pq8GwohBmIDApmPKLrFPB6REAYtMLC7syXJsIDE/2rFycBp9bl/57iZu k5cA== X-Gm-Message-State: AOJu0Yy0haQ735kL5Y2zHeYKkd+YdtbBcxquOwNEhr25sIw/jTJVdoy7 OqrAQUhTVIS/gYkbmkGQieXWbNAUItK8JNaadEpv8+EmGgu9z59OmbIuiZHk0L4FC75/KD5QNBQ 5WSPBasg= X-Gm-Gg: ASbGncv7YHi9lUoW2sL9cEMUeFQQQu+Ve7+pkKPw7HP3yt8J376ZP6h7zXXPL2U/VF1 I6UnBqSOxxBnCZsvzQ9rTq4TZUOsAAPttIc7sbMLDgyb0EjYSF1gNQMWQAIFXzw9bRaShNAsaKS 0lvNmeG6RW7iic740g8xun8UiK+YgFjdrDt8pcSzO4r79sop4uq/R9fNJXkoB44W2TU0RRW63wX R6m0sWNNrNmtaRWi9CHx+LLwuJvBDaBFRQRL32oEchXWxiLNrWYGNYNWgCfLKBJWdzy2GLMj35l RWYPy+A6HSu2S7BRk46dJeZyfxzhc7ozLMhDw3GPA6IbSxTFjtpyZI0ODUHh+V0lyPV+8dGtPB2 vwe7SebTLKfXek2ZTGKFlpeGxAw== X-Google-Smtp-Source: AGHT+IGu90kA88csSRSdHO+Xb1tNz+XDqPWhtDquf7G/1R/W4ldgpf4DRyy5UtWkBKNnYUJbMlVe8w== X-Received: by 2002:a05:6a20:3ca8:b0:240:750:58f with SMTP id adf61e73a8af0-24340d91edcmr30379546637.30.1756382936912; Thu, 28 Aug 2025 05:08:56 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 06/87] linux-user/loongarch64: Convert target_elf_gregset_t to a struct Date: Thu, 28 Aug 2025 22:07:15 +1000 Message-ID: <20250828120836.195358-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756383082928116600 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756383008; cv=none; d=zohomail.com; s=zohoarc; b=j2sVhMstUEBxE3ljayoYVQkYBqYgrzNE/Qn73de3P8xbipUJpqmgSKiTQl9UpUNftmCiSojOIwuj4jiAYo09G03vuLV9e6uXIwyuEb45MXgpARAluUZsSNCIly866O8WJvkfoqCvtgszUm8WMr6AZSL3gBeNhtthgC8WxdLAeJU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756383008; 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=4nKfUoO4CItnglgX3ikzNqhJgzeUM5V1sWMeO8yPNJs=; b=Rzx46LZIWCQKxB2lAWiPr2u3JibiImDzr05fIBrADKc4yh1afEY5IGrY0g5XKr5cnqrGGYCaMyRuyAmZ9unptueZmXZ1fkERXC5hY9/9LUxfW7vTCeNNcQcyxrgQxAle4hJKfXAs42EwNBeINmfa6tIYonJMWdQGi4hloPw9JRU= 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 1756383008080335.19648839381716; Thu, 28 Aug 2025 05: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 1urbRS-0002Mi-9l; Thu, 28 Aug 2025 08:09:24 -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 1urbR9-00028r-JQ for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:03 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbR7-0007AG-L7 for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:03 -0400 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-248c7f955a2so8102585ad.2 for ; Thu, 28 Aug 2025 05:09:01 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.08.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:08:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756382940; x=1756987740; 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=4nKfUoO4CItnglgX3ikzNqhJgzeUM5V1sWMeO8yPNJs=; b=fT/20P0RPzCGIYIgNOcI7TmpqhNwGY9NbszSFnlmjVy+RO9HXSwuCuMWh4bLun3QMy YZaFlov4X1RZsdp21UvGRM7lwS7hFvb/qGG4dbHOvSRcw/wxnKFeFgyDE/PGObvz7H7g cf8d1ODLbuRd2iubIommCpkPofEfDapSy9lWNqmG3rdx4+th6iJdto7hMTXbdIe9C/s0 0xLQh/WsUPXHy0Mn2CBGcmcs2jLPm6BOuQNV7J8rJ25oYljSZsyUieNthGBRzgNY9kVy DwwZuHXTu4N3cRNVTRB0Mr77orC/nspes5etR51sRUzUdCLNmvwzWzvjmcvtgX5q3YZK QkYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756382940; x=1756987740; 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=4nKfUoO4CItnglgX3ikzNqhJgzeUM5V1sWMeO8yPNJs=; b=MFZve+eDgv9t2EewC5HuTzEhxM/gPm29vtsx4Gj8iCUVYURlwr/DIQhE1/d2s3XLgE 3D4j02bTvfPV7nlf7NFna21SwCAfBjjx3+kIYLIfmHbjbG6zQZqWbfH0w7QzbRdKWZja jS00cqNMb0da+sJx1v0Au2BUIImHsExF4ZjL409doK+8p8F5UJSU0lIh6fupTusJyN8+ mZ+25MVdtwrAXYtMSBW/NIMB/keaHsWQqxqbEuZHbKBXrahnflY6ZEKPGV7OaIG+bfVr Dg0jfOw+eD7pZFI901MsvbvghTWq5mtoBeSIpkBRMqXXbiPIYnODIhbHV04qsvxjpZkp LWrw== X-Gm-Message-State: AOJu0YwGqlVVxay/AbSN7HVdv2nLlGwhyfL0fYEhw98uLqXITS7kjhtn QLXzwfsIw0oVMR78/ihV1L/NutGMqH45dpP9Ezj82nGrpWOWzwHuOjfk3AoaFEgXqjX2Jifes7Z Jnion8Vw= X-Gm-Gg: ASbGncuC+Jdjmbr7EBWjMY02JNRdv+u5l/3eO9M/77GIPR14RJ8oESrcO8Zl1t3GFrF QMrCy1v/dkFMVr5KYDCJTNxiLjn+1WOpPfP1i7s7wj6i6COc8mzlHN54eVTL526wE8nnB2tQ1RM hnC/R8XAcY74T7IEha5FqIwcw5Sz/41EcBHcMFHHiqVpmHAg1LQOFYrOXsF49t3HlEV6Hnt7acg vCkqfECXjjeBle2PXH6ffgPxHZ/XLplbmpUBfiUr2R96zc9ohOh2FTuHL+MOpO3R+PQ9EHJ18w0 MFYvO2+Om/47w8M93DaT4WX0gF+r8KkEP9kO09BBotZQYNxprhZtWrJqSBccrwK2m0LEuA3Mtih LjiXsP5oxCNUjJQ5zov/+EFG18xkahbak4KU9 X-Google-Smtp-Source: AGHT+IH4RVfFqVVAPfzVfrXDiaE2lgNUz7SaUCKm40zfG5GVPTQ7lRd36fxjwJ1kpHjf2ZnS+CIqZw== X-Received: by 2002:a17:903:8c6:b0:240:3eb9:5363 with SMTP id d9443c01a7336-2462ee7390emr285781805ad.27.1756382939814; Thu, 28 Aug 2025 05:08:59 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 07/87] linux-user/mips: Convert target_elf_gregset_t to a struct Date: Thu, 28 Aug 2025 22:07:16 +1000 Message-ID: <20250828120836.195358-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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: 1756383010780124100 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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756383789; cv=none; d=zohomail.com; s=zohoarc; b=E+Hrq9rZ9E4rRIfl0uOAyaWJECJ6VeRETXH+poQDAz/h17wup05PFE39ccqmYzx+AMSZysMuTunqhLw6wvrPWFm7+h91tnUQPwWHAirRX4NzGQTwjPIN52gt90KxCOp3KuxZl8v9ChNHeVBPu9a/dv7aun+gGsUwbHDzfd+lB8Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756383789; 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=Bpn3ndLl0YF3E946zMM0StCE7xSTLDYDpwSUiHaH8To=; b=gdIm8B2s88sIeJ6sXO79U8AK2eOP67jzSKVLE+ZsjxR1TLYI+dKa6dQkBnATTFWgRheGzGgVnHFmxMC8Xw2AUuDHdiEWn1zaZBQ4ursRA5tG+RbP2ThpTuphAFbyBYX5Vrs85YtnPYSBZKyP7XNKGMzq0mJ13PxAMYb5wDI0Rh0= 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 1756383789982446.9543571981486; Thu, 28 Aug 2025 05:23:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbRd-0002Vc-Eh; Thu, 28 Aug 2025 08:09:33 -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 1urbRG-0002I7-Ni for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:15 -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 1urbRB-0007Ah-CG for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:08 -0400 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-7721b8214d4so471405b3a.2 for ; Thu, 28 Aug 2025 05:09:03 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.09.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:09:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756382942; x=1756987742; 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=Bpn3ndLl0YF3E946zMM0StCE7xSTLDYDpwSUiHaH8To=; b=E4eYy6T58BepEpKWyzzyjlDC565y72QP2fHVye3A18VXZOsk5GbT+VAfFohq0h37xG vuuxjs8ctQnkyeaKIJEK7T235tfz3EddlXroJfnleJPPkEksOQcWMEzcPXDBUCH2DfRO lwUgLSpbDD8u7PrmkCy/NwVRCRpW7x9zrZA1C+BWZd4Oafzik2vrStgZViO/0q1AzuXz 2Ehpdii3Z94dlbGCLEMbgRjP029nee+e1qHecUjtr8T3TErj9dmHw/zrJSKKDR80qYu7 A5yG141E58KUsvZw4XGjFSia47gdJ+axGP3wHuSsTSui40pTL4JDcCXcuzEq2emiGKNV 1Egg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756382942; x=1756987742; 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=Bpn3ndLl0YF3E946zMM0StCE7xSTLDYDpwSUiHaH8To=; b=IDvCMPbLEOFF1SwoPrreF2eMlMfyRJ5MbuovrHzlOA982KBNlXgOufbNOo3F/lobae S6G+nVyJia9JMmQAmP4SjCbPjLTbUBKXhWnL7V5HLytLfj8bbBc0H/Mon3cFwMLjkXBl mvWR3G090+tbC1GBZ7DdJE3DiHWA8SIhZybsI8+8LEvwB31aAQVHbotUSVVZ309Je2oI fMw1ptOhhBzqpPfjutaBpt2wnP/zzIbxGIRBt9e86z9NszMxc7vDt4Y9ZBKSNNnNkprC S/5yBNaErEhBVoRuIxlaOVTOFwZA7MAiHUGcRFmAeA27ewbwYWzK7udnoYFeKpL268h1 beEA== X-Gm-Message-State: AOJu0YxTSIhNrPRyob9pCAWVq54DWBHRFQ679758/twXy7TSmlxAGQWG +LojKIxjukDCWaTQHMvdgauwEUvXHM4GZOa5Pwl26Qn+v6tMeUOBaHnMtDKdh0krO6q7THHmGFV oZaJ/oCo= X-Gm-Gg: ASbGncv0w/s/efMqUePWSahHflCc1w9gswf+xEPIVg6Vx3eEh4HQ/6H9Pb95sHhb0ci PNutft1c+bEq7FSIAj8XlDxwLiUMe3iLjbEQS5E7xsacU7Sp6FdWpzxHL2k6o3C2jexIMzl9F7L IUP/S+OnbuJ7j6MxAsCG+iOtdNhoZcEkBr2DDXVJuJ3XlaawxCS+OSP9zH4raUTU442cu7qcQov /DkI7KF+0A+Es+jz0wnQe+w2nPkKiO1sjZtFEX1d/A0s1pmCaVQNTokzyIsaJnVS0EECZtV5W7D FvHRIwe4YF0WCAf2x4B73rNczF/iv+WN/s6NddMhrrV0H7NhOvdvy1jLW5SBiZJNyJcfVTbvCbG LDRL3IST1wTxU78HiqxKRv3Ekqw== X-Google-Smtp-Source: AGHT+IFw7XoO5zmgmppy/4xZJhN6VCg2wQtETdX5hIG4bzfB8o1/9vwunZB3KVABiPi0CHXrOZWvQQ== X-Received: by 2002:a05:6a20:4321:b0:243:b52b:c97 with SMTP id adf61e73a8af0-243b52b1499mr1426586637.2.1756382942584; Thu, 28 Aug 2025 05:09:02 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 08/87] linux-user/microblaze: Convert target_elf_gregset_t to a struct Date: Thu, 28 Aug 2025 22:07:17 +1000 Message-ID: <20250828120836.195358-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756383791292124100 Content-Type: text/plain; charset="utf-8" While we're at it, drop "pos++" and simply open-code indexes. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756383395; cv=none; d=zohomail.com; s=zohoarc; b=EWC4BVfOMl+RGNvEE7nE1ynPuKbIvRjr7x8ADv92FNRmZfcFF53cxoy9zVqUkuB+OLke0fZKh3Wa10PCFfv4P+H7gGstSCe8yS8sPfn63yZkflVCXYyd9sCZ4UKpZe5s2jFbOu/dOwJkFZBY20V/rewJ6pW5lWClPKtwvo01Oas= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756383395; 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=2CRS1yiQ3bKJdT/Rq/3w5P24gdaPGfDV064zsVM1688=; b=VSlQ0BBaYOaJyf8J+nKcHpw7L/7FRmVZfKhe2/sa+TF0QJCx6v7Oljxpdoh+ShzjDeNWm0uQ/n41CbqjKBB1SDQp2HzIcssPrnxmQdxiZeLg8i8p90l8lpdSE71SO3HyI91u824V0zH55A3P66AuQxjXZvOGQ1p7aVUGovFcNiY= 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 17563833949801021.1258896930688; Thu, 28 Aug 2025 05:16:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbRW-0002Re-BF; Thu, 28 Aug 2025 08:09:26 -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 1urbRG-0002IA-Ni for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:15 -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 1urbRC-0007Ay-RT for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:08 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-770d7dafacdso967621b3a.0 for ; Thu, 28 Aug 2025 05:09:06 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.09.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:09:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756382945; x=1756987745; 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=2CRS1yiQ3bKJdT/Rq/3w5P24gdaPGfDV064zsVM1688=; b=C7x0eU+VJrvv+K/x+H29wEK78AN93p0731xDkXGx7A9dw1RRVSiqGXGxRqN6pH6ATc 20gXlKdrRJ7XsejXMUAmGhIxI2Tx7AmEXskQNw8chKHQHiuJXrLKNTJsYE4C+6V7LE9E 5fz7Tc6f2zebnhuSCf4Wcpf00e0kpEaM+LqEH7r12jjPr5PFVCxPSL6GpqoVAe7TRSYB NIFfpmKiz/RTMNrsJDr8Frz1F8it11w8CcCrPL/6zfRQU1VaTC4gzS88tjIa4KYwHtuq DUHIjqm4oy4xR/pnnf8ib1zxyUCmXsd8vpwDQ8aPeyihH6xRVN4VnrKWL05OUA96GSHr EyHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756382945; x=1756987745; 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=2CRS1yiQ3bKJdT/Rq/3w5P24gdaPGfDV064zsVM1688=; b=FJqN+4EpTX5nvWlrj9U12JduMUENG+8LsZrpxFYjkh1pRLVN7CI7okGgCS8M4JOGJ8 M8QEVQ+1Nqelr7CxDxOLOggNu0iKFY34+dZAR+NxRG+aHGCF5UzSvHvF+VBn3qp+oeOa 3UUy/MQziBQwoCunLfCHmo/DFA+nNsvD9Q7MG9yHXCXGde1GhiP8KQoZqgSO8jPR5CeY dbQUNBosAyRxSUbTZz0TeI6MM1ZDgI5TjlfEAbScYWAiRoNSN4ldtg1tRwecXTr83NKJ 3croe72FCE853B54Rz+7sGweGOo7YrK1PasAkvrGWAVn8QhFe2fKdBIqYlGbutgRrJUF ThvQ== X-Gm-Message-State: AOJu0Yz1e5BNpMerPNJ4wLRiXZXTq2d6Xzy4ce8oVRSw1ZdFtFLf6kbW PqKfForBrs144kwywRmBPTt0wpIWDEVZeJ3F0dOYJKr61hD3rt1eg2uZeo5XW2m2a7Rhk36P1Em jlw0KuOQ= X-Gm-Gg: ASbGnctTYsoksFwNnbrJVjr35aPl4qR71yo57NBNUghJvT3FkKUoYkzvnKJQN4vajEu JArVvjXwWo2cF6Wv+yGYwM/4oYbM+UG0msh4s+raZQcYxz7nIr2XdNc1UrF7M1e19JODA8FuRl5 Vt4WwbxMXoxWyTKyxvDviOmElZI/Ykj61sH7rogVvfOU93uJt/O5NbSp4Lh4laJXTRYhcsMBINO A6gHH8+AEnCdmPVtSPJRHoYJLhWBfa6I+rOw7W0tfWsM4DGxkpjyw2Wm+CqFYdQ7PraXyxb+Iw0 cKYQPS4aiEc788mWhtlSWstx7EW5ENxx4ltdLaIcbU92QWBT+28Avg+HHHKWgG2Kkhy4Dsi5cWO S5M8ZeyRzoCW4kKU4/W/kt5KHtg== X-Google-Smtp-Source: AGHT+IHdY14ECQpXkSxZ6JMxbrYwtzQ+XrkIyTWKQNaNk7q8rGkK/c0Trcjd3oWs3rWkw8r1kl9uXw== X-Received: by 2002:a05:6a20:3d07:b0:243:b700:9535 with SMTP id adf61e73a8af0-243b70095femr992066637.52.1756382945041; Thu, 28 Aug 2025 05:09:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 09/87] linux-user/openrisc: Convert target_elf_gregset_t to a struct Date: Thu, 28 Aug 2025 22:07:18 +1000 Message-ID: <20250828120836.195358-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756383397961124100 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756383120; cv=none; d=zohomail.com; s=zohoarc; b=LLNJrrEyCBpknTYlM8LlIWzzyyCLRipDMXX2fEqqFwuY0vNJzNCOd5FhttCfYBYq71U5jWm/7y4xxfBYD4YVGEzNtorzq5jFl05oK2l2f1hzMh2l6dZ1O7oMPlL65PkWEUZZNVfdZVKjkm4on0YZc9KyEDdOkzTk56FfGlJHuzE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756383120; 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=lAavnXJ7yE/1AsmSwZsfUnpmtJ7slf2ooM6FGZiMZ74=; b=eKDP4bqhiF3egAIkjDWntO4GE8CUP1dd+iAsaGB1X2iOHUx/csk7iMKybSQ4W+jSj70HTNgY9REpn8o5zuqX4dLcNrIgXqwDs/lBJMqu+asEWfZE5GXIlOg5T4sxLJb42W2t5iPwOVbqLigJThS0dB0siPYO2jsu9mY6+FyGVAE= 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 1756383120296752.2462399720755; Thu, 28 Aug 2025 05:12:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbRj-0002fV-Dc; Thu, 28 Aug 2025 08:09: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 1urbRI-0002Im-NO for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:18 -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 1urbRG-0007BH-Gd for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:12 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-770593ba164so737513b3a.3 for ; Thu, 28 Aug 2025 05:09:08 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.09.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:09:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756382947; x=1756987747; 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=lAavnXJ7yE/1AsmSwZsfUnpmtJ7slf2ooM6FGZiMZ74=; b=rKgLoNeIWKXULW/yQBC1JdOcnrVvdUC8auawGuwnH/7TwKFmiksebMq/v+QH4uNMT/ dELnYsCQthgH7r97Bi7WpHMUoThjwU7khQLJdbkhReIZ7o7CxfR0aTX0TXR0+rjUKZ0q zRmJWbNbmqBGccaPfjfDMtFlcDrugeJjWVGeXxxrqEXFgacTLEX6P172oOqZ36V8cGYH Lp4mneeM9UnVgTfvTJHlQ41KP7j1e1ZbJOic5WfE/D8NmnRZ85YWYM0OvudGLCbfjZkJ y1FyZugL9qp0/FpruFBP+BQSF9ofAjCKCD6QdAwBHZybpZ8PGbKppzt6FJxWtSH/nSya GFAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756382947; x=1756987747; 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=lAavnXJ7yE/1AsmSwZsfUnpmtJ7slf2ooM6FGZiMZ74=; b=ix7B43JmMcuk1yRmerBY+HcjzhbZ2EUnDgmJo85RYP7JYYWIVLXL9boWdrgJnbJIEb haIKnQsu5K+5sYNvhafp3as0mdFKCoGbso+Xq9zHvc+QCEwLP5m2ohLn4Mgzvw2Hv2iS ZtAK39C/59jD6QTIFkRtZvhoU6ejOu1ZvqqhFBEDZ5ZV3Tk3DTn9d23HsAX20fkD56ja 7zZBd4hOV4C9AxCboBfYef+eCeW2g9JtlaPsI5oaNLIZZClP77nUlktji0I8sv7qdt2W uhyIDFoS3+ED611iKgssj23YQjk/mkYTXWOagPcwBRmY8EtxR9PQSTpeYDaCVDPJuPdb SAMQ== X-Gm-Message-State: AOJu0Yw8VuVC0fy8cPcownQvm1ydIKC3ORHIbRF9wpZpJn9RYMJJ1mqN VaDVOI1oyWkGS7AliCE4OI8grCDdk5Glt/Tpc2xqXRD63/ZFcVbn8nm5JEaUlI3dSGUd+YdQIG9 KSlbzEHo= X-Gm-Gg: ASbGncu61ODKczVM3OwEdXYLrtKRw00iXkotSRp3ew9J5skq+gHbFpS8i/gc/bgIGcn OJ5fCWNiV6VAz0QufZitjLvrHAI1ZLS/dCUW5XbFpl8POzbSsu2dM5MGR0dKSwWmttyF1koWpq9 4ihkqVxDyhMqQYVfzxSjkvhTwqAc8284tkdkbvZ3W73zIV7KzCzGmFoCVErnMbS4cZ0YrJ3YqF9 iVV8T0mU3pDn9NNrYAqHQLgPM1F5skOSyxr4PN0ypmCa42ROJcluGSuqDA31Xh8d3YsOUwULL0U 8ICcmZl5mN6kloHkRgNpO8T6YugmKFrFH13wBWnBWKBE16HJsI2OCcJut9x897GklUvvaKw9hxW mvZ1SnT8GpS+bUmiiTbrlrghPAHAa3qsdKbz9 X-Google-Smtp-Source: AGHT+IE6WAFc+Nkh0mo7jvD7njkBAPU8DVa/OBN/XtkQiXZXhZCy/HyYhNNghsb329Ld3g3kOexXKQ== X-Received: by 2002:a05:6a20:258a:b0:243:aa41:648a with SMTP id adf61e73a8af0-243aa4168e3mr4799163637.20.1756382947197; Thu, 28 Aug 2025 05:09:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 10/87] linux-user/sh4: Convert target_elf_gregset_t to a struct Date: Thu, 28 Aug 2025 22:07:19 +1000 Message-ID: <20250828120836.195358-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756383122328116600 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756383305; cv=none; d=zohomail.com; s=zohoarc; b=OYAqEEsiZ91kvzCoBYyG4qR17Vg7UZIF6C8wJX+jtze6NeInIK+Xc1M6fpA6O5FHu/lpcJ+JnhIsFNy1KCRtn4bZM51TnBjunQISpyzmiYrW77E8b+z1F3Mioptu7jG9G4h944iL6Lk9MUQzFfA2VYI1NA+Fn/M9U+U+qKmSg1M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756383305; 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=78SsRWgNmcpJ5cOXVIqKRji/G9cgJaA+IY6oItuUXU8=; b=A1DybGPB/mui8SPoLVpzL9DyLd3Cpda0P9+N5OfuO2Qt6hAaY936JZrelcu5bkWWEe+gRodGsp5H1AvxvIYiwWv3cjTsI8VQh/4ZYqzP5pziVrC+qNVWuOjh8hfXsF4lf0oX2wtgx0JF6Is3OoONBSI60dZfSlHFrEQZTptijSU= 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 1756383305725298.33542713193094; Thu, 28 Aug 2025 05:15:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbVF-00075u-9V; Thu, 28 Aug 2025 08:13: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 1urbRK-0002Ku-3P for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:16 -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 1urbRI-0007Bf-De for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:13 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-7720c9e2900so1073437b3a.0 for ; Thu, 28 Aug 2025 05:09:10 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.09.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:09:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756382949; x=1756987749; 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=78SsRWgNmcpJ5cOXVIqKRji/G9cgJaA+IY6oItuUXU8=; b=alQqZ+0l6h030LM+kCf9Nt/wU6/m6E76j9q74xoqdOqV2DQaORCTuUdXGPoHfrGvZh CEhDiMpbu8ZcP1vQuNOEsKYzx3C/N2wDCVP3X6m7klm+hy92lzh0VdM7TS05WiwMWaKG Lq20tjqN0/OsDMJbwAJLq6UuqnsOqHCpink6NI8J57aRxX94etAPCCLt8w8AXjyc9qhZ 09zSUYrFy2vB7WuqEH1TQg4XYB+R+3XUPDZRaXLNpgNmOkEELcwAzoIUjaZib/EK07Sy Hk2VfSSxthY7h73YsQMlUUniEE6dNT4juYfyjEAC0WrNPpMGwRxOxPCGpMSsGYwr08Hg wuaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756382949; x=1756987749; 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=78SsRWgNmcpJ5cOXVIqKRji/G9cgJaA+IY6oItuUXU8=; b=Py/dSSu+Re+8dQweqPqKZKDC/m0W/BqOLy7BXxblU89tbIZzXXZyXWyu1Gxe1ec/BO cas6PTBZjs4CLBSII6jL8VKIx7AyC3tgt3kwcGdJVRr9Nkq62InEmxFJEhI1IU4Xokgl BT8B8FcrCH1wnSf1zMb6hL4yAuh8KzQsEEDJWVRiVXIaKoW1Dw7L63nLPGGHj3SwZYWy UjF0SJD/GeTVRwo9zBNWtR/W2QrJ8LElxjsA7XI5hn3w7Ss03TNjBNfQRoSvsd9hZN5a rVJyLZlWLfQk+mLqMdxHAcG5SdW6jH8HOwL5zag432vBCtnRuDW2YIAd7Ps5zLZkjwvL +m+g== X-Gm-Message-State: AOJu0Yz0N0eas6BGRmdOr1YZ0qhv8ldYInLuXWhp0QiCRrhp9mGU1ENK ka869BDI64577d4R3/4GvC0UNBFNnrNX7bbLPDOEoqHxfBCA1Doi4blrgGMaP/ffp51zg3N5cyJ sH0zDKjY= X-Gm-Gg: ASbGnct5OU/pErq3iLfNRlIlKLY3qtRGYaO+jIdMhZIg6quSTvBhsrkpSTlV7WmubvR Z6zUyGqgwTBPCW1ujZRbNzBfrerqgydeeBPWawIOFFAKARsav5QOOFlWw9ldBOskpxDAZfhcGpj XiPsrlYoNRFE/m54budjmVOVE6f0DzLzlER3g9wifORRFQTn5HNRfxje2iZjs42Z+YYV5XQb1Q6 6hQtYIo6JHqGWt/OCpddbYDpgp7mWWyQncqwxsvnKhGwjiP1oxqD/uue+vDvy84mTPu0YFL66/j a/LN10mgMwQu0QJErAIDzMIZMgr6GDtzdPqeWU6QtEYn2F72U63Jg275X1XJzcz26k2sFI6qgMo VZNkYZrAJhRSYzuIEPQeffgwvoVmEnoae87RH X-Google-Smtp-Source: AGHT+IFUZWnsFH1NkCdqZJWtKxJzg0GW4jnvwsFHgS4EJLX8I0lJQI5kWGHa/Jnhz2KiXdZq/iXO4A== X-Received: by 2002:a05:6a20:9187:b0:243:b3e2:c9f6 with SMTP id adf61e73a8af0-243b3e2cc2dmr1509566637.50.1756382949428; Thu, 28 Aug 2025 05:09:09 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 11/87] linux-user/m68k: Convert target_elf_gregset_t to a struct Date: Thu, 28 Aug 2025 22:07:20 +1000 Message-ID: <20250828120836.195358-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756383307022116600 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756383637; cv=none; d=zohomail.com; s=zohoarc; b=m02LdFR5Hw5ciiyG8jXu094R6zS72ZqHOHUvDQfiVmIcqGk8xh+OLNx8G2YsXBmzP5O1NbHczJQIZIRSGrILaIKqUb4Z/dYFC5lPlAvBpIpAWuJnRoHw2S5FQYviNB4cmFZkgyhqh0dx1sZeS6JHJSAm82ANhNadK7iLV0MDuYo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756383637; 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+BKphQlDE3v0Pvsr0pykd32dlEjN1/E4DcN/dj63Wk=; b=WbqR+0321tYkkLvDTY/SdRXXPQ9DswrClPgJVPc+o3XqBErHQZ+jBBc+QXXgUGwBJvXC0RehEygmG+FNEsgC4soZQ1SzjHdQFPJlHB4X0OpOKA88vbNmN1tiMTEgob5/dtCE3e9vBHzZzYzA2G9nGL2rcAkZngjR3rco8Yk1dYQ= 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 1756383637302280.5313437906374; Thu, 28 Aug 2025 05:20:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbRo-0002tb-2C; Thu, 28 Aug 2025 08:09: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 1urbRN-0002M1-Qi for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:21 -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 1urbRJ-0007C8-CR for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:15 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-7720b23a49fso940041b3a.0 for ; Thu, 28 Aug 2025 05:09:12 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.09.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:09:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756382952; x=1756987752; 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+BKphQlDE3v0Pvsr0pykd32dlEjN1/E4DcN/dj63Wk=; b=wS5pHoN/HXQaGHjx2QGspZczuxfgAEJtCc2C7i4WLVsUaxH9189SPviOXzCttsNFmP ZvllqP5zOxNUsBs/JlCDz61mrvlT9jQc9jSplA7o8jTosx7dM4ndzCMvhu6fVVvY78le ZPPKPsv75U/FFebgXTUJVxgNRJrqRQ8R1N9rKuzJ8jOsMFw/7P+PsiubBNMLwwt1G4YJ RKRJ5q81GfH1rOT8sSarYwo0slLBp1EihtEXR6tzVgPsFM91OV2qK0BJuufKhX4eJ7le wEdDMq59cGu/GaKmvK5SbZYmCv0xzYGPP2Yf7C/b5zGrU8AlU/bOFMswaxIfEk0xs83X ai1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756382952; x=1756987752; 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+BKphQlDE3v0Pvsr0pykd32dlEjN1/E4DcN/dj63Wk=; b=bs/lXixkkDMZOGg7rRWIEn4p4wc+VSbHazQSWhj2Tzt2paHYo82xnYS5+3oqI02Idw DxsAM1sSFcgbK1QVWKjZQB4geTTcoazESHoVVFYCDBTfTeak1Xk7KUC6gCoZ+dU+VY+k MIGfBh0+vwIBGFXJ1m5AIt7l3swTp9rmOOFI4olZsHjmZq4ugF4aQHtoBbFyCi5AfFGi XzRvEAGaBYx2doZ4g26V3g3vbr5GQ5I3iBLov4DNtVWx1++EyNEgiruFWrM1vNr5JFdp 9z2Ck+wxDvKx0TS0fDAKsRCbTkjGSvWzaw9ESMwBVDB+p9NB+9Y1tsEP50kR+sLQ+aMC nHHw== X-Gm-Message-State: AOJu0Yxgd1Q//6HnpmPGuUtPUUaoJiPrKMcS2peiZ3dY4CnUx6TUnol0 MDhvJ8G75EyYGlrAZE/B3lCviRRl7XYI7Q316hcRvBoDq33FRwRQTaKigWO8/lZ3X8U4uS3qji/ dEJlOwRQ= X-Gm-Gg: ASbGncucWpA5FXpMXagm8IlipGlH+/SWqZDhmtNUsMpBQH+G4cNrxIIzNW+KVBg2imi G4qQKENNrRQqEEltaljBqGIGwn21TrJy09hA6lYMGrIq/aVj13N9fB/8gfwTJG4nrNnnvW8wDbg QJxBwpcfJqs4W7tnUcMHw9pBLsbGPYE2quBTPY8VZz8Qj1EwhtPnMmC4uGONppO1vtJy7fWldEe /LaX8Jl3QQo0gQBEV+CQNZASnM9k8/EThQ2d8DcUMDm1ds2y6GMY1w5rFx3M+RufHQmIpikorPm GZi55BcdUCPdKMswTpKUQMXk41JGCM7iogbrh/E0/DwZy/LhLcI24NRDSYwtQrdm3AzdxGlxWSk MKXaxr0ACGPKGyiewSUXeOqwaUA== X-Google-Smtp-Source: AGHT+IHOTZammPfHqjBbCPZ4QLGw2J3HGhFyqoPPcRLbZX0rPb/uMPlH4RNilX92cILVNBu/zfwycg== X-Received: by 2002:a05:6a20:bf29:b0:243:9c68:a031 with SMTP id adf61e73a8af0-2439c68a272mr7397947637.57.1756382951898; Thu, 28 Aug 2025 05:09:11 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 12/87] linux-user/s390x: Convert target_elf_gregset_t to a struct Date: Thu, 28 Aug 2025 22:07:21 +1000 Message-ID: <20250828120836.195358-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756383639408124100 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756383120; cv=none; d=zohomail.com; s=zohoarc; b=SSlP2F8+007/GXg7UtVy05Q51QQZZZVG4scVC/LD+DwTzS6qnQ4UtEzvcwQmpLuu0Hiba2P3Ee14YbvCdJ33o6TPbSGbuCcgQpXOAidAowrfcikklKM1N5MKDlYXomdP2TSULJ6y/b3DuAe+5/efzZR3ZHkTfyjLgVEv/GrSPuA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756383120; 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=18XPWlgCmnlwnh9DfuZh3Fkld5xrETQF6kR7JJI1/ao=; b=nBg6uEsO1wjCbJFzxN1kHgU2bZmreZ8l3g5i4aCyuSsxxteApFQ2aCUmYotufoC0b9T076rqWuASB15mnWxoyqTKNqfr3bcT5NTsWKIC/oWHWZxvNFnT3dEb6jTMgQ2P3BRpeVh/nIQGJ+ttU6KNHDbq5u5AUTXLZcSYyhZUOSA= 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 1756383120271243.9153349288706; Thu, 28 Aug 2025 05:12:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbS3-00037J-73; Thu, 28 Aug 2025 08:10: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 1urbRP-0002Mh-BW for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:21 -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 1urbRN-0007Cb-JC for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:19 -0400 Received: by mail-pj1-x102c.google.com with SMTP id 98e67ed59e1d1-32326789e06so766631a91.1 for ; Thu, 28 Aug 2025 05:09:15 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.09.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:09:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756382954; x=1756987754; 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=18XPWlgCmnlwnh9DfuZh3Fkld5xrETQF6kR7JJI1/ao=; b=bZqd0YylapEYMlKe6xA7dNnbUBNmXWpzTgD3l64rM4ln6pOp9CAkNCqVLq6LK5PJLd eAS6idgs/Y3qpVWWdoOCWJSJys6CJE4jIkUquMJeQ8K2wcQW/atT94Nny1pwJr3Su5py EovplQLYUZ1xUspAkSUUXY9Y6YCPWf5c9wD/8EncxXtfax9HMWN+eZtiKHX6SuZM65cv odzOR0QUiadYA1a40HKetWv5GPb5/zkzMjml7kVVvjYmnxc/UKSwQwIstHu5y3FAAXXU Rrw+WjORi+BFf+QpeLYIp831vzamgO5t/n+qBCf7sDr9pJ3RXxtT/GnhBbSFmxV+JK+L kipw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756382954; x=1756987754; 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=18XPWlgCmnlwnh9DfuZh3Fkld5xrETQF6kR7JJI1/ao=; b=UzXAFwedyYBuxEoKcf0H/u8X1/BMngbGRHGshvsfnHHHI01C9/LIdQqsVxvbtnIaXO vZzhPko7dRyBVyfyFklrcMZIBtm7aLHjIMpEMQZjCc8uEFyGoM52r1QlMusapkckjPaa XPuaUXQgAJbpNyYLicAEORK6YxeN+NdlV9AGMc71PKOMVVqAgcagdDtMyW9984MmeTJi OOmXBsjYE2UeQ3oETDCJKgAmFmxl7dSX117hUHYmsutQrJ4sWDg987nXlOxGZxadSjSo TyH5Gnyq1y5l2SPxdG2lLRa5r1/VOE65rRjqn4lomQCttlTufLT0tQwbiO87pnYpnQDE HgJQ== X-Gm-Message-State: AOJu0YzQhhS+RqtgQSO+2ocEbLUj8j0g8SXjY6e8l+keB41tEiKC7Stz TxLHe7YOIsayBlCRBxwn9vH04gid8AMEF1ItqBKjuDkYyl9MJQMiaQWJROF/BGlqi8w+FaqCw4B cAxZFfJc= X-Gm-Gg: ASbGncs+7v2Hq/xe3QSwoSYug/F/8kSpB3xtm8jMavwiEAFlVDauBoUBTJ1P3Ni4gIA 4wO739uLspgfSj1p7zSontMr6eUvQR+UtWMMzgOend7jA863/MA0IGDl/93qsIhYGcQv6+V6mXE pNl0HSVns1g9vKrHLkZpWAVvk0uIFNYvPmEb91jku7PAGqbTaYis+gN16Thm0Y2M59DP1K2eetH jF5LkhF4Zy9IP3ZgkNJGFEtnfGykIT3COnamMvsgzrsda3aRpew+TV3Wo7liWo9oP3ahV4bX/Uj bK8wgB1Lst9wcOyFsYstQ/4/ftyMtKaxAphvuh1Dpb5bXmksuWRfzzQ4QnawEFMx0aH5AIgm3ml xl03xjaiIx0E8JDc2gId4eF4dxSzwevz1Dlhf X-Google-Smtp-Source: AGHT+IG06hEeov2LGQ/ZvnPiwVafpaWWIKkD2q6PhiGtzM0JpaKk0vcqqufEKEiQMDElxqVJwRLROw== X-Received: by 2002:a17:90a:e7ca:b0:325:7825:f5a3 with SMTP id 98e67ed59e1d1-3257825f735mr21511086a91.36.1756382954029; Thu, 28 Aug 2025 05:09:14 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 13/87] linux-user/xtensa: Convert target_elf_gregset_t to a struct Date: Thu, 28 Aug 2025 22:07:22 +1000 Message-ID: <20250828120836.195358-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756383122333116600 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756383393; cv=none; d=zohomail.com; s=zohoarc; b=fKLxInCvGfJEDWlpYXomo7my3YMTGOpOPZOVwKWQ3WenXdZ2/E+WBoYrhKg7uyr4cVt4zMT9J129nj0w99RGA/VFilfsw36xW/4QRzjM8Z+QNqiFz/uk5QoSsWMSrUHaVGn0ZPRmmlnZLpNUIr3hFRTQEkSB987z8if7S2uWjvc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756383393; 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=bjEwI1V0xJg5eU7+azAEOYSVdnzlWFhERe/P45oUe0Y=; b=M+GDpsxgBIXKzmdxMogUs+JDCa74KyV2fWmqAB5VrW9KAlBSY4BVoWMDZoaMmS4454VAsvI9vFAvvvPRB9vQSREtHNh5HNnsBirgQcrw39F1z1EdLSD/e7MeKiND9oQdK2H8CWZSQKv1CJO1YGE90kO2aUnIPJpwB9TjYAh1Tck= 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 1756383393728297.227350997165; Thu, 28 Aug 2025 05:16:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbS6-0003Ca-PV; Thu, 28 Aug 2025 08:10: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 1urbRQ-0002Mr-34 for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:22 -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 1urbRO-0007D2-B4 for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:19 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-7720b23a49fso940154b3a.0 for ; Thu, 28 Aug 2025 05:09:17 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.09.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:09:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756382957; x=1756987757; 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=bjEwI1V0xJg5eU7+azAEOYSVdnzlWFhERe/P45oUe0Y=; b=nVYKZJSwzjk8mRtqxyHoJeRauJVjB/lhFPmA62unfYW6uS9iXxQEWqQwh40N9Xqv0y KF7bSXxY6WbnhCt5CaFEU536qr1DD5/anh9mHAQpB/nyXotrcSidwOjMfrj4xw8VQzgf yUhBXJ36v7pViEptUXM5ECviIDZz3amjQoq10n7J65FqwxSRVNrFf6gEeI0FC32v1rRp Du0OUWXi6j4R4ZONjC4kW+nMXlQR3URRVkpq8gSW1oNS60X/keP5Aas6LZ8GGspolVbG rN1FRnh7UqE+jhR8m13vTH/6SGDshvNF2EyecyOgJFHwxk8B+kXKAhPZb0xlh1w9usDC 2EZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756382957; x=1756987757; 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=bjEwI1V0xJg5eU7+azAEOYSVdnzlWFhERe/P45oUe0Y=; b=I0QDqj+TYioit3NnYV3Jsw/nY0c2nJkXgPB7yYmmdlBFmhyEEAwiLZBpkTVQ9gP7vP QPcbWIxlWTo1lQHTURMrO2CDLLlekoiol6Pa2UPQGw4O/zTFRVnj26U7EKW3vnoX2rJC 08vPIlyx6eY7Hbr6tLzEXuEZ+R+niMdFSJnLRtnnWymKUDo70nWEeVnEME8oTgMhSL8Z 8nxvIBgagDvtM04INov2rki57Ik6rkFM8QqkMTvZQbN82xQcmh/kaR34rCnjVRVHZC8I cwQkPIfHz5yJFhn10f6CwgR0nkpmElbOt0fk/xMQXJ/P7PSoUO1Ppv0C6pEIItw93D3z 8LuQ== X-Gm-Message-State: AOJu0YxXINO4EHtX0PwwLUOrObxNbznuveT7n5EallcMZwbY3ARVovRA CFuR1/DdXapy+lfVY8ryFAanSzb+2IOfi1MLu0ZBnqq39MdpdgXEsv8yRl7PSLwzOLicZIcR51T ktCusvIs= X-Gm-Gg: ASbGncvPbsvrO/5ZnLBR5JXVuNzS0iq9z3J7AZTMSfpMeJH3CoH5SJTGSF0sIzYVMWt tPGfxfocVQKfI8RWBktYnZN5Vs3BpnoM/KXiQQtwMBGMjnz6bYRazw+wh9auYFCSfk/yedC5l0D Q6dJQ75Dum6EhpjDXnhHWSqPJcLmjiCvX88Ai10yZIC8Ng1UeoXe/LLh4HUUm9wfeemrEtdgsuk vKWqUFePwklChsJAq6HUNkYuGP9wM6Mho7Lr7RHB9sjGr27igcXW6V2BBMXymvb2/zYrsTuxdfH RwhNwANxibPouatKJitVKU++Vvrnc7ZoG2ceCxGq6MegN/KFlIgmns2D04euasHuCTNKQBvFj9W h7/16ykQvIVKg73swD4044Tqu1Jy/F2AjggAVfM6dYKOQ5ts= X-Google-Smtp-Source: AGHT+IE91wV+wKVAYbBK/OswY4S91vIJmmgkrjNrTU9aev2gux2NPPNPW9PN75GivPm7SDAq8Tz83g== X-Received: by 2002:a05:6a20:bf29:b0:243:9c68:a031 with SMTP id adf61e73a8af0-2439c68a272mr7398234637.57.1756382956472; Thu, 28 Aug 2025 05:09:16 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 14/87] linux-user: Update comment for target_elf_gregset_t Date: Thu, 28 Aug 2025 22:07:23 +1000 Message-ID: <20250828120836.195358-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756383395728116600 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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756383478; cv=none; d=zohomail.com; s=zohoarc; b=NZF9S58rTGM7SQmFFiOSHqIWIgdRNVt8pSpbUF07Tlmo5ZPN0YCvZKShtUkozL8BZsXHt9is7PCr2ZWOxjGduK0gKXbVF5fnHRVWei2DS/arL5uFAxeS2ILJWw49n1P3SjnzdTfr6bz3kW9NGMq5xLOp6rRYuDizLRUoSSAhoBE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756383478; 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=tO/by0/tbmDYzcjyREljwjFXyz94mevqXElOlRv7pZQ=; b=FlDwtZWw3XX278WdSOALNR8u9CDxuM/VGx4Z9ZoN5qv1ZZ3w6SQPfeeLgNT9cQyef6iHpUH4gY0EvrrozlM/32aTu07DWXmZQvAmnkAC6RxAByphWxbsDKU4lhCHGcrCoR8YPKjHkuqNirTupys+TyW/zZyvSgUWY8KjV2z9BaY= 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 1756383478131150.46159875325952; Thu, 28 Aug 2025 05:17:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbRy-00030v-CH; Thu, 28 Aug 2025 08:09: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 1urbRT-0002Pa-4s for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:24 -0400 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbRQ-0007Dn-Mf for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:22 -0400 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-24633f57e0bso5527475ad.0 for ; Thu, 28 Aug 2025 05:09:20 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.09.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:09:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756382959; x=1756987759; 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=tO/by0/tbmDYzcjyREljwjFXyz94mevqXElOlRv7pZQ=; b=Wjyx1BY+F3fy/ZXRHaHsd3U/D5DUHLmUy3hVSbWlLQTQczbD82kES9Q9VigPa3vQeK OQmOe6Tkkjc6RWJkcYiK+ynjUb0asywmYBDlIk+IuwYRP3zAdPA0w79FQdZX2ZC3fx7T b+DJYg/SzklJqNHQgJ/dEfSswlY0S6l3OII1bylsVKF4JoqE+6YFoVKqSdOpViPxFfOl VTHcNS8pNJN06GugMTJhV7BOZgZWif86SkMu96AejWHCj+ixiBlY2/LOIZjWAKE8dzQr rd8utCTJHg8BbXC0S6UiIGwuGNVwXCJJLebGGOP5pGpwkD6+XPPoXnDFMDhHYRA53KEO DRiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756382959; x=1756987759; 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=tO/by0/tbmDYzcjyREljwjFXyz94mevqXElOlRv7pZQ=; b=hlbAstOW1mpf6thh84VYhy7dJKIgkYSvE6mgysGEllS7qbQ+lv/OBYIlCwX8a8pJ6f 8luVb6ImtCKtrR6rXPtZFJTV7ssmbFDd6Hr/hSTwRobxNi0vsexxAM2eYtg9ukkCwdTx P7E8Nqzue6x0WcOIxHLuE95qV4aLhKhc6x1XLYjJsYphBQm+vNeqgqlyqNiwU8hLuvYx LOXRO+rSpsPMf3Bke0PtXRQs5DTrsffcXwqhXzULrF1rT7TYmupvXrbBet6eDGXCjlL3 dmLlsbkw4wWbfsJ3waYDqtUJx7BJ3J69X+Xe0SbZ/ioY7EmvPLpMkYhWi368rorRnkDM lX4g== X-Gm-Message-State: AOJu0YxK8gB5Q+bxeMe97rh5vS47dS8t8Y++wMjChDra6DukcWLDiN6l Vfgax1aftg4b2Pa/RtUBcXjIw+p2xqAd1BaByB9oHh6pE9LL+IxB4rEIDvd9I5MepGaZkRqQjpW XqK2vs4o= X-Gm-Gg: ASbGnculvu2mGUHGYYorL6n46ne3je88Ad9D9B7gA1RutxUuxsH1nyf8PlzerWTazRR WiuG/Y1y7h3apNNKVtsJuIoaNDdMTHpNCH5PpgtH4sTz4RmIvtR1iO5JjuqKEWxGLQThouwiIrX L++IeTKysN/qL/a6GD8qpWvo/MUT98Qb3NDEG7apR239r1MCvTDXHvEHBnKMkoCeDrdOeYMXhEc 6sO1YbRAE4MoLs23muh3iaCcnXbk8rk9sfiGeHQTOzXm39XJeKWvESHGxv52gPlI0ea8QxFNC/w gHsx4XfqDPgfS7jK+Xqf6iZ9ngjfUofd7Dsvskiy+Bl/9kqeG9P65eac39KfMq1y6KT666I31zs Ok+mXPJHV6SLb+xI7+h1uSaDrjRmQOnEFZpmm X-Google-Smtp-Source: AGHT+IFCCscqizuG84u8Cgj0RJPdWFTw/+uqtp06faTOZEsqP/+HK/4mE3bptCHwBtcbyBw/xkQMxg== X-Received: by 2002:a17:903:4b4e:b0:248:d49f:1d71 with SMTP id d9443c01a7336-248d49f244fmr26198215ad.60.1756382959090; Thu, 28 Aug 2025 05:09:19 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 15/87] linux-user: Declare elf_core_copy_regs in loader.h Date: Thu, 28 Aug 2025 22:07:24 +1000 Message-ID: <20250828120836.195358-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.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: 1756383478829116600 Content-Type: text/plain; charset="utf-8" Drop the static from all implementations. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756383800; cv=none; d=zohomail.com; s=zohoarc; b=EG+n9vEx6FCQqNXg+1LGZXloWCZliHQCVfUeRGwGCS7lahiOO/eeSmUvtWBjtjSD0IkNzcvZYdAegyBhORFi285dlwmtrele+AuCLKFB0A+sLTjrcuhFqd9Am26Rj5IpxNiJcK+Ih5jO1XQjldE+lx0dqR29yUdo5g4Ps2irM+c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756383800; 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=qjOAYz6KTtpZIgXmQSqo2WH3mmuF1FrSZppcDhCyxeM=; b=ZvYNLXwsb+opBF/cgiCJEdMK9ZSPtNYO2KEohbSEyJsZ4RxHW0uLtGIi3DcYPxLseYU5yLJWCJzzcvHGZ8cGcxpvzzjohisB9El/rC8cPsrmbQnHkgqs3pPsdJlASjHNRFJ3RlplXts6FjTHrtkZMLORX0j2OPbxnP+qICSbtwI= 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 1756383800129493.5364905146955; Thu, 28 Aug 2025 05:23:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbSn-000414-GU; Thu, 28 Aug 2025 08:10: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 1urbRU-0002Qg-NW for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:25 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbRS-0007EC-PR for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:24 -0400 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-2445827be70so10105395ad.3 for ; Thu, 28 Aug 2025 05:09:22 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.09.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:09:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756382961; x=1756987761; 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=qjOAYz6KTtpZIgXmQSqo2WH3mmuF1FrSZppcDhCyxeM=; b=v+OziQesFg9hEzPru4bxtLe5fd5CvUf3WgJh9d4jmSUq8J9nwdtt5j+HtV2aaRjX7T RVPb431iJ5AHCOFbUKTG8qikMh89ao8BJCIomUX8Wbd0eQvaYELTkW+QKqS7YW9XM9vc NFcwpKHNn7PYdLLbRiVHxww8gfCJfZYQdqV4O9Wm51tVf5Bass9WKjYdB15eM1p+vJjB SgUNihMhb1FILmtWVgFyWc03emO7lHEbKl4z6mC/nP8T9mGVScvUEIXdS7eIw3fSE3OK VgRjtUAKeWZVICJ87z/gGTcWdMsc5oFn7qW0EG3dCmehKAyrXb95e8s0FA9bBlZi+BA4 GPww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756382961; x=1756987761; 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=qjOAYz6KTtpZIgXmQSqo2WH3mmuF1FrSZppcDhCyxeM=; b=oq2Iq9+e+CEPqJ9kWwQ2diSPHYiU6H5v8b+/A7909qe6KHK9Q9cUIfS2vqEIAMGLEh hxPmJNpKDH3ixAAnKxbItL297arvgu45V+HlvGoXBWDXX7QKOry7rlLD6dT2d+c7YKx8 bHIDjAdxZ6UlTqKUWFpG8WTa8BFgW+Xdh6OKdb+RryHv5dgCLiYvulu3RyiM7MvYbHv+ B2g8ymhxuUSHp8iLvTTthito117TVt6sw4BPB+/N7BTX76ATwPLqNXP4nXvZ2Jtfzroh 8dLEUNSVOl66gKuD/rtRGXbIx2aRwM+SG/+6WBHxbbcOM8o9EA2rGxNfzmKISTntzfr8 Z+VA== X-Gm-Message-State: AOJu0YyleHpAmiGjylhaS3TVsKSQRxli8NKl9ACdE447Z58q+I+ETDx6 tRdgfxcQuMu1HdCfLf2r6ceiLEU5/2u0mv+JDeZOxAF79a6OhjqtVdbavkaxJRDaB+AuDArx57r bC5vmBVk= X-Gm-Gg: ASbGncvujpNSp7LjHH2QwHPDBF3zyIWdOphdUKBaGl5vC/IIVYJH53O7mlkP6MAGwX/ eDqhsshZXRcE4ZueVYg72q6JvLwaqHANKXxKCpj2g2SnSih4/e+FArlARReQcdZ9nGkx79gUGxq VEHjT1p8NMpFUU5niyFV2cdNHRIRhJV6fpwXPn6IuFJcN+S+13SEE5c5sLdvPRtdOPiAQYTxP+M cuJLeGZTkC6QObPmEtvaPoQWZHU6ZJpiCfrZ2dB+7xR+/erHVXhvg+RiSaAValay85DTNdnwvps NlrSEzTq/9qErYQEd+i6GsIOM0BBdpP0UWuSgHnWLzHlXs1wDHnT4nXb4j1c7zJbnO7+1h0xQcO +c2GKDpNueng8ZxQ7mXWB4mHxtlVVK/kRIuJ9 X-Google-Smtp-Source: AGHT+IGjYrHkL4I8gBfnQSotV9uB86QSmOsITPeOuz02W3WGFp6Y8sZ3E1bR1mE2L48/NhyAwbkQFA== X-Received: by 2002:a17:903:2441:b0:245:f2c2:64ed with SMTP id d9443c01a7336-2462ee13160mr321037795ad.24.1756382961182; Thu, 28 Aug 2025 05:09:21 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 16/87] linux-user: Rename USE_ELF_CORE_DUMP to HAVE_ELF_CORE_DUMP Date: Thu, 28 Aug 2025 22:07:25 +1000 Message-ID: <20250828120836.195358-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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: 1756383801530124100 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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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 1756383806333701.6395542733468; Thu, 28 Aug 2025 05:23:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbSn-000413-HN; Thu, 28 Aug 2025 08:10: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 1urbRY-0002Vd-Iz for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:30 -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 1urbRV-0007Ey-SA for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:27 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-771e1e64fbbso1020161b3a.3 for ; Thu, 28 Aug 2025 05:09:25 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.09.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:09:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756382964; x=1756987764; 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=kH3xjNESjuiwMVLt0f63naDaSmmPLkDzFn3hAYVRDFQ=; b=VRqU1SqwZyUlCDI8PKtjwBp50DIpQZTX94Rlq5E8lWJovUSMseCQOr+SstimZiCh3D SXUkbVRADseLZ/owVsT/yQtjkzZorsWZI2diwY6TSQKv+9ncf1zui/Kj1uUnqz+h98AP ZFhoWVUbHBFb6iujCM6mNCCiCQLobbEPaFJ5OQIpkJMXVlr07g206mRUcrCDwJ+m/6Zb c9zgEzOSFeA/BWFX5/ZwpZbXsJL0R3UVS3GbsS9ulZIQA9FGN/vJjhuNPEupX/tcfxt6 9HMSIkwkHpvY+xLy4DyNDh+ogwwkevr6m//f7KIoE7PuAK01AfCTbmN/qEv8T/adhERL k8QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756382964; x=1756987764; 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=kH3xjNESjuiwMVLt0f63naDaSmmPLkDzFn3hAYVRDFQ=; b=dPe+o7o4kAWnMH5nBL4Us2GGiLTRp/nBAiBTprs/2NXkwEMT7TgjY1wvfRovKty6rQ wKB0eCvGjrEqh9oh51rVBOnxf00i/QzsM7moksGu44D5+FVOPgskXLznJyh+4ZPHdQrF zLMxp7w4RWesEneVqfOoIs2oFwnsfPlbJKVzYDKwgfw9DA5X0lUvvnFou5ceOPtGdfO0 i2O1EwI0bxPpScO2hCIwze453ZAIQ2RDHRM65/0sopBm9Ro8qgc0+WXN4mgSEolnxyLp X3Tc0rXkJcRVf1sWwM/usTQ1VArgVxbW5JxUaukUxRJVS6nen3cpYkdM0cStXG/9ne/4 9Ccg== X-Gm-Message-State: AOJu0Yzp106bxyK/72SCojyXrPfIdkY+i3GjM0Cf0bbh6R6dgCQjbC5n WsilvQc7782O+VW01s9z/yZc3qcdivuPbuGTAi4NDc9ayQ5UYtbWAm5el/YcytcGwM3qYTsF1Md NK97AB/k= X-Gm-Gg: ASbGnct2r4YT1r6nxlG2LQoIpNASpTSAUmluKy0kazDyl7G0Tf5moKTNN6uBrb7n8uy tEn0rDFcw7u/UB0B2OMyJsZCILwJvHb5YuUXxNa3Zkon8+FfKw637lx3ztXf8xNkmjpNCOR5vM0 5plRBrFxCp7cUqz9xMLZgiME481XO+Ye1ZdPBXLacTvaijPfWHZwVo24Y7cNtPaoJrWIBf7/eab fsWe1DrA3NSIVRnjeJoq4MtG/DpRRCckYzWflsfMafm54s9TW4HAx4/pWRYd3zHrX0KCxfXTg+N T+zHBD887iTh4FDLIgbfdtT70u+hl35D4Cs8yqPuXrAsQOQKUsrkSuQ3EEm/lidy/mzi8sfqGvk pWsA++laBI5z8r4cuGCfJ41UEGA== X-Google-Smtp-Source: AGHT+IFP5HaGEbcNWl9IucnBheTiodu3f1PhJ5Ewx1vrTL2AgeV4E0xh5cjEW3M325P9Ztprb4BFPg== X-Received: by 2002:a05:6a21:339c:b0:238:351a:6442 with SMTP id adf61e73a8af0-24340d5e23amr35720837637.45.1756382963771; Thu, 28 Aug 2025 05:09:23 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 17/87] linux-user: Move elf_core_copy_regs to {i386, x86_64}/elfload.c Date: Thu, 28 Aug 2025 22:07:26 +1000 Message-ID: <20250828120836.195358-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756383807487124100 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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756383122; cv=none; d=zohomail.com; s=zohoarc; b=O/PtO0/fwOaD+ZHzPeic1IloteifzTbrGaxxi73jzdSfp+NOgD8alKvoZJo7aAoLdHi036jtrmFp2RU6J3dCzBH/DQ33EBdv9UFQCWD6otj5QlkKON6Ow1QYPdWGa/x9tdhY4Phrjw5OUb8TQeDU0VJITeXaKTBPv8MIvyEysTU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756383122; 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=3laHqYMdhPtHS/EPyIfDpviVzwevLC06XVpJpqY5Kc0=; b=F8rJS9eY1ZDmybcetCux5Y/nKmQ1rIwSNOKz9srVU5hHtyJNpK1YGKzem+Onr6jjGobgwBL8a7T1sfyW2kbqfxFPLoUiYWmEPorkhHSvfF6tyosHVXprfe+x+/NKjdc0F6w++rSyE9g7Y8h4BIznZ2hvi1YqIG/4+fgr3ZZZwhw= 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 1756383122958917.0837702476038; Thu, 28 Aug 2025 05:12:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbTk-000521-7d; Thu, 28 Aug 2025 08:11: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 1urbRa-0002bs-9b for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:31 -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 1urbRX-0007FK-Et for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:29 -0400 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-76e2ea933b7so733901b3a.1 for ; Thu, 28 Aug 2025 05:09:27 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.09.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:09:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756382966; x=1756987766; 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=3laHqYMdhPtHS/EPyIfDpviVzwevLC06XVpJpqY5Kc0=; b=ZIhJJunadgBN/M8mWLl8E6Yt3snPYpoLqM2OrqbSpo0TpGyk5ph6oOzZLnaakVnFc8 ljNfIu7iVi19Mcfr7B6WvgynItM+YQogiq8J+VRbWeR1lpDRYGIROdStWDBIkv4FRI+N koNG5jsepx3aK/j5E5KcgEFTyXKNyWVsgCXzWhc8r0z+DE6tba9bo3qjDPAFu9UNkLDK KdbjtuV9f1vWoAOHZZHhNH1aUmd2WuOjkPRNVCEye91RvVnT8kX8KibNZuFgAj5oRlNm lZfBZ5Pl8OES8d0sNYd+woG9i35JjQTepJXzt/umyVnsvd7HwDQAH4DeChL2ZNVjHUBi ze9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756382966; x=1756987766; 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=3laHqYMdhPtHS/EPyIfDpviVzwevLC06XVpJpqY5Kc0=; b=HTvN6eRMTz5X3ZHrPO8U8+6qDUkwt6DHBHfDGbOiBCVuGJa6t2M5uoTT8zktP/LY7x tVaOaDFzStKaE04dwOSYc72KjAFdb9F/Y9/D/rcbJNJDyDcJm5/qZVa9WoZRXxgcDM+1 cSesH2PBdx/uw696Pt9Y8S4VoPSYBwNlVeHzEsS4jN1v/I3OZOe5+W46k5w6IoJ+Zn+1 plybV4KBAlZzybZFVlx4g1+MuOhDf2iGrOTn2BwzBm2yhQWicwkNbmpXaRVYlsRqnLHu Qf5i9NGS/4Aun8R+QoCS3uY8Axs44LgtTIeqzypywsuEqld73GqEvjpnI9TS55Jl0SZZ 2CcA== X-Gm-Message-State: AOJu0YxDqM+gs9uGhS4grR5DAjwUc1XaGmuIfhQg7H6v/xNhNhgDK2Kk +pFr77rL3aNw3io/0swHKjkcQa0jucqgiuBhEKNQDzjLV29fI8NlXe1IxRCYFC/fpZzip6nZ0Nf HwKwdlAA= X-Gm-Gg: ASbGncthLLGOaIuWMXL2PxwIT/2IFNaQAFOl3oHU65hzdb3MwFyX7v16/9YFiZa3c3T weL7na2MWmjEa3il7C/j6Na8zX9PZ6A3RUYprFLb0UrzIKilzNnPotlwr1ZHUriPhAX5uZKIMeR 8WpfKM/mknjugykklE5UcVYg0uS9FcKtW5hqdhy6npNo5kvg377BWerPCRrNP/fhdAjXvgvA3f3 FnYoJrIwyW99eNS8kheAYPspx+OfHR0dXCON4lJGsaLah3vrTKzuAvgnyDFNbsDCYjo3/TjqEJC PY4P+FPx3MkekwXqGKmyvTPrzgWQBQ/z4li5IbWdEkwkcDOATktXLbaiiWM/iJAwoPH5RG8KRzU 0jaY+aZ3iY8wXq1d4XbWW2rEhiQ== X-Google-Smtp-Source: AGHT+IHmptig2elKG3k5GHu4A5RomhtuDFIaQoNXBgHpeoxW33NXRieLJivQTBDpQSpmCgp5jXwK8w== X-Received: by 2002:a05:6a20:6a0f:b0:243:a9b6:de9c with SMTP id adf61e73a8af0-243a9b6e0a5mr4807869637.24.1756382966044; Thu, 28 Aug 2025 05:09:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 18/87] linux-user: Move elf_core_copy_regs to arm/elfload.c Date: Thu, 28 Aug 2025 22:07:27 +1000 Message-ID: <20250828120836.195358-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756383124229124100 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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756383082; cv=none; d=zohomail.com; s=zohoarc; b=nwR83RQDkz87Sfl+6d2/j9IP54LTpdoixRNTaN9TKQ7cGK+3B5WchPBlCJXA3wfVjdI6D2Nque/unK6bgUp3k/v3A6cpLk5DxS0DfzrMuIANxYbvKRXJ0KxCSQwGYEx71WNJLdnAsHOIgmo42awsyj9Kyc+np7E3BxbdfwliFT8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756383082; 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=DYOR2txVRXgp+21wx6twyLM7OtlGXRFl33SFJCsnOmM=; b=L3mukLFlfMqnJ/Doqsq+TDSJsyraIGWRwW7vqZWXrsnhRZ0qYOLh2qHbFKz6ZvXYUZOcMcfhleemj7B4iCpe7M3/9Snib/kYWEoc/57Fbyqo95tzUjF5/06UDT4R1ESFw5aVnnKRfSn5WJC4EmsftpsgnkUQ/7ThsCCOGwY+yzs= 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 1756383082450234.10823462147846; Thu, 28 Aug 2025 05:11:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbS9-0003UA-Jn; Thu, 28 Aug 2025 08:10:05 -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 1urbRc-0002cS-61 for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:33 -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 1urbRa-0007Fj-Gq for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:31 -0400 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-771e15ce64eso707116b3a.0 for ; Thu, 28 Aug 2025 05:09:29 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.09.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:09:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756382968; x=1756987768; 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=DYOR2txVRXgp+21wx6twyLM7OtlGXRFl33SFJCsnOmM=; b=RJFcQVWkdRZUM4v+KNRyZkFbpfb/R3QQYfQjTgRK+bnN/QMVD4Q2LKGpVHZ3QrXMqd KWG6B51aHPPUw4qLTbDX4RzSJkruML75xK5xChr6K9NA+T9dVo0NYcKOTojAHFTiZeGd DTYaZswf/RYp6R63D94kX4GG0hbfi4/Iy5NAx9PZyiKtdSqyqYKJox39vTCL6jHt9ztB 4IldecBcy5dO2ZMfhAzNbnmaWnCCRhRzMSdubUEfp6VT4H9W2raPP7PBJYJPUGaotzqe p+ZBxKhFfd08nZVkKIMZ8a9ifVN13oRuXf5OOH+/zDawgXjNDx5DVUYjqYBt8e9xhFzJ 2HVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756382968; x=1756987768; 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=DYOR2txVRXgp+21wx6twyLM7OtlGXRFl33SFJCsnOmM=; b=A6pGwETBVnXP92Hzq4DvlpTElbzDBUMCqTAzrt7jOO33eOKmfnaqf14EZLCNZ7rfDT 2LDsgqGjA8C3ssLrGnBeBR8LmB6AdlKUc9lGk3qKfKnhwE/lybk6ij2+vblWmPAb7Nk3 pf+IKVBqO6xpoMRpVfcB3+KMRhOWLgYfsRSwUHLY3wSoqrn5X4KGOGKMDl3osRJZhGnr HXlIXzhgWPvxLK5CYQkn6WCfXFQkDXtqAjwLAAhCHJ4X5XF9L2o6kjbBXFBvuWuIsKHp TRDCKoxrcg0QerqhH0zxfChrA/5Lnn70yU9/mtf9A0yr9evZdAFOzZDaRuA8N+7XGfel znjQ== X-Gm-Message-State: AOJu0Yy6wjtzJnhpGBRUGsptAF0YYDvmTgFjii8KUGYSAbAvvpet8RKv m966rvT4mJc4UgSYlGCNTKqaknBOkcIjDKs09jQBH6/+jF1edNOoN1EWiG3RfKoRkTS9nAcy7BI WZ/8eAQw= X-Gm-Gg: ASbGncuydSbNmwFiw6VGqZ7yOnXzaPmn8BFpZCN7UHe5JaNyVLvotfHtIkREfvh9ZJ7 l20ckLv0vsXXmdgCe5acHht54ZKmTBPDEK23SGJrUEgAt2N0vpbqVZ1FC21LTuAfITjH7/UmDCF 3vjLB/Ood34pMmA71BUUsmL571H16lmh8/EBBMWhC8YfeB/Ht+7yZWbzdeD/h2WRPqe4EqJATiE qr39DoY5vjfiwYHCJ/kWaPQNX2POc4BHDWUWTRAmRtpxyAC7DEz6Tkj8i7NEwfyEKRCq9nuYqTp TMq9KdoRN6IU7y0DuT4XTqz68jqrwx7nnHdQgPST92Rz+xe1NZ0IhBAlKLqe6oHhDkTiyvXBRIf VKYlHWAMOCNZnQt3y/WzxnKWz6Q== X-Google-Smtp-Source: AGHT+IGFokdnb+OfB62Va6xZo3dXxGOgMTj9A/oa1QKme0DFnt24ma9LP1ranfsPCGFrakkgzmFQzA== X-Received: by 2002:a05:6a20:3c8d:b0:243:b656:dcc9 with SMTP id adf61e73a8af0-243b656dd00mr945598637.55.1756382968299; Thu, 28 Aug 2025 05:09:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 19/87] linux-user: Move elf_core_copy_regs to aarch64/elfload.c Date: Thu, 28 Aug 2025 22:07:28 +1000 Message-ID: <20250828120836.195358-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756383085796124100 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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756383063; cv=none; d=zohomail.com; s=zohoarc; b=mZYcheE3u5yVTk6hIqXpYv6SfEwSTbkg7xbaxvayrFWAh/FI3NL1/x/jxj3uhp3xnyK6HReei0KhJpc+E+n/j5os/9BwjiVnEctcZl4HgqYZbwBpxyFdoJ/2NDWgd5gde3CuiGZ0g0XtXEbYHFPUvgAKLnybEZ7RAAe8e361QQU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756383063; 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=pX3cyAXzWaI+M+ga3mt6VNWQq5Iik+1mUsefsD+nYFI=; b=QncFhucaZhV4HRvc1Buhqf5UlLKMPFuQXwrdSL+wNriIJyjlIpLTHHl+ri3Y/tgCi3qnXATqFWfZ3uctZd1r91eY1SnUEpuDyA0yE3+WcRPg5h96oIMCUOROYy+MzbEaDbjqxV9UtoFwNkAQDDUObkiA+TtwYHfEjIhLNJr4h40= 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 1756383063384329.73670852889427; Thu, 28 Aug 2025 05:11:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbS9-0003Te-J9; Thu, 28 Aug 2025 08:10:05 -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 1urbRd-0002co-V2 for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:34 -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 1urbRc-0007G3-1P for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:33 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-7720f231174so773903b3a.1 for ; Thu, 28 Aug 2025 05:09:31 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.09.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:09:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756382971; x=1756987771; 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=pX3cyAXzWaI+M+ga3mt6VNWQq5Iik+1mUsefsD+nYFI=; b=Ir8eHTJGM6MzX26lQjrYla52ciCR1/EFg5tjx38d6Oq8z25MgmUZehhlsh8X5BYpcJ 7cefVQ+GnU4YY4qsK2OSSYVdZSrN6mQY7M4ZEWBfLCjREYb6q1MpaW7O9JVperblD9Lt 3sQYvGQVFlGB8cpitWvw0RQxnwyH0LHANVALB3B/2CMAtZHh4A6u/Ny3k4fHvTXzDtdg SkgFd8a9pLxJ1ofVr6FQGyNsMHyj1Dm8mk0/PkXGMtBCVBJR1e6jDdT18MWihr2a4psW TBkI62TRYRbun/aa3oi9rjWdpK3J/JjI70omxOgrTOTKuikdkpXnK6aidW+Yb12ArjCY jRMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756382971; x=1756987771; 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=pX3cyAXzWaI+M+ga3mt6VNWQq5Iik+1mUsefsD+nYFI=; b=aXQXEVU/Xy7Pd44hqd4ClkAizUmNNBK5FxPXAjd7OLXjlFtsB9cfEUmt5zn00m5rji jlfLyRRjyM8vcMr3eiHumYFP16k+60uwRijzHzVQwbjja2HvW7fLHcC2ekwaNtApJCPs LALM/JK3hN7cNWyeiltzyCzijTA2muRBVffs9kT8GbxVbNwF2NnX5h8nAzDRqXm36yiN xEo15MpC5alKNBgxP/aZ+RxUiRYQRNfbIBpD/aODt/gwFhkzb782wB/dDAgf+VGVF/q4 JAigNejk0yC5XQNWXj4uLav0h6uz2/D7sqyWboUSqlj1ATGDowQrUtNkj3aHuyx9frTx 6U4w== X-Gm-Message-State: AOJu0YxwXVovl8FkFfrSsKf7yKVaCQIkWMudbL6cS7H+nDWBRlGgwuAU ckfDYU21nlBYcx1QwTeQ4/mZZrX9BZxzWdu7xNUk1kYkKJrIG++SYVi8gXc3P9/UFUIh5kX01Z0 /Tm+oqMg= X-Gm-Gg: ASbGnctK6vvA/nikBuJKHv6cBUaZDeRQKWPATv4kwGXeJmbzN9lSfg+wGnMT0xK3njG Mb9piRFVUVtxv6QjhocNOm4TvmbUZHAJU/RS4aJPLL58A7g2s33vauNvy4/Rak6506vIo+msl3u Q36Wjc5OFyNVK6qOXZt9y8/+BLF9a/WIPY9yfJSCEdlwE3onLx0Y5ByVv3wwt/TQSC5jsL3Afgv L+2Yq1R+xlvxFfCGENMBpsqYVJrb7ptG3y80fa3QjWwxFR19CoUyNJPqspUzCM3e0ACyRVu6Re5 KDFrqflB83GExiw1YxmHOW05q5JWI07eVHBNCRiwizwOabS3IMPJAiSPdfNV7E6XegTAor6WIDj k0CwpJwTrX5M/T055dw+OmXWC4NN6LYU5Se4A X-Google-Smtp-Source: AGHT+IE4Rwt0oYBXaL9moWaBU2U6kttoV9gM+jvHmkl0c9tFM+GmILqIv0lDcxyefCxGrjhJneholg== X-Received: by 2002:a05:6a20:9189:b0:243:7beb:8424 with SMTP id adf61e73a8af0-2437beb8edbmr20990106637.46.1756382970585; Thu, 28 Aug 2025 05:09:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 20/87] linux-user: Move elf_core_copy_regs to ppc/elfload.c Date: Thu, 28 Aug 2025 22:07:29 +1000 Message-ID: <20250828120836.195358-21-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756383064819116600 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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756383719; cv=none; d=zohomail.com; s=zohoarc; b=AV4OFOVHV64mPZXdvuNQF7IaBp/Ne9JhKeiBJRG8penRwTBHr7rNO6/Dk4i6HgNWWPVanfYbwq1BqS0yYAnWbwGZUi/tmMnxzcl8huiW00Atvop429zT/ypaqVlnHvl0dL8D8tJXL/y4HLgXIB2YOE/mO/6hE7sGvwwx+rfmPdQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756383719; 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=uM+3dz9YMXnBjvCgcRPx6pacLAFy5WHpxuZMWuhu4ac=; b=PaIGRUg9rz5cVUgZHQ2NBPDB07Ybp9xxmPYLOKeip4RjCaesUvPNNaJwcuq4YMtQTY8TuusbkuQUUK44ey/7mgGvvW5m2fipf2qNJMJOv1iSi3k841cDRbQd9quxdFMYwNbnfpTSN9pnnvjwm6m+4qoNvdazW2x2uC0YcVm4scU= 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 1756383719781808.3442186846454; Thu, 28 Aug 2025 05:21:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbVd-00077L-GQ; Thu, 28 Aug 2025 08:13: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 1urbRg-0002gu-7D for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:37 -0400 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbRe-0007Gb-5F for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:35 -0400 Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-324eb9cc40aso1588304a91.0 for ; Thu, 28 Aug 2025 05:09:33 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.09.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:09:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756382973; x=1756987773; 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=uM+3dz9YMXnBjvCgcRPx6pacLAFy5WHpxuZMWuhu4ac=; b=BHDUo76d9BOlOfV621oq7/PsEOEAYpq1vJA5YdE7uNVd8I50KS3wezftbLhzbSo5XX JkBB30UOkldZ4EVGDrsWSWKDVTZfFBFuab//hPIPzv2qtZJhZ8CKOiBLbvr+YIf4+WBP l8CT/Uj+3Y7FvpMGz51LlT8N66kcxyQoPfluc/0VMR4Dv3D/GQTCJgUq5knCM9UyUBGf qz+/Y2L5OQR2f2fk5PILuvb4H3BmfbA64VDe7NvkSWLzmZS6CWBNz7dngTGZT8aFh/jU eN9E4QulzOg/M+5k+3pz7hYPG14EqldAdUaiWvEvEzMEMCBWvf6wdyQdjpynxcDlNfF/ 4NcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756382973; x=1756987773; 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=uM+3dz9YMXnBjvCgcRPx6pacLAFy5WHpxuZMWuhu4ac=; b=CAKy6K7nW7IhCffyfCYqlkQ9QI7w/vJdlHWxgwE0lidDDaf+/OzyhjcWa49PsiYT2Y fOh9UhG8w2AV2h8PJrw7aOUfihZmjZcxMJ4fKo/BX+kg7W07/hVH9lWvuDFQ5BPHWwu3 55x0jwL6d+DdquSgNv7OiY7qAwTubUZpxtCpxE44nasDovJS8vzl/QI0qkZZX4Dka4B6 RS5kM7QQ4VilWTsiJkVY+G8WXxUTbb9501LFwmGH1VgqpAfPb0AyutMEU9Wh6+g/nyS8 pvREVOt8vHRHUnBzoOFMXVSzgb2UTxgOQc5WUB8+C897b9h85MK0/jYtxwKQD4K85t24 cP3Q== X-Gm-Message-State: AOJu0YxokiaQoCw4vV8xGqJnWojQv3QhIFKdtO/haLqb2geRIE4RnMPE HlxSIVsBd8I/2u8arvViOFnlboN1Li5OrajYJhBsZAzEJ2zBdSGctzFHzW5rdxZhk3fKszYUAuF laZzXE00= X-Gm-Gg: ASbGncvajK8xLZ0hAr4vrU0ia7PqTo++se1ErxYZJXuDMBYKr/LEKx9HB9nEJ1sDlG0 MtF7UboJhY06NwTmsJGFi6iAPYXwYKbkYh+X/hEXsPjNEz+vlxlTdfdSz6SWkzlLT3qI2PBn2Qf DVzI6x+MPPauztqabgrG/SlszEcS+RkZgxjzZr43cln+xCQ1x4pbm5HWjW3su48OlyG2kfjdYp2 lXV0TXy39M4utp6ZDrjPDpaDZUzt45ltR7rC2IZT1pr3bQ6w5Rkll3vLel+uh0WzoUPZkaLJ2EL i6M+Mn2R/qOiETvK7xpoxGzCH9CvhvIhsEtJL8/buF5Lo/owl2++Tg5OT+anpPpxynejxhYsCdM nr1UEfPnEwg4iugsnj0esfcazVo0Vl4fPpN3N X-Google-Smtp-Source: AGHT+IEwj5n8NqHLR6BDrzaHAYciujj5+2CJ9CQs7p3DYGLJdEh72k9eRl8SfpQhnE0T7OpJkm4RXA== X-Received: by 2002:a17:90b:5246:b0:321:82a0:fe50 with SMTP id 98e67ed59e1d1-3275085dabemr11216792a91.5.1756382972643; Thu, 28 Aug 2025 05:09:32 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 21/87] linux-user: Move elf_core_copy_regs to loongarch64/elfload.c Date: Thu, 28 Aug 2025 22:07:30 +1000 Message-ID: <20250828120836.195358-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::102a; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102a.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: 1756383721746116600 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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756383274; cv=none; d=zohomail.com; s=zohoarc; b=Oa1T3fSqsrfJBHXfnuHh94KhAzn5frpDubvPNndI1nPme+NOfWgwaf02WsbDTMAEc4VltwYWI2J7u6vNZjxPWGlHBf/Try6RuceQo7FnlQn/efSa5c/SyDW0ysvjMUKn0J+7ci8hRaxdkamMszoYIOpVH1zwsAH/2X9b/DqgvWs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756383274; 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=wIfXsalfKXZPBG/HfzJiE2bOo32PAgp8HxaWLSOVE5E=; b=lz+WunQ2fvHNPiY+10hX/0xLFsoakSm1Qv7eXkqIk6vB9LxfTXs08ehSaEzlvBgXjkYFywf6MnCDFtAcola9r3Dr6MVNP8IB9J+KUaobv/ieau6m17IcQuTZA7EziaaSgGU4+xEjsjlRz8TlRDhtAld2Uqw1OVIs0kCQEfcU5O8= 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 1756383274234907.2138774217026; Thu, 28 Aug 2025 05:14:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbTj-0004yy-AP; Thu, 28 Aug 2025 08:11: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 1urbRk-0002lC-33 for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:43 -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 1urbRg-0007HA-O1 for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:39 -0400 Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-b4c53892a56so799222a12.2 for ; Thu, 28 Aug 2025 05:09:36 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.09.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:09:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756382975; x=1756987775; 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=wIfXsalfKXZPBG/HfzJiE2bOo32PAgp8HxaWLSOVE5E=; b=l/oRPyTC1lW5/TtAp2zfak62mqSQhEibjmeN1kMPz6PP39C9CdpxZt3xY1/eoPVyKv +dipvXXIhheHmUbRrkfzojnnKkyAnHHPhKwbTu5s1BZgafZWJ/ayraitjpw/xAexNHXz r96N/JkFp7/fVquQst6Z2IgUNVFzsmJAs8XPKJuUhplAW3FEmSVo4Yav7iZwHBWQvrJK Ozr1eOTZrTxPI7p+UwcN262KJAImo99YLFlh7rzJetUyeKNRrAhdz5+1C11TuOBrdK+f 2yfDYtb6OilQt7iMZpnMiwH9klluudFPZdvA1YSudvvKfSiPYsn58Hx0QenkdIisRpwY s4Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756382975; x=1756987775; 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=wIfXsalfKXZPBG/HfzJiE2bOo32PAgp8HxaWLSOVE5E=; b=o2oX89w1b5c/wzMQwVWXgoXW1xvQWW2NalQN5I+ZmCedJhlY/SR2RVsjPTK4kEsCr/ fg7wmHGZy84DALOfZUNu2ucau5+0I4RaH5ckd0IwJ+Qv1OZBSJrSIQhPQkWuV/9gDjxe JVWnRUZbxNah4HCt7rPcuKPv86HlJ3CdpXLfL6ELgjmVoUoKbiswA8RionvdmxgdPyFr Yt3GbB22mSooha72nz93yGytVCA1mP/KjpFNOZDQVU9RNXCrbpDuRnpWyogRMPiK0n9X G2vFsC0qUcmCuSKALATIbiAuSV/7oq0pnC8hBRS8LY+pBPYCSIJXzk88z4qksMfFR7PR 4lsg== X-Gm-Message-State: AOJu0YynjjOWbjvOX8she4z92R2I4glFcja6KFFnWO2/nOI6PJFBmTsw +fj/kfxcJhShjavwCaTaJKy80qsWmKWlVbhmXPMJjOvVtTc7CbcTdOtJWPVNvS2nqKG0N/90RX0 IBRv3tf4= X-Gm-Gg: ASbGncuNG/Fj/jLkRMBH+r5C4JBwq3AhaD4QRWcoKiy80Fl5u6e1ULYDr1zn2+5oQEn 2/iUIHeGxjqulFZeWAxXXocn1FvKAp2HgER8iir5WA5EYLVYRkYqG7HJEOE1z4U6v0EqH619WbM SvX+b3FTzqPrsgeJPQs5Jw0A0+MnaGHzx1NJE2fa1k7PXpzvqrS2cUtAuXu28yDfPp/fYXozYh/ E9H8K4Z+eplNZtNA0cOyx/brqlq72K41fjUl+TrOQGMTNGOR5Qn8UAcoqUtIfWLjGe0q5yl5WJJ 6XjhZeICKEyZoEo4JXRqNgYx+cKniolvCqmHv3AJSGdL6sD3xDaQD0S8htxiVyBPGqJUGK28r3R E4wfmt/zCR192zuZcAZvO4VExr6Injko+H2Y8 X-Google-Smtp-Source: AGHT+IGx4+CAuM4tRH2ljvJ72GUZ66Sug02pWs/psIT3FeavQ9YZJn9bBKvFdJpztgqVs+CZt3vhOw== X-Received: by 2002:a17:90b:3d88:b0:31f:11d6:cea0 with SMTP id 98e67ed59e1d1-32517d1dd5bmr28530334a91.27.1756382974837; Thu, 28 Aug 2025 05:09:34 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 22/87] linux-user: Move elf_core_copy_regs to mips/elfload.c Date: Thu, 28 Aug 2025 22:07:31 +1000 Message-ID: <20250828120836.195358-23-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756383276439124100 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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756403490; cv=none; d=zohomail.com; s=zohoarc; b=oLuIJPtqh18pQ1m+1eVkg2/86AdTHAbulByAAnI4gGMyZX27sKiDtQYt1N/UbEJ66ymZ5YlG9quAlm66/ahWxgEQ315cCiQDFlQIpiwYhUXJPJeTgw9go2HyIwzg9VGW/11zNiCIYdwlWd24E6fFW0Y1iyj6hFI7fbXRqBpkvkI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756403490; 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=R9vU7UtNMSkO1PPlm9WkjYpJ2Jl3RkR5+b6cjhq8aXM=; b=VMCbjvptPlatfrUhX1iWYqARRdj87xcnS/UB4EKLDGrcSShmrdHiRJpMippMD2+OSxCj1Uqi8uO/4cXBNf3z3TnYe7OhS3il7QtuVVoKbgVExam8WVd++sYI3v+q4wlfuhKGqbQSOozWc1swUmlxuKzd8o3IeBJVVj4DZJYVdw8= 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 1756403490152315.92908444318834; Thu, 28 Aug 2025 10:51:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgJB-0008Td-5F; Thu, 28 Aug 2025 13:21: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 1urbRm-0002s7-5T for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:43 -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 1urbRj-0007Hg-SQ for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:41 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-771fa8e4190so678186b3a.1 for ; Thu, 28 Aug 2025 05:09:38 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.09.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:09:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756382977; x=1756987777; 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=R9vU7UtNMSkO1PPlm9WkjYpJ2Jl3RkR5+b6cjhq8aXM=; b=dH0OoVzWlE08ud6RyPcpbPiEQlAN0Eo57pnN/PWr4ANQHv66ALRuJ6FlfqowbF8Ozb wT7JFL1aNvSdJ/LLQHa0g/nVBeU27wFzkxvyGkq3Y3zBLm2S3Pmom0VFMmU4kOCymuUP 9oobEXijqoJebZn62sjoiV6uQ440VM8FrnNs5if5ToN5Z5f7p0Kd2Ygl3Ec25+ypsHMF lOUNVvzzNP7GhR6qJe3x+0rraJPypMXwKHREHnjQ/ncK2S2asVrA3mng7eca9s15pjB3 JcP7OcoHoAQusjHaiOP9qhlv0Fujwhd2r7sbjrxq1ZeqymDXhw12dEkAye2S5THHE30F 08BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756382977; x=1756987777; 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=R9vU7UtNMSkO1PPlm9WkjYpJ2Jl3RkR5+b6cjhq8aXM=; b=F3aJjyUcPxzaHNMtOM7oPjQNi7I4s7QYpSHLRMkdu7PnHy92xigDUift09WziLC+xo RQfwc6iCDfXjSyOjI94YmpzdzUh77Gr/ofFYFIqoUNAe8KSm08ZeHVAJq7CR+v/gajsu 7pWA8LqW1kj275cwBQft/qbgUFD2BDIJSkD7tL1CjfVJ0TECgE0SHRogbvktfpdJ9Qtk yvPZShriSz+YMQO8kNfuCgbLLtjDi9Hz0QjBxsE4shVXMIrtAvIjB8hmylcyCSg+H9rb ne7Af98kum7hMaOnNSWIQ2CBZCYeaGv2wEcGQtN1U2mHGfh15lb1MGnF3UVcSJpFF/Zw abLw== X-Gm-Message-State: AOJu0YyRw6WoGJwPXzrLVLhfUo7MGJWzxWRKewF4lluVafo4xgQi+WfU pHERqNOrVDWOIHyfUpvc/pDLF6O2RzdcG8fWeakOUofE27pwMYCmqzSYpGq1xiJcXVna293jDCk 58F4hvfY= X-Gm-Gg: ASbGncvjdED6pxI+0RIeOFUHEUqYpdlKlVsHwnYWIt6T9u01rndBh75yzAZ85gRPNuE HX1WYKUgjVBqSiS27oAOBWg4l0b+z7izSLiw5YzQf+uAhVjHCH6aqDfkSwfJvIH8mSfiW0xAz2y QytOlmkH3+vEFOwWbjAYB0oyR/cBCcjio64jxwpswXdrJnKTokx3m+px20f7KcuJkSgmLZT8A8o m897mvbCpRs1amK83FkAzOWJOLKfOPym/+6lrbO/Fquh988p9dVNunR6hZpgcBIZcaKt2HYnEJT RHmLW7WQ2UafAJvEdnnebMSQMrctTfok6eHKrd/GDe0HddAN/QBTrlfXpHYDlqIh4aNdQEq/QgU Om5mdJ4d+WiRp1IYRrUeL3Pg+aw== X-Google-Smtp-Source: AGHT+IFkoiGE0hNm/h0oQnxMC/EOyYoKBsFV77+m5MdsEdEB8q8c1BSuDHnCf9vAGb3YnTNA46eElg== X-Received: by 2002:a05:6a20:258e:b0:243:a5c7:3d6 with SMTP id adf61e73a8af0-243a5c71469mr6686798637.6.1756382977209; Thu, 28 Aug 2025 05:09:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 23/87] linux-user: Move elf_core_copy_regs to microblaze/elfload.c Date: Thu, 28 Aug 2025 22:07:32 +1000 Message-ID: <20250828120836.195358-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756403492900124100 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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756383751; cv=none; d=zohomail.com; s=zohoarc; b=EWEtbuMmObvZ6qzWCHEglqLryznowo54t/vDaejlBqizhhz8jtkgCb8Aqr96vfv/8us53Ne21Fz+JQD50Wg9bb8Eybq9zdfU+T4OW91kSRZTbckBRYrSPDLWusFxQZdTRt7HrACuoHgZ1dpL9fEsY/2D3BW6XYjqJmLhJ40/6Fw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756383751; 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=kq3UR6cJAVbU6RZVHbic254O03tLZOp/eHhdQes8t1Y=; b=ULFhQYTg1MofyoJStMF5jG6Ov9p/1m5uXaak2bPlQbNFQmxIm/PIbU/WAJwDbgx3zmI8wNNUIeepdgFVKRCBziML9eHi0H/lsJliiQMOhGS0cGi/z3BMtJH8nqvO8L2RB6dKqZ6RZyX1WyAvq1K4YnsA8yHNU0xM8f2KO79bfcY= 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 1756383751604773.3364593200849; Thu, 28 Aug 2025 05:22:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbTx-0005ua-MR; Thu, 28 Aug 2025 08:11: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 1urbRp-00030y-Fx for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:49 -0400 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbRl-0007IE-VP for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:45 -0400 Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-b471737b347so589302a12.1 for ; Thu, 28 Aug 2025 05:09:40 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.09.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:09:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756382979; x=1756987779; 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=kq3UR6cJAVbU6RZVHbic254O03tLZOp/eHhdQes8t1Y=; b=SZ4hYkIdrtJcSLVsWVKPZLCOq6yz39ZO14OongqWPxNh9n5tLzd9I9iBwFmJ/XgDt1 JaqmsfKUrFwy/8E1SysFUqf3J3x247/M/fd8f3hvHJkQsohjzAyZM4x1tjWFt/SOEmQh jJUpvbAd3bBzbnk2EnkukmT8K7+4I4RR2HImdhsrR/W/CHyFAUiJHrZWTO44DG1fDA4+ 3c00PPqL9BMpBOLxHkww73MGrH5yJhwC2n//e7on4ZjVrcD7y23KTjLAWdIlh1eWfO1u 1he/iCtqiCyf3at+tybMDrnVGFET0m/a1yErUlPZlOlHNFfmDW3hoowZwAZUDweQJXdb SU9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756382979; x=1756987779; 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=kq3UR6cJAVbU6RZVHbic254O03tLZOp/eHhdQes8t1Y=; b=S4r0HUKybLKVUbI39q39LdNcNu7Nbrk9a/TkP/AbG/aVV/GYLhn0DEsX4k3UMjX2pc 8Ic97LpAavrIZpvlhtQiEwUzzX7RvQhVpr7nRtXQrCHkO9ZEJnxf2Zy+86BmKMQSPAfd C5+7xYOu0zqcFvh4LBzKWcGYsxeRNuzpYguUMw6wKJia5R78rIHTVHsiCKwS1hMiVtga o6jMRAwIiS6tK/Q0e4E3X93omjkU8M6Uy5+VoxEKgipzMZ3xvIAuI1My02jYehYqjG6n RMcrl5zLLOyh1NR8+Qx1a3RuHcMwtum+XmLo7lVuqrGrOTlCT0MWp+1dCgEb7MGDbscW 1kjA== X-Gm-Message-State: AOJu0Yy9aLtJj41NN+tJEMfps7JjxOKL5G2yokWkzZxhmRYvsVPw1oZD kl9pdyxX5iEVWlJ1ZJcT/niFBZHL1Kxu6SAKldcklhBhBNKZ+t9pOO06zQtashdtGyB5/U0oF5z 8xhYJpLk= X-Gm-Gg: ASbGncs/HGEUxqIbNm+QhGiXqxRTibfZMVfnQDyipaXUXASsw+/PzgitRggIoJWlwQD nSghSwVxQJhaHYcaMEoEa9crWryX7rVOReSwpXHTj5ounXhH+x6WdYgczwD5hca++XVCOoMhPd4 4JrefrNl75Eb3pzD2VTxApug5YNcRoKT+snSqAHJPQdTQDKLRHBUW7hF4SVw0CUHGJBRnUCRdbI B1eFDrinehHf4uunP9SIdQb+ybOICWC7NK4M+FTcQBkWq9w6bcpUAaMLBd4ImIVopzj7/GggoUx obq8cOjKyRjujfeZlw1qNV9t5jpunT7Qf5XE3NN+SXoxlcq/qVcRAb8gI3cYKNwVN8u8fMkNAtj 7kVCf2EhcdgGcjsncULVegUS9QYnI7aiX6DQM X-Google-Smtp-Source: AGHT+IFzO9SIhPTdp6WnGfhtPYGHYN07gCPGLJg8ZtVFjkyp9d1JIz4Wvk9A6e/VYiOKtZa6lkvyvg== X-Received: by 2002:a17:90b:3503:b0:31f:867:d6b4 with SMTP id 98e67ed59e1d1-32515edd015mr28327411a91.10.1756382979391; Thu, 28 Aug 2025 05:09:39 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 24/87] linux-user: Move elf_core_copy_regs to openrisc/elfload.c Date: Thu, 28 Aug 2025 22:07:33 +1000 Message-ID: <20250828120836.195358-25-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::532; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x532.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: 1756383752211116600 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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756383478; cv=none; d=zohomail.com; s=zohoarc; b=ZcN4O/ZPbtvWORPROemOztWqfsejP9Yrm+i5HKDcfcnoO76I34iq6GkKvHlgRvkbk57PpbfxAZFOTOjijmpRXpMwr2dM/TUZB9liUdfxHrPy7XQ6CRNvQgQktjr37BV4DOOcz4Og0A/vAi2UZ59AA6J7uh/erYu/BVjaxMQwgDs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756383478; 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=xGYZ/16zBJfYDfE4nRu94YbCxMVoWNYG9n9EpekXW5s=; b=dsEPAzaJpoAzf8qgE2XfxjWUj1Pl96brSrEyB+8qInibHkX4ubpdY98CkjhY2dR18iDTpsepd8fdL+DjT+3ZoE6YPhPk898nyDKjn6dWgdUDhfibNOzMSiLH+SUFru8V0gu9F76tfDHnJZ5QP3+63ONWLVIV9yyvmDjCbIJLlp4= 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 175638347817969.07134346251155; Thu, 28 Aug 2025 05:17:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbVz-0007iy-5N; Thu, 28 Aug 2025 08:14: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 1urbRr-000314-6F for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:51 -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 1urbRn-0007In-Ob for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:46 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-7720b23a49fso940724b3a.0 for ; Thu, 28 Aug 2025 05:09:42 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.09.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:09:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756382981; x=1756987781; 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=xGYZ/16zBJfYDfE4nRu94YbCxMVoWNYG9n9EpekXW5s=; b=C0Bb041CbJGgqHTKr2VfmPHCZUhS1g6dLtAfrDk28vjMGhBpRfkT3e+kf4nu6h3beQ n/zws5XBL1ryb40Uk6l8yDHgsRKirRWZxoxxjKPCfrHVDJuzZ/Yrdkzo/8Js1xhMAFnK A3zSBrXHtJSVs0zAjLNx92Trta/gIB75jY5ZNEHjqUv2zpz2h3xWigEQSwtQ5WJxEbzS +FvtzNIDjrbZYNSSpyqk76Cruzg2UimPrWbDCVXfX8x0AaBAaH+jH59cmVOgiLtWo2MA DhBdKusiBwtvOWRWLE+FXbNpo2cC+rJqV9vxOKXOUWk5CSYLPSF5myZaNfgn20cn/3bV Xbbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756382981; x=1756987781; 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=xGYZ/16zBJfYDfE4nRu94YbCxMVoWNYG9n9EpekXW5s=; b=B3Y13AsH8pslsXI7Vqtl1R0ndSaCv9UGVDRxZyaLw9sKSlVyqKerYNRjOKXUTOeezy E+lddlejao6l0RWIk7rihahT4925VCAachD3K3r6MLxuNI7WC7OrLSl5l2sUizf0vuK3 ipy6/fGSDiAjAqACx/mGymMypgvunW10TcGhcuWeohZeFfA9b1yCsztpVd3HhilKsbqY UFC9o1H95bzkmBzdMc70u8vCc2OCv2tbu2KuNgHNj81G/J3sDS1wN/eD1NuuofOjlg06 0S6Z2i71yt6c+aFfAO7NaB0/CmI1Rse8mINU5NrXBcRd8DebEx9Y5Nax151DVNT5bNLR 2/1g== X-Gm-Message-State: AOJu0Ywhz2QBrhz9WJP1gPx5z8CPDIqJcl/1tjQowEll0hsV567Nd8cF GeRXX0zl9JjnJSrES+gB1Iwhy36M4Qxob5fJySxGOkOu/+ZvyM1LB/VdzQJR4P6Rw0dJk3+NaJs 0Pf95Pxo= X-Gm-Gg: ASbGncunAWmKmP+ycp2qw47FbACmEp97Qe8srKTWYZHzJo8Oefnna/yiGK0GP/Lf7mB JE0vLrsDespGa87IpSZ0DKA1P4CG9moL+yNhiq4iqhlO3cNaNdz+TjJo9oWzkHArtNffPjjUNmx sKcTVjdKHQRuf8NWuGgofeCTW2djXlPrySYykkm+RgESTg6dMMzO9mq2wgzg3fYlrDLFq5JaC0X jZUxjFLPcSZHZwPfxvQWYG+2gVS/zkJzfH5WR/k9ou8vGVptkM4P67QOxEwAglS4EAHx7xdKD8y TZrHggXQdyvyGNayR3SZDJ4hzIRmBCAXbnVEsXRk7B+1bN06svsj8YC9Qp8Az5C089W0aVa8kEB DmizSXrCnONfeOSoxMDbXEwuJJA== X-Google-Smtp-Source: AGHT+IFaIHd5iiumBcD7BiXgat4xVST+S/YVfk6Qu2zUs+VIy5XgJ9s/h3rK2JA5s5MwoMpZ1q5Yjg== X-Received: by 2002:a05:6a21:3286:b0:243:78c9:1637 with SMTP id adf61e73a8af0-24378c94c0bmr20728275637.42.1756382981477; Thu, 28 Aug 2025 05:09:41 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 25/87] linux-user: Move elf_core_copy_regs to sh4/elfload.c Date: Thu, 28 Aug 2025 22:07:34 +1000 Message-ID: <20250828120836.195358-26-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756383478826116600 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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756383393; cv=none; d=zohomail.com; s=zohoarc; b=W0XmkPVixba2Qk8ZiR5OkNQE7Mt5hrQYXpzyiv4lBjjJKgT955E1R+nUD1L51VD/gK5IbcGuH1o/kIhn9AQ3vFaWM5RgXbcn3Wfr+NlTz7ghhYqMKAd5lB7hDgiIqT5U8z+Kjc5haQTHRYKTXW+5jb40da0N08EfEVb/8Kqadg8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756383393; 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=7R4DNI2NJtzLUsOa8sPR5qAbu/X62eVrNpQE8ywFsac=; b=GSTK/6WEcoSTXYzYLuHeoIG/2rt5iHPntu4rbIANakDsCxZLKazRzSpHDTKb7wFhcROC7JeJbTQz1m2DGE7qb0/fbzmvKWXB2gmuf2ewItlnevtts71ux7nh4df6YqqBvOHi2KCUg45lzYSjXMJKydD64YXYPUtRr1x0rctEROs= 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 1756383393663499.9728589839814; Thu, 28 Aug 2025 05:16:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbTz-0006FZ-Oi; Thu, 28 Aug 2025 08:12: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 1urbRs-00031g-An for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09: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 1urbRp-0007JE-HF for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:48 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-771fa65b0e1so470523b3a.0 for ; Thu, 28 Aug 2025 05:09:45 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.09.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:09:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756382984; x=1756987784; 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=7R4DNI2NJtzLUsOa8sPR5qAbu/X62eVrNpQE8ywFsac=; b=t+mSJOsTbkL65bA6XDcR++r5Git8sqH30D0nJV12qEv+jNN3mHex/aCiNnYyV4uMW7 R5NPz1DY+912GIwnqRLT5YiOy8kMWkJeQz5XRj/rV0EUVroxJbo2QI87BT0giSxVLp0M 0h/yMPjcdoC5G6zb1PriWUDQKdRc21iiF/iXY531NKF+7puZnLbO2j0+x3fUZzglHQbV 2PpDZW1ruPcyJ8C9zFXpNKt1innawdgJ/UJ7IE1TJ1ZcX5KI5cseFlHsHujmPs/JCWcy 6f3EZRKPigrJB6qyIy1y6sMcSVVol53BuB/+39MXPQLxeW/zNzQbELjlkmzUdicSXYpi eQEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756382984; x=1756987784; 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=7R4DNI2NJtzLUsOa8sPR5qAbu/X62eVrNpQE8ywFsac=; b=HJN4YpECTTNlQBTIcgeAOA7GeScmlUUbTRNGGOyu90KbN0ymxCCntCgAxGjR03ux3R 7hlYnN+0r7oXTueKyAKW7G+oUSOOXIzp6igym0vKMOeCOyswiae2fUnXT6dly3/jAqf5 V9FBH2u3Ba8ZIdP1Ph5/U+hHX/Axb4fZDG1xbOOCxTqVU2X+KGeBQvDcK4bn59IGM1Jd TlpRgGHtS+0RttjlmTK+viXnCl4TLbJEj0BI4gc/MlWqfZGKqcO9yFqfl5XZu01NLHs/ F7ProYV1ickuxcviOKirwXV0R9b7C35zzrFy51uQ4n4B+9OxEfmjLd76DmcMaUbuIJG7 w99g== X-Gm-Message-State: AOJu0YwY7K/TWvcYPRKSl8BH2ICyDaLKICc5/iYiqxKYLACLW/Cg48Ut lrhrr1xfIHoHe/0s3+FPaI1S3G4aSSxekPEBYFM+7sV+G1cfJNJ5gwkEFNIECCxVz3bkjKPLAoU TbV9W5DQ= X-Gm-Gg: ASbGnctP39hOG7jGTEcdcGLD8SOIP8R6R17roId2ppL0X9iI5XtYnYOuUg/rLvDi/fX RYzVU9sVkeP9nu+00SzV4lCjCVrveqVlVnDo4CQFnOQlE9l2p68qUCPzaxOUJYr2zSeDq++wkqO snYqIzDGG+JEROp0K5R16GVwRAPY1RIiJoOmLKBL9gMTEqbYoPfG8+RshoFUyuvQ4vfu5rN9B7y uz4ba/LNmYCvQkup5B078z8fWxU4QZA+FzN1BtVARIRQwGYAaM6e9XFR+JI7nt5iTmaI2tY6DLA GtFn/kx+9lJKXuve6gESXS47YtK2AsasmTPMVNNY0Lp0a6zgkLDsHPT5/vXYOw2lMhWFAtOEHMU 30yKOT6zbc14eu3HpeUfsmfHIyGbpaXbVSevJ X-Google-Smtp-Source: AGHT+IHiPRKR+WUX3+LrwrWN3tkYnZ8qOwi6IyNF2fadFjDgCnvLZgfwnZ1vI4fXpk1OVXzFvsKKYA== X-Received: by 2002:a05:6a21:99a7:b0:23d:ab68:1b7c with SMTP id adf61e73a8af0-24340d59b98mr32409430637.46.1756382983705; Thu, 28 Aug 2025 05:09:43 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 26/87] linux-user: Move elf_core_copy_regs to m68k/elfload.c Date: Thu, 28 Aug 2025 22:07:35 +1000 Message-ID: <20250828120836.195358-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756383395699116600 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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756383632; cv=none; d=zohomail.com; s=zohoarc; b=TaZ6itxbsWn+Lg1eVzdCiWwb0hogRexIfwBbWTATCmxnIsmqC2rkm+cHlBiVEbCmj5gWzocsxcrYOJ7YdpGMNIDJW41To7ouDGf31zF7GkX5FMORo78X3QsoURAlPfZk0Fbbq33XDTNKB9jhtTH/4n4LSunVvyfqm4njav65/+U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756383632; 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=E3VcaH/lHL+y4xRzCBDi6asdRL57brfvVUF5s/r+gDo=; b=hV1JNh83KdsDWilutF7XDC8C7oEDXNRTJzPneqhuFchLV0hUzn1Qs1PaqlBtqEjwKJ7XDH63bi56hrNa/vI1Zx1/BYUUPoSQcTFrnqcExywCEy5uF1niWApolWyLPp6xRGO0z+s2hPMMkrvfqBLPGisEge6JmB6+LVB0uHXAaE8= 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 1756383632176235.97810622886686; Thu, 28 Aug 2025 05:20:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbTr-0005Om-2S; Thu, 28 Aug 2025 08:11: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 1urbRt-00033v-Ol for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:53 -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 1urbRs-0007Jh-3q for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:49 -0400 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-771ed4a8124so961906b3a.2 for ; Thu, 28 Aug 2025 05:09:47 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.09.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:09:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756382986; x=1756987786; 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=E3VcaH/lHL+y4xRzCBDi6asdRL57brfvVUF5s/r+gDo=; b=udjlfGmt1BWqjLec0JfvnQs3/EvXSJWoz8ABen09bq61s1zjaCextH9XFOOZnX/DLt ueHHcsRyny7kE2jcW/bzSqK3P5gPLL2+ZXyub4TynGQZXfvyR9iVkCeoOq67LcW30Jgk C/SMGjDZwsm3jfNb4PAGaIn0Gcq8jazddBcEt5wLr4cGPUNmfDTkDwCnLPB5mpXe1O7R kkTxWCcyFyjjkY/AXYIlHTCtxfW2vdLoUD0Z6y473DxQ7+yt0vctmp+sucSSMGLvy7B3 7NllIgEcQ6WFmlX+VO7rBYsx6WeK5y/JYuFRABPPYrSBYqq7KES+sSRC+9Yest7+xGL+ Zr/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756382986; x=1756987786; 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=E3VcaH/lHL+y4xRzCBDi6asdRL57brfvVUF5s/r+gDo=; b=pZTrH0uYp7LWr54UfX795E9Hi8MoGzIS3tXmSLY07DQ5PTl/Vvfs91Gn5Z1vY5qgHn SJeXhei1Wy4aKOtrtozVhK/X5KPWaOlwE5G771ej2bwTUz6ds49ys2W9ot/riCngVxIx Q4Z+itPJvXuBzCn+QAaKjKEyG1lPeiCvFMA1bHCUjaOmSkK+pKJ2b9ASUn+bfR5ww2Vc O+w6D3Fl00jbiZQ8qqTriUCV9fbGV2JVu+MaU0bhwMtpNyDE0iwcYZ7g7pnHzXlxjiId gTeTqQPYojnH5FyQ9OXO6ZAPXXUt1Z6XBZtkEm0FYL9i7woQFalw9qZ6DGzKTWWTtu1Z eOUA== X-Gm-Message-State: AOJu0YzkKji3xF4BBtHhsX6PzEf5L4AmlsaKQYEqbQhTaEfv9Lu8pOvX fr39G5kHHdQzDReGVTAQ9wsdiviZwQKgOgW9TT5jfmwf0i8Xyp2HUX6B6DES3W3UgiAxdtp3axI 0TCaDZoc= X-Gm-Gg: ASbGncu4zDUX84L505SMsdL9OA7vamK2VAGfDMtbPLCmJxgIHPmWK6KMmPDzA+KvQjE wi6hTEfMDcnnDUXaBsl07I9M3roR6n1LqoI1hQBpOsPvXk1H8zgEn22jU4LkRHOE+nc89zcDlOF JHA4QUNgRRYyU8hz1bOht1Pbsuq5AuDoh7ZiPdegVyg0NHG0gB5whMKFAmFChDEMb9W0aohGDf7 td13ro2Ma024wbcrgXfSJtxG25NPNAmLXJlaE6RtNRH7od/vNVSO6T4Vgpk2/Tfzk9aBYHlyp0x FTOHZwXIpmhdjI0bTX1/QQLwH72B0MBbJ7Rwcw3R42FnnwLsfzkZs8ZTJlmINOFeRwymhiDBAUA drlh6P5Ba0MrhMLRBXrKHPaTwxQ== X-Google-Smtp-Source: AGHT+IHE4X+KMfE1FGK76KkRY/kj7vEr2KdbblpMOQCZQaOFUqanosh/9kYxLzi7bnB0V9LE/E/zaA== X-Received: by 2002:a05:6a20:2589:b0:243:15b9:7797 with SMTP id adf61e73a8af0-24340eb5753mr36366831637.59.1756382986081; Thu, 28 Aug 2025 05:09:46 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 27/87] linux-user: Move elf_core_copy_regs to s390x/elfload.c Date: Thu, 28 Aug 2025 22:07:36 +1000 Message-ID: <20250828120836.195358-28-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756383635169124100 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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756383622; cv=none; d=zohomail.com; s=zohoarc; b=O2mf3y/4xRmxQUkXCYkahlVX06si+3GZ/z86cyqms9bThZE6BvBjVxLeJMH3r/NNMUXr+L1IqW6n7r7m8S6/rSnSQB1NzZ+DmhZfWV2CjTHbURZ6zDw3yODl3oudgI7exHgPzcp4817YOptaBC8nI3OxfVWi4/ge8Y+EdzGSJmU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756383622; 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=9Yeqk1iK19b2EBj0f/JY11rNKkg49He2X3YM6LJtukE=; b=e9F1cjXQv3wP6YWA6o7m+T+5/5F/AEO+/dnxWrN9D8X7B+H/RViDiPyZVl8jK+ErEdltHPfgbWohpYfZdG7N8CkHzG0Z8Xw53THAO3xUUZgzd+BZlbcv80/kEWC1zhIAVoDW3iQWGsraATjgHbFkWMynW+kMIV33kDpIokFAblQ= 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 1756383622552723.0622991481576; Thu, 28 Aug 2025 05:20:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbWq-0008Ei-Ts; Thu, 28 Aug 2025 08:14: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 1urbRw-000355-Rs for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:54 -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 1urbRu-0007KC-FS for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:52 -0400 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-76e6cbb991aso827022b3a.1 for ; Thu, 28 Aug 2025 05:09:49 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.09.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:09:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756382988; x=1756987788; 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=9Yeqk1iK19b2EBj0f/JY11rNKkg49He2X3YM6LJtukE=; b=x7SldFF16hdZhhlpdkIw58xQ5jZ9C+OxBcfCMz0YSeckQJKFREMQ+Hj0aAz11zVXs0 RCg4ASV3eJpMo8EA4MHt9IeQ0d6bgD6BeIrmQ6fBLlll7eGEtfcMi+sUTcfwkDlC2VFA 5qYjsS8CmNabmR1loNl6EC4oQkyoSx+VjwKydOPx6OOKq3KWzB4FBGiZ6z1xAM5AgSgw lg1vKf+9R8hXuvEPcEWbCf5ersCEynbgkjiKKUfnYL1Rs+ciDOIcdeYID6Z26bjoOI1i k5yT0oWAF2LX4ccPqkmQ1vjBC5n7eB3bgHxpA0Xjqu60P4w3S6t3KuOMjjIxQGmTSt5r B5YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756382988; x=1756987788; 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=9Yeqk1iK19b2EBj0f/JY11rNKkg49He2X3YM6LJtukE=; b=J6vEkXvPgPio1iKqgftKRKtqQ7P1qmPzZ9ZFVhy11sedju8xvFRG549YAJwnCAi+qg 2vWVhYJC1I4M6o6qG5oafh3V7LdE24dPp63FO/MI0+wn9xPEmLff3SaeSdMKxrD2r7Qm o7px2Yr74YV2AHRJ657xWb3zttEWzFdCmYdXO+VEbkOtVK0tFFE33M3qtcWAwQnkqdBy V9qy6nPJ1it45qE1+HpTsP6UetJYELDBJKFB7lVzpJdrSEEVTBTVKcCxfwWQDbmWy6u1 f33pXSufgwmAYeGmY6S7dHuXps0+uRBeSPhIc84omEW5cOAO+A1cfE3N8aPevxdYG1b0 X5LQ== X-Gm-Message-State: AOJu0YwYJqJ2xin184drm6sCfYZ0x2dp7RCBKw+1VfmF5fvMF2iBKP+2 7SnRd6tcBmWyHkeK16sWyQeL0/hLeuw0e+aBnQWsRE5E2cpOJMkZlqpMuyzVlTayqzQisXTNpR1 2V0h0lpk= X-Gm-Gg: ASbGncv2iX0dsi6mNu/UR7HjrZOwPnrWoDqwX61PnxD98ZfrZEzRFwBmOqt+R6BkvaE zcbQRJ8qqpVvCHXBygjxcFRWB9ZB1QyTdtV7iB0BjRGMzJUGZG3kL/vJFoDYL7Uv/odBmWKCEKF KuHIF9IKnTfYAVlEELGYXC5pg/5JvBop10u/mtt0eVm+T9e7xpdkGr8ln6noNxjhIzajYVoaqoS i1E06Ubgnxr5MD4gVio24GfVRQhYGWX4YXt21MLgQzFYRuw5zlInlMCR6Upx5Gk2yTjb8xS0FZ/ CXhXUDsJt6bvnHSaNG+3LUcFUu3uyZ3RYBzNbAXeHqnP3liuWd5+X7+8dvaPh++3EDf/ObVPFet glJAllPM6YVZd5YuS1IAy8ddk2A== X-Google-Smtp-Source: AGHT+IFWL7WkP7C0uSpj2mbuWPXIm/TtKkQvbAeMYQFWxzMamqgXjtlQXyl7YqR6GQm7cw5WGHuu7w== X-Received: by 2002:a05:6a20:3f15:b0:243:969d:a7f2 with SMTP id adf61e73a8af0-243969dc829mr9109701637.45.1756382988342; Thu, 28 Aug 2025 05:09:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 28/87] linux-user: Move elf_core_copy_regs to xtensa/elfload.c Date: Thu, 28 Aug 2025 22:07:37 +1000 Message-ID: <20250828120836.195358-29-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756383624537116600 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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756402290; cv=none; d=zohomail.com; s=zohoarc; b=X3/MIzCLcWK6AEtfR3NNvoTVFg2m6cGrtRL78TiOpXZ1Zyt8gU7tUlQrZbPbZu1TjO7mTCtcAQHERRDZgRjQ1H1uOFI5JcZG8/fQiPojHXubkxvNKRDgxgvQmqBtXnv90bX2gGM/t/+MJBaamcqMgzU4+dPYGEHPnw43Dxi6GZQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756402290; 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=63iK1SN6YM8JdMQkXOxn88bESvY73aSwuUnStQVlbgM=; b=hJa/UVDN8mRWGJhkf9giEtIwkaI7oAGXtJ9SuCQ/J7sfFOM9MRKke+tV93TgeipksRRyQUff2d6Hrd/vlB7jVR7dqUCKrnwZ3rrkaAX7NfuZDCwPZYX4gWwfu7Y+9jr0QJUooC4auM46uoS9QC6XekrTGkBPk8eoavJHyZTXiT8= 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 1756402290640174.29801110231506; Thu, 28 Aug 2025 10:31:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgHW-00057J-7Y; Thu, 28 Aug 2025 13:19:26 -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 1urbRy-00035o-5S for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09: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 1urbRw-0007Kk-Kb for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:53 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-76e1fc69f86so1583490b3a.0 for ; Thu, 28 Aug 2025 05:09:51 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.09.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:09:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756382991; x=1756987791; 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=63iK1SN6YM8JdMQkXOxn88bESvY73aSwuUnStQVlbgM=; b=PFZPXvmcyhjfKt9TmNff1wKzIN5CzEN8fXZr0vSL9fr+a+cDPGy7zEWdsWMZqHIBgV Z6MmW6LXel7xxN0pIR5DE6SA2Tq11CZJLDnRxwOM5yeiD0K3jAaAdob058KjlsfOYuQd iRYtAtyGMRngT5M/bjPEfmt5RKpXnZS6nmMK8axDRx00/8kr1Pzi9roZuWkpkiN6DPu+ qIbvol63frhIRYEg7xpEcFrWNkhZABS3nP6WuEPeMmibdkKPlRtsUbb8Ym7RFyTJGmb0 o4E0ge68mJwFKmvTICLcht4tdW7scZDjVW06iR2IUtNHefGNg/prcg0wKjpAivkuwdeA Qivw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756382991; x=1756987791; 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=63iK1SN6YM8JdMQkXOxn88bESvY73aSwuUnStQVlbgM=; b=Ig76aDDkmlu/1+0hRvPECcWMH/pMd3OVpB5arxUWBmWfZpqXCezZbXRDVX1NIkGGoA 0XOBNEq5400vG9R5cBRKObUeJZVH+nFb5voiLC75HZq6HHNvyTv+BgzIbw3As1LI6ggY h/hDGsCit/vd+GvFsjlk6kjL2LSXxIA/2Ci/FFYFBUNIo799pLz+K0IqV9KF7hBHV/PY YaxiurcfXYv4FwFa71SsjwHzM+jc1bzuaeZArJbkA5YWjDoWrq8/AuLnc/rko9hWDrk2 LHJFhI2ZXs/a1aUPRkPzroj/3ILrxLoatpF1VvBq1uHp3o1oyNl0bpq3qyjd66k16YLG m1nA== X-Gm-Message-State: AOJu0YzpdYh9apKOudw+6Yx1pl0r8a2gDnCs6i0cF2E7sxRBtpZWcheZ k5bcfMqgFlmpATMDyaPPonfW78qe5yvtGw0p6/iBQUsGuxdS6TkHKCJa/c8qD88NZB/as4L0hQP QSIHq/6Q= X-Gm-Gg: ASbGncvoaBhGIqEVru0Wy7VfAkJWnshdQG3Dxd4g0BBjuP2PiS5dW2tzyaHeecuks+x Ry2cXkzMNLmazAwJkyJ4DFQ5NFLEj+pT3v5AP7VZqjrZawlWf5kRqUcgqSiqluLwdXJAMpUBWZ7 Qti32+t9zMfFIVILdoei8yNvyT4APL8tiIOJuR+4+4+Y1AuFLqwI8EUsywnlXocWTBuA7SeW2CR q5YLwIBXMq7hHjdW61/rLyV6CFusYnhCP9t7mgb90+vQL7zzBKo/j/3VkUXzO1qcbm3pbhWcQ0o gqnTphpe4bUIxUSEKB713I0KwpChA1eAbQlsWUw7xdCDHwhYKOXI0FM6j8xJsi9UsbPGyBKjDDB uKQ1ToKmagCDcBzqhzYWqmqWQXg== X-Google-Smtp-Source: AGHT+IHS/mGPLwhduz2J7Mhn+pPd7ysFkwnZBVsfsHEhtJeYdy29CZ5QqF1z6HfCstaXTl4oTreJMQ== X-Received: by 2002:a05:6a20:12cc:b0:23d:659c:aadd with SMTP id adf61e73a8af0-2438facc8b5mr11588158637.22.1756382990788; Thu, 28 Aug 2025 05:09:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 29/87] linux-user: Remove target_elf_greg_t, tswapreg from elfload.c Date: Thu, 28 Aug 2025 22:07:38 +1000 Message-ID: <20250828120836.195358-30-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756402291222116600 Content-Type: text/plain; charset="utf-8" These are no longer used within the generic file. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756402773; cv=none; d=zohomail.com; s=zohoarc; b=k7qVOA7yQPdQZwos8Q7qNK8nQ3azlaf2pn9WY++26wRA4lDRKF07uX1uq4rK7ZcdHZ/Y++7gzZ//IG3yp963jp4HGTrWPpJGF8swlzpx8D4JBT8kH6K/6ziuVm9GQ89CyQj9oLyJJGhkGPyXYH+ZayoWtPZXNs004sC5dEF7pws= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756402773; 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=ZsmCHZq5u+318yXuBEGjsf/i7Y2i6qx/41qn9Y53C1k=; b=d/8wdj5PyY3qQwBASWZ4P4PIJvW26kAT5OhSL+/AFOJHR90psA9zqBjvX2G239xWjx3XDM140mqmzexbzE3jFnPfYgIzG1Pa19dZCpXJC2dfHU99y7jHyG057ST3BG1Joz53HkRl3+ZroZXICMF+yMvT/KjJRNC47zHw96tL7Ek= 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 1756402773015252.03534600072078; Thu, 28 Aug 2025 10:39:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgHX-0005IP-Jg; Thu, 28 Aug 2025 13:19:27 -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 1urbS0-0003B1-KD for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:58 -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 1urbRy-0007LE-Ty for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:09:56 -0400 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-76e6cbb991aso827066b3a.1 for ; Thu, 28 Aug 2025 05:09:54 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.09.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:09:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756382993; x=1756987793; 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=ZsmCHZq5u+318yXuBEGjsf/i7Y2i6qx/41qn9Y53C1k=; b=ADTq4oNdk0yOYdRdOJ6EjuZd8H9rXPO+be1NthxBEPU6SMBY1iqqEZabhFxQLh4SO+ 6QSBUCOOpUy/8AMNYLDmo8gXcOfi23DsVptZ30bVLZuwPVWx2Q1L0BtGHdrMf0LiwOKk U7SfucZNSeqDfSHl9DWC52VNv07kDgn2vbMQYoukBG+TNVj3OZfpY7TlnbuPPEJWPvK5 pi8i8SWMrajPalUPOqE8vbjVMumOdSvJIpWH7KL0Ya7i5SyvI5VJkTWdE6l47vtLsLqP uLGZCzrQThgp715BWGVT+/VuzCAZQMohncLDmra3t211r09xo65qDf4MwhpWTLUEN6gt YhGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756382993; x=1756987793; 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=ZsmCHZq5u+318yXuBEGjsf/i7Y2i6qx/41qn9Y53C1k=; b=IPer6XB9pGmAaU5MZ5dwdVT2+9gx59iO/d6mDHPlyOZM5X+ov8w/q1djAqiPHIPfjF NIpvnVb+1qp3ANJD3w0WlxqqlEnS6PJEDfWMFiYWcHvtXufktMM8A8/71tldKo6NtXOU GP99bctPm4DJ5FwCEXhvde+y5jJqecf5zsMpQgphQYn/9qpm/LZ8Jm3tZMti/DnJHCTI 0h3/RUaQJaieFzGd0TQ7il3ANtGqUXI1YgndUXg3qX0nwEuJHA/FvC+kb3WEjMVMwujC 5bRC8SE0KIk6KmWHx908rFlz/dSFJJXwAiOw313UldXzV+L9gQ98LuobvnXaB82kRsUn Lvtw== X-Gm-Message-State: AOJu0YxwkSZaAGSDGLiXg1AGsdkNOdous2R1snYHUtci0F1ALywawnIZ bFr722+AXzhikFwaq65BB+efKrMKFGta5B5eqUOiAOLcvTu4k28CdcV7BwhSYT9g3Kqd+sd4MV+ SSz631Gc= X-Gm-Gg: ASbGncu4kSSQeYPAyykKlFqsUqJwxoqXVBBKQdzPNcrMeQr+w7BfPqDV9jp4S0IHBCV wckaVXoimYgjJyKb3P+tYh9pnOUBKxHOgLO9lQsGsbVGrBe/Vr11+Z8ZKqU2yqlwJDMua8zcnlj vUThIlllBxS89SW4mJgBGR2WFH/Bl+r5AgGZ0+EXJ89pqRPpFS35TzaJ1/mFbzqejxDvwJ3q1Qg OIoyuYws+HLGIDkjVP079YiyyZNbbgtOH1BCui7tDy02sncsjCMHXjGJnHKO2vKBay8WJsUShxS rfAXu5fom+Wun00pn5NWOWBxaGNGlCI1mEDzLiQ0+VAmKEvAC903eih7c3IoBHb/RJXzbZ1/6CP 30v4Co1LAR5oYrjEdoFcMjhALNMScbGHRw51N X-Google-Smtp-Source: AGHT+IFdZBbOTBHvs2y9OTxq9EqdwAuR2YU3Ho65IrQthWz7M1uP0SruIGyYk/FwNZGe8znZPtm0bQ== X-Received: by 2002:a05:6a21:7e87:b0:243:4eb0:5835 with SMTP id adf61e73a8af0-2434eb05a09mr24801410637.57.1756382993042; Thu, 28 Aug 2025 05:09:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 30/87] linux-user/i386: Create target_ptrace.h Date: Thu, 28 Aug 2025 22:07:39 +1000 Message-ID: <20250828120836.195358-31-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756402775590124100 Content-Type: text/plain; charset="utf-8" Move the target_pt_regs structure from target_syscall.h. Rename the bits according to user_regs_struct, which is what is actually used by ELF_CORE_COPY_REGS; the layout of the two structure definitions is identical. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- linux-user/i386/target_ptrace.h | 31 +++++++++++++++++++++++++++++++ linux-user/i386/target_syscall.h | 18 ------------------ 2 files changed, 31 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..51edb637af --- /dev/null +++ b/linux-user/i386/target_ptrace.h @@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef I386_TARGET_PTRACE_H +#define I386_TARGET_PTRACE_H + +/* + * Compare linux arch/x86/include/uapi/asm/ptrace.h (struct pt_regs) and + * arch/x86/include/asm/user_32.h (struct user_regs_struct). + * The structure layouts are identical; the user_regs_struct names are bet= ter. + */ +struct target_pt_regs { + 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:25:45 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=1756383528; cv=none; d=zohomail.com; s=zohoarc; b=AfaYwX2A72RScRp88+4p2tB2MthfOzaptx0a/wIn/hC8fP7sQJhQt6XRKkPM6HNgnclcnTtRMvMsepzcmRQZDF99ZMU/xs/2hobmlC/b4KFU07TadeoWxQc/NAy+G/MhNtFxKq6lN39gJdRwXaqOr4bJnTnAtjaasq5b5LG9sAs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756383528; 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=5o+NPIq0hlx8Dl2K6/MYJXUMPiwU96+d4UnYzAmv86s=; b=mWRSQvwhfZykhrEhJRPp0y7rO0plJj9mMf9w2XxjsMq3aHQ+aOGOBpsshZMVUM+ubBzSpXlcjn3EGU83yyJU8U+wxP1kHO8NcmJ31+nLyLnEa+h3HU79vjxunex3vxPwe82RZDx3xHk4NhRwrLY7A6w90McDi55BEAKEGIbX/T4= 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 175638352813948.20681470900581; Thu, 28 Aug 2025 05:18:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbTw-0005kB-3L; Thu, 28 Aug 2025 08:11: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 1urbS5-0003GG-1M for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:10:02 -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 1urbS1-0007Lk-Vk for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:10:00 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-77057c4d88bso802848b3a.2 for ; Thu, 28 Aug 2025 05:09:56 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.09.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:09:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756382995; x=1756987795; 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=5o+NPIq0hlx8Dl2K6/MYJXUMPiwU96+d4UnYzAmv86s=; b=ekUC6/oHOZako/YcSEz3Jxg+r/v6738DR9FZdWZKoQDDkcL9CPzMM1cm05AZV3TfjU TSt9RG/l+SKMt8/k6PRgyA//cB0linZDBJmOxF/utDOQwAh1Wx1cliMbBrFF/qjXnZUm cwgYkfJ/MgKG17b85UL0RdOAQOwadnKR7zsLd0cPE9R0+FBoWpdDJ7AYFJfrFtiOdK46 aUcuL/PqxyzKo9eQOEoytJ2zR3ZZzbGTU1J5PvTOP/BtPWV7Hb2Ov8I6w7XLSaEcmIBO WTBlqpa1gatR+KnPig6L13w7GNc7eEfYvXmI7PrvF2jXb0/gU2RRjDCvnrM8kTbpgNOY DfPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756382995; x=1756987795; 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=5o+NPIq0hlx8Dl2K6/MYJXUMPiwU96+d4UnYzAmv86s=; b=NL7nJtZSXzYHeWBr9+9r1uu4I9JcQddaj/8SkwO0qh6qA7D0MeZ7urL9DbStUdToav oPgPh4E1PX624wbn1ujGqN99oQe0FUrHB9aWkTuRv6m3qZidjf/JVOocSJ7g3nYWTMd2 UJvbf5q4qiQSJ7b4Lp/oTZJxl5t89MmzLipLyEcSLmTSZ4oy7wdz4vuHFKew2s4c1/FJ ziLx7hfJd3i2HKDLQimoFecW+aPXUBnqxWqnwAKXVPSrKHKpABDYwg0OxY3v+QqCRqqA ItQF4D4inDIr6o7R9z3HmV2mkqt2EoOdVEi912ffcfzxJ17Pk8E8Fo3xbaXWg1QhKSCr Aaww== X-Gm-Message-State: AOJu0YzrI9DBatEtdORyA7XJc7Uk4trGbRd1qoSqpYuxBLbhra2+wkhj Y/+78tuzDZ/IuVGRkR82UIihCELuvIZZLo4VtPWjWciER/GZCgpQ2gocSL4/N+cTiTueExEywrj pmRvE08k= X-Gm-Gg: ASbGnctmpIw2tm5DLaUM8PQWj22PuIDVGbuhUDR2QsleysJWjGbcENKN6IMSHfHX2AV jX0PwqcGUDonj0p2IAF5WJ+qzu+OGMuiJIvyaFBOcvTzaoNM7ZhU3PBBrQJndRlSYIByq6tolMg rg20cRcNYPNtAeVIR+w+jmY/ofucoGZFhiyEtJPIjVpQsKshg0awRZPepDQJluJfC+CiEHURNbw YwCApdO5bkfDhhGo7PL+/A1EeAlUavpmHMkAqWwVs27rwlRUJop1doGgnnChXNOJ2KWgVEGtpr5 kZ/eEA6dfN9jupJVw+YHjOntYH9JS3m493pqjycmjY12mjTh0LEmzmBIx3OSNT/n2lnYG/uUmpI LWSjGSjbOONdJpWlUeCNJEbVwWA== X-Google-Smtp-Source: AGHT+IEMfRk42H3N1mCpr0qffmjrlgFbqQFj5/pfjvTOYp4juAtgsf7IBiPhBsX4sFzt00DND49fqQ== X-Received: by 2002:a05:6a21:339c:b0:237:b53b:64dd with SMTP id adf61e73a8af0-24340b8daa4mr30851025637.11.1756382995254; Thu, 28 Aug 2025 05:09:55 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 31/87] linux-user/i386: Expand target_elf_gregset_t Date: Thu, 28 Aug 2025 22:07:40 +1000 Message-ID: <20250828120836.195358-32-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756383529495116600 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_pt_regs. Drop target_elf_greg_t and tswapreg. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- linux-user/i386/target_elf.h | 15 ++++++--------- linux-user/i386/elfload.c | 36 +++++++++++++++++------------------- 2 files changed, 23 insertions(+), 28 deletions(-) diff --git a/linux-user/i386/target_elf.h b/linux-user/i386/target_elf.h index eb286868e1..da1e0a09bc 100644 --- a/linux-user/i386/target_elf.h +++ b/linux-user/i386/target_elf.h @@ -8,22 +8,19 @@ #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, and that the + * definitions of user_regs_struct and pt_regs is identical. */ -#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_pt_regs 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:25:45 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=1756383812; cv=none; d=zohomail.com; s=zohoarc; b=FwFTCKRGLYi2Rt2ehKLKztFn4cmScJXSBEhl+h+5yW1lC7vg5Q1FyVMCp0UWPOSKsrOJ0gYHNJv2jDbj3tLUmvunF2iUNuoX6gYKFSsd52/0CUe6be5YYhyV8S6288ni3SR2pW+aWB/juKaDgXmV9eujRjlj6iv4wrmALwjoieA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756383812; 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=6Ulz3SirsMyYujWtkTw6iUw4FJv5gccJWDEX7jaEwA0=; b=DpqGzrgx1SKIOv8R08oDqY/R7MNqoP0CeAtHqUU1/wxiS8LuhtCweWIepu5UYYJ4sNjhGwzSPRhoz/LSYfsdb2+p07tAyFhwVwLzteE1PaRmwkKMBA1IlT8iG0Kw8nvBbnwIhD6B0FMt/bg2mAIr6d3G+Bbl10/7J5j3IYMHsGM= 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 1756383812418180.69983780808934; Thu, 28 Aug 2025 05:23:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbSn-00041l-Gb; Thu, 28 Aug 2025 08:10: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 1urbS6-0003K4-N5 for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:10:02 -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 1urbS3-0007MJ-Bd for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:10:01 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-7704f3c46ceso756304b3a.2 for ; Thu, 28 Aug 2025 05:09:58 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.09.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:09:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756382998; x=1756987798; 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=6Ulz3SirsMyYujWtkTw6iUw4FJv5gccJWDEX7jaEwA0=; b=spDFfu+5aoUFFgkntMchOp7wFLiMuSeUq+zhD9LoOeQaB0dMvEEU2b5nNjuyoxWb56 AUngdJYeoKPxTeuvWm+D5/rHFlAGkrLWMQsHq7aaMzgORKr+HeuChCk/2+wSHQJfU0wh dawaD4+ni5Brdh5CNapBF5zeqf4mC3caW9rvN+dPSBmh4VOOrQKCOhyeqKgc7EfdBJr7 pV9F/bSdbveNx/TeoYLrRsJkF8XwjSfYQLtLYdn2a2ma7j70NKhO5tdiTj7sofx8HkCw VuWE9qdI+paUDosxq8DOBwwbSMY0sjPSPuQoG3iiLyVLxplDZY317FCLsFvdUXiHKtAU 9eHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756382998; x=1756987798; 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=6Ulz3SirsMyYujWtkTw6iUw4FJv5gccJWDEX7jaEwA0=; b=goH4tfK3uDw+ojzpQVZHhpUvJThsmGr5Y/+TniS+juImANzR3OQSHYtH84kAbpi1cR TUrd+IyU1vmGtNaXHn8ZXIpj/HmBGg0yTRkT+XGHZ5tW2rsyPbgzGxVN0epJuvSKCZRw IVcQGvwWRP3WR8X9gbu00PFFrk9EMx7lQZagHDOe3pOZ9U6G56PTkVQ/qn+0YLF7hfPv JEcWniliQti7Lqvfgg/b5UXQ00Aoa9wePTxkF1Iz5BQyhF0/+df54Eg8Fp1ipARBQEIs tvIemrgLbewKutwL4hofTgqqYh6QRMRxxhDn9Hs0oeKj9ycoSaPu2teHOhMbNlajbsFz Zozw== X-Gm-Message-State: AOJu0YzrYtbMrCPmWnxb+hiWpzLO6zxgFsvExUTCdshgQv4/m3UkrlfQ KMJz3kTTYwGyg0HBKD3cbkQ1DeZX2ccIcDQ6t0V9Arcy4rTEN+rxYbfRC/n379YJzI+2+OVwqgk PXqgpGL0= X-Gm-Gg: ASbGncu8oeIxuH2nMh+CMWQRe1aHEMn0K2Q2QLCfTQwAIGDDdEe2C+e3wrbOJb/8jkA MgEUtOb3TAd7JiJNbGsESPAY1vo9LzT0uJg7VbQ56RMy7pUPuqtD0eBN8V9zI5SF6lRuCy5TCQJ cL8j6Y/5o5PuS/2bB8YKNlsXRT0J5usYkeVJhsNkbvfnMgR6fHuOOegomxO98//QJF7AD2z2Liy mFRkpYBu6ZzqhzueE+r65Je003SZxDjyKEdlpHxea5qX+NdksFgg65pkSXbBiELGfueR6EPivwW ojRDG5FP15UQZzuNW60oFRAQeJlIqPTm6A76YVe5byrelUEF0oB0RAfWDlmv4aIWlML3o8dKJny Ur8FyK4E4/QHkVuKlaHgSog7NgmsTpuOKsvzN X-Google-Smtp-Source: AGHT+IGZaK9KBhMCuVKP1aUyl3KgV0YDTrrRJboXePvOObWZxfecEVmzK5QGHV+Wsc87FDZEHnw65w== X-Received: by 2002:a05:6a20:12c2:b0:243:ada0:3f21 with SMTP id adf61e73a8af0-243ada0427bmr3352544637.33.1756382997748; Thu, 28 Aug 2025 05:09:57 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 32/87] linux-user/x86_64: Create target_ptrace.h Date: Thu, 28 Aug 2025 22:07:41 +1000 Message-ID: <20250828120836.195358-33-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756383815605124100 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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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..ba162569a6 --- /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_rax; + 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:25:45 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=1756383627; cv=none; d=zohomail.com; s=zohoarc; b=N4uKCTl30Fbe019kK8mffZxAHGIlNjvZ0nEM12+Jp1uOoBls9yEbw2HOM5oodL4+x+dCkedQDNIKUby9+PUZld3GYhwa63rHMMODYUSYDZbzR86ywR8ADv7cu6wY4GymvzXtOGAiiGqIuRCdvE/nT5PpUpqdIABnga9tmG4kF8w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756383627; 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=gbyT5R6klG2h52SSw2CW+OGcOtC0Zmu7aFbJ12I/MfY=; b=HUny5kAy7joskRGA7hmLHSEwvf98YXWHJ2st/pAaPwtRNBMzpSA7Iu9SjWuSEYfsR4uo8A9c3R99mth4cx7otb/poUaYgk4PxEFkPPTQTrxVfs7BSC9LgBxWDC9x0emckE5LG23wpTV/36luy2PTjioz8BOxd368dhBNKNoTS4Y= 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 1756383627536855.9654991773406; Thu, 28 Aug 2025 05:20:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbX8-0000Mr-2V; Thu, 28 Aug 2025 08:15: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 1urbS8-0003SZ-Rd for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:10:05 -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 1urbS6-0007Md-FC for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:10:04 -0400 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-771e15ce64eso707507b3a.0 for ; Thu, 28 Aug 2025 05:10:01 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.09.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:09:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383000; x=1756987800; 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=gbyT5R6klG2h52SSw2CW+OGcOtC0Zmu7aFbJ12I/MfY=; b=kTT+HEjoM5aq9O5CaJ/UTrNDqMam6xjDMuA9uXHzx1qvgbhpo81GyGDQbLrfRcOOaq KE2qYdgd7PRc5e2rsC8UJnzP3EIvBlwj0GC4/Vouw8X+huo3+C3SUIfItq7xQtzNE8SN 7cT9mMAFgbcRYlFKMNf2LtvXq+5WgGDbA9IriLMJhHdwxpWZaeZ/b2S6k3e8fUBm/sXo 1/+Kb/vbXYpGwuaOE7MCq4woKWVGkCakq1V2vPBUgEhyMsLVLAcudBdmJ6gcURcWDUCr TTV+jrJ0HRu7Yiikh01iHQzzL1jLrYMWLMOoXQPnT39AMk1XCWmjQ6OYwGW4s6qa73Ac xC4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383000; x=1756987800; 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=gbyT5R6klG2h52SSw2CW+OGcOtC0Zmu7aFbJ12I/MfY=; b=PIEL7ZPokVSc9J893q/AUlRp6JphBbve2am7MyXo3oCsDA23o5k8PexRebEnZbi6H7 sNSsB52E7aHhdYkJGtqgA14Ni3QmFcAXzJMdiyUi/QsMIhrdrksKRRmXzREZTgw+4Ob0 xkByXmrlXrtjswaWmqqnDKzikQRt3aQZDSYoKcDHauiyGgjmReJHy2f7H5E82N5eoAw6 rX7YysZNIwaM2AN67mVPOTvORsvthbJk4CLBxCVEWRezM+S1U/+7vq/iiQCyJCUeMVyz udtPlFmdmol76s2fzbuIszj13FsTqX8TAOuq/17pMv+IUT26bKf3uJqR5aKPodDx8k1x e62g== X-Gm-Message-State: AOJu0YzwEt6x4uJUTWSsbR5cNe2ywa0A+/jVIS4+knZsdqtByw1zaI5N TR5lV5KipYmF2cUGU3d69Q1RMZTKDSyZdGCuhg+5ZfTu7yiIT32cm/b6NGKlMdwzADh5gug8dYM h1SLVopE= X-Gm-Gg: ASbGncu9saiaSEqFHb3lvCVKN0iQtENXN6RzjQBaA6OAssF1Ok3ZESLraBS1cXJMOJy HiDx/a8EzbdCsxOIXe5cV3zWviC/uKTip0qwKFWES4Tsd58FnufIUuYIHBqQr5BZEl25+b0Hi5L IpfRwE6WmRHzTBmDQQb/PkywNPx/sC1c9GhSIjwdYi+dwFccJMsEwQ3n+LQgxNRkdPpTBjOg9KY O8SOTgI7EV+nIUZSNzRRsj6dmrtPcxOiDOQzTctSr1d4nnRiXZ1GK/NZDWAhSGFRyLjS69tr0GX qQMSOl+hb9+MQZ04H9ymMqhfD7MZ7wYcn4q09niUhk2up1fX88WxLFQCaqzB0HhXF4RhZ/4wsC+ UZysjbdJBIBLIwMArxUJv8RvriQ== X-Google-Smtp-Source: AGHT+IH9HHKYFZN6TNeXQJNK8uZ34VS/txk5MWqEbvTDd8VHT5FTD8/usHhc6DZufEXNxL0cdzIl4w== X-Received: by 2002:a05:6300:4ca:10b0:243:a251:cf46 with SMTP id adf61e73a8af0-243a251d3f9mr4837606637.32.1756383000080; Thu, 28 Aug 2025 05:10:00 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 33/87] linux-user/x86_64: Expand target_elf_gregset_t Date: Thu, 28 Aug 2025 22:07:42 +1000 Message-ID: <20250828120836.195358-34-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756383629075124100 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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- linux-user/x86_64/target_elf.h | 14 +++----- linux-user/x86_64/target_ptrace.h | 2 +- linux-user/x86_64/elfload.c | 56 +++++++++++++++---------------- 3 files changed, 33 insertions(+), 39 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/target_ptrace.h b/linux-user/x86_64/target_p= trace.h index ba162569a6..33527127cb 100644 --- a/linux-user/x86_64/target_ptrace.h +++ b/linux-user/x86_64/target_ptrace.h @@ -23,7 +23,7 @@ struct target_user_regs_struct { abi_ulong dx; abi_ulong si; abi_ulong di; - abi_ulong orig_rax; + abi_ulong orig_ax; abi_ulong ip; abi_ulong cs; abi_ulong flags; 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:25:45 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=1756383553; cv=none; d=zohomail.com; s=zohoarc; b=dZwo20ALYl35up8H+xQu69fzjbPaLAXmxiPfpp3Ybuf44BwWAFFZP2i7CWzejPJy2yfUw46iC2i+ZVzz+wZCCNbo11pa8HOHXKyA7P/8dF7+CfFmPgY/nFKfst+I5UCPa0MJPMg+EnKUSd3FBrB+AG/dQ0+oODPiIh4vU733Abw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756383553; 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=JxjMxi/5KR08xw8JnjOd2CrQg8f6S7OfdVSLT4S7fM0=; b=Iy9B2pTZ1aabhCfjHOPlwdQiyon/QJQ05PPvEi1JFTWeqvwoOL3v4RqK+a39Sv4nl6X/LROxfMP7IUNM3ZVpADbv0Pe1vsUgFgApMLKFUB1hSe0zqTTYVMKxKEPnPAILRCtnyTXGnfjQ54XHHLzyQ2y06vqKf0I/6ocdWOUzvWc= 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 1756383552998363.4896716792075; Thu, 28 Aug 2025 05:19:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbXZ-00012m-R8; Thu, 28 Aug 2025 08:15: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 1urbSA-0003ZB-F8 for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:10:06 -0400 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbS8-0007Nq-BO for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:10:06 -0400 Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-b4c3c36643aso536656a12.3 for ; Thu, 28 Aug 2025 05:10:03 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.10.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:10:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383002; x=1756987802; 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=JxjMxi/5KR08xw8JnjOd2CrQg8f6S7OfdVSLT4S7fM0=; b=I6D/y/wHVGkOJiFazYmsYO3HNTC05jXtLcmXCeFDX5uOhBktSSBso3BMoDWL+42PlG h2EYMjedwofu+Pa1Tj4PCY4qRHuph9pMS7CGM8KVFztM2yVRaJ4SsE8Q1iCAY+nViXAA ic8N/Sut9LS34LBo76K41yEa5UcEs7tc2VlCP4lSyVc47cQp2MEfN9n9/IvA31z9aETr EIXXVgScHuWQW3durAfBliqrbdd2+jZPQcPdHqfIGxFaedaaHYFQDJoT/NCkRdMVARy0 16oeBCkFHWbxXPgN9mfXDk34BTRWJ+ouf+lj/Z9jlsBwOEEvMvR0Jy0Z1NRvuvQJ7+o3 3v2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383002; x=1756987802; 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=JxjMxi/5KR08xw8JnjOd2CrQg8f6S7OfdVSLT4S7fM0=; b=Iawmjt1xXezBsr5KiOmub3tSnRcLG++n4prf3V4ascsHQ02bOvJ6aPpPAJO9EkCpJ8 PH/1Qwx6h7is6FV30kvs93fYNFEAgaaRcyAE2WQPbNYiMecx4ITa6dQi3A2UiE5xvIDZ a+GSKZHQfoeL0UkNeYxqesOd8RZbejvnPtEOqA+ebBzu6oqR6azAw6lXSaAofQk+NZBY yyA5nFK4YbzFAJtDaPOfu4vQ4iiKPZl8pUe9E8WaUZCymu3iuros9b4jqOguZ98+knQn L4xwQsq26yAUCCz03aOVj/L7K4HMG7ISXPT+xprI0I/GROtP/P2SnqNuqRWZA2KP/qnr R62Q== X-Gm-Message-State: AOJu0Yyjf2L+Rs4/5qCSk8Gt5NER9oBsVabCxS7T9ImL3e/S4Gj5NlSw qvQ6rrAbWJ40quy5SkHnV7XI+TZpOPDbb6f9mjg2PzBb9DmhyQEl/tUmMFYrruBMbxr+Pl9VabB FWh4y4zc= X-Gm-Gg: ASbGnctP03gd3QC8jj7KVoCQcmKMInVtD7TW440jVyip4JhfeBy1z27ED0IGCBeeVju dsuMgCXcHRf47aSbk+5un1tydLELfDsSXH1kClglDDIcn3jzv+GmgAY0Eozuu93naGUcgl73OuF tv4sYIxQCRuvQwR3YsUlN/mvUw4orTG8GOKE36MUzHz9W/qqqArovEowzJkh2wNHY8IhxmJFG/g bVrK3ssi2jexUASyt4KtStHiCzSCMl4kwu1hheM5D5deHanxLU819JBz8yjKPWoLOSJdknmLHZe u2zGg9R/uUKnh2UUYOboFRlUQwaDOMgV//uyFa0+f9Vna/0XZaQkHNzZ2osUbtgP1dmI6w7DwRU tNEvBh41SXg4dYp4ybExVgodEjWC2WzDw719XruaTlBQdKJU= X-Google-Smtp-Source: AGHT+IGjrPVrdxlHQMCnomsOUJcBHjCk7wL9f9Zbb1Wo3CqSJHpnGs6s1YzkWwmXqpGVy6eSXjoLzg== X-Received: by 2002:a17:90b:53c8:b0:327:cd72:36b9 with SMTP id 98e67ed59e1d1-327cd723a1amr556219a91.20.1756383002479; Thu, 28 Aug 2025 05:10:02 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 34/87] linux-user/x86_64: Fix dump of fs_base, gs_base Date: Thu, 28 Aug 2025 22:07:43 +1000 Message-ID: <20250828120836.195358-35-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::536; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x536.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: 1756383553760116600 Content-Type: text/plain; charset="utf-8" We were storing the selector, not the base. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756383720; cv=none; d=zohomail.com; s=zohoarc; b=a1piQGM/M+c2NRPNvtpYDCnqOa01820ozKS/wY9mHRzjHt2xEg9DVO9JX4cxU5xfECTMHQOtX42W8X7LkhsIzX7Yyb8blSDMxTsQuWoiCn2vremB4QKKd9okTtt19bRPyp+W+6sZpzcbM5bPTu07dZpbfUr6Vfxp4yGWX6n91+Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756383720; 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=ZKWlfACAb2jBlO/Rna9hUlVcnHuGXsBhtcGVWRIaeSU=; b=czc3d0QbZiq2s9g2mwqHA1TaFr5sCafZMs6qo1seFSp1DyABOsLdUWuiMllmu96Q23HMO+ekEYe4uEnOYl544x2pJz9LMAkyshQheBkeIg2UTUaex8GZHAC1uy6BGsbwMxhv2lvRWIfREStSqGBuUiFtfjmUMn6Oah5vKIJeAXY= 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 1756383720946802.4721131031306; Thu, 28 Aug 2025 05:22:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbTz-00064c-8G; Thu, 28 Aug 2025 08:11:59 -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 1urbSE-0003lD-2S for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:10:11 -0400 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbSB-0007Zf-1k for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:10:09 -0400 Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-325393d0ddaso647518a91.3 for ; Thu, 28 Aug 2025 05:10:06 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.10.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:10:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383005; x=1756987805; 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=ZKWlfACAb2jBlO/Rna9hUlVcnHuGXsBhtcGVWRIaeSU=; b=FzuTBw4OCrOzhdUh7HAiej3lraUNf41DfNgNWgDzWFWjWzAgggMktXAXYti521XMCi Rr9EDhlFbjbAt4RHYQkk7VYQjgz5IPlEIT7Cy84S6SIyYLjfY0mz0cyYeo2R4chZ1hBB kC3XtPMtL/grmrT3DTVhKEopkhBQmqnPaqy8AS1AdC9MwjTdd43x2/WXLeTzNUbmNXEz bSrRBgrgLTfEtxf4a/DEDK0QpeUaKE/Id+Axdhw4SAZ/gkrhhTAN72o8AAkfphybhCcs ldPzLBdko3sm18MYrpAJRKFpXPffRu9iD+2cvMWJ8mnNPn1I8t2scV+seUXd/pSthdBy ihGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383005; x=1756987805; 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=ZKWlfACAb2jBlO/Rna9hUlVcnHuGXsBhtcGVWRIaeSU=; b=ggPE20dEZtxoyKyTFCs+h0w7mHfEv8ITbrp7xonq58cTmQbqPJ4QMvWj+hrbHSH5eM mDI7AVwyKywo1iTkerer8Fq3Bbkqkc1AcgabcvnQdnMxTciI3g1HiWeGxDfvNWOlRodE aM1Z+V/YcjdflHabVFD5p/H9fkaCNmtSBp8ctcvamj0D2IIa5cg7t3NqZ+WSaZOvbptH 4Uz+v8UHsnq+VGi5tv/sRYtZYTYKoUQE+Q9srsfhwQBpWC6np7+Dhd/o7itobW1mJMtp zaHp4uY5JjmcTInjD1tzaSJV229UgkdREFDUDqSVOVP/ouZWR2hrPVT92aWbVipf733s E0kg== X-Gm-Message-State: AOJu0YzEQTrnk53j81MkJjLwi1FQrTefPOsz/jA1TwZwAe5BYTBNE3Vp EJmSQDV+uNzCg7jlnMDg4EKt4pdha6yr/VMWrmQDB9XOc1MkIjZd9UJZABYP/ywnitZ4HlfMiXt qNlzX6lQ= X-Gm-Gg: ASbGnctiq9rNfJCX0DNftGRmXuDZl6EWjeucoAkYr5/4GihiPta4w4W2+/qTGK5lGFu fshvOBEvwWv870WxxsRj494/V5GGg2b0AoZxxR65vlSU/KTb96d5M+4teWjskYQGWWNZNmhNEPp BgI0XIDlUFxpcw+i3Q7fUyxmkPVjFhlLiHdGqblKyUIfbU263dZsy0akGgkbKovWO+5OuMQBNHI 7DnoB8sCO6HEE5waiMU8DW5svARq0anI4j3iut0tI2d9TND5foNgze6tszMOhSanijPKt13hRXs V+N61KtAkJ33grIVv6MhBfNtgHuYATmhvsRHDjQmloYFfEWJJp2uVCOyW+pY54DpGbFykZUxivn FzgsNdtsrg1OHIW89mHlpv4nmqQ== X-Google-Smtp-Source: AGHT+IH7eROIhV6B8SmbtVRbz6Oq+Cg4rIMb4jamE8AbGz7UBsn5pYg7WVZqnco/njQADeyQb546uA== X-Received: by 2002:a17:90b:5443:b0:311:f99e:7f57 with SMTP id 98e67ed59e1d1-3251774b90fmr30418823a91.23.1756383005021; Thu, 28 Aug 2025 05:10:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 35/87] linux-user/aarch64: Create target_ptrace.h Date: Thu, 28 Aug 2025 22:07:44 +1000 Message-ID: <20250828120836.195358-36-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::102a; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102a.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: 1756383722653124100 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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756383477; cv=none; d=zohomail.com; s=zohoarc; b=F0bR3a1Vlkh2HEB7FGgpicBgIzr4kdIRMrdz+tTfNJDYTqTCNqlcmi7Zpr/Dn4bCcTy/YwmgwmNsN60TofKwNuqkNO1cezKM69/HxOQZn27VeXBIf0MljZkt3/ZgI1vuYPuJ1id33qKk7cBkHn5oL6Ic70zC4OzF7VDuQBRPy8g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756383477; 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=sGKOMxTbtB0fTMjFgi2SLDv1p+aCDxxUGh+EB/xA3MU=; b=diyOCbRK1kkDJcCej2tR0KKBOPn+LupPbnVj/RrNyxh+Xu7bvdl94LGy3KivsWJ7tAVanSwzeQcmkJspfrI/QOZ8DaE2fuoM5Q0FiBEG/f2iiKtocE63UTb8Rcf8ZU6cBNPs0DDXshWLD76RoAc4JVLEylKytA7w2XehRVtaN4o= 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 1756383477273716.5090986831825; Thu, 28 Aug 2025 05:17:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbTz-00069i-BC; Thu, 28 Aug 2025 08:11:59 -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 1urbSF-0003lQ-I5 for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:10:17 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbSD-0007aU-CX for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:10:11 -0400 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-24457f581aeso6960625ad.0 for ; Thu, 28 Aug 2025 05:10:08 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.10.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:10:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383007; x=1756987807; 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=sGKOMxTbtB0fTMjFgi2SLDv1p+aCDxxUGh+EB/xA3MU=; b=dUfHiygZbCqD/wbgc0SFeBawkCBc1giAd6J6g5mJOdt1McC3/IkrkvXJDEG2kKixET C2oXCpowIj26yg2x4OFhkaHie/LEZGbU25gNuubqv3pdrfEG2LnMlWJ4peUvNxFLWY49 rteHEmX7R+XmbJ5hrhI+P0nVFZbHiXssQk/KuIb0Ce8M4U7C0qt0WshC9sJi1K7Ej/c2 ejbOrerNB046tNEdYAc9mONlz6i7D0x2VY2H0kg9CFLpEAoKckmmqQbx4K9XPzU+GeMq u2lcDM76N1qkk3B/1Lx04g1jQsW3wWcLFHTLcgaYo5aZHLUm+h3EcwCTwd77LyPS9gxk JJWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383007; x=1756987807; 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=sGKOMxTbtB0fTMjFgi2SLDv1p+aCDxxUGh+EB/xA3MU=; b=jNdWE2G0RRYZXIF/CNFd0x8Ukrd39A0s07qQhhd2rXHQS/YeD6NGcNdJfbAc1lSlET eImHfIRU/JzUOK2zoLhcX5x65KUxuf9UeqMEjQW1dn2FMMTiRiF6EnOCLEvOtDLeldeG ELEh6V09M0ypr9fBC3w6+d/lTRx8DoRddamsv/H4TB0NpyWnEktSnuD4kkZAryRBJC6m wbmZTweqthp/n9ixcZbrHVEsFSp5edPWEzBnx+MtltJPV+CRMtxX52fi7XfhgfKHVzOi 8LVvRgGQBpGfYaby17vGQTtOB4RihYpPNi4QCZM/IsKj8SccR2NzsxobYQz0YVVkN5FO GkHA== X-Gm-Message-State: AOJu0YyR6OEmeRp70aFHnWrzoDU42wsaf7R40oe+eSfpBKAkFtbz1qXl wD/5vlANNK03Rc+y9czmAn4d8fK1/FgoZFlM2dF/rb3Yc/AqWLn5V4ak4lWFog97atd0ZyveV2y c6XXw7NQ= X-Gm-Gg: ASbGncsOVdTz9AuffZcsI4WXhCRGLbR4Hrvo8OV6Bavf2oHK9iqqF8wA5teQrmgc+q9 Gx2IQZSiPf5KgLMCDDKnznaelp6Td/eImfvpx8Y/0uYh+CAaeYNaSRIm6DnePi+fKGlZ1kaY+YI 3AiXNH7b/GtVaD/540mwqS2sgYSF5K6bGT/4kC0dU89Yt5/k9ZLyVjPi7370On5euQsgWZtkTNi 5leeHmZblQ2YONn+ITV7Xv81MM960iDZ2N0RQsl2OzAon8N/libQ8n9dKJ4bWZH6aTuFCI91JtZ mjA2k7/odZjarouPws1h6ixn5fAkNv2CIej6gIMEfLXQBOX3/49e5lIkRqztBzqgh1D1eguT3hR g2szn0j/MuI3u8AY6kciRmiFdvWS6u1CAOJ6M X-Google-Smtp-Source: AGHT+IEVXtxT6Fz/SifRKsKeA38aHVbkfWebjxmuyrvMNFAp+zLpmxGWu5yMIqa8bA/8/2od3fYfgQ== X-Received: by 2002:a17:902:cec2:b0:242:9bc4:f1c9 with SMTP id d9443c01a7336-2462efdbcc7mr304676725ad.56.1756383007378; Thu, 28 Aug 2025 05:10:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 36/87] linux-user/aarch64: Expand target_elf_gregset_t Date: Thu, 28 Aug 2025 22:07:45 +1000 Message-ID: <20250828120836.195358-37-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::636; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x636.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: 1756383479168124100 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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756383622; cv=none; d=zohomail.com; s=zohoarc; b=K4hv7naiKEGGt/r7pPddHCKQRdXrlyY+IWOElUS+2QU4cpJysoENWzbAPF5uEmMrZudDE/jysv+Ad2IT57rt5Kpsb9OsVxkVdMY2/a7/OUXb1a9sfyxdpca/us7pwxNpj0Wm3r2p1VtjTrihYPqEGPcyYVRX0fhYneJVYNh33Lk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756383622; 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=HQ8MCfzgPcpFB4Sp5HSK1NZMfg3qe4D8rF6fwIfMWoM=; b=Lqc0WTpbpcOB8e4yYLeJ+CGMuM3v1gsO06AbGbrw0ZtNlMzWcnkntUqLYRAiubXuc4/wQqYiMD3qX2J8BvJSN6RsaeGksQ8tQQ8GJMjGj3LddiZ9MegYedkUpTExfsXBaDBIxTsjGq/yNR/kDSLMogERXzLQUa6St9MtnBUksZg= 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 1756383622736309.5657185586142; Thu, 28 Aug 2025 05:20:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbTw-0005nt-CU; Thu, 28 Aug 2025 08:11: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 1urbSH-0003of-GM for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:10:17 -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 1urbSF-0007bk-Hj for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:10:13 -0400 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-771fa8e4190so678506b3a.1 for ; Thu, 28 Aug 2025 05:10:10 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.10.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:10:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383010; x=1756987810; 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=HQ8MCfzgPcpFB4Sp5HSK1NZMfg3qe4D8rF6fwIfMWoM=; b=Ow7DEsgU4fYhNFvMcOvc24G7xhBCPWGiYBgWMAccuXO/TioHKWuwN1HdYTWVo0kSiH gNP+RRtjlar9eElSqWjj9dkCuaa7NyAOBpM/0KS//0X7WQBHzMrgHKoo1gRGJLQDFYnU oRFbMsgt85qU32bJqzTxp+42fyUinnCUYIOOAzgzLwYkPtYWLc9jwsDWUdNJ+PEAO2X2 I9dtrZiEaI8wNbh+32WQsLD/0IhemoONW6Iaq3Q4Ox3iRZm0oU48VHN1kbH49FVc+sHV 6rQYOAiOJNUZyxZG9H08ocj+6McXTdUbymAEtgBO0UQoFBHkSRgeMBEIiPcPDqvmLgal h0jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383010; x=1756987810; 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=HQ8MCfzgPcpFB4Sp5HSK1NZMfg3qe4D8rF6fwIfMWoM=; b=VzW72lHdijrYeZcbTe1wXdbje5WmDyK5NzFndorF7V1MsnHN1uXiDcPve9ttqpO9jD L7cb0rPskcEMCUslQTP0F6UWOuheADwcUnrfdGjlPJ6oYfpgIxUx4cQEA6l7SbOyoyx3 YcYU4wbRhfoolODHAqBXgX/FkI96J0/iEDt7/+tTNsaEf+T+J0UiGpB2w0PjMTjQeb86 G2eUo/wFqPhmVoEigO6X9NhOXsEDEz5iD8tg4KPEXqO5n9V5kPNOJH1zY7+EV7QP5ao4 KcpypVNFyE96pcf9rJX9GhoO0GRixqh5gMVmE3vlvngoE/YEYndo5AERd02A42msodzY 467w== X-Gm-Message-State: AOJu0Yw/jb546RzzcJCYoBl6PoVx7BBmKliKMaa5Cio2KdlGBdBGPUg1 tvlNJW2pyRfeEe7NSBFnV75GLHsxSOh/V0GRcgJ6/MuulsPORDk5xa/tBv3l1hSOqcMzoTZnDmB Eakv0GeY= X-Gm-Gg: ASbGncsjw77A52G1YoAklMq7wcen/WYXIIJRm3sCMfc5gH7ECY+mRfw0ulSacWZdiE1 J4evM1LrcePzRCJ9MB3nNeX+99Pfgt+uaIycEE3gWNgISMDG9BxbDH2QQlt/twsFgy0e/3BeGRy zhK0lf3oWZF3ZRDPgVIwbi0EZGq6fa2HPvk8Qtw5YKCsob8xiIBjPmQ89w366U+up/T+JxMdTZR fqS2OqPwuYPQ1YHSZUs3VykiIs4vnTMrfwSOZA0iJWLwX+i3mQqKztjK0/ZCw2a5A8Ls5x1YUyC fPlRoERrwZtGjUsyzDU4dlt9Vzdu7BAc0kE0ECoQzCFx25uchdDhlNMfIaRAj8hECNXcSpWyCca LwmLmLaykYqvJgdGn/daw61GQW76BH79Pukrd X-Google-Smtp-Source: AGHT+IE2EfPxmQCcWQa9DYgi0N3XVD7sJr/8RIvYSReOqU/cRUchYAGU8pkoVflOh5AYqZ7MPaAquQ== X-Received: by 2002:a05:6a20:7495:b0:243:78a:826a with SMTP id adf61e73a8af0-24340dca336mr36236201637.48.1756383009619; Thu, 28 Aug 2025 05:10:09 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 37/87] linux-user/arm: Create target_ptrace.h Date: Thu, 28 Aug 2025 22:07:46 +1000 Message-ID: <20250828120836.195358-38-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756383624605116600 Content-Type: text/plain; charset="utf-8" Move the target_pt_regs structure from target_syscall.h. Replace the array with proper structure fields. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756402695; cv=none; d=zohomail.com; s=zohoarc; b=kbWZIJwTyFwNLXriiJAX73+W8d0jVywzs9arSTLD27kgJmoyprRG2LT6d7ZWWoYJNxuWxONAbAIHfgJYGK5vHny4/ncJmkGA/KBbBnBiaIeL16lsk92Y0N6FtLavhDSECEcLyr+8O7SS5vPD3AJExoUI6ZjQz0IkCAFpfxWEl2Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756402695; 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=uExtz+UYbxm5QWgAqrxDGVRQ9u1WmoijCeQeuh+Ni88=; b=h3rVj+9V0paAYo54NFa6S+f0q5L17e53pPExGowF4wo6br23JtLNBO4MIfBOrYv7e3+4LSZ04x/cH8dXKu3H1WTd/OET/otI8RohuNFfGN8NkUZzRCPuqVuSlqM2qm5XA4crLYNyJYDthtn6L4rR656O6Ctp/H9zYQN1eS/6x0w= 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 1756402695313670.0383648601618; Thu, 28 Aug 2025 10:38:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgHZ-0005ML-HI; Thu, 28 Aug 2025 13:19: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 1urbSJ-0003rV-Rr for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:10:21 -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 1urbSI-0007co-2o for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:10:15 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-771f69fd6feso1072165b3a.1 for ; Thu, 28 Aug 2025 05:10:13 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.10.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:10:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383012; x=1756987812; 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=uExtz+UYbxm5QWgAqrxDGVRQ9u1WmoijCeQeuh+Ni88=; b=pg7/XkvbQ5HzN8jBKHoZiEfeMDfW8U/MyQH99BAs6gBTGwZmJtbYKM0ctBiQaBLJBO Lni5iXBlVsHBukPu5tT2pOVhWgcUVUi7NFtrnDrpYbHtlCNplgqMiucw4pVMKaWkSzzc kGIT+Xot6Se3Fq8XwdeYUH2dL/gK0OtBMAV6kY65pgkE5B0z4vl+Hz7tVvtHfL2sZd9h cgt+RfHCFlHXrP2afJMZgvrhiehA7a2Qn8WiVuO4TuwjagFNextM3IoELyT++7RNw++Y wVfjpLgDA/9h0hTSL76MDhoJOHn0peGHDqmfdtm92tOWrgvvcyXKjKx0SOJrfnNbLWRa xTuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383012; x=1756987812; 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=uExtz+UYbxm5QWgAqrxDGVRQ9u1WmoijCeQeuh+Ni88=; b=i+VMsEZ6vJ9V/ey3Nl6GkOLEgVYdjFOdx425wCkkpfrFt4H6Ei8XQg2otDvXLEc38+ Fd1IfNLlb0UAMYl8DFaojqiAgHk2MON9DlfgH24caecvnfydiMlxpOsw6s1HtEarQ4PC nMfysRK9XULbYvNLCeoBQEBVKFuYMciMRmhymZgizF+i8TIvtdLE7MrYoZtdNUqmOFEX eIFmOQ4mUf44hH/e6Om1UOClC1Jrf35eQBWqub2HaQ08yrPcNsUrqFxH/4h3P4XCkkAw Fv4KWqpfx3C26O9zDPkSH01wAV1lzDlDfIWdoeZ5RwWVoEyh2IYSs0PPxX4EiRVg8eGd cM6A== X-Gm-Message-State: AOJu0YxKLKREVSll/iCMOeajZl1CYKuBi21YSiIOzGuU9nyfAgueNFgF t6Lx4UEuxQkof/m78LoaVSEiMpBz0585VcQrJ5egU87qeBgCsgG/QslsF5OkuQlOLXNoVvck3i4 sltqDaq0= X-Gm-Gg: ASbGncsCOa1S5Ug3kBNQW7YVzCZe7Lg+orj31IWn+s13xpYqChK4S/1nUqnidDLiy4T NFODQ1WtXrGanfXMNniNYmBw8svAHX6vwEf1IwAGx37L/fj0dHPaEtfAaI4broMgOCQJG14Dbv7 I3cOvx9rLJFYJoPpxNNUsO1Y5rgKilRFar/wJGEvzmehi1tep86SmtNPJJPXJ+nbW9vOrLLQnbT mwNXzslJP0hKajggbp4Q7Ry8UNfVGiBGmx/EP4HtxgM1Og5CFfd+j5gp4woLx+hLCF3q6ObTWWJ PKBUjtwHMCrKIflvBQnoiRr7TAP+M1KB4lhf1zjnP4GzCJr9Ba3XyugWIFrATQaSntlpfQyxav+ jcLQXcKPZWt1Ue3QhlypxHtBtWQ== X-Google-Smtp-Source: AGHT+IFeYPFa84xwrRoko5mXUlNsBdRbncwhQTob5gTkGU2/10BrlJArk+mvL+RAe8A/7UIi+4eXYg== X-Received: by 2002:a17:902:d54e:b0:248:d4d5:8402 with SMTP id d9443c01a7336-248d4d58c41mr35605245ad.20.1756383011994; Thu, 28 Aug 2025 05:10:11 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 38/87] linux-user/arm: Expand target_elf_gregset_t Date: Thu, 28 Aug 2025 22:07:47 +1000 Message-ID: <20250828120836.195358-39-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756402698724124100 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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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..726d3ec25c 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]); } --=20 2.43.0 From nobody Sun Sep 28 15:25:45 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=1756383549; cv=none; d=zohomail.com; s=zohoarc; b=RHo/VN1UxB3tdwiZBHrV+RQTdP8o24byLi9XcgzJe0WdGT11QundHzMAxnvRBk5/YXr9Ro/cqkbjBijTwS4IIa0NnlMu7Y/SLa/4kHKrIsKyT8vqQblsm4BFdB83ouEOmdXn2G7uRIBjZ8CJZBOWOy2Jqp9ymrrsGXXdQ9QEWhk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756383549; 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=2uu0QoHntGkRrCcKzbvBagJt2LOtYz9fdewhkpWEHEY=; b=iwzJT15ycwyz3PJLkNFngiSgSqhWr0ui5DjaFRQHUGpp0LbWU+94H2EZ1ljHEZFf8k3B/m5Kjph3wv5R64ImbDb8YsY8E0KJqQ6OvQJBus9lAzQ1FTuFWApU8/8lRTjpgHM+kGt3Oq7SopDR+bSD5U8G2DOT2SYBCGGgx/y0zfY= 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 1756383549338378.6631813060826; Thu, 28 Aug 2025 05:19:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urbUJ-0006iS-9P; Thu, 28 Aug 2025 08:12:26 -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 1urbSN-0003ur-ST for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:10:25 -0400 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbSK-0007da-Be for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:10:19 -0400 Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-32326e5f0bfso727060a91.3 for ; Thu, 28 Aug 2025 05:10:15 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b49cb8b4b98sm13933222a12.19.2025.08.28.05.10.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:10:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383014; x=1756987814; 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=2uu0QoHntGkRrCcKzbvBagJt2LOtYz9fdewhkpWEHEY=; b=Ecq0Snavqaf7O9Qcot08A53v6nNSKmEDiq8IEQbBYUhVAxvLo+C5daxFktDQimx13P pvy7NcV21jqlxYN91ocdALU1ImzvmvdVY8+6rcdvXXJz68405MqEoovJXaA886AQ9ATO faMFgss2LE++ELS9xsH10GY4+4mwaXa7tSFqEoOP54PPrL4lYDoAQFiJR7ZXBCNSbmnr KPwS79bXPgiZW/onl5Ir8uELEMS6ZAMJ8uWc10V5C2BdOOknEBWKzGCM8YIhMDmJVBE4 LcANl6eDMqfViJqqEmp4Oraf439i21tWqyN2Pm2oqTMbSb5n+HyOf3TF9kF2rNdoRjTf E9cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383014; x=1756987814; 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=2uu0QoHntGkRrCcKzbvBagJt2LOtYz9fdewhkpWEHEY=; b=mzCeNN8hMJYgAZQZV9hiXPPrwk+0YmhrvyKb20Zi/hHqjHYNWulkcy4fdT7YzQxUx+ h6pZg8LIwNgFCj95KG/NuP1mQCBaVSmSG1RxY4iXv3H/DNeJsZbcMzUE9mZFvre+SCZR Poy1RQ8pOJLyyzeSBdHq1713Rjx5Xq077kCqmotPePxJgSf0qnpFx2JX53lzIYyww4XN hsGnKoRykJAeY+XoXqGkWLxrjZB1vpnFfCH5d5POi64lL5+t2h2pG/Y13ldG37c4hFRZ qmL58MI4mmgubVZyeHpPuakhDsCQ3v4UkKciN+cYjZghY8HSicUw3EYYN9qCykO3pXDo atsg== X-Gm-Message-State: AOJu0Yza6ow/VWNxUGFGcsamZax64vSRvSj9drRDeVhEdDNeBLvOP9Je E+UPDe7BpCowmjaXmK3avvfdhu28MQHhn+hf2Cwo985IWpQmupXQiRh3n7c1BFgFH+ZALfCKlbY tHNBYh0c= X-Gm-Gg: ASbGncv1nMHt+iGnhbi93EXsYE0FsLSWR8S6AGM1vdXqGEy3TTqF5IuOIrdKzEk1OE0 huyDBkJ01ZvdYWiZqw22Xpo5H8Cf2d/yk1KVZVTcLIWjMgb+77PVEvInKBzyX4sHC1zDKF4mYZI L9/LJsJgBHS/Mf18xK7dhtaOsalewnQMOxVQq6NFsp4iGL7z+vPbw5zq5Wt3p3SCEWvWaV+sjpl niOMa9fuNTZ4AsubpUbRqQB54VkPxIeJYikPV7Z36htsb5y4JdVpbmyR+sOxPnvPhI0gbtSMhxu NNjLgWC8G/dTBFHgR5ZDoVHCccNUGd6VN+ssU/m4oi4xDR6YqRpkhLkvtugQvv1SHmAMpWYjjJB l57/vi/aBq4uJP+tIdjXjlULnjVmXS64h6Lf0KiyFzG1CRKg= X-Google-Smtp-Source: AGHT+IFkDiWQfyXZgR5bdRYmsVGOzy8Gqovr46MtRtP+qCJmpkHBsiK53mUFgjnmqu9VbArzCVN3oQ== X-Received: by 2002:a17:90b:3c87:b0:327:7784:5390 with SMTP id 98e67ed59e1d1-32777939af9mr7222842a91.16.1756383014297; Thu, 28 Aug 2025 05:10:14 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 39/87] linux-user/loongarch64: Create target_ptrace.h Date: Thu, 28 Aug 2025 22:07:48 +1000 Message-ID: <20250828120836.195358-40-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::102b; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102b.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: 1756383552120124100 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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756402246; cv=none; d=zohomail.com; s=zohoarc; b=PLp0IoNZnadZekJAHtuaOdorSn37Xyy9JkTsvzyVsRKmJCiiW/V2qSQDxrjOJMGFWlaKxLrq81cJKIY4UldNpLV4olTuW2EzsWmEUr0YIn6VndUPHAkIi1lKT/KQAGccnr4t9wnBUk2miVL4KkHYdMPWTIQvpbStTdzQ4095NkU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756402246; 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=adyrdy+wc3AR55BfEtJwCQ42orjEroZu6e7hfMaKNNQ=; b=G+PGCrx0+1fC9sTUd1a2L9+bSQdeQqrlfesYnqm2vXZV4i5x9fzYyE0KfTlbL56WrAjOMXDSd+BPR+www1tR4ivGqBjgrjscfe4FZUqjPh9B9fd9lXv8qxyPKeoZYg4d9W9euf8qUBTJRon1pk8RPj0F549MCL4kDqE9UOFABKU= 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 175640224677267.96763056509371; Thu, 28 Aug 2025 10:30:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgFh-0001ic-30; Thu, 28 Aug 2025 13:17:33 -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 1urbVS-0007SY-HT for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:13:38 -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 1urbVP-0008A5-8W for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:13:28 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-7704799d798so707977b3a.3 for ; Thu, 28 Aug 2025 05:13:24 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.13.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:13:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383204; x=1756988004; 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=adyrdy+wc3AR55BfEtJwCQ42orjEroZu6e7hfMaKNNQ=; b=NxPIhVqbipkGH1uVVGo61LHCo3O+WxdIUreTx9SeXPndCaAtu60BcoEYejvriZyOsA NCCOmOx/eMLpV/2f7R8tJ9iSdamGPaOiZVQSUMge1ftiSJNAkJJzDn9oTstzkMrAtJqr xbkL9d3KAjVFtiwuY8tdLlPYs4sqXz0tX090GIMxoar3B8Bebo4EWAPVGFE0xsVOj4TW o6EK3MTC2zfQICo7dgc+RAR1AiQG69+G8YN2SzhJ9IakM/G7CG0oZPmq6eE4xnEl8jzA dvV5xaCJx3isnxZ7q36ymTw0xUwz9u0awDiKGAeUlIR6QuYyH46TELqd1ZZtBexzTeaZ mVJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383204; x=1756988004; 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=adyrdy+wc3AR55BfEtJwCQ42orjEroZu6e7hfMaKNNQ=; b=kGmG2I2YZjWrz3qWavqVRgocfC5sr9tUIUYkI6I0IaheRSfAWO1GAyj38EKj7+vx3L s+mlqCe5t4ZCMM10wPE96urPiXMGgfU4ruvOFr2FIEBZiQvRH6cUv7G3bT9HVSgcx7PT qjC0M3gBF+b4sNYT+JkQE8s87fYiRc2KMlBPpDeCOC3YamhE2Uun8+Q+ISMqX7hXHril jZXUBpqee2ftKeYgz3IFbBKHp6PWY5vNYs43ELSdACpNyX3KmeZim3z5jmikJiSIS3yS lkyRJ4aAgMeDW96bMRl+GrY4iEkLHxWUBiuYiCl42m4FqoXqqjK3SlvQCd4SRea6vzg9 vm4w== X-Gm-Message-State: AOJu0Yz3U3B7yYfeCiEQivBsW9tYse8SCNFrqro8+u1Sq1lZEMOTxhQf OmJUWh0s5u3GcjuY4QDXZq2/xxB6S1dKyoXgm/MdnLKBBuLCp9Oe8NT/SEDCjAl4UDBhDWFpPv9 N13x50hE= X-Gm-Gg: ASbGnctc2JQ1aKTD+pScguRDNB5/HHj3P/WxYUe9ivofVrAzhOPC2cnwgcOy3GWDjgd BqxJMn7AcOatMmMMya65/C8mVeQMH4RoZToyIxo6UWLrUMqC22I86DP4P25lbncFsHzYPzTSXTD BViPp51nVT9lFYhRBQoRmNrTINgJpx6HN4y25YN9dHvIlyRLKUpjXqcCe3jBG/OIUx6W9r/lQcl 2T5gNxxdBtBtUFJDEuB3KnTZJJpqZfv/PqxqN0QgbHPUTsofnzXGNFdNiNraHetlpji/MTsiMnE dbHuaj/QZHnVMg4QwqQgTbD+elLExEfKB94emx/VUuWPonybNGYI9X6KR6As1PDIeVmM9OzsXgA S4xpzfG5xVtfw6oByRCNXZRIq2Q== X-Google-Smtp-Source: AGHT+IGW5kv0+M1tVyOaEctYjHfWV47syJ5cy7Zd8VQE2FikXBIfvVH9kggSli7fcKzrS4g1o5VkWA== X-Received: by 2002:a17:903:1988:b0:234:f4da:7eeb with SMTP id d9443c01a7336-2462edd7d61mr315425495ad.7.1756383203546; Thu, 28 Aug 2025 05:13:23 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 40/87] linux-user/loongarch64: Expand target_elf_gregset_t Date: Thu, 28 Aug 2025 22:07:49 +1000 Message-ID: <20250828120836.195358-41-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756402248826116600 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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756404583; cv=none; d=zohomail.com; s=zohoarc; b=KrOwLgu1q8tUpMkYO+U6Tst9YIO1luk+FGILaHr/zClL0oWst3zDeHCsszLtmI/T0At6UqOQkG9EeC2tmlg4Od3dJoP435UyyQ8IvTFkEiJYZrbm1Dm8+4zc9C5kNJXJsSfiV1oO2mUrQwCvX8o7SEvvLsY2VnMmJyX6D8vLsKU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756404583; 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=b9WlSjF0+HjwhfJFeJ6DVK0cBfr4XpFmhJQo+afKF+s=; b=ZBVt3ycb/76NjpLBRZfPKLNMMRxqhnFVIPm/ZlfpbAMW3iFtVRgLek84G4FbFzvWfVvgt/oJKuFN/fIdZ0IqhCq5AZO5v2Tujx5i1wIXYoZvIhC2qSzPakcORBAvaJKvPymSCd9Wmdgq6cqVzhWwlOaen10+sh5K4koowfWfrXE= 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 175640458299260.47608320697259; Thu, 28 Aug 2025 11:09:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgBm-0002ZN-LF; Thu, 28 Aug 2025 13:13:30 -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 1urbVU-0007VC-Tk for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:13:39 -0400 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbVS-0008BC-VI for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:13:32 -0400 Received: by mail-pg1-x52d.google.com with SMTP id 41be03b00d2f7-b471756592cso598085a12.3 for ; Thu, 28 Aug 2025 05:13:30 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.13.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:13:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383209; x=1756988009; 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=b9WlSjF0+HjwhfJFeJ6DVK0cBfr4XpFmhJQo+afKF+s=; b=Fc5wCtUD09BZ7j46w6arblK+OdzvLEClCYOktwmroLPOZ7/LlyjLlMEPH4+sy2KDbG rF1bsSJiyjNnO1d53xNFgxtbX/LDgEF98dsKY7kyEHhkwD+DszvNvfVVLavjnhKaYE5/ yI8ZM3GiAFDrjGONU2DkjsoSwUc1ljfIMcXyUffUVKlrNUYYbpR4rzwB8kvP8OHBVT0Y FZ5Iyd9VegTTtbDoztgIWmBg/IgrMTWETl7leRmljblteNBFtbFDoOd3JYH2iLaHNQX2 jwArOzXXyBN97nOMruN9JZ/O/l7gAXJ/hWxga8rtHys4JqDs07hqZw/5htaFrN2yv+e8 +frA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383209; x=1756988009; 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=b9WlSjF0+HjwhfJFeJ6DVK0cBfr4XpFmhJQo+afKF+s=; b=ZjR4XnsF9jK8qU9PMlP3oYBlZpV6BtCUN8I3lilXD3GfQuEcuEIW6SagUJ+/+S6/An 9VE/De2/rk8zS0BcebBKc69t7lTGhosrKiQEk2ObJ4Mc8JUZfSHJLr6eVTUAE7iwziYk Q+qrwZ2QG2FkV1wUKOFmM4MQouUkZyZeoAK1OR2oLeqFMk+t7NvYp1szhfs0qQOJmQj6 biQFa7GVlVA/4iMe3CKlnTC3NWAyTmimBE+GFKMcPuWwjqCPviws3kxjFqVNnlUwA0BW JfX5IZBUQkZW3ppGykd1TSM+Sx62lb2piKDZ6DRsWsHrlyKjTufGtor5XVP3phTKwwCf 5SPQ== X-Gm-Message-State: AOJu0Yw5VzdDizSd1/ciFf3gA2SKDA3FWG4bAjlBEVtl5Z0LjRXeke4n zmVJBx4H2W901m42YMgBILT8xprKQ0MGKOTOn+GN4/gEyjUj1cdlOTJqXAAFWkby8+OJjMOeIne vRYF6MWA= X-Gm-Gg: ASbGncusEBuB7ww8qZtWQkHzBNUX37gTwkoF/M0DQV9/XdKTNiY6Urn7I448C0Cu+Zi UwQi9ASIAM/TvpzBbz2DVbG1LBu1DYVmAHkWGzx2c73hU5EX5skdOQBTWvvUslzVgYSzosz6NvQ kgEVOWD+vi7JxOYB1K48ABj9SgruSI1zmUqHJytvvo5SQV92HuHHEeB355R3f0XCnR/7F/KxY1Y IMgbNqYRtGodiMg+SfRPzfdwFdHDaI59enIjc+i0g/ASe8Y2YkCEQqfbYZa86j1EQAuHMX16pMm 9znLnZG7FYdwC0XOfBN7GAGO+hOkfDY1Mr3faoWRi5iixT7fiih77IbOibv8jmDWKlKB3YZvXsC zlfbXvZEgRPTaeh/NS1TOJBus3XiyfkjbBYEn X-Google-Smtp-Source: AGHT+IEYP/ILgr4L4QmKcULUOk2t7mhr0of12kX8Kaxru8fohKz5l1ABc5LA1Y3uqk+lWqR4ngmjiA== X-Received: by 2002:a17:902:f542:b0:248:7b7e:11e8 with SMTP id d9443c01a7336-2487b7e1af0mr121236745ad.18.1756383209000; Thu, 28 Aug 2025 05:13:29 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 41/87] linux-user/m68k: Expand target_elf_gregset_t Date: Thu, 28 Aug 2025 22:07:50 +1000 Message-ID: <20250828120836.195358-42-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::52d; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52d.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: 1756404585754124100 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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756402178; cv=none; d=zohomail.com; s=zohoarc; b=nlCTIJ3RR4j+4OrnqIFSlguEaTodjWxP/jjQ7w0Jk/xgv5MzdljZ6Fsnvc22Pl4So6UevFbgrywEdD8qAKw/outmVRTlvH5zpN2GHDoD2mKhblfZ1Z017sdAQLnCgx60MIsa3Dv7biC6mBjeby75xtGwXOiaR8eUt/sgu7mdeEI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756402178; 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=I9aPcmtBMNORt6gmFP2dhBOnn0gYGPdCmjOMx0sPWOA=; b=GUXqIf3jy3cHRLy2si8PctFeMQI1scvo4eEKISZxZLMktemUqgYFbGB6DQ2fhn8nBjQE3Qh/D9Hrwb3+CD+O052T2j8fnqZ/zQRMLylFl2ZbWYRC8ijA77VuOGqVcfKnKeiBkfIUnPpmKaxeJd4oNs5V1JTeev7qtQ7FgL3cEbQ= 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 1756402178916632.8349646518466; Thu, 28 Aug 2025 10:29:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgHb-0005Ra-Ft; Thu, 28 Aug 2025 13:19:32 -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 1urbVf-0007cv-2A for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:13:45 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbVX-0008CK-SC for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:13:41 -0400 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-2489c65330aso8534775ad.0 for ; Thu, 28 Aug 2025 05:13:35 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.13.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:13:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383214; x=1756988014; 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=I9aPcmtBMNORt6gmFP2dhBOnn0gYGPdCmjOMx0sPWOA=; b=k+VzjfD/yPLq7BONZIbhE6fi7H1I+vYIn/qVOwB1cE0498EVRQdoxEUDFxJwnZxlaP 8TWsWyiScYc8lOuVrcsezM2cRn4/azEGwXW/lfqVonHL3JrphadjkwvyT6Mwz4Iysz2X IlYX8csgdDpknxuldsJ8LhZlXY7Q5SQ+S/TYWLu5JXPqcOCuYZGX5hoytuYGFvyvYemz gtmEVvsUyTKOGfNCaZ6NsVxJEcwzm2MFtz10qrpgHG6vXGnCkdGDqOyu1BOkEUx0PGYa d/GqljcUwog3dvpwYfX1fpaQ4qtJaUkhunJjf0pyGJFWO8Z1YdfofCCdHY0r2qwfmfCj KRig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383214; x=1756988014; 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=I9aPcmtBMNORt6gmFP2dhBOnn0gYGPdCmjOMx0sPWOA=; b=uFfcIXBTRpOb4h26X2FCUH8R+8iwwEXTsg0rWzoUC4zOKvGq8fxEvQC0/qe6KZ2SuI HvVO6nIwuA3d8P8ymhow2QSR3m9NeLDdSkPJcdQXWx6FumpxQMC/VcnLajW2EpCvhwxJ Wv1Lylcg9vaMndXAvJtDH0QuyUR5kV4UGm3R70HrLdi4XqxgqqyJNsDvhfXPo9dGuCB8 x3y/wqrz/4lE2gntLnBqWRgswXpCmO3nh3UERmeSj9rp1At5YWZaaNDxDsUW3e8MDI03 /FGv5Kwat1Rf2pOjPIinnSsfMl8RrsaoIAlDGdMXU2wVK1q5GCzpSIqzUV070wnDCG8H zwYA== X-Gm-Message-State: AOJu0YwV3MsBZtOsUXML9uIkhmiuECcBDiiB+HaIPNTvRGQP9Gw6DecS Bbkx1s3li7JmdfDt2g1sp46jzHJJtUd9WTEEDnlt44lMLkz/ndg4OpyGTtEX+AIMJq1yMk9khqh SiEdIlYQ= X-Gm-Gg: ASbGncvtQGgQ36oTHo+aPYjyq8Etrqe53ZBQ2hMovq5pub3nhKlBp0Yga1ijPNypRGv bhP0sQx4YKdAvghuUjkMYY95JuhZj6At5f4kJdDz6OJKTtlFexmGlH8wPSbq5lixIrMeGjPeWKi w8ahi/x41He9f0nvRGDu8Ka2zZTQ1RxY2qzJg0T9S0qRpMTlTYCb9rBDIwYZqW8hs0QrfO1fqaG SAM+3hiFxZ4W/GWog3JiXVTMLORTyZV5fOPSAe/XRxVzbV0w9RgIBVuC0O20WCNrljV41X7JhjD O81Zws9d5/QgnhwtKpuvP8JljykszZ+LYZstyjNPcyNel0nVYQKazl24FGRbe/TP6pzC3shl5m3 DBqiBmyQoq2t0cFKqz/HYhz2aM0GAvOkS6agk X-Google-Smtp-Source: AGHT+IHBgmDtCBb/LUpNKZ4l+Dn9TjgW+okM2SMJMSAR3cto0AmPcN6QZBivChxSKgiOu76LGdYb2g== X-Received: by 2002:a17:902:c94d:b0:245:f002:d67c with SMTP id d9443c01a7336-2462eeb6325mr276128885ad.30.1756383214058; Thu, 28 Aug 2025 05:13:34 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 42/87] linux-user/microblaze: Create target_ptrace.h Date: Thu, 28 Aug 2025 22:07:51 +1000 Message-ID: <20250828120836.195358-43-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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, T_SPF_TEMPERROR=0.01 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: 1756402179858116600 Content-Type: text/plain; charset="utf-8" Move the target_pt_regs structure from target_syscall.h. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756402131; cv=none; d=zohomail.com; s=zohoarc; b=Yt/aZIvKBif5vHaRBL6zhVfdytP5KYXF/PbuDfQWcbRDI/aJUdJ4KxuWgZyaWcYXKGfJE0EopCq/uAEwxhgKyWgeqrvw5kGjAajFE8SRG8O80iUmHryyg0BwzrNAdFoOzoiECpwT+SGYCUUZVj8zF+ReO5pRaWrRPTxYsJIDrbg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756402131; 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=ETzMoCsYZvdXntMHdD7opuNC2i41ysldzXxK0olCZs0=; b=mpHcOtTGRMoo6UOPCJdSoy2bsylCZvk0nFtUeA9GbvhkuuQV2MZwSUdysG36dN9+Joy6PZijo9iUxgLx81UGAYzjT98neygzvz+IO6g7erKu6CRC7PBM60dOto4YtEGlaWPOmuCU8407m6vnGbvYtBdpZDJM+0pYmCSJnJQPuAE= 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 1756402131722741.6959057165543; Thu, 28 Aug 2025 10: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 1urgHX-0005IS-JX; Thu, 28 Aug 2025 13:19:27 -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 1urbVe-0007ck-UY for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:13:45 -0400 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbVa-0008Ce-Jt for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:13:40 -0400 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-24457fe9704so8977535ad.0 for ; Thu, 28 Aug 2025 05:13:37 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.13.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:13:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383216; x=1756988016; 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=ETzMoCsYZvdXntMHdD7opuNC2i41ysldzXxK0olCZs0=; b=CoG3+ayPjkXd5MYVBO9Fakk3ARZrlwU9Zbs49P9VUZHAIl5iCpifsD+UiQL5uoc9J3 4WhRUpT6FTwurODdEBATYaUBRZfTZ0Z9L/vQTGQtVbnnMqBWQWryTnN6NLvnMgcgYAAk Xe2xijjh1kx4/EXzUJxDIG58V0aKCABnI4gTUjSgkneSXBjLjbkOvXrP7VbkuWJnvmgH FFzlxAMqJT+A8a6C+tTGPGs/KC37ghhVqY3Dq/4toGal4/jcvDcmdIQINL59RQlUvBXP 9RNAYnaT4DJaBYX8rTKh0r1jjxAVQmj+jjexXmPBBXrA974y487j2Y1kFwH6aii0G4F2 FTcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383216; x=1756988016; 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=ETzMoCsYZvdXntMHdD7opuNC2i41ysldzXxK0olCZs0=; b=VDmDoJhq2WD8NEA0nIlhZ5UuGGYPWEUI6NZQwSn8F2gI1qvdtmgiUnnd3ByTSozuer 9VLcEeLHj6nlBPnODGvaD2YGpQOBvITEQAoqSWnWJTp0/YUOcELa3hxmEbvkihDzzmY8 jFSTANQnD2rbpwZnma19NmuHWi+hA7uYgoYeK6yByjn9ilMrsNhPmlZxBQ6MPUcIljBO 8JMrL+IcCj9GK9OwXF8ja68MknbtNka5SSg2e0khtPNsTCqSHcEOk4CcT6c5rfKhEoFY olKQw8WtreiYnjZ4gL7FMgcbjkg3x8h9CA+rtMgLVr3PoaE3sxeuzsMizMCooJG8mYV2 s8wg== X-Gm-Message-State: AOJu0YzAq0Z98614w8tTotOhYuJOxvyVHCC81841c2Y5HxMLUeI7wZGl 6X0EOfWKc/teE982yMrattD2o7TIa9gQORtNJ2cqR3qXnrZjYRLOsbpN2VU3RYcZjJ7DEtr1SKx /nBToF8c= X-Gm-Gg: ASbGncuoCTL3hxgnqhDHLfsNlBDvt6lY64LSxCzuaN1Mgiu7s3y5TxXBtK9JkISC8N/ VFLJKZR6XIH7715Qf2lUuX9LdDb3touJfcUAII2gSIYBsYrvMLGJD7CCJy3r0/dC0nx3HOJZ0ou YPQEgFBEH/f4HuYTS+livvmGW+zvcce9rJ+LP8wie0+Vo+8DvwySvHp0bZ3T8MdMcARvWGCeC8S p6F09e0l8Dk8V3nhHFzjgZVp2SycZkwUClZxAUDXhtqDzhCKZZQmulMtaVTb83kSlwMRIQEEyq3 bZDZJNy6AGaZfN8XhDMh1i4/iV5kZ4anA1k1U/4QaAPKNzDGNWqwuQ557hx5P1dEMdGyAigokYS Jsz83qnqpFEzsJGAqkezD2Ja6wtQ4pKy9Y6kN X-Google-Smtp-Source: AGHT+IHJUrmlpyUB+23RX5aXQa6H6ZdV38fDNjJyCKaIpiDTKJezIUWaco3MdpbFJLaYmBruDE4S0Q== X-Received: by 2002:a17:903:124c:b0:240:84b:a11a with SMTP id d9443c01a7336-2462ee2bc6fmr296999095ad.17.1756383216387; Thu, 28 Aug 2025 05:13:36 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 43/87] linux-user/microblaze: Fold target_pt_regs.r* to an array Date: Thu, 28 Aug 2025 22:07:52 +1000 Message-ID: <20250828120836.195358-44-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::62e; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62e.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: 1756402133198124100 Content-Type: text/plain; charset="utf-8" Separately enumerating all 32 registers is not helpful. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756402764; cv=none; d=zohomail.com; s=zohoarc; b=JoWcSihADiPSpPk/nde+IxJn8M048twYDdsVbzwD3ONBpsDY6z5puOw1/zbRAyT+w5Xp9Uz71UU5IXwLdgqY9M7tMa/ep3ZMUbOZNMZ6UvqFoFw1d1ajUA1Rg+ifCmZ4rqJcV2TuUQdGKO8SDm/tOwmlvJ9mD+HT65GZ1NqckiA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756402764; 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=gxZ146uoWLbzcq7GV0ARwloQB6KyoHpZe1NQNrxqKfg=; b=DcRpKQBya71Ro1JRAN0yvb1AX4i9t+lzhmFAEvwmSdSeRGPsWD2qjtfL65rcdfsY5j4ssiF4/ejYvOHFx6w94GkeNwtU9BPw5dC0CKwdw8oqH+u1VSz6wpHeOtvDRS3jC0+vJaYeC+2aFFHvw8auUVkrYLpIsZVeG2Vyf+/AEAA= 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 1756402764655858.9172254611831; Thu, 28 Aug 2025 10:39:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgFj-000211-UD; Thu, 28 Aug 2025 13:17:36 -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 1urbVg-0007df-RG for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:13:50 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbVd-0008D2-4P for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:13:42 -0400 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-2489c65330aso8535265ad.0 for ; Thu, 28 Aug 2025 05:13:40 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.13.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:13:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383219; x=1756988019; 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=gxZ146uoWLbzcq7GV0ARwloQB6KyoHpZe1NQNrxqKfg=; b=EqNdAhnXsJbw5kEpSo2GfNoGBsy5UJwRfd9S4HC03vo26f7TaZHCc0x9EfL3b0xz3J 6eBNAfck6YlkUJl4RjSG4B64VGZ8q9+Vs5u8dmtrOkMo4138Leh8mJwKeV2AERi4J4wy jKZZOKjA53XeYktlUC08gOI4u9Ul982Q8ikl6gzdRDXAHptUr1VLfmjlzoMrGzm1Xeg5 Nc3PW9B4F+MKULv0nDmje26Ei2ioE+OnaMLMitI98is2IpuezZIxfKnosFNyKeE+NlfE nDP3A5GysRUg1zoVnj4uM6nM0IXgVETYlirEqOUm39hu3b7IbGKfbnnDycMELX8aYrHZ UK6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383219; x=1756988019; 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=gxZ146uoWLbzcq7GV0ARwloQB6KyoHpZe1NQNrxqKfg=; b=tmUahlr9GlSGBdkc9z7Irxw5Lnes/Rj1lRDqC1AszFOYb28JrWpx6vmfGFhMJ+In5L zyBBYwARwdNIjLLGxClFg3s2iveCduOJW93ojhqLBLM9o0M5xYVTSlHPXPz/lf6QZX90 MueivMMCXCKbSvoPigF+HgqIF6JsBlCQsE+AxdyrS+N5SAIySCdWhypaxK9FwYBOx5xG Q84if63XgSt8q/iuHcwj0/7KaylunqT7xseODW5nKv6TAA9IIy79xqnisf7AZ2vjPTry fWGfv8i6iI7zcQID3APt3bc5CyPwXCUkKzqr3HlUCh4VenMnTB+EhHEHZS8jbplC7RrD EnuQ== X-Gm-Message-State: AOJu0YwQWHFapYs4TxMP0xmFBzbI3ELg0PF17Istz0QvN2jV24yWoXDv 6m8ixPuqCNhf+kQbC8xmtHvAjvzKjuzIAMWEKBfceTLUjcmV59LW44W1YciYG0c8qwodhw9+o9a JLWQtqNU= X-Gm-Gg: ASbGncsEjLydRc2+3BfsuwVQYoXBJ5pxbXtWPDEZwjgNGWLJIGLCvxfY9DdbwKzWUbA QoxV8QhIOwDpDpD0E3kUM0enzdtLsviIzoh3d3J9I/fpYWFQUWjAPW7coiFOTM4PK3108qUTGq4 BLU/CRfUElK++WJJhyLo8hkmj8yhPc92N3DLpjGTEoawH9C7BsrNnVL4517MalFeHEB5O1OeurV gM0xk9OO4rtNXKTpcxlIpmxdFBNxf8/r0f76NBG7gb4q9pGRSVWu81lpL2w39/0S4lujxwzVjJp Z4rwkqbONSQT7BJXJEHG+26Jt1OXQNNEoljP+F8dsDR7nNARmrMsxV5bTkUfBDtyAggtG5u7jCc sDkVlKuzJ1aFOnvuIhqDFn7PAPIjyav8IcXOh X-Google-Smtp-Source: AGHT+IFWo2ty1BndtontY0M31/O/8YKB1bwECb9tFfF/+fFhw/4a6weyR9Aqjknzn4iZy5ESVYLLzg== X-Received: by 2002:a17:902:ecc6:b0:244:5cde:d384 with SMTP id d9443c01a7336-2462eeb4090mr332794745ad.31.1756383219089; Thu, 28 Aug 2025 05:13:39 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 44/87] linux-user/microblaze: Expand target_elf_gregset_t Date: Thu, 28 Aug 2025 22:07:53 +1000 Message-ID: <20250828120836.195358-45-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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: 1756402765665116600 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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756401275; cv=none; d=zohomail.com; s=zohoarc; b=e1F8jFR+QPrJe8n9barQq6j6KK+k7kUUFrjvP8l1657RLhMfJ+r8zsbMf8xd6B01lj2vZRXs1D/cc64mOqgjWufVBV5VPhGc8K6x7bzOA0+EH1Huvb3YP4m3yKm+3Id+Y0gBOePyMBwTzWOcgXe4KXdcgCK8QG6tfrk9Xg+0U60= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756401275; 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=7u4pTR+R/JyUYMnGEQ4Z/n/7ie4R7pKtlyLIJYnZ1yk=; b=ZaEoMAaVXAtTFJgDT5XFamzRAgmsr1izwASrBvPkaDkraZva+pyeIreFqSb5J2KmXWrO60JTSvtdmZDJDOKlnHEDP7qbHgCZ/cgDR+YAMPexuu6qBvZvBlSpB1chmtZtUKCTRXeqg7pBbZHHSiKJNFB77KXYFzoWBvIujjqax9g= 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 1756401275188761.3734581125391; Thu, 28 Aug 2025 10:14:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgC9-0002pZ-4U; Thu, 28 Aug 2025 13:13: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 1urbVj-0007eK-Vg for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:13:52 -0400 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbVg-0008Dg-5i for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:13:45 -0400 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-24884d9e54bso8536805ad.0 for ; Thu, 28 Aug 2025 05:13:43 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.13.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:13:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383222; x=1756988022; 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=7u4pTR+R/JyUYMnGEQ4Z/n/7ie4R7pKtlyLIJYnZ1yk=; b=zlrsmZRVQGFePNM9nqYiKwG8a6KUyUEyKnuBt2ws1VOOi7e3c9iMiDHo5YowcykCYJ geBoGiUC4jvHMwkpfGX7srBuRi7TLXXzXjJDsbuLwyPmVy9vC2aDN6GXsuIhwX+CfAB5 DhHQkLGKTBIXOd0JZaWTQv2PBpjGZZjwN8M1JUjWhGn0lDD7RacFtPVEC4DRir4a/d+T GBL58+ogee3zRztpykAxRTTbS/a3hLjmPZSo87HIP2+BQCHyD6+XHI6kF5uCvLfVTwRN 50FaTRWUN7as3BCUHFTAuu7oFUGRMk131URG9TGAIeRvrZXfrPYmb/NtefMbEDfx8Ryp Z66A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383222; x=1756988022; 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=7u4pTR+R/JyUYMnGEQ4Z/n/7ie4R7pKtlyLIJYnZ1yk=; b=nCDBkARhYTg5wjX9PlsKIanSyymKlSRX660dpf13k4ZgYqeiha4+fqiLqjUuA8eLij Xi1D2SjsklcYYNYmlQktBRuGG1J8KiZJyjfrda+knEdPJ22TOz4R+ibQ5CME5vlVJN0c 7blv5xGgLIYtSnHpk/ArlvmUnZK0c3iIE6shapdapHtYQu8uVKRdx+SfLx6biVl3W8ln 8m+1z2bSpb4w2ayJm4/suJAELhwfi6rEcpneB6vn6kqinMf8aLn9ZmsYMHL4ldwBuFD0 BoTfgd2I1gcQVSwUAQPai/xy1El1phgxO7sCTuISxPaQ6yJ1pTGZXioYZOoshoV690mm /pZw== X-Gm-Message-State: AOJu0YzDEiYJAPpyXx4BzcL6DWtdnFM2A62Ld7UF+Cg4k4w5VMM6prnU wtsYCY5AIHLkawSPULer/uLkxkQ+UVc3bkc4sRA5ahvznFNZOgK0CIO6RMy3Suy4hUhc3W6dfhm Ew4R13/I= X-Gm-Gg: ASbGnctXd5T5i8mNIIZJLxXk8ixRVR5pX0Gf+3GwiEaH9yCpmAMETQmkiZDh3uW6WFL xEGSyTUMU9XGHPcYQNqmHCYJpIJWhzmR+26Pet0ijxQszRRZuDiNiDia7cZe4gHiKia6pq2KOnK ANEat7ZoxtWabGdcVSiEaCRqaPasg4xGrHGnXmA5YE4gtWA6eZzIwMIFMkEu7ecdp5zYDxyeW19 JD87yes+3Ou0gppKz7bPR0Yd2/12XeXAah5nHl2dW2hKb4sVETM3z7gxFfZS/7m/3RxwGeDJot/ p/GYPb2JKPNOOKKoOLnjVt4A428tx/kzPKq6v8n8O/m2Zqs7ok87iOKZmbR7Ybp2NyAoVPAMuxL 89H7l+EL2z4l2OLRhjiKJEwEnB/OCB0RUqqLY X-Google-Smtp-Source: AGHT+IGt6DsRQwSdvDDJ4pIJgYN5x1Q6I8nc7gjmXLYtRDriGlzll8SOOxdcwz/WcGRD1+b0GqNwVQ== X-Received: by 2002:a17:902:f68f:b0:248:9b68:f516 with SMTP id d9443c01a7336-2489b69072dmr83004405ad.37.1756383222124; Thu, 28 Aug 2025 05:13:42 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 45/87] linux-user/mips: Create target_ptrace.h Date: Thu, 28 Aug 2025 22:07:54 +1000 Message-ID: <20250828120836.195358-46-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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: 1756401277058116600 Content-Type: text/plain; charset="utf-8" Move the target_pt_regs structure from target_syscall.h. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756401330; cv=none; d=zohomail.com; s=zohoarc; b=ZE/cRFY5nYX8N+fjjxg4zjjuJ2NEv94OBcg+vIkpv4UKNMdus5YA2VG9UKJiS8mj5LUNBVZxdo+M5AGrZ0Dz3oNadeS926talqAddvUpHsm3rc0cSRfyOLPnGBgRhk92bg2FPhTVZppNfEDgKEbQRmxmmRRzKYiqeZGf3geuiEk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756401330; 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=ERLV6kpirnkz5HKBU0xee2cpCb7A4GeGx0VqhmBDmVs=; b=GaXKEX/tiVlad3/qd1tsVNbXubMZyGvRYZW9SugBFjwRoV/HEt6+XjNbxKZhu8QPHT2lNR88u8R7k0FulZEKHfdKAZ6uALpHlg5DDtIZFAsHNjve+i+eH76Jx7pCfDzwIs+DZLq+q7IEZwBYlG5s40yPHXZPtT2/6nQCSAmk8YQ= 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 1756401330920515.4094475931499; Thu, 28 Aug 2025 10:15:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgCJ-00037x-Ah; Thu, 28 Aug 2025 13:14: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 1urbVn-0007fB-HU for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:13:54 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbVj-0008EB-02 for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:13:48 -0400 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-248c7f955a2so8134465ad.2 for ; Thu, 28 Aug 2025 05:13:46 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.13.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:13:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383225; x=1756988025; 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=ERLV6kpirnkz5HKBU0xee2cpCb7A4GeGx0VqhmBDmVs=; b=wonQceuW58ZQdrMJEqPd2IWEITHAcrtBygmT2N6yBuShDr26VcCFuQ5+WfFNMqU5Id ACdFIi0NXQJHY6I7sc6tw3iDgq6JABCXkZLAcDlAsqPfTx+zEzmADVFtOzXpXlfttwbM 3oZ5BnHDOZkEWtCVCZk8IhnjX0hx4XQclQkKFtOkK8k8NHXVJQ2QR5IdCrMPD5g2UT0e TBw5FREDD8oh7tGLyDSXJ5wDQ/4ttnJof5lwVioBKFL7FfJ1gqcFg8rargC1eZzYWNP+ Qx76T06oTaj5BS7FcXFN3qx1WUUrFdEtcMjwIbGCg7mXLUKSe5ViirpsXyM88xaHx5Ex sAXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383225; x=1756988025; 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=ERLV6kpirnkz5HKBU0xee2cpCb7A4GeGx0VqhmBDmVs=; b=FTY6MvHaMuXbjRACPQEQSb+91PoXazF6369BTSr0oAboOHbp8828MAMnC/CrIfhGfD gFaX8QqXDZoR+9lnuDGEYp1a08e5y8MRKInS/UpGaKdIGaKe38Y9g8Yg7aq+wMMwhiFi 7M/V6YQZogoVa2Z3xk6zLGQ12Fqn0OiKeEODCJIlzL7YaKeKt3QtbLFfB32OEObytEbv NV9OU367vCGuqWTrxfjuWXU6NiOOaJPeiH06AQdXZ4DXb/oVfgMmpqX27p2xg8Gq7478 xreIE9sGISCrLoTKN2fHzYnplozQPrOZYbtCyvClpst+lRc62GncXRMJLkFehxcAWPNK mRIg== X-Gm-Message-State: AOJu0Ywmen4JQb8QbW+n9oWKivhZIQF399KSgMwKTBI4/H3U607PbUJD w6TzZtUvnkcuDP68gF9e5JwxZ5zDgbTLtxQM59wY92abVhDhNf18kj+di5GzXu8Jngz9GS/Px0a SVvjcWBE= X-Gm-Gg: ASbGncsPwWWoEavVKNOqw7vNfEyqzi569kdx8FpTwUKwfeLAvwAsPTVeMr+736hj2l9 6+clsmRfgN9LuFebtV+vlO3GfY46bwFiPZmWUcjKUT/4pPPILQWPPLO00BwOoQipbM1JcLXGbaD rx6taXzvrS2329TwYIfKnTYllhAhv94AJHOj4NbJOVhGYTZlN/J50moN5OiLwaGIAnCb47M2Rf1 ERvqCwb0oZy6JU3ZqeXPe8WhzubO021j71qXVfhI3MXsdCQg8BorII6c9/9THIcyDQ1udnGCwvu 7KN8V3KLUa9FbiedxzoyO+ny55y1r/OZdNDSwuKaDl5WOhYNyfmtemyQR9SGC0pcfCv8pQ5Hhre KtMS4x5CZUFvEJzKsiAdOj2gzye0dyHQkEt/K X-Google-Smtp-Source: AGHT+IFPu0cVs9+5+TNPcbkSyZCX3Gpgjt3sPmfHXqy6D2G0s/R6On7KMHsMt8P/JLqhGY6XMyaf+g== X-Received: by 2002:a17:902:e74a:b0:248:8d0a:b4c4 with SMTP id d9443c01a7336-2488d0ab7a5mr102249115ad.47.1756383224905; Thu, 28 Aug 2025 05:13:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 46/87] linux-user/mips: Use target_ulong for target_elf_greg_t Date: Thu, 28 Aug 2025 22:07:55 +1000 Message-ID: <20250828120836.195358-47-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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: 1756401331687116600 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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756401597; cv=none; d=zohomail.com; s=zohoarc; b=d+fheMUSRXHtbrvKfDIaJ26ttU5T4o73ymN2OuPhzDDFw7TE8phhiQut7igT5JNbVSqq4/h/xJ2jrQYXlCRDvB2gGVmx2OJIw6v/Jh9Vz3w6jxFNksJx7p+F+dVE8B7QH4J/28+EA/g6YQLejtY5VTgphYLoNNahwwfLZgjYxqI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756401597; 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=LenyfsMZgDOHJ6FaZSy9G8+0Dpwwnso+zoZ4ErmZGVw=; b=SukMO8m4q7RbqBkLW1epnUfeB/4fwBRsK1waPEAIxNhOH+mEI79xJzvoSdkB6O1DbThUeRYDhZKX6mq44yiSJ8ES0pidX8KdJpvwr83JGMXyUl5XTHy9Qk0Bcfufo3ccUQ52PUMK1Jn32DjZ4D4OGlR6mZwcsWgrqiwTDBf3GsE= 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 1756401597837104.62251405475945; Thu, 28 Aug 2025 10:19:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgFp-0002WT-Uh; Thu, 28 Aug 2025 13:17: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 1urbW0-0007l5-BC for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:04 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbVm-0008Eb-Al for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:13:51 -0400 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-2445824dc27so7513165ad.3 for ; Thu, 28 Aug 2025 05:13:48 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.13.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:13:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383228; x=1756988028; 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=LenyfsMZgDOHJ6FaZSy9G8+0Dpwwnso+zoZ4ErmZGVw=; b=c2VZthVJJiFXdxVAhAh0snqgMI61euujBMvlyWZeJ57O12+YA6L9KJRpqZckLVrmCk CXaM6Xxy8ma7ZrTALF/i+TEQVHWvLBmy4b78vPOdvkIC1GrYSykbhh45SR8sT5Bzahky H1IT2P8oFovSbBowkOFDzRStk1LS41lLUTKVrNhqxsGKEvJB0ETV9MUpuQshfuu3qJ+d xpljw0r6mTmdSe87hgBkameDZFzpezv9RQE7AzHzAyu+hhsWx+kSVezusL6uSQbhPm5r WYxAzyfK1p4cdMbZjU8XVBtvUkVNMIXtuoJNUAI3BpzE3I6FFB5JWI8qmSjzvHY2D7TK ttqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383228; x=1756988028; 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=LenyfsMZgDOHJ6FaZSy9G8+0Dpwwnso+zoZ4ErmZGVw=; b=KbCMbYTZ8AKVz4yopxU6AZnLRpg6utUwG9vvtYeHWj2TscNl3xX2UZTeNpy5gFYyy9 /9p2yV0x8KkJHsrACLBSdp+JtnNfbmm0bDTWpkIRTgcJ6UfnH9B/HZaQnrP8mKeBFBxn RyzBISYTMExBfYsfDeNKeFEQIRhrtgYMHiSi4gS9gYSMUXZ/UTFz7D2uUhPxmzV+Ybwx cjHJhKaT8H3z5xZjPBzmzDUa83c8K92uC2kLol6Esla7yxfot2Ab2JGwH/y/5sBwGlmT mNdRp1fYMbwQpcYpjguOjy2bV87a/yRhEnz9BSibQGxKuWEnewv+qm/2vnNwdHhKwes3 Solg== X-Gm-Message-State: AOJu0YxINiXQ87Y2mkoxQhROWGW68PLLEpQPlJLcUN1TT/CIT5+bm+RX 4X7bKNU+onsVzn5FdhJrxWULaEjpGTdgCgPTtoeNSXBM8M/5Ajgf1i/EcoH181NC3muoK3zq6zn NyBcmB6E= X-Gm-Gg: ASbGncsZrZsXjBOKR1FyvYw0QrsRjQPMAGTzPa7/sAI+0dyQGfGjAEz6YS2O/MCNSZm rz80y2a08LRqFGC52LXMtTbhy8229Jk82SLz/w3J7ZXuvbDvQVUuHFG/ebZIw8L8gnMY/qTAcus EytHB61ED/qBz0gnKPGMIsrMTE8xnoIvWhzEtgrv8LBOGIPXPLEF47xipqSTMil2cggdbXMF3fK +0x4xilrn6iTeFnzPK5DcxzGT4grcqPQOKxEQYLU+MFpRVq5wPWyaKbhkgzBzVfK+LTS2EhT6sY zgdlIOeJ9mo9xMl1XZ+A3IYgrOPy4gHN9mfUTw0pMFmGh5aaV2sxlMkZDNFD0oZam8YDfRDNmhb BW5nCMPpv0rwfHFyC8cVxTgyKZg== X-Google-Smtp-Source: AGHT+IF2Gy7j7xlZX7ZcXrKTjpYDxjNeZX+PtdulebMjA+MHwQklgCeF4Mu0W343QyOKLNKU5X9zUQ== X-Received: by 2002:a17:902:cec2:b0:245:fe27:fe80 with SMTP id d9443c01a7336-2462eeb004cmr320514185ad.26.1756383227678; Thu, 28 Aug 2025 05:13:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 47/87] linux-user/openrisc: Create target_ptrace.h Date: Thu, 28 Aug 2025 22:07:56 +1000 Message-ID: <20250828120836.195358-48-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::62a; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62a.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: 1756401598713116600 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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756402814; cv=none; d=zohomail.com; s=zohoarc; b=kBnTCSuPmNEyONUzKQLB0eiZHxfNYYIwWpKt9SunQJ7Lv5zvdIqsP5MxB27BeEA2DMGHl1zS9DhhY8D990AkddDug/8B6SMd0NLZQeCe5MNEJdoLQEJiRktYWQTBm56Gnx2siFfC7ulWdVVcj4OcKpTp3R5tdzIZEDfn8LCtZxM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756402814; 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=UpJiF4bApuwU0krCB2cxcz2fyKtUh5H+0164pmacK1U=; b=EQrcKcU3iSkANANCu/xYYjUHoom7WORwe+Mg/dzmixykTH+NRMpUruko/0n3IE4NF8raCbgSbTn3Bk70Y0pNjETQbjy9mM6v/mU5A93frRK+gBgtm29xIY+40DITbCYvueJPP2HoEmEs4qKYrABRczC1Gcj10JgT4cUnavvZC30= 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 175640281399786.3774507761018; Thu, 28 Aug 2025 10:40:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgHg-0005Xl-JC; Thu, 28 Aug 2025 13:19: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 1urbW0-0007m1-LG for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:05 -0400 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbVx-0008FA-So for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:04 -0400 Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-b4c72885c8bso113254a12.0 for ; Thu, 28 Aug 2025 05:13:51 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.13.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:13:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383231; x=1756988031; 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=UpJiF4bApuwU0krCB2cxcz2fyKtUh5H+0164pmacK1U=; b=UDiL1pPULorqDWRQPAQfjUsV/FQC9Wxi64CCfRITHI6sYiiYailTm2wH1O5dWQ38E0 h4701zd2Uk4LWmG2dEytnXgU68HCwjeuJWgiqojHRaH/E0/WGdQ7HPeykCWB1yNSxkyM 34FfyIHhU0WOJ2jdDCyoCd0WF8RA5dH1d8Q7gISrT06liqLMSqP5X8K94iaSytf3BIyI /dzHQMoe+7uV9sktmBUWrpHCjFtQSvL8vESOnPvW4YzgWyx7qTVN7uYCsMDwkwryAXL+ OMJabvDQIzBlMTB5n0rM7FGpZGW1D8ke211Xcl+NGScVwPRC/1ySfI9TkwScG2YZLInk kaUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383231; x=1756988031; 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=UpJiF4bApuwU0krCB2cxcz2fyKtUh5H+0164pmacK1U=; b=XuXj+bGnhUwFQE2RMDJ3QK97YXWXhbsESDB0LL29Ph+oCyvt5nsMau81l55iKXHvsh wMg3Khf5q8VNLe9X5voyYDb6EcN6XndOdxcSpQ0ehPAD+kvIqjWsjZEon0zQIr51QT0D qPvz05KpN9SJUGPtSorv9zQDIx+0HFx9ec95wHmLk2A4XcuxXZaGf9IuS08OjQSPID8j NE3Xim2YYRR/0PwlzQ0SgN0ej87g4KRE9yxdo9Sh77CNBZAJhhRdML7IW37jaj6dFRcs IVCVdZlc42/JDM1n4I1PIjmKx2mEbvNauqEAtmggSeLIxuMLD7ZJ6iiUIZm4hUXbhXy0 N0pw== X-Gm-Message-State: AOJu0YwFHGpl7lY2ZD/N632w0dGzTH2uT3kqVkqBV1vjM5s3eW/RWdYQ 7HDSyjzSTGiSLsEfE6juK3wGu+YBqstiamTEP88bnNeulgbVH70hfNv1fVo4v02jklh7KpCIdnd 8uhATCts= X-Gm-Gg: ASbGncsy3XrougUIEnPORmPUd3jcNgBHHh+TZ++XLYIrk8mLNvyJku3vOZmMtZCDM9K 2b7X63coAwtOsVosc31IVQghGWsYSn/E6YsTxxPf6Y1q2VjBkNKG+iqae2e3xzwemABTojwTDtN /tY+Q8ZrPCBTTpGmLarv9fG7Rhn48z/jgzWlXvGe6u49yhKoUtlD2WpqlVRJOta0E75wAGG4pZL p7iUOEa8W2LSrSW4JDRmkYr8n5FSPds8JcymT8gZm+PmXI1MOLp88dPITdnldQtCZXNwGS73yvy w8+4JaneflAYalo4t/82R9TEcRIcbI/Zfa/VMdh0JnPt5dVxF1jJpEHD9bHrxUzier/eYKxD0U0 uDDNUaU1OTToqFTgZTJ3V44apnQ== X-Google-Smtp-Source: AGHT+IEMxegY0hn9Oy3HqE6vjQHAGIV2jYK19qBrO9540TQNVM2zdTUVYE3o6Nqh/DViV4C923TPeA== X-Received: by 2002:a17:903:2290:b0:248:95cd:5268 with SMTP id d9443c01a7336-24895cd5bb4mr94760715ad.46.1756383230773; Thu, 28 Aug 2025 05:13:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 48/87] linux-user/openrisc: Expand target_elf_gregset_t Date: Thu, 28 Aug 2025 22:07:57 +1000 Message-ID: <20250828120836.195358-49-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::535; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x535.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: 1756402818334116600 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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756402691; cv=none; d=zohomail.com; s=zohoarc; b=dn9o6KyV8HGC+GvhHLz+M2IFLKFbDTKwIHUbYGp73lOSjKo6GIgib8VeJkU6UqQvRpu4c7a9SUCjGGBENbMHtPAF5e/cB4jZCo9ydLt//zdmzuPCTPkdhPe4U+kV6w57x9MM6A4OPZmkF6eB35F05Fwq1bAfxNS3JbiVJfJKmSI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756402691; 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=LcaQmcH6qQTY26hZlof1qrwXGZHKHcgEYf1b3d2ymX0=; b=YmlICj6/swpuYsBzsuolTEB2jVR3CbKKIs+zu1oGRm5nLTAGS+s3l8tYz/oD6h1CiiCs1Kth6txSngZfsTqQslRv6ki4nxE4tlFpJwgUw6m2Gl7RnoKW1WxEczYsKxjcuj4A8BTbs4YgEJvEg7zU7rio5vFBL0DFotGO17pufo4= 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 1756402691499885.7361828967155; Thu, 28 Aug 2025 10:38:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgC3-0002fS-67; Thu, 28 Aug 2025 13:13: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 1urbW1-0007sO-8f for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:05 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbVy-0008Fa-3e for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:04 -0400 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-24646202152so10794075ad.0 for ; Thu, 28 Aug 2025 05:13:54 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.13.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:13:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383233; x=1756988033; 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=LcaQmcH6qQTY26hZlof1qrwXGZHKHcgEYf1b3d2ymX0=; b=FiEdIBqD4LtBT8Gp0rO/ejw10yCMgEMVzhNkTfbgd3Ep+BOwDk6Zvz/WRDmlJdli9j XQXAI8Y2RLiUmSuMdBPxruL7aNkoTaq8v2Gwv+//bgiQmJJ87cokeJ39aUE75sUNJN1Q ltr+dlsCkVrRKSfGRh/Y0bAhxRR0FJ3HWq/D0OsAu3F/0VpV+IkRW521VETLvkCNJ59f 4OcgaAUDsAz3Twh7FwEvY1j3GPeTYdFE6T2hoCXp9MUnVudpGTx/I/eTxLyOSkpgx3fK HYx345wZHYMA+Y4xL5GyrhPx+D7oaRuU983w10M+rTw3OZB1VJ3g+dPPvrXdCka9ttJQ WY4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383233; x=1756988033; 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=LcaQmcH6qQTY26hZlof1qrwXGZHKHcgEYf1b3d2ymX0=; b=P2hkrUacOeqGmozzI8Qp/vSWtukfxQIzIQW4e7NYX7mqXPMVbDzDT7W/xl/B2ljU2D 7ba2UzM/bZo2QRYPZ7Qao+gemB9E6j7UfUqjIJje4aedwnqP3hKMwPOUJmrl7ZtaLLSo GSm1PwfpZxO5SRvXGbzNvIo5voFMSxaOydmosBzqF3dWoi/ahrgb1T6wHeyZPejbuQBU ucngqcsOJBV7KC34Krmza0hp9yyzLnbegYI6bsrM1cxVpv6xP2szesxsv3k4xBVQTab1 xDrZLCIAY4kX5iQmnO0T2QUoQhzhxPeKDH36bGnot1twtg11U+B5XxHHP3SS3OZ3miXC 8oGA== X-Gm-Message-State: AOJu0YwypF88CAqu5wtrqDBlk+6evk8+Vbn49jYaPHhhalpGohMRfhkA P02xE9XRRWpXO3ssdNAkU00aE2h+wspsGoKl20L50s8NdL0PbfjXtuXsfVmFfixxv55HQMHLbNn 0+5AkvE8= X-Gm-Gg: ASbGnct75CoaNeN/7U7jcISPT523BTF4N+FsryAcXc02L12Vtmx4JvKRing5LflnYgC qKQrcLD6kBR97W3m7FVxD76cOCg3/LvGneK/nxUCklb7fgOKQNudVlQ12pUNBu0Qm+peQiA/Gqv 5K8yonNn9LlmTBJYUyS2DvlxGVL61otJcj3JJZo7100Ikq1YcDNsoQP6s+z8FV2l/sfLtaPII26 HdnA8r/4+Q6b1jvMagCscXRWx6H5bEKeWz1FXfUqdX+5ry89WzU9t5f/I8UJLoUWeJ7w+RdDutV EzIFW/28FUJaQyr7zCJ/H/p+18q2LrT7hTgWH4s7NK+NtRMxJWe5/jmFSosVJMyxOp4I5nmtKNt jJ0/vF2Js+iLqw5RzzCpeDGi1Er3iuQCJvSe6MfasmLCGSiA= X-Google-Smtp-Source: AGHT+IEYeAbcGO7L2IfV2Xq7zIdHjbbqpPv20ZeQy3+jO2QPPh0f/lrlsewVbYNYwhp/TF76hNFYPA== X-Received: by 2002:a17:903:1246:b0:224:910:23f0 with SMTP id d9443c01a7336-2462ef9332emr331289925ad.49.1756383233293; Thu, 28 Aug 2025 05:13:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 49/87] linux-user/ppc: Create target_ptrace.h Date: Thu, 28 Aug 2025 22:07:58 +1000 Message-ID: <20250828120836.195358-50-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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: 1756402692635116600 Content-Type: text/plain; charset="utf-8" Move the target_pt_regs structure from target_syscall.h. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756401516; cv=none; d=zohomail.com; s=zohoarc; b=iKNZd4W6wCjOas+ECif8OfdfuSCsq/PSoJ2dwEyNDWunSV8bPpwZQaHQ8YDBA7HMJt/cSlUCpSG+0/67lpDvUDeZcA3SkUelrn/oEQfQMX+WLkyQLlwVie0CqLtGSS19itOGe7+Vht/rtBZmyLJGD51pty+4IozCgDkoCLtvmiI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756401516; 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=Jc1Hd4IAJ+hIHiSM2SjlYyCPHAEkMo+OJOYDdKf2WxY=; b=Od+1inwaly+LbhInZqUtKQPcUnhNxLJQYisPomMG0shCqmmn40GT3BfL82RfNcHCLbKhm5jLINSuQhhjuS5PhVbf9Yi4uluhQSQXVQk5WLmTmGjfavgqR96sAXJ/25V18Il6JSaCS9xRG4sdMr/SKNdc2k1KsMUx6lk2RiovSmk= 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 1756401516211515.7691877753074; Thu, 28 Aug 2025 10:18:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgCH-00035P-Tw; Thu, 28 Aug 2025 13:14: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 1urbW1-0007tu-Ao for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:06 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbVy-0008G4-3l for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:04 -0400 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-248c7f955a2so8135885ad.2 for ; Thu, 28 Aug 2025 05:13:58 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.13.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:13:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383237; x=1756988037; 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=Jc1Hd4IAJ+hIHiSM2SjlYyCPHAEkMo+OJOYDdKf2WxY=; b=q5qmvGBHQkEtqHf77ru/tEgkakc3+PNvP7VjZi3EFPKf2tTpQcFQIkLdCtkyVuvATY LxlAm0y5oyNdQNK3izGlB6SePF4f2eU6KVg5DjMR1gImUZORhYm0tk4BKf0Z9Hfe3znc hsIY+MAuMgStwp4KSJX6AXTrbxK2KVfPAwQH3+L4XK/gcHe44xrdOsKPQNxpWQAur6lb vHQvQmOJdYI37s6z0LHapgIcNunpen88hL61e8tLLPPWEXTcnd7XqBDwbB26ozaM0aXc nCigsmqH42bfZReDqshEsDPXrAwGhygb0W8WkPTyAAQcw97vM/6DYy0eWwfUFff5iz4n 6pSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383237; x=1756988037; 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=Jc1Hd4IAJ+hIHiSM2SjlYyCPHAEkMo+OJOYDdKf2WxY=; b=OoWAp8DQuvyhu2bpSAF/S9+LtCyBft1mHhcSzsWvIm7mOzvKjKw4x+SX/WL1FQM32b AMFzf4MjDfEE2x1Bw7OACj68EC1g9DwZNGmvjDghrZh1HNu5bpU8jfKfWnmXGE8At7FO IDjmLMD9R1kjOGYGXSxJKDS2OjC796BJjMglWLnv3pe19gRzoJ33T2YRq6zppbjVhSe3 zUdilF/Ntwe8eHZIFTlCPSSLOWFP+Q2m8Z2F3m1KpkEGi9rvmp5TDM+AWwOTbH9M9JGS HwlGSRvd/Db/vbD7ZILrzwlblQkxSv40cuRQkhTXtYMkwRKThZHi91WvaZ1PWuLfPgmm Yk4A== X-Gm-Message-State: AOJu0YyEMEPCDCSYGUBvWT60hjf7a5mSYqB9Na2EwtjwxV+4GvI7IxZL WLtFPv+Q8Q8D/nPT0dcC7JZF4q1HGuzlXS5Z2jVYuk760qUvoL3qDNiqvFT7li++fUUAwpZo2ny cNilz8lk= X-Gm-Gg: ASbGncvKXqPEClajLyaZQe9eQPwvYH/4o4JO1w9FWeLYLPlYicaalqQtsBsiKihDZBv dcEimSjvhPbraWYSPsmGJhTp5QOCeNbqWqokFWgbo8hMSeBFH0tYxgkJsQrVmJyRi6y9wwHDH54 sWQgmi/W4QGorzRWB0ssk7qYBw6Ton9RPOy7488SSTOqsy3NnyFvIgizLckKDFtBndL6kC+XyEN lS9guVXj2GK3MojL0efife16E6PcYE+pPT3RxQAJ2/k7AkYPvmZ1OP7e6epj70shr/bwuKjKEuS /wrIfs20cyHFzC3Db9pemAEkLsYrQ3i82ICRg9PBAH0HCNJkoqS90JhJliYNkt4Gz6hmtuednfi v1VIBmWLfq6R3/CTwmQRb7Hj0u7L5MfzQ5Uec X-Google-Smtp-Source: AGHT+IEIKH6TOH8AZaem44I3Qm/MOv3M/n5qe3tOpwC8BYL3Q0bZ5jF0KDlWTjP3B6KDkviOZ9PJog== X-Received: by 2002:a17:903:19e5:b0:248:75da:f797 with SMTP id d9443c01a7336-24875dafbe1mr123918785ad.54.1756383237035; Thu, 28 Aug 2025 05:13:57 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 50/87] linux-user/ppc: Expand target_elf_gregset_t Date: Thu, 28 Aug 2025 22:07:59 +1000 Message-ID: <20250828120836.195358-51-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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: 1756401517676116601 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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756403400; cv=none; d=zohomail.com; s=zohoarc; b=knuPME0uVpVoPsx4xOxHYEy/p3XIJySSKiHUXjleoxV1XMjZVDfzeEuM29nEK0tQ+B0lz4ZcOyRyE+wUh2PpIybFV6Eby6zS3thnstOKiY65v+Yw4TvaEGOkIm4w2pBfudX3DSxBjkHfi5nIg6KdhjWy7AvxVvXK6f1jEhqKLfY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756403400; 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=ClQXVCiA2tlbMrvUzmBh/3sPifrVl1yskq0jgrdgYlo=; b=bkFAe8X656m0UWNj75Zw3x63DdRbUWbkv7JpdJ+r2V9yyuyAQl5Az04MVTU2l0PzwQnMLaOAtIMSfm1tOg0h9ILBNk1cS1LCLWJZtg9iYw2rsmBBURghV+vUJFfRmxsz2zOg0a3Jui7LNmP3zp+SYeD0jSE7TL6UFWYmhx2zNiI= 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 1756403400120806.71307086288; Thu, 28 Aug 2025 10:50:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgI2-0005ud-Sm; Thu, 28 Aug 2025 13:19:59 -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 1urbW1-0007v2-B0 for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:06 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbVy-0008GS-JN for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:04 -0400 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-24884d9e54bso8539055ad.0 for ; Thu, 28 Aug 2025 05:14:01 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.13.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:13:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383240; x=1756988040; 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=ClQXVCiA2tlbMrvUzmBh/3sPifrVl1yskq0jgrdgYlo=; b=aff3J8xw5bBxLBwH0bQwcWCqhhsg5CKO8TrJ/I/DkCcMCYyblmO72PjBCHkzFHrHAN jY9hKJk6P+X4eiMdPu8rg1fLCdB8GTUSXbyxSWqFXq3OxuN1LW7QO2oErF1DpCJghnQq nKKyHr9f3ZYFQ+mCN4bxoBnoTzIn2DoO7mLOTtsybY9twPyDZww1eSgjHbh7pUnjpmWx SqoUhcGOBhpCQD2liDITlMZyoy0ZXhczxIg2/KKcSflO3CAAkjJnz8lBm2vpp1StyJ6s ZM2cXN4SLDUCbO0/IOIjz2g2dvHnViNKKALKRf6AC6wIxp/E+mcMnKhzGpATVYfy6cTW M/3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383240; x=1756988040; 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=ClQXVCiA2tlbMrvUzmBh/3sPifrVl1yskq0jgrdgYlo=; b=jVtO5cVFqN97FPsk9eLGbDXpCO/fipmaSPaFOBF+vFeXjscCAl5OZTB3ttreE/H6pH +vB2WDIhUXAbbmBG82iE0ZuRfvCFlg3Y2lRzWC6nz/qr7kQ4+FNLV8IwDwNZ5J66JTfe JtOb8fkA5hfhkCWVzHufVqRpyiJ/1hH4jGY45Bq9f8YxYaDYeWfQMa/adJOWvQDZnMzf XhaMqvHXXCiOOkolVYDefRHYg0qmcrlTvLwR5QF8hqvHumOJtXdVZ1BnWHOUCKht1ack GupArTW/Dz++z9D+pqBcj2ZbGyedPM3Ei4nnT1dcN8Qh3Aoo1PZiGd4VUmZD/TVLxsOR soOw== X-Gm-Message-State: AOJu0Yya2BVJiyMdrGjekHooeVLMETsoVUczefCMHuqlj5Nuh1zGVrqA 8cDB7ppL+MkbB7xZqxanLw8zOycqWbrbgH433XOzqZ+GzQEAkvY3BxiyfysOz8fFNfGr40jbWlx YL7hVVaY= X-Gm-Gg: ASbGncvoiJ/COAtPp0HggurEOjRHpcu/++urXJYVbNlp/2H74Z/+DOTdEVOYhAc92XU J1C3GAcBy+HXywiE5imUbiaeDnGXQDV+OakvecJql3xFLOD16EWDIHoxOmTP4UMwbgkylQSjjmO Yt3jtnUatU6MXKVIX62eI1BVH+Av94/Yeu0vqgdA4jF3duyEZvckiwEiyJtZFQK0UWGk9Rtifpo M/f2rtpit5CybyWI1Ij6J9Bpf/ah0KTkBWBwaFxGgfIW5I+cCAb30h9E3am6/OQ5YG8dS7k9zY9 pUPZWa9703AIZ2NzIzHDlep0cdPtDPbVMjpPiafrWYnLw7R8MgonSTRB3Tun86Snigd61WjDrH8 mGcMlU9fpSmnPxg/br6BfHwtRs86P6kX0O9gL X-Google-Smtp-Source: AGHT+IGL8JkMNXKKGbFJ+/kdvSBwHwNxbO9ue2uQdAFYnkBUPQGR0lkvo/KqEVcUJRTVRO/hJXE4Xw== X-Received: by 2002:a17:903:41ca:b0:248:d9af:de27 with SMTP id d9443c01a7336-248d9afe2famr41173775ad.1.1756383239745; Thu, 28 Aug 2025 05:13:59 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 51/87] linux-user/s390x: Create target_ptrace.h Date: Thu, 28 Aug 2025 22:08:00 +1000 Message-ID: <20250828120836.195358-52-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::62a; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62a.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: 1756403402695116600 Content-Type: text/plain; charset="utf-8" Move target_psw_t to target_ptrace.h. Remove the target_pt_regs; add target_s390x_reg to target_ptrace.h, which matches what is actually used. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756402303; cv=none; d=zohomail.com; s=zohoarc; b=Sq60PqwXtPKyvB83i3VGrCvhwRwghEuYCjEZpNJv7Kz/mSpr4YDKjxh2lDF071YY7RZkl1VVQ4qrLXzUuYkG5n5kaCnhacf7atzNWSJlXjBa7H8VsCDYhtygGdF00CqkXGHiYkpy1Sntgy9n50bNJ3umfuoRi2+ed3B68r+srJc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756402303; 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=69mE6QIBq3ZmENHyPTgP1dYbpvYchVwJFEPdQRbtihM=; b=TKScENnw8PfPYI5+Mp0ZEVHX2cCNJaGFNsgfnBP06Ik4ZsQ+8xQxB8VkUldCjTRP5PrThoQ+Z7hqEwzOHkaLwkGd44SPaq9Ukw6ipDFmoih+bQ17h933+T9H2RdTZ2tCL6WX9Tf4BB7EPKbH5L29ntHkrRn6QsgyyyoqscEL70A= 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 1756402303072145.38158989348096; Thu, 28 Aug 2025 10:31:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgI8-0006Ez-Oe; Thu, 28 Aug 2025 13:20: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 1urbW8-000840-6O for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:18 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbW0-0008HK-UP for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:06 -0400 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-24646202152so10795755ad.0 for ; Thu, 28 Aug 2025 05:14:04 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.14.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:14:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383243; x=1756988043; 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=69mE6QIBq3ZmENHyPTgP1dYbpvYchVwJFEPdQRbtihM=; b=xv/r1xh5msSHloBRpsGse+M5mU16oMurK1O7hjxjsCnd2fSphUMte8V0g6nClE/xE+ B0qZGzRT7dEGs8QzTSSvUiFgfkRHWIKJd6YoBTjZ24O2s8jOVQuOUlf12Ajc0gnDAGUw e+WZiTMUgBGVyfia1uoin1Omt5dZqHo9vxROg3/ozGhcXtwkOZK/Ey7aaaS36CwaEIyn 38XXXDF6WLs518h4K9mNW5pzsNmI8Suz3f7tHYmUGnS4/EVBaJ1IfbARLjuTxtCrrjDG M13kzWhl93Rjonxg/XYgpexNtvXFR2LRTdPyiw0jDDY3AjJ/dVMVDCRyMQGn73+twD41 tUjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383243; x=1756988043; 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=69mE6QIBq3ZmENHyPTgP1dYbpvYchVwJFEPdQRbtihM=; b=lgOCXne5MrlXVfO5mmp9iqRg1xGFy3rb75+Riwc/oQre6B67dAi/QRvNv+x6RSibfM V28SVmhlbZ1ETU6RXhB8wGlcgEtBXGQWU23t/ki4haZsg8XbwClPu40Ud2NxYeGVDJA8 IOmqSz4BJVmEbD6YBCYSz//+O1p0SYqcPF2GGxnGJNblTRxoApyKxF1bIaOAdxdiL7oJ 0oGhbBw4EXcDsxoug7W8I8u1ilPU0z/90lROm5l3OZXj48hY0fbSAqpXiCtpWuHCVwTa PeaZFFeEaR6w6rruqx0/ds0aUidneXGZN90UpzKOr5W8daY23k05J6etUGeID32HIGAz /GbA== X-Gm-Message-State: AOJu0Ywyh9h85l3q7Idx/kVRddpwnnsvqM1jDsVyAQ/02WWAiZh5DxbJ lPekFvrnjFOqC4lkmvCxrzaoG/Dt8jHOgbh3gzBxvT7IDU0v7yLSzbeKBcS/hYEgwW98KipB/D/ ErMqC9BY= X-Gm-Gg: ASbGncuZlQTPJTJ4PxDUwlrfEw4OiiTEPK42caDEnf1hQeDc7TQnsUncxNvfP7fFiQa BlUZUE1PytAiZkKJdDRoCPG/gfH+UrSv0kemsPE5Cl5Qm6Fq0BwzQqcxPmyg5TIpFu3kIdyWdKy mUcsGEOluN6tJHmq2Cqyt53YxnHPZG57iN1MnYW+y+prkqvmJyvKdDEfrbuUDV4yMW2wjrO8wIU a8QGiXiYgEowJ/Oyap8k0bWVG1NAU04lpAtFNpt5pUUA6yuic8bX7YW7NpHzoDEcokJYdfnMLRH QZzC4+vbmRm+m7sMZGjZcu9DUtWfqhwApNFccT/AfpeY9PCdkH85ckYIs64Q/3UmaBsQDH4rtMz KwvUYPy0Hg5lgoFUTS4kukFBMTfExghK8h7Ax X-Google-Smtp-Source: AGHT+IFdLJIpRp1Ou8yY2NuTtNiJhO61lIo284ui+XVaPL5gpQWrdFYaxwomgF3gbI/uyGmZaauDOg== X-Received: by 2002:a17:903:1a45:b0:246:ddd6:f8b9 with SMTP id d9443c01a7336-246ddd6fd04mr196377315ad.43.1756383242807; Thu, 28 Aug 2025 05:14:02 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 52/87] linux-user/s390x: Expand target_elf_gregset_t Date: Thu, 28 Aug 2025 22:08:01 +1000 Message-ID: <20250828120836.195358-53-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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: 1756402305621124100 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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756403632; cv=none; d=zohomail.com; s=zohoarc; b=N6xqsTNXsC8iTrdslELWvdoJdnZ9FHWrKuHU5txDalSG1Kev1GyP8/dWTHMlcc78fiJlK9+VukGvjgoPMCgnqvtnT9BJ5RZaDrOqkJs15jKgzLuKV/mrCKSifLztgAjGzaN4TCoh/i/IiFcqg4P9CuXH94nYUdcHfYaqhSqZnlk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756403632; 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=HLQh7CWptXLZv/VAP/TlmbA4AxN3fzKeApuzOewiD14=; b=gVGV33oQxg5DGSL73JxOYILirjcdrB6XdiLH804Xk6S94jEPGwE6Vvo6VQIQFpkC2zoh+1bHIYHtVyetmxCflsxgAISR5F/p28PWeFAuUdxVfMBZYYvASc7KqVbXtccRnJS35SikDQ5I7/aUcomrWTefcOyIHH7QWnQ4zvAQnb8= 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 1756403632857593.061080148737; Thu, 28 Aug 2025 10:53:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgJD-00006N-Ug; Thu, 28 Aug 2025 13:21: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 1urbWD-00085G-Ij for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:31 -0400 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbW4-0008I9-VZ for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:12 -0400 Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-b49d6f8f347so823388a12.0 for ; Thu, 28 Aug 2025 05:14:06 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.14.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:14:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383245; x=1756988045; 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=HLQh7CWptXLZv/VAP/TlmbA4AxN3fzKeApuzOewiD14=; b=fBA5cil41qT2pUOtOZxFmZ8yIo6rjQ/RW4YTgwbmIIZK7qJxW7EXtO/vz2hIFEWyPE w+rSj10xICUktBYQD+GtLWm3/rQfeWzNGUmX03LGEmm0uez/wkNuH9xdLoFANkoBJd+x WWD7NiYP83KpYHQS7Uj865ELoVtYadoME3rni7W+DggGzdWIcAuorvGKkb6IedKWMat1 GOtyY9Q0fpU3cQjUVl5dmfOWO4igbqtcUASipamJb84Sm4WO0ndFQCMxlBVcuo1ueHQL EB99DV7dceUUbjYpKT+3JB2biatfeoA0XNW0pQYW3Iii1uG7LfUGFFKGYEXinXLS/hYK hcNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383245; x=1756988045; 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=HLQh7CWptXLZv/VAP/TlmbA4AxN3fzKeApuzOewiD14=; b=jkKoLrbHLfHHbIFtUrHXlnQTLjVseqLhy8jwHyGOVWAGp519Ys8cqkNw5Kkb2PVvmx 8eO8uXoZZgo/Df4bVznjoTWZOAxt2Y7aXIY95Ji4QW4915SvXVGxvl8tJpI/Cx3r2MQ/ VpQ++kt4nrGjkA6JVesPM1y4lwzRghYimyDnLK75bMB4l7UZjI7+RIshbJQdR7TXpwUn YN4QdcoVsQhPRVcyDoEq9lkfUwTEUWqilUPl9Aup9vRrRLMDbbLvWYMocfzZrDj5IRo1 KDbpurRBVzO44R0Si/MyWMDaYmmaJh5oQLC9Kr0a/Q/JCtUlIOBjxU5MLFzEoMVpAwLB r0IQ== X-Gm-Message-State: AOJu0Ywg86F4RJu4eTPj+k7sMf+iVlMtx/PrCx882GwBscbRyhH9kCfO FFVGPopEZecAKsMniBcFIz3NUyzwT37tLq1tZpqTrZNqh+8BzGuwdRgs1XpI0gocMR+bpXtQTq4 nO2Vhvz8= X-Gm-Gg: ASbGncuz7D8s/1ikgNgN6vnkU+rhJWWL/EX7OoCMvTPJYAb7OqFVO1z5TutpdgqEL0w vYTINPw0LyIyvZtA8j5OLXOZjNKi/zJzoNDLnFS4ITi9Ab09XWt6zYXZ0QtKwMQ97SRGYAAFBnq trVFToTf5lcH6YEzzNXwGpoOpxz4IgM7csY2rvCxEaBaasXs20g9PC8YsKtyChXbdNrqx1lS/ZH +Pf8SxUnJ9KAw+J7zwY5piDlDIBNzV+DUDRZqdnMj/uen0DLP0UX2rL039mgXwH6ARFG/pDjN4F NpiJ9fQ0XKhx8fDqEQWS9WbJsGM766ZVEZj5e4aTnancJjfx7ew1+9/C6F59uBE1yRxbgi2lwFl soaEuvtRSCE3GkgURiVgJi7mfDWr+SYz1g3tf X-Google-Smtp-Source: AGHT+IEzDNJDjNZp4eaCIPCevLG4xEUftyLVMB+iXJTeoX3ZYv4SDLtH73XxQ1zX/ur2sWckeN/49Q== X-Received: by 2002:a17:903:1246:b0:224:910:23f0 with SMTP id d9443c01a7336-2462ef9332emr331298405ad.49.1756383245250; Thu, 28 Aug 2025 05:14:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 53/87] linux-user/sh4: Create target_ptrace.h Date: Thu, 28 Aug 2025 22:08:02 +1000 Message-ID: <20250828120836.195358-54-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::535; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x535.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: 1756403633565116600 Content-Type: text/plain; charset="utf-8" Move target_pt_regs to target_ptrace.h. Convert to abi_foo types. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756401269; cv=none; d=zohomail.com; s=zohoarc; b=j+yM3cFn09eeClGFH/LxlgZK3hoHkBOjLsnzDdmU9xB0U6Oyv/bmYqF9GEiN4xP+LpVBs1WO3GSAKWsBwNn4UCFXwZCVsjFOXceYRbXrxqXoK3DaHVeOzIlS4trSpLxaS7X92ojEoeq6aO+1w5Bc2Aa9LpV4JpssOAH7hVTA6wk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756401269; 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=WDNbW1jEFzivMgdjpGb4I3ZK7So1buAUk1BT20d5CFI=; b=b+q1pwiugxOS1/sdxQIpN8R/Mh4K0oILsAzyAnxAUSnKTJu98/n19MYUf7Ao4aaON4ITu1rJjUyCC6YGxrZJy2WAem9p3wwuV5Z1qsLCJk89IPyRmjEMv9o0iypzjKspbbXom2TWrE4P/+iLwG8O9yT3VDpuM7KTA0srKckaEok= 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 1756401269142532.0770661204224; Thu, 28 Aug 2025 10:14:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgBh-0002Wp-SB; Thu, 28 Aug 2025 13:13:26 -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 1urbWD-00085R-Mk for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:31 -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 1urbW7-0008IS-51 for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:13 -0400 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-244582738b5so7690585ad.3 for ; Thu, 28 Aug 2025 05:14:08 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.14.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:14:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383247; x=1756988047; 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=WDNbW1jEFzivMgdjpGb4I3ZK7So1buAUk1BT20d5CFI=; b=eyQVzekdgLlJI1742KJ9p1lE/cgYH5ku1pinPfoGGg7OfuVkaaw8yETY5NrhKRUlg1 SZVDuhAEy8gjqmkhH/1KejnNP5UXjkb2cGzWkdbOG4K9qD3WQozjSQyPBq3Ou46UPzFc MN1l+xcL0infita8CdD5B0qKxJAVG6DIFJVr3UtP+8Y97DFY07Z4qEPwBfXNke0jVzVX vF+nhPoAsA8IQmuPdsmImmcmKtvjm2Gw7r55FnMqHaGHYLD5AWC1iRp2i4PsfMFdFeDs pRzdzfg6RTpGzMjWzURNHzacI0ULnXlEN8sZwKelPybtHTqKUkDI/7N8Tksk3rcklgkQ U0WQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383247; x=1756988047; 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=WDNbW1jEFzivMgdjpGb4I3ZK7So1buAUk1BT20d5CFI=; b=eCKbWNZ+EwlWu67BDbfQyKZXYtiKYmBOeCmKx4uT1nphw9Sfr6riisjw/gmdF2E2Xm JmlaQ+jkq4mgwyuMyPQuPHVQerrZwC74wSDasyqnZXyWqFZEdpXR4tpR0YRyBGJ9LXJe TxGgkXpgnaYZ7fpR+6QbubQVeZdu6K5LOysX2KUDEeOksJm7mCS2zMLKxM19PUbGEt9Y utlIIrW+3Qwerr3I1OgPSMxpKf/me9Xl0U9eBVDyD3r4uGuhjk1gByWjeE3P+MveXdar bMasWRURtHuLXf18TUKiuOr6+NBdQA8OkUPvP4O2mVmn/4EP2LFd49kA62JEgBUe4HYB ySeA== X-Gm-Message-State: AOJu0Yz4lMynQe7WayDi+rxyrkTKIGWgM+qWtZaGQ0zAWdwQI8xPXXBG acZCtXrVjIQSO18d5LiebF9L98resE/5mgeWjQATkP2Y0sq55Xv+Bypsn1M4R+As10GRy3Aofax aBzRoHsk= X-Gm-Gg: ASbGncuZY9C3d7gBjhjvIySuhGC51Jf1Qk40g0gHoMG0cmHyCBXbKegRfjsOM7s4VJ9 plxbT/vqXfOGuhJeN68n1CgWglIPNyX6RWUMvJxzydeBTDeH/KWBKW/57G6A2C7lBvCmc0AHIEW EAEsRfe+zxv1mIXIImMPCc27JYrjkoou2n6a9KHyTQG9yKdVteyXrkjRTx9v4a47lmzzNQhxycB g2XtSkz9UVnCpgPlAL9BtvMPDQgx2UZ3TVeIcy48q2dREekAJg0yqM3x4IP5RaYp/zeqUAyi2Vz M2SPLD/EJJBd5CNcjEmKL3Y8YsinHadObViL6fAyn4ZD+K5aFjx8OZeHsP6ZEXVfwQ5cpv/3+S5 5ziiGgUJDpO/851psOoHB8CZwdg== X-Google-Smtp-Source: AGHT+IEUtiQT4vpn0WJZ3M4GOHrIkpRGLzAUAAFj0TcxMt0tA+LBi3cvHf937VM/nIPyDpIJsVAASg== X-Received: by 2002:a17:902:da89:b0:248:cd4c:d6e with SMTP id d9443c01a7336-248cd4c0defmr35049975ad.9.1756383247445; Thu, 28 Aug 2025 05:14:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 54/87] linux-user/sh4: Expand target_elf_gregset_t Date: Thu, 28 Aug 2025 22:08:03 +1000 Message-ID: <20250828120836.195358-55-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756401272133124100 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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756401346; cv=none; d=zohomail.com; s=zohoarc; b=MzRZT6193uwGpjbrywSRkbgVkY4HqewQ7S3Dtw9Xi8ohFJDcP4ak4H4X/BMSG6/Q88ld2ZxE3L/ps7YwGnmZk+Gy0p6H660CY1Bi+wHj4U+V5Id+fiVFh/lugE731uM/C/QyBFm6YZaQDMh4B9eMCjAg16c3b6deBpeVDJiNM7s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756401346; 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=MTwliHBkLVkAYi85E5x/rvz1P3OFlfKbMmUTuWWe28I=; b=kD9SWjTUYdhKkeqhW22YGlSkWq6Oq3VZ5AgqsXz41LoUcxyPP0Ew/C59F140SL3yaly7dhxOLH9Cqg+4p5Ja/fRD4Z/OlQfbxXTWUblko8b10kncpUf8JxusxBMkzWrFK+dJkNkpnSPcr4uAUhRWIfcu/I+g93CkKwK80g4m/hY= 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 1756401346292323.2404113000997; Thu, 28 Aug 2025 10:15:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgBp-0002aL-Bl; Thu, 28 Aug 2025 13:13:33 -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 1urbWN-00086r-Dt for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:32 -0400 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbW9-0008Ix-Bz for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:18 -0400 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-2489c65330aso8539725ad.0 for ; Thu, 28 Aug 2025 05:14:11 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.14.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:14:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383250; x=1756988050; 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=MTwliHBkLVkAYi85E5x/rvz1P3OFlfKbMmUTuWWe28I=; b=Xr2kJxPvF86M78uYYVRiAL/lavDNp1I6b0/APa3A1L4mSG0+B0YHNHKyuIKT6Qld5M Er1jVIWTWS7TBdhfVDmVztEG/tMepPmy7DG5FdR5QwFR3o3a/btVbCbCdxVTiR7dCBBv VWGtJMgi0oL8AssuviisgFj00u6xgCELV+PcgBQo9pKKXiXODIR7E/3VXKcf+rgWdbul HolFL9oCRmdupFG3QlTc5fN+/MgHmwn4v5imMe39Fz1lG9MZC2A2QqPVzcTG3Wtfp0z5 SFC4QEc4s1EkTn8JFRaiwRWoaYRFHie5IZ94s23MB1cTOhbYyiLMkUJhoKUVkhDitkis q9nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383250; x=1756988050; 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=MTwliHBkLVkAYi85E5x/rvz1P3OFlfKbMmUTuWWe28I=; b=OXcdNqSS/kpNB6ejSv157eR9Z7eG8aeG8PtY/DqhHiANeiWLFV8ozVk9kXYq9DRbcW 5aj4Pldlot4ikuA0UQgbZPZSVMfoCUKp7HCaVC6LSbQlx7f157bOBmKcK0nBnAZ7doXO axpl9w+mN1IKv8f70W357CYeTa17o31XFpqoSY0FfXIYK3OBDFYCYYyhG1Jc3emSHF+T ixmlexc5sXRem4E6bIgTacJVSgm1Qp60U4uJb2ejaKZCq4hAaDdoOct3JUsPj80wWYPY 9qAhNM/adCLYC+90BUu6zaFVhYe41z273/tUIOstXeoinDQmZ9Y6TcRJ9F/TxSdIBDeH GtBg== X-Gm-Message-State: AOJu0YyS3wripAUHCd7pNegJWmt4kdiTvp+Y48iVaVh3RtTkWC6g6KeT O0jge7borB4A2IshgpvAdQK9VHQrlRtEHHGIG7xkpFv78So90OWuxcylunYUqjqmC4SJmr1yKv0 OuGGaCCo= X-Gm-Gg: ASbGnctkFlr3aCcxqQcINoCGuGGAkbnUugWiI5X19DEuLZotIps7366uwoeerGmB9E6 9DQj4qZ0xJl438oqATzWXSZmv5y17MNgytTpEtG+RiD2Qq+njTMTMAIoYemfiLSUcD/EmqZWf13 HFdpxlYi0ucF2DMdQvpVhjSuS36D+W/vQLkLICxf38sjrXc1nUWziz+M0vvS0IrRoqTujreIqVn YcGpFju3kHXHGCM9rHzDZkwqD8FUbvo9fRDHwqI9JQbctn514LGmbpD5QEgbUu0y8af5arm7eE9 +CqdLeqNO3kAXxwXJDB8FW1mr+SFjyapdJyA7zaRcArnxhibrMt+M9RoTblVK3JR/GohgOWhHTX 15Excs0WK5Lt6kn/83SnrwGtxsY95YfNqKQ/C X-Google-Smtp-Source: AGHT+IHUSDElGbKZNX3LDi+azFnORcdO75Po2MOgpJyFvvfcY08w9GnY7dItdMgv35X4Nyih+kROoQ== X-Received: by 2002:a17:902:dad1:b0:240:8262:1a46 with SMTP id d9443c01a7336-2462ee54512mr311909125ad.25.1756383249880; Thu, 28 Aug 2025 05:14:09 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 55/87] linux-user/xtensa: Create target_ptrace.h Date: Thu, 28 Aug 2025 22:08:04 +1000 Message-ID: <20250828120836.195358-56-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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: 1756401348752124100 Content-Type: text/plain; charset="utf-8" Remove the target_pt_regs; add target_use_pt_regs to target_ptrace.h, which matches what is actually used. Remove xtensa_reg_t and xtregs_opt_t. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756403021; cv=none; d=zohomail.com; s=zohoarc; b=HfW9GVb7qGXEe12fRc/6/Ri842Y/otOuJFmAWFGkySWNuxn1fSBUdHusniRv+54s9c8z3OcjSaR6rQCvzhhbSHPp9wfExHSu/SEyxlHp8i7UtABSUgVfNLItsK3Xe4jnEa7lAr1egL0vPiHUGXFmh/X9bVNP/+n8yc3WpbkDxIk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756403021; 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=udROh7IxyCPMaBQMSkwhMc7r8ev3r6iqORdDf9N+B/Y=; b=aRMDtN+8IuT+hvBCg1RwJSBFubUBhVlgRsOAfZEhEQF1OcXW5mUq5HOblFgrADefVU2D+06rr1CjCQUnhL3N0I5tnJsO6UuuOdo6bD1UAlj30Gmcf3jU60pLeXjktoI982ofH3e7j12mEOUyZpYVLTyByg5S2PxohVmrb2SjY0A= 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 1756403021148981.2177700800032; Thu, 28 Aug 2025 10:43:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgI5-00065J-5x; Thu, 28 Aug 2025 13:20: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 1urbWN-00086t-IK for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:33 -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 1urbWB-0008JZ-NQ for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:18 -0400 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-76e6cbb991aso831147b3a.1 for ; Thu, 28 Aug 2025 05:14:14 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.14.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:14:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383253; x=1756988053; 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=udROh7IxyCPMaBQMSkwhMc7r8ev3r6iqORdDf9N+B/Y=; b=NwLOdTlWjrOZBLiuo++MfIFh0NMpf9mAV0iLJgrNU8oi5UGTSz5SQxEU+Bh0waxwOB 8uvL8n/QJ33yAWO53lbldczfVnhYxWOvr6+905dWOTr+wr5Sq9A/sjJs03u161zByp6b lpR5u7Saps5tNa1kqJWL0u882SgI5bj+pvUpjynuJdlIrYfb7BqBR29D1+l/BeMgyck3 +AwHWYG8ggoNkKee6dSwY9gJPlyF0SnznBF6tU7zPOkkG94de/aOR5Uz1mCSpVLBX5DQ AA3uecUYCY8kluGmZ0c4V1WzrbdbNK26y9uTSIRhM/H5UvfnL+dlzSqUkkhzmR+i5I2x FyTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383253; x=1756988053; 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=udROh7IxyCPMaBQMSkwhMc7r8ev3r6iqORdDf9N+B/Y=; b=pqsKnFN74gnl/YVD2T/+S19D/sQ+xzsr88TXifzdJgsFLUelPyl+zTX3SiXYTCIXMh Qbcn0we7858wYrcpCA3l0n18lwtj1zVjNuXlfbAh36v7wzOE1cB7YS2PoQu5xJtZcfO3 AmPL8XzVbz1nAIGqia9U22Fyo5MkbNHH/qM0k5vqi9+Xjsiubtk1BapiI7o9w3ceRZZY qRj9Ac95rlPXN7erJtrW57PjDGRbfsyEDWNKoHWYT1s+QNyaOWijLdAzIyzG8lA597pn q9nd3g/TguqHVP5yk2gn7c99vcZ0SicZuvLukKpSsPwTOWygr6UPQ8RjjhIYNgU2RyKu q/+w== X-Gm-Message-State: AOJu0YxUN7Ylz1MCSxebRhZ41RlzcvOE5SQ969Q8lPtFYHE38UQgKVaQ bzAUWu+StfZ5eojunhq/gAIvjgyhZyxNkr3jOF1rNUbnHOyJKIwIak5gANAZ4NTY9wR76xqvC4y erE9FHMk= X-Gm-Gg: ASbGncsVik2mtCXC/UJVBMacEHI1MnVliDhCBkJGDGnbYj/42CPl0WqBVlF7CuHLswl we8eDfWfCodPcVLNxaiX1Jh84kE2tKtJh0u7SYsLaCpZPdNPFSm2cy1JX2gQbM0VQgnAWZ8s0Oe RtSYe6mKQ2gw4z4sapg2DyblpsteLJJCoHPGcElRdPAHW4hhERZ4k1vKvmnWLUvjJylsf9E2gG5 dSn4r8hZEgmegbDOZ/qRoHerTUQfepqOx3dVFQp/N4zgBApfeTmopgrxWkqZ4rdLCLXopEZVc6g SmqLh1Y6hxu9IACKhcdZQxaBkVU9ysJeVFsL0fCK/0zfDNArObQJiPexkA6ctQIxAcA9lLrOwyE yQdRV7m1WIRq0fi1DFpQFuk+NRKBijE9gId4s X-Google-Smtp-Source: AGHT+IGegd23sX3UCoRDGeERtKI3Q/TlDFvrhae4RzI2VXQ2TWy7ey7wibadeU46Xnvi/FUXu8ifxg== X-Received: by 2002:a17:902:e888:b0:23f:df56:c74c with SMTP id d9443c01a7336-2462ee38734mr276878115ad.14.1756383253194; Thu, 28 Aug 2025 05:14:13 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 56/87] linux-user/xtensa: Expand target_elf_gregset_t Date: Thu, 28 Aug 2025 22:08:05 +1000 Message-ID: <20250828120836.195358-57-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756403024360124100 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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756403607; cv=none; d=zohomail.com; s=zohoarc; b=RSn75G4chuD2NvVg7cMC9P9LpAAm4e29vXYyvN2GFvYEq0UK5NHiFQzV+pcHwI3IA1NL8GsL5Kcw5MDFo3idfwOiDo5571Dq9vv1x7BSzHYY8Cx9H0gyo/AcI4/tP7W3hGrU1uap9BwMMzHKwP57BVMWUvwgUvVzZ11MVXqw/mE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756403607; 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=ZqmJNqGzDljJCLy2POHtK33wFf3pP48lEhqmqUFcYS4XyAlQZzIrtci92Pf5hU8aPsDDdyiQ3Y8w977ZOof64gc2/LxxxMGyO86rCISuW9S5fD4Fwoxf1aXNruQ2dnFbUZrpYeGc47fGMi4ueRIq5shixVBBS2FAsTKlwHFFPoA= 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 1756403607809750.2997581502253; Thu, 28 Aug 2025 10:53:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgJE-00006R-2A; Thu, 28 Aug 2025 13:21: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 1urbWO-00087A-75 for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:33 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbWF-0008KN-Hs for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:21 -0400 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-2467de5160eso8784415ad.0 for ; Thu, 28 Aug 2025 05:14:19 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.14.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:14:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383258; x=1756988058; 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=cDVgSJfyyNc2Idx195xMLbqQlzmFgzlnxDlVsfA7wmeHBNa2GGncb9whFiQE87WZdt EFcmF8Eerv9IgErTfG145MQ5JFQf29EzAw4owrx/14/TIaktF/nP94/rg5X6AbwAP2vN Sq6YaZRimNnBmMzxZXrbcNMW0JZCY8Jh8ALSn74TgKMqlwxdPbLc5Q4by3PBAK/GBupY fcU3xlNOF6Ocky6wJ1JB6oO02lvuE98PSEebC7Oc+eviGQObM8RKCTxl8j5TegJz6wet Ky5yywJOIilFX/GR6MSIsvQVr1y3h+jCP3DuOQl560+WgXbnZ+fEP2VeQCEFCMfONrNK 06Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383258; x=1756988058; 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=shpdOgcnEmvDsMqqsMJ8GDr1PxA4XFOmtPABoAfLoZbcND62CaOLxFo80UBbXSXjHS eamI6nJUIAT15GIR3IJgZ5XOtOPUo8xW6ava+tF/h3We8uOMbis0aiRsreM/uQsr/6Kf mazdzV3I1OHZwl7sLVS8qOsaXtT/rc2YZRD/FQ5JD2eg+kwd0eJMzIo+nMjlnp4T+1Pc wnGhK+KXPqn7MU892yGM2r6UKW51k9RCmpAknNIhRV7vH3Jls09LB5lzNFqSwkH+RIi0 fA7tPYnsF/IA6lMBDB6ZLn37WQmAyzVBhclT625EkZ7uq4fXf82GvPRWUk+YYaMl7esQ 9tpw== X-Gm-Message-State: AOJu0Yxk5Z1G6IMbfy7VBNIxHIodmfOPUPJURhpak5eLTgl+8ucl0CZ5 cCFw4QqsNvo8SIXhtvrRwytdIbNlE349OrhjfG9s8pytnoGW4FDR8+zCvLkwLe9RJrSW1clVGpK DkyPC/3I= X-Gm-Gg: ASbGnctt21Epqlejx13Yxk7JCr0W6OIHBpJcClb0jqF8I/XHxkV/OmbMmycpsSi3Xk+ tfG0PqrU22x/k+W5a2Rt4Ly3Vp5FSshs+92bG+WO2tf4atNXtdBBEq70kK+c4dCpF0AkxBoS//t +cTyVtoTMz4e1F/fXiKFjSgQESgFEb99u10IDZvRV460hAMvV9fL3X1LnMoTSZvgIUGfgUxr5PH wWaaCtk18Zt1vmxHcQJTzvw2Q1DbM+uBhVtPecnIfvTzszGToxOzooYr8dqT4COYjJ0Zxc2lLym HQdhCFdZIFDGiyRfAVFsH2zeEX1ipgsh2tUHwMLZ14Vzpmm5pd9jQvN5l5P2iC77DgJ32/doapO uw8k/xuhBtLRufwjG9eC8V/2K+nj00pyK1Xev X-Google-Smtp-Source: AGHT+IFIVaXdXC6ujBphFfabUwQ75eHqjzWYJ+o4afRguKxlXNrOaRk2h7Hy48GMO9VZ4NhA75dIng== X-Received: by 2002:a17:903:2ec7:b0:248:74db:1bf1 with SMTP id d9443c01a7336-24874db1f9amr111457405ad.44.1756383257977; Thu, 28 Aug 2025 05:14:17 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 57/87] linux-user: Move init_guest_commpage to x86_64/elfload.c Date: Thu, 28 Aug 2025 22:08:06 +1000 Message-ID: <20250828120836.195358-58-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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: 1756403610614124100 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:25:45 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=1756402756; cv=none; d=zohomail.com; s=zohoarc; b=NFOh1UTqsGhh++mUuJJL14kyx+oYk9fI+l8WaHhga40dZGWu5cm2r9iGR1ggoarZiadBCnAEO9VAbp9b/t5a9btMKvKW9cQG4tU2pr76vWM6TmkmkfR6pUrzXxwqN99pyb26AAHFovVeDM9BB0C3IJlJ9w71tXB9U5sbMZ/Oj6Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756402756; 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=jQHCDU/pTSK07tMwn49XfZ5g/Bp/iGqsx66exuLr2Ek=; b=EFpFTK3YgA+P/ZjF3vHHUNgFuZv8eRB2pkoBM0p40rMcSq2FTjVLa6oCavQgKv9/UfkhNnQOIE8mziCL25QnVliWH5u0Sln+t5P3KBIGaluoRi+VjwL2eLnXaoZeLEyfQegaa+1HR/Ac11eWPS5wGo/LZZUFcxbWeRsJ6y6G2rs= 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 1756402756786988.0685074292948; Thu, 28 Aug 2025 10:39:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgJC-00005T-N6; Thu, 28 Aug 2025 13:21: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 1urbWS-000889-Ud for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:37 -0400 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbWI-0008Kx-7H for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:27 -0400 Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-b4c53892a56so802825a12.2 for ; Thu, 28 Aug 2025 05:14:21 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.14.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:14:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383260; x=1756988060; 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=jQHCDU/pTSK07tMwn49XfZ5g/Bp/iGqsx66exuLr2Ek=; b=lbqO+yw0I6CRnStSmJny8wentHQ3Q+DhVbxJCydyx9GkgDmkiYxdULvLjxr21tWqtu lkZOrBqkd9QZRbeEEJI2A6js3cSrMseYtnVMPgMF7TnQ9N7qJh6AMKaDmMZBz355D5tN Pkzc14+W0TKH0JCdZgKR/mt+MTGD0mu4YHBNL1SpqqQBtcpSqrkVqbdpXm4oUF+v8s4p tcDWzHfdepY0T8TxdcivsSXhPO6vxwzzANwMGw2zEt8ne/duPXn0c8NdPJvl6Cy8IeS7 90qhgMNPkeNiXlsaL+S2sw449m6ghAoK6Pr7tMxKSBq2nvhllXpzdxl5N6zAwAJRLhAl UbCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383260; x=1756988060; 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=jQHCDU/pTSK07tMwn49XfZ5g/Bp/iGqsx66exuLr2Ek=; b=hk1hL2l4RnKnec53oczzXreCcOAxOPwdlYze8C5FAsZEOUcdaiEfeRFPjVNj+OsfL6 6IvA16DzznjWfWmetQUN54Pg9k3qx5zI0mKDqPojP3my82mMskgNeQH0Uh4SaqpuzNnH A9yUveIj53m4htawAMG5SCsFR+xCe1Ma0OdW0hesIQ8lx6XUyqHTuOdsHnMxkaanTWFW VktLG3tqlzo4H15eDmoq1PbhP04VPnYKsy9K5dZAZwqmWAYL5ePD7toO5mHrpjqbba8L xcbJJOrj1xOeOql2VKN4uIYX7Now1if1JEXcL9UdhX7Zmcdv9Dii7MrHC10zJVNKX6p1 Sj+A== X-Gm-Message-State: AOJu0Yz88ohNfDbXPHcUsn+FiTuzn8fBYx/V1Ai3ka6EAWgW7NTCIR2W nOuNjs8GvUS8PmUki7IhR5d6NtSA0Ihc6f++A6c1wIcEdRV9Ixin9AaOwTILoD56LEu8kp84iug HUiKRpO4= X-Gm-Gg: ASbGncunIQvQBb6L3sPoJo54h1xoIG1k3DUzSt7NmaKsWmf2YFPdzCSVA8B3biWQGod FoX0e7rqFPj5WlRmN3rLSEdNPt+TXkZ7FWi0x+pXJ7h+rAknCUpmzWcyy4UG78istiu6oj0cFTk Wd1xw7SJ/zAWZdEwfdbcf86Vl+vzM8tYOaLuhnJoPtxxj2E1c5RIPJN8109k62T2VFsT4Vxns+7 0TNf9j1IlNZYBcOR3FTivO9QX6ueSvhBiMVyn7AjX6zsOwcApjNP52mfYVCK7Qk2DjRHqvPwAya y3Wy2E2ThPmyH+sUZJmaRCXJasYmbwlq0qmn7XyU7E6oQlKezfqTrxGCZiqkWAfxuIGC7jm8kdu SwQkIhBvW9PRN+c0Vbd5xncwYdaXyh50AVU51r4obu10JL+0= X-Google-Smtp-Source: AGHT+IHF81uD5MsSVSTAEayLAIRktmabSGF+w2l8vVTuCiTaHgrSJ+KfYyXh0U3Gsl5q+2afIgXOMA== X-Received: by 2002:a17:902:e745:b0:248:9429:363a with SMTP id d9443c01a7336-24894293a0dmr77462765ad.9.1756383260600; Thu, 28 Aug 2025 05:14:20 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 58/87] linux-user: Move init_guest_commpage to arm/elfload.c Date: Thu, 28 Aug 2025 22:08:07 +1000 Message-ID: <20250828120836.195358-59-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::52c; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52c.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: 1756402759412124100 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 726d3ec25c..a3f14af691 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:25:45 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=1756401486; cv=none; d=zohomail.com; s=zohoarc; b=MdMP8FGhin9598nUM0BgzBrvdJSS/DFYmEydsrCzSVgKMK67VRvMXFJi/qvuZCSZZwuBmYhK52lOa/x6zqDHALNQB59w8GH8xfaqcxJnXdS2niO7M25+uP+F6egLaWWLS6+fzjcZDMb8j1lVuYc9ACUH7j/jvw0sUNNDqqVwqOA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756401486; 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=jxCFapWlOzHakKyYnAi3yOnRd8kr5Tg5Z/PIDh6sOvC3Fxo18NydNm/vkYwm76SwbpMhh7vdRGNzPdFRCAgY0j4iCsyoXVgq+yvJrh/vT9IH6yfnUmwVTOsIfg2E0aqaLEyr2lKdQNxsfZhks7/Rwm5CjIU37003C4q1wKMEku8= 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 1756401486750783.941281939734; Thu, 28 Aug 2025 10:18:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgCO-0003DP-4G; Thu, 28 Aug 2025 13:14: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 1urbWS-00088D-Ud for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:37 -0400 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbWO-0008La-IQ for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:31 -0400 Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-b49cf21320aso1032894a12.1 for ; Thu, 28 Aug 2025 05:14:24 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.14.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:14:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383264; x=1756988064; 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=P5zBD3WI4BlIYxxLghBd59zbyl4n53QxVfqIbmw54DROYnhLXtyu0iLKAbtWtpeBXT FmfhC0YfJXlKa18ZIUbLgTgQkin/+JNOEzUlZzWbIQH7juz/Bd61q1iLbN4EeE9gNdXk wUnd/wF8v87RuKc+Ci/XcOJ35y7sPOiYU783XgQhR2C0n6DP4XpgLaq54BGaITBPSs15 265ezNCVB46Gsh1jcgn8ulGImHKIC8tToKbDffWk4wfE8o4pzvt9Y8DfSXJ4hZwRBnWW 90GfyvSKZslggEo2U/kofD/0D0QdkffkOhi36XUhaq1mByDIJhty3rVfxGMwyVw6uPR+ iIQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383264; x=1756988064; 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=dGK8LMWZRKYq4ZrUggmwdETtvb3eD+9iIIyO/UO212hBgKZUHrksWMNvYrVkVDUG3H oNN4EqGyPRl8y/37IgQODGYHMv7ul+DQpVZ/cJyo77PYY40GgOyZ+w3DmC4b0jvjhQeX RPrCQWtDNy8XxNXR4yTIQOS7mM0bDpJVkL997SFbu45nbdHPGh2YFZ55+SR8Zk6Gd/f2 mukDkk6Q2jEZ/UZ13CUKHt8SM7B5byAXPkEa2hFuLLbBcK8qar587rAqAoWubIEH2x6f yTmud7R2xIKKHTWx6UtaDMvvvPO9C6DvwvRNQ6g39zPxv+6ZIf6/CafQ/HGnFMebEOO1 +srg== X-Gm-Message-State: AOJu0YziUGW42qzEt6LF+7SMOJwsazYlhoB7p+tt728mBzuI0c+3fNs4 tewCGMFVSNDI7qEMm4a0Y22+qSEPi8jMdzkvZprKTciMm1lp0wq+45ouNgCR1DmfIqIgCiqrBew tMKEtHPw= X-Gm-Gg: ASbGncuw3++B3823OIONOxIZqcLxUddZXjzOOzLdggc0y3/v1xkrckwaX5DIhpNee9k QQpl2TqoVxdMCmCM1Am6K9GOhbYQLMCY/1g2irdK+7henMnkVBlLHG+1JjbIyicINbqtLl1jIPf sDQRUd1WaZNfgFa++zmujlAIXHeUN2lzgZ49MfJK7mWS/C94N+He3QxabMCzkBgz8528EKFmkTr l2GngLsVEXy1S38qdmwsWZ0WkI4cNRuvZD1xoesLKV1scFooD5zVLAMBV1UkryPN15MmlHR306/ k9OKAH940P184GOtbvRKBMR1oG9QHbx4Q2J3RbMgGOrnZ4ld1SV+oO0Zfw5+5ntZBwKUB82EZXR Wfc8z/ev4TQ7NavtlN6fIvEk2VhWYicZvVtcEbXnbAAwJOHw= X-Google-Smtp-Source: AGHT+IE0GVi0OBeMfdw8EANZyzg1IEhChw4uDGfK3cwP/feacIDbaJRsJvsWhwewMPeFs4Zt3TVEzw== X-Received: by 2002:a17:902:e552:b0:247:b86:548f with SMTP id d9443c01a7336-2470b86560amr148579125ad.11.1756383263795; Thu, 28 Aug 2025 05:14:23 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 59/87] linux-user: Move init_guest_commpage to hppa/elfload.c Date: Thu, 28 Aug 2025 22:08:08 +1000 Message-ID: <20250828120836.195358-60-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::532; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x532.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: 1756401487511116601 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:25:45 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=1756403771; cv=none; d=zohomail.com; s=zohoarc; b=AmwnZijEaD7e+M1g5DpmwDpVk+qO0GU3R+R6xsOgA6l4GGYt6I7dT061dApn5VgVPiQw0qhFqZxqv4QBg2cLBO/cOXHTADOmjaPjm4zxdyRVp1USa9jeOtaNJ3SOrLXefMvPPYv/uSCRksbwZiqvsKLqRtCHv6ETSbWKR5s2Huc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756403771; 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=gKB9RPnEkddkfbX8m2UIRybDC+9vJjudS16kPOnC09qPvyrfQd2LZ40KMhOVZM600vhJP39tWiBWR9km+IuMRcYKXqg/V1XVzWDsPuN3uQnC5SbNbma12wuSkfJhJQgrUQX8X+YvULLcFGakBB7cQW1/cuhPNO4JFIyanWKi88A= 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 175640377178510.916414455370841; Thu, 28 Aug 2025 10:56:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgJD-00005h-48; Thu, 28 Aug 2025 13:21: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 1urbWU-00089V-2F for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:37 -0400 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbWP-0008MA-6z for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:31 -0400 Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-b49db86cac4so650265a12.3 for ; Thu, 28 Aug 2025 05:14:28 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.14.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:14:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383267; x=1756988067; 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=qWcJ0lYXdnsLk7XJiudsbQ8DPUp2imGhfzqr4LZQ2Cgc6kKBaHWL3C6QzzbDLna0vv uasjt02fZJm8B4HXx8xuvMifLgIxaK5xs48ipglcy8Nn/ldPOK42lvt4ctgywO9oZ1Io LrOhdUvA70iapMcDHGTKWFDYcy2c0hZUUVj3mxl4N2LdEK/WJHNLdOUu4zdZMdbCIQIi P8I8j0ZWvWBJi6+UyX4elzs41h0y7jz3qEDCJME6AjeMhjsrhSlnXaEZtB82JtsYksg2 DHYbq2PKd424UVfAnPSXAaO+720w9tOcmKe0xswGmA1IOAALINFRGEj8JSR6r8MzUXVs 33uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383267; x=1756988067; 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=DSv41h3Xqwrb2ef3kOvLeTdDamIbyetf7G+J8mifhGbIutnvzz5LCa3W6bRIBfM0Nm LJZBGg7otzLjnafm2ptoNjM50RxAYQ+/4ZvOPb90OGnuK4ObWeWZF7XmmN5REG+mAaY8 x5b2PCMJSEItNTovgoOYHqkLk0WG4nRBMvg/BSWo+ykoynehm8+Lg6QbAmzdf9X/XH3u znOzZsXJ+MCRjsg/nXalKpb97xH+6uMcx3Z6DN3sa+kOy9pfFrmy01UyLcqJld+lOXSM UIUo9GGuSLoUQfZmMRbymSmScr4E6ivElMTV7n62gr+M4wstRidjCkg6QBRnApSDTT8g N7Sg== X-Gm-Message-State: AOJu0YynmmlaV6NgsMk6w+10/YsqV9J23b49BHTOwj7WfvRmkPKOVjhc K4Aq6pvadjduhCrFuXoEZWHOWWrRXVHEUU19fkXQxg1uFa4ZM/FYrw9ErypstosuhgdYQR/BOo6 +gVrHRsM= X-Gm-Gg: ASbGncs1T6Mc+aKt+Y39xoE7R9bLq2A6wP+eRDlj3xzUnNF7AO3MvaSivbbTv3foeCw qSP1z3SsqkAINVGP3J4VNh6/yvHORUGmlz8jtfBCeZ/s2aqNcugbJxJE/bUjDs4rhUGUlsDl86H Rj5TAgQKGACHFM/NHkkJKtleEaAcZKlYu8ALpM6mYnkFMv9p1hsIhMNIcvCYcYMRkOD4Voe7Gxk 9ZDhqSqzlMm8bBhXHz6V8f9Y4mmNWQbw29/UIpeZRG5UiafhnD5sw+3uWK21DIOlWLfj5E0DeM+ J3ID31F6BTg7qnE3Q/KQiSUNFokYYivKEhsuMqCNFNvfyGuP/9ge9nqJs7HA5e1wxdexUuTUGmn TwKAY0jVM5UXQbgtWIng8rZVOoA== X-Google-Smtp-Source: AGHT+IHiydx4F/Pal7RjFuCVgVCn7vpzSxxpU/U6vIO1+G7eOLWzAKWxqZHZAU1Ro7hU9db69P5wkw== X-Received: by 2002:a17:902:da87:b0:248:c109:be14 with SMTP id d9443c01a7336-248c109bec2mr51335595ad.11.1756383267282; Thu, 28 Aug 2025 05:14:27 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 60/87] linux-user: Replace init_guest_commpage macro with function Date: Thu, 28 Aug 2025 22:08:09 +1000 Message-ID: <20250828120836.195358-61-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::536; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x536.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: 1756403773444116600 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:25:45 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=1756401378; cv=none; d=zohomail.com; s=zohoarc; b=G/ojjdCltD9BthU8Wl/OCDxKcQj5VBPN3OTgprH2WMmuLY0SjMyO3HttmdNmqJAl249oFIVyPwip30v+6cegULk2sgOTM9Z2e26GEoNkPdmMO8I2RlGPLXXUF6kLB5TLEM53YsNs/wPVR46MJhAVkkBfFSSt1SY0sJh2N045jM8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756401378; 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=lmN81to/8LnArlBTHNgeDJCC2+8PPilHqHwHcObRIIM=; b=adTXY4X1F2erYMIWGbXg1PDfcJR+2A5dDyZrZ32iABV7MFy3TsTM9kIVjwNmiFSvgDzsg09sHdV97lBenl7nAjMH33qDtXjwZMPz52KOMyJGzW7kS1P+uXKJiNoUr6u7c7Zgvjzvn5BgnaXM8j4h+KDGpXdZtuXlZGy7ydOBvJo= 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 1756401378487933.493568287069; Thu, 28 Aug 2025 10:16:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgCf-0003Gw-Ib; Thu, 28 Aug 2025 13:14: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 1urbWf-0008Dd-Bm for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:48 -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 1urbWS-0008MX-Cz for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:35 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-77033293ed8so802407b3a.0 for ; Thu, 28 Aug 2025 05:14:31 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.14.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:14:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383270; x=1756988070; 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=lmN81to/8LnArlBTHNgeDJCC2+8PPilHqHwHcObRIIM=; b=z1dWGEIysyD6AYX7J2Z2QQmFKKuzLUkHcRZJBZHF/PCw8SpkIhKIRTegLHsWjlTEaq 8IsLYzBCpVjopYUctIu7SECoBlM68LZALJNJ0H4uVji5CJRkeQ6ao2dCWnOY/QbCOX76 5HWk6TVAdUhwoLX0aokXuw53RNCoPJSJX7ugnJDpR7zGR1GNQI9PkPG71QV3ZfhTQB4q 6wp5eHtqxr03OqHc3TVz+WYrfhDE4kiutKsN8FFOYt4LPBibGaeKLhY+eUxuMqnRvLIr 0oiJujKFBCNBZgGbEyOuNAJu1s0Wh6SBOIuXkm0fQ2bONOeBB9EPFJRqE2q7QXbFfljD +9Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383270; x=1756988070; 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=lmN81to/8LnArlBTHNgeDJCC2+8PPilHqHwHcObRIIM=; b=fI3mnkNNkQmQxEb4jpPyTJ5PUWtOTAi6ZVqutMf/woH61/SDLO9hQghWUkYrr130tK 37nMX9Pc0x0kygnABcZUj5OI/u+wjM3KlX6XOoJunnZzmPTEaVLV1B/2RpRlLPibPaEd 5BdlNp5hJG3+YWV0oG9znIRlX61GoMRuTP2oCtQS4fK3arvzI1+9TKJZe3EusPc6qa43 mxbjyxE649L+DWKyFit+GxsIlf57DNgIbGe0ycb9mJAfMkEiatviTpbEr9348Ukii3z4 z3nVwvWQoci2QBWBjuErB33cBuocey9R9DIuIyJvOKlCWOi4FqeJuE121mUxmrzcty9C 3DCA== X-Gm-Message-State: AOJu0Yyie7HSSV6Z7vw8p8DbmHO6PcZe7tauZs6ecRSFXPFOr2y2T8wS Yxarylem4SvlmHwVWZFfjJE+4cyOdqVReiyrVImqpv+vAqh6n/u7Z/WqjQ68RB6BJ/Q9x96aAzu 7m51f2Es= X-Gm-Gg: ASbGncs6gEQUGmMyxGJ/swEmbWBOrb98AO0Aae+d6LMbLQHT+vEkYJLI5Scy5eJ3lkn yt/mmpwm47XAhYk3N6admCKShwUkJwB5EWLYctR6b4aga0TosqGjEK/e5I0d4EGkeNdBuiQRa6S IfH/3fugouxk7uR2vz+DXEmT/Z/tzFajtPXW0yPKmf2J01gN4YOOOA+89l1xXdDjpTMMOuo2CI1 WwNP4mcmL2NuW+pUSadE5aUaB0H8rAsPWOBDAkeGBtFijpwkSecovULFJXeG4Xuuq08/JlhRyTv cr8oA+Om84LU7IYx99VNRWW1leoo7FYIw4gh6kmOveYyituEYpHyvWJXnc/CBXfdDAdkGU4NLpC kSW6uNZqmw1Y8j1idXYqktJ0TdtdFdaJKaXPk X-Google-Smtp-Source: AGHT+IGSuDiZ8dddC9V/g/ZI4dTRxP8OfGV7rhW9h3AwIrVOfbdikruKFlU6fZE2ADnfaEBlLmbWpw== X-Received: by 2002:a17:902:d603:b0:246:a42b:a31d with SMTP id d9443c01a7336-246a42ba453mr222055615ad.44.1756383270191; Thu, 28 Aug 2025 05:14:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 61/87] linux-user: Move get_vdso_image_info to arm/elfload.c Date: Thu, 28 Aug 2025 22:08:10 +1000 Message-ID: <20250828120836.195358-62-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756401381318124101 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 a3f14af691..7e804d82a3 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]); } + +#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:25:45 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=1756403791; cv=none; d=zohomail.com; s=zohoarc; b=gwtc3uf6e17n+Qjmswqt1z5ZizRrp/3UTgfZ6D0NN+uIPf8cPzI51/TNbnO39r2VTZyB61elhVSqkzGaLPTcrVe4La0oOddJ79HM0IA+2RV+3WjMU4VRCsEf1tPS7wAGb70MLHuVC94zFWFOCnj0vw3tF86Eu4UU5CYUMlaXm9A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756403791; 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=KQf5+ro/oclRKyFeFcsxDCS0Dhc6YChwI0yFwgAcaJf5/3MuwYEZVJIfrOpa/CY2cpdWtATDM5dQjUQup034vBNri/DX+wO+fa8Hk9Z+atNP5+h9Mf7olNZ86vIMc7J4c29MFxdMz5dYIM4P/1EDAkdLrYq9Fepv20la5PFjcZc= 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 1756403791045720.4588323205172; Thu, 28 Aug 2025 10:56:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgIA-0006Gm-BS; Thu, 28 Aug 2025 13:20: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 1urbWf-0008Dk-Bm for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:48 -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 1urbWU-0008NH-TU for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:37 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-77033293ed8so802457b3a.0 for ; Thu, 28 Aug 2025 05:14:34 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.14.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:14:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383273; x=1756988073; 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=uPwG9mvoCWRV8345Y5FXQyrIhpYIntknmXlRohqPSxL7fxq8yrwhbE4RcI9CdOCi0P 6QuJClAmmkgmldpWAheWmjFMAhQGmiUmIxDdxwLkHaGwZwFiiDMXAVLQN2gQ51YLnA7U eH/+sqHxSNsW9TDNhiPKxr3AsLJ1aRs+A04zC/7XsrrSEXoCOIaC8ExTutoCeA5V+ZIy S27KpO1574nADsLnVs7NKrH+MeGBVntrCJUjkZXggPijVHbHmmOLEw4sdEM5hPsGhgsU tu0J8Hq3wUq61jtaqDjEetQgjGtHQxKqVwgZDjVrsuY8wQDUE5mwKqpYKemzIEZcVai4 sIIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383273; x=1756988073; 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=PKhPcdYl0pr71R2oCio6oUkYjUiVe8ibPWSvonPf7/Na/gwbYWBEszePgpdKRpGpLO L3+8M0uLGPJANmjPlQ9AccFMATtYB8oFjj85wXGnHigPaVqJedTDTvoNyALOFXov18oz wdxDmEFwipGDzIawGZflNJpT94DBTrNbO2vwSHEprLrrH31wKG22aEwNKt+hCES1AItU AgFZD8q7lkZ9kDyBy10X61FyCmqxiCU8EvxgijjMhoimWaiFpJpj7Ss+62KDo+J2AgV7 Dd9Rc/v3+voV7DhhtX9RW+mrMfN38YE3n2hw18IINXE2ybbJQaO3ovzcr9Mgon2hMA7E OvCg== X-Gm-Message-State: AOJu0YxXXhYekJIuK0+GFFFBYtQwB3A/KW2hlc+aK5RiB4KJQ9vGRGNF qL11SipTCNrnYBbNIwvYKHyHDClcSy4/NlVpkRCR2/CoopVhVjuRiK4x+1OmK17LveOgvASyluy wxevgc5o= X-Gm-Gg: ASbGncueNKWyQQGLoPq19USDWOLvkuFdfuuMn4DQVL0daR8tip5VEv7U0KYq/BPtgOJ TeFtudcl+M6z4bcLhCUQW86+VvZSDS933Qka46MCC7m24JbnmPjvqjLrIrp0D+OKVWs9idNTb9J a4tx2WkZ6ZvgoPAe/z7ubfaQ7/PN84xgjux3IQIrfjGpktG2UxWxV0LqmnYCsxJq/lq2szGdtev gtzW/QeMlXzpj/6FtUzV9yUJe3zy5kWvBqhPvKon7ohgZVRwRlPs4s5waeQGufUretsKXmLjAKE xYCbxAGdgGnPcqcoNa4sZz9TTBxaThd7109EDdJDBgFsWwofYYdITK7NXp/WentY7SHBO9NPocH jqXImqzLFHGKk+j/uw08WXzcHlYveHkVkgq35 X-Google-Smtp-Source: AGHT+IGn4+ohQyxoU0IYhTxcXxtDJzz4nBlvZbSFDlz30QzsnUNMeVFTFcVUWZ2/XhWeSftktIENRQ== X-Received: by 2002:a17:902:e78c:b0:248:a18e:200a with SMTP id d9443c01a7336-248a19d6483mr64186535ad.10.1756383273010; Thu, 28 Aug 2025 05:14:33 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 62/87] linux-user: Remove ELF_EXEC_PAGESIZE Date: Thu, 28 Aug 2025 22:08:11 +1000 Message-ID: <20250828120836.195358-63-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756403791815116600 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:25:45 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=1756403208; cv=none; d=zohomail.com; s=zohoarc; b=cJPMkjzrhfczhGNazLtOFdsxQnKqBjPNWjUWnb3sh+1+ALLCoQe/y4K+sdDuYdVzkwcGhLXmB6fXDcQ42qxQaZIlkgRmfMyu0dLiViFe/x+4Qzm+vbs77KcW/VO89mKp0ZpFy2vvnp2RfJofoHsaP9qxSGfTyezqqQa6/P8Wp/U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756403208; 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=l172yOtMqgHL8bSNateqKS8iuANGf0xNAH8hpxRVfcy7dLD47ukSfYgttTdvyrlM5J3UZjZRrNvdDJIg+ISQVbzgtQEBOY/ExczxtwNsvkjuEdxYt24haK3M/uSUpxcYrSb2rgx9YyhfZI49LuijLZuweeYKlzzGuoA/qFXQOQM= 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 1756403207973739.0881672595857; Thu, 28 Aug 2025 10:46:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgJE-00007H-SY; Thu, 28 Aug 2025 13:21: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 1urbWf-0008Ej-Mw for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:48 -0400 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbWY-0008Nu-T8 for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:40 -0400 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-248de53d12dso3336865ad.2 for ; Thu, 28 Aug 2025 05:14:37 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.14.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:14:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383276; x=1756988076; 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=fj3QAQBqo1j7i4SmPQxFu3ATkf6mX927xnHbLO4JeRKyAeaw/0WLvvjv9DZZ3PSFBz FHe6MijKB1+Q4kPIxT9WS7jOftT4hTA67WzeUmMQVeRW9vxox586a7S6flII/cMQi6DJ dGUtHV4DV0cHabGHGmgDdCxk18CJAQLbxOzc2LVkX7GSwwU2+UHJQ3nwajfqwqHQrJiw rQfBo4niclymdpXpY5t7DoGPBULi6tfhZpR0izgooIvf4wi6fgFCdV2Aza5y3c9vhUq6 RkMIZsFUF1Rtx7GcXbJORoW8ZqF5BLcZwZxvPXgK5XPpmfmdg0nvipykDyLp37nKZz/e BFkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383276; x=1756988076; 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=ZxMuXjljQHMw5SfzZch2gj4SHESrs4zAUO8Uou5oy40GBrisaFcHEvNzaA7XgNE0YJ zI5KpH3LV3VJT/H2mApdM9dD48Oot0GCLDZc4vdKjywVheUxVSj+TDgpqvBWEswzo7HZ NrjMcWzTHwtbFyuKsnbAkMvY6Uwue5Dap2jTKVhNMQ3QkkuEeff4458EFvc8adq/dJ0Q ZrSJhMXwi1D+sGnN1wiIT2+ENGWArVhmHitti3Ou8I3Ec+qPmkeZxn0fIhxSokmLkiHD I75i+52Gd5fijj5y4aVraPAdMpgFm2HNuCkIM1oL1VeoL6GIAdrP8vEslovBRZxgKp5v QlbA== X-Gm-Message-State: AOJu0YyBbo2Zo3wVSLqSTzrBql3e1z/NS+GLB7aZdspqZPuocK5vCaru megLPT3TG0jOlbLumk4WRRocSKk69g+lRDBp2VVZFNvyQTTR6LIG4B60Itp0mpQan5C+4pSTBfK 01H9p2LA= X-Gm-Gg: ASbGncvUzd+bJPhGk9Qmjt6g+AVfsow8t1Ocod7ENQ7zrNNA+kMxPL8zRzJRQNl1bEs l7ppSp33XzG6G/LVjXBdOnHHtdJH/yF4KZiDcHUaVgjyplGWFkVOoqJtOoRBDFQO7VZ9Y2Jpw4J NeXANv7Xz2Buv0oJ4FY372hkzo1c3SMBFyqFl6jAE8YAlO54DrX/DREuvZjU5EyUBR0uTXAuani vugruPPn661v7mx3Tc0FsRFwWrUA0QAmG0t0m91mEF/y75ZLj08Yt0/nwPJ3TN4fAclN+1+5/g9 /FjgBa+KwzOMljCm/topkG2eNtQMsrxtdulIEyFYA/8on6gBQWdvVzT1oByixOjdvDmi/V4qKb8 qwMQG6DXq/gShg0BA3DSRYhT13g== X-Google-Smtp-Source: AGHT+IE3+L+GZXGAseFC94ZLYt3OFl7dqQXNruYaKNi910Xj8ZbSGRbofONcPyAiCIG0cEQgt/KjCg== X-Received: by 2002:a17:903:1ac4:b0:240:66ff:b253 with SMTP id d9443c01a7336-2462ef93318mr301445395ad.46.1756383276441; Thu, 28 Aug 2025 05:14:36 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 63/87] linux-user: Remove redundant ELF_DATA definitons Date: Thu, 28 Aug 2025 22:08:12 +1000 Message-ID: <20250828120836.195358-64-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::62e; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62e.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: 1756403210523116600 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:25:45 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 1756401274684391.7448383104868; Thu, 28 Aug 2025 10:14:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgCJ-0003B4-UG; Thu, 28 Aug 2025 13:14: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 1urbWf-0008F2-Ta for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:50 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbWb-0008Od-3O for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:44 -0400 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-2460757107bso8165725ad.2 for ; Thu, 28 Aug 2025 05:14:40 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.14.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:14:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383279; x=1756988079; 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=fPnYSmw0H+L9FlDEZScOlrbQhE23jpPXeeMmWAqzWT4=; b=SkulLYPHTR9Y6oFy1hAjtOy2jEEbF5vpCd/mnTHqZZ0bn8o1HZvp/CdUcVPF2VLWj6 CQ9jmI4y43Nq11J0+AkmneapFYeDkFIE/b0Aa5ysW+SfmTymiZzdPVWjciZQ4o9VzNCK zs7FvkE6JLrsGe7tHV1bRXf83v0p9o6ZNtP9WuMxiIgKM2jnTc8gjcWFE9ExvE0Fm7nh SdmIhoi/HLTVtTOFQYUQpCIRPFW+ZW7e8OyNqR6ZlHafS1JX19UswplOqf2TgI2iJTNf 3bbNzyDJtxXAOngF67K1UCaOlO9/EXhYToF6C8yfQ4de5MTzQjVDAu3WqEH0CGa0cjZs M9eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383279; x=1756988079; 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=fPnYSmw0H+L9FlDEZScOlrbQhE23jpPXeeMmWAqzWT4=; b=cwJZDOYTTwyu3LGzroYWwK5sRboJWdmlEar+PlyFSNkS6KYamHdEtiA9gmbn4Cj870 THdix2qCloMB+Hb2XPWrqceBdYXkxz1wCYLHd1uIWhC3qTnbYI7vpzN2FAFcFTO0QNk5 ggcyo2eK7UDr9kGzqGKuGgZ9LeKTEouQTYMqAlv5BJpIxBee59j0Ul1LnQLmqUN+rd8t 4G3IbEB1FGv7wn+ocfVKvruKGE6Ss36rLQtU24qVW0sJ+AOG3sMGuinMZdIAy9xxXokA zwO8M/si2sDIvrX60ctnZNiANsDpn+lI1Z/czaaPZEQqwixdyp/vrD2nFoNPo0olvJpA 3Wig== X-Gm-Message-State: AOJu0Yzn+YYDfFd5EVC1TQ3/RcPM0toIxZWfSRGQrL9UQszS4Mt2FdBj rW5LtPg09UjSWQQ2hz2jpZ1O6oujWAGYFsRed4Q/QDw4pzvX4KF1egfwzisY2C7ti6MxfSuZ6at OsNYtQ4M= X-Gm-Gg: ASbGnctGE6XIsJkzZ+9nIps6CkF2PdotCSLuYX+n20YLxWjhwCFnYjOcypISD14CqO0 lxEPsP+UA7+sx0F9T9feC85R1VhAwmSVNR/Em18/2FbmYqyes4sAgWEpzdVdS0mn0pC6cQ0YMcI 2x5eTGhPi0Ar6afBZvBl9UHHGY+NgOsjlNyNM9Qwd01hcNrxROU1y9tmOIlgylIugAjbBSSYp89 LuNR8Y7GU4tLV2KrSkm/GlGGHbV1qvmSYzBLosS/pP2SXf43xPcGMLxhx0av+QtpZnGgPxPSa+i LygBmvJoyKEehciojfK21P7LQQVeYLjxg00dfUlB+zsab1ARsFvcmZwWDz89Bmn+9aNGjQEGUcU d3MuDJvgmyvUdr/BFvt5yjat4XvCjkZ8qhSfq X-Google-Smtp-Source: AGHT+IEMPXzqO7wbQofpthWDEYRb5/qf+R3XVvSihUnLAAg6O8zwX0n3LFn3N1tR20KngAIUO9K0/A== X-Received: by 2002:a17:902:c404:b0:246:464d:1194 with SMTP id d9443c01a7336-246464d13f7mr377206995ad.2.1756383279267; Thu, 28 Aug 2025 05:14:39 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 64/87] linux-user: Move elf parameters to {i386, x86_64}/target_elf.h Date: Thu, 28 Aug 2025 22:08:13 +1000 Message-ID: <20250828120836.195358-65-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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: 1756401277034116600 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 da1e0a09bc..99a95ee45b 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 @@ -23,4 +28,21 @@ typedef struct target_elf_gregset_t { struct target_pt_regs 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:25:45 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 1756402712053888.1395569858786; Thu, 28 Aug 2025 10:38:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgD7-0003rM-Tm; Thu, 28 Aug 2025 13:14: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 1urbWp-0008If-Gf for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:56 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbWe-0008PH-Fm for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:47 -0400 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-248e3ef1641so3008355ad.3 for ; Thu, 28 Aug 2025 05:14:44 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.14.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:14:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383283; x=1756988083; 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=vENxvKGQ3QLHGNpFmmQFG8tVyhOgZngF7rW/y05bPGgoJbY915P5Ntttgsds81E2sC 1mFtBYiQsZp1z0ZA65BM6zkWLuq5Eu3aYfTcanbvEthID2tU3+Hwbrap2HEb2f7p6/B1 rBOlpVskSZ+kf6HHlZvCu31g/9TGn4XJuCT66Wg2VdfkhQVr9ygs8nZQLCYzaf6AErF0 Aq2CVMteyrK0nmJuEaUA1jeG4aj1RMVm0h0lzrKu4FDXyjJvjROvb9/26U0gTiIhcSrb 6Chn32EdtouHcRnXKHLWtcZIMRoZgS3mqf+63ZpA2GfVXnNcnBFcwnwbryxY4aGvC8X7 ZL1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383283; x=1756988083; 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=nQiHNCTwIcT0a9pPPO6OcFN1YKiOEI5JQYWvZG64gA7hXHXP2pQ2F/R2hjC91z7tt3 zTR9Mb63ckKcRe6BfhJUeprlyLetaydTR98RGHBTEUm3/At75pjrLMxh1k8lSXh0LnmZ zjGcC9yDJsRV6yYV38vFYnESXJdtLfH3/X8M3tYYgBZZXATdOS6JA90Fc2Vy2+GWuquI eyc1AzhfEsdEfOY4f76A/5tF2sRR6yplwxT6PbVbTror+dXSquWN9RuNlZqy3rBvBkbF GSXyB9HGSjyY+Bu9kAv5KsKeUzIZ8CpPf0GdVg6ETJt3HN31JqsnqodgJfUyx78XFcOl PNLQ== X-Gm-Message-State: AOJu0YwqC6gFOHyLin2tMoWJhtnjQ2hbxFLGqa/HBS5mLujf0auKMNlI izaOsDJjT5lgMKQbFmOPyeItBxJroqb4DX/TPj9n1qsBIjXTc5qIVx52Y5LhkTXyj+RziL2xM+h iA5anXF4= X-Gm-Gg: ASbGncs3KHjsUqq3WzoqGzXfCQAl3b5kkI8vS4L+9DQ5C7WIAxxr3NPl91DucIToCl1 8g3MZDNdU0uaDHUI/CyzK/PM14/cS2ueHc5q/QbT1+g/J1rEEvB9fzOE/oisA9RLGhkVQlJghRg NFd0fyFGoi3HBn4lArJVA/MlGTKzr3BzWNoL0dO0mb95PpC9WSYud1gZ6aLm3lPATKadxh4kOrp O2pVIziPcnuIyw6T99DtCv30zpCWc2iVN/hjI2nxPyg1BObRBYPJ8qGwQK+RtrD6FlIQwRSo42D UyXlTNc33QJyvxRefkS2zCbCIy/0IpE/kYvfS5caPPqpQJ+bWJFKyC5AhBrNJKDKYUbB4A1Y/a/ BdrufQxxxRizf2lI1AGR6s5+BccWElNH9WP62 X-Google-Smtp-Source: AGHT+IGgC8vC57Ngmy3dJwXz4EutY/+Kw4aau6VfjO7mZKgW+1I+KhCsJgjLbHiAV7olxGREVsNEkQ== X-Received: by 2002:a17:903:f85:b0:244:6a96:6912 with SMTP id d9443c01a7336-2462ee7b50bmr300196035ad.20.1756383283058; Thu, 28 Aug 2025 05:14:43 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 65/87] linux-user: Move elf parameters to {arm, aarch64}/target_elf.h Date: Thu, 28 Aug 2025 22:08:14 +1000 Message-ID: <20250828120836.195358-66-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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: 1756402714793124100 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:25:45 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=1756403812; cv=none; d=zohomail.com; s=zohoarc; b=M68Kz1e/tNsVGpySdU5WiNpgx9HBaZrz/f3yG9L45Gn12EcakEpuNQq9ZoeUxntc1YsHPdzBLRWswaK+oZ7IJRkKq3Yp6C2SscolbWojpHB+4nvGHMWk/AXqw5YIyqvFSAB7pxksb3kF5R9VaVPEkagZO66BQB4mDhZKW+xuYpc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756403812; 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=G8X3V5YTjNTXM4uk+LcCVDC22k+70OkU675GSWTg4TJvHBQPtk4CYA45Jxu2uv3tnkgsb9bUb7kFe5sfIb6aapNZTS7umtEg6Lp0ypCVTqChp/FWUjMb1Euyak6JQKDzYaay+gH0hzeJ7tgSeSFZlQwo6M7csNtyIvA0v59vaoo= 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 1756403812231219.13721924127753; Thu, 28 Aug 2025 10:56:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgID-0006Yk-Ck; Thu, 28 Aug 2025 13:20: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 1urbWp-0008J6-IR for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:56 -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 1urbWj-0008QB-OS for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:51 -0400 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-76e1fc69f86so1587399b3a.0 for ; Thu, 28 Aug 2025 05:14:49 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.14.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:14:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383288; x=1756988088; 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=deyU48iP2aGFrTUSfjSD4JkKKJli6wD4rGinpdACv2w+qA9xtVuUqUnPcrM0nImrKB th95ry4zRfLAe0JU8zwZJhqFRW/mclkBAGoF52E2R8M60tTok3Z2VD4tUjjC0L/eRU00 4q9MXHPYcx6oAmFged+nxvZAxaGhhehLOCQznUFhW3kqTjpZ9qU/G5wgACZDyRbXRuXb 4xfNoR4jkxayYOLYNgVNuOcZwfGm6g8U4OioLvJ9No+52zbNdW6Elsp/Jk1246uAp9lB NPbGHkZGqFn6FTGEDGJMLtRQ4uWWofl7ebX6WtBsEEmOGnHc4n4fcl1mbNeBSVk3hnC2 aD8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383288; x=1756988088; 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=Ig2qYgk9ln7P5w/wyLVY4n9XIMl7TVAb9YZLNh4C4jd7iB5SyNI7LujedG2rBtzjNx /E6azgPTKNE459C4qxsISXVDlIrhjFWKrJ+KQI+uOad+nlcH+o9NrhSxm628JYKY/DHh oi7BpVMx/XlFpq0Z3DamRIDE9/bj2QkQff1mIQ0eD/zYiX/5WTVHLS5IS+5vrgltDdLt hOSCaxU9eLNjIBKwLMb1Jo/dazQdRSlNriHtH2U7Dm1Z2VDPy0Gc8qOTRGIsGmKdOb2+ v5OiuNgAzo1/ni6p9J+aU07iJJ00hVRavDNESpDoRsrLRkPhTH6YG6UOHbv7dlSXuRzv EQVw== X-Gm-Message-State: AOJu0Yx3cbRH7ADI7IRbMKklfGiBLXTT/4SPKLaAwwpLdx1WSBXPTR4f q92U4dq1EjpY4jBUznFAZPe8wDNdxBZBfZlww8wGdVrl4X4uadmmOy2z+zwjwh4t5rrVmR+zlsU zWMok1aY= X-Gm-Gg: ASbGncsehVesDlLBw4mf751sHOG07/HJB+Y3gL5/PW23RI2KrNA68UWnRGERxOuwLHS /tpc4s/6r4+LI/HBCduxNtVv+TiTRvD+rmOC593yElcbTSDKSORPnJc3lhIL/ss21Tp05dN2wZm KkgNzk2GX3rnNhbd/9DSQdc2zP7yiWttmG1n09AbSCRgsDvW6zzSAMUixl/S7zmYsDtIxREH2yH hUBZgvt0pdOuXZRWW0paykYQ4LOfBh14nf8k5hmY+ITMJ2QS/dOu9TqktFeK+rXvhCcJXh26kpK G/dwjLqVPqqX88k3uRMMkdv0ACnDWAJxGY/5wLh2lFqHRCl4onRXetEo3Nfqk/tG+vjKkj11mVr qvmyXiaIqgWjFdW1K134vSJB/kSKpltU34cPe X-Google-Smtp-Source: AGHT+IFAboyhrPv9F5pP393/PSTcP0xc/wVsQIecmZWw9bCcKVcxeHPshT4+Fn1mpoaAHCxta8PZsw== X-Received: by 2002:a17:902:e744:b0:248:96e3:6cf8 with SMTP id d9443c01a7336-24896e36f99mr83769385ad.24.1756383288384; Thu, 28 Aug 2025 05:14:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 66/87] linux-user: Move elf parameters to sparc/target_elf.h Date: Thu, 28 Aug 2025 22:08:15 +1000 Message-ID: <20250828120836.195358-67-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756403814140116600 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:25:45 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=1756403689; cv=none; d=zohomail.com; s=zohoarc; b=gTj84WCfyvMj/3tUsc1uTsCSoek1NaBok8AXLIUxuYNYe5Y53MWPH93Ae+7DEqL3tXiKZ88aqk0GbEsk75wmCQhvySUS2yxZdqNsmETSzSRq2ESMbsmBV3DMHIkqxJFcHpghsjkCTl6nUTKd+xvSa34hPjy5xLRAZUe4XVpity0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756403689; 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=EWs6MsSHjqFHrt7dXyvu0FgUugryb+ExoHTcPc7tD+w6UQPRwU441h4sEt+O3c4EqEIhtt61zw/w4+fMy+/eV4G8dE+hl2vmrd56cBOQAu/TBBnJk11SbfXqLRXwYB79bbwKIasqMuKHkIagoCAXKKQJqEhvbX6tFeKuT+pghz4= 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 1756403689586492.21249014475984; Thu, 28 Aug 2025 10:54:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgEA-0005jy-Oi; Thu, 28 Aug 2025 13:15:59 -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 1urbWr-0008PF-Ni for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:59 -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 1urbWo-0008R2-5f for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:14:57 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-7720f23123dso837919b3a.2 for ; Thu, 28 Aug 2025 05:14:53 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.14.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:14:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383292; x=1756988092; 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=UxkejWnlCRQHNWBdPIYH1am0yOTVgggYcQPuIj1yeborabubyYEAUSr/RcYKN75IaI Q4kLnmofbDKOZd0qYPWtaKOzNykfKdfo85fl30j+Vj9KKVgXMfk9OdyomLFXzWkFtK4s k8/pys0hCpcVvpr3jA14kJS8ag8dgh+WHmwMG1gE1sGjrXIe/Ne0+g4KYyMs/4xb99Nh ku7TTqGQB8HWhJusaghLxFq2Io3O1eS+BwOAs/qlhKWC2i8QfLCS/CKOkhEvYfdtVASn 1xDYs+2iMU9O5u3bqDh3SNZ0x69tOxbCs8HG5CAfuoKLOctGJfWniAmukIC6Y/aYseIc K6EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383292; x=1756988092; 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=MgoiGY5TZSnpBf1rfyO2c7IuXzbRE/rRxKflgea38S1NdnR6m827uCddF/jHpdcJv3 ggDG2BlUunx6n+iBiaMMdHBRvySiZiteEnPMkbEndyzQlQuViwb4dxVSWbJNldPj5WUk E7pUwPXqi0+o26DfpXFjOxt0u8Ho6rVV+/bMnncp7j5qAF58k02mkFeofYPukBD/4mM2 dEHyCJMR5kbgjDLxeST43zWDkLlVFHDwKFyfcWsIi9fO5vg/HP711R3DJE1bwrq8Bweo jsItFEj76QHvpAkxFJ/Jd8F5v+CGGBVFDM0fqy4aLFKaGtARiZqMIxzbSq02wDlBKcgB 039A== X-Gm-Message-State: AOJu0Yz73yy+q0OkwZGMxDCjdjW9053q046YnOo07esjrIjZ9hNYV/bF WGAh6ElVsbBlbtZXy3y4PQO4zDffQRsdfszur+py/gYLP7ojsJpVIb4Gt0KC9aPMTVgc7jIov21 tZcrWbHI= X-Gm-Gg: ASbGncvcSWLqFroIuIMyreWo6J4VZD4IwNFCeUF89Ojr6CH5dckYfKS32pz7rIBl3xt Ylgc9DboQdwQVaT5YrTL3mTf1OdnnodE46iR2MAmUVgb34jUKYPMYl6EPLu9laqGwjBVuFAvZBQ fp+QbS1dMNTk8tBKlfFkHPtQL0cOql3+O6kcaMuukrkfkXZY55TxHBUv1nqJlZRP3MnpvUkYM0p Rk+7YY0wvJsDWpyO3KXu4/Z8vTPzDs0nPww888wo7U1enaaJdg9bE9cu+zPBeBXSuoYJFN2fVLV 5x7/H/42lq/1ZItwO7PcX0SObMU5nKIVwJLXKkqQHeK4yTHMmzdI/vxBpeaNa+yj/Rzmby3FcX8 a1h0GV5I06UROeHutMHXoULfPiGHnQo9PaseO X-Google-Smtp-Source: AGHT+IFgEq/lRrKD5XJahb3EGmlaKRQGJoue/3BYozyO2kbr99Z6Mz1mc074zCR6u8NPQeHW4HBPAA== X-Received: by 2002:a17:902:e80c:b0:246:b3d4:5c82 with SMTP id d9443c01a7336-246b3d4620amr244281685ad.16.1756383292496; Thu, 28 Aug 2025 05:14:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 67/87] linux-user: Move elf parameters to ppc/target_elf.h Date: Thu, 28 Aug 2025 22:08:16 +1000 Message-ID: <20250828120836.195358-68-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756403691950124100 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:25:45 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=1756590803; cv=none; d=zohomail.com; s=zohoarc; b=iV5kNBJUtYYgejvrFSr44u8a2jup7VvuRQuG+2mh+8pAjaRqL82UVFDpMNYOKR/YN6FR9rPd5NS91w0drntAWX0dkkS2PYG/ufPv50K4wRwiIEcY+MnVG16VN7LP5lwA9qZWcwTUxlLi34R4nenDVd61nRwvlO9/1Vua0VbHJ3M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756590803; 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=QvoZmO1QNM+Kpxefhc8YU9Dzcl0geX4TjA2/ZGoS7TOftHgkpZh7k5JKv4UFAyHJ3J0QgzyxpismXJTk9qb1QseNuYIPJ46Q8IAqVF0O7vfkEhEzMT8OZTYUTHHfgsyT8Yv/zpHgmZaGDbz9v5h3/nYy2M0qJ+PwB/2Ii2MuH3o= 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 1756590802986971.1876028757342; Sat, 30 Aug 2025 14:53:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgHZ-0005NQ-Rm; Thu, 28 Aug 2025 13:19: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 1urbXF-0000ce-S1 for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:15:26 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbXD-0000GC-FO for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:15:20 -0400 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-246648f833aso5456595ad.3 for ; Thu, 28 Aug 2025 05:15:19 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.14.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:15:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383318; x=1756988118; 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=l6YzfdWq8+1yNSmTAxJvM9wkLDeCW3V19ir86KutyxYTDD+7XRKoD544IAAlC9lhkK m6dca3w0x+zOrifz8BrH6D6TNfTv/wrsbjYfZraLqhhRyFfpK9b9T4TtmTQjVHm5H0pz pd9MKADTPWaPikNZNPEMu1z7WK5FYWUZBbkfVRE1m8/4hL9DnhPRnVXB1Tv+y79w6cYz LpueBk545Hfb+chcXjAiB47u6luwxG3rtwdarS3M6Nx8mb2pkYS05XIZoKi0OTleg7X7 JIrtc+3xA8oAf6J01bcGLMZN0p6PP3azV39N90U9yNI3pX7uk3hFvwOLXuWE5nkaye9b Ur+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383318; x=1756988118; 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=eZTolJztmhPsIEiBwCjtPrupdI6OOsXmBJFFn/BwoFAz+eL6dD5c9DwvBAtoIX1kez siv3b9ajj+pXnDvVB4+sU8ElFSv/dIZ4XaNucg05tMoCzPafPCkupg6ScchApnFDz3H5 zLy95a1M6nDhOO/gBxLt15cQAt9GFknjJ8QVxCTnoJAh3egc1mJYv8fUJtXeh8UuGtVO BmDJ4kcSEoVnqfPat0Nvz+EXu/fwAPPRQJfYhnK2xeIKCDvZ/F/mcOrITXalNBJm+MYJ pKpKUrYuqiSgKxiMFhnuWRaES2PLbw3KDJrliA+i2+GrM29zqZn+g1djrWtu6lgugNty m/4g== X-Gm-Message-State: AOJu0Yx1ptOePTE6IN+0SxjSfeBKekQQorifl64I2MGH3gYuOqzNpxu3 IuQDWoFSKuDdyxvSgd0C4uRLEb3ABHbZagMnKONni2aEDxDE83AWqHgJqtlu1BibFfU1vBtAYtx oJ1qeGP8= X-Gm-Gg: ASbGncsiEwSJk1NiWpa/2QCA7/xPWbmNIDiZZtn5XNaGKm5eoOSW/tadsB94Cavh0PG 3DO4w2DatuK+EHDC7AAl2zuulZit+ZXXZoOd2kmYvhDGp67KKd5ALKS9ZdsPUXtvFVh3tZjnvqx RxSZru0M+6eDAfrOvaceVQJED4B0UXEfmo4F+Ny872k0JEy5XeG1BKLMGQ/YLCl2aA2IjSOPbQ7 +1YVTpgoXp2tXU46ufVoTesxoxMmamX8dG91agl89o4bykV60GPFXwEi+kBXTLiW0e1alfgZIKS yk5508IP8xRtTBbPHES2QdygfMHDRkkGuFG5vFJ/MweMqBOgTrm9lVCAbEXNM4DuMzyju964abE 2+dIQbk5C7yg7Fq8C2BvbQ0NWwDTDZCbhjjgA+FkiD13a7Ro= X-Google-Smtp-Source: AGHT+IGcTfpYI314VSql2jMLeZ2dnT8BgjDvsDW6HS9Q2JR2ERKjVHSCNThUh9ZtvPfPaXVVU1/Pmg== X-Received: by 2002:a17:902:d512:b0:248:95cd:525b with SMTP id d9443c01a7336-24895cd5bdamr85462885ad.48.1756383317614; Thu, 28 Aug 2025 05:15:17 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 68/87] linux-user: Move elf parameters to loongarch64/target_elf.h Date: Thu, 28 Aug 2025 22:08:17 +1000 Message-ID: <20250828120836.195358-69-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::636; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x636.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: 1756590804460124100 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:25:45 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 1756403812653681.8556363634833; Thu, 28 Aug 2025 10:56:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgDD-0003z2-9L; Thu, 28 Aug 2025 13:14:59 -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 1urbXH-0000eA-Hy for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:15:26 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbXF-0000Gd-Oc for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:15:23 -0400 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-2445806e03cso9498485ad.1 for ; Thu, 28 Aug 2025 05:15:21 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.15.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:15:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383320; x=1756988120; 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=NFoGDEP+wTf7S3r+4gNiVF6cQZ7SaUzdDsoJz9ZnILPgZny0tvYbCHURADJsgNSIkj WivzRFEj8z7fP6v4UCglnB95KKmDahEgiPjYUuAgErTk4e05dXnlgDYydH3PajCEO8hl V+ClTHTPwFTmYbJU+k8BoBU+yyVvStX8dIkI6CcuCfeD05vhYuygcDuaR/n5EmmOxyah gvjR0VczwiTGGx9UkqjdvhO8BAtVUudBwJ9ptg4v1SxU0s3LxbysOL35M6CYuRAra9nE u4JgtiZjbfr/Ul2kCg9vKCgt+Gj4JHEH1JPfxL3aBKQpnp8NGkTXn6KcfHMGeZcytpUt +dng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383320; x=1756988120; 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=LFYXvqVIDY7Ca3MPsOAGA6NsKloQro7FkRffVzMaCHVS1USg9qP1vflGwTYr3oQ/9V vnWvY24t5qoDyfR4oCcp13dQ7Z/vmZ+KsKrXm68tTIxWXdJh2075JhxX9agtwpZbgNnh XDqKx0aP5V5XVLqoGvWEDA3Vwm9aflfIPyhewSkKQk8X77e8tQ15EYB1JKeBy6vp2lF3 5vjlZ8HUT23P8nEukJ8UqXySg75xfJu2JsLQ3HYdFxOkoYLQDl07D26aQ2oLRKkHlVN3 N/xpFpg6luzB7ea2FpUQa0n82llF0dlrVg2jAKwj5S9DqYbiXjVE5BeE5rqQsKVCDalA Vfig== X-Gm-Message-State: AOJu0YwazMXgRAsyA4h3cYslO56WJ9NnfHBOOLF/M3JycbUimQKhNxDQ BVxfaR2uPOBxuLUKUw34VJnB70GWV6E32P7ZD3m5WAg+XG0rQE44gqibxXa6ipcHN8FAhr+tN36 TkFTRm4Y= X-Gm-Gg: ASbGnctmyQIQc43zqnufqPrqJ8ONhHgyOR3Nyj839wm6zY/kAMKrvIoTz7v3kuyDE33 cGEqjdDoRD/hlMSBceMBLieCMWKq/V+Vt2N9osPkyomz1siyo2vnLigml1hKK6S3mW0gGgQZCKC JGUPqPtJTvw4/Z5iLdzBLL8dsFggS4Xc0g+Vb9B1/twutMnsXfu8VwkDJugjXk5WPMfqaLlRYx7 KGDI1mBTLhEecdkgJ7BZROBxgoNCCooNQ6NR6/w/YnUlcvAqsGKAOO40ibrS8XYkVNCewQbmdrP lj6WPYh4sTFJof7kcrFTLJsaG0IXkS2M0nBrfA7uJrNvKQZOU9xudAtGFstppKLEVTni9kU5Ahz 7d2nXd26mA83OJ7tC33pABvUab8aLky5esPgOyE6CU6xD/HQ= X-Google-Smtp-Source: AGHT+IGzFiY23efa9oltBIVU66DOoUoUODAKLgu3cyuY+jRK4efleEzogn0F263BDaiOdw2U2ceNEw== X-Received: by 2002:a17:903:38c7:b0:242:d721:b019 with SMTP id d9443c01a7336-2462ef427cfmr300280025ad.38.1756383320386; Thu, 28 Aug 2025 05:15:20 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 69/87] linux-user: Move elf parameters to {mips, mips64}/target_elf.h Date: Thu, 28 Aug 2025 22:08:18 +1000 Message-ID: <20250828120836.195358-70-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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: 1756403814141116600 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:25:45 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=1756402978; cv=none; d=zohomail.com; s=zohoarc; b=cSbVJBBql28dvUWYewIaLQXVAFmyDZfOyVQxTPPT8ZhWxsITU3ghSPBi//KuzsDvd5Rf5+NjROA18S9hzvnAx1WfO6/pvUevvmNJaDaIswMEp+rNkL2gdPOmU8rHDYZe3rn5F6fKIvHF4JwNqD+c55+43ZOTgoAOtHIG6Gi2Cqs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756402978; 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=lhDSnKi3CNdrdnlpAtkkqkykmjGOn/90k6M6gm0nHQwFxNGahDmiJCdrw41aXr4aReVYn296FLfyY8SkZ+Q+yOMYvld4CrQGx3eHDpRhU+npKmqOPU8bnaRnzBVr1ypCV7UaQMN5SMT9C7lwnxOEsO74ldFtKHjccMhUrG9hIu0= 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 1756402978390897.7515191883078; Thu, 28 Aug 2025 10:42:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgIC-0006Rt-82; Thu, 28 Aug 2025 13:20: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 1urbXL-0000hg-MQ for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:15:29 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbXK-0000HK-1A for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:15:27 -0400 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-24879ed7c17so6633765ad.1 for ; Thu, 28 Aug 2025 05:15:24 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.15.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:15:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383323; x=1756988123; 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=zkHaVY+Rhnozgivy4GKpP6G9ZfcBoX/E/sBithWC0pfOsoEy2qTblA9G6Kprq+fBnm 0QCXAajb0/V0L4c9HdmDSdPkZjmqB/nQwqhBH243fpiiyGp6+5nJmJU5IIKrgqfUwDC0 nWEjE4R/QjNuScc2tQK5/i4dbNc5uCICiHRb8YJqjXIFKCoVYZ7S/pcb3+B1GV6+dIdC Hq9OjQYzFgvhb8msQ0FzMNkhaZLy7Mu79pF5rvCoK2pRmbNlChkfu4/e89NhLyUCQZr9 gApe80NrJbWK/1zL3AJlV4pNpIs8rbvdNg6+D+ZGfUIbbMcnmFA2DWUPPYk/PPgsji0D 3ZRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383323; x=1756988123; 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=hrl4jQcNrc/xW3vGJF/iEoOtnZKS4UGCBYck4+Zbr0Aqib0AZetWM8cHY/OXkjoD0Q +jsOcWHzuaf3xvZEhwDpa+02lIlf957ekg9nX7xrM0yen/5EWVC08+jc5KgCsDBIY8y4 TGLRjjm9p2OK3aOwMEIfGW9o1xk9FTkncIZpqG9Tzxm34goe7U+8HjaqDTYKTxHOk2M6 Cqx9AnPJPr38jHgFrkA3j617QQo4nP/FlaasYsiVgre8K/J+bAwdSaueXwjSwOGq96FD AxyjI5jHEYK5hcjyZ4cx6TOkCRRfVlIKXJkMl4aye606u4GglKAbcZpXNlSVy+u0Kl1e SWNQ== X-Gm-Message-State: AOJu0YwtXWltUuosS3t1sGy7oeNSQuKLucIDQec44g0AJU8kSq55Gg5C Hdbkk7oOWa4JQhV3wu58/EG07/xVTC+0tVh6xUZhJztgQeQZraHq9Dw79SXA8+kY5tFoo37/HV/ OMdtRRIA= X-Gm-Gg: ASbGncttb7/S1OymxiqyQcizfsz/GXC6ssUGtgmclfFPjVnu7u0Fr7N6z71qOJQgPch CQCIQRrwFrPysi5C+ssuKyVjEnkPfsd4gJNwu/MzYuBJh1ZO4wSmZKOekJYd+Kfm1ypsQ1WXjJc ak+0ZAkWAOoTgTW7iDwhLkTwOnZFVXFPEM4Cqu8isnpdrICUCgLn6y/lU/mUfEeAoCy3hia+O2c 60NS3wOGf0j6GxQBdiHLjX7PWEWPMMniebsmeCyCcEZO8no+aPyhUcJMHF+bUK3Li/Mq2sVpB5H mGOKP30Mepab+WxKd8Loar2GMLokcSzW4s8fKuaV7XclT5mU/QZUalus0u8HnN4blmBN7vFpgOw VovFpgFxKY/vbI64TjHtBWBBb0RcXn2KhNndl X-Google-Smtp-Source: AGHT+IHJKptoRq61SZvu8sg8L9EepZrSFBZDTmGs+U5jSHmRuqrvscnmsjjQ6UQrbsrB514i89swVA== X-Received: by 2002:a17:903:298d:b0:248:9429:3638 with SMTP id d9443c01a7336-248942939bamr83890375ad.7.1756383323275; Thu, 28 Aug 2025 05:15:23 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 70/87] linux-user: Move elf parameters to microblaze/target_elf.h Date: Thu, 28 Aug 2025 22:08:19 +1000 Message-ID: <20250828120836.195358-71-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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: 1756402979471116600 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:25:45 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=1756402358; cv=none; d=zohomail.com; s=zohoarc; b=nQsIqlwE7UeSY24vddCEwcXRILpEGRb8TJi7nv6m6dpknedSELneKbEg0EX332IUva3RQKyV+q2ul5rjmoJA6V5zsNetwJiaPMY1TsGXyxTHYHupQLUyELtvjhgCk79uYTPiQVzIajIdR1ZCn16zbXEzC0z1PODD7oDsxxuilFE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756402358; 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=jJErZosp3xvXdm9PCn7kiFTXMdYeKhWHDD6j+5urkxVc+M8jComSFzixg+WzTfVH8lShQAmJeX3j4+EPd6WaLgZp8jRCu48WnBzwrwhaq0QXvcIoZYArvTFcLByuGGzH7m2Xaim/lwAL+8QAV7gHHRmeaXom9UgDADFK/ny3iqo= 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 175640235866523.78008932435546; Thu, 28 Aug 2025 10:32:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgIH-0006l2-4D; Thu, 28 Aug 2025 13:20: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 1urbXO-0000oF-6T for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:15:32 -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 1urbXM-0000Hq-Ld for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:15:29 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-771e15ce64eso711758b3a.0 for ; Thu, 28 Aug 2025 05:15:28 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.15.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:15:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383327; x=1756988127; 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=uWneUh1HlC+pW++RO++HCgOc7IJHg9S/GwdB15yZyAPuVfBUwHDeqqTrdDI7qqS9mY ac39+ArI41pTFBMweBdAnoLl0ig5JZFK7SZ6FpyOWIfk5JRuoCDOFpYjMiq200/46+Eq bmdEe0cApiE05Qh1mKIOe75iU4nZQNLGNVZDY+OIZZqaeLzMHvB7tR/m2qNPlms5goD8 JwffUAYrIVDivv+h1bGXkjpZ0+m7XsgfDzj00LkpBMAdKMyhPTWn+JxiwpJgwoSve/3Q lu+uMvOHVDLjf+alJ6Tc33uZqApxyJwBlDAMcB0UadLjTAKff6y9CP726CywTDRh3Aim c4Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383327; x=1756988127; 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=uaIQjIhTYObZPZl9tujxFc/B1nDF37a4JVj0e0ERC5QKsbQRlC77ni1uuEUlj3903T cQenc089JUHMXMPMli3XXBHK1PpNnLof47GXeDRrm6V0cspRvD4gy3LOpe0EC8OmXAzY Q7vFfZyumjj2jQoVy/4IjJMVpXF6u6+9jsqtV9ugTA3+Bn4wFz93sPYuK/El13yjmr+n 48KGTGlQ3GhoGWL8hA04JNa1JtboTB86aekp0wkmI2NyI4SgdZyVab3K1se5/YiorKXb NZ1S/h2KFkR5nxaaO9bfRE+Kuofg2y8s3jhzhvszj3j3/ZImTl8Bdo7ojvY7SYN40E/D o+Mg== X-Gm-Message-State: AOJu0Yy6pFelwY3XmHd+jCo64QiHFmAHh36Y7BIjRjfONNHL2+3iNAyn 3Sj2gsGNtu3uF6ZLI8P877fEe1USD3hr5LJMDMVEA3TBauoBHNWDUMah7YME/L66qoZh05PUYxa rM+MpRyM= X-Gm-Gg: ASbGncvJeYLkiUaKuGOXpFvbwxkNZIL8EwxIoPGYKvZi1QSC046q4rUTq8fgIR0bTE/ 0FtO94qTJRPMnv1MyPCGctt9Ol1lT1lH+fAOhc3CeG18VsPRpZj3TTw5L84y2oTY02ipKiwSPJu Cqgu0DbTZ8KM2A65kuAZzi8zrBuQojVmPINocYNB01wy7cFakmt3cSBT1wYzEYtUZa2Ubnu4sw5 Cykgq5S+XBe6GukCtplAMuULbl5PWp1LwcuHtxiQ4SZ5qJ9hgm4G5rVxXsUNVUgPCGOQt43ndjO pTaIGGmrHyk0O2mvVK5OrKN7e9LGTtHpaCYZqsh1oimQe7TfDKGRPCq2K8qzce44FmOqbQO/nSc Do3rDW3AB9oQA+4Z7iQ4gF5zG1w== X-Google-Smtp-Source: AGHT+IHm7zdCBfKhvU0HB1tUa+KNHUV5oeObCpj+hgDEANE7ToaTCcOTZu2JBu6sT7iJqzsv4iA4eg== X-Received: by 2002:a17:903:3bc6:b0:246:e1b6:f9b0 with SMTP id d9443c01a7336-246e1b6fad8mr175295405ad.18.1756383326570; Thu, 28 Aug 2025 05:15:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 71/87] linux-user: Move elf parameters to openrisc/target_elf.h Date: Thu, 28 Aug 2025 22:08:20 +1000 Message-ID: <20250828120836.195358-72-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756402360238124100 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:25:45 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=1756401752; cv=none; d=zohomail.com; s=zohoarc; b=QzImTUvrUc0Rd8XbLL5VKqens5MUI4v8dIMiixDBDvE8uPVNdOi5fp5S9SdyLbH0n3EhuW50TxAbkrxY7HKEWiy3oRgaUD39nO9l4HKv7fteGZUF3bmB5fcvYWfoL4GPvXqmgk/0w5j2Vh2qNaR+qjEmlkbEJnN06LeHw+1VSQU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756401752; 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=MHhgLbwQLMjffNPJFv8hRzpAt3JWvLsBbgLOKTnxIsF3aWkfoTSjQe5Qm9TPLhaEyzi1AjDVju/NhF+K0I+7ZiqIq4IZY8gfUcJ1zt3hnUHYt+kC2VlU2CSDYGXlpEEaGcCyfNg52qg3n3EyVgl+J38GxrvJIdtDIrPzcHWJ+SY= 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 1756401752152550.9305352356487; Thu, 28 Aug 2025 10:22:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgBi-0002Wv-CP; Thu, 28 Aug 2025 13:13:26 -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 1urbXQ-0000s5-Sc for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:15:32 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbXP-0000IT-8r for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:15:32 -0400 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-24457fe9704so8996555ad.0 for ; Thu, 28 Aug 2025 05:15:30 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.15.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:15:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383330; x=1756988130; 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=ghFtz3V9/T4t+ZCGGdbDrFJ1niYk7j50BXM+KJ8SWmkefzKRtehCCnjMw9SxVCfWby thzwxKRYQHfrsZfHzZ9Urv5ibeBcWHxHvGYYyECoHgPUgU4cdfPRNexBX/PWLSm4Dnaf XRdc55MlCzaXsLmB5qowo0APdF/v5dvq3go8qvXhvVCqnkcB0Mt1EbCMtTNDlZ0w7y9+ pFa3l3qFjjHUDKfHA6GEAl5+gqDbz1OOUaHsnLoMFgA8o/X02vmnE86tAVyVxvoTQljG q1358DtkzKqqmWqAUm60VLqgtYodXYsc5aeeJH4EcOzQC8GRTkxXJ1TwGVcYd+9exkBs kYAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383330; x=1756988130; 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=ngJmhXHVbvKxBxJGY8hPUVCX1hurHEsDRI7bax+Z+uylOpM63FOgS1XIbaBFh4q27Y 8bxbazcCashdQCMWrRvXvKObOghNz/L/uByCukrufHABm2baIUfke77AfxVMvDf3l4ly /8uu8WKQdzPFYfxt5DnwoRypfAwVvmmf4qbN8HDOGPsC2rpYMDfNSZCisHpuZ6Jm2czv d3PaP6gsouiO0iphMUyCNj5x5qt+pbT3QyF/i6CJNSirCbEuFqfzOdU1UG6LVw/cRorO q864L2IxSgSddJbQOwutmTRFf7TmPvqamZ/73r42j3Oixyz66yI0N+CLYzMVgT2lJFc6 /69g== X-Gm-Message-State: AOJu0YyWw1YE4pgrdTvZJyZM8ps3zj1msW9EteFZStD1lQd0t7KtZ0vZ 9wdUQzX26GVZp5mkix94kT0unfnZbbPKpgqlWp5sO8DKT7Fm2b7Xdv8BjHwDiFwLeljAW3yvsX2 RAbRMKuI= X-Gm-Gg: ASbGncuTC1stYrEImG2nAzVIk8iTh1MIeTe6Pp0DhWmZxpHst15CYQEEv6KVG0XorD9 V1E8AIBbMw3d+xiMdD/+HHkokIrePG+LTAAN8SWKhLz/+9Lqc9CnvtsMZCPuhF1yp35ppxqwEzA NyLa5qe6+KAi/T8v6dUt61dP2abeZFTGleKHeEcqksw7PwvysDf1tB6VRAG8Mtdeb68dF34lQaW 382GmqDGe6Wt7U2ycNXELUIkzSPs2Wb47y32QSNyZixgLSTCLHTpQ16P/NME3Yl6IuezaPNiv4L XDLmP9lYLGNKMQu6FZD49itdXQl74LUAYYpaQ7kR/W6pdDEkVd8h1qJqxEHv11S/xrNJy3AacJ8 lumLhOJUQEnRRAl0uaUED12dH6w3GJMcf/rwlTxq/vTgJdD8= X-Google-Smtp-Source: AGHT+IFdnWarR19Zs7YMYKR76ewlkuZ1xQNFYikel85sg8cfVHQoTdZDsBi3Qw9x6IM58vaNNLOhcA== X-Received: by 2002:a17:903:19cc:b0:248:cd0b:3467 with SMTP id d9443c01a7336-248cd0b38bbmr42389455ad.11.1756383329761; Thu, 28 Aug 2025 05:15:29 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 72/87] linux-user: Move elf parameters to sh4/target_elf.h Date: Thu, 28 Aug 2025 22:08:21 +1000 Message-ID: <20250828120836.195358-73-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::636; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x636.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: 1756401752467116600 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:25:45 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=1756583141; cv=none; d=zohomail.com; s=zohoarc; b=gmAzHUTmJH6jKEEE3KqHZpUEW8WAY7BrlJV78SegLmo1EnaQN9mPWRjpiNF6Pu1nUXLmqqHCdtZN4gnmG/bZ4Hxh8bfYyvsbCbduOGR14eLJJn4ejrqO5itasAa73goAU1k0yiNs254ucJuozNVopOPNyLCA9sGQ6GywCrk/K9M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756583141; 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=Vr54om2ppXAao+eoukv+e70C3VXSZHOzQdK1jHjB460saCAGvOfW+STONem8cH14osHwVmMj99jMT+UthhfFwQ3HnOwx/tRqPPj66fJoF0PVb/kPJXNrCLMjq2hLY2iTzHOtVoaFihjud08vtAgiWV58Q46lEKrF4DtHVm8c9VM= 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 175658314150233.70248697797331; Sat, 30 Aug 2025 12:45:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgHb-0005Rq-IG; Thu, 28 Aug 2025 13:19: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 1urbXU-0000xk-Je for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:15:39 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbXT-0000J1-1v for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:15:36 -0400 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-2445805aa2eso8865095ad.1 for ; Thu, 28 Aug 2025 05:15:34 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.15.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:15:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383333; x=1756988133; 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=VgYH0VpPOAFNcLAprpYc+PMNdUBPBrEIp3kExQixINfPVCmP2LxIDcbtbPvIIJlpoO WoE7yGE7CejjDjDV1DBRHKrG+mNKrBYZdekfnvTtUGt+SEoqyIJAKl0HflA42Tj+HEVA tjZu7b316kjKlcr7dliG7hhaXF57EmJP9wAm7MQ2LXNPSSFkfP2DMzZmucBWdd72Fjqa n2CRUknEcOlzWgndBHfUEPuj6gwDADDnX2pwq2b4/DWEISkFQxcKAyCgB9EvhBHRYn0a eXr4IQC1oQ3i/PG2FEJaRI30EpdwlYWggt8tPsIEro9dPnEmElHcN3wLQboIwfBu2Ld3 Rg9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383333; x=1756988133; 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=pP3lL0Q/kegBRp/DMwR3HUtwFnhLNUSMBvFgLj0LjBV2qhVv2N15K2YkFlGbJaN5Lw nBoobCAQ0RMo54/VpJTy+99wQ2Fh3Bp2G3z20qaWOgTpVtZluNfPJtgQvSi4yfBWAQeT RlmDnazn0bI5BESkzYhzujd01IfmU4jpJrNTuPJKyJowCfPN7735ttbGeUuOYm67TCEf AB4Zr6buens+tLd9XRxRUl51x4tNQp7XfSJvbahnYAFIFusRjGVr9sNuUA0D55hNn27b yE3U62UqF1HZeoYA+xnME6/PbUxIS9Eas9C+wPBMeglntRAARjlZkairNSMAmkYUJXoM uSVw== X-Gm-Message-State: AOJu0YxrjLQrYOwOxDBjFGhot+FvGLsHQFwVFuB5FBYNRSNnd5Hb0U8A GhrtaF5z7Ro7y/PE0aqK3JLj/qwlR2VUg8dhQaWFOnzzQNmiqucjO5Ke0D3lS96ipk7K4IUeO4u OFFJ8/uU= X-Gm-Gg: ASbGncvpa3XqQQqnQtnNe+iHnuSH0ez4MQIDMS4kdZ3eJUAfLLys/qpehPy4jEEkur3 nW5UWv7XcF6jlTlCe/iiDuEbxsbmUJjuzcM0c7wZB5YAPg8gfZU7uHZMlLCu0CjF3LTq0h4WtbJ 8CsDsWZ31h684bv/3vPAdM5uCPJtWnU63GeujUkTozUbLjuGAHwnG/qga1nfBQ1Z0qAMKWwGtW8 Zdg46imJK/MNYaesWpc8ipYBNHmvhy3e1ms2AnT5dTBXiJCV8O3JyAFg92TnX/uDp3SRjjYbGeq dp/QKk6NDqFdWZ8XH5faXH+zuc7tWIAwsC51xs8K8BdNBPjZL5is/GSKyZMNF3SURP9PNLWEB0y SBJKMtoPco6cOyM9ZGWw3dEzpsj1Qfvj6zwzN X-Google-Smtp-Source: AGHT+IH/P5xU2ilB2wmo4Lcnbwloz+Elotgbl/dcxENqYYK8L4f+8RWKCKvMeHmY/rTCI2NE6rzzDA== X-Received: by 2002:a17:903:1a87:b0:248:db40:daf0 with SMTP id d9443c01a7336-248db40e31emr25462975ad.31.1756383332680; Thu, 28 Aug 2025 05:15:32 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 73/87] linux-user: Move elf parameters to m68k/target_elf.h Date: Thu, 28 Aug 2025 22:08:22 +1000 Message-ID: <20250828120836.195358-74-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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: 1756583142962116600 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:25:45 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=1756402700; cv=none; d=zohomail.com; s=zohoarc; b=f0sOvPdyExfOYuWdcAQCpACORiPP8ATe7SQSHXy/2ycp6oXLnRuMfi4o3m0M9V2HmJY0/Eeik6dBrFfn83MgivxPRQx5/jjTWcL/uczDg/5Q+2BZ8h0piaE3xhtQRK7TPpGzXDJxI5oQlfmRSAUZLif3ASGpOmIapkIjnQf4DOs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756402700; 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=Nv069UV86t8OwXVvKyzxUcjOvF8LLWz2OrZokd/bSYm2UDTrhnlXf24GaE5p7aUkKqLrpVcVSuKsa0Gqplse6HfIEHdjVbbOWsEbUGnwQ1PQI4f0ckmeY0L/v5yGfvR6zn8Y8qOr31R6/BmwcdIsf/srZvrKeZZ2JShr+eUDs/U= 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 1756402700621787.941105792281; Thu, 28 Aug 2025 10:38:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgCX-0003Gn-Jw; Thu, 28 Aug 2025 13:14: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 1urbXZ-00016e-Uq for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:15:46 -0400 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbXX-0000Jj-1d for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:15:40 -0400 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-2487104b9c6so7796965ad.0 for ; Thu, 28 Aug 2025 05:15:38 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.15.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:15:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383338; x=1756988138; 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=HxynPJqpHMMmr2I9bILLtlQxagfE58RYJTGAcaFqYCnVIu0A6WOeiGbZe+oG2EodIz adZgxfkmQdUT0oyJD1pDxUCFOb8AuEB1wasl+yQBzKTx3UJ6/X7+GfcngijWr/0JKWww yvS6OgcSgiHlupjwxJnMsWFEUC7Qz1uhOQAndWSzohSumm2C0F4F+/3U/HXUol+ny0Yq LaxWVvix+z0fy5EwGwjXDAARjKZlkSMbNx70u9KiTnkqgLMpqMbc06gVvEhN/Cljp1h/ 7Jkm5QdmjEUluJBqpSXBWWw8CPWG2RPMqL/H0hE/0gMPHtxe2eseD3Ng1WsBHAdXO9j0 b2NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383338; x=1756988138; 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=KdzazeAX6JWPuIxPLSIQWv7Ye5OxI/RfVmBk0724Q/27h1r/wwbq1haI1uPYokXqRA +5LBIFI8pD6ImwnmHjUo+Rut5+q0lFmgifKCX3/TunAUmulyEulMTdcZhpxG4/WRAOwM 6vjhFWAQAkqdySY7V10qaqLX6al51HfpUfQcBxtSsA+JDyRH0R5USx1DHWOz32pSCUtl 2+zxT1N+6ZaY3eoC7GMLj7hBxMpkDgRCQH/jSW1aCO4HlYXchnbNY3H8KsDVOYP1yHTf RC9dycu+MQOpRNntT8c4HIpDEK3H9xmYGexbvuYttpAroIeF43w5iWuWJ06kVcl48NNt R5aA== X-Gm-Message-State: AOJu0YyhURhfhUJlN9RwVFTJwQ6WdXltU/oBCnIdxCmjjwA2sCvQrh7s tD+tCxWXTht+BMRohyycCFveKdXMVmFGg03x5Au7CX+dwNnTYBpqLOC8pW3Ashn0Pd9WQO54vCI LhG3Ygvc= X-Gm-Gg: ASbGnctzRWXAaCm0PR5umvIvtJKzIOfu8fhMXqHAObqr3Hnhuj4Yzg0FQL1DxS+uFIs VqOE+gtJ/9dF/HOeyjijHWr3FV8PAI49DavQfd8o8E2kpI2HbpJktfRHBXI6uIejkSEebYY0Z8i eZWYfZzDCtySl+W9JTFLDTlkPBGjuEt13b5DwTweSNHytXmrhNkpLUEHhV58bqKPbYqRJNdSE8z WNsqaVT58r4ai6LsxZJY3iXTdUsSvrX80ldDgtT+cYGju5LcdPStv6xp6GaUOmFG9ROqc7zN64X kzTRfeoUmn3jRF9MHYAQBPDDuJ7380EoDT7mKF2WJOrx8pSTBdOYGbTAHXjnOopsyPGmGqV5F1G cq+iJqWwgHhhrNqa2jVBUKAmi0g== X-Google-Smtp-Source: AGHT+IHCbRZZpkh2uBjVQbUqFIYR2ExlR25rfYPkVetMhko3QBq1XsZIGVoHYQgnPwEo+jj8SPO3ng== X-Received: by 2002:a17:903:24f:b0:242:9bc6:6bc0 with SMTP id d9443c01a7336-2462ef8e7c5mr301903625ad.55.1756383337487; Thu, 28 Aug 2025 05:15:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 74/87] linux-user: Move elf parameters to alpha/target_elf.h Date: Thu, 28 Aug 2025 22:08:23 +1000 Message-ID: <20250828120836.195358-75-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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: 1756402702696124100 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:25:45 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=1756402292; cv=none; d=zohomail.com; s=zohoarc; b=fs3DPw0PX2vgbkRk36NkBpOh9X9VN/7LHAKEK6u6ZPOcxOEwO2faswg2LaGEOz4wdSJCBpOv8ZcJoxvOnUUMK/aYcTLZozM13ilvD0ZKAimhp6kSYswjyWGK7rpxY1L/Bb/wjFmTrrYFzK/5bs+6lqSydVewuKhTIrm9z2e4xWQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756402292; 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=Kj/+glS1oo3jl5jLrN4lvxs19CMxes7n8O+hDxYA0ze+oYHhmpbOD5HZ8gRzBc77vfCxi9Hiq49d8fxVFs531WsBz8euM086gH9HyvcQ09psZG9WUJJN2kC4tFi13O2SExLs779TVdpQBnekeHMyLNx7fFm4m0H+OVbJ1zRvfH8= 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 1756402292213504.0150545068667; Thu, 28 Aug 2025 10:31:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgDH-0004DW-Ui; Thu, 28 Aug 2025 13:15: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 1urbXb-0001AL-Bw for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:15:48 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbXZ-0000K6-S3 for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:15:43 -0400 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-2445806e03cso9501665ad.1 for ; Thu, 28 Aug 2025 05:15:41 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.15.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:15:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383340; x=1756988140; 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=xBcvlSTYPwXotFAdTT3DXG1XHzH2B1Bc54HRXeUvxbsxgcrPoXOyxK9lGZTAjibHDO 630jCna041FNZGM4jwUP5xzSWK7byHaL9T41Dgxp9yYz2VsyHDPSxUkt9eAi4GxFpnrl qITUarbGh0SAnYTXcr855xTFXM5MTlIs9FRgKYE93fqXj8g928EEleg7nBDqwUDlAEVw SiQeLxnb2TsOuyZVOsu7JoiUJE/Y1DZY5ExZQfrZ9ejk8NG/qhKTcEUj3bD9ZIuE6YI8 EWadmmEqqDiSEBxVS4AFomk1T+T+CUKO2ZyoL9HuuSBKk7cb+2p8edKlWv8nCjLz7fKu NI9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383340; x=1756988140; 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=BHwAr76aZmuqn+6OWQCRHJfO4+LYhF+S+a5V/6CC/Gc4tudECLaCeZ79BYl4WRovje wFwQlsC4COdBsJxGT5RxpZ77OWuhVIzLmewq/uCat9mqo7HwivzWSBrOcExyAjFAhuUN ZMt7BqooEPNGW71q6tkwU90oqD2rTad8jUQkoTbnoBedq54ANgg1as+GHHyk+07kvWK2 G0w76aB9UI26JpJQ5O9sHXoo4W5eEGOhV88LoymvB1+cM+Et+NhAoErluj2m2GBXSriz aNDNga08/X8hvfBdwdUtNYTs1QmIvSIuePfguk+FEq9s43zyp/yq+53XB3e+FnUS4Ws7 iAKw== X-Gm-Message-State: AOJu0YzxufecGDN7r07gi7MklufQC99TcultNuf8CH2Qqhewf19vT0F8 lKv0WamgFuqFWzpxQrut6cijkcdCfI2nF/x/dp0DbdMf2Zhs9l1TdnCPWy7FO5+/BulhhsdSigU xWmQRoz4= X-Gm-Gg: ASbGnctaSqYep0la2WcVfsLmuMStH6461pgoXorxuFk7PtR2a4kTOvNpOWk2cZEZ1Tr 8KhwSdGL55URXgnYIwsRW0lsIh9kURUWRyZ9zZgCaoX78svkx2MeX/Ee1qvGwRaYBd1buGHbAnK n1ZnE1mqSAUfEUDMfZURr4LMXwVd11jDViYNEhlY9vx/5nkT0xkwi7xHLqIhmkNthsfZCU4+GFh AeyYPq1jqq/BXoCcsaJB6MhilMdF9vqc+IdtIircJ8WxnnyJdaAyJX7R9+geEdYtkJO9ON3apa4 hFct2YekiWlOIKs+TCMgfZyoGX+pOYMcL7SN5mJrc3KcbxR/CXO955OzjdawTW4yyrlD8OasJ/n mSKuqPIJj2rrL53Xd2NufrB4gHo1yH2ohchvh X-Google-Smtp-Source: AGHT+IEFwL0CqF+D4i24xUbyc6QNoa8gfFhIFdfj/lTdshy/RoLxbO+L3+oRMS4C1v71yzu4LFc8Lg== X-Received: by 2002:a17:903:4b03:b0:246:cf6a:f00f with SMTP id d9443c01a7336-246cf6af34dmr192721815ad.31.1756383340014; Thu, 28 Aug 2025 05:15:40 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 75/87] linux-user: Move elf parameters to s390x/target_elf.h Date: Thu, 28 Aug 2025 22:08:24 +1000 Message-ID: <20250828120836.195358-76-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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: 1756402295475124100 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:25:45 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=1756403604; cv=none; d=zohomail.com; s=zohoarc; b=fSzOQfKfiXr/iRRPpVqZseNLrtEV90YpgCdss84zlKQNakkJiw7cghmDPnmxHRkwtFxJaFW/FqHXYmRrPOaOvDb8FyY8NhP8LLq+I/LgLEXwFVdsSwEfxnuO7JtSpLvxfPFS3Plq6W0Cpo0Dfi9gyRL00nUGlB73rXFLU51fYWY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756403604; 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=UYYRnZZtfzBi7U0A2thjhWfXmdJABpDfrqwnCK4XPBM4acK07l8AaMf6SJCMJE8b0z3x/Rkqw0qF8T6bEPcv3Vms4lO1HQmBpj5Ptn9lDYKIZPTPfMP5wuneAEgdM6OHbLIfCnj9wj6KEg3VKSH14bWy2mkMwC331JG16nFOcHI= 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 1756403604829834.8002593235022; Thu, 28 Aug 2025 10:53:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgIE-0006h3-SZ; Thu, 28 Aug 2025 13:20: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 1urbXg-0001By-3v for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:15:53 -0400 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbXe-0000Kz-7T for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:15:47 -0400 Received: by mail-pg1-x529.google.com with SMTP id 41be03b00d2f7-b476c67c5easo625104a12.0 for ; Thu, 28 Aug 2025 05:15:45 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.15.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:15:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383345; x=1756988145; 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=DhBT56EXoOv/V/CcOTZKNbHkaGLKTTn2nA+Z5Zku1xpkWzj/El3Ux/ptiUaPvo0BH6 6kKGha+ODS2y0Lf2zowC9KOtKShAWh+XIVYZVtOXAxkFZW3m7Fqh/QO7iPD3zU1wuPEg tqayZ2pl7Pbk5kYPUlPyRoGIBsNzNvalBIZ5Oq8WIr2jI1gOvGcsi6c7oJPdvHhuHLsc TKxmVnVbij6PJM3daza9M6p3yTs9UPnkDKntBV/jGyxPuIrbXmr6seySGIe+vGkx8qnu 6J5TxVN+Lrl60Y8YBxEDRiYwls/nIpAsQAeqhawOxMioX+bKq9UrMDWu6p0CLQcrRWHN GcjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383345; x=1756988145; 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=C2eXX5qBXCoeEBoz7oI/r6FEYo9kj6b//88k4vLWA5O//hWLN/+k6id8UQkTZoJfsQ UIu1+Npk9ZOfk8hU2Z0tVLK6OBwaXKwO4GHp+JOpR6Iz3OF/9tGtNZdg9o8poChPM1cz ORc05fBQzfJVdAKj/aXZ8Mv7eHhqH8BY0X7i6xzmTXxXim1f1uKdO7/Ttx021krQf58k XDfa9dM7Qdgaeix/hWAoma9zEj+XhaUooi8VaHZDmsV/bMGBEnTlo/JJHHhBRI4UqEJj HaHpcdIyc64rTX5FHjc2Ddx0IOPEWWVXKoy9MA2YWyzSLSHKRnVwfSvrqP1mNXC8jY5L g6VA== X-Gm-Message-State: AOJu0Ywy1tigjogSbPm7HGz7+fGZga4rinQsvY/S84EK3Q9HwKQ2ofiz wjmNL4BnA26YTSGAvb3me2xv0b/4sP+CwUEfVBMa1DLKtMx8AEMGVCdR7qQITCCc/dH2FMo9Yp3 B2988Wp0= X-Gm-Gg: ASbGncv0dxV5u6NW5FQZofwvN2iisfoYiywLqfWAiQCd01/rLQjPgMvwFaCqZ7tRnLj Bso2SoZzUd8+t3irCTuB5OUqiCAAByV/13jUUbg+3FXZbEoN6NWSD1fprIR7a0zqBMcjKB64Orv 5i6YupBQM88l9OMpJUfOs4q6WUdaiMew/gtaY7cqZAQNJQIYUlXWJjjt654CbB0FiaMtZr7fFXL Po28umPqMKbx4gaF3HWwHyr0Emlvt9xzL+llYSl5u12BsPLxtxeUFzMU2FmRFLiNhhoGlLArGAj 482OYb6iomdSsauI5pSzYr312r12CUerPcT5/4ApksD1MWez2wSsip65KVot5ssUqAqGPhpd0bO 3mpBAFm2fbVnooCW33kNsA6qOLYJC1UaElMNA X-Google-Smtp-Source: AGHT+IGnYOgiZgFUBmexVpXPbW+GyWuvuonPWIMc+8JZjmJ0YTI2c5spnaAnReUGa8gRtiBJDdeezg== X-Received: by 2002:a17:902:c947:b0:246:50c0:ae8b with SMTP id d9443c01a7336-248753a2457mr119845495ad.0.1756383344713; Thu, 28 Aug 2025 05:15:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 76/87] linux-user: Move elf parameters to riscv/target_elf.h Date: Thu, 28 Aug 2025 22:08:25 +1000 Message-ID: <20250828120836.195358-77-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::529; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x529.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: 1756403605159116601 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:25:45 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=1756401342; cv=none; d=zohomail.com; s=zohoarc; b=b5/pCI6J7Ai2Tx0hpIRb8PAOL3TIVXsBojVuBCFUk3H3OKbgQN+i3qxRKbAKNn89T7zUnzTD+emX45AywKDYYcPxuQ0UaEVgyuHg5vEYkOmpVe3lS/GbtzXQl009/UK2fXcbjxQDPDyKmQUWjw/aVOluVX0BO8hBTd6xYbzhcCM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756401342; 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=DHbb/xBdweEk+Bvk2uG55ys0SkyJQvGNY/EH+5KzGKbpHsx6vgHnvQn+bRB3G7Tdoj1HgehhROzYDMB/PZDiYOa5CT7D5IKpSbBKAwre1cEtLVGtb317FFjGlHsWb2sSzs2KiDcKDUbh5b2DeBBzONk3uWXoM3WJmgUURJLQUhM= 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 1756401342308175.35434201935323; Thu, 28 Aug 2025 10:15:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgDP-0004GG-9l; Thu, 28 Aug 2025 13:15: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 1urbXj-0001DH-N5 for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:15:55 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbXg-0000LM-Ue for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:15:51 -0400 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-24633f57e0bso5564365ad.0 for ; Thu, 28 Aug 2025 05:15:48 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.15.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:15:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383347; x=1756988147; 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=DBxR8s9DrwGEGS58Kb/lYIWrTurrfaHx6p5q9C1JQMD9Nnt2U0y1Ah4PPSfRRKPXJ/ krqqbGw0i+HtLOUVxYRL6oXyjsMp3XWq4Sxj5qpTQpx5ycDKiwiNM6l7kA8AH36VqmVU sFZ78hr7sw4LI753ruMUENkHzLu1bmR8QOvuRWizGz9tYuwwC3srNDw66q9HHOUq2XuP DWd3OjrIENnj81agbuCT2HjSmsNzF+fv/oR7c34ssWnDU0+VgoQ01Qc8EbfdpFto3rdz U9HdE8Ch6JuZ7Nnlti2G/zK3nM/rKV6IdQ5fUZM1CEB1hwQdR5x//hdFvMh0K/l6TnNI ZzZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383347; x=1756988147; 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=Bgb9oVDRRAFt7Vg17C2YMrbIGYvFa3V5T4CsTI5iigoT+Al/9rdej/bxFsyELZLrTF f2uCfUjTmbviJp8p1kQA7UEoI539uCkHGSRiMOrfrJ4ZFC6gFxv9tB+R5PBIg5DG7oDP a1zhJ742PTMeofswhXXpt+l3vByGj7+8ooeT1xffVGM5OCw1qkEa5RDY7VVhRWRkHyJ5 9Aeo9oL3cJVmACr4NyuTnbSDcI2QSP2iMNSNZh2kk1BfAQ2qLpxzE1urEmIOYO40dlca dKoAqNoETxppb2g0nMUSVCgXZKN5OFMHVnV1Wl0rrCWbi9fr6Ihwb9tkw9p4/z/2BIw8 LmgQ== X-Gm-Message-State: AOJu0YyI6SDXL3D6h99y8BaQ4TyqsRplSUdAjfBxXVdmAAvLa0vKOOS4 b0HLdSpesOangWvfoFdfpysQx7VMr+Hnq/lEKLpy6zlRq3WyfprDdVzhbtcUsUA3hkI1ZGnUjd0 ZMj5LGQk= X-Gm-Gg: ASbGncsBzY1eOPTilw6KiPnHE4xwTX7t/JV7L0lViX6lwi0DGm64yvhEh7rz4SvuUnl wMrOgF0oiBgjmaAhFWvamdkcOH+RJPpFaX8EOceM9zeaztNlqg7jbFYEsQsY1osdp6M4WRCS1Hh ghX/gSuS2M0JdTGEXPQjaYW0MAL3mxEwa6NG2L9MJnaBaYWSekYSNV75YvrP7m725VZFJ5mItqu aaWxBgb16tRkLPjclDrZfeb1bOs12pmemY55TLvotLIbz0M0OyM4MYT+95cTPaW7TIlVV5e4mpG uDNvwMjfVSXWaaV3imov8wnqyRf0SoPNiYwqMQY5Ebbbo1XyWZx+/CIf95XTa/z0cu9ZzO/HWuF 3psPdSvswFfvnL3eFTM9in8B6Vw6xXYlWfpN/ X-Google-Smtp-Source: AGHT+IEWniJfyJUWCp4uZ7n8nFX/lxPddQlhchCEK2gpuA2qc/UqEBU0JDSuLU5ZQtUzQQXbTXAxDQ== X-Received: by 2002:a17:903:3d10:b0:246:d383:3964 with SMTP id d9443c01a7336-246d3833ba3mr176360235ad.18.1756383347539; Thu, 28 Aug 2025 05:15:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 77/87] linux-user: Move elf parameters to hppa/target_elf.h Date: Thu, 28 Aug 2025 22:08:26 +1000 Message-ID: <20250828120836.195358-78-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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: 1756401343742116600 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:25:45 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=1756403629; cv=none; d=zohomail.com; s=zohoarc; b=OVYgOHEBZQS606tu4N31LjQ9SacICzW3SPDzYYwrGCXqJqI2PpeuxHVZrd0W5T49lBvBCemauiixxM3Ur9MdjkZpkfW4NeCMnxMIVrNphNFs8g4qQal12b/ecg43ZhdvuhZbqGuuNS2ZfPxwwVGSyNsuUgfkqEnbNSnCAbhwEX4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756403629; 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=mxK92JgBhFicJ/3hEyJB2jAeZncGTHiWa3XQMg+oN8opRElvYxvqtINE3sV4dv+RM9IMrtKqTmG3JX8Mv8/owRlKfAXk9xrkBZIzs3tQFMegAvRHTH0zRX0dVPPxl2IbRf7imJXmAKfgVDbIA4wQZTMpv1cA2AIj0if8jxHwO34= 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 1756403629954556.2956362592628; Thu, 28 Aug 2025 10:53:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgIB-0006QL-Rl; Thu, 28 Aug 2025 13:20: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 1urbXn-0001EO-3U for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:15:57 -0400 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbXl-0000Lm-61 for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:15:54 -0400 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-24622df0d95so6543745ad.2 for ; Thu, 28 Aug 2025 05:15:51 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.15.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:15:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383351; x=1756988151; 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=q1htR7uuwCc+kxvZqp4vv0+8wY3CDL3nVtXa1B1HSZT6fxVZw9XFXFff+0YC4km1lg SzIcVJQsr3p73oVxp7cG62g0XjKT/inPNo2ql4XBgboHntA1wVxLKyRGMf1Kt3uxFwXh /LpUMUAbQBqeKqCaaMCkmpPhMgKIskE+HWxlxgK3sisPXywceZ5l5KTT/UHOQx2rtltU cLKl9Dl3k9zI90g7O64DSqNa5kCXCNKTaWUWIsgmlFIEtUquxKnnjFcuVy/mem+I+X4W FAoLrwoBqclFBtMNIhmjvKYJ1WAmqIpzIT1Nj4mUopA8C09plE6j7NLN1WtnJF2Aelh9 dfwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383351; x=1756988151; 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=Nqf5epGUBvl3h0gy4XbLaUDkeJIe8cAAeJVEBx5AwnKQc9/b4v9fuXtmclKigYl6uR 3NnEAFZfphEU76I2cJut/yZwXlIjAviNaUnZkwu40/I0wLgf9KVgMPzcSKQY2/eXs+5g R04GxwCJk+gtvK27xkU1MipZtbO3Uui8Tj9bFaCrwWKcRfu0wig1mV4E7vTTotk0MkjN MB+W9JN8VkEUVsbD/AE40l09DCBYmtojDGtTdCC7MKN6Bvnmu4SpSJ8ddsIIOPyqjJw0 cx3qRFj1fX231e+LJnJ5/bJYT3XFrcWCLXBs4CmfARQWzP/CzOs5ssq6u/1fQn5/OInj i2Xg== X-Gm-Message-State: AOJu0YzWvlqkhvSi3wryscS3j9A5rxqU6vGv95FpUK2OCu8GXiG75FbP 8GLhIdmliEylHyYhfrCUibDT+QIJ6UWwt7GwJ9VA5+xCNVVsEk4MVD5asmXT6q0W3OW5S03TrvR Ei3PDhrM= X-Gm-Gg: ASbGncscBpojIm5HYXtqlwkiLb9RFc7m4kAfXmEvu9+1edPwx5LtLKXPr4s4qUSNPI8 ASru5eV1UE0tICROcINy8kubkpqbM8G5ZzyhQsQSTvjpl1xYdD73SFh05uTZZJF2GyvZNdJ3FME NHygQIbnukhN7iYvBqS3B5YYySRxe1Da4Tt6KfDsqr7r7WtdXht4f4fNkloVvcx2MQtcJjiLJu0 n3RUs4bD30bKc59U95z7aGb2IHQ/SP8ZUAkV3j8KQMU4umQvmqrXv5izBFAZ9QyKuVPFjUgLpiW FBJ9jMH3GoGkiRnpcZdKqbDyzaO8eL+uFsDJ4uDiTVIOjJ1HZP7lY8aM5wZzrzyZaThJy8Ildhb k95dZkKr251Fuo74Ioum5/FWRYA== X-Google-Smtp-Source: AGHT+IF/J8RuQWQuR2NAwtYk+P2OoN+rke7AxA//SXizpOWa83eusUr8zWx4z/NBCG7i7eBvwpCyqA== X-Received: by 2002:a17:903:950:b0:246:7e1a:6bc8 with SMTP id d9443c01a7336-2467e1a6fafmr238356245ad.11.1756383350839; Thu, 28 Aug 2025 05:15:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 78/87] linux-user: Move elf parameters to xtensa/target_elf.h Date: Thu, 28 Aug 2025 22:08:27 +1000 Message-ID: <20250828120836.195358-79-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.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: 1756403631438116600 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:25:45 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=1756402734; cv=none; d=zohomail.com; s=zohoarc; b=Qm/nlUMBmp4i1wX87lxcYq6xn6g2NvjMkXN2/tzREEG0sptDLytxvTz/P7aShseV8wSSdpXz5jy/3ONdROljbXAT/bnt5xc670ZF9mHPRVgu3fkOT0nbhehYuloI6jxtS5ahHAN38QTv9A8vOGYFGkArI+/5VWx0nTyZ4YrqX/0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756402734; 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=PUv2d7nQ9mjmro/E+j+HGvCJTnhtuBYKOynMNfZESE6SX+2Wy0W/hVzbf81tTKz3ujk/U7d1er4keK1G5sLW9X1lDvb9ti3zMjvNeEF2q6GvZoyElOn666rRYi02S1JJ6YjuQX8uvBAzGk7mm5BrhFx9IYkkici2abTLtxyPAPU= 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 1756402734602226.14230243067936; Thu, 28 Aug 2025 10:38:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgDv-00059F-4H; Thu, 28 Aug 2025 13:15: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 1urbXr-0001Iu-8T for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:16:01 -0400 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbXp-0000Mb-Dp for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:15:58 -0400 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-244580523a0so8879095ad.1 for ; Thu, 28 Aug 2025 05:15:56 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248e3e0b75esm15129025ad.8.2025.08.28.05.15.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:15:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383355; x=1756988155; 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=uWbov3XRzJ9G61Ekh8in2u0cAyUFh+nCqo6heHRO/9xWBLxXhxv6VvYiJHy1vf+VdG kIkHqDdhSaYpt/TP43K0mRbjADSWubuJ5M52wi5g+RGqfSmzPn9/R8GYsqFF+cpyJRtu v91d1/MorBIGyVpzc9o+YamYdbqINKBy2WCCg++gDrhT7XJ9WhJHgDqwn4LJMxjbh1jS 3wBBECXfxwyN8YiMa/pWY/1nVTZ9cOE++4luNE3KCsBeYQ3jIgCMcOhqZ6mkBnSdYoAd d+pbq/fZuvptwamnIxJnmdwv8K68xbmqkzeSJQNjPk7ARGA3Y0RGRzR/bqowPuoWJMXg z9Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383355; x=1756988155; 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=VO1CotL2vcR93AdPl2nDHqhOrHjMaSBKiEajqF9x1kBlojhl7pWLgfpmsnH3qbiYLF QtLx41GSCHO3uqsDJ05CvYYI5lB9OVwAkAHlWhBNHkX3SaSA/TG54m5kZ9WGuMsO8HlY hdzQPIjVTF4xnZ+PYGQGnpxG3JFl8wGbR+IRP7ADLehSvmGcft/gFxKRqtep3aE/4nNP 4NKjj4P7r69XH2gA9PRQFB1uPY5Wm+Tm17ruWM8Q9NsvrDk1ijfrRXjn6HMaRdsRfMxj hwJWGNPfIk5LoU86VNk/gR/HpO0y3ydg+yUNPDkSLvwP3yS6ZvXF9s4gfJuwnNQLrplL +xRg== X-Gm-Message-State: AOJu0YyuS0GA+y7XHpW4ylRHF+FuMp1r0FP0rbPWiO4fnt+H1MRvfAo7 WUhDKoQoyDW6opvTXIXy/FPjpQQdvZUi/hcGJ6z7YabUStisCNkGz5yoJMV0OlEbXD2bsxDVkLz /Rlp1bFc= X-Gm-Gg: ASbGncsQ0FaGGwdokJgkYYTG2I6RJTbLkWVERxgEnDaHDV1DOpX23vjEZv8zC555s1y 5QwsQt2zG4Dhu5y2llGepFqjd2A57hph4NjCn/sMm5/mF39RuzinmkXrNcfqLiaKIaZC6Wp2nZz HK17HGAfKP48yQhYIU35A0eOzbWY20M6meO+kOXNpqUJ+NtDqHX0zTl81wZaTV4znXqdXsMxv+U C6zPSFPQ0LlU01sVnbWGQU5EOxU1EkTKF+cS/IaII7bUJjzo97svEVgydzrq3EfY/IknY5Noc+e DqOEBwzA9rn6bs91v0pIAHWoSaBEsGTIfYuzvymrtMRo0lJMvN/mRpr4ieqc+nGeg1WZVOXekOQ a6OXvWVKCVtqMNkqgUxj3VwBJfVhuT6rSy0VR X-Google-Smtp-Source: AGHT+IEFuvdnFSu/MsqCdQTMmYp7ydIr8SBXfm48KdesngkDEBtqTpN/H8hgI48zNL/aM30rGGjPOA== X-Received: by 2002:a17:903:1b48:b0:246:6113:f1a8 with SMTP id d9443c01a7336-2466113f4e7mr257577815ad.40.1756383355445; Thu, 28 Aug 2025 05:15:55 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 79/87] linux-user: Move elf parameters to hexagon/target_elf.h Date: Thu, 28 Aug 2025 22:08:28 +1000 Message-ID: <20250828120836.195358-80-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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: 1756402735242116600 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:25:45 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=1756402044; cv=none; d=zohomail.com; s=zohoarc; b=UoTyTSnkgXpOgZqmtn9aIBsxsSKizHXC0+lC1mPg3M17Fu5fmzbNwXx8jTQaNrRB/NmvxPG2eE1R4RmLXHlE/+2Mnk0WP4OvsAI7THQo6GIpfa0qcg0yQRQ9Xn8Sl1P85nCQsphEjSkN68vir11C27XdRN0/09/CFJEsYf/YQzg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756402044; 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=8WjM1vxXQ4hTMsgbOuNurVqo634njinTp8OegjizR4w=; b=ZC2fGOXYceDrWjoBCXvivKltlU6ylulArw9ThBH4klcDAWGwq0G3o2xwSJeSZ4h0NC4py5sF7C8S+uQwQ9wjTL6XpcDNDc5g7P67hyg0wSvJ/hs2lsyeVNsSEiqdgawKq01q3vX1mc4MPzqwCW3nHlRy9y7lEnzbSJjBbNVgz64= 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 1756402044267481.7128649995535; Thu, 28 Aug 2025 10:27:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgIJ-0006v8-BS; Thu, 28 Aug 2025 13:20:15 -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 1urbas-0006hj-GF for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:19: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 1urbaq-0000oq-7X for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:19:06 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-7720c7cbcabso641698b3a.3 for ; Thu, 28 Aug 2025 05:19:03 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248953dc1f4sm48898735ad.30.2025.08.28.05.18.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:19:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383542; x=1756988342; 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=8WjM1vxXQ4hTMsgbOuNurVqo634njinTp8OegjizR4w=; b=EQY0nfI1EmoGhbMEOk7NfexAluoSLDtXAdA95YU5VJrk9WF3bhaZkqWXkY0zsFxtYN 2N781zAL6zdKb8buVjjgbUP3FJ/ohLxjcfEHcntht9d5m5HogA2SkMHP6f3cHutixcB6 vQK9+1wNeYSnbT4DiCeIGlNI6yE1Opn0VrsrTu7vMa+2N2cDBSag36+XygsMQSlxNz5V AyHPqSwmXYXO0xy/LXfk6DEmDV5eQHIUic54r3t9UVjrSP/s8ch5eYjmf9MBEIU92Tlr Nz6Z/XurAg5bJi9LmvMEGLGI/e0DIXw1VnIiQT6eptXb8/7lnjNKf039bLXmSIyEJCvV KcCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383542; x=1756988342; 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=8WjM1vxXQ4hTMsgbOuNurVqo634njinTp8OegjizR4w=; b=pfOjUFTZFqDBYVjx9kvsuESSRhYA5C6XBagYbObhY7BMwhKxC7O1WWX6VgCF91CYZ4 mx+1hXy8QknR7nxkkTtpuetpT4oanMv2+Dq05gZsulaAAEX9OBw7IkPKqrNu0Z7kb9hR Y4zFDSmycFQ3ZdhpZ6FbAvntJQYB8N2hfxICmVkt4K0FGhP0GGgIL+/Cie+Av7/avemh C/Mn+SkhpoMSXzg9xMIgp4uux+E+MoTEcZBwOloMPO5720cd57YzVengTErBAbUDflG+ bBEGW896hSpVuyg0ymQ76GUQ6Z+XOn2TuptcFDl5JYd0+fz7LTis0RA7A8nVXYzEhJBs B8mg== X-Gm-Message-State: AOJu0YyaZCRYVv76+y0gbrwIgtO+PhQamFjHAz0+Ghsd/NY1G5FLhdT3 C9Y4Vcgbp7a0s8Y2UF37n0z6BTWncnQafRJuUWDPa+5hjR9FNpDWMvqqRPwZLSJjwQel/TvQvsH JR6h4Ibs= X-Gm-Gg: ASbGnct+lAQ/EHjzGI8iagsDuNEQsCkkcNp8UkwYiwaH7D34AaX/JNrYpmJLYSIeBRu FDGMe9HrQusm9TVnAwTyIawrDDMiAzONp3tJqV5OuLAtxp7TzaN8Domlwm44HhfrUXGd/CCWSYo RK9AOEAygwKF9WkDfa2dbZEzuGapQjk1WaFyve7DW5EXeQc4TAi28QF0Nj95JIWI6ODoN8lRLXq 4Wp/YxBDVoUQ8Iauzb83WodvRz/RmgYrl3P+fGM57z2/kn4KV1KGPWY+DRoRWE3zj4sGPfrjQNj zdYyT9XLXjmB6qMMU3HCe49DEipsUltsX1o3FY8LvMx/5SvqovzDuBy8ywYk6sVOO4OWOtJ3e8u jJp1cPPDa7nSXj+ZYiquNYJEl7pZ5cdO2spJm X-Google-Smtp-Source: AGHT+IGi3KS5OKPIC7SbPuHNqhAHqzheEs3zHfNBhBd9v3mUOFl2H+dqWv3Bsmk03GgLl+iu5nuNSg== X-Received: by 2002:a17:903:94e:b0:246:ae6e:e5db with SMTP id d9443c01a7336-246ae6ee847mr220964005ad.42.1756383541654; Thu, 28 Aug 2025 05:19:01 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 80/87] linux-user: Standardize on ELF_MACHINE not ELF_ARCH Date: Thu, 28 Aug 2025 22:08:29 +1000 Message-ID: <20250828120836.195358-81-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756402046245116600 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 99a95ee45b..bb7571f6cb 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:25:45 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=1756403487; cv=none; d=zohomail.com; s=zohoarc; b=naPan8Hzv6M+mIBB/btESdnmMeAhOovmnrO+Wxj/HIP6FE8kYh3Bc8J3AKIG3vRHqGgfgpDRhU5u00PvlT+iHFDlQKke8vvF+gpHPfVyXnkLNzlEqrRz03ToHo5zkIcPdEvo7l3NU6TnE0cTGuiG7pY44OwS8cGohjOlzwr5ssM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756403487; 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=BoVMQWkfhaQ7L6Kax3GY1GgkjInKIWLCkTwFOcDdNSI=; b=bfJQvvBpPbZLUIaymxw97Efae3ES+Td6c/EggUPw/Ia8bRURBMAO7rXV/SzjfNJTvAqAtjRxYBED2Zf2putqTEiJF+ZSSZj4ba6VzSxyVLm1LTIT+E13belNrviPbZayNEFK+0Iyn2CH18R1KRGxnB9UeERvUtCic5h0e7/4Q5I= 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 1756403487604478.562760845458; Thu, 28 Aug 2025 10:51:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgIN-00072Y-Fa; Thu, 28 Aug 2025 13:20: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 1urbat-0006kC-6s for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:19:09 -0400 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbar-0000pA-Gw for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:19:06 -0400 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-24622df0d95so6564965ad.2 for ; Thu, 28 Aug 2025 05:19:05 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248953dc1f4sm48898735ad.30.2025.08.28.05.19.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:19:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383544; x=1756988344; 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=BoVMQWkfhaQ7L6Kax3GY1GgkjInKIWLCkTwFOcDdNSI=; b=IVLtatyMrFDoMi+Da/R4v++B/+sOST3sfDJB9+N6QVyTR9sP5ObIiEdoysxGnY1E52 xGCILf4eVXq75qcbjBcTM5w/awp3W2FawNlUiir2xDJGQWm/FGEukm25jq7OJGjTPUj0 qAE430J2L3d0KwkGo1MPWJ3E86egH2Hd/at+GTPLHdgEuqT2UYnB6MBKMTDybUud7aU6 V0SdoIRxKWXVfyjZS1wMeqEfF5DQRJxKzzfB17widSeJ1xHaU+tb/5V83djus8DnqF+2 Gv7hZ2g3JOP2Oen/77kvmhm53NPeDc2/e5Be3Kq+nG1iia1G/Kl34v48j6If6T1EPGYc E4zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383544; x=1756988344; 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=BoVMQWkfhaQ7L6Kax3GY1GgkjInKIWLCkTwFOcDdNSI=; b=rOjLsbAt7efDXXTZWv8xyEXN9w73QUJmUmwLysFM8lcs6pE5DpewjtUdtMI/3yWWLA QM3BB5eJQ032OXMjNaHFGSw4D5ub689xnNcgjapOoxHj6xPAwMZJiicabQ/RM72+4015 cTqoLgA6VVAZvEC3aizTQd6WAr0IqADVrLjgd5LIzErZRzNeZMvgxBwSeE8tPSdqNwmj 4Wdi/+MmQH8tEQ1iDDsmRZLzYFil/LXtFgbHgqLJ4dhwGMDAeqSQ67Zhbw8QsjMKmBUt rovidq01KPWcZ/JppXL2+d5NrgdQ9b5cQGrrVm/gKUghlaR/mBDAvI0+WLCU7G2hPWC9 fHUw== X-Gm-Message-State: AOJu0Yyadl2xNHxync4Xg8cu7+8CN86bQIBIel9e+u8KNrI8y6XD8Mm2 RUxPGQ72p3vTP535NdK8QMj1WymslhDeCNumKEk+pGpr8jLNSE4PXUEP5Z2kKh0vVq9KKBaRphM HRPWZVf4= X-Gm-Gg: ASbGncsFosEUENd13TQ1UwF7peeLARz0pct6zq3TqqUkfe5yHLt8Auj5f+E1+FGMzX6 VDJYqVQFPE6g0uO9P5Boq7RlGDYDbNiV8EKd8Lu8RV7GKReyEdrLNw6MauAHVMKpdqx/sGmQnWl 35pXqAnnDxiSWZul5d5Q+KZnm87nemHpJC55+yzHdV6ewPPb4Ob3hHuZrg/mhdNRKMPaI4VriHD ljm74w2pFk2JQCiENWnZ0OtWQHcxk/m22z4kjJsmghrShp1hpZbeWlQEfbFksJd6f7FjjnLTY3m fSG+8IuF+SnPIMsqKLiK1UM3LATosq+M3gm4MoqNef3gfiyYO2pbmCGNcEWso5z07SSFBe4i/uM eNxJZRlLbMSlEPjlbiRO2gv4ySgUiEuuyEvBV X-Google-Smtp-Source: AGHT+IGpSfQR6cNz0bGNy3Qe1mdFU6ZPIL+Qw/uyuJR5DSjeSQWFXm8z1NoUQYn16AI53Z43mCGZjw== X-Received: by 2002:a17:902:e788:b0:246:80ef:87fc with SMTP id d9443c01a7336-24680ef8bc7mr251621355ad.45.1756383543941; Thu, 28 Aug 2025 05:19:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 81/87] linux-user: Rename elf_check_arch Date: Thu, 28 Aug 2025 22:08:30 +1000 Message-ID: <20250828120836.195358-82-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.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: 1756403489755116600 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 bb7571f6cb..33ce82ab2f 100644 --- a/linux-user/i386/target_elf.h +++ b/linux-user/i386/target_elf.h @@ -31,7 +31,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:25:45 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=1756402829; cv=none; d=zohomail.com; s=zohoarc; b=GMNTlti3Y6PPr8OCa2kA9wOjLe5jddHhgVrh5V6iTx/fQKVPhY3pDh2MXEYc2d2d4WsQ5lxaYQAPt+6CPhmNb2aw/DKMX60RlwN22eaE8NAU81l/ruDHF/5moneyDsLqNim6pOUHv26y1jehe5HZgeGyWgHhFe3EipEDZ1oum6c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756402829; 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=AWSW7baFH77Pk9AiWziJSACqygz+Nm97M+nZTfeYJ1MTFnZ7heUblUbhoNsfhqTyYS+secY+v33gaWaNf80Ge3U6XL9b8hAWYFmCwE3VDZwwI7nf2VyT3OEPaXvzr7TSCgY5kzbL+foHKlm3fC+DGnyRxDpdbeMjJpRpDF8I9ds= 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 1756402829659400.42531708770207; Thu, 28 Aug 2025 10:40:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgEC-0006GX-9F; Thu, 28 Aug 2025 13:16: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 1urbb0-00072Q-6S for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:19:16 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbau-0000pe-4R for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:19:13 -0400 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-2487104b9c6so7822495ad.0 for ; Thu, 28 Aug 2025 05:19:07 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248953dc1f4sm48898735ad.30.2025.08.28.05.19.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:19:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383546; x=1756988346; 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=p+xVgnULBAP11fxScBV9TkkFb372ftx+6cGWoemkc6vagLeLTapnwJJy4NbD5jroZx txXe1iBEwNXCnWW8T+ZmpLsc4UN37SqEZ6HTs8XCV31Jn/Ob1eGpkUlsTP5swJx+AecO 1J4t03HTZl2uqgnFUp09dEUfKT+4DJK5VMxQ376eb5SSy+Ky6z9FK3VNIjcrx9nI9n8r bzuv7OosXVzCFSNcSsmvOLR+2hrj49MMGrkyearI/83oCqNxEfDplkDPXhXEOSsSWdYS dZcFDkGGWx4ajQssQ2bguBcA1O5JS+lmoy5vccmZy4rzhXPonPtsDdMLj711e8Jc1mHU WG5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383546; x=1756988346; 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=DCkbgrqwqKiNoQ1KfR6A1e5SsY8fxVgOl4s+Sl2zRgjtZf81JUHCGi2tziuvYLGVDf 6WBiLoxUBybR8KD6xahcRTm/n1nPto9gldhB4C6SJ1IkWxBYRegzyeZ6vdYybrDxX8MS cMZlDukX4jTkQAloDU9WZBqi3tp0aXTq0HP/nKS0dBh/9d106H3nSrySch8x0/E7wbqx G7Wu53WPjF5jvKDiI+rCttOBUYDs1E6iAQvUAg9bFyVKEmA+QFK0bQ0wHU+KUCakez1f ajzWrEgTyf9A5pdzTrT7zW9/nuySCFA+4imH6HOE9TXQOWsaHg1cOEl2wchHVDaaGJUA vVYg== X-Gm-Message-State: AOJu0Yxg7Hj8G3KLm7jIpVmOvwVRYnSvBAemHQrAsX+VvRPVBvmJcJEu uMKXRanUQ3uLiH68v1+cbnD9kSaRYqotrSExnX9qamNiU5FKtFUiP8U/hzOIoWLzbm3FMKcivGo PiL9FCQw= X-Gm-Gg: ASbGncuK7HJ8ntbVX/TZ1P7UdJqAx3iodwD4hTtn2X3fT8jfbmGyfBRCP4Li9RO6jGZ e5RAQyDExvr3ziXqPRvw1mNoK0o2a7zYRJGhbs+POwyJyyevb5j9R3vCKa7feC/zz5rHfDD7jIx NevCthAR0NHBe7+9tvAKDJKkadsuj6V+6bHs69jk6dA2z5Z0+dLqBGy9FJyptuImN8zgCv3H1ZW zHZ/F52i7t+cf1K2Ykl2mRKzLytfGoh++IBi0Y1iM/p3fXelr4gw0Jll2xr/H5XkgP8UuGLFB13 3oFKvPMiqVsF4/f32BrM2OYH1kbNpdcve5Y/ctLALr6WodkCL36T/aMdC6+dvh27QU66pmtoAic 06HKlTK14U299ON+2HnMvRd4vCOXzHU1I8WIZAKwyRjSqrkY= X-Google-Smtp-Source: AGHT+IGQeM3R51nUNstdZSTHRJ1/H9U3HovUr02tQlWLDZH/6Lo5kmdO74fB5mm67ZpTRR5jpwxIJw== X-Received: by 2002:a17:903:38cf:b0:248:aa0d:bb25 with SMTP id d9443c01a7336-248aa0dc43amr72399725ad.14.1756383546501; Thu, 28 Aug 2025 05:19:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 82/87] linux-user: Remove ELIBBAD from elfload.c Date: Thu, 28 Aug 2025 22:08:31 +1000 Message-ID: <20250828120836.195358-83-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::636; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x636.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: 1756402832484124100 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:25:45 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=1756401271; cv=none; d=zohomail.com; s=zohoarc; b=fZ5y/p3ziZ5RoX0NPjrJuS/S+6+ErhRm3YtwJN7DpjA2YcGj/yjr9Vc935ALa+ignCvzWIgJyIe0/yjg6B7AWUpU1yrgpxGIIcuRPqdqt/G6WOcX+pibD8l7hAWAl8txXKHhtfLs5mVFqq0nsskoZ0eEkmcjXLY9doLpqtsGvww= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756401271; 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=WG4st/D2IvL6X9fqJ6UMxr8cOefDrX4tb+vEvO06Aig4pfNMP2G0YZEaLwV8C2gQiae7bcZZE4gJsl4C7dIP05AtLBvxUG8G8ITQ/0KpiqBMsstvaKAegbNOPJPIDPXNLnKg+Pt0ZNLFFQi1dnpeiO8pXNvL+bceNvkqii0dxnE= 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 1756401271420497.0231520725547; Thu, 28 Aug 2025 10: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 1urgBL-0002TM-UX; Thu, 28 Aug 2025 13:13: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 1urbb3-0007DY-JN for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:19:18 -0400 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbaw-0000q4-Kp for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:19:17 -0400 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-24622df0d95so6565585ad.2 for ; Thu, 28 Aug 2025 05:19:09 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248953dc1f4sm48898735ad.30.2025.08.28.05.19.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:19:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383549; x=1756988349; 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=t5QGlsYI1S0ypABAm1x3XFb3CQLlP+HbjsX7WeoA0Wb0rt51eBGZ5ItjM5UGuS5e0O tmMAV/WQr4G1lJfcMmqnxXlBXWk4+tLPYE+W6NcA0WrbNZkYJ7Y6RBbwwUn8S3tWNhPu 2xdhegkJuikV4qKKosl7yXhZrQu/8pN4koMlHNkZUFGcHpV6mXtSFOBPxrCPTadvauq8 hA+jEjuFD4m0OiFaOe8cgsilPIrFJ4PrDIJd1xOeF46VTGlqfpLjyng2KSkeydTG2dj0 qs5SMEK1k8lnKbuV/KoQ5c6NAGSORJPkLMTQTrV2W0uq7ZGJY4CA4xXJnTJjNEAntKU8 n/pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383549; x=1756988349; 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=lP7RWor3Tf8gGLuzPAFzm/+X1Xu9zgf90e2u9jDRcQYxMa/pBRzLkdLp3dMrTGJAR6 BgpPL4yGyArRpnF5iGoX3IivjIym8RVM1FQKE4PH8I4Bdyfp3IofWqWxkI4uf8o9S36X /nKsDvPw6RO8px+yJ8+T9m2iU2jWchFMOf7I6wv0jBgYGtLWNOwgGYfb0y4GhTPBVQwt hGQDNZtRkHZJAazsdsMWMiDWehxeXWWFAo5EjEXm0esmsOGJuuLUiu1sIRJRMSuJdOTw XiA2Mp8BAoXLjCycxyWqwc+M+ZaQaT9yWE8QX0EnWnLshFMrPLGdc88syjs+iehUMyBq 45IA== X-Gm-Message-State: AOJu0YyP/Ysy5vWUfCWjz/miI2sDQ5HRvFBnCDH5XU43VFlMM/QECno3 ByIs0zbAh2BlZsZzQ9VN9kA3E+igWyiaHt5rey3gLndLav6DCPnOIWsh34fhQNiwMUArW+wJrXm gfwJe4L0= X-Gm-Gg: ASbGncukRFdx4PMC+t0H/bt69ecxR6sEvY7jycCYwjswWJzbHd5VG7DAcrjOuOev7MN 4tiNyagdvZpf+j++faI58y7KmyG5goUXa861BIfchp6k+H6ChtunQnARs1ieqN/ZLBnCNkkB+gB im/FLKAOH/E56HDkoEoVnWIFcAbRZb2Bi40nNGiNAdaZMkV6NHMDUE6oDSrUIozpovSOiOq5xt/ LddIrTXwJ9PwuhctQC8ATpFO4C1EhyOuOTFGXjVErkMXpiSeaEM0/t71bG2VkwPnFwvc+JNVzzr 7htKfg/tH2D/yrn7VZxn0xKaqKSLxjiP52svneHEP4wGx3pvFe42S2NRjH6RFCovVWfLjG1jVY3 0arEZnMZDQi0mrayTMm3V4aEQMg== X-Google-Smtp-Source: AGHT+IEhLnSINAzIBAkFLnNYNExqkffZ8XEayLh5uhzGsmb5gtfVpPTnP0MthyYMfIA1HKZxM06S6Q== X-Received: by 2002:a17:902:db11:b0:248:f30c:9544 with SMTP id d9443c01a7336-248f30c98f5mr8465145ad.50.1756383548803; Thu, 28 Aug 2025 05:19:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 83/87] linux-user: Remove MAP_DENYWRITE from elfload.c Date: Thu, 28 Aug 2025 22:08:32 +1000 Message-ID: <20250828120836.195358-84-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.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: 1756401273248116600 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:25:45 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=1756401837; cv=none; d=zohomail.com; s=zohoarc; b=J97hWmmOxcqJ2ccdsgEP484yIA0/n5wYmwQ8AS+Rz5+MbUagwsQyx1CDqC5F0jxkexwAjbTM2SuossLaWE0Xa3E+RS8wuLlw4l2pyj/XwNdFxUQzTI1Et5HCjv7/GcGfCZAGzLKP8dmv0oCTIX1O9l+nLiHb6AbFz/gePJ0zi00= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756401837; 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=bJ3/7wj19rNefp7dXv1N7YEbFbcf3qmt+nLmjhBeCzcGsvvJgSAYFI8Cn3FZtxzN3hsNTQdOkw01P96y2VaG0GYnergvYLC3ioiPfVVvaPEv6F+zOEwP6fFsug41SqkFpNNpgCKatrJDavrXEmGf0Qzz+7yene1X1SwaTLMWEN4= 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 1756401837467449.7487724439387; Thu, 28 Aug 2025 10:23:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgDn-0004ne-2G; Thu, 28 Aug 2025 13:15: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 1urbb1-00077H-Ki for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:19:17 -0400 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbay-0000qY-I7 for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:19:15 -0400 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-2445824dc27so7555115ad.3 for ; Thu, 28 Aug 2025 05:19:12 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248953dc1f4sm48898735ad.30.2025.08.28.05.19.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:19:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383551; x=1756988351; 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=nsQAxRWa9n6rjSHR65//BJAxuwPSNCwzRnSC90i7r66i/olWoljDUto/ZE8eTYlMZE +sJkXTujj1qmf5XYNFYmkxUh6BtlIrHGaFoCc6MtjApAOHQo2PI86eRr9vUQSzOi1THn tz0nFyShLYv13PXTJdou/SGZjwNTM4btNE9vD8bMM+umuGMg2XbawIg/WNGqug2P+WVa ckdzbAxiRKefwrDAVWbf5L17Hup27wzXvp1lhG5ljeVZuf2CkbZprvjKdRGQp7Lxbd9e UO2mk/5MNGx3I2DY7CHQOMD2VZiMKUxe8p9tt1UPbwfEJi8udL5y6p6bR6c+DSFoca91 TH8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383551; x=1756988351; 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=wx98p+5DFZ6SY8gQhIVkYQyD3c3NEBccX1NsJnGDzkIEsVHxgnN8L4lRPUqb3qiudB U7tLDbYpEePSSpuTCYYo2eqaHstiDxSu9MCnMe/ZeAVBK15VB6s+K3TgS/vsVm7ixC8T JkAyB4zUuUrgqW6X2okY5IMjss7ct+Q9AgekUPmpy+ONrr9nDY2+hKEvCiNRoCWUhpnv H0yD/R9SseS/gXq6xcgIkOhas51/V7rWy5sOWWsWU6LvdT0lM0wDxKuhBuKNfJM21thN 4K6aWYYHfcNikN5zMe8PCL9M4aNEpvjrgcOnhuJOsZvJ5O84UkicDlr2XNyvLvkQjL09 p02w== X-Gm-Message-State: AOJu0YyigTm82w1z2P86XIX88Q9mWAzzO5PGG1zeD+3QOTplR+xn4k/K 0K1LEcKiiylUOlYizUKulhDCK9nqz8sVcHS/cjT686O8SuCXlWfOM8OzPTwm3aavBIaBMqjJBhM 7JQqBfW8= X-Gm-Gg: ASbGnctzMFDg26K/1p8shI0dut2FnyFrtl4QSLAQ3FW8CYJw2SpnSxulmTW7d/7OGGX Bo02IL8HPejf62quu+d7PYVPFPtpWNQIWUyerGHZd5q60sZpaegEiPb0e8AtEdC2q2APUykVFcM z8OozjrbA1miSFIrwI1fACkNFDYnh2smqLY2GxOxdrqCCI1O54Pj07OJZBc7TzYATJbFmqNMYsD MTMLx++JvIuGTJRvlUHR7yBh8H/hiIkpF6FAANIxcHIGRIexjHgXBSc6n2v9T9EfrfI7ESvyRoX D3DnjCiy1oOs0SGrXKHtHFW/NCwuG4E6t25cUyoHzMgHw9s01pKMYy+Kn76ZeS0E6tcAy03vIVf tvEeasNCmooXtTZl6yw5jm48VwzI57MgYyOKV X-Google-Smtp-Source: AGHT+IGVsvquWZuAjmSFsGt4kxATy4qBiX8HDexAI0tWopd6VxhG1Ts9eOISN2V7/qNHexAkAIJVbQ== X-Received: by 2002:a17:903:244b:b0:246:cc56:39e5 with SMTP id d9443c01a7336-246cc563f19mr197661145ad.17.1756383551031; Thu, 28 Aug 2025 05:19:11 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 84/87] linux-user: Move arch_parse_elf_property to aarch64/elfload.c Date: Thu, 28 Aug 2025 22:08:33 +1000 Message-ID: <20250828120836.195358-85-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::62c; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62c.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: 1756401839755116600 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:25:45 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=1756401485; cv=none; d=zohomail.com; s=zohoarc; b=gXrU1TpCbE5voHke1jaibG3wYUQBSHIj4dVz5kyh2P8pIRvlzAJbV7cOK55r4lstFOr+ZfO8XdMA5cxtzhnle1jNA8zh4u5Z9PBCngqqfm3HJHPRODf4qxSASGkNf+aBocHZ7MMry9qqktYj5HN67b56PqX1fmUADXVawFCHUiY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756401485; 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=FpEjdEJz9ZgDSoYQ0TIqJFn+NF/Xy8uJxr1ONlPAeupT3Eb+tACNI4DWi6eDr8lLt7Uj6A7LDosqQeiYV5UvM15hQWEAa0O6wyQsoJPquVmUSpk4BJBSVsqvljVdLv5h9JUQf0Fle8vBZpOa8NcmQ65GcxiZ707atOTnI+z9cmY= 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 1756401485780380.3143698560708; Thu, 28 Aug 2025 10:18:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgEF-0006bA-1Q; Thu, 28 Aug 2025 13:16: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 1urbb3-0007Da-JU for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:19:18 -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 1urbb0-0000rI-UX for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:19:16 -0400 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-7720f231174so781779b3a.1 for ; Thu, 28 Aug 2025 05:19:14 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248953dc1f4sm48898735ad.30.2025.08.28.05.19.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:19:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383553; x=1756988353; 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=qLd9NS021GpUQ/zWUvS9JxtP+Ut/3RD8WGvhg8HlDW/vUF2MqBz+orBvbIHHqH9BoR cFVVR4zGzM/fj+h2pQ9airQl41ED0xyux6EzHfCu5lWMlpmoSh8nYdwRcB4TsBGtZw6b Tje0g63dlJq9OBAIExjSOSG/rqTYWggrfiqXL2LLaY+UYNeqUTGdepw4qdQuEGwTxnmD yqqBfzwCF7QAt8cg8FOeubuaB9LTKKDv4PxClb0mBPjOsyDdmJ8OBFhYfp5kGYzAXmNZ YDWCFx/4riuZ+E1xzTrBYHpz2AxHBbrl1vf8IpPFCdKRGIlvhxkZqKpHcHqCrzq8qVUj ab+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383553; x=1756988353; 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=E5ZGqvCMpfXsU9crucEE+jrJekQvWewUww0PuYxNUJtiVionuzfQvQoilYYzlxkecr kws+0rH1f5FOXW9eId36Vo+gEY/ygLM1ZN6osOL/0VVx0NMATUAnPf+e7MpeSLOrfYuG l58AArTaHhYgO9IWSu1VzcqB3Kw2BQu5fV29s6wZ245rLfl6On+L3m2ItDZaVTmn/k/i 1dnBLePa5aJB5WrNdYAKA+YwcNI0+N87qt+ZD3ozSPK4wejo5Bkd+q8lgWGZL7j7VXlG rAIKvkkn1GsdNBPJQKQy0uqUwAqNOmcmLTeKMiZtN0BvQvUMWxS8cZXuxPjFys6izy4F CFmQ== X-Gm-Message-State: AOJu0YyT4rjMbmbyX6q1CeqjEyj9xJIBfVpAkJieXcxzblD/xJuIhFTX nw5/DBKuXEpM0IiFedfyrro6QG2ijm9msK9VM+F/hOetGsYCffpJzN30rj6RvUXDPDPioUK9ORF Y2dMobDY= X-Gm-Gg: ASbGncuZxZrZSm6ljWcF4eftYzooC28T3aRKPND24jBMSmkV47PSX5rtJ67gb0FGlcm 0+CXFQNcgbuxS2O53F57fQspNxtpJivMaiWv7OOQepJQ3kQlrZY2OX6KChXnGZUhPv2H9fxDWHp xJbsTCUCRFvv2davE3Sa58EocSV3sQhrsURW4gMqlyr/EQRxP7UmEcXnbKkHwiahoHRzpnjFOLT FlPFhFbpkhMAGHtbUPCyY58iLm+s3Gy3jmZ8C1zAnnRf5pL39VV2ON0C1paCwyuwtetZTgDxTFj kVQySQZnWRdSLKEJBv+D6P9leGzjxG37YF+39CBs08+4FZCUhxuD7xFBAVTc0HUwkb7e8jm8261 czhapmT6qAuLbYSPz4DdZzuZypthUNVOYNE4ifEogxB/71Rg= X-Google-Smtp-Source: AGHT+IEBqcxH8eukIiTh8LxhzI3gnllu2d6+OxkMf7BE97Re8RcWB/cadrT1/jxB28yNhNyvTrX6wA== X-Received: by 2002:a17:902:dac5:b0:248:d4d5:8428 with SMTP id d9443c01a7336-248d4d58c57mr31584245ad.22.1756383553494; Thu, 28 Aug 2025 05:19:13 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 85/87] linux-user: Remove a.out declarations from elfload.c Date: Thu, 28 Aug 2025 22:08:34 +1000 Message-ID: <20250828120836.195358-86-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756401488614124100 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:25:45 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=1756401320; cv=none; d=zohomail.com; s=zohoarc; b=FLnptF2ipG0Jox9/EC4jDOYk2gaQd/2ZafIw5bhaVzjzI6t2DwlC9CrnRfTV7il10c1S0m/uBDSkD1MTZs1Bsv/rQngw8zPmA3DM2XcCGLy3D4cOFMTlxQzWNrSNXf19sAaRfPZSKOG96tD53/EdjmB2O+Cn0EU5Nn2z5bJ7ep4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756401320; 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=gSSqodjZuof68OvFrsej/3x/24+mS39WuwisvHqWfCs=; b=eHoXzspcVtJoqFxS/nP3r+A6yDN0WbdIYptrAmwibTO6uymmYZWwD409uX0Zyb4617XDEsxVovNue+SXhvlkoUqkrd9r8iaEKtVo9YIzXo7vbJwqBfD7eovqVLn2XE8SnQ6DrBZg8Rp4oPjEyry7rYuqz3jIA4yRkpVQ3AU4rHY= 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 1756401320788981.369477900306; Thu, 28 Aug 2025 10:15:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgBN-0002TS-UZ; Thu, 28 Aug 2025 13:13: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 1urbb6-0007KA-CE for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:19:20 -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 1urbb3-0000rv-Do for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:19:20 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-76e1fc69f86so1591296b3a.0 for ; Thu, 28 Aug 2025 05:19:17 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248953dc1f4sm48898735ad.30.2025.08.28.05.19.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:19:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383556; x=1756988356; 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=gSSqodjZuof68OvFrsej/3x/24+mS39WuwisvHqWfCs=; b=lF1yvDZFS+FcAwn494jh98SPI8YK4HphvvzU8ze9jquwaxqRz7HeLVVzwDl5GR/i0d saTk7MOeJsJWiAxgg9C6NhaV7aE4c1tcCWsmxGMk245M9DpRHUcgzGfrIqJIFG9iVRn0 2zU/VPXzRu8u96FBO+w4obdo/jXiJmcCJrKKhVzWyd8meMZIQDp+QtrhIfmtB8ubq1lX VDs0+Qs8HDzIa94377mifbEVESR9CFc7xjzgV84wtsndWPD26ohqI7Mm7bkxl2P0WsfP 4Nh5ts1WWzxxO1HRbbvdq40oARQRDPqA2wr6Ku8xtW16qQRH6pd+G5U9tRxU0O89yqXZ jCtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383556; x=1756988356; 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=gSSqodjZuof68OvFrsej/3x/24+mS39WuwisvHqWfCs=; b=W8Pe68rpLEWM1xFZ3+QTAaMaLqkmzu+CmFMdulrzCSlWG4lepAvxbCPELUdwuBRuDz 49BdJqUqldxKEepF3TShwDoOBROUFGy2FN1zpFWsmDJPhoOPjqm2JTWw3KqPz5pEoUzZ CM0lICWhdhxAbzQiQ2K9J1hLYQ4ItV8xPT/HRLTTIXrPsqTBKQX5g/uTWiqCVaVKOGNr Y3xLSB0O/S7otdMrqglGHGs+ksn6BpQpACiprh0+fLrw8XZjoYDH1DOqZeQyxKyuiCMr 7jntwguwcK5AO2Q/NIECseFdpW44KI5mWNSSuEZuCJ8Eyz6qDdd5mOjNQVSqwGaFq7T1 hYpA== X-Gm-Message-State: AOJu0YyvBwh6lkJMqsCHeWGNTbowaa4BsTZ6ovhv9Qd8f3DVYw35uo/4 77TH0UaCMqR4r/BDcaQ13hq6F2GDQXlYLbOys1eed2HUIqtrWrs3XY9p0P0vm53J5WLMCGc1Kyp MIxU28rE= X-Gm-Gg: ASbGncvyJLCVLhzRp/opmKUEp1tGgmtm6lp6xoR1bRqzzIycg2oqFLrDG1OlF0mdZVL dcGEaSaz2SZKZo/zFYCYVn36tPyUI8orUWoKxEa/+Y/f4ug1X+R2sfE2Kf6G5ITTMB5HEZv3KuT y7S1YNaqFteBPDrgNECqZogYdHp2DREzBNVGIV60awqWiODKAHcgR5rH4GW/uiOqTWpp53OZY8M smG/P8NOP5ULyMNK/SSxa9azV1TkH3KkJe6p2Ou9MNCqESwBnTBEzmaLE92Qa7Y7z1Jk63/Q1vP tZC1CMetUIjDpNK+A3zP35qU7zSzO6PjHfFCSqbV6czrgYtdwzbFCApgOk/wbqveTRRPL+x8Z5l qu70510MIbZnG/FOHAJrLwRn4BQ== X-Google-Smtp-Source: AGHT+IGdu0BJwAK8OTrexjRfU20u2UDfvcGiBZAvXTVH2CRdsh5lwICR/gzCsanVUds2KAHVGHJXew== X-Received: by 2002:a17:902:ce88:b0:242:c66f:9f62 with SMTP id d9443c01a7336-248753a2725mr116365855ad.26.1756383555651; Thu, 28 Aug 2025 05:19:15 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 86/87] linux-user/sparc: Create target_ptrace.h Date: Thu, 28 Aug 2025 22:08:35 +1000 Message-ID: <20250828120836.195358-87-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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: 1756401322434124100 Content-Type: text/plain; charset="utf-8" Move target_pt_regs to target_ptrace.h. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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:25:45 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=1756401650; cv=none; d=zohomail.com; s=zohoarc; b=ScPVD032v5aCZR7HZv1D/YzQOsy2DJ1qIml5pzlyZIQkH1I9ePDS9oMkR0xRw+6og6YEslVk3x3KtnTazAzMq74Vr+BBPR2CkxLVLFDsjHZxpKotkBZUv/tN44KbQZUiX9ZQLqk9hX1j2oUQGJQC+FNKVydtktxCCS5rXmvNtrg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756401650; 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=UbwavcB5p3xBMwbs2Qh5dv9jVH0cvn6kYBKvsg40cc4=; b=T1U08M7Rnmg/fd+5JTIi9QtE0H6AYv2L57EgnBKpzuyR45KXrlOlvy8IS+jCqnYvp5wFUzksjk0bDAgglG7UDv65zmQ+nRkmiG3okRMtL0BaPImPNwN6+Zfmx7Ir/4i0oVakUPydwajxSAuxOZulu++DFHfYXhabJteI734zrUY= 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 1756401650545749.3275563661335; Thu, 28 Aug 2025 10:20:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urgEF-0006hM-TM; Thu, 28 Aug 2025 13:16: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 1urbb7-0007NF-9h for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:19:21 -0400 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1urbb5-0000sS-Do for qemu-devel@nongnu.org; Thu, 28 Aug 2025 08:19:20 -0400 Received: by mail-pg1-x529.google.com with SMTP id 41be03b00d2f7-b4c645aaa58so496370a12.2 for ; Thu, 28 Aug 2025 05:19:18 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-248953dc1f4sm48898735ad.30.2025.08.28.05.19.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 05:19:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756383558; x=1756988358; 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=UbwavcB5p3xBMwbs2Qh5dv9jVH0cvn6kYBKvsg40cc4=; b=V8kYWOIl8/vFlHyocG/w20rgmFqbhe7F7NDFXHUDo82s3KlGRflYbuZJKoqQUWwn98 G2dCrqBjAzc5aWitXJIdyXlBENwDEDHNDkK4TPiHi+O+kbtQed2rG87ncVRkQJ8gn8zX tNexqd081Wr1yrBBKJxk1+aXl5fAOaLV+13p1FRgSYMnXQaKeDOfVoq1DQgXV4LSOGJx sLRLCMcGm2rQgF1SbKQZTbfg9WDJxMwkZmpMmCfMKIRzU82tA6/C9U2QBvadqS80K1qf t/RnZUAhZQzC9lmROpCAMjHRbgJnAEuatL6OB/ZKp1MvIUWIJx4yYybhf+Q0LoJZ0U67 TpMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756383558; x=1756988358; 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=UbwavcB5p3xBMwbs2Qh5dv9jVH0cvn6kYBKvsg40cc4=; b=coPrzQ2UcqcXxsx4BtE6Ucy6FGSEVowWwD0C8Mi2m5JUe35NtnPSHOskjO2b0b1XId 0emoROm6ZZ181FDt596SWE56y/lELjDT6ZUh8PjeChvDfw4j12qK/+2tZyHGOnDbK1TC 2TlGtVusRr8YxiCxqjXp2XV+xJrKns85yeIgSf3Pzrkr59vqSaehcD7vaGfNHW7AyyfV uKLyC4CKdlf/DwlbrGDRGKQ/Be34R8rdfm24vAgUCjgf7q9QB+s4BKijiGrWxWWtQ5Sg Oe6YgVkqQ5jqN39ZjUhyp8e24Bw3Ud2mPUr4nDIxPCfrqRPB+5m7xVWhlvJ0hQ9KMswt Xr0w== X-Gm-Message-State: AOJu0YxCsEt8f3/lZkd5aJrZm7orYL3Wq/ETusVnnW9OhGuEcu99K2EY 6FVrPPDg3o94CHjEwF+T7we3RxkGcVCecW56iDQb5xi2Ma9ehtqVWXrn5n+OPXZeAbys42kkSCv yxAzrBTg= X-Gm-Gg: ASbGncsPUb2yedtRyopdv2sEryOGwovLXLWdXimeW6iNjs/uCCgL8VYN5TJcEWQRPTB mREwwbNIBFsuUrBGr7zAocctEg7A/vDsQ3drSbqA5oAHDA3tOqhOrbBmiWzx8zB5GuvJmEXesAw y9GAuejLBigq/BHQNKwbvOO5RIwLT9WAnP1NHPoGM4flJGPVW/FAuLecpPJ1cqw17dl9HSdTyMy HArXHj1ELcFMi7e2wodzZuOH0giZxt1CzMOSeKGkgGUdnP3I+67DgT2caJ3+jW+GY5X91B9MVVs HqVmwkLa7DbQDwhjV0HLvuYjLvOROSTDprWxNaexIbAyKTW+ymYc/4JZZX9L5wFJyJskaizVMnn qdQB5K0fhh6M+Amlo9q54V8A9UQ== X-Google-Smtp-Source: AGHT+IF/MVTTJwTl3rKMFBo1BbrJTpQ4JVc5AwZt0RgF5Q+bwcThVqFBXRFQjSD0siPQuhhp3S2klA== X-Received: by 2002:a17:903:3d05:b0:246:b467:eea9 with SMTP id d9443c01a7336-246b467f171mr199583585ad.21.1756383557876; Thu, 28 Aug 2025 05:19:17 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v3 87/87] linux-user: Remove target_pt_regs from target_syscall.h Date: Thu, 28 Aug 2025 22:08:36 +1000 Message-ID: <20250828120836.195358-88-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828120836.195358-1-richard.henderson@linaro.org> References: <20250828120836.195358-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::529; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x529.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: 1756401652929124100 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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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