2023-02-15 10:01:19

by Ard Biesheuvel

[permalink] [raw]
Subject: [RFC PATCH 2/5] kernel: Drop IA64 support from sig_fault handlers

Signed-off-by: Ard Biesheuvel <[email protected]>
---
include/linux/sched/signal.h | 17 ++++---------
kernel/signal.c | 25 ++++----------------
2 files changed, 9 insertions(+), 33 deletions(-)

diff --git a/include/linux/sched/signal.h b/include/linux/sched/signal.h
index 20099268fa257f40..6aecfbf823656f6c 100644
--- a/include/linux/sched/signal.h
+++ b/include/linux/sched/signal.h
@@ -303,20 +303,11 @@ static inline void kernel_signal_stop(void)

schedule();
}
-#ifdef __ia64__
-# define ___ARCH_SI_IA64(_a1, _a2, _a3) , _a1, _a2, _a3
-#else
-# define ___ARCH_SI_IA64(_a1, _a2, _a3)
-#endif

-int force_sig_fault_to_task(int sig, int code, void __user *addr
- ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr)
- , struct task_struct *t);
-int force_sig_fault(int sig, int code, void __user *addr
- ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr));
-int send_sig_fault(int sig, int code, void __user *addr
- ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr)
- , struct task_struct *t);
+int force_sig_fault_to_task(int sig, int code, void __user *addr,
+ struct task_struct *t);
+int force_sig_fault(int sig, int code, void __user *addr);
+int send_sig_fault(int sig, int code, void __user *addr, struct task_struct *t);

int force_sig_mceerr(int code, void __user *, short);
int send_sig_mceerr(int code, void __user *, short, struct task_struct *);
diff --git a/kernel/signal.c b/kernel/signal.c
index ae26da61c4d9fa6a..5b7f0bf2713901da 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -1701,9 +1701,8 @@ void force_sigsegv(int sig)
force_sig(SIGSEGV);
}

-int force_sig_fault_to_task(int sig, int code, void __user *addr
- ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr)
- , struct task_struct *t)
+int force_sig_fault_to_task(int sig, int code, void __user *addr,
+ struct task_struct *t)
{
struct kernel_siginfo info;

@@ -1712,24 +1711,15 @@ int force_sig_fault_to_task(int sig, int code, void __user *addr
info.si_errno = 0;
info.si_code = code;
info.si_addr = addr;
-#ifdef __ia64__
- info.si_imm = imm;
- info.si_flags = flags;
- info.si_isr = isr;
-#endif
return force_sig_info_to_task(&info, t, HANDLER_CURRENT);
}

-int force_sig_fault(int sig, int code, void __user *addr
- ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr))
+int force_sig_fault(int sig, int code, void __user *addr)
{
- return force_sig_fault_to_task(sig, code, addr
- ___ARCH_SI_IA64(imm, flags, isr), current);
+ return force_sig_fault_to_task(sig, code, addr, current);
}

-int send_sig_fault(int sig, int code, void __user *addr
- ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr)
- , struct task_struct *t)
+int send_sig_fault(int sig, int code, void __user *addr, struct task_struct *t)
{
struct kernel_siginfo info;

@@ -1738,11 +1728,6 @@ int send_sig_fault(int sig, int code, void __user *addr
info.si_errno = 0;
info.si_code = code;
info.si_addr = addr;
-#ifdef __ia64__
- info.si_imm = imm;
- info.si_flags = flags;
- info.si_isr = isr;
-#endif
return send_sig_info(info.si_signo, &info, t);
}

--
2.39.1



2023-02-15 10:19:59

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [RFC PATCH 2/5] kernel: Drop IA64 support from sig_fault handlers

On Wed, Feb 15, 2023, at 11:00, Ard Biesheuvel wrote:
> Signed-off-by: Ard Biesheuvel <[email protected]>
> ---
> include/linux/sched/signal.h | 17 ++++---------
> kernel/signal.c | 25 ++++----------------
> 2 files changed, 9 insertions(+), 33 deletions(-)

The patch looks good, but I'd suggest adding a oneline description
referencing that ia64 as a whole is removed.

I see that you created a couple of patches looking for __ia64__
but not CONFIG_IA64. If we get consensus on patch 1, we should
do that as well, let me know if you you want to add those or
would like me to help here.

I can probably do the same recursive check for removed Kconfig
options that I used for finding dead code after the boardfile
removal.

Arnd

2023-02-15 11:15:49

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [RFC PATCH 2/5] kernel: Drop IA64 support from sig_fault handlers

On Wed, Feb 15, 2023, at 11:19, Arnd Bergmann wrote:
>
> I can probably do the same recursive check for removed Kconfig
> options that I used for finding dead code after the boardfile
> removal.

FWIW, here is the list from a bit of scripting. Symbols that
are only defined in arch/ia64 but are referenced elsewhere are:

CONFIG_IA64
CONFIG_IA64_PAGE_SIZE_64KB
CONFIG_IA64_SGI_UV
CONFIG_IA64_DEBUG_CMPXCHG
CONFIG_MSPEC

Kconfig symbols that are only selected in arch/ia64 but
defined elsewhere are

CONFIG_ARCH_HAS_DMA_MARK_CLEAN
CONFIG_ARCH_TASK_STRUCT_ALLOCATOR
CONFIG_ARCH_TASK_STRUCT_ON_STACK
CONFIG_ARCH_THREAD_STACK_ALLOCATOR
CONFIG_GENERIC_IRQ_LEGACY

plus a few that have only one or two other places selecting them:

CONFIG_ARCH_CLOCKSOURCE_DATA (sparc64)
CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC (x86)
CONFIG_ATA_NONSTANDARD (powerpc-maple)
CONFIG_FUNCTION_ALIGNMENT_32B (i386)
CONFIG_HUGETLB_PAGE_SIZE_VARIABLE (powerpc64)
CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT (x86, loongarch)
CONFIG_ARCH_BINFMT_ELF_EXTRA_PHDRS (arm64, arch/um 32-bit)
CONFIG_HAVE_FUNCTION_DESCRIPTORS (ppc64be, parisc64)
CONFIG_HAVE_UNSTABLE_SCHED_CLOCK (parisc, x86)
CONFIG_HAVE_VIRT_CPU_ACCOUNTING (powerpc, s390)
CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN (arc, loongarch)

Arnd

2023-02-15 11:22:31

by Ard Biesheuvel

[permalink] [raw]
Subject: Re: [RFC PATCH 2/5] kernel: Drop IA64 support from sig_fault handlers

On Wed, 15 Feb 2023 at 12:15, Arnd Bergmann <[email protected]> wrote:
>
> On Wed, Feb 15, 2023, at 11:19, Arnd Bergmann wrote:
> >
> > I can probably do the same recursive check for removed Kconfig
> > options that I used for finding dead code after the boardfile
> > removal.
>
> FWIW, here is the list from a bit of scripting.

Thanks

> Symbols that
> are only defined in arch/ia64 but are referenced elsewhere are:
>
> CONFIG_IA64
> CONFIG_IA64_PAGE_SIZE_64KB
> CONFIG_IA64_SGI_UV
> CONFIG_IA64_DEBUG_CMPXCHG
> CONFIG_MSPEC

These are all gone from the code after applying this series.

> Kconfig symbols that are only selected in arch/ia64 but
> defined elsewhere are
>
> CONFIG_ARCH_HAS_DMA_MARK_CLEAN
> CONFIG_ARCH_TASK_STRUCT_ALLOCATOR
> CONFIG_ARCH_TASK_STRUCT_ON_STACK
> CONFIG_ARCH_THREAD_STACK_ALLOCATOR
> CONFIG_GENERIC_IRQ_LEGACY
>

I can follow up with patches that remove all of those as well once we
progress on this series.

> plus a few that have only one or two other places selecting them:
>
> CONFIG_ARCH_CLOCKSOURCE_DATA (sparc64)
> CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC (x86)
> CONFIG_ATA_NONSTANDARD (powerpc-maple)
> CONFIG_FUNCTION_ALIGNMENT_32B (i386)
> CONFIG_HUGETLB_PAGE_SIZE_VARIABLE (powerpc64)
> CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT (x86, loongarch)
> CONFIG_ARCH_BINFMT_ELF_EXTRA_PHDRS (arm64, arch/um 32-bit)
> CONFIG_HAVE_FUNCTION_DESCRIPTORS (ppc64be, parisc64)
> CONFIG_HAVE_UNSTABLE_SCHED_CLOCK (parisc, x86)
> CONFIG_HAVE_VIRT_CPU_ACCOUNTING (powerpc, s390)
> CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN (arc, loongarch)
>
> Arnd

2023-02-15 12:47:10

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [RFC PATCH 2/5] kernel: Drop IA64 support from sig_fault handlers

On Wed, Feb 15, 2023, at 12:22, Ard Biesheuvel wrote:
> On Wed, 15 Feb 2023 at 12:15, Arnd Bergmann <[email protected]> wrote:
>>
>> CONFIG_IA64
>> CONFIG_IA64_PAGE_SIZE_64KB
>> CONFIG_IA64_SGI_UV
>> CONFIG_IA64_DEBUG_CMPXCHG
>> CONFIG_MSPEC
>
> These are all gone from the code after applying this series.

Ok, got it. I missed that the first patch also removes
bits outside of arch/ia64.

Arnd