From nobody Mon Nov 25 00:52:21 2024 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 ARC-Seal: i=1; a=rsa-sha256; t=1718773309; cv=none; d=zohomail.com; s=zohoarc; b=nlujlo6EYj49MwRNVeGFghQJ4V1MW43VPYwMCpp3/S6jXcyWa9uW8GauaU4iQ36EJg2wADu+JI9Me9DHKdBXRiCocNXBk5jH6VCraKxYMpmcBG2R8hlnUPjrl6cPTatENN6jnQMvlLllHUEgYsppDEpBB4WHcVyJwrBkj8Sxjz4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718773309; 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=wxOU2UBK31A2MsvvrU8KfdPolr+I7zX14JcLUR83OuY=; b=MlHga7TPa9vo5JdpeDu+rpo6kq3bL8tuVUtrtuQ5SKUagOdD1jUYJsZDIBnnQQ4bubGTKhrsiigIwd5g74AX4W4oS1FAS8QR93ypwkNruMophbqwQqTsW9J+DLxv9ue6kKrHzjGyATdS6IUx1204JFpWY00v0+fo0nEpm7Gf3cs= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 171877330908053.55615039602469; Tue, 18 Jun 2024 22:01:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sJnR4-00088d-FJ; Wed, 19 Jun 2024 01:00: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 1sJnQx-00086P-0p for qemu-devel@nongnu.org; Wed, 19 Jun 2024 01:00:36 -0400 Received: from mail-oo1-xc2b.google.com ([2607:f8b0:4864:20::c2b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sJnQu-0002Ci-Sf for qemu-devel@nongnu.org; Wed, 19 Jun 2024 01:00:34 -0400 Received: by mail-oo1-xc2b.google.com with SMTP id 006d021491bc7-5bfa5f9bbe6so1747433eaf.3 for ; Tue, 18 Jun 2024 22:00:30 -0700 (PDT) Received: from telecaster.hsd1.wa.comcast.net ([2601:602:8980:9170::2f17]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-6fedcf36be7sm7457523a12.1.2024.06.18.22.00.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 22:00:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20230601.gappssmtp.com; s=20230601; t=1718773229; x=1719378029; 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=wxOU2UBK31A2MsvvrU8KfdPolr+I7zX14JcLUR83OuY=; b=Kcailptvuz9013OyL/yyBltry2NtRtUxPj/AYkfzMMYsLRx/UY1CrsMl0RvMPfDToX BAp866SuY+x58k9JlsqgAL8XWWURgv0yOMDA1r2Vu63u7b8ILe+8LY+Zk7E7pkVPnd54 iGAqfTJpbaHw+ooooFbcoKGOrlaZ7ok+dQEJCHt0UFJ2XCng/yE5dtGDy2jBkDwY7FRR uyRVRMCfiOC7hAJCzdqYwY0a6f3NEYjritc00xtRxyRNITrLCKE4XP1M1YpNOaPNeSo+ SXDb/b7ygf9lhnUVOHggbpvawljbiUQuPYGY1uX1ghAIM0PYqx+tzoTWDPkLWXCP8DW4 tyog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718773229; x=1719378029; 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=wxOU2UBK31A2MsvvrU8KfdPolr+I7zX14JcLUR83OuY=; b=X+Dl+X7YFyBM6E6WU2mT2s5M5kkgL/6VQTqlIykee3p4qcgEIXyuSVbLd7jUi7zrqb 9B9BPgZdsoiVKJ37mPK7ClVSxj04zeUQ2KcATR9RTb2DoZxHTnClkp6bH9rKf7XbgS0j 2IHsjbVNma65tl78cy8e2rfQ4GUKGU149Xs/nPS4yNbyffLXeezSB5FKJiBgodfxPtO4 Qxzp/EerXcpBfeQ0VfjgkJZTdLq+XZTdW00YURbdvm0w65FHkwWL77XwAF9vZEZHt1QD CNH8YCpTbM3JBawKFOGuCnpt4cXXTfkGVm136m2XGJRHxLFN+bmksfByNENGzi/eESAZ pb3A== X-Gm-Message-State: AOJu0YzecMyHe3YaYu3ZQb22FTNMGUDMdcXJAinfwrtyDXle77zof/go ByrG0xrWPdRPPOdyGCKS7YMqjuplcgUU9Rf3KDHaqknWIyJcDhuvCFZLsOlYCI1i4NkvdF6pvjh MKjw= X-Google-Smtp-Source: AGHT+IFnRK+olC27LLdSl+gitic7LAbd0SqQcny58N5Rx0UD++iUFr60Z1/P8h7FqL77+abhYXrbkg== X-Received: by 2002:a05:6358:5207:b0:1a2:46b:9278 with SMTP id e5c5f4694b2df-1a2046b95e6mr48914055d.19.1718773228755; Tue, 18 Jun 2024 22:00:28 -0700 (PDT) From: Omar Sandoval To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Nicholas Piggin , Daniel Henrique Barboza , linux-debuggers@vger.kernel.org Subject: [PATCH 1/2] target/s390x/arch_dump: use correct byte order for pid Date: Tue, 18 Jun 2024 22:00:12 -0700 Message-ID: <5929f76d536d355afd04af51bf293695a1065118.1718771802.git.osandov@osandov.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: 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: none client-ip=2607:f8b0:4864:20::c2b; envelope-from=osandov@osandov.com; helo=mail-oo1-xc2b.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-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 @osandov-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1718773311117100001 Content-Type: text/plain; charset="utf-8" The pid field of prstatus needs to be big endian like all of the other fields. Fixes: f738f296eaae ("s390x/arch_dump: pass cpuid into notes sections") Signed-off-by: Omar Sandoval Reviewed-by: Thomas Huth --- target/s390x/arch_dump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/s390x/arch_dump.c b/target/s390x/arch_dump.c index 7e8a1b4fc0..029d91d93a 100644 --- a/target/s390x/arch_dump.c +++ b/target/s390x/arch_dump.c @@ -102,7 +102,7 @@ static void s390x_write_elf64_prstatus(Note *note, S390= CPU *cpu, int id) regs->acrs[i] =3D cpu_to_be32(cpu->env.aregs[i]); regs->gprs[i] =3D cpu_to_be64(cpu->env.regs[i]); } - note->contents.prstatus.pid =3D id; + note->contents.prstatus.pid =3D cpu_to_be32(id); } =20 static void s390x_write_elf64_fpregset(Note *note, S390CPU *cpu, int id) --=20 2.45.2 From nobody Mon Nov 25 00:52:21 2024 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 ARC-Seal: i=1; a=rsa-sha256; t=1718773300; cv=none; d=zohomail.com; s=zohoarc; b=XlrWgTjq3W8zCxsetFdFrJZwzHITdBukP76NRQVoV6rDPUVirLivwfZOYWTr+QsXWagHnUYWYVlCc2IJo9ZPIL7EAuSKY60wmUIzeOvctFz0W0FR251r7Kx9FxmBPdILkO5hKSgGFKOp7ug/yZFp82JqLxotKC1nkpR5SFqn1mA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718773300; 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=CnHosSMTlhyZy4/smUQmVXiKBF37sEAO5boId4LvkC4=; b=e0GPJq5OYPgKREFnfXzRN/zfFrc4RN/dEhJiVJV4rlmd+VBPkYjMqa4pHAHW557ibi1ytmd6+XZCUcHA1nMOltOypG53PCI9MGD+jSjfFcifT+oWALPdjDAf7GDrRNh3JCi3oJTQks9zA0b5N92RDcvm+Y17GKoxU2CXcI9wD9Q= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1718773300012866.8774891649497; Tue, 18 Jun 2024 22:01:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sJnR7-0008A0-AH; Wed, 19 Jun 2024 01:00:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sJnQz-00086x-7C for qemu-devel@nongnu.org; Wed, 19 Jun 2024 01:00:38 -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 1sJnQu-0002DW-Sj for qemu-devel@nongnu.org; Wed, 19 Jun 2024 01:00:36 -0400 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-705c739b878so428764b3a.1 for ; Tue, 18 Jun 2024 22:00:32 -0700 (PDT) Received: from telecaster.hsd1.wa.comcast.net ([2601:602:8980:9170::2f17]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-6fedcf36be7sm7457523a12.1.2024.06.18.22.00.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 22:00:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20230601.gappssmtp.com; s=20230601; t=1718773231; x=1719378031; 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=CnHosSMTlhyZy4/smUQmVXiKBF37sEAO5boId4LvkC4=; b=01grOxXvZ4QjyUPmU8rPBbU1luNUaQymAYHhPOmVzVI7IQR8zG/s9zynjrpugdurDO yX95c5NpkfMl5waQCx5UsuK1D5bDnm8bCAmVJF1cH0ApB8nyWVzePiQGpy7TGwcFNq6h RnalrwU3IvNMlsAqjIu4bNL3Znq5lUKj+APpvEWWvqPBNRm8bO9Y69AzGvOnt2nRD+QY NcilGRK9QBSIAPIHwoYoIJTn2i1a5VwRlTEiJzPTJV4U44usxi/scMtU0xXc6s4Z0y6N 3h0e35aEZR8J60IC+5EtTQkLt6AF5r+tYt3XBM0+1hLPMrIvSfaUu0NZuBxp8ORne89K N98g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718773231; x=1719378031; 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=CnHosSMTlhyZy4/smUQmVXiKBF37sEAO5boId4LvkC4=; b=uAA5zP0Q0TBIqogVThsw36VVBHWbCS95iKeN3t0Ur0LTol8gTbHHXnZL/yyFlrNeSb yuHggnXcI0rI5mnldPzpXyyXOP70IaOBgn7fkaTtlr+DAUwtrHMsI20Qixdoju9sPxCF +vxaGC/MrOjDqHRKgNdLtgnT7ty3udZVw6w3cXcHj0pt1un6aibfhKRhZVfmpc2ijVjr +UH3IbqR9JRoTPcJbGbJxdZocdHYqNrjnpH35vF0IBgSBURdU2Lr8hPWFbjcUVmrAU2O 0g3feeu3bnsi9NneosKDVovmuwkmDsDo889YPUEnOj5w70SC6NP7k0/6BXWtchcDDuqE hxmQ== X-Gm-Message-State: AOJu0YyGadQdnsELdYJBr3monBMnLrPqaCzhl44pYDhFhtFXvEGO7ib8 8VhRyD1j5ccqH+Yg45O6TbGVKTLmTpwBDyfAdXrQd08AeXOlioRy75u2Ed9j4/lq0+OhST/3sHJ dpJQ= X-Google-Smtp-Source: AGHT+IH+pD6pdddjXgKRvRm15zJ2fCm4wOHzm9P4Y5A1pJHZtGupGZ0FTYlkdIu+G+aSj8d3m5wyXQ== X-Received: by 2002:a05:6a20:c31d:b0:1bc:bada:a9fd with SMTP id adf61e73a8af0-1bcbadab018mr1978857637.1.1718773230570; Tue, 18 Jun 2024 22:00:30 -0700 (PDT) From: Omar Sandoval To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Nicholas Piggin , Daniel Henrique Barboza , linux-debuggers@vger.kernel.org Subject: [PATCH 2/2] target/ppc/arch_dump: set prstatus pid to cpuid Date: Tue, 18 Jun 2024 22:00:13 -0700 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: References: 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: none client-ip=2607:f8b0:4864:20::42f; envelope-from=osandov@osandov.com; helo=mail-pf1-x42f.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 @osandov-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1718773301170100007 Content-Type: text/plain; charset="utf-8" Every other architecture does this, and debuggers need it to be able to identify which prstatus note corresponds to which CPU. Signed-off-by: Omar Sandoval Reviewed-by: Harsh Prateek Bora Reviewed-by: Thomas Huth --- target/ppc/arch_dump.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/target/ppc/arch_dump.c b/target/ppc/arch_dump.c index a8315659d9..78b4205319 100644 --- a/target/ppc/arch_dump.c +++ b/target/ppc/arch_dump.c @@ -47,9 +47,11 @@ struct PPCUserRegStruct { } QEMU_PACKED; =20 struct PPCElfPrstatus { - char pad1[112]; + char pad1[32]; + uint32_t pid; + uint8_t pad2[76]; struct PPCUserRegStruct pr_reg; - char pad2[40]; + char pad3[40]; } QEMU_PACKED; =20 =20 @@ -96,7 +98,7 @@ typedef struct NoteFuncArg { DumpState *state; } NoteFuncArg; =20 -static void ppc_write_elf_prstatus(NoteFuncArg *arg, PowerPCCPU *cpu) +static void ppc_write_elf_prstatus(NoteFuncArg *arg, PowerPCCPU *cpu, int = id) { int i; reg_t cr; @@ -109,6 +111,7 @@ static void ppc_write_elf_prstatus(NoteFuncArg *arg, Po= werPCCPU *cpu) =20 prstatus =3D ¬e->contents.prstatus; memset(prstatus, 0, sizeof(*prstatus)); + prstatus->pid =3D cpu_to_dump32(s, id); reg =3D &prstatus->pr_reg; =20 for (i =3D 0; i < 32; i++) { @@ -127,7 +130,7 @@ static void ppc_write_elf_prstatus(NoteFuncArg *arg, Po= werPCCPU *cpu) reg->ccr =3D cpu_to_dump_reg(s, cr); } =20 -static void ppc_write_elf_fpregset(NoteFuncArg *arg, PowerPCCPU *cpu) +static void ppc_write_elf_fpregset(NoteFuncArg *arg, PowerPCCPU *cpu, int = id) { int i; struct PPCElfFpregset *fpregset; @@ -146,7 +149,7 @@ static void ppc_write_elf_fpregset(NoteFuncArg *arg, Po= werPCCPU *cpu) fpregset->fpscr =3D cpu_to_dump_reg(s, cpu->env.fpscr); } =20 -static void ppc_write_elf_vmxregset(NoteFuncArg *arg, PowerPCCPU *cpu) +static void ppc_write_elf_vmxregset(NoteFuncArg *arg, PowerPCCPU *cpu, int= id) { int i; struct PPCElfVmxregset *vmxregset; @@ -178,7 +181,7 @@ static void ppc_write_elf_vmxregset(NoteFuncArg *arg, P= owerPCCPU *cpu) vmxregset->vscr.u32[3] =3D cpu_to_dump32(s, ppc_get_vscr(&cpu->env)); } =20 -static void ppc_write_elf_vsxregset(NoteFuncArg *arg, PowerPCCPU *cpu) +static void ppc_write_elf_vsxregset(NoteFuncArg *arg, PowerPCCPU *cpu, int= id) { int i; struct PPCElfVsxregset *vsxregset; @@ -195,7 +198,7 @@ static void ppc_write_elf_vsxregset(NoteFuncArg *arg, P= owerPCCPU *cpu) } } =20 -static void ppc_write_elf_speregset(NoteFuncArg *arg, PowerPCCPU *cpu) +static void ppc_write_elf_speregset(NoteFuncArg *arg, PowerPCCPU *cpu, int= id) { struct PPCElfSperegset *speregset; Note *note =3D &arg->note; @@ -211,7 +214,7 @@ static void ppc_write_elf_speregset(NoteFuncArg *arg, P= owerPCCPU *cpu) =20 static const struct NoteFuncDescStruct { int contents_size; - void (*note_contents_func)(NoteFuncArg *arg, PowerPCCPU *cpu); + void (*note_contents_func)(NoteFuncArg *arg, PowerPCCPU *cpu, int id); } note_func[] =3D { {sizeof_field(Note, contents.prstatus), ppc_write_elf_prstatus}, {sizeof_field(Note, contents.fpregset), ppc_write_elf_fpregset}, @@ -282,7 +285,7 @@ static int ppc_write_all_elf_notes(const char *note_nam= e, arg.note.hdr.n_descsz =3D cpu_to_dump32(s, nf->contents_size); strncpy(arg.note.name, note_name, sizeof(arg.note.name)); =20 - (*nf->note_contents_func)(&arg, cpu); + (*nf->note_contents_func)(&arg, cpu, id); =20 note_size =3D sizeof(arg.note) - sizeof(arg.note.contents) + nf->contents_si= ze; --=20 2.45.2