From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH] Lazy FPU save/restore Date: Sun, 18 Feb 2007 16:55:39 -0600 Message-ID: <45D8D96B.50104@codemonkey.ws> References: <45D502A1.5000303@codemonkey.ws> <45D81EB6.9010407@qumranet.com> <45D861CD.4020207@qumranet.com> <45D87B22.6070403@codemonkey.ws> <45D87C2E.2090806@qumranet.com> <45D89917.9090003@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel To: Avi Kivity Return-path: In-Reply-To: <45D89917.9090003-atKUWr5tajBWk0Htik3J/w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Avi Kivity wrote: > Avi Kivity wrote: >>> >>> I'll have to try and setup a 64 bit system. I cannot reproduce on >>> my 32bit system with your test program. >> >> It may be related to 64-bit (as that uses sse for floating point), or >> to the fact that I use ssh on a remote host, which causes more >> context switches. I'll try to reproduce on 32 bits with my setup. >> > > It doesn't reproduce on a 32-bit host. However, it does reproduce on > a 32-bit guest on a 64-bit host, and on a 32-bit user load running in > a 64-bit guest on a 64-bit host. Thanks, I'll setup a 64 bit partition and start debugging. I'm a bit confused though, I thought CR0.TS even covers SIMD instructions? I'll take a look at Xen and see if it's doing something else. Regards, Anthony Liguori > I'm attaching an updated test program which makes it easier to spot > the failures. You only need to run it on the guest, although running > it on the host as well increases the failure rate significantly. > > ------------------------------------------------------------------------ > > > #include > #include > > double test_fpu_once() > { > int i; > double f = 0; > > for (i = 0; i < 10000000; ++i) > f += 1 / (1.0 + i); > return f; > } > > void test_fpu() > { > double a, b; > int runs; > > runs = 0; > a = test_fpu_once(); > while (1) { > b = test_fpu_once(); > if (fabs(a - b) > 1e-9) > printf("error: %20.16f -> %20.16f\n", a, b); > a = b; > if (++runs % 100 == 0) > printf("runs: %8d\n", runs); > } > } > > int main(int ac, char **av) > { > test_fpu(); > return 0; > } > ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV