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: <20151023143144.GN16418@hzzhang-OptiPlex-9020.sh.intel.com>
Date:	Fri, 23 Oct 2015 22:31:44 +0800
From:	Haozhong Zhang <haozhong.zhang@...el.com>
To:	kvm@...r.kernel.org, Paolo Bonzini <pbonzini@...hat.com>,
	Joerg Roedel <joro@...tes.org>
Cc:	Gleb Natapov <gleb@...nel.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
	Joerg Roedel <joro@...tes.org>,
	Wanpeng Li <wanpeng.li@...mail.com>,
	Xiao Guangrong <guangrong.xiao@...ux.intel.com>,
	mdontu@...defender.com, Kai Huang <kai.huang@...ux.intel.com>,
	Andy Lutomirski <luto@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 00/12] KVM: x86: add support for VMX TSC scaling

Following is how I test this patchset. It should also apply to AMD
machines by replacing Intel with AMD and VMX TSC scaling with SVM TSC
ratio.

* Hardware Requirements
  1) Two machines with Intel CPUs, called M_A and M_B below.
  2) TSC frequency of CPUs on M_A is different from CPUs on M_B.
     Suppose TSC frequency on M_A is f_a KHz.
  3) At least CPUs on M_B support VMX TSC scaling.

* Software Requirements
  1) Apply this patchset to KVM on both machines.
  2) Apply QEMU patches[1] to QEMU commit 40fe17b on both machines

* Test Process
  1) Start a linux guest on M_A
       qemu-system-x86_64 -enable-kvm -smp 4 -cpu qemu66 -m 512 -hda linux.img
       
  2) In guest linux, check the TSC frequency detected by Linux kernel.
     e.g. search in dmeg for messages like
       "tsc: Detected XYZ.ABC MHz processor" or
       "tsc: Refined TSC clocksource calibration: XYZ.ABC MHz"
  
  3) Start QEMU waiting for migration on M_B:
       qemu-system-x86_64 -enable-kvm -smp 4 -cpu qemu64,load-tsc-freq -m 512 -hda linux.img -incoming tcp:0:1234
       
  4) Migrate above VM to M_B as normal in QEMU monitor:
       migrate tcp:<M_B's ip>:1234
       
  5) After the migration, if VMX TSC scaling and this patchset work on
     M_B, no messages like
       "Clocksource tsc unstable (delta = xxxxx ns)"
     should appear in dmesg of guest linux

  6) Furthermore, users can also check whether guest TSC after the
     migration increases in the same rate as before by running the
     attached program test_tsc in VM:
       ./test_tsc N f_a
     It measures the number of TSC ticks passed in N seconds, and
     divides it by the expected TSC frequency f_a to get the output
     result. If this patchset works, the output should be very closed
     to N
  
[1] http://www.spinics.net/lists/kvm/msg122421.html

Thanks,
Haozhong

View attachment "test_tsc.c" of type "text/plain" (810 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ