All of lore.kernel.org
 help / color / mirror / Atom feed
From: SJ Park <sj@kernel.org>
To: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
Cc: SJ Park <sj@kernel.org>, Richard Weinberger <richard@nod.at>,
	Anton Ivanov <anton.ivanov@cambridgegreys.com>,
	Johannes Berg <johannes@sipsolutions.net>,
	"Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
	Thomas Gleixner <tglx@kernel.org>,
	linux-um@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] um: Use asm-generic/timex.h over the host architecture one
Date: Sun, 30 Aug 2026 08:52:11 -0700	[thread overview]
Message-ID: <20260830155212.97975-1-sj@kernel.org> (raw)
In-Reply-To: <20260819-uml-timex-fix-v1-1-f690b514fc9f@linutronix.de>

On Wed, 19 Aug 2026 09:24:21 +0200 Thomas Weißschuh <thomas.weissschuh@linutronix.de> wrote:

> 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)                            \
>       |                 ^~~~~~~~~~~~~~~
> arch/um/include/asm/cpufeature.h:52:72: note: in expansion of macro ‘_static_cpu_has’
>    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: note: ‘_static_cpu_has’ is a function-like macro and might be used incorrectly
> arch/um/include/asm/cpufeature.h:52:72: note: in expansion of macro ‘_static_cpu_has’
>    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))
>       |              ^~~~~~~~~~~~~~~~~~~
> 
> 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.

I got the same issue, and confirmed this patch fixes it on my setup.  Thank you
for sharing this patch.

> 
> Fixes: 3ed403bbc967 ("treewide: Remove CLOCK_TICK_RATE")
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>

Tested-by: SJ Park <sj@kernel.org>


Thanks,
SJ

[...]


      parent reply	other threads:[~2026-08-30 15:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-19  7:24 [PATCH] um: Use asm-generic/timex.h over the host architecture one Thomas Weißschuh
2026-08-21  8:22 ` David Gow
2026-08-25  1:53 ` [tip: timers/urgent] " tip-bot2 for Thomas Weißschuh
2026-08-30 15:52 ` SJ Park [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260830155212.97975-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=anton.ivanov@cambridgegreys.com \
    --cc=chleroy@kernel.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-um@lists.infradead.org \
    --cc=richard@nod.at \
    --cc=tglx@kernel.org \
    --cc=thomas.weissschuh@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.