[COMMIT master] test: realmode: fix pusha test

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com 'pop esp' destroys the stack, avoid it Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/kvm/test/x86/realmode.c b/kvm/test/x86/realmode.c index bd79348..d0cc3dc 100644 --- a/kvm/test/x86/realmode.c +++

[COMMIT master] device-assignment: Use PCI I/O port sysfs resource file when available

2010-08-02 Thread Avi Kivity
From: Alex Williamson alex.william...@redhat.com When supported by the host kernel, we can use read/write on the PCI sysfs resource file for I/O port regions. This allows us to avoid raw in/out commands and works with deprivileged guests via libvirt. Signed-off-by: Alex Williamson

[COMMIT master] test: access: separate pool from ac_test_t struct

2010-08-02 Thread Avi Kivity
From: Xiao Guangrong xiaoguangr...@cn.fujitsu.com Separate pool from the ac_test_t struct, later we will use multiple ac_test_t units, those units should allocate pte from the same pool to avoid mapping to the same pte Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com Signed-off-by:

[COMMIT master] test: access: separate expect status updates from ac_test_setup_pte() function

2010-08-02 Thread Avi Kivity
From: Xiao Guangrong xiaoguangr...@cn.fujitsu.com Separate expect status updates operation, later we can just modify the access way(i,e the AC_ACCESS_* flags) Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git

[COMMIT master] test: move ARRAY_SIZE() to libcflat.h

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/kvm/test/lib/libcflat.h b/kvm/test/lib/libcflat.h index 1da4013..7274fed 100644 --- a/kvm/test/lib/libcflat.h +++ b/kvm/test/lib/libcflat.h @@ -39,4 +39,6 @@

[COMMIT master] test: emulator: test LOCK NEG and LOCK NOT

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/kvm/test/x86/emulator.c b/kvm/test/x86/emulator.c index db6a134..476f86f 100644 --- a/kvm/test/x86/emulator.c +++ b/kvm/test/x86/emulator.c @@ -220,9 +220,10

[COMMIT master] test: realmode: fix pusha test stack

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com pusha needs some stack space, or it will fault. The supplied value of 7 is too small. Provide a real stack for pusha. Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/kvm/test/x86/realmode.c

[COMMIT master] test: add type bool

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/kvm/test/lib/libcflat.h b/kvm/test/lib/libcflat.h index 2e2a8bf..d0d3df2 100644 --- a/kvm/test/lib/libcflat.h +++ b/kvm/test/lib/libcflat.h @@ -28,6 +28,10

[COMMIT master] test: move memset() to libcflat

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/kvm/test/lib/libcflat.h b/kvm/test/lib/libcflat.h index 7274fed..2e2a8bf 100644 --- a/kvm/test/lib/libcflat.h +++ b/kvm/test/lib/libcflat.h @@ -27,6 +27,7 @@

[COMMIT master] test: add processor register access functions

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/kvm/test/lib/x86/processor.h b/kvm/test/lib/x86/processor.h new file mode 100644 index 000..ea44a9d --- /dev/null +++ b/kvm/test/lib/x86/processor.h @@

[COMMIT master] test: add svm definitions header

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/kvm/test/x86/svm.h b/kvm/test/x86/svm.h new file mode 100644 index 000..3fdc0d3 --- /dev/null +++ b/kvm/test/x86/svm.h @@ -0,0 +1,328 @@ +#ifndef __SVM_H

[COMMIT master] test: add scratch word for use by svm tests

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/kvm/test/x86/svm.c b/kvm/test/x86/svm.c index af0e60c..5bb64ff 100644 --- a/kvm/test/x86/svm.c +++ b/kvm/test/x86/svm.c @@ -63,6 +63,7 @@ struct test {

[COMMIT master] test: add pause() instruction accessor

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/kvm/test/lib/x86/processor.h b/kvm/test/lib/x86/processor.h index ea44a9d..0376d04 100644 --- a/kvm/test/lib/x86/processor.h +++

[COMMIT master] test: ensure svm tests are executed with interrupts disabled by default

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/kvm/test/x86/svm.c b/kvm/test/x86/svm.c index 222356d..3c30118 100644 --- a/kvm/test/x86/svm.c +++ b/kvm/test/x86/svm.c @@ -110,6 +110,7 @@ static bool

[COMMIT master] test: add cli() and sti() instruction accessors

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/kvm/test/lib/x86/processor.h b/kvm/test/lib/x86/processor.h index 0376d04..67d7ca5 100644 --- a/kvm/test/lib/x86/processor.h +++

[COMMIT master] test: add svm tests

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/kvm/test/config-x86-common.mak b/kvm/test/config-x86-common.mak index 00817dc..19bffd4 100644 --- a/kvm/test/config-x86-common.mak +++

[COMMIT master] test: Run tests only if supported on the current hardware

2010-08-02 Thread Avi Kivity
From: Roedel, Joerg joerg.roe...@amd.com Signed-off-by: Joerg Roedel joerg.roe...@amd.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/kvm/test/x86/svm.c b/kvm/test/x86/svm.c index cb26af6..628f3aa 100644 --- a/kvm/test/x86/svm.c +++ b/kvm/test/x86/svm.c @@ -58,6 +58,7 @@

[COMMIT master] test: verify that the emulator honours svm intercepts

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/kvm/test/x86/svm.c b/kvm/test/x86/svm.c index 3c30118..cb26af6 100644 --- a/kvm/test/x86/svm.c +++ b/kvm/test/x86/svm.c @@ -3,6 +3,7 @@ #include processor.h

[COMMIT master] test: add intercepted and unintercepted cr3 read tests for svm

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/kvm/test/x86/svm.c b/kvm/test/x86/svm.c index 5bb64ff..222356d 100644 --- a/kvm/test/x86/svm.c +++ b/kvm/test/x86/svm.c @@ -146,12 +146,36 @@ static bool

[COMMIT master] KVM: x86 emulator: consolidate inc/dec reg decoding

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index f774ce3..d84f1f7 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -147,10 +147,8 @@

[COMMIT master] KVM: MMU: fix compile warning in kvm_mmu_pte_write

2010-08-02 Thread Avi Kivity
From: Xiao Guangrong xiaoguangr...@cn.fujitsu.com Fix: arch/x86/kvm/mmu.c: In function 'kvm_mmu_pte_write': arch/x86/kvm/mmu.c:2908: warning: suggest parentheses around operand of '!' or change '' to '' or '!' to '~' Reported-by: Stephen Rothwell s...@canb.auug.org.au Signed-off-by: Xiao

[COMMIT master] KVM: X86 emulator: consolidate Jcc rel8 decoding

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 00bc73d..373dea3 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -161,12 +161,8 @@

[COMMIT master] KVM: x86 emulator: consolidate CMOVcc decoding

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 5b1d3fb..5106acc 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -238,16 +238,8 @@

[COMMIT master] KVM: VMX: Fix host GDT.LIMIT corruption

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com vmx does not restore GDT.LIMIT to the host value, instead it sets it to 64KB. This means host userspace can learn a few bits of host memory. Fix by reloading GDTR when we load other host state. Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo

[COMMIT master] KVM: x86 emulator: convert group 3 to new style

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 049d63d..485528b 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -105,7 +105,7 @@

[COMMIT master] KVM: x86 emulator: introduce 'struct opcode'

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com This will hold all the information known about the opcode. Currently, this is just the decode flags. Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index

[COMMIT master] KVM: x86 emulator: drop parentheses in repreat macros

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com The parenthese make is impossible to use the macros with initializers that require braces. Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index

[COMMIT master] KVM: x86 emulator: move group tables to top

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com No code changes. Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 52399c8..2078fb7 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@

[COMMIT master] KVM: VMX: Use host_gdt variable wherever we need the host gdt

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Now that we have the host gdt conveniently stored in a variable, make use of it instead of querying the cpu. Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index

[COMMIT master] KVM: x86 emulator: Add IRET instruction

2010-08-02 Thread Avi Kivity
From: Mohammed Gamal m.gamal...@gmail.com Ths patch adds IRET instruction (opcode 0xcf). Currently, only IRET in real mode is emulated. Protected mode support is to be added later if needed. Signed-off-by: Mohammed Gamal m.gamal...@gmail.com Reviewed-by: Avi Kivity a...@redhat.com Reviewed-by:

[COMMIT master] KVM: x86 emulator: don't update vcpu state if instruction is restarted

2010-08-02 Thread Avi Kivity
From: Gleb Natapov g...@redhat.com No need to update vcpu state since instruction is in the middle of the emulation. Signed-off-by: Gleb Natapov g...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 7308bb8..c5878d8 100644

[COMMIT master] KVM: x86 emulator: convert some push instructions to direct decode

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 4d59bb6..dc1ecff 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -2017,6 +2017,12

[COMMIT master] KVM: x86 emulator: convert group 7 to new style

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 8d03a64..576cd9d 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -105,7 +105,7 @@

[COMMIT master] KVM: x86 emulator: store x86_emulate_ops in emulation context

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com It doesn't ever change, so we don't need to pass it around everywhere. Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h index

[COMMIT master] KVM: x86 emulator: move ByteOp and Dst back to bits 0:3

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Now that the group index no longer exists, the space is free. Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 460e30d..8c75410 100644 ---

[COMMIT master] KVM: x86 emulator: allow specifying group directly in opcode

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Instead of having a group number, store the group table pointer directly in the opcode. Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index

[COMMIT master] KVM: x86 emulator: add Undefined decode flag

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Add a decode flag to indicate the instruction is invalid. Will come in useful later, when we mix decode bits from the opcode and group table. Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git

[COMMIT master] KVM: x86 emulator: consolidate MOV reg, imm decoding

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 373dea3..5b1d3fb 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -188,15 +188,9 @@

[COMMIT master] KVM: x86 emulator: simplify Group 1 decoding

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Move operand decoding to the opcode table, keep lock decoding in the group table. This allows us to get consolidate the four variants of Group 1 into one group. Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff

[COMMIT master] KVM: x86 emulator: add macros for repetitive instructions

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Some instructions are repetitive in the opcode space, add macros for consolidating them. Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index

[COMMIT master] KVM: x86 emulator: consolidate push/pop reg decoding

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index d84f1f7..00bc73d 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -150,11 +150,9 @@

[COMMIT master] KVM: x86 emulator: consolidate Jcc rel32 decoding

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 5106acc..ab0845c 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -247,8 +247,7 @@

[COMMIT master] Merge remote branch 'upstream' into next

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com * upstream: (43 commits) Initialize a variable in all cases Fix uint8_t comparison with negative value Fix a warning on OpenSolaris Correctly identify multiple cpus in SMP systems Remove unused constant jazz led: Fix debug prints xilinx-s3adsp: Add

[COMMIT master] test: Add test to check if asid 0 is allowed

2010-08-02 Thread Avi Kivity
From: Joerg Roedel joerg.roe...@amd.com Signed-off-by: Joerg Roedel joerg.roe...@amd.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/kvm/test/x86/svm.c b/kvm/test/x86/svm.c index fd98505..2f1c900 100644 --- a/kvm/test/x86/svm.c +++ b/kvm/test/x86/svm.c @@ -342,6 +342,21 @@ static bool

[COMMIT master] test: Add mode-switch test for nested svm

2010-08-02 Thread Avi Kivity
From: Joerg Roedel joerg.roe...@amd.com Signed-off-by: Joerg Roedel joerg.roe...@amd.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/kvm/test/x86/cstart64.S b/kvm/test/x86/cstart64.S index f1a9d09..46e9d5c 100644 --- a/kvm/test/x86/cstart64.S +++ b/kvm/test/x86/cstart64.S @@ -51,6

[COMMIT master] test: add svm tests

2010-08-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Test behaviour both with svm enabled and with svm disabled. Signed-off-by: Avi Kivity a...@redhat.com diff --git a/kvm/test/x86/unittests.cfg b/kvm/test/x86/unittests.cfg index f39c5bd..7796e41 100644 --- a/kvm/test/x86/unittests.cfg +++

[COMMIT master] test: Add nested svm next_rip test

2010-08-02 Thread Avi Kivity
From: Joerg Roedel joerg.roe...@amd.com Signed-off-by: Joerg Roedel joerg.roe...@amd.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/kvm/test/x86/svm.c b/kvm/test/x86/svm.c index dd4a8da..4a7a662 100644 --- a/kvm/test/x86/svm.c +++ b/kvm/test/x86/svm.c @@ -209,6 +209,32 @@ static void

[COMMIT master] KVM: MMU: mark page dirty only when page is really written

2010-08-02 Thread Avi Kivity
From: Xiao Guangrong xiaoguangr...@cn.fujitsu.com Mark page dirty only when this page is really written, it's more exacter, and also can fix dirty page marking in speculation path Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com Signed-off-by: Avi Kivity a...@redhat.com diff --git

[COMMIT master] KVM: x86 emulator: check io permissions only once for string pio

2010-08-02 Thread Avi Kivity
From: Gleb Natapov g...@redhat.com Do not recheck io permission on every iteration. Signed-off-by: Gleb Natapov g...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h index f397b79..3c7dd29 100644 ---

[COMMIT master] KVM: MMU: move bits lost judgement into a separate function

2010-08-02 Thread Avi Kivity
From: Xiao Guangrong xiaoguangr...@cn.fujitsu.com Introduce spte_has_volatile_bits() function to judge whether spte bits will miss, it's more readable and can help us to cleanup code later Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com Signed-off-by: Avi Kivity a...@redhat.com diff

[COMMIT master] KVM: MMU: using kvm_set_pfn_accessed() instead of mark_page_accessed()

2010-08-02 Thread Avi Kivity
From: Xiao Guangrong xiaoguangr...@cn.fujitsu.com It's a small cleanup that using using kvm_set_pfn_accessed() instead of mark_page_accessed() Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/mmu.c

Re: [PATCH 15/15] KVM: x86 emulator: Decode memory operands directly into a 'struct operand'

2010-08-02 Thread Paolo Bonzini
On 08/01/2010 04:23 PM, Avi Kivity wrote: if (c-src.type == OP_MEM) { + if (c-d NoAccess) + goto no_fetch; rc = read_emulated(ctxt, ops, c-src.addr.mem, c-src.valptr, c-src.bytes);

Re: [PATCH 15/15] KVM: x86 emulator: Decode memory operands directly into a 'struct operand'

2010-08-02 Thread Avi Kivity
On 08/02/2010 10:28 AM, Paolo Bonzini wrote: On 08/01/2010 04:23 PM, Avi Kivity wrote: if (c-src.type == OP_MEM) { +if (c-d NoAccess) +goto no_fetch; rc = read_emulated(ctxt, ops, c-src.addr.mem, c-src.valptr, c-src.bytes);

Re: [PATCH 09/15] KVM: x86 emulator: mark mov cr and mov dr as 64-bit instructions in long mode

2010-08-02 Thread Avi Kivity
On 08/01/2010 05:23 PM, Avi Kivity wrote: Signed-off-by: Avi Kivitya...@redhat.com --- arch/x86/kvm/emulate.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index d7d95de..d1a6cd7 100644 --- a/arch/x86/kvm/emulate.c

Re: [PATCH 2/3] KVM: MMU: move bits lost judgement into a separate function

2010-08-02 Thread Avi Kivity
On 07/27/2010 06:33 AM, Xiao Guangrong wrote: Introduce spte_bits_lost() function to judge whether spte bits will miss, it's more readable and can help us to cleanup code later Signed-off-by: Xiao Guangrongxiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c | 20 +--- 1

Re: [PATCH] KVM: x86 emulator: fix LMSW able to clear cr0.pe

2010-08-02 Thread Paolo Bonzini
On 08/02/2010 05:35 AM, Avi Kivity wrote: LMSW is documented not to be able to set cr0.pe; make it so. The code is correct, but LMSW is documented not to be able to _clear_ cr0.pe. :) Paolo Signed-off-by: Avi Kivitya...@redhat.com --- arch/x86/kvm/emulate.c |2 +- 1 files changed,

Re: [PATCH 3/3] KVM: MMU: mark page dirty only when page is really written

2010-08-02 Thread Avi Kivity
On 07/27/2010 06:35 AM, Xiao Guangrong wrote: Mark page dirty only when this page is really written, it's more exacter, and also can fix dirty page marking in speculation path Signed-off-by: Xiao Guangrongxiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c | 47

Re: [PATCH] KVM: x86 emulator: fix LMSW able to clear cr0.pe

2010-08-02 Thread Avi Kivity
On 08/02/2010 10:48 AM, Paolo Bonzini wrote: On 08/02/2010 05:35 AM, Avi Kivity wrote: LMSW is documented not to be able to set cr0.pe; make it so. The code is correct, but LMSW is documented not to be able to _clear_ cr0.pe. :) Right, thinko. -- error compiling committee.c: too many

Re: [PATCH 2/3] KVM: MMU: move bits lost judgement into a separate function

2010-08-02 Thread Xiao Guangrong
Avi Kivity wrote: On 07/27/2010 06:33 AM, Xiao Guangrong wrote: Introduce spte_bits_lost() function to judge whether spte bits will miss, it's more readable and can help us to cleanup code later Signed-off-by: Xiao Guangrongxiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c | 20

Re: [PATCH 3/3] KVM: MMU: mark page dirty only when page is really written

2010-08-02 Thread Xiao Guangrong
Avi Kivity wrote: On 07/27/2010 06:35 AM, Xiao Guangrong wrote: Mark page dirty only when this page is really written, it's more exacter, and also can fix dirty page marking in speculation path Signed-off-by: Xiao Guangrongxiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c | 47

Re: [PATCH 1/2] KVM: x86 emulator: don't update vcpu state if instruction is restarted.

2010-08-02 Thread Gleb Natapov
On Mon, Aug 02, 2010 at 08:04:20AM +0300, Avi Kivity wrote: On 08/01/2010 04:27 PM, Gleb Natapov wrote: When we are going to enable e_i_g_s by default? Optimistically, 2.6.37, so six months. May be we have enough time to fix userspace? Sure we do, but will users update? 0.12 is

Re: [PATCH 1/2] KVM: x86 emulator: don't update vcpu state if instruction is restarted.

2010-08-02 Thread Avi Kivity
On 08/02/2010 10:58 AM, Gleb Natapov wrote: On Mon, Aug 02, 2010 at 08:04:20AM +0300, Avi Kivity wrote: On 08/01/2010 04:27 PM, Gleb Natapov wrote: When we are going to enable e_i_g_s by default? Optimistically, 2.6.37, so six months. May be we have enough time to fix userspace? Sure we

Re: Alt SeaBIOS SSDT cpu hotplug

2010-08-02 Thread Alexander Graf
On 02.08.2010, at 07:49, Kevin O'Connor wrote: On Mon, Aug 02, 2010 at 10:41:39AM +0800, Liu, Jinsong wrote: Kevin, This patch still has issue, It can boot Windows 2008 DataCenter, however, when run cpu_set cpu online command, windows 2008 Datacenter system shutdown at once. Thanks for

[PATCH v2 1/3] KVM: MMU: using kvm_set_pfn_accessed() instead of mark_page_accessed()

2010-08-02 Thread Xiao Guangrong
It's a small cleanup that using using kvm_set_pfn_accessed() instead of mark_page_accessed() Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index

Re: [PATCH 1/2] KVM: x86 emulator: don't update vcpu state if instruction is restarted.

2010-08-02 Thread Gleb Natapov
On Mon, Aug 02, 2010 at 11:03:26AM +0300, Avi Kivity wrote: On 08/02/2010 10:58 AM, Gleb Natapov wrote: On Mon, Aug 02, 2010 at 08:04:20AM +0300, Avi Kivity wrote: On 08/01/2010 04:27 PM, Gleb Natapov wrote: When we are going to enable e_i_g_s by default? Optimistically, 2.6.37, so six

[PATCH v2 2/3] KVM: MMU: move bits lost judgement into a separate function

2010-08-02 Thread Xiao Guangrong
Introduce spte_has_volatile_bits() function to judge whether spte bits will miss, it's more readable and can help us to cleanup code later Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c | 20 +--- 1 files changed, 17 insertions(+), 3

[PATCH v2 3/3] KVM: MMU: mark page dirty only when page is really written

2010-08-02 Thread Xiao Guangrong
Mark page dirty only when this page is really written, it's more exacter, and also can fix dirty page marking in speculation path Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c | 47 --- 1 files changed, 28

Re: [PATCH 1/2] KVM: x86 emulator: don't update vcpu state if instruction is restarted.

2010-08-02 Thread Avi Kivity
On 08/02/2010 11:17 AM, Gleb Natapov wrote: We don't know what they'll do. API stability means we only change things to fix bugs. Is this API documented? Do we guaranty somewhere anywhere that rip during io point past the instruction? I think it should be documented that cpu state cannot be

Re: [PATCH RFC 2/4] Add yield hypercall for KVM guests

2010-08-02 Thread Avi Kivity
On 07/26/2010 08:19 PM, Jeremy Fitzhardinge wrote: On 07/25/2010 11:14 PM, Srivatsa Vaddagiri wrote: Add KVM hypercall for yielding vcpu timeslice. Can you do a directed yield? A problem with directed yield is figuring out who to yield to. One idea is to look for a random vcpu that is

Re: [PATCH 1/2] KVM: x86 emulator: don't update vcpu state if instruction is restarted.

2010-08-02 Thread Gleb Natapov
On Mon, Aug 02, 2010 at 11:24:14AM +0300, Avi Kivity wrote: On 08/02/2010 11:17 AM, Gleb Natapov wrote: We don't know what they'll do. API stability means we only change things to fix bugs. Is this API documented? Do we guaranty somewhere anywhere that rip during io point past the

Re: [PATCH RFC 2/4] Add yield hypercall for KVM guests

2010-08-02 Thread Avi Kivity
On 07/28/2010 05:55 PM, Srivatsa Vaddagiri wrote: On Mon, Jul 26, 2010 at 10:19:41AM -0700, Jeremy Fitzhardinge wrote: On 07/25/2010 11:14 PM, Srivatsa Vaddagiri wrote: Add KVM hypercall for yielding vcpu timeslice. Can you do a directed yield? We don't have that support yet in Linux

Re: [PATCH RFC 3/4] Paravirtualized spinlock implementation for KVM guests

2010-08-02 Thread Avi Kivity
On 07/26/2010 09:15 AM, Srivatsa Vaddagiri wrote: Paravirtual spinlock implementation for KVM guests, based heavily on Xen guest's spinlock implementation. + +static struct spinlock_stats +{ + u64 taken; + u32 taken_slow; + + u64 released; + +#define HISTO_BUCKETS 30 +

Re: [PATCH RFC 0/4] Paravirt-spinlock implementation for KVM guests (Version 0)

2010-08-02 Thread Avi Kivity
On 07/26/2010 09:11 AM, Srivatsa Vaddagiri wrote: This patch-series implements paravirt-spinlock implementation for KVM guests, based heavily on Xen's implementation. I tried to refactor Xen's spinlock implementation to make it common for both Xen and KVM - but found that few differences

Re: [PATCH RFC 3/4] Paravirtualized spinlock implementation for KVM guests

2010-08-02 Thread Avi Kivity
On 07/26/2010 09:15 AM, Srivatsa Vaddagiri wrote: Paravirtual spinlock implementation for KVM guests, based heavily on Xen guest's spinlock implementation. +static void kvm_spin_unlock(struct arch_spinlock *lock) +{ + struct kvm_spinlock *sl = (struct kvm_spinlock *)lock; + +

Re: [PATCH 1/2] KVM: x86 emulator: don't update vcpu state if instruction is restarted.

2010-08-02 Thread Avi Kivity
On 08/02/2010 11:34 AM, Gleb Natapov wrote: On Mon, Aug 02, 2010 at 11:24:14AM +0300, Avi Kivity wrote: On 08/02/2010 11:17 AM, Gleb Natapov wrote: We don't know what they'll do. API stability means we only change things to fix bugs. Is this API documented? Do we guaranty somewhere

Re: [PATCH 7/24] Understanding guest pointers to vmcs12 structures

2010-08-02 Thread Nadav Har'El
On Sun, Aug 01, 2010, Gleb Natapov wrote about Re: [PATCH 7/24] Understanding guest pointers to vmcs12 structures: Guest can use any valid virtual address. There is UNMAPPED_GVA (~(gpa_t)0) which at least cannot be valid if address that your function returns have to be page aligned. Thanks.

Re: [PATCH 1/2] KVM: x86 emulator: don't update vcpu state if instruction is restarted.

2010-08-02 Thread Gleb Natapov
On Mon, Aug 02, 2010 at 11:54:58AM +0300, Avi Kivity wrote: On 08/02/2010 11:34 AM, Gleb Natapov wrote: On Mon, Aug 02, 2010 at 11:24:14AM +0300, Avi Kivity wrote: On 08/02/2010 11:17 AM, Gleb Natapov wrote: We don't know what they'll do. API stability means we only change things to fix

Migration issues in qemu.git

2010-08-02 Thread Avi Kivity
I'm hitting some migration issues merging qemu.git into qemu-kvm.git: 1. Crash in mig_cancel test: (gdb) bt #0 0x003a91c83dbb in memcpy () from /lib64/libc.so.6 #1 0x0049c2ff in qemu_get_buffer (f=0x302d870, buf=value optimized out, size1=4096) at /usr/include/bits/string3.h:52

Re: [PATCH 1/2] KVM: x86 emulator: don't update vcpu state if instruction is restarted.

2010-08-02 Thread Avi Kivity
On 08/02/2010 12:05 PM, Gleb Natapov wrote: We did it with unmapped pages in the middles of the slot recently. What guests did we break? The one that uses device assignment with old qemu-kvm userspace. Old qemu-kvm copied assigned card's ROM into memory and made it read only (mprotect(RO))

Re: Disable EPT

2010-08-02 Thread Kuniyasu Suzaki
Hello, From: pradeepkumar psuri...@linux.vnet.ibm.com Subject: Re: Disable EPT On Mon, 02 Aug 2010 10:46:13 +0900 (JST) Kuniyasu Suzaki k.suz...@aist.go.jp wrote: Please tell me how to disable EPT of KVM. Can I disable EPT in BIOS menu? I did not find the option in BIOS menu of

What should I do when I want to update the version of kvm in thel 5.4.

2010-08-02 Thread 姚远
My linux is rhel 5.4. In it, the version of kvm is 83 and the qemu is 0.9.1. Virt-manager use /usr/libexec/qemu-kvm to manage VMs. Now, I want to use the higher version of kvm, so I download qemu-kvm-0.12.4.tar.gz. tar xvf qemu-kvm-0.12.4.tar.gz cd qemu-kvm-0.12.4 ./configure --prefix=/usr/ make

Re: Migration issues in qemu.git

2010-08-02 Thread Avi Kivity
On 08/02/2010 12:06 PM, Avi Kivity wrote: I'm hitting some migration issues merging qemu.git into qemu-kvm.git: 1. Crash in mig_cancel test: (gdb) bt #0 0x003a91c83dbb in memcpy () from /lib64/libc.so.6 #1 0x0049c2ff in qemu_get_buffer (f=0x302d870, buf=value optimized out,

Re: Disable EPT

2010-08-02 Thread Xiao Guangrong
Kuniyasu Suzaki wrote: Hello, From: pradeepkumar psuri...@linux.vnet.ibm.com Subject: Re: Disable EPT On Mon, 02 Aug 2010 10:46:13 +0900 (JST) Kuniyasu Suzaki k.suz...@aist.go.jp wrote: Please tell me how to disable EPT of KVM. Can I disable EPT in BIOS menu? I did not

Re: [PATCH v2 1/3] KVM: MMU: using kvm_set_pfn_accessed() instead of mark_page_accessed()

2010-08-02 Thread Avi Kivity
On 08/02/2010 11:12 AM, Xiao Guangrong wrote: It's a small cleanup that using using kvm_set_pfn_accessed() instead of mark_page_accessed() Applied all of v2, thanks. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe

Re: 2.6.35-rc1 regression with pvclock and smp guests

2010-08-02 Thread Andre Przywara
Zachary Amsden wrote: On 07/28/2010 02:25 AM, Andre Przywara wrote: Andre Przywara wrote: Andre Przywara wrote: Avi Kivity wrote: On 07/27/2010 04:48 PM, Andre Przywara wrote: Wierd. Maybe the clock goes crazy. Let's see if it jumps forward alot: } while (unlikely(last !=

KVM Processor cache size

2010-08-02 Thread Ricardo Martins
Hi guys, I'm having a problem with kvm, my physical machine have 2 processor Xeon E5520, with 8 mb cache size, when i run cat /proc/cpuinfo the linux shows 16 processors equal. processor   : 15 vendor_id   : GenuineIntel cpu family  : 6 model   : 26 model name  : Intel(R)

Re: [PATCH 7/24] Understanding guest pointers to vmcs12 structures

2010-08-02 Thread Nadav Har'El
Hi, On Mon, Jun 14, 2010, Avi Kivity wrote about Re: [PATCH 7/24] Understanding guest pointers to vmcs12 structures: On 06/13/2010 03:26 PM, Nadav Har'El wrote: This patch includes a couple of utility functions for extracting pointer operands of VMX instructions issued by L1 (a guest

Re: KVM Processor cache size

2010-08-02 Thread Andre Przywara
Ricardo Martins wrote: Hi guys, I'm having a problem with kvm, my physical machine have 2 processor Xeon E5520, with 8 mb cache size, when i run cat /proc/cpuinfo the linux shows 16 processors equal. processor : 15 vendor_id : GenuineIntel cpu family : 6 model : 26

Re: KVM Processor cache size

2010-08-02 Thread Avi Kivity
On 08/02/2010 03:51 PM, Andre Przywara wrote: Ricardo Martins wrote: Hi guys, I'm having a problem with kvm, my physical machine have 2 processor Xeon E5520, with 8 mb cache size, when i run cat /proc/cpuinfo the linux shows 16 processors equal. processor : 15 vendor_id :

Re: Migration issues in qemu.git

2010-08-02 Thread Alex Williamson
On Mon, 2010-08-02 at 12:42 +0300, Avi Kivity wrote: On 08/02/2010 12:06 PM, Avi Kivity wrote: I'm hitting some migration issues merging qemu.git into qemu-kvm.git: 1. Crash in mig_cancel test: (gdb) bt #0 0x003a91c83dbb in memcpy () from /lib64/libc.so.6 #1

Re: Migration issues in qemu.git

2010-08-02 Thread Avi Kivity
On 08/02/2010 04:12 PM, Alex Williamson wrote: On Mon, 2010-08-02 at 12:42 +0300, Avi Kivity wrote: On 08/02/2010 12:06 PM, Avi Kivity wrote: I'm hitting some migration issues merging qemu.git into qemu-kvm.git: 1. Crash in mig_cancel test: (gdb) bt #0 0x003a91c83dbb in memcpy ()

Re: Migration issues in qemu.git

2010-08-02 Thread Avi Kivity
On 08/02/2010 12:06 PM, Avi Kivity wrote: 2. Intermittent migration failures Likely suspect is the IDE migration fixes. A merge of the commit just before these changes passes the test, I'm now testing the commit immediately after the changes. Looks like this was a byproduct of the

[PATCH] KVM: x86 mmu: simplify BUG_ON conditions

2010-08-02 Thread Takuya Yoshikawa
This patch cleanups rmap_write_protect() as follows: 1. The BUG_ON(!spte)'s right after while(spte) have been there unchanged for a long time. Since we don't see any special reason why we do this double check, we remove these BUG_ON's. 2. In the case of Y and Z are single-bit-set masks,

[PATCH 2/4] test: Add nested svm next_rip test

2010-08-02 Thread Joerg Roedel
Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- kvm/test/x86/svm.c | 29 + 1 files changed, 29 insertions(+), 0 deletions(-) diff --git a/kvm/test/x86/svm.c b/kvm/test/x86/svm.c index dd4a8da..4a7a662 100644 --- a/kvm/test/x86/svm.c +++ b/kvm/test/x86/svm.c @@

[PATCH 0/4] qemu-kvm: Add some nested svm tests

2010-08-02 Thread Joerg Roedel
Hi Avi, Marcelo, here are 3 additional nested svm tests. The first two test the features/fixes I posted last week for nested svm. To keep the rate of only 66.7% passing tests I added the asid_zero test which currently fails ;-) I will post patches to fix the vmrun_intercept and asid_zero test

[PATCH 3/4] test: Add mode-switch test for nested svm

2010-08-02 Thread Joerg Roedel
Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- kvm/test/x86/cstart64.S |5 ++ kvm/test/x86/svm.c | 109 +++ kvm/test/x86/types.h| 20 + 3 files changed, 134 insertions(+), 0 deletions(-) create mode 100644

[PATCH 4/4] test: Add test to check if asid 0 is allowed

2010-08-02 Thread Joerg Roedel
Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- kvm/test/x86/svm.c | 17 + 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/kvm/test/x86/svm.c b/kvm/test/x86/svm.c index fd98505..2f1c900 100644 --- a/kvm/test/x86/svm.c +++ b/kvm/test/x86/svm.c @@ -342,6

[PATCH 1/4] test: Run tests with asid 1

2010-08-02 Thread Joerg Roedel
This is correct since vmrun with asid 0 is not allowed. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- kvm/test/x86/svm.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/kvm/test/x86/svm.c b/kvm/test/x86/svm.c index 628f3aa..dd4a8da 100644 --- a/kvm/test/x86/svm.c

Re: [PATCH 7/24] Understanding guest pointers to vmcs12 structures

2010-08-02 Thread Avi Kivity
On 08/02/2010 03:25 PM, Nadav Har'El wrote: + /* offfset = Base + [Index * Scale] + Displacement */ + addr = vmx_get_segment_base(vcpu, seg_reg); + if (base_is_valid) + addr += kvm_register_read(vcpu, base_reg); + if (index_is_valid) + addr

Re: [PATCH 8/24] Hold a vmcs02 for each vmcs12

2010-08-02 Thread Nadav Har'El
On Tue, Jul 06, 2010, Dong, Eddie wrote about RE: [PATCH 8/24] Hold a vmcs02 for each vmcs12: +/* Allocate an L0 VMCS (vmcs02) for the current L1 VMCS (vmcs12), if one + * does not already exist. The allocation is done in L0 memory, ... +static int nested_create_current_vmcs(struct kvm_vcpu

  1   2   >