All of lore.kernel.org
 help / color / mirror / Atom feed
* DOS VM problem with QEMU-KVM and newer kernels
@ 2012-04-12 18:32 Gerhard Wiesinger
  2012-04-15  9:44 ` Avi Kivity
  0 siblings, 1 reply; 13+ messages in thread
From: Gerhard Wiesinger @ 2012-04-12 18:32 UTC (permalink / raw)
  To: qemu-devel, kvm; +Cc: Avi Kivity

Hello,

I'm having problems with recents kernels and qemu-kvm with a DOS VM:
TD286
System: Bad selector: 0007
System: Bad selector: 0D87
System: Bad selector: 001F
System: Bad selector: 0007
GP at 0020 21D4 EC 0DC4
Error 269 loading D:\BP\BIN\TD286.EXE into extended memory

Another 286 DOS Extender application also rises a general protection fault:
GP at 0020 18A1 CODE 357C

Doesn't depend on the used DOS memory manager and is always reproduceable.

Depends only on kernel version and not qemu-kvm and seabios (tried to 
bisect it without success):
# NOK: Linux 3.3.1-3.fc16.x86_64 #1 SMP Wed Apr 4 18:08:51 UTC 2012 
x86_64 x86_64 x86_64 GNU/Linux
# NOK: Linux 3.2.10-3.fc16.x86_64 #1 SMP Thu Mar 15 19:39:46 UTC 2012 
x86_64 x86_64 x86_64 GNU/Linux
# OK: Linux 3.1.9-1.fc16.x86_64 #1 SMP Fri Jan 13 16:37:42 UTC 2012 
x86_64 x86_64 x86_64 GNU/Linux
# OK: Linux 2.6.41.9-1.fc15.x86_64 #1 SMP Fri Jan 13 16:46:51 UTC 2012 
x86_64 x86_64 x86_64 GNU/Linux

CPU is an AMD one.

Any ideas how to fix it again?
Any switches which might help?

Thnx.

Ciao,
Gerhard

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: DOS VM problem with QEMU-KVM and newer kernels
  2012-04-12 18:32 DOS VM problem with QEMU-KVM and newer kernels Gerhard Wiesinger
@ 2012-04-15  9:44 ` Avi Kivity
  2012-04-15 19:03   ` Gerhard Wiesinger
                     ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Avi Kivity @ 2012-04-15  9:44 UTC (permalink / raw)
  To: Gerhard Wiesinger; +Cc: qemu-devel, kvm, Jan Kiszka, Roedel, Joerg, Kevin Wolf

On 04/12/2012 09:32 PM, Gerhard Wiesinger wrote:
> Hello,
>
> I'm having problems with recents kernels and qemu-kvm with a DOS VM:
> TD286
> System: Bad selector: 0007
> System: Bad selector: 0D87
> System: Bad selector: 001F
> System: Bad selector: 0007
> GP at 0020 21D4 EC 0DC4
> Error 269 loading D:\BP\BIN\TD286.EXE into extended memory
>
> Another 286 DOS Extender application also rises a general protection
> fault:
> GP at 0020 18A1 CODE 357C
>
> Doesn't depend on the used DOS memory manager and is always
> reproduceable.
>
> Depends only on kernel version and not qemu-kvm and seabios (tried to
> bisect it without success):
> # NOK: Linux 3.3.1-3.fc16.x86_64 #1 SMP Wed Apr 4 18:08:51 UTC 2012
> x86_64 x86_64 x86_64 GNU/Linux
> # NOK: Linux 3.2.10-3.fc16.x86_64 #1 SMP Thu Mar 15 19:39:46 UTC 2012
> x86_64 x86_64 x86_64 GNU/Linux
> # OK: Linux 3.1.9-1.fc16.x86_64 #1 SMP Fri Jan 13 16:37:42 UTC 2012
> x86_64 x86_64 x86_64 GNU/Linux
> # OK: Linux 2.6.41.9-1.fc15.x86_64 #1 SMP Fri Jan 13 16:46:51 UTC 2012
> x86_64 x86_64 x86_64 GNU/Linux
>
> CPU is an AMD one.
>
> Any ideas how to fix it again?
> Any switches which might help?
>


The trigger is probably

> commit f1c1da2bde712812a3e0f9a7a7ebe7a916a4b5f4
> Author: Jan Kiszka <jan.kiszka@siemens.com>
> Date:   Tue Oct 18 18:23:11 2011 +0200
>
>     KVM: SVM: Keep intercepting task switching with NPT enabled
>     
>     AMD processors apparently have a bug in the hardware task switching
>     support when NPT is enabled. If the task switch triggers a NPF, we can
>     get wrong EXITINTINFO along with that fault. On resume, spurious
>     exceptions may then be injected into the guest.
>     
>     We were able to reproduce this bug when our guest triggered #SS
> and the
>     handler were supposed to run over a separate task with not yet touched
>     stack pages.
>     
>     Work around the issue by continuing to emulate task switches even in
>     NPT mode.
>     
>     Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>     Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>

Although it's not the patch's direct fault - it simply exposed an
existing bug in kvm.

Things to try:
- revert the patch with a newer kernel
- try 3.4-rc2 which has some task switch fixes from Kevin; if you want a
Fedora kernel, use rawhide's [2]
- post traces [1]

Jan, Joerg, was an AMD erratum published for the bug?

[1] http://www.linux-kvm.org/page/Tracing
[2]
http://mirrors.kernel.org/fedora/development/rawhide/x86_64/os/Packages/k/kernel-3.4.0-0.rc2.git2.1.fc18.x86_64.rpm

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: DOS VM problem with QEMU-KVM and newer kernels
  2012-04-15  9:44 ` Avi Kivity
@ 2012-04-15 19:03   ` Gerhard Wiesinger
  2012-04-16 10:11     ` Avi Kivity
  2012-04-16 10:25   ` Jan Kiszka
  2012-04-17  6:04   ` Gerhard Wiesinger
  2 siblings, 1 reply; 13+ messages in thread
From: Gerhard Wiesinger @ 2012-04-15 19:03 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Kevin Wolf, Jan Kiszka, qemu-devel, kvm, Roedel, Joerg

On 15.04.2012 11:44, Avi Kivity wrote:
> On 04/12/2012 09:32 PM, Gerhard Wiesinger wrote:
>> Hello,
>>
>> I'm having problems with recents kernels and qemu-kvm with a DOS VM:
>> TD286
>> System: Bad selector: 0007
>> System: Bad selector: 0D87
>> System: Bad selector: 001F
>> System: Bad selector: 0007
>> GP at 0020 21D4 EC 0DC4
>> Error 269 loading D:\BP\BIN\TD286.EXE into extended memory
>>
>> Another 286 DOS Extender application also rises a general protection
>> fault:
>> GP at 0020 18A1 CODE 357C
>>
>> Doesn't depend on the used DOS memory manager and is always
>> reproduceable.
>>
>> Depends only on kernel version and not qemu-kvm and seabios (tried to
>> bisect it without success):
>> # NOK: Linux 3.3.1-3.fc16.x86_64 #1 SMP Wed Apr 4 18:08:51 UTC 2012
>> x86_64 x86_64 x86_64 GNU/Linux
>> # NOK: Linux 3.2.10-3.fc16.x86_64 #1 SMP Thu Mar 15 19:39:46 UTC 2012
>> x86_64 x86_64 x86_64 GNU/Linux
>> # OK: Linux 3.1.9-1.fc16.x86_64 #1 SMP Fri Jan 13 16:37:42 UTC 2012
>> x86_64 x86_64 x86_64 GNU/Linux
>> # OK: Linux 2.6.41.9-1.fc15.x86_64 #1 SMP Fri Jan 13 16:46:51 UTC 2012
>> x86_64 x86_64 x86_64 GNU/Linux
>>
>> CPU is an AMD one.
>>
>> Any ideas how to fix it again?
>> Any switches which might help?
>>
>
> The trigger is probably
>
>> commit f1c1da2bde712812a3e0f9a7a7ebe7a916a4b5f4
>> Author: Jan Kiszka<jan.kiszka@siemens.com>
>> Date:   Tue Oct 18 18:23:11 2011 +0200
>>
>>      KVM: SVM: Keep intercepting task switching with NPT enabled
>>
>>      AMD processors apparently have a bug in the hardware task switching
>>      support when NPT is enabled. If the task switch triggers a NPF, we can
>>      get wrong EXITINTINFO along with that fault. On resume, spurious
>>      exceptions may then be injected into the guest.
>>
>>      We were able to reproduce this bug when our guest triggered #SS
>> and the
>>      handler were supposed to run over a separate task with not yet touched
>>      stack pages.
>>
>>      Work around the issue by continuing to emulate task switches even in
>>      NPT mode.
>>
>>      Signed-off-by: Jan Kiszka<jan.kiszka@siemens.com>
>>      Signed-off-by: Marcelo Tosatti<mtosatti@redhat.com>
> Although it's not the patch's direct fault - it simply exposed an
> existing bug in kvm.
>
> Things to try:
> - revert the patch with a newer kernel
> - try 3.4-rc2 which has some task switch fixes from Kevin; if you want a
> Fedora kernel, use rawhide's [2]
> - post traces [1]
>
> Jan, Joerg, was an AMD erratum published for the bug?
>
> [1] http://www.linux-kvm.org/page/Tracing
> [2]
> http://mirrors.kernel.org/fedora/development/rawhide/x86_64/os/Packages/k/kernel-3.4.0-0.rc2.git2.1.fc18.x86_64.rpm
>

Hello Avi,

Tried newer kernel since this version is no longer available:
http://mirrors.kernel.org/fedora/development/rawhide/x86_64/os/Packages/k/kernel-3.4.0-0.rc2.git3.1.fc18.x86_64.rpm

But I wasn't successfull. Still same GP fault (but with 18A2 instead of 
18A1):
GP at 0020 18A2 CODE 357C

yum install asciidoc udis86 udis86-devel
git clone 
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git
cd trace-cmd
make
./trace-cmd record -b 20000 -e kvm
./trace-cmd report

Very long output, what should I grep/trigger for?

Thnx so far.

BTW: Where can I find old kernels like (removed on upgrade :-( ):
kernel-2.6.41.9-1.fc15.x86_64.rpm
kernel-3.1.9-1.fc16.x86_64.rpm
kernel-3.2.10-3.fc16.x86_64.rpm
kernel-debug-2.6.41.9-1.fc15.x86_64

Ciao,
Gerhard

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: DOS VM problem with QEMU-KVM and newer kernels
  2012-04-15 19:03   ` Gerhard Wiesinger
@ 2012-04-16 10:11     ` Avi Kivity
  0 siblings, 0 replies; 13+ messages in thread
From: Avi Kivity @ 2012-04-16 10:11 UTC (permalink / raw)
  To: Gerhard Wiesinger; +Cc: qemu-devel, kvm, Jan Kiszka, Roedel, Joerg, Kevin Wolf

On 04/15/2012 10:03 PM, Gerhard Wiesinger wrote:
>
> Hello Avi,
>
> Tried newer kernel since this version is no longer available:
> http://mirrors.kernel.org/fedora/development/rawhide/x86_64/os/Packages/k/kernel-3.4.0-0.rc2.git3.1.fc18.x86_64.rpm
>
>
> But I wasn't successfull. Still same GP fault (but with 18A2 instead
> of 18A1):
> GP at 0020 18A2 CODE 357C
>
> yum install asciidoc udis86 udis86-devel
> git clone
> git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git
> cd trace-cmd
> make

Also need to 'make install', otherwise the plugin system doesn't work. 
I think re-running 'trace-cmd report' is sufficient to get the right output.

> ./trace-cmd record -b 20000 -e kvm
> ./trace-cmd report
>
> Very long output, what should I grep/trigger for?

TASK_SWITCH (lines before and after).

>
> Thnx so far.
>
> BTW: Where can I find old kernels like (removed on upgrade :-( ):
> kernel-2.6.41.9-1.fc15.x86_64.rpm
> kernel-3.1.9-1.fc16.x86_64.rpm
> kernel-3.2.10-3.fc16.x86_64.rpm
> kernel-debug-2.6.41.9-1.fc15.x86_64


Try http://koji.fedoraproject.org/koji/ (haven't tried myself).


-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: DOS VM problem with QEMU-KVM and newer kernels
  2012-04-15  9:44 ` Avi Kivity
  2012-04-15 19:03   ` Gerhard Wiesinger
@ 2012-04-16 10:25   ` Jan Kiszka
  2012-04-16 10:30     ` Roedel, Joerg
  2012-04-16 11:59     ` Avi Kivity
  2012-04-17  6:04   ` Gerhard Wiesinger
  2 siblings, 2 replies; 13+ messages in thread
From: Jan Kiszka @ 2012-04-16 10:25 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Gerhard Wiesinger, qemu-devel, kvm, Roedel, Joerg, Kevin Wolf

On 2012-04-15 11:44, Avi Kivity wrote:
> The trigger is probably
> 
>> commit f1c1da2bde712812a3e0f9a7a7ebe7a916a4b5f4
>> Author: Jan Kiszka <jan.kiszka@siemens.com>
>> Date:   Tue Oct 18 18:23:11 2011 +0200
>>
>>     KVM: SVM: Keep intercepting task switching with NPT enabled
>>     
>>     AMD processors apparently have a bug in the hardware task switching
>>     support when NPT is enabled. If the task switch triggers a NPF, we can
>>     get wrong EXITINTINFO along with that fault. On resume, spurious
>>     exceptions may then be injected into the guest.
>>     
>>     We were able to reproduce this bug when our guest triggered #SS
>> and the
>>     handler were supposed to run over a separate task with not yet touched
>>     stack pages.
>>     
>>     Work around the issue by continuing to emulate task switches even in
>>     NPT mode.
>>     
>>     Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>>     Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
> 
> Although it's not the patch's direct fault - it simply exposed an
> existing bug in kvm.
> 
> Things to try:
> - revert the patch with a newer kernel
> - try 3.4-rc2 which has some task switch fixes from Kevin; if you want a
> Fedora kernel, use rawhide's [2]
> - post traces [1]
> 
> Jan, Joerg, was an AMD erratum published for the bug?

It wasn't an erratum but a documented feature limitation in the AMD
architecture that was simply ignored by the old code.

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: DOS VM problem with QEMU-KVM and newer kernels
  2012-04-16 10:25   ` Jan Kiszka
@ 2012-04-16 10:30     ` Roedel, Joerg
  2012-04-16 12:03       ` Avi Kivity
  2012-04-16 11:59     ` Avi Kivity
  1 sibling, 1 reply; 13+ messages in thread
From: Roedel, Joerg @ 2012-04-16 10:30 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Avi Kivity, Gerhard Wiesinger, qemu-devel, kvm, Kevin Wolf

On Mon, Apr 16, 2012 at 12:25:37PM +0200, Jan Kiszka wrote:
> On 2012-04-15 11:44, Avi Kivity wrote:
> > Jan, Joerg, was an AMD erratum published for the bug?
> 
> It wasn't an erratum but a documented feature limitation in the AMD
> architecture that was simply ignored by the old code.

Right. But there is an erratum on K8 (only) which Kevin ran into. It is
documented as Erratum 701 and the bug is that no EXITINTINFO is stored
on a task-switch intercept on K8.


	Joerg

-- 
AMD Operating System Research Center

Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach
General Managers: Alberto Bozzo
Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: DOS VM problem with QEMU-KVM and newer kernels
  2012-04-16 10:25   ` Jan Kiszka
  2012-04-16 10:30     ` Roedel, Joerg
@ 2012-04-16 11:59     ` Avi Kivity
  1 sibling, 0 replies; 13+ messages in thread
From: Avi Kivity @ 2012-04-16 11:59 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Gerhard Wiesinger, qemu-devel, kvm, Roedel, Joerg, Kevin Wolf

On 04/16/2012 01:25 PM, Jan Kiszka wrote:
> > 
> > Jan, Joerg, was an AMD erratum published for the bug?
>
> It wasn't an erratum but a documented feature limitation in the AMD
> architecture that was simply ignored by the old code.
>

Are you referring to

> 15.2.5 Restartable Instructions
> SVM is designed to safely restart, with the exception of task
> switches, any intercepted instruction
> (either atomic or idempotent) after the intercept.

?

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: DOS VM problem with QEMU-KVM and newer kernels
  2012-04-16 10:30     ` Roedel, Joerg
@ 2012-04-16 12:03       ` Avi Kivity
  2012-04-16 12:18         ` Gerhard Wiesinger
  0 siblings, 1 reply; 13+ messages in thread
From: Avi Kivity @ 2012-04-16 12:03 UTC (permalink / raw)
  To: Roedel, Joerg; +Cc: Jan Kiszka, Gerhard Wiesinger, qemu-devel, kvm, Kevin Wolf

On 04/16/2012 01:30 PM, Roedel, Joerg wrote:
> On Mon, Apr 16, 2012 at 12:25:37PM +0200, Jan Kiszka wrote:
> > On 2012-04-15 11:44, Avi Kivity wrote:
> > > Jan, Joerg, was an AMD erratum published for the bug?
> > 
> > It wasn't an erratum but a documented feature limitation in the AMD
> > architecture that was simply ignored by the old code.
>
> Right. But there is an erratum on K8 (only) which Kevin ran into. It is
> documented as Erratum 701 and the bug is that no EXITINTINFO is stored
> on a task-switch intercept on K8.

Ah, so this could affect Gerhard.  Gerhard, what's your cpu
family/model/stepping from /proc/cpuinfo?

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: DOS VM problem with QEMU-KVM and newer kernels
  2012-04-16 12:03       ` Avi Kivity
@ 2012-04-16 12:18         ` Gerhard Wiesinger
  2012-04-16 12:28           ` Avi Kivity
  0 siblings, 1 reply; 13+ messages in thread
From: Gerhard Wiesinger @ 2012-04-16 12:18 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Kevin Wolf, Roedel, Joerg, qemu-devel, kvm, Jan Kiszka

On Mon, 16 Apr 2012, Avi Kivity wrote:

> On 04/16/2012 01:30 PM, Roedel, Joerg wrote:
>> On Mon, Apr 16, 2012 at 12:25:37PM +0200, Jan Kiszka wrote:
>>> On 2012-04-15 11:44, Avi Kivity wrote:
>>>> Jan, Joerg, was an AMD erratum published for the bug?
>>>
>>> It wasn't an erratum but a documented feature limitation in the AMD
>>> architecture that was simply ignored by the old code.
>>
>> Right. But there is an erratum on K8 (only) which Kevin ran into. It is
>> documented as Erratum 701 and the bug is that no EXITINTINFO is stored
>> on a task-switch intercept on K8.
>
> Ah, so this could affect Gerhard.  Gerhard, what's your cpu
> family/model/stepping from /proc/cpuinfo?

Only CPU 0 of 3:
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 16
model           : 4
model name      : AMD Phenom(tm) II X4 940 Processor
stepping        : 2
microcode       : 0x1000086
cpu MHz         : 2999.912
cache size      : 512 KB
physical id     : 0
siblings        : 4
core id         : 0
cpu cores       : 4
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt hw_pstate npt lbrv svm_lock nrip_save
bogomips        : 5999.82
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate

part of cpuid, CPU 0:
    vendor_id = "AuthenticAMD"
    version information (1/eax):
       processor type  = primary processor (0)
       family          = Intel Pentium 4/Pentium D/Pentium Extreme Edition/Celeron/Xeon/Xeon MP/Itanium2, AMD Athlon 64/Athlon XP-M/Opteron/Sempron/Turion (15)
       model           = 0x4 (4)
       stepping id     = 0x2 (2)
       extended family = 0x1 (1)
       extended model  = 0x0 (0)
       (simple synth)  = AMD Quad-Core Opteron (Shanghai RB-C2) / Embedded Opteron (Shanghai RB-C2) / Athlon Dual-Core (Regor / Propus RB-C2) / Phenom II (Callisto / Heka / Deneb RB-C2), 45nm
    miscellaneous (1/ebx):
       process local APIC physical ID = 0x0 (0)
       cpu count                      = 0x4 (4)
       CLFLUSH line size              = 0x8 (8)
       brand index                    = 0x0 (0)
    brand id = 0x00 (0): unknown

Ciao,
Gerhard

--
http://www.wiesinger.com/

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: DOS VM problem with QEMU-KVM and newer kernels
  2012-04-16 12:18         ` Gerhard Wiesinger
@ 2012-04-16 12:28           ` Avi Kivity
  0 siblings, 0 replies; 13+ messages in thread
From: Avi Kivity @ 2012-04-16 12:28 UTC (permalink / raw)
  To: Gerhard Wiesinger; +Cc: Roedel, Joerg, Jan Kiszka, qemu-devel, kvm, Kevin Wolf

On 04/16/2012 03:18 PM, Gerhard Wiesinger wrote:
>>> Right. But there is an erratum on K8 (only) which Kevin ran into. It is
>>> documented as Erratum 701 and the bug is that no EXITINTINFO is stored
>>> on a task-switch intercept on K8.
>>
>> Ah, so this could affect Gerhard.  Gerhard, what's your cpu
>> family/model/stepping from /proc/cpuinfo?
>
>
> Only CPU 0 of 3:
> processor       : 0
> vendor_id       : AuthenticAMD
> cpu family      : 16
> model           : 4
> model name      : AMD Phenom(tm) II X4 940 Processor
> stepping        : 2
> microcode       : 0x1000086
> cpu MHz         : 2999.912
> cache size      : 512 KB
> physical id     : 0
> siblings        : 4
> core id         : 0
> cpu cores       : 4
> apicid          : 0
> initial apicid  : 0
> fpu             : yes
> fpu_exception   : yes
> cpuid level     : 5
> wp              : yes
> flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
> mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext
> fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl
> nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm
> extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit
> wdt hw_pstate npt lbrv svm_lock nrip_save
> bogomips        : 5999.82
> TLB size        : 1024 4K pages
> clflush size    : 64
> cache_alignment : 64
> address sizes   : 48 bits physical, 48 bits virtual
> power management: ts ttp tm stc 100mhzsteps hwpstate
>
> part of cpuid, CPU 0:
>    vendor_id = "AuthenticAMD"
>    version information (1/eax):
>       processor type  = primary processor (0)
>       family          = Intel Pentium 4/Pentium D/Pentium Extreme
> Edition/Celeron/Xeon/Xeon MP/Itanium2, AMD Athlon 64/Athlon
> XP-M/Opteron/Sempron/Turion (15)
>       model           = 0x4 (4)
>       stepping id     = 0x2 (2)
>       extended family = 0x1 (1)
>       extended model  = 0x0 (0)
>       (simple synth)  = AMD Quad-Core Opteron (Shanghai RB-C2) /
> Embedded Opteron (Shanghai RB-C2) / Athlon Dual-Core (Regor / Propus
> RB-C2) / Phenom II (Callisto / Heka / Deneb RB-C2), 45nm
>    miscellaneous (1/ebx):
>       process local APIC physical ID = 0x0 (0)
>       cpu count                      = 0x4 (4)
>       CLFLUSH line size              = 0x8 (8)
>       brand index                    = 0x0 (0)
>    brand id = 0x00 (0): unknown

So it's not a K8; we're dealing with a kvm bug.

(if it's really the task switch - we'll know when you post the traces).

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: DOS VM problem with QEMU-KVM and newer kernels
  2012-04-15  9:44 ` Avi Kivity
  2012-04-15 19:03   ` Gerhard Wiesinger
  2012-04-16 10:25   ` Jan Kiszka
@ 2012-04-17  6:04   ` Gerhard Wiesinger
  2012-04-17  6:57     ` Gleb Natapov
  2 siblings, 1 reply; 13+ messages in thread
From: Gerhard Wiesinger @ 2012-04-17  6:04 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Kevin Wolf, Jan Kiszka, qemu-devel, kvm, Roedel, Joerg

On 15.04.2012 11:44, Avi Kivity wrote:
> On 04/12/2012 09:32 PM, Gerhard Wiesinger wrote:
>> Hello,
>>
>> I'm having problems with recents kernels and qemu-kvm with a DOS VM:
>> TD286
>> System: Bad selector: 0007
>> System: Bad selector: 0D87
>> System: Bad selector: 001F
>> System: Bad selector: 0007
>> GP at 0020 21D4 EC 0DC4
>> Error 269 loading D:\BP\BIN\TD286.EXE into extended memory
>>
>> Another 286 DOS Extender application also rises a general protection
>> fault:
>> GP at 0020 18A1 CODE 357C
>>
>> Doesn't depend on the used DOS memory manager and is always
>> reproduceable.
>>
>> Depends only on kernel version and not qemu-kvm and seabios (tried to
>> bisect it without success):
>> # NOK: Linux 3.3.1-3.fc16.x86_64 #1 SMP Wed Apr 4 18:08:51 UTC 2012
>> x86_64 x86_64 x86_64 GNU/Linux
>> # NOK: Linux 3.2.10-3.fc16.x86_64 #1 SMP Thu Mar 15 19:39:46 UTC 2012
>> x86_64 x86_64 x86_64 GNU/Linux
>> # OK: Linux 3.1.9-1.fc16.x86_64 #1 SMP Fri Jan 13 16:37:42 UTC 2012
>> x86_64 x86_64 x86_64 GNU/Linux
>> # OK: Linux 2.6.41.9-1.fc15.x86_64 #1 SMP Fri Jan 13 16:46:51 UTC 2012
>> x86_64 x86_64 x86_64 GNU/Linux
>>
>> CPU is an AMD one.
>>
>> Any ideas how to fix it again?
>> Any switches which might help?
>>
>
> The trigger is probably
>
>> commit f1c1da2bde712812a3e0f9a7a7ebe7a916a4b5f4
>> Author: Jan Kiszka<jan.kiszka@siemens.com>
>> Date:   Tue Oct 18 18:23:11 2011 +0200
>>
>>      KVM: SVM: Keep intercepting task switching with NPT enabled
>>
>>      AMD processors apparently have a bug in the hardware task switching
>>      support when NPT is enabled. If the task switch triggers a NPF, we can
>>      get wrong EXITINTINFO along with that fault. On resume, spurious
>>      exceptions may then be injected into the guest.
>>
>>      We were able to reproduce this bug when our guest triggered #SS
>> and the
>>      handler were supposed to run over a separate task with not yet touched
>>      stack pages.
>>
>>      Work around the issue by continuing to emulate task switches even in
>>      NPT mode.
>>
>>      Signed-off-by: Jan Kiszka<jan.kiszka@siemens.com>
>>      Signed-off-by: Marcelo Tosatti<mtosatti@redhat.com>
> Although it's not the patch's direct fault - it simply exposed an
> existing bug in kvm.
>
> Things to try:
> - revert the patch with a newer kernel
> - try 3.4-rc2 which has some task switch fixes from Kevin; if you want a
> Fedora kernel, use rawhide's [2]
> - post traces [1]
>
> Jan, Joerg, was an AMD erratum published for the bug?
>
> [1] http://www.linux-kvm.org/page/Tracing
> [2]
> http://mirrors.kernel.org/fedora/development/rawhide/x86_64/os/Packages/k/kernel-3.4.0-0.rc2.git2.1.fc18.x86_64.rpm
>

Hello Avi,

Status is as follows:
1.) Kernel 3.4.x DIDN'T fix the problem
2.) Reverting f1c1da2bde712812a3e0f9a7a7ebe7a916a4b5f4 FIXED the problem.

So the bug is still in 3.2., 3.3, 3.4rc present and a possible fix 
doesn't work. Should be fixed in 3.4 release.

How to proceed further?

I can try some patches if you want.

Thnx for all your help.

Ciao,
Gerhard

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: DOS VM problem with QEMU-KVM and newer kernels
  2012-04-17  6:04   ` Gerhard Wiesinger
@ 2012-04-17  6:57     ` Gleb Natapov
  2012-04-17  7:33       ` [Qemu-devel] " Avi Kivity
  0 siblings, 1 reply; 13+ messages in thread
From: Gleb Natapov @ 2012-04-17  6:57 UTC (permalink / raw)
  To: Gerhard Wiesinger
  Cc: Kevin Wolf, kvm, Jan Kiszka, qemu-devel, Avi Kivity, Roedel, Joerg

On Tue, Apr 17, 2012 at 08:04:16AM +0200, Gerhard Wiesinger wrote:
> On 15.04.2012 11:44, Avi Kivity wrote:
> >On 04/12/2012 09:32 PM, Gerhard Wiesinger wrote:
> >>Hello,
> >>
> >>I'm having problems with recents kernels and qemu-kvm with a DOS VM:
> >>TD286
> >>System: Bad selector: 0007
> >>System: Bad selector: 0D87
> >>System: Bad selector: 001F
> >>System: Bad selector: 0007
> >>GP at 0020 21D4 EC 0DC4
> >>Error 269 loading D:\BP\BIN\TD286.EXE into extended memory
> >>
> >>Another 286 DOS Extender application also rises a general protection
> >>fault:
> >>GP at 0020 18A1 CODE 357C
> >>
> >>Doesn't depend on the used DOS memory manager and is always
> >>reproduceable.
> >>
> >>Depends only on kernel version and not qemu-kvm and seabios (tried to
> >>bisect it without success):
> >># NOK: Linux 3.3.1-3.fc16.x86_64 #1 SMP Wed Apr 4 18:08:51 UTC 2012
> >>x86_64 x86_64 x86_64 GNU/Linux
> >># NOK: Linux 3.2.10-3.fc16.x86_64 #1 SMP Thu Mar 15 19:39:46 UTC 2012
> >>x86_64 x86_64 x86_64 GNU/Linux
> >># OK: Linux 3.1.9-1.fc16.x86_64 #1 SMP Fri Jan 13 16:37:42 UTC 2012
> >>x86_64 x86_64 x86_64 GNU/Linux
> >># OK: Linux 2.6.41.9-1.fc15.x86_64 #1 SMP Fri Jan 13 16:46:51 UTC 2012
> >>x86_64 x86_64 x86_64 GNU/Linux
> >>
> >>CPU is an AMD one.
> >>
> >>Any ideas how to fix it again?
> >>Any switches which might help?
> >>
> >
> >The trigger is probably
> >
> >>commit f1c1da2bde712812a3e0f9a7a7ebe7a916a4b5f4
> >>Author: Jan Kiszka<jan.kiszka@siemens.com>
> >>Date:   Tue Oct 18 18:23:11 2011 +0200
> >>
> >>     KVM: SVM: Keep intercepting task switching with NPT enabled
> >>
> >>     AMD processors apparently have a bug in the hardware task switching
> >>     support when NPT is enabled. If the task switch triggers a NPF, we can
> >>     get wrong EXITINTINFO along with that fault. On resume, spurious
> >>     exceptions may then be injected into the guest.
> >>
> >>     We were able to reproduce this bug when our guest triggered #SS
> >>and the
> >>     handler were supposed to run over a separate task with not yet touched
> >>     stack pages.
> >>
> >>     Work around the issue by continuing to emulate task switches even in
> >>     NPT mode.
> >>
> >>     Signed-off-by: Jan Kiszka<jan.kiszka@siemens.com>
> >>     Signed-off-by: Marcelo Tosatti<mtosatti@redhat.com>
> >Although it's not the patch's direct fault - it simply exposed an
> >existing bug in kvm.
> >
> >Things to try:
> >- revert the patch with a newer kernel
> >- try 3.4-rc2 which has some task switch fixes from Kevin; if you want a
> >Fedora kernel, use rawhide's [2]
> >- post traces [1]
> >
> >Jan, Joerg, was an AMD erratum published for the bug?
> >
> >[1] http://www.linux-kvm.org/page/Tracing
> >[2]
> >http://mirrors.kernel.org/fedora/development/rawhide/x86_64/os/Packages/k/kernel-3.4.0-0.rc2.git2.1.fc18.x86_64.rpm
> >
> 
> Hello Avi,
> 
> Status is as follows:
> 1.) Kernel 3.4.x DIDN'T fix the problem
> 2.) Reverting f1c1da2bde712812a3e0f9a7a7ebe7a916a4b5f4 FIXED the problem.
> 
> So the bug is still in 3.2., 3.3, 3.4rc present and a possible fix
> doesn't work. Should be fixed in 3.4 release.
> 
> How to proceed further?
> 
Can you post image of your VM somewhere?

--
			Gleb.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Qemu-devel] DOS VM problem with QEMU-KVM and newer kernels
  2012-04-17  6:57     ` Gleb Natapov
@ 2012-04-17  7:33       ` Avi Kivity
  0 siblings, 0 replies; 13+ messages in thread
From: Avi Kivity @ 2012-04-17  7:33 UTC (permalink / raw)
  To: Gleb Natapov
  Cc: Gerhard Wiesinger, Kevin Wolf, Jan Kiszka, qemu-devel, kvm,
	Roedel, Joerg

On 04/17/2012 09:57 AM, Gleb Natapov wrote:
> > 
> > Status is as follows:
> > 1.) Kernel 3.4.x DIDN'T fix the problem
> > 2.) Reverting f1c1da2bde712812a3e0f9a7a7ebe7a916a4b5f4 FIXED the problem.
> > 
> > So the bug is still in 3.2., 3.3, 3.4rc present and a possible fix
> > doesn't work. Should be fixed in 3.4 release.
> > 
> > How to proceed further?
> > 
> Can you post image of your VM somewhere?
>

If you can't, then those traces would be a start.

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2012-04-17  7:34 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-12 18:32 DOS VM problem with QEMU-KVM and newer kernels Gerhard Wiesinger
2012-04-15  9:44 ` Avi Kivity
2012-04-15 19:03   ` Gerhard Wiesinger
2012-04-16 10:11     ` Avi Kivity
2012-04-16 10:25   ` Jan Kiszka
2012-04-16 10:30     ` Roedel, Joerg
2012-04-16 12:03       ` Avi Kivity
2012-04-16 12:18         ` Gerhard Wiesinger
2012-04-16 12:28           ` Avi Kivity
2012-04-16 11:59     ` Avi Kivity
2012-04-17  6:04   ` Gerhard Wiesinger
2012-04-17  6:57     ` Gleb Natapov
2012-04-17  7:33       ` [Qemu-devel] " Avi Kivity

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.