Skip to contentSkip to conversation

Making allyesconfig work

DISCUSSION Russell King - ARM Linux 3 participants 6 messages Jan 20, 2012 – Jan 25, 2012 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

Presently, allyesconfig fails to get anywhere near building on ARM, which is caused mainly by a Kconfig problem.

The problem is XIP_KERNEL gets enabled, which turns off ARM_PATCH_PHYS_VIRT, and then we have Kconfig wanting a value for PHYS_OFFSET. Because 'y' doesn't suit this, Kconfig leaves this blank.

The result is that make allyesconfig produces an invalid configuration file, which fails on building - killing off the build before we've even compiled any of the kernel .c files.

One solution to this would be:

config __ALLYESCONFIG
bool "If you enable me, your personal universe will implode" help
Never enable this option. This option is here to detect 'make allyesconfig' and allow certain options to be disabled. Saying 'y' here yourself will result in those options being hidden from you, which is probably not what you want.

and then we can have:

config XIP_KERNEL
bool "Kernel Execute-In-Place from ROM" depends on !ZBOOT_ROM && !ARM_LPAE && !__ALLYESCONFIG

Once this is done, then we can actually get to a point where we can start building the kernel. The good news is that most of the kernel builds relatively cleanly, although there are the expected warnings about virt_to_bus(), bus_to_virt().

However, it seems we're exporting a few constants which don't have a good namespace - one of those is fixed by a patches I posted earlier today to avoid exporting the CR_* constants to the entire kernel build. CR_* is not a good namespace to be visible to drivers and the like, so these definitions have been moved to a private ARM header.

There's also the troublesome T() macro, which conflicts with a bunch of other drivers. (I've added Catalin to the To: line for this reason.)

I won't post the entire build log - it comes in around 430K which is much too large for these lists. Instead, below are the errors and warnings from the build.

Below are the errors from a fresh allyesconfig build:

drivers/input/touchscreen/eeti_ts.c:65: error: implicit declaration of function 'irq_to_gpio' drivers/mfd/ezx-pcap.c:205: error: implicit declaration of function 'irq_to_gpio' drivers/net/ethernet/faraday/ftgmac100.c:983: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ftgmac100_interrupt' drivers/net/ethernet/faraday/ftgmac100.c:1085: error: implicit declaration of function 'request_irq' drivers/net/ethernet/faraday/ftgmac100.c:1085: error: 'ftgmac100_interrupt' undeclared (first use in this function) drivers/net/ethernet/faraday/ftgmac100.c:1085: error: (Each undeclared identifier is reported only once drivers/net/ethernet/faraday/ftgmac100.c:1085: error: for each function it appears in.) drivers/net/ethernet/faraday/ftgmac100.c:1113: error: implicit declaration of function 'free_irq' drivers/net/ethernet/faraday/ftmac100.c:859: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ftmac100_interrupt' drivers/net/ethernet/faraday/ftmac100.c:964: error: implicit declaration of function 'request_irq' drivers/net/ethernet/faraday/ftmac100.c:964: error: 'ftmac100_interrupt' undeclared (first use in this function) drivers/net/ethernet/faraday/ftmac100.c:964: error: (Each undeclared identifier is reported only once drivers/net/ethernet/faraday/ftmac100.c:964: error: for each function it appears in.) drivers/net/ethernet/faraday/ftmac100.c:987: error: implicit declaration of function 'free_irq' drivers/net/ethernet/stmicro/stmmac/mmc_core.c:142: error: implicit declaration of function 'pr_debug' drivers/scsi/advansys.c:8376: error: implicit declaration of function 'dma_cache_sync' drivers/staging/iio/accel/lis3l02dq_core.c:702: error: implicit declaration of function 'irq_to_gpio' drivers/staging/iio/accel/lis3l02dq_ring.c:295: error: implicit declaration of function 'irq_to_gpio'

which shows mostly its irq_to_gpio, and three drivers with missing include files.

The warnings are (with virt_to_bus/bus_to_virt omitted):

arch/arm/kernel/return_address.c:62:2: warning: #warning "TODO: return_address should use unwind tables" arch/arm/kernel/return_address.c:62:2: warning: #warning "TODO: return_address should use unwind tables" kernel/debug/kdb/kdb_support.c:639: warning: passing argument 1 of 'is_idle_task' discards qualifiers from pointer target type kernel/sched/fair.c:419: warning: 'account_cfs_rq_runtime' declared inline after being called
kernel/sched/fair.c:419: warning: previous declaration of 'account_cfs_rq_runtime' was here
kernel/sched/fair.c:1178: warning: 'return_cfs_rq_runtime' declared inline after being called
kernel/sched/fair.c:1178: warning: previous declaration of 'return_cfs_rq_runtime' was here
kernel/trace/trace.c:3697: warning: 'page2' may be used uninitialized in this function
mm/memcontrol.c:381: warning: 'mem_cgroup_is_root' declared inline after being called
mm/memcontrol.c:381: warning: previous declaration of 'mem_cgroup_is_root' was here
fs/btrfs/backref.c:419: warning: 'ret' may be used uninitialized in this function
fs/nfs/callback_proc.c:116: warning: 'ino' may be used uninitialized in this function
fs/nfs/callback_proc.c:115: warning: 'lo' may be used uninitialized in this function
include/asm-generic/xor.h:696: warning: 'xor_block_8regs_p' defined but not usedinclude/asm-generic/xor.h:704: warning: 'xor_block_32regs_p' defined but not used drivers/dma/pl330.c:859: warning: comparison of distinct pointer types lacks a cast
drivers/gpu/drm/drm_edid.c:1341: warning: array subscript is above array bounds
drivers/gpu/drm/drm_edid.c:1341: warning: array subscript is above array bounds
drivers/gpu/drm/drm_edid.c:1341: warning: array subscript is above array bounds
drivers/gpu/drm/drm_edid.c:1341: warning: array subscript is above array bounds
drivers/gpu/drm/drm_edid.c:1341: warning: array subscript is above array bounds
drivers/gpu/drm/nouveau/nv50_display.c:618: warning: 'mc' may be used uninitialized in this function drivers/infiniband/hw/mlx4/qp.c:1366: warning: 'vlan' may be used uninitialized in this function
drivers/input/joystick/analog.c:175:2: warning: #warning Precise timer not defined for this architecture. drivers/isdn/hardware/mISDN/hfcpci.c:2319: warning: ignoring return value of 'driver_for_each_device', declared with attribute warn_unused_result drivers/isdn/hardware/mISDN/w6692.c:1189: warning: unsupported argument to '__builtin_return_address' drivers/isdn/hardware/mISDN/mISDNipac.c:755: warning: unsupported argument to '__builtin_return_address' drivers/leds/leds-lp5521.c:648: warning: 'ret' may be used uninitialized in this function
drivers/leds/leds-lp5521.c:649: warning: 'buf' may be used uninitialized in this function
drivers/leds/leds-lp5521.c:197: warning: 'mode' may be used uninitialized in this function
drivers/leds/leds-lp5523.c:443: warning: 'vdd' may be used uninitialized in this function
drivers/leds/leds-lp5523.c:443: warning: 'adc' may be used uninitialized in this function
drivers/leds/leds-lp5523.c:196: warning: 'status' may be used uninitialized in this function
drivers/media/dvb/pt1/pt1.c:395: warning: 'addr' may be used uninitialized in this function
drivers/media/dvb/pt1/pt1.c:397: warning: 'buf_pfn' may be used uninitialized in this function
drivers/media/rc/redrat3.c:1100: warning: assignment from incompatible pointer type
drivers/media/video/em28xx/em28xx-core.c:1116: warning: 'packet_size' may be used uninitialized in this function drivers/mmc/card/block.c:794: warning: 'arg' may be used uninitialized in this function
drivers/mmc/card/block.c:794: warning: 'nr' may be used uninitialized in this function
drivers/mmc/card/block.c:794: warning: 'from' may be used uninitialized in this function
drivers/mtd/devices/doc2000.c:874: warning: value computed is not used
drivers/mtd/devices/doc2000.c:1043: warning: value computed is not used
drivers/mtd/devices/doc2000.c:1068: warning: value computed is not used
drivers/mtd/devices/doc2000.c:1143: warning: value computed is not used
drivers/mtd/devices/doc2001plus.c:634: warning: value computed is not used
drivers/mtd/devices/doc2001plus.c:635: warning: value computed is not used
drivers/mtd/devices/doc2001plus.c:891: warning: value computed is not used
drivers/mtd/devices/doc2001plus.c:892: warning: value computed is not used
drivers/mtd/devices/docg3.c:753: warning: 'doc_get_erase_count' defined but not used
drivers/mtd/devices/docprobe.c:74:2: warning: #warning Unknown architecture for DiskOnChip. No default probe locations defined drivers/mtd/devices/docprobe.c:138: warning: value computed is not used
drivers/mtd/devices/docprobe.c:139: warning: value computed is not used
drivers/mtd/devices/docprobe.c:158: warning: value computed is not used
drivers/mtd/devices/slram.c:52:1: warning: "T" redefined
arch/arm/include/asm/domain.h:86:1: warning: this is the location of the previous definition
drivers/mtd/devices/sst25l.c:381: warning: unused variable 'i'
drivers/mtd/nand/diskonchip.c:57:2: warning: #warning Unknown architecture for DiskOnChip. No default probe locations defined drivers/mtd/nand/diskonchip.c:318: warning: value computed is not used
drivers/mtd/nand/diskonchip.c:494: warning: value computed is not used
drivers/mtd/nand/diskonchip.c:520: warning: value computed is not used
drivers/mtd/nand/diskonchip.c:537: warning: value computed is not used
drivers/mtd/nand/diskonchip.c:541: warning: value computed is not used
drivers/mtd/nand/diskonchip.c:556: warning: value computed is not used
drivers/mtd/nand/diskonchip.c:557: warning: value computed is not used
drivers/mtd/nand/diskonchip.c:593: warning: value computed is not used
drivers/mtd/nand/diskonchip.c:594: warning: value computed is not used
drivers/mtd/nand/diskonchip.c:624: warning: value computed is not used
drivers/mtd/nand/diskonchip.c:625: warning: value computed is not used
drivers/mtd/nand/diskonchip.c:629: warning: value computed is not used
drivers/mtd/nand/diskonchip.c:630: warning: value computed is not used
drivers/mtd/nand/diskonchip.c:1454: warning: value computed is not used
drivers/mtd/nand/diskonchip.c:1455: warning: value computed is not used
drivers/mtd/nand/diskonchip.c:1456: warning: value computed is not used
drivers/mtd/nand/diskonchip.c:1547: warning: value computed is not used
drivers/net/ethernet/amd/nmclan_cs.c:626: warning: 'pcmcia_request_exclusive_irq' is deprecated (declared at include/pcmcia/ds.h:203) drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c:2784: warning: comparison of distinct pointer types lacks a cast drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c:1530: warning: comparison of distinct pointer types lacks a cast drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c:1614:1: warning: "T" redefined
arch/arm/include/asm/domain.h:86:1: warning: this is the location of the previous definition drivers/net/ethernet/dec/tulip/winbond-840.c:914:2: warning: #warning Processor architecture undefined drivers/net/ethernet/marvell/sky2.c:1762: warning: 'imask' may be used uninitialized in this function drivers/net/ethernet/neterion/vxge/vxge-main.c:2117: warning: 'adaptive_coalesce_tx_interrupts' defined but not used drivers/net/ethernet/neterion/vxge/vxge-main.c:2145: warning: 'adaptive_coalesce_rx_interrupts' defined but not used drivers/net/ethernet/via/via-velocity.c:3062: warning: array subscript is above array bounds drivers/net/ethernet/via/via-velocity.c:3064: warning: array subscript is above array bounds drivers/net/ethernet/via/via-velocity.c:3074: warning: array subscript is above array bounds
drivers/net/tokenring/ibmtr_cs.c:195: warning: 'pcmcia_request_exclusive_irq' is deprecated (declared at include/pcmcia/ds.h:203) drivers/net/wireless/ath/ath6kl/sdio.c:330: warning: 'sg_sz' may be used uninitialized in this function drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c:346: warning: 'wsec' may be used uninitialized in this function drivers/net/wireless/brcm80211/brcmsmac/aiutils.c:1159: warning: 'val' may be used uninitialized in this function drivers/net/wireless/rt2x00/rt2800lib.c:1291: warning: 'gf40_mode' may be used uninitialized in this function drivers/net/wireless/rt2x00/rt2800lib.c:1291: warning: 'gf20_mode' may be used uninitialized in this function drivers/net/wireless/rt2x00/rt2800lib.c:1291: warning: 'mm40_mode' may be used uninitialized in this function drivers/net/wireless/rt2x00/rt2800lib.c:1291: warning: 'mm20_mode' may be used uninitialized in this function drivers/net/wireless/rtlwifi/rtl8192de/trx.c:124: warning: 'rx_pwr_all' may be used uninitialized in this function drivers/rtc/rtc-m41t80.c:217: warning: 'm41t80_rtc_alarm_irq_enable' defined but not used
drivers/rtc/rtc-m41t80.c:239: warning: 'm41t80_rtc_set_alarm' defined but not used
drivers/rtc/rtc-m41t80.c:309: warning: 'm41t80_rtc_read_alarm' defined but not used
drivers/scsi/aic94xx/aic94xx_sds.c:985: warning: 'offs' may be used uninitialized in this function
drivers/scsi/lpfc/lpfc_scsi.c:1307: warning: integer constant is too large for 'long' type
drivers/scsi/lpfc/lpfc_scsi.c:1333: warning: integer constant is too large for 'long' type
drivers/scsi/lpfc/lpfc_scsi.c:1344: warning: integer constant is too large for 'long' type
drivers/scsi/lpfc/lpfc_scsi.c:1367: warning: integer constant is too large for 'long' type
drivers/scsi/lpfc/lpfc_scsi.c:1378: warning: integer constant is too large for 'long' type
drivers/scsi/lpfc/lpfc_scsi.c:1412: warning: integer constant is too large for 'long' type
drivers/scsi/lpfc/lpfc_scsi.c:1434: warning: integer constant is too large for 'long' type
drivers/scsi/lpfc/lpfc_debugfs.c:3892: warning: integer constant is too large for 'long' type
drivers/scsi/advansys.c:72:2: warning: #warning this driver is still not properly converted to the DMA API
drivers/scsi/dpt_i2o.c:183: warning: 'dptids' defined but not used
drivers/scsi/ips.c:210:2: warning: #warning "This driver has only been tested on the x86/ia64/x86_64 platforms" drivers/scsi/fdomain.c:1775: warning: 'fdomain_pci_tbl' defined but not used
drivers/scsi/initio.c:131: warning: 'i91u_pci_devices' defined but not used
drivers/staging/iio/gyro/adis16080_core.c:85: warning: 'ut' may be used uninitialized in this function drivers/staging/iio/light/isl29018.c:297: warning: 'new_adc_bit' may be used uninitialized in this function drivers/staging/iio/light/isl29018.c:255: warning: 'new_range' may be used uninitialized in this function drivers/staging/media/dt3155v4l/dt3155v4l.c:307: warning: initialization from incompatible pointer type drivers/staging/media/dt3155v4l/dt3155v4l.c:311: warning: initialization from incompatible pointer type
include/linux/jhash.h:90: warning: array subscript is above array bounds
include/linux/jhash.h:91: warning: array subscript is above array bounds
include/linux/jhash.h:92: warning: array subscript is above array bounds
include/linux/jhash.h:93: warning: array subscript is above array bounds
include/linux/jhash.h:94: warning: array subscript is above array bounds
include/linux/jhash.h:95: warning: array subscript is above array bounds
include/linux/jhash.h:96: warning: array subscript is above array bounds
include/linux/jhash.h:97: warning: array subscript is above array bounds
drivers/staging/rtl8712/rtl8712_recv.c:752: warning: 'rx_pwr_all' may be used uninitialized in this function drivers/staging/usbip/usbip_common.c:796: warning: 'ret' may be used uninitialized in this function drivers/staging/wlan-ng/cfg80211.c:404: warning: ignoring return value of 'cfg80211_inform_bss', declared with attribute warn_unused_result drivers/tty/serial/ifx6x60.c:609: warning: 'more' may be used uninitialized in this function
drivers/usb/host/xhci-ring.c:1253: warning: 'hcd' may be used uninitialized in this function
drivers/usb/musb/musb_gadget.c:1087: warning: 'double_buffer_not_ok' is deprecated (declared at drivers/usb/musb/musb_core.h:450) drivers/usb/musb/musb_gadget.c:1127: warning: 'double_buffer_not_ok' is deprecated (declared at drivers/usb/musb/musb_core.h:450) drivers/usb/musb/musb_host.c:599: warning: 'double_buffer_not_ok' is deprecated (declared at drivers/usb/musb/musb_core.h:450) drivers/usb/musb/musb_host.c:774: warning: 'double_buffer_not_ok' is deprecated (declared at drivers/usb/musb/musb_core.h:450) drivers/usb/otg/ab8500-usb.c:156: warning: 'event' may be used uninitialized in this function
drivers/video/aty/atyfb_base.c:169: warning: array subscript is above array bounds
drivers/video/aty/atyfb_base.c:154: warning: array subscript is above array bounds
drivers/video/aty/radeon_pm.c:1719: warning: 'radeon_reinitialize_M10' defined but not used
sound/soc/codecs/wm_hubs.c:120: warning: 'reg_r' may be used uninitialized in this function
sound/soc/codecs/wm_hubs.c:120: warning: 'reg_l' may be used uninitialized in this function
sound/soc/codecs/wm8994.c:58: warning: unused variable 'wm8994'
sound/soc/codecs/wm8996.c:1661: warning: 'bclk_reg' may be used uninitialized in this function
net/bluetooth/rfcomm/tty.c:218: warning: 'p' may be used uninitialized in this function
net/ceph/ceph_fs.c:33: warning: 'mode' may be used uninitialized in this function
include/net/netfilter/xt_log.h:50: warning: value computed is not used
include/net/netfilter/xt_log.h:50: warning: value computed is not used

The biggest one in there that I think we need to be concerned about is the T() thing, which really needs to change to something more suitable or move to a private header file which isn't exposed to the entire kernel build.

#1 lore raw
Quoted 3 lines · Russell King - ARM Linux

There's also the troublesome T() macro, which conflicts with a bunch of other drivers. (I've added Catalin to the To: line for this reason.)

This macro is used in asm/uaccess.h and asm/futex.h, so I think it would be difficult to hide it completely. But I'm happy to rename it to something else (IIRC, T stands for "Translated").

Signature · 1 line
Catalin
#2 lore raw
Quoted 8 lines · Catalin Marinas
Quoted 3 lines · Russell King - ARM Linux

There's also the troublesome T() macro, which conflicts with a bunch of other drivers. (I've added Catalin to the To: line for this reason.)

This macro is used in asm/uaccess.h and asm/futex.h, so I think it would be difficult to hide it completely. But I'm happy to rename it to something else (IIRC, T stands for "Translated").

We should do something, because T() is just too risky for causing these kinds of conflicts. We're not going to be able to get the driver code changed for this. People will rightfully object - and it was something originally spotted by Al Viro in November... allegedly rude works were muttered (not publically) over it!

#3 lore raw
Quoted 6 lines · Russell King - ARM Linux
Quoted 5 lines · Catalin Marinas
Quoted 3 lines · Russell King - ARM Linux

There's also the troublesome T() macro, which conflicts with a bunch of other drivers. (I've added Catalin to the To: line for this reason.)

Quoted 6 lines
Quoted 3 lines

This macro is used in asm/uaccess.h and asm/futex.h, so I think it would be difficult to hide it completely. But I'm happy to rename it to something else (IIRC, T stands for "Translated").

We should do something, because T() is just too risky for causing these kinds of conflicts.

Here's a patch. For lack of inspiration, I called it TUSER (and grep'ed the kernel, there isn't other reference to such name).

ARM: Rename the T() macro to TUSER() to avoid namespace conflicts

From: Catalin Marinas <[email protected]>

This macro is used to generate unprivileged accesses (LDRT/STRT) to user space.

---
 arch/arm/include/asm/assembler.h |    4 +-
 arch/arm/include/asm/domain.h    |    8 ++--
 arch/arm/include/asm/futex.h     |    8 ++--
 arch/arm/include/asm/uaccess.h   |   16 ++++---
 arch/arm/lib/getuser.S           |   12 +++---
 arch/arm/lib/putuser.S           |   28 ++++++-------
 arch/arm/lib/uaccess.S           |   82 +++++++++++++++++++-------------------
 7 files changed, 79 insertions(+), 79 deletions(-)
arch/arm/include/asm/assembler.h +2 -2
index b6e65de..62f8095 100644
@@ -237,7 +237,7 @@
  */
 #ifdef CONFIG_THUMB2_KERNEL
 
-	.macro	usraccoff, instr, reg, ptr, inc, off, cond, abort, t=T()
+	.macro	usraccoff, instr, reg, ptr, inc, off, cond, abort, t=TUSER()
 9999:
 	.if	\inc == 1
 	\instr\cond\()b\()\t\().w \reg, [\ptr, #\off]
@@ -277,7 +277,7 @@
 
 #else	/* !CONFIG_THUMB2_KERNEL */
 
-	.macro	usracc, instr, reg, ptr, inc, cond, rept, abort, t=T()
+	.macro	usracc, instr, reg, ptr, inc, cond, rept, abort, t=TUSER()
 	.rept	\rept
 9999:
 	.if	\inc == 1
arch/arm/include/asm/domain.h +4 -4
index af18cea..b5dc173 100644
@@ -83,9 +83,9 @@
  * instructions (inline assembly)
  */
 #ifdef CONFIG_CPU_USE_DOMAINS
-#define T(instr)	#instr "t"
+#define TUSER(instr)	#instr "t"
 #else
-#define T(instr)	#instr
+#define TUSER(instr)	#instr
 #endif
 
 #else /* __ASSEMBLY__ */
@@ -95,9 +95,9 @@
  * instructions
  */
 #ifdef CONFIG_CPU_USE_DOMAINS
-#define T(instr)	instr ## t
+#define TUSER(instr)	instr ## t
 #else
-#define T(instr)	instr
+#define TUSER(instr)	instr
 #endif
 
 #endif /* __ASSEMBLY__ */
arch/arm/include/asm/futex.h +4 -4
index 253cc86..7be5469 100644
@@ -75,9 +75,9 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
 
 #define __futex_atomic_op(insn, ret, oldval, tmp, uaddr, oparg)	\
 	__asm__ __volatile__(					\
-	"1:	" T(ldr) "	%1, [%3]\n"			\
+	"1:	" TUSER(ldr) "	%1, [%3]\n"			\
 	"	" insn "\n"					\
-	"2:	" T(str) "	%0, [%3]\n"			\
+	"2:	" TUSER(str) "	%0, [%3]\n"			\
 	"	mov	%0, #0\n"				\
 	__futex_atomic_ex_table("%5")				\
 	: "=&r" (ret), "=&r" (oldval), "=&r" (tmp)		\
@@ -95,10 +95,10 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
 		return -EFAULT;
 
 	__asm__ __volatile__("@futex_atomic_cmpxchg_inatomic\n"
-	"1:	" T(ldr) "	%1, [%4]\n"
+	"1:	" TUSER(ldr) "	%1, [%4]\n"
 	"	teq	%1, %2\n"
 	"	it	eq	@ explicit IT needed for the 2b label\n"
-	"2:	" T(streq) "	%3, [%4]\n"
+	"2:	" TUSER(streq) "	%3, [%4]\n"
 	__futex_atomic_ex_table("%5")
 	: "+r" (ret), "=&r" (val)
 	: "r" (oldval), "r" (newval), "r" (uaddr), "Ir" (-EFAULT)
arch/arm/include/asm/uaccess.h +8 -8
index b293616..2958976 100644
@@ -227,7 +227,7 @@ do {									\
 
 #define __get_user_asm_byte(x,addr,err)				\
 	__asm__ __volatile__(					\
-	"1:	" T(ldrb) "	%1,[%2],#0\n"			\
+	"1:	" TUSER(ldrb) "	%1,[%2],#0\n"			\
 	"2:\n"							\
 	"	.pushsection .fixup,\"ax\"\n"			\
 	"	.align	2\n"					\
@@ -263,7 +263,7 @@ do {									\
 
 #define __get_user_asm_word(x,addr,err)				\
 	__asm__ __volatile__(					\
-	"1:	" T(ldr) "	%1,[%2],#0\n"			\
+	"1:	" TUSER(ldr) "	%1,[%2],#0\n"			\
 	"2:\n"							\
 	"	.pushsection .fixup,\"ax\"\n"			\
 	"	.align	2\n"					\
@@ -308,7 +308,7 @@ do {									\
 
 #define __put_user_asm_byte(x,__pu_addr,err)			\
 	__asm__ __volatile__(					\
-	"1:	" T(strb) "	%1,[%2],#0\n"			\
+	"1:	" TUSER(strb) "	%1,[%2],#0\n"			\
 	"2:\n"							\
 	"	.pushsection .fixup,\"ax\"\n"			\
 	"	.align	2\n"					\
@@ -341,7 +341,7 @@ do {									\
 
 #define __put_user_asm_word(x,__pu_addr,err)			\
 	__asm__ __volatile__(					\
-	"1:	" T(str) "	%1,[%2],#0\n"			\
+	"1:	" TUSER(str) "	%1,[%2],#0\n"			\
 	"2:\n"							\
 	"	.pushsection .fixup,\"ax\"\n"			\
 	"	.align	2\n"					\
@@ -366,10 +366,10 @@ do {									\
 
 #define __put_user_asm_dword(x,__pu_addr,err)			\
 	__asm__ __volatile__(					\
- ARM(	"1:	" T(str) "	" __reg_oper1 ", [%1], #4\n"	)	\
- ARM(	"2:	" T(str) "	" __reg_oper0 ", [%1]\n"	)	\
- THUMB(	"1:	" T(str) "	" __reg_oper1 ", [%1]\n"	)	\
- THUMB(	"2:	" T(str) "	" __reg_oper0 ", [%1, #4]\n"	)	\
+ ARM(	"1:	" TUSER(str) "	" __reg_oper1 ", [%1], #4\n"	) \
+ ARM(	"2:	" TUSER(str) "	" __reg_oper0 ", [%1]\n"	) \
+ THUMB(	"1:	" TUSER(str) "	" __reg_oper1 ", [%1]\n"	) \
+ THUMB(	"2:	" TUSER(str) "	" __reg_oper0 ", [%1, #4]\n"	) \
 	"3:\n"							\
 	"	.pushsection .fixup,\"ax\"\n"			\
 	"	.align	2\n"					\
arch/arm/lib/getuser.S +6 -6
index 1b049cd..11093a7 100644
@@ -31,18 +31,18 @@
 #include <asm/domain.h>
 
 ENTRY(__get_user_1)
-1:	T(ldrb)	r2, [r0]
+1: TUSER(ldrb)	r2, [r0]
 	mov	r0, #0
 	mov	pc, lr
 ENDPROC(__get_user_1)
 
 ENTRY(__get_user_2)
 #ifdef CONFIG_THUMB2_KERNEL
-2:	T(ldrb)	r2, [r0]
-3:	T(ldrb)	r3, [r0, #1]
+2: TUSER(ldrb)	r2, [r0]
+3: TUSER(ldrb)	r3, [r0, #1]
 #else
-2:	T(ldrb)	r2, [r0], #1
-3:	T(ldrb)	r3, [r0]
+2: TUSER(ldrb)	r2, [r0], #1
+3: TUSER(ldrb)	r3, [r0]
 #endif
 #ifndef __ARMEB__
 	orr	r2, r2, r3, lsl #8
@@ -54,7 +54,7 @@ ENTRY(__get_user_2)
 ENDPROC(__get_user_2)
 
 ENTRY(__get_user_4)
-4:	T(ldr)	r2, [r0]
+4: TUSER(ldr)	r2, [r0]
 	mov	r0, #0
 	mov	pc, lr
 ENDPROC(__get_user_4)
arch/arm/lib/putuser.S +14 -14
index c023fc1..7db2599 100644
@@ -31,7 +31,7 @@
 #include <asm/domain.h>
 
 ENTRY(__put_user_1)
-1:	T(strb)	r2, [r0]
+1: TUSER(strb)	r2, [r0]
 	mov	r0, #0
 	mov	pc, lr
 ENDPROC(__put_user_1)
@@ -40,19 +40,19 @@ ENTRY(__put_user_2)
 	mov	ip, r2, lsr #8
 #ifdef CONFIG_THUMB2_KERNEL
 #ifndef __ARMEB__
-2:	T(strb)	r2, [r0]
-3:	T(strb)	ip, [r0, #1]
+2: TUSER(strb)	r2, [r0]
+3: TUSER(strb)	ip, [r0, #1]
 #else
-2:	T(strb)	ip, [r0]
-3:	T(strb)	r2, [r0, #1]
+2: TUSER(strb)	ip, [r0]
+3: TUSER(strb)	r2, [r0, #1]
 #endif
 #else	/* !CONFIG_THUMB2_KERNEL */
 #ifndef __ARMEB__
-2:	T(strb)	r2, [r0], #1
-3:	T(strb)	ip, [r0]
+2: TUSER(strb)	r2, [r0], #1
+3: TUSER(strb)	ip, [r0]
 #else
-2:	T(strb)	ip, [r0], #1
-3:	T(strb)	r2, [r0]
+2: TUSER(strb)	ip, [r0], #1
+3: TUSER(strb)	r2, [r0]
 #endif
 #endif	/* CONFIG_THUMB2_KERNEL */
 	mov	r0, #0
@@ -60,18 +60,18 @@ ENTRY(__put_user_2)
 ENDPROC(__put_user_2)
 
 ENTRY(__put_user_4)
-4:	T(str)	r2, [r0]
+4: TUSER(str)	r2, [r0]
 	mov	r0, #0
 	mov	pc, lr
 ENDPROC(__put_user_4)
 
 ENTRY(__put_user_8)
 #ifdef CONFIG_THUMB2_KERNEL
-5:	T(str)	r2, [r0]
-6:	T(str)	r3, [r0, #4]
+5: TUSER(str)	r2, [r0]
+6: TUSER(str)	r3, [r0, #4]
 #else
-5:	T(str)	r2, [r0], #4
-6:	T(str)	r3, [r0]
+5: TUSER(str)	r2, [r0], #4
+6: TUSER(str)	r3, [r0]
 #endif
 	mov	r0, #0
 	mov	pc, lr
arch/arm/lib/uaccess.S +41 -41

253 lines not on this page · raw message

Signature · 1 line
Catalin
Acked-by
#4 lore raw
Quoted 11 lines · Catalin Marinas
Quoted 10 lines · Russell King - ARM Linux
Quoted 8 lines · Catalin Marinas
Quoted 3 lines · Russell King - ARM Linux

There's also the troublesome T() macro, which conflicts with a bunch of other drivers. (I've added Catalin to the To: line for this reason.)

This macro is used in asm/uaccess.h and asm/futex.h, so I think it would be difficult to hide it completely. But I'm happy to rename it to something else (IIRC, T stands for "Translated").

Quoted 5 lines
Quoted 2 lines

We should do something, because T() is just too risky for causing these kinds of conflicts.

Here's a patch. For lack of inspiration, I called it TUSER (and grep'ed the kernel, there isn't other reference to such name).

To be on the safe side, you could even call it ARM_TUSER.

Quoted 8 lines

ARM: Rename the T() macro to TUSER() to avoid namespace conflicts

From: Catalin Marinas <[email protected]>

This macro is used to generate unprivileged accesses (LDRT/STRT) to user space.

In any case:

Quoted 534 lines
---
 arch/arm/include/asm/assembler.h |    4 +-
 arch/arm/include/asm/domain.h    |    8 ++--
 arch/arm/include/asm/futex.h     |    8 ++--
 arch/arm/include/asm/uaccess.h   |   16 ++++---
 arch/arm/lib/getuser.S           |   12 +++---
 arch/arm/lib/putuser.S           |   28 ++++++-------
 arch/arm/lib/uaccess.S           |   82 +++++++++++++++++++-------------------
 7 files changed, 79 insertions(+), 79 deletions(-)
arch/arm/include/asm/assembler.h +2 -2
index b6e65de..62f8095 100644
@@ -237,7 +237,7 @@
  */
 #ifdef CONFIG_THUMB2_KERNEL
 
-	.macro	usraccoff, instr, reg, ptr, inc, off, cond, abort, t=T()
+	.macro	usraccoff, instr, reg, ptr, inc, off, cond, abort, t=TUSER()
 9999:
 	.if	\inc == 1
 	\instr\cond\()b\()\t\().w \reg, [\ptr, #\off]
@@ -277,7 +277,7 @@
 
 #else	/* !CONFIG_THUMB2_KERNEL */
 
-	.macro	usracc, instr, reg, ptr, inc, cond, rept, abort, t=T()
+	.macro	usracc, instr, reg, ptr, inc, cond, rept, abort, t=TUSER()
 	.rept	\rept
 9999:
 	.if	\inc == 1
arch/arm/include/asm/domain.h +4 -4
index af18cea..b5dc173 100644
@@ -83,9 +83,9 @@
  * instructions (inline assembly)
  */
 #ifdef CONFIG_CPU_USE_DOMAINS
-#define T(instr)	#instr "t"
+#define TUSER(instr)	#instr "t"
 #else
-#define T(instr)	#instr
+#define TUSER(instr)	#instr
 #endif
 
 #else /* __ASSEMBLY__ */
@@ -95,9 +95,9 @@
  * instructions
  */
 #ifdef CONFIG_CPU_USE_DOMAINS
-#define T(instr)	instr ## t
+#define TUSER(instr)	instr ## t
 #else
-#define T(instr)	instr
+#define TUSER(instr)	instr
 #endif
 
 #endif /* __ASSEMBLY__ */
arch/arm/include/asm/futex.h +4 -4
index 253cc86..7be5469 100644
@@ -75,9 +75,9 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
 
 #define __futex_atomic_op(insn, ret, oldval, tmp, uaddr, oparg)	\
 	__asm__ __volatile__(					\
-	"1:	" T(ldr) "	%1, [%3]\n"			\
+	"1:	" TUSER(ldr) "	%1, [%3]\n"			\
 	"	" insn "\n"					\
-	"2:	" T(str) "	%0, [%3]\n"			\
+	"2:	" TUSER(str) "	%0, [%3]\n"			\
 	"	mov	%0, #0\n"				\
 	__futex_atomic_ex_table("%5")				\
 	: "=&r" (ret), "=&r" (oldval), "=&r" (tmp)		\
@@ -95,10 +95,10 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
 		return -EFAULT;
 
 	__asm__ __volatile__("@futex_atomic_cmpxchg_inatomic\n"
-	"1:	" T(ldr) "	%1, [%4]\n"
+	"1:	" TUSER(ldr) "	%1, [%4]\n"
 	"	teq	%1, %2\n"
 	"	it	eq	@ explicit IT needed for the 2b label\n"
-	"2:	" T(streq) "	%3, [%4]\n"
+	"2:	" TUSER(streq) "	%3, [%4]\n"
 	__futex_atomic_ex_table("%5")
 	: "+r" (ret), "=&r" (val)
 	: "r" (oldval), "r" (newval), "r" (uaddr), "Ir" (-EFAULT)
arch/arm/include/asm/uaccess.h +8 -8
index b293616..2958976 100644
@@ -227,7 +227,7 @@ do {									\
 
 #define __get_user_asm_byte(x,addr,err)				\
 	__asm__ __volatile__(					\
-	"1:	" T(ldrb) "	%1,[%2],#0\n"			\
+	"1:	" TUSER(ldrb) "	%1,[%2],#0\n"			\
 	"2:\n"							\
 	"	.pushsection .fixup,\"ax\"\n"			\
 	"	.align	2\n"					\
@@ -263,7 +263,7 @@ do {									\
 
 #define __get_user_asm_word(x,addr,err)				\
 	__asm__ __volatile__(					\
-	"1:	" T(ldr) "	%1,[%2],#0\n"			\
+	"1:	" TUSER(ldr) "	%1,[%2],#0\n"			\
 	"2:\n"							\
 	"	.pushsection .fixup,\"ax\"\n"			\
 	"	.align	2\n"					\
@@ -308,7 +308,7 @@ do {									\
 
 #define __put_user_asm_byte(x,__pu_addr,err)			\
 	__asm__ __volatile__(					\
-	"1:	" T(strb) "	%1,[%2],#0\n"			\
+	"1:	" TUSER(strb) "	%1,[%2],#0\n"			\
 	"2:\n"							\
 	"	.pushsection .fixup,\"ax\"\n"			\
 	"	.align	2\n"					\
@@ -341,7 +341,7 @@ do {									\
 
 #define __put_user_asm_word(x,__pu_addr,err)			\
 	__asm__ __volatile__(					\
-	"1:	" T(str) "	%1,[%2],#0\n"			\
+	"1:	" TUSER(str) "	%1,[%2],#0\n"			\
 	"2:\n"							\
 	"	.pushsection .fixup,\"ax\"\n"			\
 	"	.align	2\n"					\
@@ -366,10 +366,10 @@ do {									\
 
 #define __put_user_asm_dword(x,__pu_addr,err)			\
 	__asm__ __volatile__(					\
- ARM(	"1:	" T(str) "	" __reg_oper1 ", [%1], #4\n"	)	\
- ARM(	"2:	" T(str) "	" __reg_oper0 ", [%1]\n"	)	\
- THUMB(	"1:	" T(str) "	" __reg_oper1 ", [%1]\n"	)	\
- THUMB(	"2:	" T(str) "	" __reg_oper0 ", [%1, #4]\n"	)	\
+ ARM(	"1:	" TUSER(str) "	" __reg_oper1 ", [%1], #4\n"	) \
+ ARM(	"2:	" TUSER(str) "	" __reg_oper0 ", [%1]\n"	) \
+ THUMB(	"1:	" TUSER(str) "	" __reg_oper1 ", [%1]\n"	) \
+ THUMB(	"2:	" TUSER(str) "	" __reg_oper0 ", [%1, #4]\n"	) \
 	"3:\n"							\
 	"	.pushsection .fixup,\"ax\"\n"			\
 	"	.align	2\n"					\
arch/arm/lib/getuser.S +6 -6
index 1b049cd..11093a7 100644
@@ -31,18 +31,18 @@
 #include <asm/domain.h>
 
 ENTRY(__get_user_1)
-1:	T(ldrb)	r2, [r0]
+1: TUSER(ldrb)	r2, [r0]
 	mov	r0, #0
 	mov	pc, lr
 ENDPROC(__get_user_1)
 
 ENTRY(__get_user_2)
 #ifdef CONFIG_THUMB2_KERNEL
-2:	T(ldrb)	r2, [r0]
-3:	T(ldrb)	r3, [r0, #1]
+2: TUSER(ldrb)	r2, [r0]
+3: TUSER(ldrb)	r3, [r0, #1]
 #else
-2:	T(ldrb)	r2, [r0], #1
-3:	T(ldrb)	r3, [r0]
+2: TUSER(ldrb)	r2, [r0], #1
+3: TUSER(ldrb)	r3, [r0]
 #endif
 #ifndef __ARMEB__
 	orr	r2, r2, r3, lsl #8
@@ -54,7 +54,7 @@ ENTRY(__get_user_2)
 ENDPROC(__get_user_2)
 
 ENTRY(__get_user_4)
-4:	T(ldr)	r2, [r0]
+4: TUSER(ldr)	r2, [r0]
 	mov	r0, #0
 	mov	pc, lr
 ENDPROC(__get_user_4)
arch/arm/lib/putuser.S +14 -14
index c023fc1..7db2599 100644
@@ -31,7 +31,7 @@
 #include <asm/domain.h>
 
 ENTRY(__put_user_1)
-1:	T(strb)	r2, [r0]
+1: TUSER(strb)	r2, [r0]
 	mov	r0, #0
 	mov	pc, lr
 ENDPROC(__put_user_1)
@@ -40,19 +40,19 @@ ENTRY(__put_user_2)
 	mov	ip, r2, lsr #8
 #ifdef CONFIG_THUMB2_KERNEL
 #ifndef __ARMEB__
-2:	T(strb)	r2, [r0]
-3:	T(strb)	ip, [r0, #1]
+2: TUSER(strb)	r2, [r0]
+3: TUSER(strb)	ip, [r0, #1]
 #else
-2:	T(strb)	ip, [r0]
-3:	T(strb)	r2, [r0, #1]
+2: TUSER(strb)	ip, [r0]
+3: TUSER(strb)	r2, [r0, #1]
 #endif
 #else	/* !CONFIG_THUMB2_KERNEL */
 #ifndef __ARMEB__
-2:	T(strb)	r2, [r0], #1
-3:	T(strb)	ip, [r0]
+2: TUSER(strb)	r2, [r0], #1
+3: TUSER(strb)	ip, [r0]
 #else
-2:	T(strb)	ip, [r0], #1
-3:	T(strb)	r2, [r0]
+2: TUSER(strb)	ip, [r0], #1
+3: TUSER(strb)	r2, [r0]
 #endif
 #endif	/* CONFIG_THUMB2_KERNEL */
 	mov	r0, #0
@@ -60,18 +60,18 @@ ENTRY(__put_user_2)
 ENDPROC(__put_user_2)
 
 ENTRY(__put_user_4)
-4:	T(str)	r2, [r0]
+4: TUSER(str)	r2, [r0]
 	mov	r0, #0
 	mov	pc, lr
 ENDPROC(__put_user_4)
 
 ENTRY(__put_user_8)
 #ifdef CONFIG_THUMB2_KERNEL
-5:	T(str)	r2, [r0]
-6:	T(str)	r3, [r0, #4]
+5: TUSER(str)	r2, [r0]
+6: TUSER(str)	r3, [r0, #4]
 #else
-5:	T(str)	r2, [r0], #4
-6:	T(str)	r3, [r0]
+5: TUSER(str)	r2, [r0], #4
+6: TUSER(str)	r3, [r0]
 #endif
 	mov	r0, #0
 	mov	pc, lr
arch/arm/lib/uaccess.S +41 -41
index d0ece2a..5c908b1 100644
@@ -32,11 +32,11 @@
 		rsb	ip, ip, #4
 		cmp	ip, #2
 		ldrb	r3, [r1], #1
-USER(		T(strb)	r3, [r0], #1)			@ May fault
+USER(	TUSER(	strb)	r3, [r0], #1)			@ May fault
 		ldrgeb	r3, [r1], #1
-USER(		T(strgeb) r3, [r0], #1)			@ May fault
+USER(	TUSER(	strgeb) r3, [r0], #1)			@ May fault
 		ldrgtb	r3, [r1], #1
-USER(		T(strgtb) r3, [r0], #1)			@ May fault
+USER(	TUSER(	strgtb) r3, [r0], #1)			@ May fault
 		sub	r2, r2, ip
 		b	.Lc2u_dest_aligned
 
@@ -59,7 +59,7 @@ ENTRY(__copy_to_user)
 		addmi	ip, r2, #4
 		bmi	.Lc2u_0nowords
 		ldr	r3, [r1], #4
-USER(		T(str)	r3, [r0], #4)			@ May fault
+USER(	TUSER(	str)	r3, [r0], #4)			@ May fault
 		mov	ip, r0, lsl #32 - PAGE_SHIFT	@ On each page, use a ld/st??t instruction
 		rsb	ip, ip, #0
 		movs	ip, ip, lsr #32 - PAGE_SHIFT
@@ -88,18 +88,18 @@ USER(		T(str)	r3, [r0], #4)			@ May fault
 		stmneia	r0!, {r3 - r4}			@ Shouldnt fault
 		tst	ip, #4
 		ldrne	r3, [r1], #4
-		T(strne) r3, [r0], #4			@ Shouldnt fault
+	TUSER(	strne) r3, [r0], #4			@ Shouldnt fault
 		ands	ip, ip, #3
 		beq	.Lc2u_0fupi
 .Lc2u_0nowords:	teq	ip, #0
 		beq	.Lc2u_finished
 .Lc2u_nowords:	cmp	ip, #2
 		ldrb	r3, [r1], #1
-USER(		T(strb)	r3, [r0], #1)			@ May fault
+USER(	TUSER(	strb)	r3, [r0], #1)			@ May fault
 		ldrgeb	r3, [r1], #1
-USER(		T(strgeb) r3, [r0], #1)			@ May fault
+USER(	TUSER(	strgeb) r3, [r0], #1)			@ May fault
 		ldrgtb	r3, [r1], #1
-USER(		T(strgtb) r3, [r0], #1)			@ May fault
+USER(	TUSER(	strgtb) r3, [r0], #1)			@ May fault
 		b	.Lc2u_finished
 
 .Lc2u_not_enough:
@@ -120,7 +120,7 @@ USER(		T(strgtb) r3, [r0], #1)			@ May fault
 		mov	r3, r7, pull #8
 		ldr	r7, [r1], #4
 		orr	r3, r3, r7, push #24
-USER(		T(str)	r3, [r0], #4)			@ May fault
+USER(	TUSER(	str)	r3, [r0], #4)			@ May fault
 		mov	ip, r0, lsl #32 - PAGE_SHIFT
 		rsb	ip, ip, #0
 		movs	ip, ip, lsr #32 - PAGE_SHIFT
@@ -155,18 +155,18 @@ USER(		T(str)	r3, [r0], #4)			@ May fault
 		movne	r3, r7, pull #8
 		ldrne	r7, [r1], #4
 		orrne	r3, r3, r7, push #24
-		T(strne) r3, [r0], #4			@ Shouldnt fault
+	TUSER(	strne) r3, [r0], #4			@ Shouldnt fault
 		ands	ip, ip, #3
 		beq	.Lc2u_1fupi
 .Lc2u_1nowords:	mov	r3, r7, get_byte_1
 		teq	ip, #0
 		beq	.Lc2u_finished
 		cmp	ip, #2
-USER(		T(strb)	r3, [r0], #1)			@ May fault
+USER(	TUSER(	strb)	r3, [r0], #1)			@ May fault
 		movge	r3, r7, get_byte_2
-USER(		T(strgeb) r3, [r0], #1)			@ May fault
+USER(	TUSER(	strgeb) r3, [r0], #1)			@ May fault
 		movgt	r3, r7, get_byte_3
-USER(		T(strgtb) r3, [r0], #1)			@ May fault
+USER(	TUSER(	strgtb) r3, [r0], #1)			@ May fault
 		b	.Lc2u_finished
 
 .Lc2u_2fupi:	subs	r2, r2, #4
@@ -175,7 +175,7 @@ USER(		T(strgtb) r3, [r0], #1)			@ May fault
 		mov	r3, r7, pull #16
 		ldr	r7, [r1], #4
 		orr	r3, r3, r7, push #16
-USER(		T(str)	r3, [r0], #4)			@ May fault
+USER(	TUSER(	str)	r3, [r0], #4)			@ May fault
 		mov	ip, r0, lsl #32 - PAGE_SHIFT
 		rsb	ip, ip, #0
 		movs	ip, ip, lsr #32 - PAGE_SHIFT
@@ -210,18 +210,18 @@ USER(		T(str)	r3, [r0], #4)			@ May fault
 		movne	r3, r7, pull #16
 		ldrne	r7, [r1], #4
 		orrne	r3, r3, r7, push #16
-		T(strne) r3, [r0], #4			@ Shouldnt fault
+	TUSER(	strne) r3, [r0], #4			@ Shouldnt fault
 		ands	ip, ip, #3
 		beq	.Lc2u_2fupi
 .Lc2u_2nowords:	mov	r3, r7, get_byte_2
 		teq	ip, #0
 		beq	.Lc2u_finished
 		cmp	ip, #2
-USER(		T(strb)	r3, [r0], #1)			@ May fault
+USER(	TUSER(	strb)	r3, [r0], #1)			@ May fault
 		movge	r3, r7, get_byte_3
-USER(		T(strgeb) r3, [r0], #1)			@ May fault
+USER(	TUSER(	strgeb) r3, [r0], #1)			@ May fault
 		ldrgtb	r3, [r1], #0
-USER(		T(strgtb) r3, [r0], #1)			@ May fault
+USER(	TUSER(	strgtb) r3, [r0], #1)			@ May fault
 		b	.Lc2u_finished
 
 .Lc2u_3fupi:	subs	r2, r2, #4
@@ -230,7 +230,7 @@ USER(		T(strgtb) r3, [r0], #1)			@ May fault
 		mov	r3, r7, pull #24
 		ldr	r7, [r1], #4
 		orr	r3, r3, r7, push #8
-USER(		T(str)	r3, [r0], #4)			@ May fault
+USER(	TUSER(	str)	r3, [r0], #4)			@ May fault
 		mov	ip, r0, lsl #32 - PAGE_SHIFT
 		rsb	ip, ip, #0
 		movs	ip, ip, lsr #32 - PAGE_SHIFT
@@ -265,18 +265,18 @@ USER(		T(str)	r3, [r0], #4)			@ May fault
 		movne	r3, r7, pull #24
 		ldrne	r7, [r1], #4
 		orrne	r3, r3, r7, push #8
-		T(strne) r3, [r0], #4			@ Shouldnt fault
+	TUSER(	strne) r3, [r0], #4			@ Shouldnt fault
 		ands	ip, ip, #3
 		beq	.Lc2u_3fupi
 .Lc2u_3nowords:	mov	r3, r7, get_byte_3
 		teq	ip, #0
 		beq	.Lc2u_finished
 		cmp	ip, #2
-USER(		T(strb)	r3, [r0], #1)			@ May fault
+USER(	TUSER(	strb)	r3, [r0], #1)			@ May fault
 		ldrgeb	r3, [r1], #1
-USER(		T(strgeb) r3, [r0], #1)			@ May fault
+USER(	TUSER(	strgeb) r3, [r0], #1)			@ May fault
 		ldrgtb	r3, [r1], #0
-USER(		T(strgtb) r3, [r0], #1)			@ May fault
+USER(	TUSER(	strgtb) r3, [r0], #1)			@ May fault
 		b	.Lc2u_finished
 ENDPROC(__copy_to_user)
 
@@ -295,11 +295,11 @@ ENDPROC(__copy_to_user)
 .Lcfu_dest_not_aligned:
 		rsb	ip, ip, #4
 		cmp	ip, #2
-USER(		T(ldrb)	r3, [r1], #1)			@ May fault
+USER(	TUSER(	ldrb)	r3, [r1], #1)			@ May fault
 		strb	r3, [r0], #1
-USER(		T(ldrgeb) r3, [r1], #1)			@ May fault
+USER(	TUSER(	ldrgeb) r3, [r1], #1)			@ May fault
 		strgeb	r3, [r0], #1
-USER(		T(ldrgtb) r3, [r1], #1)			@ May fault
+USER(	TUSER(	ldrgtb) r3, [r1], #1)			@ May fault
 		strgtb	r3, [r0], #1
 		sub	r2, r2, ip
 		b	.Lcfu_dest_aligned
@@ -322,7 +322,7 @@ ENTRY(__copy_from_user)
 .Lcfu_0fupi:	subs	r2, r2, #4
 		addmi	ip, r2, #4
 		bmi	.Lcfu_0nowords
-USER(		T(ldr)	r3, [r1], #4)
+USER(	TUSER(	ldr)	r3, [r1], #4)
 		str	r3, [r0], #4
 		mov	ip, r1, lsl #32 - PAGE_SHIFT	@ On each page, use a ld/st??t instruction
 		rsb	ip, ip, #0
@@ -351,18 +351,18 @@ USER(		T(ldr)	r3, [r1], #4)
 		ldmneia	r1!, {r3 - r4}			@ Shouldnt fault
 		stmneia	r0!, {r3 - r4}
 		tst	ip, #4
-		T(ldrne) r3, [r1], #4			@ Shouldnt fault
+	TUSER(	ldrne) r3, [r1], #4			@ Shouldnt fault
 		strne	r3, [r0], #4
 		ands	ip, ip, #3
 		beq	.Lcfu_0fupi
 .Lcfu_0nowords:	teq	ip, #0
 		beq	.Lcfu_finished
 .Lcfu_nowords:	cmp	ip, #2
-USER(		T(ldrb)	r3, [r1], #1)			@ May fault
+USER(	TUSER(	ldrb)	r3, [r1], #1)			@ May fault
 		strb	r3, [r0], #1
-USER(		T(ldrgeb) r3, [r1], #1)			@ May fault
+USER(	TUSER(	ldrgeb) r3, [r1], #1)			@ May fault
 		strgeb	r3, [r0], #1
-USER(		T(ldrgtb) r3, [r1], #1)			@ May fault
+USER(	TUSER(	ldrgtb) r3, [r1], #1)			@ May fault
 		strgtb	r3, [r0], #1
 		b	.Lcfu_finished
 
@@ -375,7 +375,7 @@ USER(		T(ldrgtb) r3, [r1], #1)			@ May fault
 
 .Lcfu_src_not_aligned:
 		bic	r1, r1, #3
-USER(		T(ldr)	r7, [r1], #4)			@ May fault
+USER(	TUSER(	ldr)	r7, [r1], #4)			@ May fault
 		cmp	ip, #2
 		bgt	.Lcfu_3fupi
 		beq	.Lcfu_2fupi
@@ -383,7 +383,7 @@ USER(		T(ldr)	r7, [r1], #4)			@ May fault
 		addmi	ip, r2, #4
 		bmi	.Lcfu_1nowords
 		mov	r3, r7, pull #8
-USER(		T(ldr)	r7, [r1], #4)			@ May fault
+USER(	TUSER(	ldr)	r7, [r1], #4)			@ May fault
 		orr	r3, r3, r7, push #24
 		str	r3, [r0], #4
 		mov	ip, r1, lsl #32 - PAGE_SHIFT
@@ -418,7 +418,7 @@ USER(		T(ldr)	r7, [r1], #4)			@ May fault
 		stmneia	r0!, {r3 - r4}
 		tst	ip, #4
 		movne	r3, r7, pull #8
-USER(		T(ldrne) r7, [r1], #4)			@ May fault
+USER(	TUSER(	ldrne) r7, [r1], #4)			@ May fault
 		orrne	r3, r3, r7, push #24
 		strne	r3, [r0], #4
 		ands	ip, ip, #3
@@ -438,7 +438,7 @@ USER(		T(ldrne) r7, [r1], #4)			@ May fault
 		addmi	ip, r2, #4
 		bmi	.Lcfu_2nowords
 		mov	r3, r7, pull #16
-USER(		T(ldr)	r7, [r1], #4)			@ May fault
+USER(	TUSER(	ldr)	r7, [r1], #4)			@ May fault
 		orr	r3, r3, r7, push #16
 		str	r3, [r0], #4
 		mov	ip, r1, lsl #32 - PAGE_SHIFT
@@ -474,7 +474,7 @@ USER(		T(ldr)	r7, [r1], #4)			@ May fault
 		stmneia	r0!, {r3 - r4}
 		tst	ip, #4
 		movne	r3, r7, pull #16
-USER(		T(ldrne) r7, [r1], #4)			@ May fault
+USER(	TUSER(	ldrne) r7, [r1], #4)			@ May fault
 		orrne	r3, r3, r7, push #16
 		strne	r3, [r0], #4
 		ands	ip, ip, #3
@@ -486,7 +486,7 @@ USER(		T(ldrne) r7, [r1], #4)			@ May fault
 		strb	r3, [r0], #1
 		movge	r3, r7, get_byte_3
 		strgeb	r3, [r0], #1
-USER(		T(ldrgtb) r3, [r1], #0)			@ May fault
+USER(	TUSER(	ldrgtb) r3, [r1], #0)			@ May fault
 		strgtb	r3, [r0], #1
 		b	.Lcfu_finished
 
@@ -494,7 +494,7 @@ USER(		T(ldrgtb) r3, [r1], #0)			@ May fault
 		addmi	ip, r2, #4
 		bmi	.Lcfu_3nowords
 		mov	r3, r7, pull #24
-USER(		T(ldr)	r7, [r1], #4)			@ May fault
+USER(	TUSER(	ldr)	r7, [r1], #4)			@ May fault
 		orr	r3, r3, r7, push #8
 		str	r3, [r0], #4
 		mov	ip, r1, lsl #32 - PAGE_SHIFT
@@ -529,7 +529,7 @@ USER(		T(ldr)	r7, [r1], #4)			@ May fault
 		stmneia	r0!, {r3 - r4}
 		tst	ip, #4
 		movne	r3, r7, pull #24
-USER(		T(ldrne) r7, [r1], #4)			@ May fault
+USER(	TUSER(	ldrne) r7, [r1], #4)			@ May fault
 		orrne	r3, r3, r7, push #8
 		strne	r3, [r0], #4
 		ands	ip, ip, #3
@@ -539,9 +539,9 @@ USER(		T(ldrne) r7, [r1], #4)			@ May fault
 		beq	.Lcfu_finished
 		cmp	ip, #2
 		strb	r3, [r0], #1
-USER(		T(ldrgeb) r3, [r1], #1)			@ May fault
+USER(	TUSER(	ldrgeb) r3, [r1], #1)			@ May fault
 		strgeb	r3, [r0], #1
-USER(		T(ldrgtb) r3, [r1], #1)			@ May fault
+USER(	TUSER(	ldrgtb) r3, [r1], #1)			@ May fault
 		strgtb	r3, [r0], #1
 		b	.Lcfu_finished
 ENDPROC(__copy_from_user)
Signature · 7 lines
-- 
Catalin

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#5 lore raw
Quoted 12 lines · Nicolas Pitre
Quoted 11 lines · Catalin Marinas
Quoted 10 lines · Russell King - ARM Linux
Quoted 8 lines · Catalin Marinas
Quoted 3 lines · Russell King - ARM Linux

There's also the troublesome T() macro, which conflicts with a bunch of other drivers. ?(I've added Catalin to the To: line for this reason.)

This macro is used in asm/uaccess.h and asm/futex.h, so I think it would be difficult to hide it completely. But I'm happy to rename it to something else (IIRC, T stands for "Translated").

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

We should do something, because T() is just too risky for causing these kinds of conflicts.

Here's a patch. For lack of inspiration, I called it TUSER (and grep'ed the kernel, there isn't other reference to such name).

To be on the safe side, you could even call it ARM_TUSER.

I thought about making it longer but some asm code becomes uglier with so many characters.

Quoted 3 lines

In any case:

Thanks.

Signature · 1 line
Catalin