Skip to contentSkip to conversation

kvm guest for 486 sx

DISCUSSION Jerry Geis 4 participants 15 messages Jul 6, 2009 – Jul 8, 2009 KVM

lore
Share & tools
lore

Jerry Geis

author
#0 lore raw

I wish to run as a guest a 486 SX equivalent
is there an option to disable the floating point support?

Is it possible to do this?

Thanks,

Jerry

#1 lore raw
Quoted 5 lines · Jerry Geis

I wish to run as a guest a 486 SX equivalent
is there an option to disable the floating point support?

Is it possible to do this?

Try -cpu 486,-fpu.

Signature · 1 line
error compiling committee.c: too many arguments to function
author
#2 lore raw
Quoted 9 lines · Avi Kivity
Quoted 5 lines · Jerry Geis

I wish to run as a guest a 486 SX equivalent
is there an option to disable the floating point support?

Is it possible to do this?

Try -cpu 486,-fpu.

Avi,

Running this command:
qemu-system-x86_64 -net nic,model=rtl8139 -net user -hda $1 -no-acpi -usb -cpu 486,-fpu &

I get a seg fault:
qemu-system-x86[15419]: segfault at c ip 0000000000458b95 sp 0000000041d9df90 error 4 in qemu-system-x86_64[400000+208000]

I am running kvm-87 centos 5.3 x86_64.

Jerry

#3 lore raw
Quoted 9 lines · Jerry Geis
Quoted 2 lines

Try -cpu 486,-fpu.

Avi,

Running this command:
qemu-system-x86_64 -net nic,model=rtl8139 -net user -hda $1 -no-acpi -usb -cpu 486,-fpu &

Quoted 5 lines

I get a seg fault:
qemu-system-x86[15419]: segfault at c ip 0000000000458b95 sp 0000000041d9df90 error 4 in qemu-system-x86_64[400000+208000]

I am running kvm-87 centos 5.3 x86_64.

Add -no-kvm-irqchip. A 486 doesn't have a local APIC, which the code expects.

Signature · 1 line
error compiling committee.c: too many arguments to function
author
#4 lore raw
Quoted 10 lines · Avi Kivity
Quoted 9 lines · Jerry Geis
Quoted 2 lines

Try -cpu 486,-fpu.

Avi,

Running this command:
qemu-system-x86_64 -net nic,model=rtl8139 -net user -hda $1 -no-acpi -usb -cpu 486,-fpu &

Quoted 8 lines
Quoted 5 lines

I get a seg fault:
qemu-system-x86[15419]: segfault at c ip 0000000000458b95 sp 0000000041d9df90 error 4 in qemu-system-x86_64[400000+208000]

I am running kvm-87 centos 5.3 x86_64.

Add -no-kvm-irqchip. A 486 doesn't have a local APIC, which the code expects.

This works. Thanks.

Jerry

author
#5 lore raw
In reply to Avi Kivity
Quoted 10 lines · Avi Kivity
Quoted 9 lines · Jerry Geis
Quoted 2 lines

Try -cpu 486,-fpu.

Avi,

Running this command:
qemu-system-x86_64 -net nic,model=rtl8139 -net user -hda $1 -no-acpi -usb -cpu 486,-fpu &

Quoted 8 lines
Quoted 5 lines

I get a seg fault:
qemu-system-x86[15419]: segfault at c ip 0000000000458b95 sp 0000000041d9df90 error 4 in qemu-system-x86_64[400000+208000]

I am running kvm-87 centos 5.3 x86_64.

Add -no-kvm-irqchip. A 486 doesn't have a local APIC, which the code expects.

Running with this line:
qemu-system-x86_64 -net nic,model=rtl8139 -net user -hda $1 -no-acpi -usb -cpu 486,-fpu -no-kvm-irqchip &

My /proc/cpuinfo shows the follow:
processor : 0
vendor_id : AuthenticAMD
cpu family : 4
model : 0
model name : 04/00
stepping : 0
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : no
cpuid level : 0
wp : yes

flags           :
bogomips        : 2965.50
clflush size    : 32

power management:

Notice FPU indicates yes and I requested -fpu on the command line. also is this a 486 as it says AMD?

Thanks,

Jerry

#6 lore raw
Quoted 41 lines · Jerry Geis
Quoted 10 lines · Avi Kivity
Quoted 9 lines · Jerry Geis
Quoted 2 lines

Try -cpu 486,-fpu.

Avi,

Running this command:
qemu-system-x86_64 -net nic,model=rtl8139 -net user -hda $1 -no-acpi -usb -cpu 486,-fpu &

Quoted 8 lines
Quoted 5 lines

I get a seg fault:
qemu-system-x86[15419]: segfault at c ip 0000000000458b95 sp 0000000041d9df90 error 4 in qemu-system-x86_64[400000+208000]

I am running kvm-87 centos 5.3 x86_64.

Add -no-kvm-irqchip. A 486 doesn't have a local APIC, which the code expects.

Running with this line:
qemu-system-x86_64 -net nic,model=rtl8139 -net user -hda $1 -no-acpi -usb -cpu 486,-fpu -no-kvm-irqchip &

My /proc/cpuinfo shows the follow:
processor : 0
vendor_id : AuthenticAMD
cpu family : 4
model : 0
model name : 04/00
stepping : 0
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : no
cpuid level : 0
wp : yes

Quoted 7 lines
flags           :
bogomips        : 2965.50
clflush size    : 32

power management:

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.

Quoted 1 line

also is this a 486 as it says AMD?

You can override it if you like, -cpu 486,vendor=AuthenticAMD (I think).

Signature · 1 line
error compiling committee.c: too many arguments to function
author
#7 lore raw
Quoted 50 lines · Avi Kivity
Quoted 41 lines · Jerry Geis
Quoted 10 lines · Avi Kivity
Quoted 9 lines · Jerry Geis
Quoted 2 lines

Try -cpu 486,-fpu.

Avi,

Running this command:
qemu-system-x86_64 -net nic,model=rtl8139 -net user -hda $1 -no-acpi -usb -cpu 486,-fpu &

Quoted 8 lines
Quoted 5 lines

I get a seg fault:
qemu-system-x86[15419]: segfault at c ip 0000000000458b95 sp 0000000041d9df90 error 4 in qemu-system-x86_64[400000+208000]

I am running kvm-87 centos 5.3 x86_64.

Add -no-kvm-irqchip. A 486 doesn't have a local APIC, which the code expects.

Running with this line:
qemu-system-x86_64 -net nic,model=rtl8139 -net user -hda $1 -no-acpi -usb -cpu 486,-fpu -no-kvm-irqchip &

My /proc/cpuinfo shows the follow:
processor : 0
vendor_id : AuthenticAMD
cpu family : 4
model : 0
model name : 04/00
stepping : 0
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : no
cpuid level : 0
wp : yes

Quoted 7 lines
flags           :
bogomips        : 2965.50
clflush size    : 32

power management:

Notice FPU indicates yes and I requested -fpu on the command line.

Quoted 8 lines

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.

Quoted 1 line

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.
Do I not have the command line correct? qemu-system-x86_64 -net nic,model=rtl8139 -net user -hda $1 -no-acpi -usb -cpu 486,-fpu -no-kvm-irqchip

the vendor_id is OK just not what I expected to see.

Jerry

#8 lore raw
Quoted 6 lines · Jerry Geis
Quoted 6 lines
Quoted 1 line

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.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

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. We can make it emulate a 486sx without a 487, but that will take a kernel patch.

Signature · 1 line
error compiling committee.c: too many arguments to function
author
#9 lore raw
Quoted 9 lines · Avi Kivity
Quoted 8 lines · Jerry Geis
Quoted 8 lines
Quoted 1 line

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.

Quoted 1 line

also is this a 486 as it says AMD?

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

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. We can make it emulate a 486sx without a 487, but that will take a kernel patch.

I'd be interested in that if you can make it happen.

jerry

#10 lore raw
Quoted 3 lines · Jerry Geis
Quoted 1 line

I thought so too, but in fact it emulates a 486sx+487. We can make it emulate a 486sx without a 487, but that will take a kernel patch.

I'd be interested in that if you can make it happen.

I don't think I'll get around to it soon. I'll happily apply a patch though.

Signature · 1 line
error compiling committee.c: too many arguments to function
author
#11 lore raw
Quoted 7 lines · Avi Kivity
Quoted 3 lines · Jerry Geis
Quoted 1 line

I thought so too, but in fact it emulates a 486sx+487. We can make it emulate a 486sx without a 487, but that will take a kernel patch.

I'd be interested in that if you can make it happen.

I don't think I'll get around to it soon. I'll happily apply a patch though.

I wish could. I'll have to wait or you.

jerry

#12 lore raw
In reply to Avi Kivity
Quoted 9 lines · Avi Kivity
Quoted 8 lines · Jerry Geis
Quoted 8 lines
Quoted 1 line

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.

Quoted 1 line

also is this a 486 as it says AMD?

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

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

Quoted 2 lines

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.

Signature · 9 lines
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
#13 lore raw
Quoted 3 lines · Andre Przywara
Quoted 2 lines

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?

Yes.

Signature · 1 line
error compiling committee.c: too many arguments to function
#14 lore raw
In reply to Jerry Geis
Quoted 16 lines · Jerry Geis
Quoted 9 lines · Avi Kivity
Quoted 5 lines · Jerry Geis

I wish to run as a guest a 486 SX equivalent
is there an option to disable the floating point support?

Is it possible to do this?

Try -cpu 486,-fpu.

Avi,

Running this command:
qemu-system-x86_64 -net nic,model=rtl8139 -net user -hda $1 -no-acpi -usb -cpu 486,-fpu &

Quoted 7 lines

I get a seg fault:
qemu-system-x86[15419]: segfault at c ip 0000000000458b95 sp 0000000041d9df90 error 4 in qemu-system-x86_64[400000+208000]

I am running kvm-87 centos 5.3 x86_64.

Apply the patch and try again please.

hw/apic.c +2 -1
index 778a853..3e79377 100644
@@ -955,7 +955,8 @@ static void kvm_kernel_lapic_load_from_user(APICState *s)
 void qemu_kvm_load_lapic(CPUState *env)
 {
 #ifdef KVM_CAP_IRQCHIP
-    if (kvm_enabled() && kvm_vcpu_inited(env) && qemu_kvm_irqchip_in_kernel()) {
+    if (kvm_enabled() && kvm_vcpu_inited(env) &&
+		    qemu_kvm_irqchip_in_kernel() && env->apic_state) {
         kvm_kernel_lapic_load_from_user(env->apic_state);
     }
 #endif

--
Gleb.