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] [day] [month] [year] [list]
Date:   Mon, 04 Dec 2017 10:08:52 +0100
From:   Vitaly Kuznetsov <vkuznets@...hat.com>
To:     Paolo Bonzini <pbonzini@...hat.com>
Cc:     Stephen Hemminger <stephen@...workplumber.org>,
        Stephen Hemminger <sthemmin@...rosoft.com>,
        kvm@...r.kernel.org,
        Radim Krčmář 
        <rkrcmar@...hat.com>, Haiyang Zhang <haiyangz@...rosoft.com>,
        x86@...nel.org, linux-kernel@...r.kernel.org,
        Ingo Molnar <mingo@...hat.com>,
        Andy Lutomirski <luto@...nel.org>,
        "H. Peter Anvin" <hpa@...or.com>, devel@...uxdriverproject.org,
        Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH RFC 2/6] x86/hyper-v: add a function to read both TSC and TSC page value simulateneously

Paolo Bonzini <pbonzini@...hat.com> writes:

> On 01/12/2017 18:29, Stephen Hemminger wrote:
>>> +static inline u64 hv_read_tsc_page_tsc(const struct ms_hyperv_tsc_page *tsc_pg,
>>> +				       u64 *cur_tsc)
>>> +{
>>> +	*cur_tsc = rdtsc();
>>> +
>>> +	return cur_tsc;
>> Why do return and setting by reference. Looks like an ugly API.
>
> This is the fallback implementation for !CONFIG_HYPERV_TSCPAGE, which
> explains why it's ugly, but why is it needed at all (or it could just
> BUG())?
>

It is not needed indeed, the intention was just to avoid '#if
IS_ENABLED(CONFIG_HYPERV)' in kvm code. I can replace it with BUG() or
return U64_MAX;

-- 
  Vitaly

Powered by blists - more mailing lists