PAX: size overflow detected in function __vhost_add_used_n drivers/vhost/vhost.c:1517

2015-12-05 Thread Toralf Förster

run into the following at a 64bit hardened stable Gentoo Linux while running 
the following command at the host (probably just the ssh login was it yet) :

$ cd ~/devel/linux/; git archive --prefix linux-4.4.x/ v4.4-rc3 | (ssh 
root@n22kvm "cd /usr/src/; sudo tar -xf-")



Dec  5 20:39:26 t44 kernel: PAX: size overflow detected in function 
__vhost_add_used_n drivers/vhost/vhost.c:1517 cicus.491_193 max, count: 7, 
decl: last_used_idx; num: 0; context: vhost_virtqueue;
Dec  5 20:39:26 t44 kernel: CPU: 2 PID: 3708 Comm: vhost-3706 Tainted: G
W   4.2.6-hardened-r7 #2
Dec  5 20:39:26 t44 kernel: Hardware name: LENOVO 20AQCTO1WW/20AQCTO1WW, BIOS 
GJET83WW (2.33 ) 03/09/2015
Dec  5 20:39:26 t44 kernel:  c096fe5a  c096fddc 
c943bb78
Dec  5 20:39:26 t44 kernel:  815ef500 88033e30eec8 c096fe5a 
c943bba8
Dec  5 20:39:26 t44 kernel:  811ae28b fffb 880326d300a0 
0005
Dec  5 20:39:26 t44 kernel: Call Trace:
Dec  5 20:39:26 t44 kernel:  [] ? 
__param_str_max_mem_regions+0x9a/0xae8 [vhost]
Dec  5 20:39:26 t44 kernel:  [] ? 
__param_str_max_mem_regions+0x1c/0xae8 [vhost]
Dec  5 20:39:26 t44 kernel:  [] dump_stack+0x45/0x5d
Dec  5 20:39:26 t44 kernel:  [] ? 
__param_str_max_mem_regions+0x9a/0xae8 [vhost]
Dec  5 20:39:26 t44 kernel:  [] report_size_overflow+0x3b/0x50
Dec  5 20:39:26 t44 kernel:  [] 
__vhost_add_used_n+0x1db/0x1e0 [vhost]
Dec  5 20:39:26 t44 kernel:  [] ? 
copy_user_enhanced_fast_string+0x16/0x20
Dec  5 20:39:26 t44 kernel:  [] vhost_add_used_n+0x92/0x1b0 
[vhost]
Dec  5 20:39:26 t44 kernel:  [] 
vhost_add_used_and_signal_n+0x2a/0x50 [vhost]
Dec  5 20:39:26 t44 kernel:  [] handle_rx+0x63b/0x910 
[vhost_net]
Dec  5 20:39:26 t44 kernel:  [] handle_rx_net+0x1d/0x30 
[vhost_net]
Dec  5 20:39:26 t44 kernel:  [] vhost_worker+0xf8/0x1a0 
[vhost]
Dec  5 20:39:26 t44 kernel:  [] ? vhost_log_write+0xa0/0xa0 
[vhost]
Dec  5 20:39:26 t44 kernel:  [] kthread+0xf7/0x110
Dec  5 20:39:26 t44 kernel:  [] ? 
kthread_create_on_node+0x1b0/0x1b0
Dec  5 20:39:26 t44 kernel:  [] ret_from_fork+0x3e/0x70
Dec  5 20:39:26 t44 kernel:  [] ? 
kthread_create_on_node+0x1b0/0x1b0


-- 
Toralf, pgp: C4EACDDE 0076E94E
--
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


[PATCH] arch/x86/kvm/x86.c: add comment to a superfluous test for !X86_64

2014-05-03 Thread Toralf Förster
Signed-off-by: Toralf Förster 
---
 arch/x86/kvm/x86.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 8b8fc0b..c45718a 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5680,6 +5680,11 @@ int kvm_hv_hypercall(struct kvm_vcpu *vcpu)
kvm_x86_ops->get_cs_db_l_bits(vcpu, &cs_db, &cs_l);
longmode = is_long_mode(vcpu) && cs_l == 1;
 
+   /* 
+* The next condition is superfluous for !CONFIG_X86_64 but a fix to
+* make a static code checker happy would be more ugly than helpful
+* 
+*/
if (!longmode) {
param = ((u64)kvm_register_read(vcpu, VCPU_REGS_RDX) << 32) |
(kvm_register_read(vcpu, VCPU_REGS_RAX) & 0x);
-- 
1.9.2

--
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


Re: [PATCH] arch/x86/kvm/x86.c: remove a superfluous test for !X86_64

2014-04-27 Thread Toralf Förster
On 04/27/2014 05:40 PM, Paolo Bonzini wrote:
> Il 27/04/2014 17:32, Toralf Förster ha scritto:
>> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
>> index 8b8fc0b..a6ca7e0 100644
>> --- a/arch/x86/kvm/x86.c
>> +++ b/arch/x86/kvm/x86.c
>> @@ -5680,15 +5680,17 @@ int kvm_hv_hypercall(struct kvm_vcpu *vcpu)
>>  kvm_x86_ops->get_cs_db_l_bits(vcpu, &cs_db, &cs_l);
>>  longmode = is_long_mode(vcpu) && cs_l == 1;
>>
>> +#ifdef CONFIG_X86_64
>>  if (!longmode) {
>> +#endif
> 
> This is ugly...
+1

> 
>>  param = ((u64)kvm_register_read(vcpu, VCPU_REGS_RDX) << 32) |
>>  (kvm_register_read(vcpu, VCPU_REGS_RAX) & 0x);
>>  ingpa = ((u64)kvm_register_read(vcpu, VCPU_REGS_RBX) << 32) |
>>  (kvm_register_read(vcpu, VCPU_REGS_RCX) & 0x);
>>  outgpa = ((u64)kvm_register_read(vcpu, VCPU_REGS_RDI) << 32) |
>>  (kvm_register_read(vcpu, VCPU_REGS_RSI) & 0x);
>> -}
>>  #ifdef CONFIG_X86_64
> 
> ... can you just remove this #ifdef instead?  It will be dead code, but
> the compiler will detect it as such and remove it.
> 

ok, but VCPU_REGS_R8 is #ifdef'ed in arch/x86/include/asm/kvm_host.h around 
line 120 and therefore I get :

tfoerste@n22 ~/devel/linux $ sudo make modules
...
  CHK include/config/kernel.release
  CHK include/generated/uapi/linux/version.h
  CHK include/generated/utsrelease.h
  CALLscripts/checksyscalls.sh
  CC [M]  arch/x86/kvm/x86.o
arch/x86/kvm/x86.c: In function ‘kvm_hv_hypercall’:
arch/x86/kvm/x86.c:5694:36: error: ‘VCPU_REGS_R8’ undeclared (first use in this 
function)
arch/x86/kvm/x86.c:5694:36: note: each undeclared identifier is reported only 
once for each function it appears in
make[2]: *** [arch/x86/kvm/x86.o] Error 1
make[1]: *** [arch/x86/kvm] Error 2
make: *** [arch/x86] Error 2


> Paolo
> 
>> +}
>>  else {
>>  param = kvm_register_read(vcpu, VCPU_REGS_RCX);
>>  ingpa = kvm_register_read(vcpu, VCPU_REGS_RDX);
> 
> 


-- 
Toralf

--
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


[PATCH] arch/x86/kvm/x86.c: remove a superfluous test for !X86_64

2014-04-27 Thread Toralf Förster
compile and runtime tested

Signed-off-by: Toralf Förster 
---
 arch/x86/kvm/x86.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 8b8fc0b..a6ca7e0 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5680,15 +5680,17 @@ int kvm_hv_hypercall(struct kvm_vcpu *vcpu)
kvm_x86_ops->get_cs_db_l_bits(vcpu, &cs_db, &cs_l);
longmode = is_long_mode(vcpu) && cs_l == 1;
 
+#ifdef CONFIG_X86_64
if (!longmode) {
+#endif
param = ((u64)kvm_register_read(vcpu, VCPU_REGS_RDX) << 32) |
(kvm_register_read(vcpu, VCPU_REGS_RAX) & 0x);
ingpa = ((u64)kvm_register_read(vcpu, VCPU_REGS_RBX) << 32) |
(kvm_register_read(vcpu, VCPU_REGS_RCX) & 0x);
outgpa = ((u64)kvm_register_read(vcpu, VCPU_REGS_RDI) << 32) |
(kvm_register_read(vcpu, VCPU_REGS_RSI) & 0x);
-   }
 #ifdef CONFIG_X86_64
+   }
else {
param = kvm_register_read(vcpu, VCPU_REGS_RCX);
ingpa = kvm_register_read(vcpu, VCPU_REGS_RDX);
-- 
1.9.2

--
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


Re: [PATCH 1/2] arch/x86/kvm/x86.c: remove superflous check condition

2014-04-27 Thread Toralf Förster
On 04/27/2014 04:41 PM, Paolo Bonzini wrote:
> Il 27/04/2014 13:40, Toralf Förster ha scritto:
>> Ah, so the following would work, but looks too ugly, right ? :
>>
>>
>> #ifdef CONFIG_X86_64
>> if (!longmode) {
>> #endif
>> param = ((u64)kvm_register_read(vcpu, VCPU_REGS_RDX) << 32) |
>> (kvm_register_read(vcpu, VCPU_REGS_RAX) & 0x);
>> ingpa = ((u64)kvm_register_read(vcpu, VCPU_REGS_RBX) << 32) |
>> (kvm_register_read(vcpu, VCPU_REGS_RCX) & 0x);
>> outgpa = ((u64)kvm_register_read(vcpu, VCPU_REGS_RDI) << 32) |
>> (kvm_register_read(vcpu, VCPU_REGS_RSI) & 0x);
>> #ifdef CONFIG_X86_64
>> }
>> else {
>> param = kvm_register_read(vcpu, VCPU_REGS_RCX);
>> ingpa = kvm_register_read(vcpu, VCPU_REGS_RDX);
>> outgpa = kvm_register_read(vcpu, VCPU_REGS_R8);
>> }
>> #endif
>>
> 
> Yep. :)  Note that GCC correctly reports no warning, because it looks
> through is_long_mode.  In the end, #ifdef in the code can just be
> removed.  Please compile-test it on 32-bit though (well, I will too
> before committing but...).
> 
> Paolo
> 

Will send out a patch, which was compile tested and runtime tested using
a tails KVM image udner a stable 32 bit Gentoo Linux

-- 
Toralf

--
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


Re: [PATCH 1/2] arch/x86/kvm/x86.c: remove superflous check condition

2014-04-27 Thread Toralf Förster
On 04/27/2014 12:45 PM, Paolo Bonzini wrote:
> Il 27/04/2014 12:30, Toralf Förster ha scritto:
>> Signed-off-by: Toralf Förster 
>> ---
>>  arch/x86/kvm/x86.c | 23 ++-
>>  1 file changed, 10 insertions(+), 13 deletions(-)
>>
>> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
>> index 8b8fc0b..93cf454 100644
>> --- a/arch/x86/kvm/x86.c
>> +++ b/arch/x86/kvm/x86.c
>> @@ -5680,20 +5680,17 @@ int kvm_hv_hypercall(struct kvm_vcpu *vcpu)
>>  kvm_x86_ops->get_cs_db_l_bits(vcpu, &cs_db, &cs_l);
>>  longmode = is_long_mode(vcpu) && cs_l == 1;
>>
>> -if (!longmode) {
>> -param = ((u64)kvm_register_read(vcpu, VCPU_REGS_RDX) << 32) |
>> -(kvm_register_read(vcpu, VCPU_REGS_RAX) & 0x);
>> -ingpa = ((u64)kvm_register_read(vcpu, VCPU_REGS_RBX) << 32) |
>> -(kvm_register_read(vcpu, VCPU_REGS_RCX) & 0x);
>> -outgpa = ((u64)kvm_register_read(vcpu, VCPU_REGS_RDI) << 32) |
>> -(kvm_register_read(vcpu, VCPU_REGS_RSI) & 0x);
>> -}
>>  #ifdef CONFIG_X86_64
>> -else {
>> -param = kvm_register_read(vcpu, VCPU_REGS_RCX);
>> -ingpa = kvm_register_read(vcpu, VCPU_REGS_RDX);
>> -outgpa = kvm_register_read(vcpu, VCPU_REGS_R8);
>> -}
>> +param = kvm_register_read(vcpu, VCPU_REGS_RCX);
>> +ingpa = kvm_register_read(vcpu, VCPU_REGS_RDX);
>> +outgpa = kvm_register_read(vcpu, VCPU_REGS_R8);
>> +#else
>> +param = ((u64)kvm_register_read(vcpu, VCPU_REGS_RDX) << 32) |
>> +(kvm_register_read(vcpu, VCPU_REGS_RAX) & 0x);
>> +ingpa = ((u64)kvm_register_read(vcpu, VCPU_REGS_RBX) << 32) |
>> +(kvm_register_read(vcpu, VCPU_REGS_RCX) & 0x);
>> +outgpa = ((u64)kvm_register_read(vcpu, VCPU_REGS_RDI) << 32) |
>> +(kvm_register_read(vcpu, VCPU_REGS_RSI) & 0x);
>>  #endif
>>
>>  code = param & 0x;
>>
> 
> No, wait, it's only superfluous in the sense that you don't need
> longmode for !CONFIG_X86_64.  It's definitely needed for CONFIG_X86_64,
> because the guest can run in 32-bit mode.
> 
> Paolo
> 

Ah, so the following would work, but looks too ugly, right ? :


#ifdef CONFIG_X86_64
if (!longmode) {
#endif
param = ((u64)kvm_register_read(vcpu, VCPU_REGS_RDX) << 32) |
(kvm_register_read(vcpu, VCPU_REGS_RAX) & 0x);
ingpa = ((u64)kvm_register_read(vcpu, VCPU_REGS_RBX) << 32) |
(kvm_register_read(vcpu, VCPU_REGS_RCX) & 0x);
outgpa = ((u64)kvm_register_read(vcpu, VCPU_REGS_RDI) << 32) |
(kvm_register_read(vcpu, VCPU_REGS_RSI) & 0x);
#ifdef CONFIG_X86_64
}
else {
param = kvm_register_read(vcpu, VCPU_REGS_RCX);
ingpa = kvm_register_read(vcpu, VCPU_REGS_RDX);
outgpa = kvm_register_read(vcpu, VCPU_REGS_R8);
}
#endif

-- 
Toralf

--
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


[PATCH 2/2] arch/x86/kvm/x86.c: variable longmode ist just used in one place, remove it therefore

2014-04-27 Thread Toralf Förster
Signed-off-by: Toralf Förster 
---
 arch/x86/kvm/x86.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 93cf454..05166a0 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5665,7 +5665,7 @@ int kvm_hv_hypercall(struct kvm_vcpu *vcpu)
 {
u64 param, ingpa, outgpa, ret;
uint16_t code, rep_idx, rep_cnt, res = HV_STATUS_SUCCESS, rep_done = 0;
-   bool fast, longmode;
+   bool fast;
int cs_db, cs_l;
 
/*
@@ -5678,7 +5678,6 @@ int kvm_hv_hypercall(struct kvm_vcpu *vcpu)
}
 
kvm_x86_ops->get_cs_db_l_bits(vcpu, &cs_db, &cs_l);
-   longmode = is_long_mode(vcpu) && cs_l == 1;
 
 #ifdef CONFIG_X86_64
param = kvm_register_read(vcpu, VCPU_REGS_RCX);
@@ -5710,7 +5709,7 @@ int kvm_hv_hypercall(struct kvm_vcpu *vcpu)
}
 
ret = res | (((u64)rep_done & 0xfff) << 32);
-   if (longmode) {
+   if (is_long_mode(vcpu) && cs_l == 1) {
kvm_register_write(vcpu, VCPU_REGS_RAX, ret);
} else {
kvm_register_write(vcpu, VCPU_REGS_RDX, ret >> 32);
-- 
1.9.2

--
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


[PATCH 1/2] arch/x86/kvm/x86.c: remove superflous check condition

2014-04-27 Thread Toralf Förster
Signed-off-by: Toralf Förster 
---
 arch/x86/kvm/x86.c | 23 ++-
 1 file changed, 10 insertions(+), 13 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 8b8fc0b..93cf454 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5680,20 +5680,17 @@ int kvm_hv_hypercall(struct kvm_vcpu *vcpu)
kvm_x86_ops->get_cs_db_l_bits(vcpu, &cs_db, &cs_l);
longmode = is_long_mode(vcpu) && cs_l == 1;
 
-   if (!longmode) {
-   param = ((u64)kvm_register_read(vcpu, VCPU_REGS_RDX) << 32) |
-   (kvm_register_read(vcpu, VCPU_REGS_RAX) & 0x);
-   ingpa = ((u64)kvm_register_read(vcpu, VCPU_REGS_RBX) << 32) |
-   (kvm_register_read(vcpu, VCPU_REGS_RCX) & 0x);
-   outgpa = ((u64)kvm_register_read(vcpu, VCPU_REGS_RDI) << 32) |
-   (kvm_register_read(vcpu, VCPU_REGS_RSI) & 0x);
-   }
 #ifdef CONFIG_X86_64
-   else {
-   param = kvm_register_read(vcpu, VCPU_REGS_RCX);
-   ingpa = kvm_register_read(vcpu, VCPU_REGS_RDX);
-   outgpa = kvm_register_read(vcpu, VCPU_REGS_R8);
-   }
+   param = kvm_register_read(vcpu, VCPU_REGS_RCX);
+   ingpa = kvm_register_read(vcpu, VCPU_REGS_RDX);
+   outgpa = kvm_register_read(vcpu, VCPU_REGS_R8);
+#else
+   param = ((u64)kvm_register_read(vcpu, VCPU_REGS_RDX) << 32) |
+   (kvm_register_read(vcpu, VCPU_REGS_RAX) & 0x);
+   ingpa = ((u64)kvm_register_read(vcpu, VCPU_REGS_RBX) << 32) |
+   (kvm_register_read(vcpu, VCPU_REGS_RCX) & 0x);
+   outgpa = ((u64)kvm_register_read(vcpu, VCPU_REGS_RDI) << 32) |
+   (kvm_register_read(vcpu, VCPU_REGS_RSI) & 0x);
 #endif
 
code = param & 0x;
-- 
1.9.2

--
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


[arch/x86/kvm/x86.c:5699]: (error) Uninitialized variable: param

2014-04-26 Thread Toralf Förster
cppcheck spotted this - and while it has a lot of false positives in its 
current version,
I do think that the kernel code around that line can be improved:


longmode = is_long_mode(vcpu) && cs_l == 1;

if (!longmode) {
param = ((u64)kvm_register_read(vcpu, VCPU_REGS_RDX) << 32) |
(kvm_register_read(vcpu, VCPU_REGS_RAX) & 0x);
ingpa = ((u64)kvm_register_read(vcpu, VCPU_REGS_RBX) << 32) |
(kvm_register_read(vcpu, VCPU_REGS_RCX) & 0x);
outgpa = ((u64)kvm_register_read(vcpu, VCPU_REGS_RDI) << 32) |
(kvm_register_read(vcpu, VCPU_REGS_RSI) & 0x);
}
#ifdef CONFIG_X86_64
else {
param = kvm_register_read(vcpu, VCPU_REGS_RCX);
ingpa = kvm_register_read(vcpu, VCPU_REGS_RDX);
outgpa = kvm_register_read(vcpu, VCPU_REGS_R8);
}
#endif

code = param & 0x;



If CONFIG_X86_64 is not defined then the condition "if (!longmode)" is either 
superfluous
or lacks an else branch, right ?


-- 
Toralf

--
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


Re: 3.13 hangs when I tried to start a KVM at a 32 bit stable Gentoo

2014-02-24 Thread Toralf Förster
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 01/23/2014 07:55 PM, Dave Hansen wrote:
> On 01/21/2014 08:38 AM, Toralf Förster wrote:
>> Jan 21 17:18:57 n22 kernel: INFO: rcu_sched self-detected stall on CPU { 2}  
>> (t=60001 jiffies g=18494 c=18493 q=183951)
>> Jan 21 17:18:57 n22 kernel: sending NMI to all CPUs:
>> Jan 21 17:18:57 n22 kernel: NMI backtrace for cpu 2
>> Jan 21 17:18:57 n22 kernel: CPU: 2 PID: 6779 Comm: qemu-system-x86 Not 
>> tainted 3.13.0 #3
>> Jan 21 17:18:57 n22 kernel: Hardware name: LENOVO 4180F65/4180F65, BIOS 
>> 83ET75WW (1.45 ) 05/10/2013
>> Jan 21 17:18:57 n22 kernel: task: e921c370 ti: e5f36000 task.ti: e5f36000
> 
> I'm seeing a very similar hang with an ubuntu guest and a custom kernel.
>  I'm on commit 0dc3fd0249a, and it's 100% reproducible every time I run KVM.
> 
> Cc-ing a few more folks...
> 

I tried to bisect it - the first attempt to bisetc it between v3.12. and v3.13 
blamed this commit :

commit 37bf06375c90a42fe07b9bebdb07bc316ae5a0ce
Merge: 6bfa687 d0e639c
Author: Ingo Molnar 
Date:   Wed Oct 9 12:36:13 2013 +0200

Merge tag 'v3.12-rc4' into sched/core

Merge Linux v3.12-rc4 to fix a conflict and also to refresh the tree
before applying more scheduler patches.

Conflicts:
arch/avr32/include/asm/Kbuild

Signed-off-by: Ingo Molnar 


which seems rather to be the upper limit where to search for the first bad 
commit, or ?



- -- 
MfG/Sincerely
Toralf Förster
pgp finger print:1A37 6F99 4A9D 026F 13E2 4DCF C4EA CDDE 0076 E94E
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iF4EAREIAAYFAlMLregACgkQxOrN3gB26U7P7gD/Wage68loQ++oP4moD94kTNpn
goyT7fvssm3jyF+2HagA/0EIR5MOcl7xlBPNw5JKqcI0pPx0yBytUljtz+KTPS/Y
=P8vB
-END PGP SIGNATURE-
--
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


Re: 3.13 hangs when I tried to start a KVM at a 32 bit stable Gentoo

2014-02-08 Thread Toralf Förster
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 01/23/2014 07:55 PM, Dave Hansen wrote:
> On 01/21/2014 08:38 AM, Toralf Förster wrote:
>> Jan 21 17:18:57 n22 kernel: INFO: rcu_sched self-detected stall on CPU { 2}  
>> (t=60001 jiffies g=18494 c=18493 q=183951)
>> Jan 21 17:18:57 n22 kernel: sending NMI to all CPUs:
>> Jan 21 17:18:57 n22 kernel: NMI backtrace for cpu 2
>> Jan 21 17:18:57 n22 kernel: CPU: 2 PID: 6779 Comm: qemu-system-x86 Not 
>> tainted 3.13.0 #3
>> Jan 21 17:18:57 n22 kernel: Hardware name: LENOVO 4180F65/4180F65, BIOS 
>> 83ET75WW (1.45 ) 05/10/2013
>> Jan 21 17:18:57 n22 kernel: task: e921c370 ti: e5f36000 task.ti: e5f36000
> 
> I'm seeing a very similar hang with an ubuntu guest and a custom kernel.
>  I'm on commit 0dc3fd0249a, and it's 100% reproducible every time I run KVM.
> 
> Cc-ing a few more folks...
> 
With 3.12.2 at the same 32 bit Gentoo Linux I experienced a similar thingin a 
complete different scenario: I umounted a loop-mounted file, on which I created 
and filled a btrfs file system before (/usr/portage FWIW - I'm a Gentoo user) 
and the systems becomes very slowly and /var/log/messages shows :

Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: Error sending 
POWER_TABLE_CMD: time out after 2000ms.
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: Current CMD queue read_ptr 
100 write_ptr 101
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: Loaded firmware version: 
18.168.6.1
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: 0x | OK
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: 0x | uPc
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: 0x | branchlink1
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: 0x | branchlink2
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: 0x | interruptlink1
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: 0x | interruptlink2
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: 0x | data1
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: 0x | data2
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: 0x | line
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: 0x | beacon time
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: 0x | tsf low
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: 0x | tsf hi
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: 0x | time gp1
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: 0x | time gp2
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: 0x | time gp3
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: 0x | uCode version
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: 0x | hw version
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: 0x | board version
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: 0x | hcmd
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: 0x | isr0
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: 0x | isr1
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: 0x | isr2
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: 0x | isr3
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: 0x | isr4
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: 0x | isr_pref
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: 0x | wait_event
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: 0x | l2p_control
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: 0x | l2p_duration
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: 0x | l2p_mhvalid
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: 0x | l2p_addr_match
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: 0x | lmpm_pmg_sel
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: 0x | timestamp
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: 0x | flow_handler
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: Start IWL Event Log Dump: 
nothing in log
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: set power fail, ret = -110
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: iwl_trans_wait_tx_queue_empty 
bad state = 0
Feb  7 22:46:46 n22 kernel: ieee80211 phy0: Hardware restart was requested
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: L1 Enabled; Disabling L0S
Feb  7 22:46:46 n22 kernel: iwlwifi :03:00.0: Radio type=0x1-0x2-0x0
Feb  7 22:46:51 n22 kernel: iwlwifi :03:00.0: Failed to load firmware chunk!
Feb  7 22:46:51 n22 kernel: iwlwifi :03:00.0: Could not load the [0] uCode 
section
Feb  7 22:46:51 n22 kernel: iwlwifi :03:00.0: Failed to start RT ucode: -110
Feb  7 22:46:51 n22 kernel: iwlwifi :03:00.0: Unable to initialize device.
Feb  7 22:46:51 n22 kernel: iwlwifi :03:00.0: Fw not loaded - dropping CMD: 
18
Feb  7 22:46:51 n22 kernel: wlp3s0: HW problem - can not stop rx aggregation 
for 08:96:d7:05:f9:2a tid 0
Feb  7 22:46:51 n22 kernel: iwlwifi :03:00.0: Fw 

Re: 3.13 hangs when I tried to start a KVM at a 32 bit stable Gentoo

2014-01-26 Thread Toralf Förster
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 01/24/2014 01:36 PM, Paolo Bonzini wrote:
> Il 23/01/2014 20:50, Toralf Förster ha scritto:
> | What makes the situation really annyoing - sometimes I just can
> | restart my wlan device it the system works normal, but sometimes
> | the whole system hangs and for those cases then sometimes not even
> | sysrq buttons do work.
> 
> Can you reproduce it with the wlan driver disabled completely?

yes - with CONFIG_WLAN=n I do get a similar thing :


Jan 26 11:23:17 n22 kernel: NET: Registered protocol family 17
Jan 26 11:23:17 n22 kernel: device vnet0 entered promiscuous mode
Jan 26 11:23:17 n22 kernel: br0: port 4(vnet0) entered forwarding state
Jan 26 11:23:17 n22 kernel: br0: port 4(vnet0) entered forwarding state
Jan 26 11:23:17 n22 kernel: IPv6: ADDRCONF(NETDEV_CHANGE): br0: link becomes 
ready
Jan 26 11:23:17 n22 kernel: cgroup: libvirtd (6113) created nested cgroup for 
controller "memory" which has incomplete hierarchy support. Nested cgroups may 
change behavior in the future.
Jan 26 11:23:17 n22 kernel: cgroup: "memory" requires setting use_hierarchy to 
1 on the root.
Jan 26 11:23:19 n22 ntpd[6015]: Listen normally on 5 br0 
fe80::837:18ff:feae:caf0 UDP 123
Jan 26 11:23:19 n22 ntpd[6015]: Listen normally on 6 vnet0 
fe80::fc54:ff:fed0:f1eb UDP 123
Jan 26 11:23:19 n22 ntpd[6015]: peers refreshed
Jan 26 11:23:35 n22 kernel: br0: port 4(vnet0) entered disabled state
Jan 26 11:23:35 n22 kernel: device vnet0 left promiscuous mode
Jan 26 11:23:35 n22 kernel: br0: port 4(vnet0) entered disabled state
Jan 26 11:23:38 n22 ntpd[6015]: Deleting interface #6 vnet0, 
fe80::fc54:ff:fed0:f1eb#123, interface stats: received=0, sent=0, dropped=0, 
active_time=19 secs
Jan 26 11:23:38 n22 ntpd[6015]: peers refreshed
Jan 26 11:23:45 n22 kernel: device vnet0 entered promiscuous mode
Jan 26 11:23:45 n22 kernel: br0: port 4(vnet0) entered forwarding state
Jan 26 11:23:45 n22 kernel: br0: port 4(vnet0) entered forwarding state
Jan 26 11:23:48 n22 ntpd[6015]: Listen normally on 7 vnet0 
fe80::fc54:ff:fed0:f1eb UDP 123
Jan 26 11:23:48 n22 ntpd[6015]: peers refreshed
Jan 26 11:24:09 n22 kernel: br0: port 4(vnet0) entered disabled state
Jan 26 11:24:09 n22 kernel: device vnet0 left promiscuous mode
Jan 26 11:24:09 n22 kernel: br0: port 4(vnet0) entered disabled state
Jan 26 11:24:11 n22 ntpd[6015]: Deleting interface #7 vnet0, 
fe80::fc54:ff:fed0:f1eb#123, interface stats: received=0, sent=0, dropped=0, 
active_time=23 secs
Jan 26 11:24:11 n22 ntpd[6015]: peers refreshed
Jan 26 11:24:28 n22 kernel: device vnet0 entered promiscuous mode
Jan 26 11:24:28 n22 kernel: br0: port 4(vnet0) entered forwarding state
Jan 26 11:24:28 n22 kernel: br0: port 4(vnet0) entered forwarding state
Jan 26 11:24:31 n22 ntpd[6015]: Listen normally on 8 vnet0 
fe80::fc54:ff:fed0:f1eb UDP 123
Jan 26 11:24:31 n22 ntpd[6015]: peers refreshed
Jan 26 11:24:57 n22 kernel: hda-intel: IRQ timing workaround is activated for 
card #0. Suggest a bigger bdl_pos_adj.
Jan 26 11:25:34 n22 kernel: INFO: rcu_sched self-detected stall on CPU { 3}  
(t=6 jiffies g=23149 c=23148 q=7132)
Jan 26 11:25:34 n22 kernel: sending NMI to all CPUs:
Jan 26 11:25:34 n22 kernel: NMI backtrace for cpu 3
Jan 26 11:25:34 n22 kernel: CPU: 3 PID: 6523 Comm: qemu-system-x86 Not tainted 
3.13.0 #5
Jan 26 11:25:34 n22 kernel: Hardware name: LENOVO 4180F65/4180F65, BIOS 
83ET75WW (1.45 ) 05/10/2013
Jan 26 11:25:34 n22 kernel: task: e410c8a0 ti: eec6 task.ti: eec6
Jan 26 11:25:34 n22 kernel: EIP: 0060:[] EFLAGS: 0006 CPU: 3
Jan 26 11:25:34 n22 kernel: EIP is at __const_udelay+0xd/0x20
Jan 26 11:25:34 n22 kernel: EAX: 01062560 EBX: 2710 ECX: c1557e60 EDX: 
00278af4
Jan 26 11:25:34 n22 kernel: ESI: c155c500 EDI: f3627c80 EBP: eec61c64 ESP: 
eec61c64
Jan 26 11:25:34 n22 kernel: DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
Jan 26 11:25:34 n22 kernel: CR0: 80050033 CR2:  CR3: 23c2e000 CR4: 
000427f0
Jan 26 11:25:34 n22 kernel: Stack:
Jan 26 11:25:34 n22 kernel: eec61c74 c102dc75 c14b9db5 c155c500 eec61cb8 
c108ba1c c14c3ac0 ea60
Jan 26 11:25:34 n22 kernel: 5a6d 5a6c 1bdc c106aadd 0001 
c155c500 c1595544 f3627c80
Jan 26 11:25:34 n22 kernel: 1bdc 0003 e410c8a0  0003 
eec61ccc c104a2fb f3627ec0
Jan 26 11:25:34 n22 kernel: Call Trace:
Jan 26 11:25:34 n22 kernel: [] 
arch_trigger_all_cpu_backtrace+0x55/0x70
Jan 26 11:25:34 n22 kernel: [] rcu_check_callbacks+0x38c/0x590
Jan 26 11:25:34 n22 kernel: [] ? account_system_time+0xbd/0x170
Jan 26 11:25:34 n22 kernel: [] update_process_times+0x3b/0x70
Jan 26 11:25:34 n22 kernel: [] tick_sched_handle.isra.12+0x33/0x40
Jan 26 11:25:34 n22 kernel: [] tick_sched_timer+0x40/0x70
Jan 26 11:25:34 n22 kernel: [] ? __remove_hrtimer+0x40/0xa0
Jan 26 11:25:34 n22 kernel: [] __run_hrtimer+0x69/0x190
Jan 26 11:25:34 n22 kernel: [] ? tick_sched_do_timer+0x40/0x40
Jan 26 11:25:34 n22 kernel: [] hrtimer_interr

Re: 3.13 hangs when I tried to start a KVM at a 32 bit stable Gentoo

2014-01-25 Thread Toralf Förster
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 01/24/2014 01:36 PM, Paolo Bonzini wrote:
> Il 23/01/2014 20:50, Toralf Förster ha scritto: | What makes the
> situation really annyoing - sometimes I just can | restart my wlan
> device it the system works normal, but sometimes | the whole system
> hangs and for those cases then sometimes not even | sysrq buttons
> do work.
> 
> Can you reproduce it with the wlan driver disabled completely?
> 
yes - root cause is not the wlan - that's just a victim.
> Paolo
> 

- -- 
MfG/Sincerely
Toralf Förster
pgp finger print:1A37 6F99 4A9D 026F 13E2 4DCF C4EA CDDE 0076 E94E
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iF4EAREIAAYFAlLjiF0ACgkQxOrN3gB26U64DwD/c60zqwUORstYkSD2I1AarWLO
/4QVwWo8hW8bUg6f3SEA/2Wv7jkJTtkfTUVEyZZxeEJaNP+RChsmGSoU77Dl1G7T
=VMnB
-END PGP SIGNATURE-
--
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


Re: 3.13 hangs when I tried to start a KVM at a 32 bit stable Gentoo

2014-01-23 Thread Toralf Förster
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 01/23/2014 08:33 PM, Dave Hansen wrote:
> On 01/23/2014 10:55 AM, Dave Hansen wrote:
>> On 01/21/2014 08:38 AM, Toralf Förster wrote:
>>> Jan 21 17:18:57 n22 kernel: INFO: rcu_sched self-detected stall on CPU { 2} 
>>>  (t=60001 jiffies g=18494 c=18493 q=183951)
>>> Jan 21 17:18:57 n22 kernel: sending NMI to all CPUs:
>>> Jan 21 17:18:57 n22 kernel: NMI backtrace for cpu 2
>>> Jan 21 17:18:57 n22 kernel: CPU: 2 PID: 6779 Comm: qemu-system-x86 Not 
>>> tainted 3.13.0 #3
>>> Jan 21 17:18:57 n22 kernel: Hardware name: LENOVO 4180F65/4180F65, BIOS 
>>> 83ET75WW (1.45 ) 05/10/2013
>>> Jan 21 17:18:57 n22 kernel: task: e921c370 ti: e5f36000 task.ti: e5f36000
>>
>> I'm seeing a very similar hang with an ubuntu guest and a custom kernel.
>> I'm on commit 0dc3fd0249a, and it's 100% reproducible every time I run KVM.
> 
> Did a little more LKML digging and found this:
> 
>   http://marc.info/?l=linux-kernel&m=139038631607917&q=raw
> 
Hhm, that patch cannot be applied to 3.13.0 kernel :-(

> Peter's fix works for me.  I'm also running a CONFIG_PREEMPT_VOLUNTARY=y
> config.
> 
I do have :

n22 /usr/src/linux # zgrep CONFIG_PREEMPT /proc/config.gz
# CONFIG_PREEMPT_RCU is not set
CONFIG_PREEMPT_NOTIFIERS=y
# CONFIG_PREEMPT_NONE is not set
CONFIG_PREEMPT_VOLUNTARY=y
# CONFIG_PREEMPT is not set

> 

What makes the situation really annyoing - sometimes I just can restart my wlan 
device it the system works normal, but sometimes the whole system hangs and for 
those cases then sometimes not even sysrq buttons do work.

What I see in /var/log/messages are those lines :

Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: Error sending 
POWER_TABLE_CMD: time out after 2000ms.
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: Current CMD queue read_ptr 
158 write_ptr 159
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: Loaded firmware version: 
18.168.6.1
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: 0x | OK   
   Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: 0x | uPc
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: 0x | branchlink1
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: 0x | branchlink2
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: 0x | interruptlink1
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: 0x | interruptlink2
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: 0x | data1
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: 0x | data2
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: 0x | line
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: 0x | beacon time
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: 0x | tsf low
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: 0x | tsf hi
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: 0x | time gp1
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: 0x | time gp2
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: 0x | time gp3
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: 0x | uCode version
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: 0x | hw version
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: 0x | board version
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: 0x | hcmd
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: 0x | isr0
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: 0x | isr1
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: 0x | isr2
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: 0x | isr3
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: 0x | isr4
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: 0x | isr_pref
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: 0x | wait_event
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: 0x | l2p_control
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: 0x | l2p_duration
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: 0x | l2p_mhvalid
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: 0x | l2p_addr_match
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: 0x | lmpm_pmg_sel
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: 0x | timestamp
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: 0x | flow_handler
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: Start IWL Event Log Dump: 
nothing in log
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: set power fail, ret = -110
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: iwl_trans_wait_tx_queue_empty 
bad state = 0
Jan 23 19:23:15 n22 kernel: ieee80211 phy0: Hardware restart was requested
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: L1 Enabled; Disabling L0S
Jan 23 19:23:15 n22 kernel: iwlwifi :03:00.0: Radio type=0x1-0x2-0x0
Jan