RE: [PATCH 14/24] Prepare vmcs02 from vmcs01 and vmcs12

2010-07-06 Thread Dong, Eddie
Nadav Har'El wrote: This patch contains code to prepare the VMCS which can be used to actually run the L2 guest, vmcs02. prepare_vmcs02 appropriately merges the information in shadow_vmcs that L1 built for L2 (vmcs12), and that in the VMCS that we built for L1 (vmcs01). VMREAD/WRITE can only

Re: [patch 0/3] [RESEND] kvm test: test rmap chains

2010-07-06 Thread Avi Kivity
On 07/05/2010 09:16 PM, Marcelo Tosatti wrote: Applied, thanks. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at

Re: [patch 3/3] kvm test: long rmap chains

2010-07-06 Thread Avi Kivity
On 07/05/2010 09:16 PM, Marcelo Tosatti wrote: test long rmap chains + +int main (void) +{ +int i; +int nr_pages; +void *target_page, *virt_addr; + +setup_vm(); + +nr_pages = inl(0xd1) / PAGE_SIZE; +nr_pages -= 1000; No need to depend on the number of physical

Re: random crash in post_kvm_run()

2010-07-06 Thread Avi Kivity
On 07/05/2010 10:42 AM, Avi Kivity wrote: Please don't top-post. On 07/03/2010 05:23 PM, BuraphaLinux Server wrote: Ok, I kept going like you said. Here is what it said: $git bisect good 44ea2b1758d88ad822e65b1c4c21ca6164494e27 is the first bad commit commit

[PATCH] KVM: VMX: Fix host MSR_KERNEL_GS_BASE corruption

2010-07-06 Thread Avi Kivity
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 under its feet, it took the wrong

Re: random crash in post_kvm_run()

2010-07-06 Thread Avi Kivity
On 07/06/2010 10:46 AM, Avi Kivity wrote: I'll investigate further. Patch posted. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at

[PATCH 1/6] KVM: x86 emulator: fix 'mov sreg,rm16' instruction decoding

2010-07-06 Thread Wei Yongjun
Memory reads for 'mov sreg,rm16' should be 16 bits only. Signed-off-by: Wei Yongjun yj...@cn.fujitsu.com --- arch/x86/kvm/emulate.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index e8bdddc..d842a7d 100644 ---

[PATCH 2/6] KVM: x86 emulator: fix the comment of out instruction

2010-07-06 Thread Wei Yongjun
Fix the comment of out instruction, using the same style as the other instructions. Signed-off-by: Wei Yongjun yj...@cn.fujitsu.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

[PATCH 3/6] KVM: x86 emulator: fix 'and AL,imm8' instruction decoding

2010-07-06 Thread Wei Yongjun
'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 --- arch/x86/kvm/emulate.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git

[PATCH 4/6] KVM: x86 emulator: fix 'mov rm,sreg' instruction decoding

2010-07-06 Thread Wei Yongjun
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 --- arch/x86/kvm/emulate.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/emulate.c

[PATCH 5/6] KVM: x86 emulator: fix 'mov AL,moffs' instruction decoding

2010-07-06 Thread Wei Yongjun
'mov AL,moffs' do not need decode dest operand and 'mov moffs,AL' do not need decode source operand. Signed-off-by: Wei Yongjun yj...@cn.fujitsu.com --- arch/x86/kvm/emulate.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/emulate.c

Re: [PATCH 1/6] KVM: x86 emulator: fix 'mov sreg,rm16' instruction decoding

2010-07-06 Thread Avi Kivity
On 07/06/2010 11:49 AM, Wei Yongjun wrote: Memory reads for 'mov sreg,rm16' should be 16 bits only. Applied all 6, thanks. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to

[ kvm-Bugs-2124690 ] external modules dont support seperate linux output dir

2010-07-06 Thread SourceForge.net
Bugs item #2124690, was opened at 2008-09-23 16:38 Message generated for change (Comment added) made by jessorensen You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=893831aid=2124690group_id=180599 Please note that this message will contain a full copy of the comment

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

2010-07-06 Thread Dong, Eddie
+/* Allocate an L0 VMCS (vmcs02) for the current L1 VMCS (vmcs12), if one + * does not already exist. The allocation is done in L0 memory, so to avoid + * denial-of-service attack by guests, we limit the number of concurrently- + * allocated vmcss. A well-behaving L1 will VMCLEAR unused

[PATCH v5 1/9] KVM: MMU: fix forgot reserved bits check in speculative path

2010-07-06 Thread Xiao Guangrong
In the speculative path, we should check guest pte's reserved bits just as the real processor does Reported-by: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c |3 +++ arch/x86/kvm/paging_tmpl.h |3 ++- 2 files

[PATCH v5 2/9] KVM: MMU: fix race between 'walk_addr' and 'fetch'

2010-07-06 Thread Xiao Guangrong
'walk_addr' is out of mmu_lock's protection, so while we handle 'fetch', then guest's mapping has modifited by other vcpu's write path, such as invlpg, pte_write and other fetch path Fixed by checking all level's mapping Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com ---

[PATCH v5 3/9] export __get_user_pages_fast() function

2010-07-06 Thread Xiao Guangrong
This function is used by KVM to pin process's page in the atomic context. Define the 'weak' function to avoid other architecture not support it Acked-by: Nick Piggin npig...@suse.de Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- mm/util.c | 13 + 1 files changed,

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

2010-07-06 Thread Xiao Guangrong
Introduce gfn_to_pfn_atomic(), it's the fast path and can used in atomic context, the later patch will use it Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- include/linux/kvm_host.h |1 + virt/kvm/kvm_main.c | 32 +--- 2 files changed, 26

[PATCH v5 6/9] KVM: MMU: introduce pte_prefetch_topup_memory_cache()

2010-07-06 Thread Xiao Guangrong
Introduce this function to topup prefetch cache Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c | 25 + 1 files changed, 21 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 3dcd55d..cda4587

[PATCH v5 7/9] KVM: MMU: prefetch ptes when intercepted guest #PF

2010-07-06 Thread Xiao Guangrong
Support prefetch ptes when intercept guest #PF, avoid to #PF by later access If we meet any failure in the prefetch path, we will exit it and not try other ptes to avoid become heavy path Will do: fix dirty bit tracking in the speculative path Signed-off-by: Xiao Guangrong

[PATCH v5 9/9] KVM: MMU: trace pte prefetch

2010-07-06 Thread Xiao Guangrong
Trace pte prefetch, it can help us to improve the prefetch's performance Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c | 40 ++-- arch/x86/kvm/mmutrace.h| 33 +

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

2010-07-06 Thread Gleb Natapov
On Tue, Jul 06, 2010 at 06:47:47PM +0800, Xiao Guangrong wrote: Introduce gfn_to_pfn_atomic(), it's the fast path and can used in atomic context, the later patch will use it Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- include/linux/kvm_host.h |1 +

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

2010-07-06 Thread Xiao Guangrong
Gleb Natapov wrote: +} if (unlikely(npages != 1)) { struct vm_area_struct *vma; +if (atomic) +goto return_bad_page; + You are skipping hwpoison test and sometimes you will return bad_page for something that returns good pfn now

Re: [PATCH 5/6] KVM: x86 emulator: fix 'mov AL,moffs' instruction decoding

2010-07-06 Thread Avi Kivity
On 07/06/2010 11:53 AM, Wei Yongjun wrote: 'mov AL,moffs' do not need decode dest operand and 'mov moffs,AL' do not need decode source operand. @@ -177,8 +177,8 @@ static u32 opcode_table[256] = { 0, 0, SrcImmFAddr | No64, 0, ImplicitOps | Stack, ImplicitOps | Stack, 0, 0,

Re: [Qemu-devel] KVM Call agenda for July 6th

2010-07-06 Thread Anthony Liguori
On 07/05/2010 09:05 AM, Luiz Capitulino wrote: On Mon, 05 Jul 2010 14:45:23 +0200 Juan Quintelaquint...@redhat.com wrote: Please send in any agenda items you are interested in covering. - 0.13 release I was hoping to do -rc0 before the holiday but that didn't happen so I'm

Re: [Qemu-devel] KVM Call agenda for July 6th

2010-07-06 Thread Anthony Liguori
On 07/05/2010 11:52 PM, Alex Williamson wrote: On Mon, 2010-07-05 at 11:05 -0300, Luiz Capitulino wrote: On Mon, 05 Jul 2010 14:45:23 +0200 Juan Quintelaquint...@redhat.com wrote: Please send in any agenda items you are interested in covering. - 0.13 release -

Re: KVM Call agenda for July 6th

2010-07-06 Thread Anthony Liguori
On 07/05/2010 07:45 AM, Juan Quintela wrote: Please send in any agenda items you are interested in covering. If we have a lack of agenda items I'll cancel the week's call. I've got a lot to catch up on after the mini-holiday so I'd rather skip the call unless there's a pressing agenda

Re: [Qemu-devel] KVM Call agenda for July 6th

2010-07-06 Thread Kevin Wolf
Am 06.07.2010 15:26, schrieb Anthony Liguori: On 07/05/2010 09:05 AM, Luiz Capitulino wrote: On Mon, 05 Jul 2010 14:45:23 +0200 Juan Quintelaquint...@redhat.com wrote: Please send in any agenda items you are interested in covering. - 0.13 release I was hoping to do -rc0

[PATCH 1/2] KVM: MMU: Only indicate a fetch fault in page fault error code if nx is enabled

2010-07-06 Thread Avi Kivity
Bit 4 of the page fault error code is set only if EFER.NX is set. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/paging_tmpl.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h index dfb2720..56c7f4f

[PATCH 0/2] Fix walk_addr() page fault error codes

2010-07-06 Thread Avi Kivity
This patchset fixes bugs in page fault error code generation. With the patches applied, the access.flat unit test now passes with no errors on shadow, npt, and ept. Avi Kivity (2): KVM: MMU: Only indicate a fetch fault in page fault error code if nx is enabled KVM: MMU: Keep going on

Re: [Qemu-devel] KVM Call agenda for July 6th

2010-07-06 Thread Anthony Liguori
On 07/06/2010 08:37 AM, Kevin Wolf wrote: Am 06.07.2010 15:26, schrieb Anthony Liguori: On 07/05/2010 09:05 AM, Luiz Capitulino wrote: On Mon, 05 Jul 2010 14:45:23 +0200 Juan Quintelaquint...@redhat.com wrote: Please send in any agenda items you are interested in

Re: [Qemu-devel] KVM Call agenda for July 6th

2010-07-06 Thread Kevin Wolf
Am 06.07.2010 15:53, schrieb Anthony Liguori: On 07/06/2010 08:37 AM, Kevin Wolf wrote: Am 06.07.2010 15:26, schrieb Anthony Liguori: On 07/05/2010 09:05 AM, Luiz Capitulino wrote: On Mon, 05 Jul 2010 14:45:23 +0200 Juan Quintelaquint...@redhat.com wrote: Please send

KVM call minutes for July 6

2010-07-06 Thread Juan Quintela
Today was a short call as Anthony didn't attend. - Jes reminded people that Linux Plumbers deadline is July 19th - Qemu 0.13 (from the agenda, we didn't discuss it without Anthony). List of patches missing commit/comment/review from Anthony. We decided to send to the list an initial list, and

Re: [Qemu-devel] KVM Call agenda for July 6th

2010-07-06 Thread Markus Armbruster
Kevin Wolf kw...@redhat.com writes: Am 06.07.2010 15:53, schrieb Anthony Liguori: On 07/06/2010 08:37 AM, Kevin Wolf wrote: Am 06.07.2010 15:26, schrieb Anthony Liguori: On 07/05/2010 09:05 AM, Luiz Capitulino wrote: On Mon, 05 Jul 2010 14:45:23 +0200 Juan

Re: [Qemu-devel] KVM call minutes for July 6

2010-07-06 Thread Cam Macdonell
On Tue, Jul 6, 2010 at 8:46 AM, Juan Quintela quint...@redhat.com wrote: Today was a short call as Anthony didn't attend. - Jes reminded people that Linux Plumbers deadline is July 19th - Qemu 0.13 (from the agenda, we didn't discuss it without Anthony). List of patches missing

Re: [Qemu-devel] KVM Call agenda for July 6th

2010-07-06 Thread Anthony Liguori
On 07/06/2010 10:27 AM, Kevin Wolf wrote: Any chance to get the next series (Split ide-drive and scsi-disk qdevs, and more) as well? 1-3/8 are bug fixes, and 4/8 removes unreliable information from info block; wanted in .13. 5-8/8 could be punted to .14. If it's purely bug fixes, I

Re: random crash in post_kvm_run()

2010-07-06 Thread BuraphaLinux Server
On 7/6/10, Avi Kivity a...@redhat.com wrote: On 07/06/2010 10:46 AM, Avi Kivity wrote: I'll investigate further. Patch posted. Hello Avi Kitty, I spent the day getting things ready for you to log in, but was amazed to find you already had a patch ready for testing, which was good news. I

[PATCH v4 10/12] Handle async PF in non preemptable context

2010-07-06 Thread Gleb Natapov
If async page fault is received by idle task or when preemp_count is not zero guest cannot reschedule, so do sti; hlt and wait for page to be ready. vcpu can still process interrupts while it waits for the page to be ready. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kernel/kvm.c |

[PATCH v4 07/12] Maintain memslot version number

2010-07-06 Thread Gleb Natapov
Code that depends on particular memslot layout can track changes and adjust to new layout. Signed-off-by: Gleb Natapov g...@redhat.com --- include/linux/kvm_host.h |1 + virt/kvm/kvm_main.c |1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/include/linux/kvm_host.h

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

2010-07-06 Thread Gleb Natapov
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 guest may be in non-sleepable context and will not be able to

[PATCH v4 00/12] KVM: Add host swap event notifications for PV guest

2010-07-06 Thread Gleb Natapov
KVM virtualizes guest memory by means of shadow pages or HW assistance like NPT/EPT. Not all memory used by a guest is mapped into the guest address space or even present in a host memory at any given time. When vcpu tries to access memory page that is not mapped into the guest address space KVM

[PATCH v4 09/12] Retry fault before vmentry

2010-07-06 Thread Gleb Natapov
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. Signed-off-by: Gleb Natapov g...@redhat.com ---

[PATCH v4 06/12] Add get_user_pages() variant that fails if major fault is required.

2010-07-06 Thread Gleb Natapov
This patch add get_user_pages() variant that only succeeds if getting a reference to a page doesn't require major fault. Reviewed-by: Rik van Riel r...@redhat.com Signed-off-by: Gleb Natapov g...@redhat.com --- fs/ncpfs/mmap.c|2 ++ include/linux/mm.h |5 + mm/filemap.c |

[PATCH v4 04/12] Provide special async page fault handler when async PF capability is detected

2010-07-06 Thread Gleb Natapov
When async PF capability is detected hook up special page fault handler that will handle async page fault events and bypass other page faults to regular page fault handler. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_para.h |3 + arch/x86/include/asm/traps.h|

[PATCH v4 01/12] Move kvm_smp_prepare_boot_cpu() from kvmclock.c to kvm.c.

2010-07-06 Thread Gleb Natapov
Async PF also needs to hook into smp_prepare_boot_cpu so move the hook into generic code. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_para.h |1 + arch/x86/kernel/kvm.c | 11 +++ arch/x86/kernel/kvmclock.c | 13 + 3 files

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

2010-07-06 Thread Gleb Natapov
Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_para.h |5 arch/x86/kernel/kvm.c | 49 +++ arch/x86/kernel/smpboot.c |3 ++ include/linux/kvm_para.h|2 + 4 files changed, 59 insertions(+), 0

[PATCH v4 05/12] Export __get_user_pages_fast.

2010-07-06 Thread Gleb Natapov
KVM will use it to try and find a page without falling back to slow gup. That is why get_user_pages_fast() is not enough. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/mm/gup.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/x86/mm/gup.c

[PATCH v4 02/12] Add PV MSR to enable asynchronous page faults delivery.

2010-07-06 Thread Gleb Natapov
Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_host.h |3 ++ arch/x86/include/asm/kvm_para.h |4 +++ arch/x86/kvm/x86.c | 49 +- include/linux/kvm.h |1 + 4 files changed, 55 insertions(+), 2

[PATCH v4 12/12] Send async PF when guest is not in userspace too.

2010-07-06 Thread Gleb Natapov
Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/mmu.c |8 +++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 95a0a8b..297f399 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -2280,7 +2280,13 @@ static

Re: [PATCH] KVM: VMX: Fix host MSR_KERNEL_GS_BASE corruption

2010-07-06 Thread Marcelo Tosatti
On Tue, Jul 06, 2010 at 11:36:01AM +0300, Avi Kivity wrote: 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

Re: [PATCH v5 8/9] KVM: MMU: combine guest pte read between fetch and pte prefetch

2010-07-06 Thread Marcelo Tosatti
On Tue, Jul 06, 2010 at 06:51:06PM +0800, Xiao Guangrong wrote: Combine guest pte read between guest pte check in the fetch path and pte prefetch Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/paging_tmpl.h | 69 ++-

Re: [PATCH v5 8/9] KVM: MMU: combine guest pte read between fetch and pte prefetch

2010-07-06 Thread Xiao Guangrong
Marcelo Tosatti wrote: - -first_pte_gpa = gfn_to_gpa(sp-gfn) + -(offset + i) * sizeof(pt_element_t); - -if (kvm_read_guest_atomic(vcpu-kvm, first_pte_gpa, gptep, -sizeof(gptep)) 0) -return; +gptep =

Re: [PATCH 0/2] Fix walk_addr() page fault error codes

2010-07-06 Thread Xiao Guangrong
Avi Kivity wrote: This patchset fixes bugs in page fault error code generation. With the patches applied, the access.flat unit test now passes with no errors on shadow, npt, and ept. Avi Kivity (2): KVM: MMU: Only indicate a fetch fault in page fault error code if nx is enabled

Alt SeaBIOS SSDT cpu hotplug

2010-07-06 Thread Kevin O'Connor
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 dynamic SSDT entries just call methods in the main DSDT. This is