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: <200703121409.18533.ak@suse.de>
Date:	Mon, 12 Mar 2007 14:09:18 +0100
From:	Andi Kleen <ak@...e.de>
To:	discuss@...-64.org
Cc:	"Joerg Roedel" <joerg.roedel@....com>,
	"Avi Kivity" <avi@...o.co.il>, linux-kernel@...r.kernel.org
Subject: Re: [discuss] [PATCH 4/4 TRY#3] optimize and simplify get_cycles_sync()

On Monday 12 March 2007 14:02, Joerg Roedel wrote:
> On Fri, Mar 09, 2007 at 08:10:03PM +0200, Avi Kivity wrote:
> > Joerg Roedel wrote:
> > >From: Joerg Roedel <joerg.roedel@....com>
> > >
> > >This patch simplifies the get_cycles_sync() function by removing
> > >the #ifdefs from it. Further it introduces an optimization for AMD
> > >processors. There the RDTSCP instruction is used instead of CPUID;RDTSC
> > >which is helpfull if the kernel runs as a KVM guest. Running as a guest
> > >makes CPUID very expensive because it causes an intercept of the guest.
> > >
> > >  +#define RDTSCP ".byte 0x0f, 0x01, 0xf9"
> > >+	alternative_io_two("cpuid\nrdtsc",
> > >+			   "rdtsc", X86_FEATURE_SYNC_RDTSC,
> > >+			   ".byte 0x0f, 0x01, 0xf9", X86_FEATURE_RDTSCP,
> > >  
> > 
> > why not use the RDTSCP macro here?
> 
> Does this macro exist? I couldn't found it in the current git tree. And
> the rdtscp macros in msr.h use the plain opcode too.

It doesn't exist. The rdtscp macros are also not used currently, that
is why nobody's binutils complained.

Doing the .bytes is ok

I still don't like the alternative() record complications though.

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