From owner-freebsd-emulation@freebsd.org Sat Jan 5 23:22:16 2019 Return-Path: Delivered-To: freebsd-emulation@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41D9E1426F91 for ; Sat, 5 Jan 2019 23:22:16 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic303-23.consmr.mail.gq1.yahoo.com (sonic303-23.consmr.mail.gq1.yahoo.com [98.137.64.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC7E772AF8 for ; Sat, 5 Jan 2019 23:22:15 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: x_hhgiUVM1n7.8ORVUk.xGwm4Pi5FVhYB7JI1.m0NA5u9h9BMZU7Mj9qZoGcoIN dR4SjCZm7ZAOsZbG8aArzp7uY1fK6FzVUQxyGNrCFL0RVCvkyAn2Mc0U5AL1vSpJBmMBklieh90k aDtJwdI14PdVaA6tHDBuKswHyfrWLtzLdpYUYQPTzRBBowk61JYT63LK.CB2UkxOIaXaO584k9aj VYjgvhXfZodm9YGVjpBZ6ZHRuOtfpjDj2UaIdn.01M6xjAGGZGVoz9vTmxVw7FopWYCJbHKExQeX DV_BfFuhRzZeUQp0jiH3jl0oArvgE8sVKtU6BkmM3sph5L13tErVY1EPWQkU81T7qjpcwclzz6S5 ZUV50ohn7CT9OyMvvA7VkcyynvQdXMJ5XTbOn1p41..rRGrnnyk893gh82z5F7KpVbvKaeZxuAWd X08asRNc78UhnSONZaSdvIae_hUXgEl7nEQbsrLLwkBXs8w7l8l89R9fwvwGtF14lQJ2xK9A2Z9H X7.nnrz6TaQfniuBbCHr9sjR69IaSiJ6HLrPuy4vczuAKLR9SQZXGIo9kZIzk2wJThcMobHrhrub 921XO.bLnK.Ii1Dgzy2PLkpSVX.Rl31DZo02F4rL3hyaZjeyERvPZtYMPy1BM3xNT9LecqQtdKFS z0StWI67vcQBzLe6ZVdNbnDXeuEmdBVBVhZxRMElEIavFL3.9uujticdsiplNUpLBv9MbHIp4FgD XhwuD.YOBMsYfzzqEFZGEdASEN8CuAFB7E8JodHkDjcJNhDYoVY2oujESYmQUSGsfU0XE8tMCnld Tohf9rJv9vLYLge85WuUYS244754rCRDeYuOd.5bN8UM7_uN6vQ53fpq424SwRRvtmTEjCrbPQZp j8GOED0TumC50UzHL25OXHZgSIdNdgsGa1DyfqOX.N9w.ySxfnlRNnk.JbtlRN2amFY4o3y0sArN SzPiQYnewN6riKnVaZiXCwCa6olOcYYID_j0aDT9xYckwrHcurib8Ia66CCUJlBoVE4daRpe.5kH l6m23l3W9EvFMXY_fiLwSj8y3CU.pRc1g73sR.PgDNyW3YtHq.A8BhExZoNUBAn2Fgjxn02JZjKB a68c- Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.gq1.yahoo.com with HTTP; Sat, 5 Jan 2019 23:22:05 +0000 Received: from c-67-170-167-181.hsd1.or.comcast.net (EHLO [192.168.1.109]) ([67.170.167.181]) by smtp402.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 27714f34376999a592f1bb6b408ac852; Sat, 05 Jan 2019 23:22:01 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: qemu-arm-static has target_sigframe missing sf_fvp field so target_sigframe is too small Message-Id: <693D6101-25B5-4D88-BD5F-1F8BD34AEA1D@yahoo.com> Date: Sat, 5 Jan 2019 15:22:00 -0800 Cc: Sean Bruno To: Kyle Evans , freebsd-emulation@freebsd.org, ports-list freebsd X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: AC7E772AF8 X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.69 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MV_CASE(0.50)[]; FREEMAIL_FROM(0.00)[yahoo.com]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[yahoo.com:+]; MX_GOOD(-0.01)[cached: mta6.am0.yahoodns.net]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; NEURAL_HAM_SHORT(-0.77)[-0.772,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(-0.40)[ip: (-3.03), ipnet: 98.137.64.0/21(0.60), asn: 36647(0.48), country: US(-0.08)]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[204.64.137.98.list.dnswl.org : 127.0.5.0] X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jan 2019 23:22:16 -0000 [The context here is FreeBSD head -r341836 based and ports head -r488859 = based.] Note: I assume that "struct target_sigframe" is meant to match the = memory layout of the target's native "struct sigframe". Otherwise the reported = differences below could be irrelevant. For armv7 (and likely armv6) the following code: printf("sizeof(struct sigframe) =3D %lu\n", (unsigned long) = sizeof(struct sigframe)); // arm: printf("sf_si %lu\n", (unsigned long) offsetof(struct sigframe, = sf_si)); printf("sf_uc %lu\n", (unsigned long) offsetof(struct sigframe, = sf_uc)); printf("sf_vfp %lu\n", (unsigned long) offsetof(struct sigframe, = sf_vfp)); produces: sizeof(struct sigframe) =3D 592 sf_si 0 sf_uc 64 sf_vfp 328 However gdb reports for qemu-arm-static (on amd64): (gdb) p/d sizeof(struct target_sigframe) $3 =3D 324 (gdb) p/d &((struct target_sigframe *)0)->sf_si $4 =3D 0 (gdb) p/d &((struct target_sigframe *)0)->sf_uc $5 =3D 64 (gdb) p/d &((struct target_sigframe *)0)->sf_vfp There is no member named sf_vfp. So the first two fields have matching offsets. But note: sf_vfp is at 328, after the size of target_sigframe (324). It looks like both contexts have 260 for the size of sf_uc so the difference is padding before sf_vfp . /usr/include/machine/frame.h has: struct sigframe { siginfo_t sf_si; /* actual saved siginfo */ ucontext_t sf_uc; /* actual saved ucontext */ mcontext_vfp_t sf_vfp; /* actual saved VFP context */ }; sf_vfp was added in -r315947 (2017-Mar-26) and is in 11.2 . = /wrkdirs/usr/ports/emulators/qemu-user-static/work/qemu-bsd-user-4ef7d07/b= sd-user/arm/target_arch_signal.h has: struct target_sigframe { target_siginfo_t sf_si; /* saved siginfo */ target_ucontext_t sf_uc; /* saved ucontext */ }; =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)