Re: [RESEND PATCH 2/4] x86: add phys addr validity check for /dev/mem mmap

2014-09-30 Thread Frantisek Hrbata
On Tue, Sep 30, 2014 at 07:27:51AM -0700, Dave Hansen wrote: > On 09/30/2014 05:41 AM, Frantisek Hrbata wrote: > > Does it make sense to replace "count" with "size" so it's consistent with > > the > > rest or do you prefer "nr_bytes" or a

[PATCH v2 4/4] x86: remove high_memory check from valid_phys_addr_range

2014-09-30 Thread Frantisek Hrbata
There is no need to block read/write access to /dev/mem for phys. addr. above high_memory for non-system RAM. The only limitation should be boot_cpu_data.x86_phys_bits(max phys. addr. size). Signed-off-by: Frantisek Hrbata --- arch/x86/mm/mmap.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v2 2/4] x86: add phys addr validity check for /dev/mem mmap

2014-09-30 Thread Frantisek Hrbata
quot;); return 0; } -8<-- V3: use len_bytes instead of count, thanks to Dave Hansen and Thomas Gleixner V2: fix pfn check in valid_mmap_phys_addr_range, thanks to Dave Hansen Signed-off-by: Frantisek Hrbata --- arch/x86

[PATCH v2 3/4] x86: add high_memory check to (xlate|unxlate)_dev_mem_ptr

2014-09-30 Thread Frantisek Hrbata
safely for kernel mapped memory and it will also allow read/write to access non-system RAM above high_memory once the high_memory check is removed from valid_phys_addr_range. Signed-off-by: Frantisek Hrbata --- arch/x86/mm/ioremap.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions

[PATCH v2 0/4] x86: /dev/mem fixes

2014-09-30 Thread Frantisek Hrbata
valid reason to use high_memory check in (read|write)_mem. The second patch removes the high_memory check from valid_phys_addr_range, allowing read/write to access non-system RAM above high_memory. So far this was possible only by using mmap. I hope I haven't overlooked something. Many thanks Fran

[PATCH v2 1/4] x86: add arch_pfn_possible helper

2014-09-30 Thread Frantisek Hrbata
Add helper to check maximum possible pfn on x86. Also make the current phys_addr_valid helper using it internally. Signed-off-by: Frantisek Hrbata --- arch/x86/mm/physaddr.h | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/x86/mm/physaddr.h b/arch/x86/mm

Re: [RESEND PATCH 2/4] x86: add phys addr validity check for /dev/mem mmap

2014-09-30 Thread Frantisek Hrbata
On Mon, Sep 29, 2014 at 10:15:28PM +0200, Thomas Gleixner wrote: > On Mon, 29 Sep 2014, Frantisek Hrbata wrote: > > V2: fix pfn check in valid_mmap_phys_addr_range, thanks to Dave Hansen > > AFAICT, Dave also asked you to change size_t count into something more > intuit

Re: [RESEND PATCH 2/4] x86: add phys addr validity check for /dev/mem mmap

2014-09-30 Thread Frantisek Hrbata
On Mon, Sep 29, 2014 at 10:15:28PM +0200, Thomas Gleixner wrote: On Mon, 29 Sep 2014, Frantisek Hrbata wrote: V2: fix pfn check in valid_mmap_phys_addr_range, thanks to Dave Hansen AFAICT, Dave also asked you to change size_t count into something more intuitive, i.e. nr_bytes or such. Hi

[PATCH v2 1/4] x86: add arch_pfn_possible helper

2014-09-30 Thread Frantisek Hrbata
Add helper to check maximum possible pfn on x86. Also make the current phys_addr_valid helper using it internally. Signed-off-by: Frantisek Hrbata fhrb...@redhat.com --- arch/x86/mm/physaddr.h | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/x86/mm/physaddr.h b

[PATCH v2 0/4] x86: /dev/mem fixes

2014-09-30 Thread Frantisek Hrbata
. The second patch removes the high_memory check from valid_phys_addr_range, allowing read/write to access non-system RAM above high_memory. So far this was possible only by using mmap. I hope I haven't overlooked something. Many thanks Frantisek Hrbata (4): x86: add arch_pfn_possible helper x86

[PATCH v2 3/4] x86: add high_memory check to (xlate|unxlate)_dev_mem_ptr

2014-09-30 Thread Frantisek Hrbata
safely for kernel mapped memory and it will also allow read/write to access non-system RAM above high_memory once the high_memory check is removed from valid_phys_addr_range. Signed-off-by: Frantisek Hrbata fhrb...@redhat.com --- arch/x86/mm/ioremap.c | 9 ++--- 1 file changed, 6 insertions

[PATCH v2 4/4] x86: remove high_memory check from valid_phys_addr_range

2014-09-30 Thread Frantisek Hrbata
There is no need to block read/write access to /dev/mem for phys. addr. above high_memory for non-system RAM. The only limitation should be boot_cpu_data.x86_phys_bits(max phys. addr. size). Signed-off-by: Frantisek Hrbata fhrb...@redhat.com --- arch/x86/mm/mmap.c | 2 +- 1 file changed, 1

[PATCH v2 2/4] x86: add phys addr validity check for /dev/mem mmap

2014-09-30 Thread Frantisek Hrbata
; } -8-- V3: use len_bytes instead of count, thanks to Dave Hansen and Thomas Gleixner V2: fix pfn check in valid_mmap_phys_addr_range, thanks to Dave Hansen Signed-off-by: Frantisek Hrbata fhrb...@redhat.com --- arch/x86/include/asm/io.h | 4 arch/x86

Re: [RESEND PATCH 2/4] x86: add phys addr validity check for /dev/mem mmap

2014-09-30 Thread Frantisek Hrbata
On Tue, Sep 30, 2014 at 07:27:51AM -0700, Dave Hansen wrote: On 09/30/2014 05:41 AM, Frantisek Hrbata wrote: Does it make sense to replace count with size so it's consistent with the rest or do you prefer nr_bytes or as Dave proposed len_bytes? I don't care what it is as long as it has

[RESEND PATCH 1/4] x86: add arch_pfn_possible helper

2014-09-29 Thread Frantisek Hrbata
Add helper to check maximum possible pfn on x86. Also make the current phys_addr_valid helper using it internally. Signed-off-by: Frantisek Hrbata --- arch/x86/mm/physaddr.h | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/x86/mm/physaddr.h b/arch/x86/mm

[RESEND PATCH 2/4] x86: add phys addr validity check for /dev/mem mmap

2014-09-29 Thread Frantisek Hrbata
ot;); return 0; } -----8<-- V2: fix pfn check in valid_mmap_phys_addr_range, thanks to Dave Hansen Signed-off-by: Frantisek Hrbata --- arch/x86/include/asm/io.h | 4 arch/x86/mm/mmap.c| 12 2 f

[RESEND PATCH 3/4] x86: add high_memory check to (xlate|unxlate)_dev_mem_ptr

2014-09-29 Thread Frantisek Hrbata
safely for kernel mapped memory and it will also allow read/write to access non-system RAM above high_memory once the high_memory check is removed from valid_phys_addr_range. Signed-off-by: Frantisek Hrbata --- arch/x86/mm/ioremap.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions

[RESEND PATCH 4/4] x86: remove high_memory check from valid_phys_addr_range

2014-09-29 Thread Frantisek Hrbata
There is no need to block read/write access to /dev/mem for phys. addr. above high_memory for non-system RAM. The only limitation should be boot_cpu_data.x86_phys_bits(max phys. addr. size). Signed-off-by: Frantisek Hrbata --- arch/x86/mm/mmap.c | 2 +- 1 file changed, 1 insertion(+), 1

[RESEND PATCH 0/4] x86: /dev/mem fixes

2014-09-29 Thread Frantisek Hrbata
reason to use high_memory check in (read|write)_mem. The second patch removes the high_memory check from valid_phys_addr_range, allowing read/write to access non-system RAM above high_memory. So far this was possible only by using mmap. I hope I haven't overlooked something. Many thanks Franti

[RESEND PATCH 0/4] x86: /dev/mem fixes

2014-09-29 Thread Frantisek Hrbata
in (read|write)_mem. The second patch removes the high_memory check from valid_phys_addr_range, allowing read/write to access non-system RAM above high_memory. So far this was possible only by using mmap. I hope I haven't overlooked something. Many thanks Frantisek Hrbata (4): x86: add

[RESEND PATCH 4/4] x86: remove high_memory check from valid_phys_addr_range

2014-09-29 Thread Frantisek Hrbata
There is no need to block read/write access to /dev/mem for phys. addr. above high_memory for non-system RAM. The only limitation should be boot_cpu_data.x86_phys_bits(max phys. addr. size). Signed-off-by: Frantisek Hrbata fhrb...@redhat.com --- arch/x86/mm/mmap.c | 2 +- 1 file changed, 1

[RESEND PATCH 3/4] x86: add high_memory check to (xlate|unxlate)_dev_mem_ptr

2014-09-29 Thread Frantisek Hrbata
safely for kernel mapped memory and it will also allow read/write to access non-system RAM above high_memory once the high_memory check is removed from valid_phys_addr_range. Signed-off-by: Frantisek Hrbata fhrb...@redhat.com --- arch/x86/mm/ioremap.c | 9 ++--- 1 file changed, 6 insertions

[RESEND PATCH 2/4] x86: add phys addr validity check for /dev/mem mmap

2014-09-29 Thread Frantisek Hrbata
; } -8-- V2: fix pfn check in valid_mmap_phys_addr_range, thanks to Dave Hansen Signed-off-by: Frantisek Hrbata fhrb...@redhat.com --- arch/x86/include/asm/io.h | 4 arch/x86/mm/mmap.c| 12 2 files changed, 16 insertions(+) diff

[RESEND PATCH 1/4] x86: add arch_pfn_possible helper

2014-09-29 Thread Frantisek Hrbata
Add helper to check maximum possible pfn on x86. Also make the current phys_addr_valid helper using it internally. Signed-off-by: Frantisek Hrbata fhrb...@redhat.com --- arch/x86/mm/physaddr.h | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/x86/mm/physaddr.h b

[PATCH 1/2] x86: add high_memory check to (xlate|unxlate)_dev_mem_ptr

2014-08-20 Thread Frantisek Hrbata
safely for kernel mapped memory and it will also allow read/write to access non-system RAM above high_memory once the high_memory check is removed from valid_phys_addr_range. Signed-off-by: Frantisek Hrbata --- arch/x86/mm/ioremap.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions

[PATCH 0/2] x86: allow read/write /dev/mem to access non-system RAM above high_memory

2014-08-20 Thread Frantisek Hrbata
g read/write to access non-system RAM above high_memory. So far this was possible only by using mmap. I hope I haven't overlooked something. Many thanks Frantisek Hrbata (2): x86: add high_memory check to (xlate|unxlate)_dev_mem_ptr x86: remove high_memory check from valid_phys_addr_range arch/x86/

[PATCH 2/2] x86: remove high_memory check from valid_phys_addr_range

2014-08-20 Thread Frantisek Hrbata
There is no need to block read/write access to /dev/mem for phys. addr. above high_memory for non-system RAM. The only limitation should be boot_cpu_data.x86_phys_bits(max phys. addr. size). Signed-off-by: Frantisek Hrbata --- arch/x86/mm/mmap.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 2/2] x86: remove high_memory check from valid_phys_addr_range

2014-08-20 Thread Frantisek Hrbata
There is no need to block read/write access to /dev/mem for phys. addr. above high_memory for non-system RAM. The only limitation should be boot_cpu_data.x86_phys_bits(max phys. addr. size). Signed-off-by: Frantisek Hrbata fhrb...@redhat.com --- arch/x86/mm/mmap.c | 2 +- 1 file changed, 1

[PATCH 1/2] x86: add high_memory check to (xlate|unxlate)_dev_mem_ptr

2014-08-20 Thread Frantisek Hrbata
safely for kernel mapped memory and it will also allow read/write to access non-system RAM above high_memory once the high_memory check is removed from valid_phys_addr_range. Signed-off-by: Frantisek Hrbata fhrb...@redhat.com --- arch/x86/mm/ioremap.c | 9 ++--- 1 file changed, 6 insertions

[PATCH 0/2] x86: allow read/write /dev/mem to access non-system RAM above high_memory

2014-08-20 Thread Frantisek Hrbata
non-system RAM above high_memory. So far this was possible only by using mmap. I hope I haven't overlooked something. Many thanks Frantisek Hrbata (2): x86: add high_memory check to (xlate|unxlate)_dev_mem_ptr x86: remove high_memory check from valid_phys_addr_range arch/x86/mm/ioremap.c | 9

Re: [PATCH V2 2/2] x86: add phys addr validity check for /dev/mem mmap

2014-08-18 Thread Frantisek Hrbata
On Fri, Aug 15, 2014 at 11:10:25AM -0700, Dave Hansen wrote: > On 08/15/2014 04:44 AM, Frantisek Hrbata wrote: > > +int valid_phys_addr_range(phys_addr_t addr, size_t count) > > +{ > > + return addr + count <= __pa(high_memory); > > +} > > + > > +int va

Re: [PATCH V2 2/2] x86: add phys addr validity check for /dev/mem mmap

2014-08-18 Thread Frantisek Hrbata
On Fri, Aug 15, 2014 at 11:10:25AM -0700, Dave Hansen wrote: On 08/15/2014 04:44 AM, Frantisek Hrbata wrote: +int valid_phys_addr_range(phys_addr_t addr, size_t count) +{ + return addr + count = __pa(high_memory); +} + +int valid_mmap_phys_addr_range(unsigned long pfn, size_t count

[PATCH V2 2/2] x86: add phys addr validity check for /dev/mem mmap

2014-08-15 Thread Frantisek Hrbata
ot;); return 0; } -----8<-- V2: fix pfn check in valid_mmap_phys_addr_range, thanks to Dave Hansen Signed-off-by: Frantisek Hrbata --- arch/x86/include/asm/io.h | 4 arch/x86/mm/mmap.c| 12 2 f

[PATCH V2 0/2] Prevent possible PTE corruption with /dev/mem mmap

2014-08-15 Thread Frantisek Hrbata
kept from historic reasons. I'm just curious and I of course may be missing something. Many thanks Frantisek Hrbata (2): x86: add arch_pfn_possible helper x86: add phys addr validity check for /dev/mem mmap arch/x86/include/asm/io.h | 4 arch/x86/mm/mmap.c| 12 a

[PATCH V2 1/2] x86: add arch_pfn_possible helper

2014-08-15 Thread Frantisek Hrbata
Add helper to check maximum possible pfn on x86. Also make the current phys_addr_valid helper using it internally. Signed-off-by: Frantisek Hrbata --- arch/x86/mm/physaddr.h | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/x86/mm/physaddr.h b/arch/x86/mm

Re: [PATCH 1/1] x86: add phys addr validity check for /dev/mem mmap

2014-08-15 Thread Frantisek Hrbata
self-nack As pointed by Dave Hansen, the check is just wrong. I will post V2. Many thanks Dave! -- Frantisek Hrbata -- 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.

Re: [PATCH 1/1] x86: add phys addr validity check for /dev/mem mmap

2014-08-15 Thread Frantisek Hrbata
self-nack As pointed by Dave Hansen, the check is just wrong. I will post V2. Many thanks Dave! -- Frantisek Hrbata -- 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

[PATCH V2 0/2] Prevent possible PTE corruption with /dev/mem mmap

2014-08-15 Thread Frantisek Hrbata
historic reasons. I'm just curious and I of course may be missing something. Many thanks Frantisek Hrbata (2): x86: add arch_pfn_possible helper x86: add phys addr validity check for /dev/mem mmap arch/x86/include/asm/io.h | 4 arch/x86/mm/mmap.c| 12 arch/x86/mm

[PATCH V2 1/2] x86: add arch_pfn_possible helper

2014-08-15 Thread Frantisek Hrbata
Add helper to check maximum possible pfn on x86. Also make the current phys_addr_valid helper using it internally. Signed-off-by: Frantisek Hrbata fhrb...@redhat.com --- arch/x86/mm/physaddr.h | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/x86/mm/physaddr.h b

[PATCH V2 2/2] x86: add phys addr validity check for /dev/mem mmap

2014-08-15 Thread Frantisek Hrbata
; } -8-- V2: fix pfn check in valid_mmap_phys_addr_range, thanks to Dave Hansen Signed-off-by: Frantisek Hrbata fhrb...@redhat.com --- arch/x86/include/asm/io.h | 4 arch/x86/mm/mmap.c| 12 2 files changed, 16 insertions(+) diff

Re: [PATCH 1/1] x86: add phys addr validity check for /dev/mem mmap

2014-08-14 Thread Frantisek Hrbata
On Thu, Aug 14, 2014 at 10:20:53AM -0700, H. Peter Anvin wrote: > On 08/14/2014 09:36 AM, Dave Hansen wrote: > > Thanks for dredging this back up! > > > > On 08/14/2014 07:18 AM, Frantisek Hrbata wrote: > >> +int valid_phys_addr_range(phys_addr_t addr, size_t coun

Re: [PATCH 1/1] x86: add phys addr validity check for /dev/mem mmap

2014-08-14 Thread Frantisek Hrbata
On Thu, Aug 14, 2014 at 09:36:03AM -0700, Dave Hansen wrote: > Thanks for dredging this back up! > > On 08/14/2014 07:18 AM, Frantisek Hrbata wrote: > > +int valid_phys_addr_range(phys_addr_t addr, size_t count) > > +{ > > + return addr + count <= __pa(high_memory

[PATCH 0/1] Prevent possible PTE corruption with /dev/mem mmap

2014-08-14 Thread Frantisek Hrbata
ill get more attention or at least to start the discussion how/if this should be fixed. The patch is the same except I added a check for phys addr overflow before calling phys_addr_valid. Maybe this check should be in do_mmap_pgoff. Many thanks Frantisek Hrbata (1): x86: add phys addr validity check fo

[PATCH 1/1] x86: add phys addr validity check for /dev/mem mmap

2014-08-14 Thread Frantisek Hrbata
YS_mmap2, NULL, ps, PROT_READ, MAP_SHARED, fd, OFFSET); if (map == MAP_FAILED) die("cannot mmap"); c = map[0]; if (munmap(map, ps) == -1) die("cannot munmap"); if (close(fd) == -1) die("cannot close&

[PATCH 1/1] x86: add phys addr validity check for /dev/mem mmap

2014-08-14 Thread Frantisek Hrbata
; } -8-- Signed-off-by: Frantisek Hrbata fhrb...@redhat.com --- arch/x86/include/asm/io.h | 4 arch/x86/mm/mmap.c| 18 ++ 2 files changed, 22 insertions(+) diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h index

[PATCH 0/1] Prevent possible PTE corruption with /dev/mem mmap

2014-08-14 Thread Frantisek Hrbata
to start the discussion how/if this should be fixed. The patch is the same except I added a check for phys addr overflow before calling phys_addr_valid. Maybe this check should be in do_mmap_pgoff. Many thanks Frantisek Hrbata (1): x86: add phys addr validity check for /dev/mem mmap arch/x86

Re: [PATCH 1/1] x86: add phys addr validity check for /dev/mem mmap

2014-08-14 Thread Frantisek Hrbata
On Thu, Aug 14, 2014 at 09:36:03AM -0700, Dave Hansen wrote: Thanks for dredging this back up! On 08/14/2014 07:18 AM, Frantisek Hrbata wrote: +int valid_phys_addr_range(phys_addr_t addr, size_t count) +{ + return addr + count = __pa(high_memory); +} Is this correct on 32-bit

Re: [PATCH 1/1] x86: add phys addr validity check for /dev/mem mmap

2014-08-14 Thread Frantisek Hrbata
On Thu, Aug 14, 2014 at 10:20:53AM -0700, H. Peter Anvin wrote: On 08/14/2014 09:36 AM, Dave Hansen wrote: Thanks for dredging this back up! On 08/14/2014 07:18 AM, Frantisek Hrbata wrote: +int valid_phys_addr_range(phys_addr_t addr, size_t count) +{ + return addr + count = __pa

Re: [RESEND PATCH] x86: add phys addr validity check for /dev/mem mmap

2013-10-02 Thread Frantisek Hrbata
On Wed, Oct 02, 2013 at 11:36:09AM -0700, H. Peter Anvin wrote: > On 10/02/2013 11:31 AM, Frantisek Hrbata wrote: > > On Wed, Oct 02, 2013 at 10:46:35AM -0700, H. Peter Anvin wrote: > >> On 10/02/2013 09:05 AM, Frantisek Hrbata wrote: > >>> + > >>> +

Re: [RESEND PATCH] x86: add phys addr validity check for /dev/mem mmap

2013-10-02 Thread Frantisek Hrbata
On Wed, Oct 02, 2013 at 10:46:35AM -0700, H. Peter Anvin wrote: > On 10/02/2013 09:05 AM, Frantisek Hrbata wrote: > > + > > +int valid_phys_addr_range(phys_addr_t addr, size_t count) > > +{ > > + return addr + count <= __pa(high_memory); > > +} > > + &g

[RESEND PATCH] x86: add phys addr validity check for /dev/mem mmap

2013-10-02 Thread Frantisek Hrbata
ct 2 11:24:02 amd-pence-01 kernel: RSP <7fff2d34da10> Oct 2 11:24:02 amd-pence-01 kernel: ---[ end trace 8a123cd70049eebc ]--- ---------8<-- Please note the PTE value 8008000a0225. Signed-off-by: Frantisek Hrbata --- arc

[RESEND PATCH] x86: add phys addr validity check for /dev/mem mmap

2013-10-02 Thread Frantisek Hrbata
kernel: ---[ end trace 8a123cd70049eebc ]--- -8-- Please note the PTE value 8008000a0225. Signed-off-by: Frantisek Hrbata fhrb...@redhat.com --- arch/x86/include/asm/io.h | 4 arch/x86/mm/mmap.c| 13 + 2

Re: [RESEND PATCH] x86: add phys addr validity check for /dev/mem mmap

2013-10-02 Thread Frantisek Hrbata
On Wed, Oct 02, 2013 at 10:46:35AM -0700, H. Peter Anvin wrote: On 10/02/2013 09:05 AM, Frantisek Hrbata wrote: + +int valid_phys_addr_range(phys_addr_t addr, size_t count) +{ + return addr + count = __pa(high_memory); +} + +int valid_mmap_phys_addr_range(unsigned long pfn, size_t

Re: [RESEND PATCH] x86: add phys addr validity check for /dev/mem mmap

2013-10-02 Thread Frantisek Hrbata
On Wed, Oct 02, 2013 at 11:36:09AM -0700, H. Peter Anvin wrote: On 10/02/2013 11:31 AM, Frantisek Hrbata wrote: On Wed, Oct 02, 2013 at 10:46:35AM -0700, H. Peter Anvin wrote: On 10/02/2013 09:05 AM, Frantisek Hrbata wrote: + +int valid_phys_addr_range(phys_addr_t addr, size_t count

Re: [PATCH v2 2/4] gcov: add support for gcc 4.7 gcov format

2013-09-19 Thread Frantisek Hrbata
On Thu, Sep 19, 2013 at 11:04:16AM +0200, Peter Oberparleiter wrote: > On 04.09.2013 16:42, Frantisek Hrbata wrote: > > The gcov in-memory format changed in gcc 4.7. The biggest change, which > > requires this special implementation, is that gcov_info no longer contains > &

Re: [PATCH v2 2/4] gcov: add support for gcc 4.7 gcov format

2013-09-19 Thread Frantisek Hrbata
On Wed, Sep 18, 2013 at 02:31:27PM -0700, Andrew Morton wrote: > On Wed, 18 Sep 2013 14:27:05 -0700 Joe Perches wrote: > > > On Wed, 2013-09-18 at 14:22 -0700, Andrew Morton wrote: > > > On Wed, 4 Sep 2013 16:42:54 +0200 Frantisek Hrbata > > > wrote: > > &

Re: [PATCH v2 2/4] gcov: add support for gcc 4.7 gcov format

2013-09-19 Thread Frantisek Hrbata
On Wed, Sep 18, 2013 at 02:31:27PM -0700, Andrew Morton wrote: On Wed, 18 Sep 2013 14:27:05 -0700 Joe Perches j...@perches.com wrote: On Wed, 2013-09-18 at 14:22 -0700, Andrew Morton wrote: On Wed, 4 Sep 2013 16:42:54 +0200 Frantisek Hrbata fhrb...@redhat.com wrote: The gcov

Re: [PATCH v2 2/4] gcov: add support for gcc 4.7 gcov format

2013-09-19 Thread Frantisek Hrbata
On Thu, Sep 19, 2013 at 11:04:16AM +0200, Peter Oberparleiter wrote: On 04.09.2013 16:42, Frantisek Hrbata wrote: The gcov in-memory format changed in gcc 4.7. The biggest change, which requires this special implementation, is that gcov_info no longer contains array of counters for each

Re: [PATCH v2 4/4] kernel: add support for init_array constructors

2013-09-10 Thread Frantisek Hrbata
On Tue, Sep 10, 2013 at 03:05:57PM +0930, Rusty Russell wrote: > Frantisek Hrbata writes: > > On Mon, Sep 09, 2013 at 10:44:03AM +0930, Rusty Russell wrote: > >> Kyle McMartin writes: > >> > On Fri, Sep 06, 2013 at 07:51:18PM +0200, Frantisek Hrbata wrote: >

Re: [PATCH v2 4/4] kernel: add support for init_array constructors

2013-09-10 Thread Frantisek Hrbata
On Tue, Sep 10, 2013 at 03:05:57PM +0930, Rusty Russell wrote: Frantisek Hrbata fhrb...@redhat.com writes: On Mon, Sep 09, 2013 at 10:44:03AM +0930, Rusty Russell wrote: Kyle McMartin k...@infradead.org writes: On Fri, Sep 06, 2013 at 07:51:18PM +0200, Frantisek Hrbata wrote: v2

Re: [PATCH v2 4/4] kernel: add support for init_array constructors

2013-09-09 Thread Frantisek Hrbata
On Mon, Sep 09, 2013 at 10:44:03AM +0930, Rusty Russell wrote: > Kyle McMartin writes: > > On Fri, Sep 06, 2013 at 07:51:18PM +0200, Frantisek Hrbata wrote: > >> > > v2: - reuse mod->ctors for .init_array section for modules, because > >> > > gcc

Re: [PATCH v2 4/4] kernel: add support for init_array constructors

2013-09-09 Thread Frantisek Hrbata
On Mon, Sep 09, 2013 at 10:44:03AM +0930, Rusty Russell wrote: Kyle McMartin k...@infradead.org writes: On Fri, Sep 06, 2013 at 07:51:18PM +0200, Frantisek Hrbata wrote: v2: - reuse mod-ctors for .init_array section for modules, because gcc uses .ctors or .init_array

Re: [PATCH v2 4/4] kernel: add support for init_array constructors

2013-09-06 Thread Frantisek Hrbata
On Fri, Sep 06, 2013 at 11:43:08AM +0930, Rusty Russell wrote: > Frantisek Hrbata writes: > > This adds the .init_array section as yet another section with constructors. > > This > > is needed because gcc could add __gcov_init calls to .init_array or .ctors > > sectio

Re: [PATCH v2 4/4] kernel: add support for init_array constructors

2013-09-06 Thread Frantisek Hrbata
On Fri, Sep 06, 2013 at 11:43:08AM +0930, Rusty Russell wrote: Frantisek Hrbata fhrb...@redhat.com writes: This adds the .init_array section as yet another section with constructors. This is needed because gcc could add __gcov_init calls to .init_array or .ctors section, depending on gcc

[PATCH v2 0/4] add support for gcov format introduced in gcc 4.7

2013-09-04 Thread Frantisek Hrbata
provided by Peter Oberparleiter. Detailed description in patches. Frantisek Hrbata (4): gcov: move gcov structs definitions to a gcc version specific file gcov: add support for gcc 4.7 gcov format gcov: compile specific gcov implementation based on gcc version kernel: add support

[PATCH v2 1/4] gcov: move gcov structs definitions to a gcc version specific file

2013-09-04 Thread Frantisek Hrbata
code and to introduce simple helpers for accessing data inside gcov_info. Signed-off-by: Frantisek Hrbata --- kernel/gcov/base.c| 26 ++-- kernel/gcov/fs.c | 27 ++-- kernel/gcov/gcc_3_4.c | 115 ++ kernel/gcov/gcov.h

[PATCH v2 2/4] gcov: add support for gcc 4.7 gcov format

2013-09-04 Thread Frantisek Hrbata
in gcov_info - use vmalloc for counter values in gcov_info_dup - use iter buffer for gcda Signed-off-by: Frantisek Hrbata --- kernel/gcov/base.c| 6 + kernel/gcov/gcc_4_7.c | 562 ++ 2 files changed, 568 insertions(+) create mode 100644

[PATCH v2 4/4] kernel: add support for init_array constructors

2013-09-04 Thread Frantisek Hrbata
ray, but not both at the same time Signed-off-by: Frantisek Hrbata --- include/asm-generic/vmlinux.lds.h | 1 + kernel/module.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 69732d2..c55d8d9 100

[PATCH v2 3/4] gcov: compile specific gcov implementation based on gcc version

2013-09-04 Thread Frantisek Hrbata
-by: Frantisek Hrbata --- Documentation/gcov.txt | 4 kernel/gcov/Kconfig| 30 ++ kernel/gcov/Makefile | 32 +++- 3 files changed, 65 insertions(+), 1 deletion(-) diff --git a/Documentation/gcov.txt b/Documentation/gcov.txt index e7ca647

[PATCH v2 3/4] gcov: compile specific gcov implementation based on gcc version

2013-09-04 Thread Frantisek Hrbata
-by: Frantisek Hrbata fhrb...@redhat.com --- Documentation/gcov.txt | 4 kernel/gcov/Kconfig| 30 ++ kernel/gcov/Makefile | 32 +++- 3 files changed, 65 insertions(+), 1 deletion(-) diff --git a/Documentation/gcov.txt b/Documentation/gcov.txt

[PATCH v2 2/4] gcov: add support for gcc 4.7 gcov format

2013-09-04 Thread Frantisek Hrbata
in gcov_info - use vmalloc for counter values in gcov_info_dup - use iter buffer for gcda Signed-off-by: Frantisek Hrbata fhrb...@redhat.com --- kernel/gcov/base.c| 6 + kernel/gcov/gcc_4_7.c | 562 ++ 2 files changed, 568 insertions

[PATCH v2 4/4] kernel: add support for init_array constructors

2013-09-04 Thread Frantisek Hrbata
, but not both at the same time Signed-off-by: Frantisek Hrbata fhrb...@redhat.com --- include/asm-generic/vmlinux.lds.h | 1 + kernel/module.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index

[PATCH v2 1/4] gcov: move gcov structs definitions to a gcc version specific file

2013-09-04 Thread Frantisek Hrbata
code and to introduce simple helpers for accessing data inside gcov_info. Signed-off-by: Frantisek Hrbata fhrb...@redhat.com --- kernel/gcov/base.c| 26 ++-- kernel/gcov/fs.c | 27 ++-- kernel/gcov/gcc_3_4.c | 115

[PATCH v2 0/4] add support for gcov format introduced in gcc 4.7

2013-09-04 Thread Frantisek Hrbata
provided by Peter Oberparleiter. Detailed description in patches. Frantisek Hrbata (4): gcov: move gcov structs definitions to a gcc version specific file gcov: add support for gcc 4.7 gcov format gcov: compile specific gcov implementation based on gcc version kernel: add support

Re: [RFC PATCH 3/4] gcov: compile specific gcov implementation based on gcc version

2013-08-28 Thread Frantisek Hrbata
On Wed, Aug 28, 2013 at 03:46:05PM +0200, Peter Oberparleiter wrote: > On 27.08.2013 15:34, Frantisek Hrbata wrote: > > On Mon, Aug 26, 2013 at 04:14:07PM +0200, Peter Oberparleiter wrote: > >> On 24.08.2013 21:44, Frantisek Hrbata wrote: > >>> On Fri, Aug 23, 2

Re: [RFC PATCH 3/4] gcov: compile specific gcov implementation based on gcc version

2013-08-28 Thread Frantisek Hrbata
On Wed, Aug 28, 2013 at 03:46:05PM +0200, Peter Oberparleiter wrote: On 27.08.2013 15:34, Frantisek Hrbata wrote: On Mon, Aug 26, 2013 at 04:14:07PM +0200, Peter Oberparleiter wrote: On 24.08.2013 21:44, Frantisek Hrbata wrote: On Fri, Aug 23, 2013 at 05:21:12PM +0200, Peter Oberparleiter

Re: [RFC PATCH 2/4] gcov: add support for gcc 4.7 gcov format

2013-08-27 Thread Frantisek Hrbata
On Mon, Aug 26, 2013 at 02:45:10PM +0200, Peter Oberparleiter wrote: > On 23.08.2013 23:00, Frantisek Hrbata wrote: > > On Fri, Aug 23, 2013 at 05:12:19PM +0200, Peter Oberparleiter wrote: > >> On 23.08.2013 10:39, Frantisek Hrbata wrote: > >>> The gcov in-me

Re: [RFC PATCH 3/4] gcov: compile specific gcov implementation based on gcc version

2013-08-27 Thread Frantisek Hrbata
On Mon, Aug 26, 2013 at 04:14:07PM +0200, Peter Oberparleiter wrote: > On 24.08.2013 21:44, Frantisek Hrbata wrote: > > On Fri, Aug 23, 2013 at 05:21:12PM +0200, Peter Oberparleiter wrote: > >> On 23.08.2013 17:15, Peter Oberparleiter wrote: > >>> On 23.08.2013

Re: [RFC PATCH 3/4] gcov: compile specific gcov implementation based on gcc version

2013-08-27 Thread Frantisek Hrbata
On Mon, Aug 26, 2013 at 02:56:04PM +0200, Peter Oberparleiter wrote: > On 24.08.2013 21:12, Frantisek Hrbata wrote: > > On Fri, Aug 23, 2013 at 05:15:19PM +0200, Peter Oberparleiter wrote: > >> Also it is my understanding that there are some distribution-specific > &g

Re: [RFC PATCH 3/4] gcov: compile specific gcov implementation based on gcc version

2013-08-27 Thread Frantisek Hrbata
On Mon, Aug 26, 2013 at 02:56:04PM +0200, Peter Oberparleiter wrote: On 24.08.2013 21:12, Frantisek Hrbata wrote: On Fri, Aug 23, 2013 at 05:15:19PM +0200, Peter Oberparleiter wrote: Also it is my understanding that there are some distribution-specific versions of GCC that include

Re: [RFC PATCH 3/4] gcov: compile specific gcov implementation based on gcc version

2013-08-27 Thread Frantisek Hrbata
On Mon, Aug 26, 2013 at 04:14:07PM +0200, Peter Oberparleiter wrote: On 24.08.2013 21:44, Frantisek Hrbata wrote: On Fri, Aug 23, 2013 at 05:21:12PM +0200, Peter Oberparleiter wrote: On 23.08.2013 17:15, Peter Oberparleiter wrote: On 23.08.2013 10:39, Frantisek Hrbata wrote: Compile

Re: [RFC PATCH 2/4] gcov: add support for gcc 4.7 gcov format

2013-08-27 Thread Frantisek Hrbata
On Mon, Aug 26, 2013 at 02:45:10PM +0200, Peter Oberparleiter wrote: On 23.08.2013 23:00, Frantisek Hrbata wrote: On Fri, Aug 23, 2013 at 05:12:19PM +0200, Peter Oberparleiter wrote: On 23.08.2013 10:39, Frantisek Hrbata wrote: The gcov in-memory format changed in gcc 4.7. The biggest

Re: [RFC PATCH 3/4] gcov: compile specific gcov implementation based on gcc version

2013-08-24 Thread Frantisek Hrbata
On Fri, Aug 23, 2013 at 05:21:12PM +0200, Peter Oberparleiter wrote: > On 23.08.2013 17:15, Peter Oberparleiter wrote: > > On 23.08.2013 10:39, Frantisek Hrbata wrote: > >> Compile the correct gcov implementation file for a specific gcc version. In > >> the futur

Re: [RFC PATCH 3/4] gcov: compile specific gcov implementation based on gcc version

2013-08-24 Thread Frantisek Hrbata
On Fri, Aug 23, 2013 at 05:15:19PM +0200, Peter Oberparleiter wrote: > On 23.08.2013 10:39, Frantisek Hrbata wrote: > > Compile the correct gcov implementation file for a specific gcc version. In > > the future, if another file is added, the conditions will need to be someh

Re: [RFC PATCH 3/4] gcov: compile specific gcov implementation based on gcc version

2013-08-24 Thread Frantisek Hrbata
On Fri, Aug 23, 2013 at 05:15:19PM +0200, Peter Oberparleiter wrote: On 23.08.2013 10:39, Frantisek Hrbata wrote: Compile the correct gcov implementation file for a specific gcc version. In the future, if another file is added, the conditions will need to be somehow adjusted to if-elif-else

Re: [RFC PATCH 3/4] gcov: compile specific gcov implementation based on gcc version

2013-08-24 Thread Frantisek Hrbata
On Fri, Aug 23, 2013 at 05:21:12PM +0200, Peter Oberparleiter wrote: On 23.08.2013 17:15, Peter Oberparleiter wrote: On 23.08.2013 10:39, Frantisek Hrbata wrote: Compile the correct gcov implementation file for a specific gcc version. In the future, if another file is added, the conditions

Re: [RFC PATCH 2/4] gcov: add support for gcc 4.7 gcov format

2013-08-23 Thread Frantisek Hrbata
On Fri, Aug 23, 2013 at 05:12:19PM +0200, Peter Oberparleiter wrote: > On 23.08.2013 10:39, Frantisek Hrbata wrote: > > The gcov in-memory format changed in gcc 4.7. The biggest change, which > > requires this special implementation, is that gcov_info no longer contains > &

Re: [RFC PATCH 4/4] kernel: add support for init_array constructors

2013-08-23 Thread Frantisek Hrbata
On Fri, Aug 23, 2013 at 05:13:31PM +0200, Peter Oberparleiter wrote: > On 23.08.2013 10:39, Frantisek Hrbata wrote: > > This adds the .init_array section as yet another section with constructors. > > This > > is needed because gcc is adding __gcov_init calls to .init_array

Re: [RFC PATCH 1/4] gcov: move gcov structs definitions to a gcc version specific file

2013-08-23 Thread Frantisek Hrbata
On Fri, Aug 23, 2013 at 05:09:58PM +0200, Peter Oberparleiter wrote: > On 23.08.2013 10:39, Frantisek Hrbata wrote: > > Since also the gcov structures(gcov_info, gcov_fn_info, gcov_ctr_info) can > > change between gcc releases, as shown in gcc 4.7, they cannot be defined in &

Re: [RFC PATCH 0/4] add support for gcov format introduced in gcc 4.7

2013-08-23 Thread Frantisek Hrbata
On Fri, Aug 23, 2013 at 05:08:07PM +0200, Peter Oberparleiter wrote: > On 23.08.2013 10:39, Frantisek Hrbata wrote: > > This is an attempt to bring support for modified gcov format in gcc 4.7 to > > the kernel. It tries to leverage the existing layout/abstraction, which was >

[RFC PATCH 4/4] kernel: add support for init_array constructors

2013-08-23 Thread Frantisek Hrbata
This adds the .init_array section as yet another section with constructors. This is needed because gcc is adding __gcov_init calls to .init_array. Signed-off-by: Frantisek Hrbata --- include/asm-generic/vmlinux.lds.h | 1 + include/linux/module.h| 2 ++ kernel/module.c

[RFC PATCH 3/4] gcov: compile specific gcov implementation based on gcc version

2013-08-23 Thread Frantisek Hrbata
Compile the correct gcov implementation file for a specific gcc version. In the future, if another file is added, the conditions will need to be somehow adjusted to if-elif-else case, but at this point the simple cc-ifversion should be enough. Signed-off-by: Frantisek Hrbata --- kernel/gcov

[RFC PATCH 2/4] gcov: add support for gcc 4.7 gcov format

2013-08-23 Thread Frantisek Hrbata
each gcov_fn_info contans it's counters, which makes things a little bit easier. This is heavily based on the previous gcc_3_4.c implementation. Signed-off-by: Frantisek Hrbata --- kernel/gcov/base.c| 6 + kernel/gcov/gcc_4_7.c | 612 ++ 2

[RFC PATCH 1/4] gcov: move gcov structs definitions to a gcc version specific file

2013-08-23 Thread Frantisek Hrbata
code and to introduce simple helpers for accessing data inside gcov_info. Signed-off-by: Frantisek Hrbata --- kernel/gcov/base.c| 26 ++-- kernel/gcov/fs.c | 27 ++-- kernel/gcov/gcc_3_4.c | 115 ++ kernel/gcov/gcov.h

[RFC PATCH 0/4] add support for gcov format introduced in gcc 4.7

2013-08-23 Thread Frantisek Hrbata
into account that even the core gcov structures, like gcov_info, could change. One part that could be problematic is the addition of the .init_array section for constructors. Tested with lcov and seems to be working fine, giving similar results as for the older format. Frantisek Hrbata (4): gcov: move

[RFC PATCH 0/4] add support for gcov format introduced in gcc 4.7

2013-08-23 Thread Frantisek Hrbata
into account that even the core gcov structures, like gcov_info, could change. One part that could be problematic is the addition of the .init_array section for constructors. Tested with lcov and seems to be working fine, giving similar results as for the older format. Frantisek Hrbata (4): gcov: move

[RFC PATCH 1/4] gcov: move gcov structs definitions to a gcc version specific file

2013-08-23 Thread Frantisek Hrbata
code and to introduce simple helpers for accessing data inside gcov_info. Signed-off-by: Frantisek Hrbata fhrb...@redhat.com --- kernel/gcov/base.c| 26 ++-- kernel/gcov/fs.c | 27 ++-- kernel/gcov/gcc_3_4.c | 115

[RFC PATCH 2/4] gcov: add support for gcc 4.7 gcov format

2013-08-23 Thread Frantisek Hrbata
each gcov_fn_info contans it's counters, which makes things a little bit easier. This is heavily based on the previous gcc_3_4.c implementation. Signed-off-by: Frantisek Hrbata fhrb...@redhat.com --- kernel/gcov/base.c| 6 + kernel/gcov/gcc_4_7.c | 612

[RFC PATCH 3/4] gcov: compile specific gcov implementation based on gcc version

2013-08-23 Thread Frantisek Hrbata
Compile the correct gcov implementation file for a specific gcc version. In the future, if another file is added, the conditions will need to be somehow adjusted to if-elif-else case, but at this point the simple cc-ifversion should be enough. Signed-off-by: Frantisek Hrbata fhrb...@redhat.com

[RFC PATCH 4/4] kernel: add support for init_array constructors

2013-08-23 Thread Frantisek Hrbata
This adds the .init_array section as yet another section with constructors. This is needed because gcc is adding __gcov_init calls to .init_array. Signed-off-by: Frantisek Hrbata fhrb...@redhat.com --- include/asm-generic/vmlinux.lds.h | 1 + include/linux/module.h| 2 ++ kernel

  1   2   >