Message ID | 20231110103120.387517-1-thuth@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp1307059vqs; Fri, 10 Nov 2023 10:35:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IF36HepOGNJo3ateO5IZ3F7Ep86Ta3J9p3XdF5E6IGgeNuaAtOkHQRYF1fl+qJ6tri+WA/o X-Received: by 2002:a05:6e02:1985:b0:359:53a4:b23c with SMTP id g5-20020a056e02198500b0035953a4b23cmr261295ilf.6.1699641303203; Fri, 10 Nov 2023 10:35:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699641303; cv=none; d=google.com; s=arc-20160816; b=nA+r0WcDb7VXTc1e1U7ElfjZUBVuiNSUHuLKq4RNl4LtIJbKmMQZephI/l76qWeHJ1 FEKWY6hy5S8hAe8ns0WIYYtVN5I7JCTv3tV++1sAgxbyd+ivNI12k7FFXpNWMEucYxXS AHWrb9zYRo9MtXsb4Adl4GKNmWXO2ENq5r/q2ebPesEWPbCvslXpDj+UqwOuXktCmYDn B3dCy5FWpyqo9go6t6BKm55Cd5oXC56TBHRSTqefas7L/u0NPTLuWmNCe2BBsZ9f8/Re XNDvuGRnIBHIx+D+KoHy+mT21l07tuqrGRTWX6Ewznor1gzdtuuF0x0+u0zUOQaHlsBt fUdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=knUCazqI7zdSXmyG+dXyUAX6tOCbDCPV67c1pmGbQpk=; fh=tSEmPjYgBuaNvf0apqAB2s7ZuMNMiThz7PwydKTpe50=; b=o2JYIKzQTJgfxquMABQKozCBIe/W8Y7RbZJK/91RjwwA2KjbvCQ+pWR993cZqBBLDA xSsZzioGCl+IdxOa+cya7G9tgR9SR7HroNoGz3N/cO9UifR2Ful/L5cXF0ghm9E26rv0 u0yqMreEPgK5p8uZCDlaSGTdsDHBQK17hsm4bXS3+jkdOos6s9RDY6KqihXO3Pv5Mi1j wU/a2pCQ1XLOzuMqbDCJEAJwqxyaX4dhiKPSPqQ5rKQnh0gVUMSQcwI96iVwxz/NGDpv Z9mayU2ukClmgD/0Jgic6f3E2ZVCmEr4PYUthxMqsF3xQlUx7fg9gyMDfeBXGmARAv4+ 6kBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hP3ofO+m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id m8-20020a656a08000000b005898d648224si11935462pgu.12.2023.11.10.10.35.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Nov 2023 10:35:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hP3ofO+m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 5561783CB60C; Fri, 10 Nov 2023 10:35:02 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345981AbjKJSeW (ORCPT <rfc822;heyuhang3455@gmail.com> + 29 others); Fri, 10 Nov 2023 13:34:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235542AbjKJSdD (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 10 Nov 2023 13:33:03 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1DCD28B3C for <linux-kernel@vger.kernel.org>; Fri, 10 Nov 2023 02:31:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699612287; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=knUCazqI7zdSXmyG+dXyUAX6tOCbDCPV67c1pmGbQpk=; b=hP3ofO+mc2CSyaIimzKZfvV2v0Y//M5mXBP6ssKGOzTEAGkjq3opGPZ0pNm//0oVcdOihQ zBDCp7rTb6VhTbfH/saR/uDRWvunJH6RhXRcn13WQY1Ll/W/eRNlXYSumf8dspjlW9kbqt D/XjBev01FbDbl0msMND33XsPAWifOk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-306-F5WEz2q1Mhi6Un7UOLexjw-1; Fri, 10 Nov 2023 05:31:23 -0500 X-MC-Unique: F5WEz2q1Mhi6Un7UOLexjw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 809958007B3; Fri, 10 Nov 2023 10:31:23 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id 82C34502B; Fri, 10 Nov 2023 10:31:22 +0000 (UTC) From: Thomas Huth <thuth@redhat.com> To: Geert Uytterhoeven <geert@linux-m68k.org>, linux-m68k@lists.linux-m68k.org Cc: Arnd Bergmann <arnd@arndb.de>, linux-kernel@vger.kernel.org Subject: [RFC PATCH] m68k: Avoid CONFIG_COLDFIRE switch in uapi header Date: Fri, 10 Nov 2023 11:31:20 +0100 Message-ID: <20231110103120.387517-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 10 Nov 2023 10:35:02 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782200742910719821 X-GMAIL-MSGID: 1782203078999294893 |
Series |
[RFC] m68k: Avoid CONFIG_COLDFIRE switch in uapi header
|
|
Commit Message
Thomas Huth
Nov. 10, 2023, 10:31 a.m. UTC
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(-)
Comments
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? Regards Greg
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
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; diff --git a/scripts/headers_install.sh b/scripts/headers_install.sh index c3064ac31003..cdb04c920670 100755 --- a/scripts/headers_install.sh +++ b/scripts/headers_install.sh @@ -75,7 +75,6 @@ arch/arc/include/uapi/asm/page.h:CONFIG_ARC_PAGE_SIZE_4K arch/arc/include/uapi/asm/swab.h:CONFIG_ARC_HAS_SWAPE arch/arm/include/uapi/asm/ptrace.h:CONFIG_CPU_ENDIAN_BE8 arch/hexagon/include/uapi/asm/user.h:CONFIG_HEXAGON_ARCH_VERSION -arch/m68k/include/uapi/asm/ptrace.h:CONFIG_COLDFIRE arch/nios2/include/uapi/asm/swab.h:CONFIG_NIOS2_CI_SWAB_NO arch/nios2/include/uapi/asm/swab.h:CONFIG_NIOS2_CI_SWAB_SUPPORT arch/x86/include/uapi/asm/auxvec.h:CONFIG_IA32_EMULATION