From: "H. Peter Anvin" <hpa@zytor.com>
To: mingo@redhat.com, hpa@zytor.com, linux-kernel@vger.kernel.org,
luto@mit.edu, johnstul@us.ibm.com, tony.luck@intel.com,
fenghua.yu@intel.com, tglx@linutronix.de, hpa@linux.intel.com
Cc: linux-tip-commits@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
Linux Arch Mailing List <linux-arch@vger.kernel.org>
Subject: Re: [tip:x86/vdso] clocksource: Replace vread with generic arch data
Date: Thu, 21 Jul 2011 13:23:02 -0700 [thread overview]
Message-ID: <4E288AA6.7090804@zytor.com> (raw)
In-Reply-To: <tip-433bd805e5fd2c731b3a9025b034f066272d336e@git.kernel.org>
On 07/14/2011 09:24 PM, tip-bot for Andy Lutomirski wrote:
>
> diff --git a/arch/x86/include/asm/clocksource.h b/arch/x86/include/asm/clocksource.h
> new file mode 100644
> index 0000000..a5df33f
> --- /dev/null
> +++ b/arch/x86/include/asm/clocksource.h
> @@ -0,0 +1,16 @@
> +/* x86-specific clocksource additions */
> +
> +#ifndef _ASM_X86_CLOCKSOURCE_H
> +#define _ASM_X86_CLOCKSOURCE_H
> +
> +#ifdef CONFIG_X86_64
> +
> +#define __ARCH_HAS_CLOCKSOURCE_DATA
> +
> +struct arch_clocksource_data {
> + cycle_t (*vread)(void);
> +};
> +
> +#endif /* CONFIG_X86_64 */
> +
> +#endif /* _ASM_X86_CLOCKSOURCE_H */
> --- /dev/null
> +++ b/include/asm-generic/clocksource.h
> @@ -0,0 +1,4 @@
> +/*
> + * Architectures should override this file to add private userspace
> + * clock magic if needed.
> + */
> diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
> index d4646b4..0fb83c2 100644
> --- a/include/linux/clocksource.h
> +++ b/include/linux/clocksource.h
> @@ -22,6 +22,8 @@
> typedef u64 cycle_t;
> struct clocksource;
>
> +#include <asm/clocksource.h>
> +
> /**
Hi Andy,
I should have spotted this sooner... Ingo pointed out to me that this
breaks building on any non-x86 architecture.
asm-generic doesn't work quite the way you think it does, here; it's a
library for architectures to include from, not something that gets
included on all architectures by default.
To make a file from asm-generic appear in asm/ it needs to at least
appear in a generic-y statement in a Makefile; however, that is kind of
pointless in the case of an empty file.
One could argue that it would be nice if we had such a fallback
director, of if asm-generic was such a fallback directory, but currently
it is not.
The easiest way to deal with this is probably to make
ARCH_HAS_CLOCKSOURCE_DATA here a Kconfig option (autoselected for
x86-64); the only other would be to add this as generic-y stubs for
every single architecture.
Cc: Arnd Bergmann who is the asm-generic maintainer for a
recommendation, and linux-arch.
-hpa
--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.
WARNING: multiple messages have this Message-ID (diff)
From: "H. Peter Anvin" <hpa@zytor.com>
To: mingo@redhat.com, hpa@zytor.com, linux-kernel@vger.kernel.org,
luto@mit.edu, johnstul@us.ibm.com, tony.luck@intel.com,
fenghua.yu@intel.com, tglx@linutronix.de, hpa@linux.intel.com,
clemens@ladisch.de
Cc: linux-tip-commits@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
Linux Arch Mailing List <linux-arch@vger.kernel.org>
Subject: Re: [tip:x86/vdso] clocksource: Replace vread with generic arch data
Date: Thu, 21 Jul 2011 13:23:02 -0700 [thread overview]
Message-ID: <4E288AA6.7090804@zytor.com> (raw)
Message-ID: <20110721202302.EcRPr7zepZAUhHcjD52EzK1DxYiJHoOJm7w8KvUCmNc@z> (raw)
In-Reply-To: <tip-433bd805e5fd2c731b3a9025b034f066272d336e@git.kernel.org>
On 07/14/2011 09:24 PM, tip-bot for Andy Lutomirski wrote:
>
> diff --git a/arch/x86/include/asm/clocksource.h b/arch/x86/include/asm/clocksource.h
> new file mode 100644
> index 0000000..a5df33f
> --- /dev/null
> +++ b/arch/x86/include/asm/clocksource.h
> @@ -0,0 +1,16 @@
> +/* x86-specific clocksource additions */
> +
> +#ifndef _ASM_X86_CLOCKSOURCE_H
> +#define _ASM_X86_CLOCKSOURCE_H
> +
> +#ifdef CONFIG_X86_64
> +
> +#define __ARCH_HAS_CLOCKSOURCE_DATA
> +
> +struct arch_clocksource_data {
> + cycle_t (*vread)(void);
> +};
> +
> +#endif /* CONFIG_X86_64 */
> +
> +#endif /* _ASM_X86_CLOCKSOURCE_H */
> --- /dev/null
> +++ b/include/asm-generic/clocksource.h
> @@ -0,0 +1,4 @@
> +/*
> + * Architectures should override this file to add private userspace
> + * clock magic if needed.
> + */
> diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
> index d4646b4..0fb83c2 100644
> --- a/include/linux/clocksource.h
> +++ b/include/linux/clocksource.h
> @@ -22,6 +22,8 @@
> typedef u64 cycle_t;
> struct clocksource;
>
> +#include <asm/clocksource.h>
> +
> /**
Hi Andy,
I should have spotted this sooner... Ingo pointed out to me that this
breaks building on any non-x86 architecture.
asm-generic doesn't work quite the way you think it does, here; it's a
library for architectures to include from, not something that gets
included on all architectures by default.
To make a file from asm-generic appear in asm/ it needs to at least
appear in a generic-y statement in a Makefile; however, that is kind of
pointless in the case of an empty file.
One could argue that it would be nice if we had such a fallback
director, of if asm-generic was such a fallback directory, but currently
it is not.
The easiest way to deal with this is probably to make
ARCH_HAS_CLOCKSOURCE_DATA here a Kconfig option (autoselected for
x86-64); the only other would be to add this as generic-y stubs for
every single architecture.
Cc: Arnd Bergmann who is the asm-generic maintainer for a
recommendation, and linux-arch.
-hpa
--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.
next parent reply other threads:[~2011-07-21 20:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <3ae5ec76a168eaaae63f08a2a1060b91aa0b7759.1310563276.git.luto@mit.edu>
[not found] ` <tip-433bd805e5fd2c731b3a9025b034f066272d336e@git.kernel.org>
2011-07-21 20:23 ` H. Peter Anvin [this message]
2011-07-21 20:23 ` [tip:x86/vdso] clocksource: Replace vread with generic arch data H. Peter Anvin
2011-07-21 20:49 ` Andrew Lutomirski
2011-07-21 20:59 ` H. Peter Anvin
2011-07-21 21:22 ` Andrew Lutomirski
2011-07-21 21:25 ` H. Peter Anvin
2011-07-21 21:36 ` Andrew Lutomirski
2011-07-21 21:42 ` H. Peter Anvin
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=4E288AA6.7090804@zytor.com \
--to=hpa@zytor.com \
--cc=arnd@arndb.de \
--cc=fenghua.yu@intel.com \
--cc=hpa@linux.intel.com \
--cc=johnstul@us.ibm.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=luto@mit.edu \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).