linux/arch/um
Thomas Weißschuh 64f74d8f72 um: Use asm-generic/timex.h over the host architecture one
The removal of the architecture-specific asm/timex.h was meant to fall back to
asm-generic/timex.h. However on UML, the host architecture headers are earlier
on the include path and therefore asm/timex.h from the host architecture is
used.

On x86 that header in turn requires the generation of cpufeaturemasks.h, which
is not set up for UML and the build fails.

  In file included from ../arch/x86/include/asm/tsc.h:9,
                   from ../arch/x86/include/asm/timex.h:6,
                   from ../include/linux/timex.h:67,
                   from ../include/linux/time32.h:13,
                   from ../include/linux/time.h:60,
                   from ../include/linux/jiffies.h:10,
                   from ../include/linux/ktime.h:25,
                   from ../include/linux/timer.h:6,
                   from ../include/linux/uprobes.h:18,
                   from ../include/linux/mm_types.h:16,
                   from ../include/linux/mmzone.h:22,
                   from ../include/linux/gfp.h:7,
                   from ../include/linux/slab.h:17,
                   from ../include/linux/crypto.h:18,
                   from ../arch/um/kernel/asm-offsets.c:6:
  arch/x86/include/asm/tsc.h: In function ‘get_cycles’:
  arch/um/include/asm/cpufeature.h:52:39: error: implicit declaration of function ‘DISABLED_MASK_BIT_SET’ [-Wimplicit-function-declaration]
     52 |         (__builtin_constant_p(bit) && DISABLED_MASK_BIT_SET(bit) ? 0 : _static_cpu_has(bit))
        |                                       ^~~~~~~~~~~~~~~~~~~~~
  arch/x86/include/asm/tsc.h:79:14: note: in expansion of macro ‘cpu_feature_enabled’
     79 |         if (!cpu_feature_enabled(X86_FEATURE_TSC))
        |              ^~~~~~~~~~~~~~~~~~~
  arch/um/include/asm/cpufeature.h:115:17: error: implicit declaration of function ‘_static_cpu_has’ [-Wimplicit-function-declaration]
    115 |                 _static_cpu_has(bit)                            \
        |                 ^~~~~~~~~~~~~~~
  ...

The x86-specific timex.h also doesn't make sense on UML in general.

Reintroduce the UML-specific asm/timex.h and add a comment to document
its necessity.

  [ bp: Improve that comment to actually state why stuff is there. ]

Fixes: 3ed403bbc9 ("treewide: Remove CLOCK_TICK_RATE")
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: David Gow <david@davidgow.net>
Link: https://patch.msgid.link/20260819-uml-timex-fix-v1-1-f690b514fc9f@linutronix.de
2026-08-24 17:10:35 -07:00
..
configs um: Remove CONFIG_FRAME_WARN from x86_64_defconfig 2026-03-21 10:43:10 +01:00
drivers um: vector: fix use-after-free in vector_mmsg_rx() 2026-07-23 21:31:14 +02:00
include um: Use asm-generic/timex.h over the host architecture one 2026-08-24 17:10:35 -07:00
kernel - Remove the smp_locks alternatives machinery which was used to patch out lock 2026-08-18 18:11:25 -07:00
os-Linux arch/um: remove unused varible err in remove_files_and_dir() 2026-01-13 19:43:41 +01:00
scripts um: prevent user code in modules 2023-04-20 23:06:38 +02:00
.gitignore um: gitignore: Add kernel/capflags.c 2021-12-21 21:22:43 +01:00
Kbuild um: use obj-y to descend into arch/um/*/ 2023-08-26 22:41:34 +02:00
Kconfig um: Disable GCOV_PROFILE_ALL on 32-bit UML with Clang 20/21 2026-04-10 09:28:59 +02:00
Kconfig.debug um: Disable CONFIG_GCOV with MODULES 2021-04-15 23:10:33 +02:00
Makefile percpu: Sanitize __percpu_qual include hell 2026-06-03 11:38:48 +02:00
Makefile-os-Linux
Makefile-skas um: fix stub exe build with CONFIG_GCOV 2024-10-26 16:06:10 +02:00