All of lore.kernel.org
 help / color / mirror / Atom feed
* [nVMX w/ Haswell] KVM unit-tests in L1 - eventinj test fails trying to send NMI
@ 2013-06-04 12:44 Kashyap Chamarthy
  2013-06-05  9:06 ` Kashyap Chamarthy
  0 siblings, 1 reply; 6+ messages in thread
From: Kashyap Chamarthy @ 2013-06-04 12:44 UTC (permalink / raw)
  To: kvm

Heya,

So, I invoked this in L1 with:
=======================
[test@foo kvm-unit-tests]$ time qemu-system-x86_64 -enable-kvm -device
pc-testdev -serial stdio -nographic -no-user-config -nodefaults
-device
isa-debug-exit,iobase=0xf4,iosize=0x4 -kernel ./x86/eventinj.flat |
tee /var/tmp/eventinj-test.txt
enabling apic
paging enabled
cr0 = 80010011
cr3 = 7fff000
cr4 = 20
Try to divide by 0
DE isr running divider is 0
Result is 150
DE exception: PASS
Try int 3
BP isr running
After int 3
BP exception: PASS
Try send vec 33 to itself
irq1 running
After vec 33 to itself
vec 33: PASS
Try int $33
irq1 running
After int $33
int $33: PASS
Try send vec 32 and 33 to itself
irq1 running
irq0 running
After vec 32 and 33 to itself
vec 32/33: PASS
Try send vec 32 and int $33
irq1 running
irq0 running
After vec 32 and int $33
vec 32/int $33: PASS
Try send vec 33 and 62 and mask one with TPR
irq1 running
After 33/62 TPR test
TPR: PASS
irq0 running
Try send NMI to itself
After NMI to itself
NMI: FAIL
Try int 33 with shadowed stack
irq1 running
After int 33 with shadowed stack
int 33 with shadowed stack: PASS

summary: 9 tests, 1 failures

real    0m0.647s
user    0m0.164s
sys     0m0.146s
[test@foo kvm-unit-tests]$
=======================

Any hints on further debugging this ?


Other info:
--------------

- L1's qemu-kvm CLI
=======================
# ps -ef | grep -i qemu
qemu      5455     1 94 Jun02 ?        1-07:14:29
/usr/bin/qemu-system-x86_64 -machine accel=kvm -name regular-guest -S
-machine pc-i440fx-1.4,accel=kvm,usb=off -cpu Haswell,+vmx -m 10240
-smp 4,sockets=4,cores=1,threads=1 -uuid
4ed9ac0b-7f72-dfcf-68b3-e6fe2ac588b2 -nographic -no-user-config
-nodefaults -chardev
socket,id=charmonitor,path=/var/lib/libvirt/qemu/regular-guest.monitor,server,nowait
-mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc
-no-shutdown -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2
-drive file=/home/test/vmimages/regular-guest.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none
-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1
-netdev tap,fd=23,id=hostnet0,vhost=on,vhostfd=24 -device
virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:80:c1:34,bus=pci.0,addr=0x3
-chardev pty,id=charserial0 -device
isa-serial,chardev=charserial0,id=serial0 -device usb-tablet,id=input0
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5
root     12255  5419  0 08:41 pts/2    00:00:00 grep --color=auto -i qemu
=======================

- Setup details --
https://github.com/kashyapc/nvmx-haswell/blob/master/SETUP-nVMX.rst

/kashyap

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

* Re: [nVMX w/ Haswell] KVM unit-tests in L1 - eventinj test fails trying to send NMI
  2013-06-04 12:44 [nVMX w/ Haswell] KVM unit-tests in L1 - eventinj test fails trying to send NMI Kashyap Chamarthy
@ 2013-06-05  9:06 ` Kashyap Chamarthy
  2013-06-26  6:28   ` Jan Kiszka
  0 siblings, 1 reply; 6+ messages in thread
From: Kashyap Chamarthy @ 2013-06-05  9:06 UTC (permalink / raw)
  To: kvm, Nakajima, Jun, Jan Kiszka

Adding Jan, Jun, to see if they have any inputs here.

/kashyap

On Tue, Jun 4, 2013 at 6:14 PM, Kashyap Chamarthy <kashyap.cv@gmail.com> wrote:
> Heya,
>
> So, I invoked this in L1 with:
> =======================
> [test@foo kvm-unit-tests]$ time qemu-system-x86_64 -enable-kvm -device
> pc-testdev -serial stdio -nographic -no-user-config -nodefaults
> -device
> isa-debug-exit,iobase=0xf4,iosize=0x4 -kernel ./x86/eventinj.flat |
> tee /var/tmp/eventinj-test.txt
> enabling apic
> paging enabled
> cr0 = 80010011
> cr3 = 7fff000
> cr4 = 20
> Try to divide by 0
> DE isr running divider is 0
> Result is 150
> DE exception: PASS
> Try int 3
> BP isr running
> After int 3
> BP exception: PASS
> Try send vec 33 to itself
> irq1 running
> After vec 33 to itself
> vec 33: PASS
> Try int $33
> irq1 running
> After int $33
> int $33: PASS
> Try send vec 32 and 33 to itself
> irq1 running
> irq0 running
> After vec 32 and 33 to itself
> vec 32/33: PASS
> Try send vec 32 and int $33
> irq1 running
> irq0 running
> After vec 32 and int $33
> vec 32/int $33: PASS
> Try send vec 33 and 62 and mask one with TPR
> irq1 running
> After 33/62 TPR test
> TPR: PASS
> irq0 running
> Try send NMI to itself
> After NMI to itself
> NMI: FAIL
> Try int 33 with shadowed stack
> irq1 running
> After int 33 with shadowed stack
> int 33 with shadowed stack: PASS
>
> summary: 9 tests, 1 failures
>
> real    0m0.647s
> user    0m0.164s
> sys     0m0.146s
> [test@foo kvm-unit-tests]$
> =======================
>
> Any hints on further debugging this ?
>
>
> Other info:
> --------------
>
> - L1's qemu-kvm CLI
> =======================
> # ps -ef | grep -i qemu
> qemu      5455     1 94 Jun02 ?        1-07:14:29
> /usr/bin/qemu-system-x86_64 -machine accel=kvm -name regular-guest -S
> -machine pc-i440fx-1.4,accel=kvm,usb=off -cpu Haswell,+vmx -m 10240
> -smp 4,sockets=4,cores=1,threads=1 -uuid
> 4ed9ac0b-7f72-dfcf-68b3-e6fe2ac588b2 -nographic -no-user-config
> -nodefaults -chardev
> socket,id=charmonitor,path=/var/lib/libvirt/qemu/regular-guest.monitor,server,nowait
> -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc
> -no-shutdown -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2
> -drive file=/home/test/vmimages/regular-guest.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none
> -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1
> -netdev tap,fd=23,id=hostnet0,vhost=on,vhostfd=24 -device
> virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:80:c1:34,bus=pci.0,addr=0x3
> -chardev pty,id=charserial0 -device
> isa-serial,chardev=charserial0,id=serial0 -device usb-tablet,id=input0
> -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5
> root     12255  5419  0 08:41 pts/2    00:00:00 grep --color=auto -i qemu
> =======================
>
> - Setup details --
> https://github.com/kashyapc/nvmx-haswell/blob/master/SETUP-nVMX.rst
>
> /kashyap

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

* Re: [nVMX w/ Haswell] KVM unit-tests in L1 - eventinj test fails trying to send NMI
  2013-06-05  9:06 ` Kashyap Chamarthy
@ 2013-06-26  6:28   ` Jan Kiszka
  2013-06-26  8:03     ` Kashyap Chamarthy
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Kiszka @ 2013-06-26  6:28 UTC (permalink / raw)
  To: Kashyap Chamarthy; +Cc: kvm, Nakajima, Jun, Ren, Yongjie

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

On 2013-06-05 11:06, Kashyap Chamarthy wrote:
> Adding Jan, Jun, to see if they have any inputs here.

Thanks for the note, it's very helpful! This test actually fails on
older CPUs as well, and I can finally reproduce the issue that Jay also
reported. I'm not able to "cure" it by going back to 3b656cf764^, just
alter the error report. Anyway, a start. Now I just need time to debug it...

Jan

> 
> /kashyap
> 
> On Tue, Jun 4, 2013 at 6:14 PM, Kashyap Chamarthy <kashyap.cv@gmail.com> wrote:
>> Heya,
>>
>> So, I invoked this in L1 with:
>> =======================
>> [test@foo kvm-unit-tests]$ time qemu-system-x86_64 -enable-kvm -device
>> pc-testdev -serial stdio -nographic -no-user-config -nodefaults
>> -device
>> isa-debug-exit,iobase=0xf4,iosize=0x4 -kernel ./x86/eventinj.flat |
>> tee /var/tmp/eventinj-test.txt
>> enabling apic
>> paging enabled
>> cr0 = 80010011
>> cr3 = 7fff000
>> cr4 = 20
>> Try to divide by 0
>> DE isr running divider is 0
>> Result is 150
>> DE exception: PASS
>> Try int 3
>> BP isr running
>> After int 3
>> BP exception: PASS
>> Try send vec 33 to itself
>> irq1 running
>> After vec 33 to itself
>> vec 33: PASS
>> Try int $33
>> irq1 running
>> After int $33
>> int $33: PASS
>> Try send vec 32 and 33 to itself
>> irq1 running
>> irq0 running
>> After vec 32 and 33 to itself
>> vec 32/33: PASS
>> Try send vec 32 and int $33
>> irq1 running
>> irq0 running
>> After vec 32 and int $33
>> vec 32/int $33: PASS
>> Try send vec 33 and 62 and mask one with TPR
>> irq1 running
>> After 33/62 TPR test
>> TPR: PASS
>> irq0 running
>> Try send NMI to itself
>> After NMI to itself
>> NMI: FAIL
>> Try int 33 with shadowed stack
>> irq1 running
>> After int 33 with shadowed stack
>> int 33 with shadowed stack: PASS
>>
>> summary: 9 tests, 1 failures
>>
>> real    0m0.647s
>> user    0m0.164s
>> sys     0m0.146s
>> [test@foo kvm-unit-tests]$
>> =======================
>>
>> Any hints on further debugging this ?
>>
>>
>> Other info:
>> --------------
>>
>> - L1's qemu-kvm CLI
>> =======================
>> # ps -ef | grep -i qemu
>> qemu      5455     1 94 Jun02 ?        1-07:14:29
>> /usr/bin/qemu-system-x86_64 -machine accel=kvm -name regular-guest -S
>> -machine pc-i440fx-1.4,accel=kvm,usb=off -cpu Haswell,+vmx -m 10240
>> -smp 4,sockets=4,cores=1,threads=1 -uuid
>> 4ed9ac0b-7f72-dfcf-68b3-e6fe2ac588b2 -nographic -no-user-config
>> -nodefaults -chardev
>> socket,id=charmonitor,path=/var/lib/libvirt/qemu/regular-guest.monitor,server,nowait
>> -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc
>> -no-shutdown -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2
>> -drive file=/home/test/vmimages/regular-guest.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none
>> -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1
>> -netdev tap,fd=23,id=hostnet0,vhost=on,vhostfd=24 -device
>> virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:80:c1:34,bus=pci.0,addr=0x3
>> -chardev pty,id=charserial0 -device
>> isa-serial,chardev=charserial0,id=serial0 -device usb-tablet,id=input0
>> -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5
>> root     12255  5419  0 08:41 pts/2    00:00:00 grep --color=auto -i qemu
>> =======================
>>
>> - Setup details --
>> https://github.com/kashyapc/nvmx-haswell/blob/master/SETUP-nVMX.rst
>>
>> /kashyap


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

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

* Re: [nVMX w/ Haswell] KVM unit-tests in L1 - eventinj test fails trying to send NMI
  2013-06-26  6:28   ` Jan Kiszka
@ 2013-06-26  8:03     ` Kashyap Chamarthy
  2013-06-26 17:19       ` Jan Kiszka
  0 siblings, 1 reply; 6+ messages in thread
From: Kashyap Chamarthy @ 2013-06-26  8:03 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: kvm, Nakajima, Jun, Ren, Yongjie

> Thanks for the note, it's very helpful! This test actually fails on
> older CPUs as well, and I can finally reproduce the issue that Jay also
> reported. I'm not able to "cure" it by going back to 3b656cf764^,

Ok, you tried w/o this commit..
------------------------
commit 3b656cf764cbc43d3efb9bf5f45c618d4cf0989f
Author: Jan Kiszka <jan.kiszka@siemens.com>
Date:   Sun Apr 14 12:12:45 2013 +0200

    KVM: nVMX: Fix injection of PENDING_INTERRUPT and NMI_WINDOW exits to L1

    Check if the interrupt or NMI window exit is for L1 by testing if it has
    the corresponding controls enabled. This is required when we allow
    direct injection from L0 to L2
------------------------

>  just
> alter the error report. Anyway, a start. Now I just need time to debug it...

Great, would you prefer a bug to track this? Or will that be ignored? :)

Don't hesitate to let me know if you need any further testing help or
want me to try something specific.

Thanks.

>
> Jan
>
>>
>> /kashyap
>>
>> On Tue, Jun 4, 2013 at 6:14 PM, Kashyap Chamarthy <kashyap.cv@gmail.com> wrote:
>>> Heya,
>>>
>>> So, I invoked this in L1 with:
>>> =======================
>>> [test@foo kvm-unit-tests]$ time qemu-system-x86_64 -enable-kvm -device
>>> pc-testdev -serial stdio -nographic -no-user-config -nodefaults
>>> -device
>>> isa-debug-exit,iobase=0xf4,iosize=0x4 -kernel ./x86/eventinj.flat |
>>> tee /var/tmp/eventinj-test.txt
>>> enabling apic
>>> paging enabled
>>> cr0 = 80010011
>>> cr3 = 7fff000
>>> cr4 = 20
>>> Try to divide by 0
>>> DE isr running divider is 0
>>> Result is 150
>>> DE exception: PASS
>>> Try int 3
>>> BP isr running
>>> After int 3
>>> BP exception: PASS
>>> Try send vec 33 to itself
>>> irq1 running
>>> After vec 33 to itself
>>> vec 33: PASS
>>> Try int $33
>>> irq1 running
>>> After int $33
>>> int $33: PASS
>>> Try send vec 32 and 33 to itself
>>> irq1 running
>>> irq0 running
>>> After vec 32 and 33 to itself
>>> vec 32/33: PASS
>>> Try send vec 32 and int $33
>>> irq1 running
>>> irq0 running
>>> After vec 32 and int $33
>>> vec 32/int $33: PASS
>>> Try send vec 33 and 62 and mask one with TPR
>>> irq1 running
>>> After 33/62 TPR test
>>> TPR: PASS
>>> irq0 running
>>> Try send NMI to itself
>>> After NMI to itself
>>> NMI: FAIL
>>> Try int 33 with shadowed stack
>>> irq1 running
>>> After int 33 with shadowed stack
>>> int 33 with shadowed stack: PASS
>>>
>>> summary: 9 tests, 1 failures
>>>
>>> real    0m0.647s
>>> user    0m0.164s
>>> sys     0m0.146s
>>> [test@foo kvm-unit-tests]$
>>> =======================
>>>
>>> Any hints on further debugging this ?
>>>
>>>
>>> Other info:
>>> --------------
>>>
>>> - L1's qemu-kvm CLI
>>> =======================
>>> # ps -ef | grep -i qemu
>>> qemu      5455     1 94 Jun02 ?        1-07:14:29
>>> /usr/bin/qemu-system-x86_64 -machine accel=kvm -name regular-guest -S
>>> -machine pc-i440fx-1.4,accel=kvm,usb=off -cpu Haswell,+vmx -m 10240
>>> -smp 4,sockets=4,cores=1,threads=1 -uuid
>>> 4ed9ac0b-7f72-dfcf-68b3-e6fe2ac588b2 -nographic -no-user-config
>>> -nodefaults -chardev
>>> socket,id=charmonitor,path=/var/lib/libvirt/qemu/regular-guest.monitor,server,nowait
>>> -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc
>>> -no-shutdown -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2
>>> -drive file=/home/test/vmimages/regular-guest.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none
>>> -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1
>>> -netdev tap,fd=23,id=hostnet0,vhost=on,vhostfd=24 -device
>>> virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:80:c1:34,bus=pci.0,addr=0x3
>>> -chardev pty,id=charserial0 -device
>>> isa-serial,chardev=charserial0,id=serial0 -device usb-tablet,id=input0
>>> -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5
>>> root     12255  5419  0 08:41 pts/2    00:00:00 grep --color=auto -i qemu
>>> =======================
>>>
>>> - Setup details --
>>> https://github.com/kashyapc/nvmx-haswell/blob/master/SETUP-nVMX.rst
>>>
>>> /kashyap
>

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

* Re: [nVMX w/ Haswell] KVM unit-tests in L1 - eventinj test fails trying to send NMI
  2013-06-26  8:03     ` Kashyap Chamarthy
@ 2013-06-26 17:19       ` Jan Kiszka
  2013-06-27  9:36         ` Kashyap Chamarthy
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Kiszka @ 2013-06-26 17:19 UTC (permalink / raw)
  To: Kashyap Chamarthy; +Cc: kvm, Nakajima, Jun, Ren, Yongjie

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

On 2013-06-26 10:03, Kashyap Chamarthy wrote:
>> Thanks for the note, it's very helpful! This test actually fails on
>> older CPUs as well, and I can finally reproduce the issue that Jay also
>> reported. I'm not able to "cure" it by going back to 3b656cf764^,
> 
> Ok, you tried w/o this commit..
> ------------------------
> commit 3b656cf764cbc43d3efb9bf5f45c618d4cf0989f
> Author: Jan Kiszka <jan.kiszka@siemens.com>
> Date:   Sun Apr 14 12:12:45 2013 +0200
> 
>     KVM: nVMX: Fix injection of PENDING_INTERRUPT and NMI_WINDOW exits to L1
> 
>     Check if the interrupt or NMI window exit is for L1 by testing if it has
>     the corresponding controls enabled. This is required when we allow
>     direct injection from L0 to L2
> ------------------------

I first tried by reverting to the commit before this one, just like Jay
reported for https://bugzilla.kernel.org/show_bug.cgi?id=58941. But this
just varied the error (kvm reports an internal error), didn't solve the
issue. Now I simply reverted the commit on top of next, but without an
effect. Looks like those problems are not directly related.

Kashyap, you can do us a favor and try to find out if there was a commit
in the recent history (roughly before I started to hack on nVMX this
year) where this test cases succeeded.

TIA,
Jan



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

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

* Re: [nVMX w/ Haswell] KVM unit-tests in L1 - eventinj test fails trying to send NMI
  2013-06-26 17:19       ` Jan Kiszka
@ 2013-06-27  9:36         ` Kashyap Chamarthy
  0 siblings, 0 replies; 6+ messages in thread
From: Kashyap Chamarthy @ 2013-06-27  9:36 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: kvm, Nakajima, Jun, Ren, Yongjie

On Wed, Jun 26, 2013 at 10:49 PM, Jan Kiszka <jan.kiszka@web.de> wrote:
> On 2013-06-26 10:03, Kashyap Chamarthy wrote:
>>> Thanks for the note, it's very helpful! This test actually fails on
>>> older CPUs as well, and I can finally reproduce the issue that Jay also
>>> reported. I'm not able to "cure" it by going back to 3b656cf764^,
>>
>> Ok, you tried w/o this commit..
>> ------------------------
>> commit 3b656cf764cbc43d3efb9bf5f45c618d4cf0989f
>> Author: Jan Kiszka <jan.kiszka@siemens.com>
>> Date:   Sun Apr 14 12:12:45 2013 +0200
>>
>>     KVM: nVMX: Fix injection of PENDING_INTERRUPT and NMI_WINDOW exits to L1
>>
>>     Check if the interrupt or NMI window exit is for L1 by testing if it has
>>     the corresponding controls enabled. This is required when we allow
>>     direct injection from L0 to L2
>> ------------------------
>
> I first tried by reverting to the commit before this one, just like Jay
> reported for https://bugzilla.kernel.org/show_bug.cgi?id=58941. But this
> just varied the error (kvm reports an internal error), didn't solve the
> issue. Now I simply reverted the commit on top of next, but without an
> effect. Looks like those problems are not directly related.
>
> Kashyap, you can do us a favor and try to find out if there was a commit
> in the recent history (roughly before I started to hack on nVMX this
> year) where this test cases succeeded.

Ok, will try this week by trial and error. I'm currently heads down on
a couple of other things.

By "this test cases succeeded" - I interpret it as "NMI tests" succeeded too.

Thanks.

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

end of thread, other threads:[~2013-06-27  9:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-04 12:44 [nVMX w/ Haswell] KVM unit-tests in L1 - eventinj test fails trying to send NMI Kashyap Chamarthy
2013-06-05  9:06 ` Kashyap Chamarthy
2013-06-26  6:28   ` Jan Kiszka
2013-06-26  8:03     ` Kashyap Chamarthy
2013-06-26 17:19       ` Jan Kiszka
2013-06-27  9:36         ` Kashyap Chamarthy

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.