From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andre Przywara Subject: Re: kvm guest for 486 sx Date: Wed, 8 Jul 2009 13:04:48 +0200 Message-ID: <4A547D50.70501@amd.com> References: <4A525759.6090404@pagestation.com> <4A531B44.90803@redhat.com> <4A533A32.7000505@pagestation.com> <4A533CE7.2080706@redhat.com> <4A53414F.3070300@pagestation.com> <4A53448A.7050002@redhat.com> <4A534A8F.2030702@pagestation.com> <4A534C46.3040603@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Cc: Jerry Geis , kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from wa4ehsobe002.messaging.microsoft.com ([216.32.181.12]:11495 "EHLO WA4EHSOBE002.bigfish.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751443AbZGHLFN (ORCPT ); Wed, 8 Jul 2009 07:05:13 -0400 In-Reply-To: <4A534C46.3040603@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Avi Kivity wrote: > On 07/07/2009 04:15 PM, Jerry Geis wrote: >>>> Notice FPU indicates yes and I requested -fpu on the command line. >>> >>> I think it detects the host fpu as a 487 coprocessor. Anything in >>> dmesg about it? Note there's no fpu in the flags: line. >>> >>> That's a kvm kernel bug. >>> >>>> also is this a 486 as it says AMD? >>> >>> You can override it if you like, -cpu 486,vendor=AuthenticAMD (I think). >>> >> >> Sorry - I thought the " -cpu 486,-fpu " was the way to turn off the fpu. >> I 'm trying to emulute a 486 sx that has no fpu. > > I thought so too, but in fact it emulates a 486sx+487. -fpu does not help here, as the injected 486 CPUID limits the level to 0, so effectively no other leaf than leaf 0 is checked by the guest. That's why the FPU bit, which is 0000_0001.EDX:0, is not honored. I bumped up the level to 1 and set the model to 2, which should mimic a later 486SX chip, together with -fpu Linux (2.6.21) still insisted on fpu: yes (probably determined by probing FPU instructions). > We can make it > emulate a 486sx without a 487, but that will take a kernel patch. What are you thinking of? Forcing CR0.EM to 1 (and don't let the guest change it), then inject #NM into the guest? Regards, Andre. -- Andre Przywara AMD-Operating System Research Center (OSRC), Dresden, Germany Tel: +49 351 448 3567 12 ----to satisfy European Law for business letters: Advanced Micro Devices GmbH Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Thomas M. McCoy; Giuliano Meroni Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632