* [now with correct Cc] [RFC] weirdness in "MIPS: ptrace: introduce NT_MIPS_MSA regset"
@ 2024-11-24 4:36 Al Viro
2024-12-02 12:25 ` Maciej W. Rozycki
0 siblings, 1 reply; 2+ messages in thread
From: Al Viro @ 2024-11-24 4:36 UTC (permalink / raw)
To: linux-mips; +Cc: Paul Burton
Both msa_get() and msa_set() have very odd logics:
} else if (sizeof(target->thread.fpu.fpr[0]) == regset->size) {
and
if (sizeof(target->thread.fpu.fpr[0]) == regset->size) {
resp.
These instances occur in mips_regsets[REGSET_MSA] and in mips64_regsets[REGSET_MSA]
and both have ->size set to 16. Fair enough, we are dealing with 128bit elements.
Now, the type of target->thread.fpu.fpr[0] is always union fpureg, i.e.
union fpureg {
__u32 val32[FPU_REG_WIDTH / 32];
__u64 val64[FPU_REG_WIDTH / 64];
};
and both members have the same size - FPU_REG_WIDTH / 8, now as well as at the
time this commit went in. FPU_REG_WIDTH definition, now as then, is
#ifdef CONFIG_CPU_HAS_MSA
# define FPU_REG_WIDTH 128
#else
# define FPU_REG_WIDTH 64
#endif
Both msa_get() and msa_set() are under ifdef CONFIG_CPU_HAS_MSA. In other words,
they are only going to be compiled if FPU_REG_WIDTH is 128 and sizeof(union fpreg)
is 16.
So it looks like both checks are constant true. What am I missing here?
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [now with correct Cc] [RFC] weirdness in "MIPS: ptrace: introduce NT_MIPS_MSA regset"
2024-11-24 4:36 [now with correct Cc] [RFC] weirdness in "MIPS: ptrace: introduce NT_MIPS_MSA regset" Al Viro
@ 2024-12-02 12:25 ` Maciej W. Rozycki
0 siblings, 0 replies; 2+ messages in thread
From: Maciej W. Rozycki @ 2024-12-02 12:25 UTC (permalink / raw)
To: Al Viro; +Cc: linux-mips, Paul Burton
On Sun, 24 Nov 2024, Al Viro wrote:
> Both msa_get() and msa_set() have very odd logics:
>
> } else if (sizeof(target->thread.fpu.fpr[0]) == regset->size) {
>
> and
>
> if (sizeof(target->thread.fpu.fpr[0]) == regset->size) {
>
> resp.
[...]
> So it looks like both checks are constant true. What am I missing here?
FWIW ISTM these are leftovers from an earlier version or suchlike.
FAOD I haven't had anything to do with this code so this is based solely
on visual inspection. Also no MSA hardware available here to verify
anything (but QEMU might do). HTH.
Maciej
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-12-02 12:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-24 4:36 [now with correct Cc] [RFC] weirdness in "MIPS: ptrace: introduce NT_MIPS_MSA regset" Al Viro
2024-12-02 12:25 ` Maciej W. Rozycki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).