[COMMIT master] make-release: fix mtime on rhel6 beta

2010-07-08 Thread Avi Kivity
From: Michael S. Tsirkin m...@redhat.com With recent git versions (like one in rhel6 beta), git prints out tag info in addition to requested format, if passed a tag name. This breaks make-release. To get just the time as we want, we need to pass something that is not a tag name but matches same

[COMMIT master] device-assignment: Clear assigned_dev irq type

2010-07-08 Thread Avi Kivity
From: Alex Williamson alex.william...@redhat.com Commit 96abccb5 cleared assigned_irq_data.flags when an irq is disabled, but what we really want is to clear assigned_dev-irq_requested_type. Signed-off-by: Alex Williamson alex.william...@redhat.com Found-by: Juan Quintela quint...@redhat.com

[COMMIT master] qemu-kvm unittests: Small makefile fix

2010-07-08 Thread Avi Kivity
From: Lucas Meneghel Rodrigues l...@redhat.com Turns out $(tests-common) does not encompass all flat files built for the unittests. So let's fix the makefile install rule to include all flat files generated by the make procedure. Signed-off-by: Lucas Meneghel Rodrigues l...@redhat.com

[COMMIT master] qemu-kvm tests: Create make target for install tests

2010-07-08 Thread Avi Kivity
From: Lucas Meneghel Rodrigues l...@redhat.com In order to make it convenient to run unit tests on KVM autotest, add rules to install the flat files to $(PREFIX)/share/qemu/tests. Also, add a unittests.cfg file, a simple .ini file that contains unittest definitions. The unittest definitions work

[COMMIT master] test: long rmap chains

2010-07-08 Thread Avi Kivity
From: Marcelo Tosatti mtosa...@redhat.com test long rmap chains Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/kvm/test/config-x86-common.mak b/kvm/test/config-x86-common.mak index 3ac53a5..00817dc 100644 ---

[COMMIT master] test: export vm helpers

2010-07-08 Thread Avi Kivity
From: Marcelo Tosatti mtosa...@redhat.com To be used by rmap chain patch. Also make install_pte take an argument indicating physical location of pagetable. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/kvm/test/x86/emulator.c

[COMMIT master] kvm test: setup_vm should map APIC

2010-07-08 Thread Avi Kivity
From: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/kvm/test/x86/vm.c b/kvm/test/x86/vm.c index c9876e5..90b1085 100644 --- a/kvm/test/x86/vm.c +++ b/kvm/test/x86/vm.c @@ -204,10 +204,8 @@ static void setup_mmu(unsigned long len)

[COMMIT master] test: protect fwfcg accesses with spinlock

2010-07-08 Thread Avi Kivity
From: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/kvm/test/lib/x86/fwcfg.c b/kvm/test/lib/x86/fwcfg.c index 2cf7cec..e2cdd15 100644 --- a/kvm/test/lib/x86/fwcfg.c +++ b/kvm/test/lib/x86/fwcfg.c @@

[COMMIT master] Revert KVM: cleanup: make kvm_vm_ioctl_get_dirty_log() arch independent

2010-07-08 Thread Avi Kivity
From: Marcelo Tosatti mtosa...@redhat.com This reverts commit a45aa4f19c14b9f72ff3750c059d6332d74ab197. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c index 86b6b1d..da0c133 100644 --- a/arch/ia64/kvm/kvm-ia64.c +++

[COMMIT master] KVM: Simplify vcpu_enter_guest() mmu reload logic slightly

2010-07-08 Thread Avi Kivity
From: Avi Kivity a...@redhat.com No need to reload the mmu in between two different vcpu-requests checks. kvm_mmu_reload() may trigger KVM_REQ_TRIPLE_FAULT, but that will be caught during atomic guest entry later. Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti

[COMMIT master] KVM: VMX: Execute WBINVD to keep data consistency with assigned devices

2010-07-08 Thread Avi Kivity
From: Sheng Yang sh...@linux.intel.com Some guest device driver may leverage the Non-Snoop I/O, and explicitly WBINVD or CLFLUSH to a RAM space. Since migration may occur before WBINVD or CLFLUSH, we need to maintain data consistency either by: 1: flushing cache (wbinvd) when the guest is

[COMMIT master] KVM: MMU: fix writable sync sp mapping

2010-07-08 Thread Avi Kivity
From: Xiao Guangrong xiaoguangr...@cn.fujitsu.com While we sync many unsync sp at one time(in mmu_sync_children()), we may mapping the spte writable, it's dangerous, if one unsync sp's mapping gfn is another unsync page's gfn. For example: SP1.pte[0] = P SP2.gfn's pfn = P [SP1.pte[0] =

[COMMIT master] KVM: MMU: fix conflict access permissions in direct sp

2010-07-08 Thread Avi Kivity
From: Xiao Guangrong xiaoguangr...@cn.fujitsu.com In no-direct mapping, we mark sp is 'direct' when we mapping the guest's larger page, but its access is encoded form upper page-struct entire not include the last mapping, it will cause access conflict. For example, have this mapping: [W]

[COMMIT master] Revert KVM: cleanup: remove kvm_get_dirty_log()

2010-07-08 Thread Avi Kivity
From: Marcelo Tosatti mtosa...@redhat.com This reverts commit 7e2c227d82232327c43e25fa98a132c000faa005, as it breaks dirty logging on PPC. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c index da0c133..5cb5865 100644 ---

[COMMIT master] KVM: MMU: fix direct sp's access corrupted

2010-07-08 Thread Avi Kivity
From: Xiao Guangrong xiaoguangr...@cn.fujitsu.com If the mapping is writable but the dirty flag is not set, we will find the read-only direct sp and setup the mapping, then if the write #PF occur, we will mark this mapping writable in the read-only direct sp, now, other real read-only mapping

[COMMIT master] KVM: Use u64 for frame data types

2010-07-08 Thread Avi Kivity
From: Joerg Roedel joerg.roe...@amd.com For 32bit machines where the physical address width is larger than the virtual address width the frame number types in KVM may overflow. Fix this by changing them to u64. Signed-off-by: Joerg Roedel joerg.roe...@amd.com Signed-off-by: Marcelo Tosatti

[COMMIT master] KVM: MMU: fix forgot to flush all vcpu's tlb

2010-07-08 Thread Avi Kivity
From: Xiao Guangrong xiaoguangr...@cn.fujitsu.com After remove a rmap, we should flush all vcpu's tlb Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 24290f8..a0c5c31 100644

[COMMIT master] KVM: Fix IOMMU memslot reference warning

2010-07-08 Thread Avi Kivity
From: Sheng Yang sh...@linux.intel.com This patch fixes the following warning. === [ INFO: suspicious rcu_dereference_check() usage. ] --- include/linux/kvm_host.h:259 invoked rcu_dereference_check()

[COMMIT master] KVM: MMU: Atomically check for accessed bit when dropping an spte

2010-07-08 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Currently, in the window between the check for the accessed bit, and actually dropping the spte, a vcpu can access the page through the spte and set the bit, which will be ignored by the mmu. Fix by using an exchange operation to atmoically fetch the spte and

[COMMIT master] KVM: PPC: Make use of hash based Shadow MMU

2010-07-08 Thread Avi Kivity
From: Alexander Graf ag...@suse.de We just introduced generic functions to handle shadow pages on PPC. This patch makes the respective backends make use of them, getting rid of a lot of duplicate code along the way. Signed-off-by: Alexander Graf ag...@suse.de Signed-off-by: Marcelo Tosatti

[COMMIT master] KVM: MMU: cleanup FNAME(fetch)() functions

2010-07-08 Thread Avi Kivity
From: Xiao Guangrong xiaoguangr...@cn.fujitsu.com Cleanup this function that we are already get the direct sp's access Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/paging_tmpl.h

[COMMIT master] KVM: MMU: Move accessed/dirty bit checks from rmap_remove() to drop_spte()

2010-07-08 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Since we need to make the check atomic, move it to the place that will set the new spte. Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 5b211dc..e1e6967 100644 --- a/arch/x86/kvm/mmu.c +++

[COMMIT master] KVM: VMX: fix tlb flush with invalid root

2010-07-08 Thread Avi Kivity
From: Xiao Guangrong xiaoguangr...@cn.fujitsu.com Commit 341d9b535b6c simplify reload logic while entry guest mode, it can avoid unnecessary sync-root if KVM_REQ_MMU_RELOAD and KVM_REQ_MMU_SYNC both set. But, it cause a issue that when we handle 'KVM_REQ_TLB_FLUSH', the root is invalid, it is

[COMMIT master] KVM: PPC: Add generic hpte management functions

2010-07-08 Thread Avi Kivity
From: Alexander Graf ag...@suse.de Currently the shadow paging code keeps an array of entries it knows about. Whenever the guest invalidates an entry, we loop through that entry, trying to invalidate matching parts. While this is a really simple implementation, it is probably the most

[COMMIT master] KVM: Remove unnecessary divide operations

2010-07-08 Thread Avi Kivity
From: Joerg Roedel joerg.roe...@amd.com This patch converts unnecessary divide and modulo operations in the KVM large page related code into logical operations. This allows to convert gfn_t to u64 while not breaking 32 bit builds. Signed-off-by: Joerg Roedel joerg.roe...@amd.com Signed-off-by:

[COMMIT master] KVM: MMU: Introduce drop_spte()

2010-07-08 Thread Avi Kivity
From: Avi Kivity a...@redhat.com When we call rmap_remove(), we (almost) always immediately follow it by an __set_spte() to a nonpresent pte. Since we need to perform the two operations atomically, to avoid losing the dirty and accessed bits, introduce a helper drop_spte() and convert all call

[COMMIT master] KVM: VMX: Fix host MSR_KERNEL_GS_BASE corruption

2010-07-08 Thread Avi Kivity
From: Avi Kivity a...@redhat.com enter_lmode() and exit_lmode() modify the guest's EFER.LMA before calling vmx_set_efer(). However, the latter function depends on the value of EFER.LMA to determine whether MSR_KERNEL_GS_BASE needs reloading, via vmx_load_host_state(). With EFER.LMA changing

[COMMIT master] Merge branch 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6

2010-07-08 Thread Avi Kivity
From: Avi Kivity a...@redhat.com * 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6: (355 commits) Linux 2.6.35-rc4 module: initialize module dynamic debug later ARM: 6205/1: perf: ensure counter delta is treated as unsigned perf, x86: Fix incorrect

[COMMIT master] KVM: MMU: Don't drop accessed bit while updating an spte

2010-07-08 Thread Avi Kivity
From: Avi Kivity a...@redhat.com __set_spte() will happily replace an spte with the accessed bit set with one that has the accessed bit clear. Add a helper update_spte() which checks for this condition and updates the page flag if needed. Signed-off-by: Avi Kivity a...@redhat.com diff --git

[COMMIT master] KVM: x86 emulator: fix cli/sti instruction emulation

2010-07-08 Thread Avi Kivity
From: Wei Yongjun yj...@cn.fujitsu.com If IOPL check fail, the cli/sti emulate GP and then we should skip writeback since the default write OP is OP_REG. Signed-off-by: Wei Yongjun yj...@cn.fujitsu.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/emulate.c

[COMMIT master] KVM: x86 emulator: re-implementing 'mov AL, moffs' instruction decoding

2010-07-08 Thread Avi Kivity
From: Wei Yongjun yj...@cn.fujitsu.com This patch change to use DstAcc for decoding 'mov AL, moffs' and introduced SrcAcc for decoding 'mov moffs, AL'. Signed-off-by: Wei Yongjun yj...@cn.fujitsu.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/emulate.c

[COMMIT master] KVM: x86 emulator: fix 'and AL, imm8' instruction decoding

2010-07-08 Thread Avi Kivity
From: Wei Yongjun yj...@cn.fujitsu.com 'and AL,imm8' should be mask as ByteOp, otherwise the dest operand length will no correct and we may fill the full EAX when writeback. Signed-off-by: Wei Yongjun yj...@cn.fujitsu.com Signed-off-by: Avi Kivity a...@redhat.com diff --git

[COMMIT master] KVM: define hwpoison variables static

2010-07-08 Thread Avi Kivity
From: Gleb Natapov g...@redhat.com They are not used outside of the file. Signed-off-by: Gleb Natapov g...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index a60b6b0..630d122 100644 --- a/virt/kvm/kvm_main.c +++

[COMMIT master] KVM: Reenter guest after emulation failure if due to access to non-mmio address

2010-07-08 Thread Avi Kivity
From: Gleb Natapov g...@redhat.com When shadow pages are in use sometimes KVM try to emulate an instruction when it accesses a shadowed page. If emulation fails KVM un-shadows the page and reenter guest to allow vcpu to execute the instruction. If page is not in shadow page hash KVM assumes that

[COMMIT master] KVM: x86 emulator: fix 'mov rm, sreg' instruction decoding

2010-07-08 Thread Avi Kivity
From: Wei Yongjun yj...@cn.fujitsu.com The source operand of 'mov rm,sreg' is segment register, not general-purpose register, so remove SrcReg from decoding. Signed-off-by: Wei Yongjun yj...@cn.fujitsu.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/emulate.c

[COMMIT master] KVM: MMU: Keep going on permission error

2010-07-08 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Real hardware disregards permission errors when computing page fault error code bit 0 (page present). Do the same. Reviewed-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/paging_tmpl.h

[COMMIT master] KVM: fix lock imbalance in kvm_create_pit()

2010-07-08 Thread Avi Kivity
From: Jiri Slaby jirisl...@gmail.com Stanse found that there is an omitted unlock in kvm_create_pit in one fail path. Add proper unlock there. Signed-off-by: Jiri Slaby jirisl...@gmail.com Cc: Avi Kivity a...@redhat.com Cc: Marcelo Tosatti mtosa...@redhat.com Cc: Thomas Gleixner

[COMMIT master] KVM: Return EFAULT from kvm ioctl when guest accesses bad area

2010-07-08 Thread Avi Kivity
From: Gleb Natapov g...@redhat.com Currently if guest access address that belongs to memory slot but is not backed up by page or page is read only KVM treats it like MMIO access. Remove that capability. It was never part of the interface and should not be relied upon. Signed-off-by: Gleb Natapov

[COMMIT master] KVM: x86 emulator: fix 'mov sreg, rm16' instruction decoding

2010-07-08 Thread Avi Kivity
From: Wei Yongjun yj...@cn.fujitsu.com Memory reads for 'mov sreg,rm16' should be 16 bits only. Signed-off-by: Wei Yongjun yj...@cn.fujitsu.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index e8bdddc..d842a7d 100644 ---

Re: [PATCH 1/2] KVM: Expose MCE control MSRs to userspace

2010-07-08 Thread Avi Kivity
On 07/08/2010 05:07 AM, Huang Ying wrote: static u32 emulated_msrs[] = { MSR_IA32_MISC_ENABLE, + MSR_IA32_MCG_STATUS, + MSR_IA32_MCG_CTL, We need only clear MSR_IA32_MCG_STATUS during reset, but should not clear MSR_IA32_MCG_CTL. Why not? -- error compiling

Re: [RFC PATCH 3/3] x86 emulator: Add segment limit checks and helper functions

2010-07-08 Thread Avi Kivity
On 07/08/2010 12:23 AM, Mohammed Gamal wrote: This patch adds segment limit checks to the x86 emulator, in addition to some helper functions and changes to the return values of emulate_push to accomodate the new checks. +static u32 seg_limit(struct x86_emulate_ctxt *ctxt, +

Re: [PATCH 1/2] KVM: Expose MCE control MSRs to userspace

2010-07-08 Thread Huang Ying
On Thu, 2010-07-08 at 15:43 +0800, Avi Kivity wrote: On 07/08/2010 05:07 AM, Huang Ying wrote: static u32 emulated_msrs[] = { MSR_IA32_MISC_ENABLE, + MSR_IA32_MCG_STATUS, + MSR_IA32_MCG_CTL, We need only clear MSR_IA32_MCG_STATUS during reset, but should not clear

Re: [RFC PATCH 0/3] Add segment limit checks to emulator

2010-07-08 Thread Stefan Hajnoczi
On Wed, Jul 7, 2010 at 10:23 PM, Mohammed Gamal m.gamal...@gmail.com wrote: After some conversation with Avi concerning why unreal mode has been seen to work with KVM on Intel. It clears out the scenario is caused as follows: - guest enters big real mode - kvm squashes limit to 64k-1 -

Re: [RFC PATCH 0/3] Add segment limit checks to emulator

2010-07-08 Thread Avi Kivity
On 07/08/2010 12:23 AM, Mohammed Gamal wrote: After some conversation with Avi concerning why unreal mode has been seen to work with KVM on Intel. It clears out the scenario is caused as follows: - guest enters big real mode - kvm squashes limit to 64k-1 - guest executes instructions with

Re: [PATCH 1/2] KVM: Expose MCE control MSRs to userspace

2010-07-08 Thread Avi Kivity
On 07/08/2010 11:03 AM, Huang Ying wrote: On Thu, 2010-07-08 at 15:43 +0800, Avi Kivity wrote: On 07/08/2010 05:07 AM, Huang Ying wrote: static u32 emulated_msrs[] = { MSR_IA32_MISC_ENABLE, + MSR_IA32_MCG_STATUS, + MSR_IA32_MCG_CTL, We need

Re: [PATCH] device-assignment: Better fd tracking

2010-07-08 Thread Avi Kivity
On 07/07/2010 07:29 PM, Alex Williamson wrote: Commit 909bfdba fixed a hole with not closing resource file descriptors but we need to be more careful about tracking which are real fds, otherwise we might close fd 0, which doesn't work out so well for stdio. @@ -785,7 +786,8 @@ static void

Re: [PATCH] kvm: merge fixes for vmstate/block name from qemu.git

2010-07-08 Thread Avi Kivity
On 07/07/2010 11:08 PM, Alex Williamson wrote: Also updates qemu_ram_map() and create qemu_ram_unmap() to match qemu_ram_alloc/qemu_ram_free(). Patch does not apply, multiple failures. Are you patching an old tree? This patch should fix all the qemu-kvm build failures that will occur

Re: [PATCH 3/3] Reenter guest after instruction emulation failure if emulation was due to access to non-mmio address.

2010-07-08 Thread Avi Kivity
On 07/07/2010 08:16 PM, Gleb Natapov wrote: When shadow pages are in use sometimes KVM try to emulate an instruction when it accesses a shadowed page. If emulation fails KVM un-shadows the page and reenter guest to allow vcpu to execute the instruction. If page is not in shadow page hash KVM

Re: [PATCH 1/2] KVM: Expose MCE control MSRs to userspace

2010-07-08 Thread Avi Kivity
On 07/08/2010 11:47 AM, Huang Ying wrote: On Thu, 2010-07-08 at 16:16 +0800, Avi Kivity wrote: On 07/08/2010 11:03 AM, Huang Ying wrote: On Thu, 2010-07-08 at 15:43 +0800, Avi Kivity wrote: On 07/08/2010 05:07 AM, Huang Ying wrote: static u32

Re: [PATCH 3/3] Reenter guest after instruction emulation failure if emulation was due to access to non-mmio address.

2010-07-08 Thread Avi Kivity
On 07/08/2010 12:06 PM, Avi Kivity wrote: On 07/07/2010 08:16 PM, Gleb Natapov wrote: When shadow pages are in use sometimes KVM try to emulate an instruction when it accesses a shadowed page. If emulation fails KVM un-shadows the page and reenter guest to allow vcpu to execute the instruction.

Re: [PATCH 3/3] Reenter guest after instruction emulation failure if emulation was due to access to non-mmio address.

2010-07-08 Thread Gleb Natapov
On Thu, Jul 08, 2010 at 12:15:18PM +0300, Avi Kivity wrote: On 07/08/2010 12:06 PM, Avi Kivity wrote: On 07/07/2010 08:16 PM, Gleb Natapov wrote: When shadow pages are in use sometimes KVM try to emulate an instruction when it accesses a shadowed page. If emulation fails KVM un-shadows the

Re: [PATCH 3/3] Reenter guest after instruction emulation failure if emulation was due to access to non-mmio address.

2010-07-08 Thread Avi Kivity
On 07/08/2010 12:17 PM, Gleb Natapov wrote: btw, that will mean another page walk, so better fold into kvm_mmu_unprotect_page_virt() (which needs a new name, since it does more than unprotect a page now). But this code will be taken very rarely and usually on the way to failure anyway,

[PATCH v2 3/3] Reenter guest after instruction emulation failure if emulation was due to access to non-mmio address.

2010-07-08 Thread Gleb Natapov
When shadow pages are in use sometimes KVM try to emulate an instruction when it accesses a shadowed page. If emulation fails KVM un-shadows the page and reenter guest to allow vcpu to execute the instruction. If page is not in shadow page hash KVM assumes that this was attempt to do MMIO and

Re: [PATCH v2 3/3] Reenter guest after instruction emulation failure if emulation was due to access to non-mmio address.

2010-07-08 Thread Avi Kivity
On 07/08/2010 12:41 PM, Gleb Natapov wrote: When shadow pages are in use sometimes KVM try to emulate an instruction when it accesses a shadowed page. If emulation fails KVM un-shadows the page and reenter guest to allow vcpu to execute the instruction. If page is not in shadow page hash KVM

Re: [Autotest] [KVM-AUTOTEST PATCH] KVM test: rss.cpp: minimize window by default so it doesn't bother step files

2010-07-08 Thread Michael Goldish
On 07/08/2010 04:43 AM, Chen Cao wrote: Michael, Can rss provide some log (files)? Cao, Chen Not right now, but I'll post a patch that will enable logging. On Wed, Jul 07, 2010 at 01:32:17PM +0300, Michael Goldish wrote: Signed-off-by: Michael Goldish mgold...@redhat.com ---

Re: [PATCH 2/2] KVM: MMU: Keep going on permission error

2010-07-08 Thread Jan Kiszka
Avi Kivity wrote: On 07/07/2010 03:33 PM, Jan Kiszka wrote: Avi Kivity wrote: Real hardware disregards permission errors when computing page fault error code bit 0 (page present). Do the same. This generates (false positive) build warnings here: CC [M]

Re: [PATCH 2/2] KVM: MMU: Keep going on permission error

2010-07-08 Thread Avi Kivity
On 07/08/2010 02:14 PM, Jan Kiszka wrote: Yes, I saw. I'll clear it up. You already pushed some update, don't you? Then I'm afraid I have to report that the problem persists. Yes, I did. I can't believe I didn't even compile test it. Sorry, will fix for real now. -- error

Re: Alt SeaBIOS SSDT cpu hotplug

2010-07-08 Thread Gleb Natapov
On Wed, Jul 07, 2010 at 07:26:07PM -0400, Kevin O'Connor wrote: On Wed, Jul 07, 2010 at 01:22:49PM +0300, Gleb Natapov wrote: On Wed, Jul 07, 2010 at 12:57:05AM -0400, Kevin O'Connor wrote: The CPUS package stores references to the Processor objects, and the CPON package stores the state

RE: Alt SeaBIOS SSDT cpu hotplug

2010-07-08 Thread Liu, Jinsong
Avi Kivity wrote: On 07/07/2010 07:57 AM, Kevin O'Connor wrote: Hi, I've been playing with the cpu hotplug SSDT changes. Attached is a proposal for an alternative method of adding ACPI support. The idea is to continue to build a dynamic SSDT based on CountCPUs and MaxCountCPUs. The

Re: [PATCH v4 03/12] Add async PF initialization to PV guest.

2010-07-08 Thread Gleb Natapov
On Wed, Jul 07, 2010 at 05:41:01PM +0200, Peter Zijlstra wrote: On Tue, 2010-07-06 at 19:24 +0300, Gleb Natapov wrote: @@ -329,6 +330,8 @@ notrace static void __cpuinit start_secondary(void *unused) per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE;

Re: [PATCH v4 11/12] Let host know whether the guest can handle async PF in non-userspace context.

2010-07-08 Thread Gleb Natapov
On Thu, Jul 08, 2010 at 12:28:18AM -0400, Rik van Riel wrote: On 07/06/2010 12:24 PM, Gleb Natapov wrote: If guest can detect that it runs in non-preemptable context it can handle async PFs at any time, so let host know that it can send async PF even if guest cpu is not in userspace. The

[RFC PATCH v2 0/3] Add segment limit checks to emulator

2010-07-08 Thread Mohammed Gamal
After some conversation with Avi concerning why unreal mode has been seen to work with KVM on Intel. It clears out the scenario is caused as follows: - guest enters big real mode - kvm squashes limit to 64k-1 - guest executes instructions with offset 64k - cpu issues #GP due to limit violation

[RFC PATCH v2 1/3] Add helper methods to get segment limits

2010-07-08 Thread Mohammed Gamal
This adds helper methods to get segment limits for kvm_x86_ops and x86_emulate_ops. Hooks are added for SVM and VMX Signed-off-by: Mohammed Gamal m.gamal...@gmail.com --- arch/x86/include/asm/kvm_emulate.h |1 + arch/x86/include/asm/kvm_host.h|1 + arch/x86/kvm/svm.c

[RFC PATCH v2 2/3] x86 emulator: Add cs_base() helper

2010-07-08 Thread Mohammed Gamal
Adds a cs_base() helper for consistency with other emulator functions Signed-off-by: Mohammed Gamal m.gamal...@gmail.com --- arch/x86/kvm/emulate.c |8 +++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index

[RFC PATCH v2 3/3] x86 emulator: Add segment limit checks and helper functions

2010-07-08 Thread Mohammed Gamal
This patch adds segment limit checks to the x86 emulator, in addition to some helper functions and changes to the return values of emulate_push to accomodate the new checks. Changes from v1: - Added seg_override_limit() and emulate_ss() helpers - Corrected limit check return values for long

[PATCH v2] device-assignment: Better fd tracking

2010-07-08 Thread Alex Williamson
Commit 909bfdba fixed a hole with not closing resource file descriptors but we need to be more careful about tracking which are real fds, otherwise we might close fd 0, which doesn't work out so well for stdio. Signed-off-by: Alex Williamson alex.william...@redhat.com --- v2: fix qemu style

Re: [PATCH v2] device-assignment: Better fd tracking

2010-07-08 Thread Don Dutile
Alex Williamson wrote: Commit 909bfdba fixed a hole with not closing resource file descriptors but we need to be more careful about tracking which are real fds, otherwise we might close fd 0, which doesn't work out so well for stdio. Signed-off-by: Alex Williamson alex.william...@redhat.com

Re: [PATCH v4 08/12] Inject asynchronous page fault into a guest if page is swapped out.

2010-07-08 Thread Marcelo Tosatti
On Tue, Jul 06, 2010 at 07:24:56PM +0300, Gleb Natapov wrote: If guest access swapped out memory do not swap it in from vcpu thread context. Setup slow work to do swapping and send async page fault to a guest. Allow async page fault injection only when guest is in user mode since otherwise

Re: [PATCH v4 09/12] Retry fault before vmentry

2010-07-08 Thread Marcelo Tosatti
On Tue, Jul 06, 2010 at 07:24:57PM +0300, Gleb Natapov wrote: When page is swapped in it is mapped into guest memory only after guest tries to access it again and generate another fault. To save this fault we can map it immediately since we know that guest is going to access the page.

Re: [PATCH v4 08/12] Inject asynchronous page fault into a guest if page is swapped out.

2010-07-08 Thread Gleb Natapov
On Thu, Jul 08, 2010 at 12:59:20PM -0300, Marcelo Tosatti wrote: +static int apf_put_user(struct kvm_vcpu *vcpu, u32 val) +{ + if (unlikely(vcpu-arch.apf_memslot_ver != +vcpu-kvm-memslot_version)) { + u64 gpa = vcpu-arch.apf_msr_val ~0x3f; +

Re: [PATCH v4 08/12] Inject asynchronous page fault into a guest if page is swapped out.

2010-07-08 Thread Peter Zijlstra
On Thu, 2010-07-08 at 21:05 +0300, Gleb Natapov wrote: + /* do alloc atomic since if we are going to sleep anyway we + may as well sleep faulting in page */ + work = kmem_cache_zalloc(async_pf_cache, GFP_ATOMIC); + if (!work) + return 0; GFP_KERNEL is fine

Re: [PATCH v4 08/12] Inject asynchronous page fault into a guest if page is swapped out.

2010-07-08 Thread Peter Zijlstra
On Thu, 2010-07-08 at 20:09 +0200, Peter Zijlstra wrote: On Thu, 2010-07-08 at 21:05 +0300, Gleb Natapov wrote: + /* do alloc atomic since if we are going to sleep anyway we + may as well sleep faulting in page */ + work = kmem_cache_zalloc(async_pf_cache, GFP_ATOMIC); +

Is there shadow page table cache during context switch?

2010-07-08 Thread Gu, Zhongshu
Hi all: Recently i am looking at the code of the implementation of shadow page table of kvm. There is one thing that i am confused. Is there implementation for caching the shadow page table during context switch? From the code, when there is action of setting cr3 in the guest os, it will

[KVM-AUTOTEST PATCH] KVM test: fail if qemu complains about KVM module trouble

2010-07-08 Thread Michael Goldish
If qemu is tested without KVM intentionally (e.g. with -no-kvm) it won't complain and the KVM test won't complain either. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_vm.py | 10 +- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git

[PATCH v7 RESEND 4/4] Inter-VM shared memory PCI device

2010-07-08 Thread Cam Macdonell
Resent (again): Some lines were over 80 characters and debugging is now off. Support an inter-vm shared memory device that maps a shared-memory object as a PCI device in the guest. This patch also supports interrupts between guest by communicating over a unix domain socket. This patch applies

[PATCH] netfilter: add CHECKSUM target

2010-07-08 Thread Michael S. Tsirkin
This adds a `CHECKSUM' target, which can be used in the iptables mangle table. You can use this target to compute and fill in the checksum in an IP packet that lacks a checksum. This is particularly useful, if you need to work around old applications such as dhcp clients, that do not work well

[PATCH] extensions: libipt_CHECKSUM extension

2010-07-08 Thread Michael S. Tsirkin
This adds a `CHECKSUM' target, which can be used in the iptables mangle table. You can use this target to compute and fill in the checksum in an IP packet that lacks a checksum. This is particularly useful, if you need to work around old applications such as dhcp clients, that do not work well

Re: [PATCH v7 RESEND 4/4] Inter-VM shared memory PCI device

2010-07-08 Thread David S. Ahern
On 07/08/10 15:08, Cam Macdonell wrote: Resent (again): Some lines were over 80 characters and debugging is now off. Support an inter-vm shared memory device that maps a shared-memory object as a PCI device in the guest. This patch also supports interrupts between guest by communicating

[KVM-AUTOTEST PATCH 1/2] KVM test: rss.cpp: use critical section instead of mutex for text buffer access

2010-07-08 Thread Michael Goldish
A critical section should be faster. The difference for this application may or may not be noticeable (with a large number of files). Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/deps/rss.cpp | 15 --- 1 files changed, 8 insertions(+), 7 deletions(-)

[KVM-AUTOTEST PATCH 2/2] KVM test: rss.cpp: write all user messages to a log file

2010-07-08 Thread Michael Goldish
The log file will be placed in the current directory. For example, when rss.exe is run at startup as administrator under WinXP, the current directory will be C:\Documents and Settings\Administrator. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/deps/rss.cpp | 21

Re: Alt SeaBIOS SSDT cpu hotplug

2010-07-08 Thread Kevin O'Connor
On Thu, Jul 08, 2010 at 03:54:10PM +0300, Gleb Natapov wrote: On Wed, Jul 07, 2010 at 07:26:07PM -0400, Kevin O'Connor wrote: On Wed, Jul 07, 2010 at 01:22:49PM +0300, Gleb Natapov wrote: On Wed, Jul 07, 2010 at 12:57:05AM -0400, Kevin O'Connor wrote: The CPUS package stores references

Re: [PATCH v5 4/9] KVM: MMU: introduce gfn_to_pfn_atomic() function

2010-07-08 Thread Xiao Guangrong
Xiao Guangrong wrote: + if (atomic) + goto return_bad_page; + down_read(current-mm-mmap_sem); if (is_hwpoison_address(addr)) { up_read(current-mm-mmap_sem); @@ -959,6 +965,7 @@ static pfn_t

Re: [PATCH 00/27] KVM PPC PV framework

2010-07-08 Thread MJ embd
On Thu, Jul 1, 2010 at 4:12 PM, Alexander Graf ag...@suse.de wrote: On PPC we run PR=0 (kernel mode) code in PR=1 (user mode) and don't use the hypervisor extensions. While that is all great to show that virtualization is possible, there are quite some cases where the emulation overhead of

Re: Alt SeaBIOS SSDT cpu hotplug

2010-07-08 Thread Kevin O'Connor
On Thu, Jul 08, 2010 at 09:19:13PM +0800, Liu, Jinsong wrote: Avi Kivity wrote: Very nice. I thought about doing this but abandoned it as unmaintainable. Using external functions and the ID variable, however, reduces the mess to tolerable proportions, and gains us a lot of flexibility.

Re: [PATCH 00/27] KVM PPC PV framework

2010-07-08 Thread MJ embd
On Thu, Jul 1, 2010 at 4:12 PM, Alexander Graf ag...@suse.de wrote: On PPC we run PR=0 (kernel mode) code in PR=1 (user mode) and don't use the hypervisor extensions. While that is all great to show that virtualization is possible, there are quite some cases where the emulation overhead of