arm64: asm-offsets: clenups
Mark Rutland
reviewercover arm64: asm-offsets: clenups
This series removes a number of unused asm-offsets entries. This is purely a cleanup.
This is arragned as a series of patches rather than one big patch for easier bisection and/or backporting, and so that each removal can be explained independently.
There should be no functional change as a result of this series.
Mark.
Mark Rutland (7):
arm64: asm-offsets: remove TSK_ACTIVE_MM
arm64: asm-offsets: remove VMA_VM_*
arm64: asm-offsets: remove COMPAT_{RT_,SIGFRAME_REGS_OFFSET
arm64: asm-offsets: remove MM_CONTEXT_ID
arm64: asm-offsets: remove VM_EXEC and PAGE_SZ
arm64: asm-offsets: remove DMA_{TO,FROM}_DEVICE
arm64: asm-offsets: remove PREEMPT_DISABLE_OFFSET
arch/arm64/include/asm/assembler.h | 7 ------- arch/arm64/kernel/asm-offsets.c | 24 ------------------------ 2 files changed, 31 deletions(-)
Signature · 1 line
2.30.2
Mark Rutland
reviewerPATCH 1/7 arm64: asm-offsets: remove TSK_ACTIVE_MM
The TSK_ACTIVE_MM definition isn't used anywhere.
Remove it.
--- arch/arm64/kernel/asm-offsets.c | 2 -- 1 file changed, 2 deletions(-)
arch/arm64/kernel/asm-offsets.c +0 -2
@@ -28,8 +28,6 @@int main (void ) { -DEFINE (TSK_ACTIVE_MM , offsetof(struct task_struct , active_mm)); -BLANK (); DEFINE(TSK_TI_CPU, offsetof(struct task_struct, thread_info.cpu)); DEFINE(TSK_TI_FLAGS, offsetof(struct task_struct, thread_info.flags)); DEFINE(TSK_TI_PREEMPT, offsetof(struct task_struct, thread_info.preempt_count));
Signature · 1 line
2.30.2
Mark Rutland
reviewerPATCH 2/7 arm64: asm-offsets: remove VMA_VM_*
In reply to Mark RutlandThe VMA_VM_MM definition is only used by the vma_vm_mm macro, which itself is unused. The VMA_VM_FLAGS definition isn't used anywhere.
Remove them all.
--- arch/arm64/include/asm/assembler.h | 7 ------- arch/arm64/kernel/asm-offsets.c | 3 --- 2 files changed, 10 deletions(-)
arch/arm64/include/asm/assembler.h +0 -7
@@ -248,13 +248,6 @@ alternative_endif ldr \dst, [\dst, \tmp] .endm -/* - * vma_vm_mm - get mm pointer from vma pointer (vma->vm_mm) - */ - .macro vma_vm_mm, rd, rn - ldr \rd, [\rn, #VMA_VM_MM] - .endm -/* * read_ctr - read CTR_EL0. If the system has mismatched register fields, * provide the system wide safe value from arm64_ftr_reg_ctrel0.sys_val
arch/arm64/kernel/asm-offsets.c +0 -3
@@ -104,9 +104,6 @@ int main(void)#endif DEFINE(MM_CONTEXT_ID, offsetof(struct mm_struct, context.id.counter));BLANK (); -DEFINE (VMA_VM_MM , offsetof(struct vm_area_struct , vm_mm)); -DEFINE (VMA_VM_FLAGS , offsetof(struct vm_area_struct , vm_flags)); -BLANK ();DEFINE (VM_EXEC ,VM_EXEC );BLANK ();DEFINE (PAGE_SZ ,PAGE_SIZE );
Signature · 1 line
2.30.2
Mark Rutland
reviewerPATCH 3/7 arm64: asm-offsets: remove COMPAT_{RT_,SIGFRAME_REGS_OFFSET
In reply to Mark RutlandThe COMPAT_SIGFRAME_REGS_OFFSET and COMPAT_RT_SIGFRAME_REGS_OFFSET defintions aren't used anywhere.
They were added in commit:
f14d8025d263f3c8 ("arm64: compat: Generate asm offsets for signals")
... and subsequently their only user was removed in commit:
2d071968a4052e58 ("arm64: compat: Remove 32-bit sigreturn code from the vDSO")
... leaving them unused.
Remove them.
--- arch/arm64/kernel/asm-offsets.c | 6 ------ 1 file changed, 6 deletions(-)
arch/arm64/kernel/asm-offsets.c +0 -6
@@ -20,7 +20,6 @@#include <asm/fixmap.h> #include <asm/thread_info.h> #include <asm/memory.h> -#include <asm/signal32.h> #include <asm/smp_plat.h> #include <asm/suspend.h> #include <linux/kbuild.h>
@@ -96,11 +95,6 @@ int main(void)#endif DEFINE (FREGS_SIZE ,sizeof (struct ftrace_regs ));BLANK (); -#endif -#ifdef CONFIG_COMPAT - DEFINE(COMPAT_SIGFRAME_REGS_OFFSET, offsetof(struct compat_sigframe, uc.uc_mcontext.arm_r0)); - DEFINE(COMPAT_RT_SIGFRAME_REGS_OFFSET, offsetof(struct compat_rt_sigframe, sig.uc.uc_mcontext.arm_r0)); -BLANK ();#endif DEFINE(MM_CONTEXT_ID, offsetof(struct mm_struct, context.id.counter));BLANK ();
Signature · 1 line
2.30.2
Mark Rutland
reviewerPATCH 4/7 arm64: asm-offsets: remove MM_CONTEXT_ID
In reply to Mark RutlandThe only user of the MM_CONTEXT_ID defintion was removed in commit:
25b92693a1b67a47 ("arm64: mm: convert cpu_do_switch_mm() to C")
Remove MM_CONTEXT_ID.
--- arch/arm64/kernel/asm-offsets.c | 2 -- 1 file changed, 2 deletions(-)
arch/arm64/kernel/asm-offsets.c +0 -2
@@ -96,8 +96,6 @@ int main(void)DEFINE (FREGS_SIZE ,sizeof (struct ftrace_regs ));BLANK ();#endif - DEFINE(MM_CONTEXT_ID, offsetof(struct mm_struct, context.id.counter)); -BLANK ();DEFINE (VM_EXEC ,VM_EXEC );BLANK ();DEFINE (PAGE_SZ ,PAGE_SIZE );
Signature · 1 line
2.30.2
Mark Rutland
reviewerPATCH 5/7 arm64: asm-offsets: remove VM_EXEC and PAGE_SZ
In reply to Mark RutlandThe VM_EXEC definition duplicates the common VM_EXEC definition from <linux/mm.h>. The common definition cannot safely be included by assembly code but currently we don't need to use VM_EXEC in assembly.
The PAGE_SZ definition duplicates arm64's definition of PAGE_SIZE from <asm/page-def.h> which can safely be included from assembly code and should be used directly.
Remove the duplicate definitions.
--- arch/arm64/kernel/asm-offsets.c | 4 ---- 1 file changed, 4 deletions(-)
arch/arm64/kernel/asm-offsets.c +0 -4
@@ -96,10 +96,6 @@ int main(void)DEFINE (FREGS_SIZE ,sizeof (struct ftrace_regs ));BLANK ();#endif -DEFINE (VM_EXEC ,VM_EXEC ); -BLANK (); -DEFINE (PAGE_SZ ,PAGE_SIZE ); -BLANK ();DEFINE (DMA_TO_DEVICE ,DMA_TO_DEVICE );DEFINE (DMA_FROM_DEVICE ,DMA_FROM_DEVICE );BLANK ();
Signature · 1 line
2.30.2
Mark Rutland
reviewerPATCH 6/7 arm64: asm-offsets: remove DMA_{TO,FROM}_DEVICE
In reply to Mark RutlandThe DMA_TO_DEVICE and DMA_FROM_DEVICE defintitons in asm-offsets duplicate the common defintions from <linux/dma-direction.h> (which used to live in <linux/dma-mapping.h>), and haven't been used from asseembly code since commit:
7eacf1858bc86fe9 ("arm64: mm: Remove assembly DMA cache maintenance wrappers")
Remove them both.
--- arch/arm64/kernel/asm-offsets.c | 4 ---- 1 file changed, 4 deletions(-)
arch/arm64/kernel/asm-offsets.c +0 -4
@@ -12,7 +12,6 @@#include <linux/ftrace.h> #include <linux/kexec.h> #include <linux/mm.h> -#include <linux/dma-mapping.h> #include <linux/kvm_host.h> #include <linux/preempt.h> #include <linux/suspend.h>
@@ -96,9 +95,6 @@ int main(void)DEFINE (FREGS_SIZE ,sizeof (struct ftrace_regs ));BLANK ();#endif -DEFINE (DMA_TO_DEVICE ,DMA_TO_DEVICE ); -DEFINE (DMA_FROM_DEVICE ,DMA_FROM_DEVICE ); -BLANK ();DEFINE (PREEMPT_DISABLE_OFFSET ,PREEMPT_DISABLE_OFFSET );BLANK ();DEFINE (CPU_BOOT_TASK , offsetof(struct secondary_data , task));
Signature · 1 line
2.30.2
Mark Rutland
reviewerPATCH 7/7 arm64: asm-offsets: remove PREEMPT_DISABLE_OFFSET
In reply to Mark RutlandThe PREEMPT_DISABLE_OFFSET definition was added in commit:
24534b3511828c66 ("arm64: assembler: add macros to conditionally yield the NEON under PREEMPT")
... but hasn't been used since commit:
3931261ecf46151a ("arm64: fpsimd: Bring cond_yield asm macro in line with new rules")
Remove PREEMPT_DISABLE_OFFSET.
--- arch/arm64/kernel/asm-offsets.c | 3 --- 1 file changed, 3 deletions(-)
arch/arm64/kernel/asm-offsets.c +0 -3
@@ -13,7 +13,6 @@#include <linux/kexec.h> #include <linux/mm.h> #include <linux/kvm_host.h> -#include <linux/preempt.h> #include <linux/suspend.h> #include <asm/cpufeature.h> #include <asm/fixmap.h>
@@ -95,8 +94,6 @@ int main(void)DEFINE (FREGS_SIZE ,sizeof (struct ftrace_regs ));BLANK ();#endif -DEFINE (PREEMPT_DISABLE_OFFSET ,PREEMPT_DISABLE_OFFSET ); -BLANK ();DEFINE (CPU_BOOT_TASK , offsetof(struct secondary_data , task));BLANK ();DEFINE (FTR_OVR_VAL_OFFSET , offsetof(struct arm64_ftr_override , val));
Signature · 1 line
2.30.2
Quoted 8 lines · Mark Rutland
This series removes a number of unused asm-offsets entries. This is purely a cleanup.
This is arragned as a series of patches rather than one big patch for easier bisection and/or backporting, and so that each removal can be explained independently.
[...]
Applied to arm64 (for-next/asm-offsets), thanks!
[1/7] arm64: asm-offsets: remove TSK_ACTIVE_MM
https://git.kernel.org/arm64/c/ab23df141f53 [2/7] arm64: asm-offsets: remove VMA_VM_* https://git.kernel.org/arm64/c/7bd8870af8dd [3/7] arm64: asm-offsets: remove COMPAT_{RT_,SIGFRAME_REGS_OFFSET https://git.kernel.org/arm64/c/4c92c121c402 [4/7] arm64: asm-offsets: remove MM_CONTEXT_ID https://git.kernel.org/arm64/c/1abc7c1e5933 [5/7] arm64: asm-offsets: remove VM_EXEC and PAGE_SZ https://git.kernel.org/arm64/c/4ce689b4480a [6/7] arm64: asm-offsets: remove DMA_{TO,FROM}_DEVICE https://git.kernel.org/arm64/c/b129125e1f96 [7/7] arm64: asm-offsets: remove PREEMPT_DISABLE_OFFSET https://git.kernel.org/arm64/c/7bb32dc788dd
Signature · 1 line
Catalin
Quoted 11 lines · Mark Rutland
This series removes a number of unused asm-offsets entries. This is purely a cleanup.
This is arragned as a series of patches rather than one big patch for easier bisection and/or backporting, and so that each removal can be explained independently.
There should be no functional change as a result of this series.
Mark.
Quoted 8 lines
Mark Rutland (7):
arm64: asm-offsets: removeTSK_ACTIVE_MM
arm64: asm-offsets: remove VMA_VM_*
arm64: asm-offsets: remove COMPAT_{RT_,SIGFRAME_REGS_OFFSET
arm64: asm-offsets: removeMM_CONTEXT_ID
arm64: asm-offsets: removeVM_EXECandPAGE_SZ
arm64: asm-offsets: remove DMA_{TO,FROM}_DEVICE
arm64: asm-offsets: removePREEMPT_DISABLE_OFFSET
I see Catalin has already merged these, but for what it's worth, the series looks good to me. And it means I can remove a patch from my boot-time page size series.
Quoted 5 lines
arch/arm64/include/asm/assembler.h | 7 ------- arch/arm64/kernel/asm-offsets.c | 24 ------------------------ 2 files changed, 31 deletions(-)