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: <48E15AC7.2080603@redhat.com>
Date:	Tue, 30 Sep 2008 00:46:31 +0200
From:	Gerd Hoffmann <kraxel@...hat.com>
To:	akataria@...are.com
CC:	Ingo Molnar <mingo@...e.hu>, "H. Peter Anvin" <hpa@...or.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	LKML <linux-kernel@...r.kernel.org>,
	the arch/x86 maintainers <x86@...nel.org>,
	Jeremy Fitzhardinge <jeremy@...p.org>,
	"avi@...hat.com" <avi@...hat.com>,
	Rusty Russell <rusty@...tcorp.com.au>,
	Zach Amsden <zach@...are.com>,
	Daniel Hecht <dhecht@...are.com>,
	"Jun.Nakajima@...el.Com" <Jun.Nakajima@...el.Com>
Subject: Re: Use CPUID to communicate with the hypervisor.

Alok Kataria wrote:
> On Mon, 2008-09-29 at 11:46 -0700, Gerd Hoffmann wrote:
>> But even that you can't take for granted, see the
>> discussion of the "tsc-may-change-on-migration" problem.
> 
> I may have been unclear in my first attempt to this question, let me try
> again. 
> If the frequency of tsc changes during migration, it should be the task
> of hypervisor to handle it. There could be multiple ways to solve that
> problem, either the hypervisor emulates the old frequency (by whatever
> way) or there are cpufreq drivers in the guest which detect changes in
> frequency, and ask the hypervisor for the new frequency. The interface
> still allows you to query the cpuid leaf and get the new frequency.
> right ? 

This small print is part of the guest/host ABI though, so hypervisors
must agree here too, be it "tsc is constant" or "re-read tsc freq on
$event" or whatever else.  Otherwise it isn't a generic interface.

>> The real big problem are other closed-source hypervisors (VirtualPC /
>> Hyper-V / Parallels / ...).  How can we be sure they don't define that
>> leaf to something different?
> 
> How does that matter, if we are able to standardize all this then,
> hypervisors which want to run a Linux guest should effectively play by
> the standards over here or else they would never work properly on Linux.

Although we are working on world domination I think we are not close
enough yet that this is a realistic point of view.

> Hmm, I am confused, from the patch i posted above, in
> native_calibrate_tsc
> 
> +       tsc_khz = hypervisor_tsc_freq();
> +       if (tsc_khz)
> +               return tsc_khz;
> 
> We do ignore zero values over here.

Oh, ok.

I expected the check explicitly coded within the hypervisor_tsc_freq()
function.  This deserves at least a comment saying that this side effect
is actually intentional.

cheers,
  Gerd


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