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]
Date:	Sat, 30 Apr 2016 10:47:49 -0700
From:	Andy Lutomirski <luto@...capital.net>
To:	Borislav Petkov <bp@...e.de>
Cc:	Minfei Huang <mnghuan@...il.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	"H. Peter Anvin" <hpa@...or.com>,
	Andrew Lutomirski <luto@...nel.org>,
	Paolo Bonzini <pbonzini@...hat.com>,
	Marcelo Tosatti <mtosatti@...hat.com>, X86 ML <x86@...nel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Cleanup __pvclock_read_cycles to remove useless variables

On Sat, Apr 30, 2016 at 6:24 AM, Borislav Petkov <bp@...e.de> wrote:
> On Mon, Apr 25, 2016 at 02:53:14PM +0800, Minfei Huang wrote:
>> The value of cycles and flags can be assigned directly without
>> intermediate variables.
>>
>> Remove the useless variables.
>>
>> Signed-off-by: Minfei Huang <mnghuan@...il.com>
>> ---
>>  arch/x86/include/asm/pvclock.h | 15 ++++-----------
>>  1 file changed, 4 insertions(+), 11 deletions(-)
>>
>> diff --git a/arch/x86/include/asm/pvclock.h b/arch/x86/include/asm/pvclock.h
>> index fdcc040..fb95dac 100644
>> --- a/arch/x86/include/asm/pvclock.h
>> +++ b/arch/x86/include/asm/pvclock.h
>> @@ -80,19 +80,12 @@ static __always_inline
>>  unsigned __pvclock_read_cycles(const struct pvclock_vcpu_time_info *src,
>>                              cycle_t *cycles, u8 *flags)
>>  {
>> -     unsigned version;
>> -     cycle_t ret, offset;
>> -     u8 ret_flags;
>> -
>> -     version = src->version;
>> +     cycle_t offset;
>>
>>       offset = pvclock_get_nsec_offset(src);
>
> You could go a step further and get rid of that
> pvclock_get_nsec_offset() simple wrapper too and move its meat into
> __pvclock_read_cycles()...
>

Take a look at vread_pvclock.  I decided that __pvclock_read_cycles
was too ugly to use and was very slow and I just gave up and rewrote
it.

> --
> Regards/Gruss,
>     Boris.
>
> SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
> --



-- 
Andy Lutomirski
AMA Capital Management, LLC

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ