qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Win2k broken by kvmvapic
@ 2012-10-07 15:23 Blue Swirl
  2012-10-07 17:24 ` Jan Kiszka
  0 siblings, 1 reply; 4+ messages in thread
From: Blue Swirl @ 2012-10-07 15:23 UTC (permalink / raw)
  To: Jan Kiszka, Avi Kivity, qemu-devel

Hi,

Win2k does not work in HEAD, it resets the machine. I bisected this to
0b57e287138728f72d88b06e69b970c5d745c44a, but that does not look so
buggy.

Digging deeper, the problem is introduced by kvmvapic:
Breakpoint 1, cpu_physical_memory_write_rom (addr=0xca300,
    buf=0x7fffec66b500 "", len=0x5) at /src/qemu/exec.c:3536
3536                invalidate_and_set_dirty(addr1, l);
(gdb) bt
#0  cpu_physical_memory_write_rom (addr=0xca300, buf=0x7fffec66b500 "",
    len=0x5) at /src/qemu/exec.c:3536
#1  0x0000000000644089 in apic_sync_vapic (s=0x1a6ba60, sync_type=0x2)
    at /src/qemu/hw/i386/../apic.c:132

It looks like vapic is enabled even with KVM disabled and this causes
chaos. With -global apic.vapic=false Win2k works.

Maybe vapic shouldn't be enabled at all if KVM is not available and
apic_common.c needs kvm_enabled() checks before using vapic?

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

* Re: [Qemu-devel] Win2k broken by kvmvapic
  2012-10-07 15:23 [Qemu-devel] Win2k broken by kvmvapic Blue Swirl
@ 2012-10-07 17:24 ` Jan Kiszka
  2012-10-07 18:40   ` Blue Swirl
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Kiszka @ 2012-10-07 17:24 UTC (permalink / raw)
  To: Blue Swirl; +Cc: Avi Kivity, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1140 bytes --]

On 2012-10-07 17:23, Blue Swirl wrote:
> Hi,
> 
> Win2k does not work in HEAD, it resets the machine. I bisected this to
> 0b57e287138728f72d88b06e69b970c5d745c44a, but that does not look so
> buggy.
> 
> Digging deeper, the problem is introduced by kvmvapic:
> Breakpoint 1, cpu_physical_memory_write_rom (addr=0xca300,
>     buf=0x7fffec66b500 "", len=0x5) at /src/qemu/exec.c:3536
> 3536                invalidate_and_set_dirty(addr1, l);
> (gdb) bt
> #0  cpu_physical_memory_write_rom (addr=0xca300, buf=0x7fffec66b500 "",
>     len=0x5) at /src/qemu/exec.c:3536
> #1  0x0000000000644089 in apic_sync_vapic (s=0x1a6ba60, sync_type=0x2)
>     at /src/qemu/hw/i386/../apic.c:132
> 
> It looks like vapic is enabled even with KVM disabled

Which is intentional. The VAPIC is provided in a KVM-independent way to
the guest. Used to work fine with XP, but I never had my finger on a 2k
version.

> and this causes
> chaos. With -global apic.vapic=false Win2k works.

And that means we have a bug somewhere. Can you specify the chaos you
see in more details? Does your Win2k boot with KVM (and kvmvapic)?

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]

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

* Re: [Qemu-devel] Win2k broken by kvmvapic
  2012-10-07 17:24 ` Jan Kiszka
@ 2012-10-07 18:40   ` Blue Swirl
  2012-10-07 20:55     ` Jan Kiszka
  0 siblings, 1 reply; 4+ messages in thread
From: Blue Swirl @ 2012-10-07 18:40 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Avi Kivity, qemu-devel

On Sun, Oct 7, 2012 at 5:24 PM, Jan Kiszka <jan.kiszka@web.de> wrote:
> On 2012-10-07 17:23, Blue Swirl wrote:
>> Hi,
>>
>> Win2k does not work in HEAD, it resets the machine. I bisected this to
>> 0b57e287138728f72d88b06e69b970c5d745c44a, but that does not look so
>> buggy.
>>
>> Digging deeper, the problem is introduced by kvmvapic:
>> Breakpoint 1, cpu_physical_memory_write_rom (addr=0xca300,
>>     buf=0x7fffec66b500 "", len=0x5) at /src/qemu/exec.c:3536
>> 3536                invalidate_and_set_dirty(addr1, l);
>> (gdb) bt
>> #0  cpu_physical_memory_write_rom (addr=0xca300, buf=0x7fffec66b500 "",
>>     len=0x5) at /src/qemu/exec.c:3536
>> #1  0x0000000000644089 in apic_sync_vapic (s=0x1a6ba60, sync_type=0x2)
>>     at /src/qemu/hw/i386/../apic.c:132
>>
>> It looks like vapic is enabled even with KVM disabled
>
> Which is intentional. The VAPIC is provided in a KVM-independent way to
> the guest. Used to work fine with XP, but I never had my finger on a 2k
> version.
>
>> and this causes
>> chaos. With -global apic.vapic=false Win2k works.
>
> And that means we have a bug somewhere. Can you specify the chaos you
> see in more details? Does your Win2k boot with KVM (and kvmvapic)?

It works with KVM both with and without kvmvapic. There are these
error messages though:
(qemu) Invalid write to memory region kvm-pic
Invalid write to memory region kvm-pic

Here's 'info mtree' output, kvmvapic-rom line may be interesting:

memory
0000000000000000-7ffffffffffffffe (prio 0, RW): system
  0000000000000000-000000000fffffff (prio 0, RW): alias ram-below-4g
@pc.ram 0000000000000000-000000000fffffff
  00000000000a0000-00000000000bffff (prio 1, RW): alias smram-region
@pci 00000000000a0000-00000000000bffff
  00000000000c0000-00000000000c3fff (prio 1, R-): alias pam-rom
@pc.ram 00000000000c0000-00000000000c3fff
  00000000000c4000-00000000000c7fff (prio 1, R-): alias pam-rom
@pc.ram 00000000000c4000-00000000000c7fff
  00000000000c8000-00000000000cbfff (prio 1, R-): alias pam-rom
@pc.ram 00000000000c8000-00000000000cbfff
  00000000000ca000-00000000000ccfff (prio 1000, RW): alias
kvmvapic-rom @pc.ram 00000000000ca000-00000000000ccfff
  00000000000cc000-00000000000cffff (prio 1, R-): alias pam-rom
@pc.ram 00000000000cc000-00000000000cffff
  00000000000d0000-00000000000d3fff (prio 1, RW): alias pam-ram
@pc.ram 00000000000d0000-00000000000d3fff
  00000000000d4000-00000000000d7fff (prio 1, RW): alias pam-ram
@pc.ram 00000000000d4000-00000000000d7fff
  00000000000d8000-00000000000dbfff (prio 1, RW): alias pam-ram
@pc.ram 00000000000d8000-00000000000dbfff
  00000000000dc000-00000000000dffff (prio 1, RW): alias pam-ram
@pc.ram 00000000000dc000-00000000000dffff
  00000000000e0000-00000000000e3fff (prio 1, RW): alias pam-ram
@pc.ram 00000000000e0000-00000000000e3fff
  00000000000e4000-00000000000e7fff (prio 1, RW): alias pam-ram
@pc.ram 00000000000e4000-00000000000e7fff
  00000000000e8000-00000000000ebfff (prio 1, RW): alias pam-ram
@pc.ram 00000000000e8000-00000000000ebfff
  00000000000ec000-00000000000effff (prio 1, RW): alias pam-ram
@pc.ram 00000000000ec000-00000000000effff
  00000000000f0000-00000000000fffff (prio 1, R-): alias pam-rom
@pc.ram 00000000000f0000-00000000000fffff
  0000000010000000-00000000ffffffff (prio 0, RW): alias pci-hole @pci
0000000010000000-00000000ffffffff
  00000000fec00000-00000000fec00fff (prio 0, RW): kvm-ioapic
  00000000fed00000-00000000fed003ff (prio 0, RW): hpet
  00000000fee00000-00000000feefffff (prio 0, RW): kvm-apic-msi
  0000000100000000-40000000ffffffff (prio 0, RW): alias pci-hole64
@pci 0000000100000000-40000000ffffffff
I/O
0000000000000000-000000000000ffff (prio 0, RW): io
  0000000000000020-0000000000000021 (prio 0, RW): kvm-pic
  0000000000000040-0000000000000043 (prio 0, RW): kvm-pit
  0000000000000060-0000000000000060 (prio 0, RW): i8042-data
  0000000000000061-0000000000000061 (prio 0, RW): elcr
  0000000000000064-0000000000000064 (prio 0, RW): i8042-cmd
  0000000000000070-0000000000000071 (prio 0, RW): rtc
  000000000000007e-000000000000007f (prio 0, RW): kvmvapic
  0000000000000092-0000000000000092 (prio 0, RW): port92
  00000000000000a0-00000000000000a1 (prio 0, RW): kvm-pic
  0000000000000170-0000000000000177 (prio 0, RW): alias ide @ide
0000000000000170-0000000000000177
  00000000000001f0-00000000000001f7 (prio 0, RW): alias ide @ide
00000000000001f0-00000000000001f7
  0000000000000376-0000000000000376 (prio 0, RW): alias ide @ide
0000000000000376-0000000000000376
  0000000000000378-000000000000037f (prio 0, RW): alias parallel
@parallel 0000000000000378-000000000000037f
  00000000000003f1-00000000000003f5 (prio 0, RW): alias fdc @fdc
00000000000003f1-00000000000003f5
  00000000000003f6-00000000000003f6 (prio 0, RW): alias ide @ide
00000000000003f6-00000000000003f6
  00000000000003f7-00000000000003f7 (prio 0, RW): alias fdc @fdc
00000000000003f7-00000000000003f7
  00000000000003f8-00000000000003ff (prio 0, RW): serial
  00000000000004d0-00000000000004d0 (prio 0, RW): kvm-elcr
  00000000000004d1-00000000000004d1 (prio 0, RW): kvm-elcr
  0000000000000510-0000000000000511 (prio 0, RW): fwcfg
  0000000000000cf8-0000000000000cfb (prio 0, RW): pci-conf-idx
  0000000000000cfc-0000000000000cff (prio 0, RW): pci-conf-data
  0000000000005658-0000000000005658 (prio 0, RW): vmport
  000000000000c000-000000000000c0ff (prio 1, RW): es1370
  000000000000c100-000000000000c13f (prio 1, RW): e1000-io
  000000000000c140-000000000000c14f (prio 1, RW): piix-bmdma-container
    000000000000c140-000000000000c143 (prio 0, RW): piix-bmdma
    000000000000c144-000000000000c147 (prio 0, RW): bmdma
    000000000000c148-000000000000c14b (prio 0, RW): piix-bmdma
    000000000000c14c-000000000000c14f (prio 0, RW): bmdma
aliases
pc.ram
0000000000000000-000000000fffffff (prio 0, RW): pc.ram
pci
0000000000000000-7ffffffffffffffe (prio 0, RW): pci
  00000000000a0000-00000000000bffff (prio 1, RW): cirrus-lowmem-container
    00000000000a0000-00000000000a7fff (prio 1, RW): alias vga.bank0
@vga.vram 0000000000000000-0000000000007fff
    00000000000a0000-00000000000bffff (prio 0, RW): cirrus-low-memory
    00000000000a8000-00000000000affff (prio 1, RW): alias vga.bank1
@vga.vram 0000000000008000-000000000000ffff
  00000000000c0000-00000000000dffff (prio 1, RW): pc.rom
  00000000000e0000-00000000000fffff (prio 1, R-): alias isa-bios
@pc.bios 0000000000000000-000000000001ffff
  00000000fc000000-00000000fdffffff (prio 1, RW): cirrus-pci-bar0
    00000000fc000000-00000000fc7fffff (prio 1, RW): vga.vram
    00000000fc000000-00000000fc7fffff (prio 0, RW): cirrus-linear-io
    00000000fd000000-00000000fd3fffff (prio 0, RW): cirrus-bitblt-mmio
  00000000feba0000-00000000febbffff (prio 1, RW): e1000-mmio
  00000000febf0000-00000000febf0fff (prio 1, RW): cirrus-mmio
  00000000fffe0000-00000000ffffffff (prio 0, R-): pc.bios
ide
0000000000000000-7ffffffffffffffe (prio 0, RW): ide
ide
0000000000000000-7ffffffffffffffe (prio 0, RW): ide
ide
0000000000000000-7ffffffffffffffe (prio 0, RW): ide
parallel
0000000000000000-7ffffffffffffffe (prio 0, RW): parallel
fdc
0000000000000000-7ffffffffffffffe (prio 0, RW): fdc
ide
0000000000000000-7ffffffffffffffe (prio 0, RW): ide
fdc
0000000000000000-7ffffffffffffffe (prio 0, RW): fdc
vga.vram
0000000000000000-00000000007fffff (prio 1, RW): vga.vram
pc.bios
00000000fffe0000-00000000ffffffff (prio 0, R-): pc.bios

>
> Jan
>

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

* Re: [Qemu-devel] Win2k broken by kvmvapic
  2012-10-07 18:40   ` Blue Swirl
@ 2012-10-07 20:55     ` Jan Kiszka
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Kiszka @ 2012-10-07 20:55 UTC (permalink / raw)
  To: Blue Swirl; +Cc: Avi Kivity, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 2506 bytes --]

On 2012-10-07 20:40, Blue Swirl wrote:
> On Sun, Oct 7, 2012 at 5:24 PM, Jan Kiszka <jan.kiszka@web.de> wrote:
>> On 2012-10-07 17:23, Blue Swirl wrote:
>>> Hi,
>>>
>>> Win2k does not work in HEAD, it resets the machine. I bisected this to
>>> 0b57e287138728f72d88b06e69b970c5d745c44a, but that does not look so
>>> buggy.
>>>
>>> Digging deeper, the problem is introduced by kvmvapic:
>>> Breakpoint 1, cpu_physical_memory_write_rom (addr=0xca300,
>>>     buf=0x7fffec66b500 "", len=0x5) at /src/qemu/exec.c:3536
>>> 3536                invalidate_and_set_dirty(addr1, l);
>>> (gdb) bt
>>> #0  cpu_physical_memory_write_rom (addr=0xca300, buf=0x7fffec66b500 "",
>>>     len=0x5) at /src/qemu/exec.c:3536
>>> #1  0x0000000000644089 in apic_sync_vapic (s=0x1a6ba60, sync_type=0x2)
>>>     at /src/qemu/hw/i386/../apic.c:132
>>>
>>> It looks like vapic is enabled even with KVM disabled
>>
>> Which is intentional. The VAPIC is provided in a KVM-independent way to
>> the guest. Used to work fine with XP, but I never had my finger on a 2k
>> version.
>>
>>> and this causes
>>> chaos. With -global apic.vapic=false Win2k works.
>>
>> And that means we have a bug somewhere. Can you specify the chaos you
>> see in more details? Does your Win2k boot with KVM (and kvmvapic)?
> 
> It works with KVM both with and without kvmvapic. There are these
> error messages though:
> (qemu) Invalid write to memory region kvm-pic
> Invalid write to memory region kvm-pic

Weird, that's a PIO region. And the KVM kernel module should catch all
accesses.

> 
> Here's 'info mtree' output, kvmvapic-rom line may be interesting:
> 
> memory
> 0000000000000000-7ffffffffffffffe (prio 0, RW): system
>   0000000000000000-000000000fffffff (prio 0, RW): alias ram-below-4g
> @pc.ram 0000000000000000-000000000fffffff
>   00000000000a0000-00000000000bffff (prio 1, RW): alias smram-region
> @pci 00000000000a0000-00000000000bffff
>   00000000000c0000-00000000000c3fff (prio 1, R-): alias pam-rom
> @pc.ram 00000000000c0000-00000000000c3fff
>   00000000000c4000-00000000000c7fff (prio 1, R-): alias pam-rom
> @pc.ram 00000000000c4000-00000000000c7fff
>   00000000000c8000-00000000000cbfff (prio 1, R-): alias pam-rom
> @pc.ram 00000000000c8000-00000000000cbfff
>   00000000000ca000-00000000000ccfff (prio 1000, RW): alias
> kvmvapic-rom @pc.ram 00000000000ca000-00000000000ccfff

Looks ok - it's kind of an option ROM.

Guess I need to dig for a Win2k CD...

Jan



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]

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

end of thread, other threads:[~2012-10-07 20:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-07 15:23 [Qemu-devel] Win2k broken by kvmvapic Blue Swirl
2012-10-07 17:24 ` Jan Kiszka
2012-10-07 18:40   ` Blue Swirl
2012-10-07 20:55     ` Jan Kiszka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).