Date: Sun, 23 Mar 2014 18:00:46 +0200 From: Konstantin Belousov <kostikbel@gmail.com> To: Justin Hibbits <chmeeedalf@gmail.com> Cc: FreeBSD PowerPC ML <freebsd-ppc@freebsd.org> Subject: Re: set_mcontext()/grab_mcontext() Message-ID: <20140323160046.GU21331@kib.kiev.ua> In-Reply-To: <20140319221325.13f4b7c2@zhabar.att.net> References: <20140319221325.13f4b7c2@zhabar.att.net>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
On Wed, Mar 19, 2014 at 10:13:25PM -0700, Justin Hibbits wrote:
> Running into problems with X exiting during a sigreturn(2) on my G4
> PowerBooks, it seems sometimes bit 10 is set in the mc_srr1 field,
> which, from the documentation, can only be set by hardware on an
> external interrupt.
>
> Looking at the references closer, bits 1-4, 10-15 (ppc32), also
> numbered as bits 33-36, 42-47 (ppc64) are for exception-specific
> information only. I'm wondering if it makes sense to mask these off
> when setting and getting the context, as those bits are useless upon an
> rfi.
>
> I know this is probably simply a band-aid for possible corruption in X,
> but to me it makes sense, as the context data is useful only when
> entering the interrupt context, not when context is restored (bits are
> localized, not restored to MSR).
Late reply, I saw that you already committed r263464.
Traditionally, the sigreturn(2)/setcontext(2) are strict, in particular,
on FreeBSD. E.g., on i386/amd64 any reserved bit in %{e.r}flags,
which is closest analog of PPC msr, or even a reserved flag in the
software-defined mc_flags field, cause EINVAL. Due to the construction
of the signal trampoline code, return from sigreturn(2) without applying
passed context causes trap.
I think it is useful to keep this behaviour consistent between architectures.
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (FreeBSD)
iQIcBAEBAgAGBQJTLwUtAAoJEJDCuSvBvK1BzSkP/RkEAeLMhVIRbNoKipr1LxE7
I3lcsHGmHMj+nluzWWHSTlcw9u831vKp0c8swpG4fewUDR/XX0xpK6Khb2tnDs+z
9tITxoGVTTlQWmP8RbsmBpnnyR5JU2VJJ21xS8dxYX3Lo4eis+PEI6rw8jLZQ4xx
Atryvp0TYboQGyNPE1rLziO4myYwQnRPTS70Qpcp57btt6Y1ZOx5pTa8LWBI50oX
s7QTeSB9bNmWf59MR3+J+RI/dIXuveTVeU5a+syZM6QaQ2fBvS5LyPKE3gUBA158
+/K36MPsxpCgOu7d5qMiGoBjUVCN2XPH7X9S3OCbMUN7Ak26KzV2JmGMckO/aVvl
slKnNFsXJxOMm7aT20v/zVJXv4U899HUFK0BGiKrhtX0Av7uoGO4abUn+Xx8AGvy
4NGSRJ0O66BSweSBC8R46/hmMtk84wP8Ot0DJ7GZrVQn3cEO8GfM9bVLKWcxBCAW
CxMWBwx+CYrBW/Vbx238vRYt1CCAY01OJwgLZcfEkhkj9PThsgR6s9zMr1tVFL22
BFlCbEIm0dbQ/C1D7LHzF34RgqljusqPtZ/lcEBcdBI8Y0f6RNQRBvVERvIq9L5d
Ga09//gzOyuvkqcQ1I880SdQUEDkwzltv2I2q3vtdVF6yWqcyW5+4xzZJbxWeeB6
EwH0xIvExS2Pl+jxaWmg
=/+yz
-----END PGP SIGNATURE-----
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140323160046.GU21331>
