mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Greg Ungerer <gerg@linux-m68k.org>, Arnd Bergmann <arnd@arndb.de>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	linux-m68k@lists.linux-m68k.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] m68k: Avoid CONFIG_COLDFIRE switch in uapi header
Date: Tue, 14 Nov 2023 15:32:54 +0100	[thread overview]
Message-ID: <8305a632-730a-4113-a638-0a9a520ee0f7@redhat.com> (raw)
In-Reply-To: <6e3f2a2e-2430-4b4f-9ead-d9a4d5e42713@linux-m68k.org>

On 14/11/2023 15.20, Greg Ungerer wrote:
> 
> 
> On 10/11/23 21:19, Arnd Bergmann wrote:
>> On Fri, Nov 10, 2023, at 11:31, Thomas Huth wrote:
>>> We should not use any CONFIG switches in uapi headers since
>>> these only work during kernel compilation. They are not defined
>>> for userspace. Let's use the __mcoldfire__ switch from the
>>> compiler here instead.
>>>
>>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>>> ---
>>>   Marked as RFC since I didn't test it - I'd appreciate if someone
>>>   could give it a try on a real system.
>>>
>>>   arch/m68k/include/uapi/asm/ptrace.h | 2 +-
>>>   scripts/headers_install.sh          | 1 -
>>>   2 files changed, 1 insertion(+), 2 deletions(-)
>>>
>>> diff --git a/arch/m68k/include/uapi/asm/ptrace.h
>>> b/arch/m68k/include/uapi/asm/ptrace.h
>>> index 5b50ea592e00..ebd9fccb3d11 100644
>>> --- a/arch/m68k/include/uapi/asm/ptrace.h
>>> +++ b/arch/m68k/include/uapi/asm/ptrace.h
>>> @@ -39,7 +39,7 @@ struct pt_regs {
>>>     long     d0;
>>>     long     orig_d0;
>>>     long     stkadj;
>>> -#ifdef CONFIG_COLDFIRE
>>> +#ifdef __mcoldfire__
>>>     unsigned format :  4; /* frame format specifier */
>>>     unsigned vector : 12; /* vector offset */
>>>     unsigned short sr;
>>
>> I think this should be harmless,
> 
> I expect it would be, we have done this in at least one other uapi file,
> arch/m68k/include/uapi/asm/swab.h.
> 
> 
>> but I'm not sure we even
>> need the structure in a uapi header: about half the architectures
>> define this in a user-visible way, while the others don't.
>>
>> On csky, powerpc and microblaze, pt_regs is used inside
>> of the 'struct sigcontext' definition, but I don't think
>> this was ever the case on m68k.
>>
>> The other one that is accessed in userspace is 'struct
>> user_regs_struct', but this one is actually not in the
>> uapi headers on m68k or x86.
> 
> I don't think we need them in the uapi header at all. Trivially moving
> those 2 structures into the non-uapi ptrace.h seems to build fine on
> most simple setups I tried (systems using uClibc, with applications like
> strace). Should we try moving them out?

Yes, please! Can you send your patch?

  Thomas



      reply	other threads:[~2023-11-14 14:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-10 10:31 Thomas Huth
2023-11-10 11:19 ` Arnd Bergmann
2023-11-14 14:20   ` Greg Ungerer
2023-11-14 14:32     ` Thomas Huth [this message]

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=8305a632-730a-4113-a638-0a9a520ee0f7@redhat.com \
    --to=thuth@redhat.com \
    --cc=arnd@arndb.de \
    --cc=geert@linux-m68k.org \
    --cc=gerg@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    /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

all inboxes | Powered by JetHome®