Re: [RFC PATCH] Fix: x86 unaligned __memcpy to/from virtual memory

2015-06-25 Thread Mathieu Desnoyers
- On Jun 24, 2015, at 8:37 PM, Linus Torvalds torva...@linux-foundation.org wrote: > On Wed, Jun 24, 2015 at 4:54 PM, Mathieu Desnoyers > wrote: >> >> OK, see below. This time the fault occurred at an unaligned address. >> It fails on the !pte_present(*pte_ref) check. > > So every time, %rc

Re: [RFC PATCH] Fix: x86 unaligned __memcpy to/from virtual memory

2015-06-24 Thread Linus Torvalds
On Wed, Jun 24, 2015 at 4:54 PM, Mathieu Desnoyers wrote: > > OK, see below. This time the fault occurred at an unaligned address. > It fails on the !pte_present(*pte_ref) check. So every time, %rcx is 0x001fb. Once, your rdx value (which is remaining bytes after the movsq) was 3, the other two

Re: [RFC PATCH] Fix: x86 unaligned __memcpy to/from virtual memory

2015-06-24 Thread Mathieu Desnoyers
- On Jun 24, 2015, at 7:54 PM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: > - On Jun 24, 2015, at 3:15 PM, Linus Torvalds > torva...@linux-foundation.org > wrote: > >> On Wed, Jun 24, 2015 at 11:49 AM, Mathieu Desnoyers >> wrote: >>> >>> Here is the output. I added the prin

Re: [RFC PATCH] Fix: x86 unaligned __memcpy to/from virtual memory

2015-06-24 Thread Mathieu Desnoyers
- On Jun 24, 2015, at 3:15 PM, Linus Torvalds torva...@linux-foundation.org wrote: > On Wed, Jun 24, 2015 at 11:49 AM, Mathieu Desnoyers > wrote: >> >> Here is the output. I added the printk just after the initial range >> check within vmalloc_fault. > > Good. Can you add printk's to the er

Re: [RFC PATCH] Fix: x86 unaligned __memcpy to/from virtual memory

2015-06-24 Thread Linus Torvalds
On Wed, Jun 24, 2015 at 11:49 AM, Mathieu Desnoyers wrote: > > Here is the output. I added the printk just after the initial range > check within vmalloc_fault. Good. Can you add printk's to the error return paths too, so that we see which one it is that triggers. If it is a valid vmalloc addres

Re: [RFC PATCH] Fix: x86 unaligned __memcpy to/from virtual memory

2015-06-24 Thread H. Peter Anvin
On 06/24/2015 11:49 AM, Mathieu Desnoyers wrote: > > [ 53.084521] DEBUG: vmalloc_fault at address 0xc9000746e000 > [ 53.085460] BUG: unable to handle kernel paging request at c9000746e000 > [ 53.085460] IP: > [ 53.090220] [] __memcpy+0x12/0x20 > [ 53.090220] PGD 236c92067 PUD 23

Re: [RFC PATCH] Fix: x86 unaligned __memcpy to/from virtual memory

2015-06-24 Thread Mathieu Desnoyers
- On Jun 24, 2015, at 1:00 PM, Linus Torvalds torva...@linux-foundation.org wrote: > On Wed, Jun 24, 2015 at 9:14 AM, Mathieu Desnoyers > wrote: >> When trying to change memory allocation from kmalloc to vmalloc to >> handle memory fragmentation for reallocation of a growing string within >>

Re: [RFC PATCH] Fix: x86 unaligned __memcpy to/from virtual memory

2015-06-24 Thread Linus Torvalds
On Wed, Jun 24, 2015 at 9:14 AM, Mathieu Desnoyers wrote: > When trying to change memory allocation from kmalloc to vmalloc to > handle memory fragmentation for reallocation of a growing string within > a kernel module, our testsuite started to trigger kernel OOPS. It > triggers when the string is