lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAObL_7HyKSwm9a_7nfdk5E0Noy5zqD=dyaanvxY_iX5XcP1d4Q@mail.gmail.com>
Date:	Thu, 21 Jul 2011 16:49:07 -0400
From:	Andrew Lutomirski <luto@....edu>
To:	"H. Peter Anvin" <hpa@...or.com>
Cc:	mingo@...hat.com, linux-kernel@...r.kernel.org,
	johnstul@...ibm.com, tony.luck@...el.com, fenghua.yu@...el.com,
	tglx@...utronix.de, hpa@...ux.intel.com, clemens@...isch.de,
	linux-tip-commits@...r.kernel.org, Arnd Bergmann <arnd@...db.de>,
	Linux Arch Mailing List <linux-arch@...r.kernel.org>
Subject: Re: [tip:x86/vdso] clocksource: Replace vread with generic arch data

On Thu, Jul 21, 2011 at 4:23 PM, H. Peter Anvin <hpa@...or.com> wrote:
> 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.

Whoops.  If only cross-compiler toolchains were easy to build...

[...]

>
> 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.

ARCH_HAS_CLOCKSOURCE_DATA seems reasonable.  It's a little ugly
because it needs:

#ifdef CONFIG_ARCH_HAS_CLOCKSOURCE_DATA
#include <asm/clocksource.h>
#endif


If I don't hear any better suggestions, I'll implement that tomorrow.
Do you want an incremental patch or a replacement?

--Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ