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:   Mon, 12 Dec 2022 07:57:30 -0800
From:   Krister Johansen <kjlx@...pleofstupid.com>
To:     Boris Ostrovsky <boris.ostrovsky@...cle.com>
Cc:     Krister Johansen <kjlx@...pleofstupid.com>,
        Juergen Gross <jgross@...e.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
        "H. Peter Anvin" <hpa@...or.com>, xen-devel@...ts.xenproject.org,
        linux-kernel@...r.kernel.org,
        Marcelo Tosatti <mtosatti@...hat.com>,
        Anthony Liguori <aliguori@...zon.com>,
        David Reaver <me@...idreaver.com>,
        Brendan Gregg <brendan@...el.com>
Subject: Re: [PATCH linux-next] x86/xen/time: prefer tsc as clocksource when
 it is invariant

On Fri, Dec 09, 2022 at 02:32:15PM -0500, Boris Ostrovsky wrote:
> 
> On 12/8/22 11:36 AM, Krister Johansen wrote:
> > +	/*
> > +	 * As Dom0 is never moved, no penalty on using TSC there.
> > +	 *
> > +	 * If the guest has invariant tsc, then set xen_clocksource rating
> > +	 * below that of the tsc so that the system prefers tsc instead.  This
> > +	 * check excludes PV domains, because PV is unable to guarantee that the
> > +	 * guest's cpuid call has been intercepted by the hypervisor.
> > +	 */
> > +	if (xen_initial_domain()) {
> >   		xen_clocksource.rating = 275;
> > +	} else if ((xen_hvm_domain() || xen_pvh_domain()) &&
> > +	    boot_cpu_has(X86_FEATURE_CONSTANT_TSC) &&
> > +	    boot_cpu_has(X86_FEATURE_NONSTOP_TSC) &&
> > +	    !check_tsc_unstable()) {
> > +		xen_clocksource.rating = 299;
> > +	}
> 
> 
> What if RDTSC is intercepted?

Right, thanks.  I'll send out an updated patch here shortly that
attempts to address this by examining the cpuid information to determine
if the tsc is being emulated.

-K

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ