public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Documentation: Restrict TSC test code to x86
@ 2014-10-28  0:03 Alexander Graf
  2014-10-28  0:07 ` Peter Foley
  0 siblings, 1 reply; 9+ messages in thread
From: Alexander Graf @ 2014-10-28  0:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-doc, Jiri Kosina, Randy Dunlap, Peter Foley, afaerber

The prctl test code in Documentation/ tries to show how to
use a call that only makes sense on x86. Restrict it there
so that other platforms don't try to call asm("rdtsc").

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 Documentation/prctl/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/prctl/Makefile b/Documentation/prctl/Makefile
index 3e3232d..2948b7b 100644
--- a/Documentation/prctl/Makefile
+++ b/Documentation/prctl/Makefile
@@ -1,5 +1,5 @@
 # List of programs to build
-hostprogs-y := disable-tsc-ctxt-sw-stress-test disable-tsc-on-off-stress-test disable-tsc-test
+hostprogs-$(CONFIG_X86) := disable-tsc-ctxt-sw-stress-test disable-tsc-on-off-stress-test disable-tsc-test
 # Tell kbuild to always build the programs
 always := $(hostprogs-y)
 
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] Documentation: Restrict TSC test code to x86
  2014-10-28  0:03 [PATCH] Documentation: Restrict TSC test code to x86 Alexander Graf
@ 2014-10-28  0:07 ` Peter Foley
  2014-10-28 12:47   ` Jonathan Corbet
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Foley @ 2014-10-28  0:07 UTC (permalink / raw)
  To: Alexander Graf
  Cc: LKML, linux-doc@vger.kernel.org, Jiri Kosina, Randy Dunlap,
	afaerber

On Mon, Oct 27, 2014 at 8:03 PM, Alexander Graf <agraf@suse.de> wrote:
> The prctl test code in Documentation/ tries to show how to
> use a call that only makes sense on x86. Restrict it there
> so that other platforms don't try to call asm("rdtsc").
>
> Signed-off-by: Alexander Graf <agraf@suse.de>

Acked-by: Peter Foley <pefoley2@pefoley.com>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Documentation: Restrict TSC test code to x86
  2014-10-28  0:07 ` Peter Foley
@ 2014-10-28 12:47   ` Jonathan Corbet
  2014-10-28 13:12     ` Alexander Graf
  0 siblings, 1 reply; 9+ messages in thread
From: Jonathan Corbet @ 2014-10-28 12:47 UTC (permalink / raw)
  To: Peter Foley
  Cc: Alexander Graf, LKML, linux-doc@vger.kernel.org, Jiri Kosina,
	Randy Dunlap, afaerber

On Mon, 27 Oct 2014 20:07:51 -0400
Peter Foley <pefoley2@pefoley.com> wrote:

> > The prctl test code in Documentation/ tries to show how to
> > use a call that only makes sense on x86. Restrict it there
> > so that other platforms don't try to call asm("rdtsc").
> >
> > Signed-off-by: Alexander Graf <agraf@suse.de>  
> 
> Acked-by: Peter Foley <pefoley2@pefoley.com>

Snagged into the docs tree, thanks.

jon

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Documentation: Restrict TSC test code to x86
  2014-10-28 12:47   ` Jonathan Corbet
@ 2014-10-28 13:12     ` Alexander Graf
  2014-11-01 12:03       ` Matwey V. Kornilov
  0 siblings, 1 reply; 9+ messages in thread
From: Alexander Graf @ 2014-10-28 13:12 UTC (permalink / raw)
  To: Jonathan Corbet
  Cc: Peter Foley, LKML, linux-doc@vger.kernel.org, Jiri Kosina,
	Randy Dunlap, afaerber@suse.de




> Am 28.10.2014 um 13:47 schrieb Jonathan Corbet <corbet@lwn.net>:
> 
> On Mon, 27 Oct 2014 20:07:51 -0400
> Peter Foley <pefoley2@pefoley.com> wrote:
> 
>>> The prctl test code in Documentation/ tries to show how to
>>> use a call that only makes sense on x86. Restrict it there
>>> so that other platforms don't try to call asm("rdtsc").
>>> 
>>> Signed-off-by: Alexander Graf <agraf@suse.de>  
>> 
>> Acked-by: Peter Foley <pefoley2@pefoley.com>
> 
> Snagged into the docs tree, thanks.

Awesome, please make sure this makes it into 3.18 - the build is broken on non-x86 archs there ;).

Alex


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Documentation: Restrict TSC test code to x86
  2014-10-28 13:12     ` Alexander Graf
@ 2014-11-01 12:03       ` Matwey V. Kornilov
  2014-11-01 21:16         ` Alexander Graf
  0 siblings, 1 reply; 9+ messages in thread
From: Matwey V. Kornilov @ 2014-11-01 12:03 UTC (permalink / raw)
  To: Alexander Graf, Jonathan Corbet
  Cc: Peter Foley, LKML, linux-doc@vger.kernel.org, Jiri Kosina,
	Randy Dunlap, afaerber@suse.de

28.10.2014 16:12, Alexander Graf пишет:
> 
> 
> 
>> Am 28.10.2014 um 13:47 schrieb Jonathan Corbet <corbet@lwn.net>:
>>
>> On Mon, 27 Oct 2014 20:07:51 -0400
>> Peter Foley <pefoley2@pefoley.com> wrote:
>>
>>>> The prctl test code in Documentation/ tries to show how to
>>>> use a call that only makes sense on x86. Restrict it there
>>>> so that other platforms don't try to call asm("rdtsc").
>>>>
>>>> Signed-off-by: Alexander Graf <agraf@suse.de>  
>>>
>>> Acked-by: Peter Foley <pefoley2@pefoley.com>
>>
>> Snagged into the docs tree, thanks.
> 
> Awesome, please make sure this makes it into 3.18 - the build is broken on non-x86 archs there ;).
> 
> Alex
> 

Hi,

Sorry for criticism, but the patch is not complete.
CONFIG_X86 deals with target architecture, at the same time the problem
deals with the host architecture.

Imagine, that I run arm, aarch64 or something else and do
cross-compiling kernel for x86 on it. Then CONFIG_X86 will evaluate to
'y' and make will try to compile the apps with the host-compiler, which
is not x86 one.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Documentation: Restrict TSC test code to x86
  2014-11-01 12:03       ` Matwey V. Kornilov
@ 2014-11-01 21:16         ` Alexander Graf
  2014-11-02  7:46           ` Matwey V. Kornilov
  0 siblings, 1 reply; 9+ messages in thread
From: Alexander Graf @ 2014-11-01 21:16 UTC (permalink / raw)
  To: Matwey V. Kornilov, Jonathan Corbet
  Cc: Peter Foley, LKML, linux-doc@vger.kernel.org, Jiri Kosina,
	Randy Dunlap, afaerber@suse.de



On 01.11.14 13:03, Matwey V. Kornilov wrote:
> 28.10.2014 16:12, Alexander Graf пишет:
>>
>>
>>
>>> Am 28.10.2014 um 13:47 schrieb Jonathan Corbet <corbet@lwn.net>:
>>>
>>> On Mon, 27 Oct 2014 20:07:51 -0400
>>> Peter Foley <pefoley2@pefoley.com> wrote:
>>>
>>>>> The prctl test code in Documentation/ tries to show how to
>>>>> use a call that only makes sense on x86. Restrict it there
>>>>> so that other platforms don't try to call asm("rdtsc").
>>>>>
>>>>> Signed-off-by: Alexander Graf <agraf@suse.de>  
>>>>
>>>> Acked-by: Peter Foley <pefoley2@pefoley.com>
>>>
>>> Snagged into the docs tree, thanks.
>>
>> Awesome, please make sure this makes it into 3.18 - the build is broken on non-x86 archs there ;).
>>
>> Alex
>>
> 
> Hi,
> 
> Sorry for criticism, but the patch is not complete.
> CONFIG_X86 deals with target architecture, at the same time the problem
> deals with the host architecture.
> 
> Imagine, that I run arm, aarch64 or something else and do
> cross-compiling kernel for x86 on it. Then CONFIG_X86 will evaluate to
> 'y' and make will try to compile the apps with the host-compiler, which
> is not x86 one.

Good point. Any ideas how I can easily limit this to x86 hosts?


Alex

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Documentation: Restrict TSC test code to x86
  2014-11-01 21:16         ` Alexander Graf
@ 2014-11-02  7:46           ` Matwey V. Kornilov
  2014-11-02  8:16             ` Alexander Graf
  0 siblings, 1 reply; 9+ messages in thread
From: Matwey V. Kornilov @ 2014-11-02  7:46 UTC (permalink / raw)
  To: Alexander Graf
  Cc: Jonathan Corbet, Peter Foley, LKML, linux-doc@vger.kernel.org,
	Jiri Kosina, Randy Dunlap, afaerber@suse.de

I wish I knew. We need KBuild guru to ask how to take into account
host architecture.


2014-11-02 0:16 GMT+03:00 Alexander Graf <agraf@suse.de>:
>
>
> On 01.11.14 13:03, Matwey V. Kornilov wrote:
>> 28.10.2014 16:12, Alexander Graf пишет:
>>>
>>>
>>>
>>>> Am 28.10.2014 um 13:47 schrieb Jonathan Corbet <corbet@lwn.net>:
>>>>
>>>> On Mon, 27 Oct 2014 20:07:51 -0400
>>>> Peter Foley <pefoley2@pefoley.com> wrote:
>>>>
>>>>>> The prctl test code in Documentation/ tries to show how to
>>>>>> use a call that only makes sense on x86. Restrict it there
>>>>>> so that other platforms don't try to call asm("rdtsc").
>>>>>>
>>>>>> Signed-off-by: Alexander Graf <agraf@suse.de>
>>>>>
>>>>> Acked-by: Peter Foley <pefoley2@pefoley.com>
>>>>
>>>> Snagged into the docs tree, thanks.
>>>
>>> Awesome, please make sure this makes it into 3.18 - the build is broken on non-x86 archs there ;).
>>>
>>> Alex
>>>
>>
>> Hi,
>>
>> Sorry for criticism, but the patch is not complete.
>> CONFIG_X86 deals with target architecture, at the same time the problem
>> deals with the host architecture.
>>
>> Imagine, that I run arm, aarch64 or something else and do
>> cross-compiling kernel for x86 on it. Then CONFIG_X86 will evaluate to
>> 'y' and make will try to compile the apps with the host-compiler, which
>> is not x86 one.
>
> Good point. Any ideas how I can easily limit this to x86 hosts?
>
>
> Alex



-- 
With best regards,
Matwey V. Kornilov
http://blog.matwey.name
xmpp://0x2207@jabber.ru

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Documentation: Restrict TSC test code to x86
  2014-11-02  7:46           ` Matwey V. Kornilov
@ 2014-11-02  8:16             ` Alexander Graf
  2014-11-02 10:28               ` Matwey V. Kornilov
  0 siblings, 1 reply; 9+ messages in thread
From: Alexander Graf @ 2014-11-02  8:16 UTC (permalink / raw)
  To: Matwey V. Kornilov
  Cc: Jonathan Corbet, Peter Foley, LKML, linux-doc@vger.kernel.org,
	Jiri Kosina, Randy Dunlap, afaerber@suse.de



On 02.11.14 08:46, Matwey V. Kornilov wrote:
> I wish I knew. We need KBuild guru to ask how to take into account
> host architecture.

Hrm. At least this patch makes things more consistent with the other
Documentation makefiles:

Documentation/timers/Makefile:hostprogs-$(CONFIG_X86) := hpet_example
Documentation/vDSO/Makefile:hostprogs-$(CONFIG_X86) :=
vdso_standalone_test_x86

But I agree, it is wrong in general - hostprogs should make sure the
host arch matches.

We could maybe just evaluate the host uname output:

  ifeq ($(shell uname -m),x86_64)
    hostprogs-$(CONFIG_X86) := ...
  endif

Then we're double safe ;). Not sure how to easily add x86 to the mix as
well here, but I'm not sure anyone cares. Do people still compile on
32bit x86 hosts? And expect Documentation/ examples to build?


Alex

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Documentation: Restrict TSC test code to x86
  2014-11-02  8:16             ` Alexander Graf
@ 2014-11-02 10:28               ` Matwey V. Kornilov
  0 siblings, 0 replies; 9+ messages in thread
From: Matwey V. Kornilov @ 2014-11-02 10:28 UTC (permalink / raw)
  To: Alexander Graf, yann.morin.1998, linux-kbuild, mmarek
  Cc: Jonathan Corbet, Peter Foley, LKML, linux-doc@vger.kernel.org,
	Jiri Kosina, Randy Dunlap, afaerber@suse.de

I've added Yann and Michal to the discussion.

The issue is that we have

hostprogs-y := disable-tsc-ctxt-sw-stress-test
disable-tsc-on-off-stress-test disable-tsc-test

in Documentation/prctl/Makefile

and disable-tsc-ctxt-sw-stress-test has x86 assembler inside and must
be restricted only to this host architecture.


2014-11-02 11:16 GMT+03:00 Alexander Graf <agraf@suse.de>:
>
>
> On 02.11.14 08:46, Matwey V. Kornilov wrote:
>> I wish I knew. We need KBuild guru to ask how to take into account
>> host architecture.
>
> Hrm. At least this patch makes things more consistent with the other
> Documentation makefiles:
>
> Documentation/timers/Makefile:hostprogs-$(CONFIG_X86) := hpet_example
> Documentation/vDSO/Makefile:hostprogs-$(CONFIG_X86) :=
> vdso_standalone_test_x86
>
> But I agree, it is wrong in general - hostprogs should make sure the
> host arch matches.
>
> We could maybe just evaluate the host uname output:
>
>   ifeq ($(shell uname -m),x86_64)
>     hostprogs-$(CONFIG_X86) := ...
>   endif
>
> Then we're double safe ;). Not sure how to easily add x86 to the mix as
> well here, but I'm not sure anyone cares. Do people still compile on
> 32bit x86 hosts? And expect Documentation/ examples to build?
>
>
> Alex



-- 
With best regards,
Matwey V. Kornilov
http://blog.matwey.name
xmpp://0x2207@jabber.ru

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-11-02 10:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-28  0:03 [PATCH] Documentation: Restrict TSC test code to x86 Alexander Graf
2014-10-28  0:07 ` Peter Foley
2014-10-28 12:47   ` Jonathan Corbet
2014-10-28 13:12     ` Alexander Graf
2014-11-01 12:03       ` Matwey V. Kornilov
2014-11-01 21:16         ` Alexander Graf
2014-11-02  7:46           ` Matwey V. Kornilov
2014-11-02  8:16             ` Alexander Graf
2014-11-02 10:28               ` Matwey V. Kornilov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox