Commit 942fa985 authored by Yury Norov's avatar Yury Norov Committed by Arnd Bergmann
Browse files

32-bit userspace ABI: introduce ARCH_32BIT_OFF_T config option



All new 32-bit architectures should have 64-bit userspace off_t type, but
existing architectures has 32-bit ones.

To enforce the rule, new config option is added to arch/Kconfig that defaults
ARCH_32BIT_OFF_T to be disabled for new 32-bit architectures. All existing
32-bit architectures enable it explicitly.

New option affects force_o_largefile() behaviour. Namely, if userspace
off_t is 64-bits long, we have no reason to reject user to open big files.

Note that even if architectures has only 64-bit off_t in the kernel
(arc, c6x, h8300, hexagon, nios2, openrisc, and unicore32),
a libc may use 32-bit off_t, and therefore want to limit the file size
to 4GB unless specified differently in the open flags.

Signed-off-by: default avatarYury Norov <ynorov@caviumnetworks.com>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarYury Norov <ynorov@marvell.com>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 0d0216c0
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -276,6 +276,16 @@ config ARCH_THREAD_STACK_ALLOCATOR
config ARCH_WANTS_DYNAMIC_TASK_STRUCT
	bool

config ARCH_32BIT_OFF_T
	bool
	depends on !64BIT
	help
	  All new 32-bit architectures should have 64-bit off_t type on
	  userspace side which corresponds to the loff_t kernel type. This
	  is the requirement for modern ABIs. Some existing architectures
	  still support 32-bit off_t. This option is enabled for all such
	  architectures explicitly.

config HAVE_REGS_AND_STACK_ACCESS_API
	bool
	help
+1 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ config ARC
	select ARCH_HAS_SYNC_DMA_FOR_CPU
	select ARCH_HAS_SYNC_DMA_FOR_DEVICE
	select ARCH_SUPPORTS_ATOMIC_RMW if ARC_HAS_LLSC
	select ARCH_32BIT_OFF_T
	select BUILDTIME_EXTABLE_SORT
	select CLONE_BACKWARDS
	select COMMON_CLK
+1 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
config ARM
	bool
	default y
	select ARCH_32BIT_OFF_T
	select ARCH_CLOCKSOURCE_DATA
	select ARCH_DISCARD_MEMBLOCK if !HAVE_ARCH_PFN_VALID && !KEXEC
	select ARCH_HAS_DEBUG_VIRTUAL if MMU
+1 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@

config C6X
	def_bool y
	select ARCH_32BIT_OFF_T
	select ARCH_HAS_SYNC_DMA_FOR_CPU
	select ARCH_HAS_SYNC_DMA_FOR_DEVICE
	select CLKDEV_LOOKUP
+1 −0
Original line number Diff line number Diff line
config CSKY
	def_bool y
	select ARCH_32BIT_OFF_T
	select ARCH_HAS_SYNC_DMA_FOR_CPU
	select ARCH_HAS_SYNC_DMA_FOR_DEVICE
	select ARCH_USE_BUILTIN_BSWAP
Loading