From: Thorsten Blum <thorsten.blum@linux.dev>
To: Huacai Chen <chenhuacai@kernel.org>
Cc: "Maciej W. Rozycki" <macro@orcam.me.uk>,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
Oleg Nesterov <oleg@redhat.com>,
linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] MIPS: Fix MAX_REG_OFFSET and remove zero-length struct member
Date: Sat, 19 Apr 2025 12:35:38 +0200 [thread overview]
Message-ID: <505DF3CB-F7E2-4233-B39E-654FB5BEB811@linux.dev> (raw)
In-Reply-To: <CAAhV-H4x4oQEtvk4Ah0WNBWtaQysj00k_Pybs=+r37oriJxVPA@mail.gmail.com>
Hi Huacai,
On 19. Apr 2025, at 04:56, Huacai Chen wrote:
> On Sat, Apr 19, 2025 at 4:22 AM Thorsten Blum wrote:
>> On 18. Apr 2025, at 22:18, Thorsten Blum wrote:
>>> On 18. Apr 2025, at 17:14, Maciej W. Rozycki wrote:
>>>> On Fri, 18 Apr 2025, Thorsten Blum wrote:
>>>>>>> Does regs_get_register() even work for CPU_CAVIUM_OCTEON when accessing
>>>>>>> the last two registers because they're both ULL, not UL? (independent of
>>>>>>> my patch)
>>>>>>
>>>>>> Or rather two arrays of registers. With 32-bit configurations their
>>>>>> contents have to be retrieved by pieces. I don't know if it's handled by
>>>>>> the caller(s) though as I'm not familiar with this interface.
>>>>>
>>>>> Ah, CPU_CAVIUM_OCTEON seems to be 64-bit only, so there's no difference
>>>>> between UL and ULL. Then both my patch and your suggestion:
>>>>
>>>> So it seems odd to use `long long int' here, but I can't be bothered to
>>>> check history. There could be a valid reason or it could be just sloppy
>>>> coding.
>>>>
>>>>> I still prefer my approach without '__last[0]' because it also silences
>>>>> the following false-positive Coccinelle warning, which is how I stumbled
>>>>> upon this in the first place:
>>>>>
>>>>> ./ptrace.h:51:15-21: WARNING use flexible-array member instead
>>>>
>>>> So make `__last' a flexible array instead? With a separate patch.
>>>
>>> No, '__last[0]' is a fake flexible array and the Coccinelle warning is
>>> wrong. We should either ignore the warning or silence it by removing the
>>> marker, but turning it into a real flexible array doesn't make sense.
>>> I'd prefer to just remove it from the struct.
>>>
>>> Stefan or Oleg, do you have any preference?
>>
>> Sorry, I meant Thomas, not Stefan.
> In my opinion just changing __last[0] to __last[] is OK, no other
> actions needed.
That doesn't fix the value of MAX_REG_OFFSET - you might be missing some
of the context here.
Thanks,
Thorsten
next prev parent reply other threads:[~2025-04-19 10:35 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-17 17:47 [PATCH v2] MIPS: Fix MAX_REG_OFFSET and remove zero-length struct member Thorsten Blum
2025-04-18 7:57 ` Thomas Bogendoerfer
2025-04-18 10:06 ` Thorsten Blum
2025-04-18 10:36 ` Maciej W. Rozycki
2025-04-18 11:05 ` Thorsten Blum
2025-04-18 12:44 ` Maciej W. Rozycki
2025-04-18 13:38 ` Thorsten Blum
2025-04-18 15:14 ` Maciej W. Rozycki
2025-04-18 20:18 ` Thorsten Blum
2025-04-18 20:21 ` Thorsten Blum
2025-04-19 2:56 ` Huacai Chen
2025-04-19 10:35 ` Thorsten Blum [this message]
2025-04-27 7:12 ` Thomas Bogendoerfer
2025-04-27 16:22 ` Thomas Bogendoerfer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=505DF3CB-F7E2-4233-B39E-654FB5BEB811@linux.dev \
--to=thorsten.blum@linux.dev \
--cc=chenhuacai@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=macro@orcam.me.uk \
--cc=oleg@redhat.com \
--cc=tsbogend@alpha.franken.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox