Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Xiao Guangrong

On Jul 18, 2013, at 3:31 AM, Gleb Natapov  wrote:

> On Thu, Jul 18, 2013 at 03:07:11AM +0800, Xiao Guangrong wrote:
>> Ouch!
>> 
>> The guest is hang when boot from ubuntu iso, i bisected the code and found 
>> it is caused by:
>> 
>> cad55f1aed000db46dfd1b5706707f33624d8604 is the first bad commit
>> commit cad55f1aed000db46dfd1b5706707f33624d8604
>> Author: Cornelia Huck 
>> Date:   Wed Jul 3 16:30:53 2013 +0200
>> 
>>KVM: kvm-io: support cookies
>> 
>>Add new functions kvm_io_bus_{read,write}_cookie() that allows users of
>>the kvm io infrastructure to use a cookie value to speed up lookup of a
>>device on an io bus.
>> 
>>Signed-off-by: Cornelia Huck 
>>Signed-off-by: Paolo Bonzini 
>> 
>> Now, i have reset the code behind this commit and continue to install the 
>> guest…...
>> 
> You are on an old queue branch (the commit was never in next). I fixed it not 
> long time ago. Can you
> pull?

Yes. The issue is gone after update the code. Thank you, Gleb!

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Markus Trippelsdorf
On 2013.07.18 at 03:27 +0800, Xiao Guangrong wrote:
> 
> Could you please try this:
> 
> index 460b9c6..16d1578 100644
> --- a/arch/x86/kvm/mmu.c
> +++ b/arch/x86/kvm/mmu.c
> @@ -2952,6 +2952,9 @@ static bool page_fault_can_be_fast(u32 error_code)
>   !(error_code & PFERR_WRITE_MASK))
> return false;
>  
> +   if (error_code & PFERR_RSVD_MASK)
> +   return false;
> +
> return true;
>  }

This fixes the issue for me. Many thanks Xiao.

-- 
Markus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Gleb Natapov
On Thu, Jul 18, 2013 at 03:07:11AM +0800, Xiao Guangrong wrote:
> Ouch!
> 
> The guest is hang when boot from ubuntu iso, i bisected the code and found it 
> is caused by:
> 
> cad55f1aed000db46dfd1b5706707f33624d8604 is the first bad commit
> commit cad55f1aed000db46dfd1b5706707f33624d8604
> Author: Cornelia Huck 
> Date:   Wed Jul 3 16:30:53 2013 +0200
> 
> KVM: kvm-io: support cookies
> 
> Add new functions kvm_io_bus_{read,write}_cookie() that allows users of
> the kvm io infrastructure to use a cookie value to speed up lookup of a
> device on an io bus.
> 
> Signed-off-by: Cornelia Huck 
> Signed-off-by: Paolo Bonzini 
> 
> Now, i have reset the code behind this commit and continue to install the 
> guest…...
> 
You are on an old queue branch (the commit was never in next). I fixed it not 
long time ago. Can you
pull?

--
Gleb.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Gleb Natapov
On Wed, Jul 17, 2013 at 09:00:29PM +0200, Markus Trippelsdorf wrote:
> > > 10346403  qemu-system-x86-1403  [001]  1451.422260: check_mmio_spte:  
> > > spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0  
> > > ...
Can you trace only this event and record stack information:
trace-cmd record -T -e kvmmmu:check_mmio_spte


> > > 
> [  236.322519] qemu-system-x86 R  running task0   603367 
> 0x
Is this the task that now prints check_mmio_spte ad nauseam?

> [  236.322523]   0001 7fff27e6b950 
> 000fee00
> [  236.322528]  8801df8b3b90 fee000b0 8801dff0b0d1 
> 
> [  236.322533]  8801df8b3b90 8801f7614040  
> 
> [  236.322537] Call Trace:
> [  236.322544]  [] ? nested_svm_get_tdp_cr3+0x20/0x20
I am assuming you are not running nested guest and this is just a glitch
in the matrix, correct?

> [  236.322551]  [] ? kvm_arch_vcpu_ioctl_run+0x415/0x10c0
> [  236.322556]  [] ? page_add_new_anon_rmap+0x2b/0x100
> [  236.322561]  [] ? handle_pte_fault+0x69b/0x7c0
> [  236.322567]  [] ? kvm_arch_vcpu_load+0x4a/0x1e0
> [  236.322573]  [] ? kvm_vcpu_ioctl+0x271/0x500
> [  236.322578]  [] ? do_vfs_ioctl+0x2cc/0x4a0
> [  236.322583]  [] ? SyS_ioctl+0x3c/0x80
> [  236.322588]  [] ? system_call_fastpath+0x16/0x1b

--
Gleb.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Xiao Guangrong
Hi,

Could you please try this:

index 460b9c6..16d1578 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -2952,6 +2952,9 @@ static bool page_fault_can_be_fast(u32 error_code)
  !(error_code & PFERR_WRITE_MASK))
return false;
 
+   if (error_code & PFERR_RSVD_MASK)
+   return false;
+
return true;
 }


On Jul 18, 2013, at 2:42 AM, Markus Trippelsdorf  wrote:

> On 2013.07.18 at 01:25 +0800, Xiao Guangrong wrote:
>> Hi Markus,
>> 
>> Thanks for your report! I am downloading the ubuntu iso and will try to 
>> reproducible it.
>> 
>> Could you please enable these tracepoints:
>> kvmmmu/check_mmio_spte
>> kvmmmu/handle_mmio_page_fault
>> kvmmmu/kvm_mmu_invalidate_zap_all_pages
>> kvmmmu/mark_mmio_spte
>> kvm/kvm_mmio
>> kvm/vcpu_match_mmio
>> 
>> and post the output?
>> 
> First line repeated ad nauseam.
> ...
> 10346367  qemu-system-x86-1403  [001]  1451.45: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346368  qemu-system-x86-1403  [001]  1451.46: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346369  qemu-system-x86-1403  [001]  1451.47: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346370  qemu-system-x86-1403  [001]  1451.48: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346371  qemu-system-x86-1403  [001]  1451.49: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0index 
> 460b9c6..16d1578 100644
> --- a/arch/x86/kvm/mmu.c
> +++ b/arch/x86/kvm/mmu.c
> @@ -2952,6 +2952,9 @@ static bool page_fault_can_be_fast(u32 error_code)
>   !(error_code & PFERR_WRITE_MASK))
> return false;
>  
> +   if (error_code & PFERR_RSVD_MASK)
> +   return false;
> +
> return true;
>  }10346372  qemu-system-x86-1404  [002]  1451.49: kvm_mmio: 
> mmio write len 4 gpa 0xfee000b0 val 0x0
> 10346373  qemu-system-x86-1403  [001]  1451.422230: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346374  qemu-system-x86-1403  [001]  1451.422231: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346375  qemu-system-x86-1403  [001]  1451.422232: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346376  qemu-system-x86-1403  [001]  1451.422233: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346377  qemu-system-x86-1403  [001]  1451.422234: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346378  qemu-system-x86-1403  [001]  1451.422235: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346379  qemu-system-x86-1404  [002]  1451.422236: kvm_mmio: 
> mmio write len 4 gpa 0xfee00380 val 0x3c7b0
> 10346380  qemu-system-x86-1403  [001]  1451.422237: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346381  qemu-system-x86-1403  [001]  1451.422238: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346382  qemu-system-x86-1403  [001]  1451.422239: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346383  qemu-system-x86-1403  [001]  1451.422240: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346384  qemu-system-x86-1403  [001]  1451.422241: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346385  qemu-system-x86-1403  [001]  1451.422242: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346386  qemu-system-x86-1403  [001]  1451.422243: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346387  qemu-system-x86-1403  [001]  1451.422244: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346403  qemu-system-x86-1403  [001]  1451.422260: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0  
> ...
> Last line repeated ad nauseam.
> 
> Whole output is over 1.3G of size.
> 
> --
> Markus

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Xiao Guangrong
Ouch!

The guest is hang when boot from ubuntu iso, i bisected the code and found it 
is caused by:

cad55f1aed000db46dfd1b5706707f33624d8604 is the first bad commit
commit cad55f1aed000db46dfd1b5706707f33624d8604
Author: Cornelia Huck 
Date:   Wed Jul 3 16:30:53 2013 +0200

KVM: kvm-io: support cookies

Add new functions kvm_io_bus_{read,write}_cookie() that allows users of
the kvm io infrastructure to use a cookie value to speed up lookup of a
device on an io bus.

Signed-off-by: Cornelia Huck 
Signed-off-by: Paolo Bonzini 

Now, i have reset the code behind this commit and continue to install the 
guest…...

On Jul 18, 2013, at 12:57 AM, Markus Trippelsdorf  
wrote:

> On 2013.07.17 at 19:42 +0300, Gleb Natapov wrote:
>> On Wed, Jul 17, 2013 at 06:32:15PM +0200, Markus Trippelsdorf wrote:
>>> The following commit:
>>> commit f8f559422b6c6a05469dfde614b67789b6142cb5
>>> Author: Xiao Guangrong 
>>> Date:   Fri Jun 7 16:51:26 2013 +0800
>>> 
>>>KVM: MMU: fast invalidate all mmio sptes
>>> 
>>> causes my kvm qemu qcow2 images to hang when they switch from the boot
>>> console to the desktop. For example:
>>> qemu-system-x86_64 -enable-kvm -net nic,vlan=0,model=virtio -net user 
>>> -drive file=ubuntu,if=virtio,cache=unsafe -smp 2 -m 1024
>>> boots normally at first, but then hangs as soon as Xorg gets started.`
>>> 
>> Which guest is is exactly and how reproducible is this?
> 
> Ubuntu 12.04.
> It's 100% reproducible or else it wouldn't have been so easily
> bisectable.
> 
>>> Perf top shows:
>>> 20.99%  [kernel]  [k] svm_vcpu_run
>>> 17.24%  [kernel]  [k] 
>>> handle_mmio_page_fault_common
>>> 15.61%  [kernel]  [k] 
>>> kvm_arch_vcpu_ioctl_run
>>> 12.49%  [kernel]  [k] 
>>> fast_page_fault.part.78
>>> 
>>> I'm running:
>>> QEMU emulator version 1.4.2 
>>> on an AMD PhenomII X4 CPU.
>>> 
>> What is the output of "cat /proc/cpuinfo"?
> 
> 
> processor : 0
> vendor_id : AuthenticAMD
> cpu family: 16
> model : 4
> model name: AMD Phenom(tm) II X4 955 Processor
> stepping  : 2
> microcode : 0x1db
> cpu MHz   : 800.000
> cache size: 512 KB
> physical id   : 0
> siblings  : 4
> core id   : 0
> cpu cores : 4
> apicid: 0
> initial apicid: 0
> fpu   : yes
> fpu_exception : yes
> cpuid level   : 5
> wp: yes
> flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov 
> pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb 
> rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid 
> pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a 
> misalignsse 3dnowprefetch osvw ibs skinit wdt hw_pstate npt lbrv svm_lock 
> nrip_save
> bogomips  : 6424.73
> TLB size  : 1024 4K pages
> clflush size  : 64
> cache_alignment   : 64
> address sizes : 48 bits physical, 48 bits virtual
> power management: ts ttp tm stc 100mhzsteps hwpstate
> ...
> *4
> 
> -- 
> Markus
> --
> 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  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Gleb Natapov
On Wed, Jul 17, 2013 at 08:42:26PM +0200, Markus Trippelsdorf wrote:
> On 2013.07.18 at 01:25 +0800, Xiao Guangrong wrote:
> > Hi Markus,
> > 
> > Thanks for your report! I am downloading the ubuntu iso and will try to 
> > reproducible it.
> > 
> > Could you please enable these tracepoints:
> > kvmmmu/check_mmio_spte
> > kvmmmu/handle_mmio_page_fault
> > kvmmmu/kvm_mmu_invalidate_zap_all_pages
> > kvmmmu/mark_mmio_spte
> > kvm/kvm_mmio
> > kvm/vcpu_match_mmio
> > 
> > and post the output?
> > 
> First line repeated ad nauseam.
> ...
> 10346367  qemu-system-x86-1403  [001]  1451.45: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346368  qemu-system-x86-1403  [001]  1451.46: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346369  qemu-system-x86-1403  [001]  1451.47: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346370  qemu-system-x86-1403  [001]  1451.48: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346371  qemu-system-x86-1403  [001]  1451.49: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346372  qemu-system-x86-1404  [002]  1451.49: kvm_mmio: 
> mmio write len 4 gpa 0xfee000b0 val 0x0
> 10346373  qemu-system-x86-1403  [001]  1451.422230: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346374  qemu-system-x86-1403  [001]  1451.422231: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346375  qemu-system-x86-1403  [001]  1451.422232: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346376  qemu-system-x86-1403  [001]  1451.422233: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346377  qemu-system-x86-1403  [001]  1451.422234: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346378  qemu-system-x86-1403  [001]  1451.422235: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346379  qemu-system-x86-1404  [002]  1451.422236: kvm_mmio: 
> mmio write len 4 gpa 0xfee00380 val 0x3c7b0
> 10346380  qemu-system-x86-1403  [001]  1451.422237: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346381  qemu-system-x86-1403  [001]  1451.422238: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346382  qemu-system-x86-1403  [001]  1451.422239: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346383  qemu-system-x86-1403  [001]  1451.422240: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346384  qemu-system-x86-1403  [001]  1451.422241: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346385  qemu-system-x86-1403  [001]  1451.422242: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346386  qemu-system-x86-1403  [001]  1451.422243: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346387  qemu-system-x86-1403  [001]  1451.422244: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
> 10346403  qemu-system-x86-1403  [001]  1451.422260: check_mmio_spte:  
> spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0  
> ...
> Last line repeated ad nauseam.
> 
While this happens can you run "echo t > /proc/sysrq-trigger" and attach
dmesg here.

--
Gleb.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Markus Trippelsdorf
On 2013.07.18 at 01:25 +0800, Xiao Guangrong wrote:
> Hi Markus,
> 
> Thanks for your report! I am downloading the ubuntu iso and will try to 
> reproducible it.
> 
> Could you please enable these tracepoints:
> kvmmmu/check_mmio_spte
> kvmmmu/handle_mmio_page_fault
> kvmmmu/kvm_mmu_invalidate_zap_all_pages
> kvmmmu/mark_mmio_spte
> kvm/kvm_mmio
> kvm/vcpu_match_mmio
> 
> and post the output?
> 
First line repeated ad nauseam.
...
10346367  qemu-system-x86-1403  [001]  1451.45: check_mmio_spte:  spte 
fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
10346368  qemu-system-x86-1403  [001]  1451.46: check_mmio_spte:  spte 
fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
10346369  qemu-system-x86-1403  [001]  1451.47: check_mmio_spte:  spte 
fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
10346370  qemu-system-x86-1403  [001]  1451.48: check_mmio_spte:  spte 
fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
10346371  qemu-system-x86-1403  [001]  1451.49: check_mmio_spte:  spte 
fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
10346372  qemu-system-x86-1404  [002]  1451.49: kvm_mmio: mmio 
write len 4 gpa 0xfee000b0 val 0x0
10346373  qemu-system-x86-1403  [001]  1451.422230: check_mmio_spte:  spte 
fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
10346374  qemu-system-x86-1403  [001]  1451.422231: check_mmio_spte:  spte 
fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
10346375  qemu-system-x86-1403  [001]  1451.422232: check_mmio_spte:  spte 
fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
10346376  qemu-system-x86-1403  [001]  1451.422233: check_mmio_spte:  spte 
fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
10346377  qemu-system-x86-1403  [001]  1451.422234: check_mmio_spte:  spte 
fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
10346378  qemu-system-x86-1403  [001]  1451.422235: check_mmio_spte:  spte 
fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
10346379  qemu-system-x86-1404  [002]  1451.422236: kvm_mmio: mmio 
write len 4 gpa 0xfee00380 val 0x3c7b0
10346380  qemu-system-x86-1403  [001]  1451.422237: check_mmio_spte:  spte 
fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
10346381  qemu-system-x86-1403  [001]  1451.422238: check_mmio_spte:  spte 
fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
10346382  qemu-system-x86-1403  [001]  1451.422239: check_mmio_spte:  spte 
fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
10346383  qemu-system-x86-1403  [001]  1451.422240: check_mmio_spte:  spte 
fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
10346384  qemu-system-x86-1403  [001]  1451.422241: check_mmio_spte:  spte 
fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
10346385  qemu-system-x86-1403  [001]  1451.422242: check_mmio_spte:  spte 
fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
10346386  qemu-system-x86-1403  [001]  1451.422243: check_mmio_spte:  spte 
fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
10346387  qemu-system-x86-1403  [001]  1451.422244: check_mmio_spte:  spte 
fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0
10346403  qemu-system-x86-1403  [001]  1451.422260: check_mmio_spte:  spte 
fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0  
...
Last line repeated ad nauseam.

Whole output is over 1.3G of size.

--
Markus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Markus Trippelsdorf
On 2013.07.18 at 01:25 +0800, Xiao Guangrong wrote:
> Hi Markus,
> 
> Thanks for your report! I am downloading the ubuntu iso and will try to 
> reproducible it.

Please note that the exact guest doesn't matter. I first noticed the
hang when I tried to install Fedora 19 today.

> Could you please enable these tracepoints:
> kvmmmu/check_mmio_spte
> kvmmmu/handle_mmio_page_fault
> kvmmmu/kvm_mmu_invalidate_zap_all_pages
> kvmmmu/mark_mmio_spte
> kvm/kvm_mmio
> kvm/vcpu_match_mmio
> 
> and post the output?

I will run this later.

> Just check, your host is 64-bit or 32 bit? 

Both guest and host are 64-bit.

-- 
Markus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Xiao Guangrong
Hi Markus,

Thanks for your report! I am downloading the ubuntu iso and will try to 
reproducible it.

Could you please enable these tracepoints:
kvmmmu/check_mmio_spte
kvmmmu/handle_mmio_page_fault
kvmmmu/kvm_mmu_invalidate_zap_all_pages
kvmmmu/mark_mmio_spte
kvm/kvm_mmio
kvm/vcpu_match_mmio

and post the output?

Just check, your host is 64-bit or 32 bit? 

On Jul 18, 2013, at 12:57 AM, Markus Trippelsdorf  
wrote:

> On 2013.07.17 at 19:42 +0300, Gleb Natapov wrote:
>> On Wed, Jul 17, 2013 at 06:32:15PM +0200, Markus Trippelsdorf wrote:
>>> The following commit:
>>> commit f8f559422b6c6a05469dfde614b67789b6142cb5
>>> Author: Xiao Guangrong 
>>> Date:   Fri Jun 7 16:51:26 2013 +0800
>>> 
>>>KVM: MMU: fast invalidate all mmio sptes
>>> 
>>> causes my kvm qemu qcow2 images to hang when they switch from the boot
>>> console to the desktop. For example:
>>> qemu-system-x86_64 -enable-kvm -net nic,vlan=0,model=virtio -net user 
>>> -drive file=ubuntu,if=virtio,cache=unsafe -smp 2 -m 1024
>>> boots normally at first, but then hangs as soon as Xorg gets started.`
>>> 
>> Which guest is is exactly and how reproducible is this?
> 
> Ubuntu 12.04.
> It's 100% reproducible or else it wouldn't have been so easily
> bisectable.
> 
>>> Perf top shows:
>>> 20.99%  [kernel]  [k] svm_vcpu_run
>>> 17.24%  [kernel]  [k] 
>>> handle_mmio_page_fault_common
>>> 15.61%  [kernel]  [k] 
>>> kvm_arch_vcpu_ioctl_run
>>> 12.49%  [kernel]  [k] 
>>> fast_page_fault.part.78
>>> 
>>> I'm running:
>>> QEMU emulator version 1.4.2 
>>> on an AMD PhenomII X4 CPU.
>>> 
>> What is the output of "cat /proc/cpuinfo"?
> 
> 
> processor : 0
> vendor_id : AuthenticAMD
> cpu family: 16
> model : 4
> model name: AMD Phenom(tm) II X4 955 Processor
> stepping  : 2
> microcode : 0x1db
> cpu MHz   : 800.000
> cache size: 512 KB
> physical id   : 0
> siblings  : 4
> core id   : 0
> cpu cores : 4
> apicid: 0
> initial apicid: 0
> fpu   : yes
> fpu_exception : yes
> cpuid level   : 5
> wp: yes
> flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov 
> pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb 
> rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid 
> pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a 
> misalignsse 3dnowprefetch osvw ibs skinit wdt hw_pstate npt lbrv svm_lock 
> nrip_save
> bogomips  : 6424.73
> TLB size  : 1024 4K pages
> clflush size  : 64
> cache_alignment   : 64
> address sizes : 48 bits physical, 48 bits virtual
> power management: ts ttp tm stc 100mhzsteps hwpstate
> ...
> *4
> 
> -- 
> Markus
> --
> 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  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Markus Trippelsdorf
On 2013.07.17 at 19:42 +0300, Gleb Natapov wrote:
> On Wed, Jul 17, 2013 at 06:32:15PM +0200, Markus Trippelsdorf wrote:
> > The following commit:
> >  commit f8f559422b6c6a05469dfde614b67789b6142cb5
> >  Author: Xiao Guangrong 
> >  Date:   Fri Jun 7 16:51:26 2013 +0800
> > 
> > KVM: MMU: fast invalidate all mmio sptes
> > 
> > causes my kvm qemu qcow2 images to hang when they switch from the boot
> > console to the desktop. For example:
> >  qemu-system-x86_64 -enable-kvm -net nic,vlan=0,model=virtio -net user 
> > -drive file=ubuntu,if=virtio,cache=unsafe -smp 2 -m 1024
> > boots normally at first, but then hangs as soon as Xorg gets started.`
> > 
> Which guest is is exactly and how reproducible is this?

Ubuntu 12.04.
It's 100% reproducible or else it wouldn't have been so easily
bisectable.

> > Perf top shows:
> >  20.99%  [kernel]  [k] svm_vcpu_run
> >  17.24%  [kernel]  [k] 
> > handle_mmio_page_fault_common
> >  15.61%  [kernel]  [k] 
> > kvm_arch_vcpu_ioctl_run
> >  12.49%  [kernel]  [k] 
> > fast_page_fault.part.78
> > 
> > I'm running:
> > QEMU emulator version 1.4.2 
> > on an AMD PhenomII X4 CPU.
> > 
> What is the output of "cat /proc/cpuinfo"?


processor   : 0
vendor_id   : AuthenticAMD
cpu family  : 16
model   : 4
model name  : AMD Phenom(tm) II X4 955 Processor
stepping: 2
microcode   : 0x1db
cpu MHz : 800.000
cache size  : 512 KB
physical id : 0
siblings: 4
core id : 0
cpu cores   : 4
apicid  : 0
initial apicid  : 0
fpu : yes
fpu_exception   : yes
cpuid level : 5
wp  : yes
flags   : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov 
pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb 
rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid pni 
monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a 
misalignsse 3dnowprefetch osvw ibs skinit wdt hw_pstate npt lbrv svm_lock 
nrip_save
bogomips: 6424.73
TLB size: 1024 4K pages
clflush size: 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate
...
*4

-- 
Markus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Gleb Natapov
On Wed, Jul 17, 2013 at 06:32:15PM +0200, Markus Trippelsdorf wrote:
> The following commit:
>  commit f8f559422b6c6a05469dfde614b67789b6142cb5
>  Author: Xiao Guangrong 
>  Date:   Fri Jun 7 16:51:26 2013 +0800
> 
> KVM: MMU: fast invalidate all mmio sptes
> 
> causes my kvm qemu qcow2 images to hang when they switch from the boot
> console to the desktop. For example:
>  qemu-system-x86_64 -enable-kvm -net nic,vlan=0,model=virtio -net user -drive 
> file=ubuntu,if=virtio,cache=unsafe -smp 2 -m 1024
> boots normally at first, but then hangs as soon as Xorg gets started.`
> 
Which guest is is exactly and how reproducible is this?

> Perf top shows:
>  20.99%  [kernel]  [k] svm_vcpu_run
>  17.24%  [kernel]  [k] 
> handle_mmio_page_fault_common
>  15.61%  [kernel]  [k] kvm_arch_vcpu_ioctl_run
>  12.49%  [kernel]  [k] fast_page_fault.part.78
> 
> I'm running:
> QEMU emulator version 1.4.2 
> on an AMD PhenomII X4 CPU.
> 
What is the output of "cat /proc/cpuinfo"?

--
Gleb.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/