Re: Gcov support in Covoar

2018-07-18 Thread Vijay Kumar Banerjee
Hello, I have made the changes and also got the confusion with structure of gcno, cleared to some extent after some careful reading and experiments. I'm attaching the txt file generated. So far it is complete up to function record, next is the basic block records. I will start with the block

Re: [PATCH 01/45] libfdt: check for potential overrun in _fdt_splice()

2018-07-18 Thread Joel Sherrill
On Wed, Jul 18, 2018 at 2:38 AM, Sebastian Huber < sebastian.hu...@embedded-brains.de> wrote: > Sorry, I forgot the cover letter. > > This patch series update the libfdt to the latest upstream version, see > also > If all the patches are from the upstream, just push them. They have already been

Re: [PATCH 0/1] [GSoC - x86_64] User documentation for BSP

2018-07-18 Thread Amaan Cheval
On Wed, Jul 18, 2018 at 6:56 PM, Gedare Bloom wrote: > On Wed, Jul 18, 2018 at 9:09 AM, Amaan Cheval wrote: >> Hi! >> >> On Fri, Jul 13, 2018 at 7:32 PM, Joel Sherrill wrote: >>> >>> >>> On Fri, Jul 13, 2018 at 8:25 AM, Gedare Bloom wrote: Hello Amaan, On Fri, Jul 13,

Re: [GSoC - x86_64] Clock driver - which hardware source to support primarily?

2018-07-18 Thread Joel Sherrill
On Wed, Jul 18, 2018 at 12:31 AM, Sebastian Huber < sebastian.hu...@embedded-brains.de> wrote: > Hello Amaan, > > On 17/07/18 19:18, Amaan Cheval wrote: > >> Hi! >> >> Now that I'm working on the clock driver, we need to pick what we >> support first. Our options in brief are: >> > > The clock

[PATCH 12/45] libfdt: simplify fdt_del_mem_rsv()

2018-07-18 Thread Sebastian Huber
From: Masahiro Yamada The variable "err" is unneeded. Signed-off-by: Masahiro Yamada Signed-off-by: David Gibson --- cpukit/dtc/libfdt/fdt_rw.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cpukit/dtc/libfdt/fdt_rw.c b/cpukit/dtc/libfdt/fdt_rw.c index

[PATCH 08/45] libfdt: Add iterator over properties

2018-07-18 Thread Sebastian Huber
From: Maxime Ripard Implement a macro based on fdt_first_property_offset and fdt_next_property_offset that provides a convenience to iterate over all the properties of a given node. Signed-off-by: Maxime Ripard Acked-by: Simon Glass [dwg: Removed a stray trailing blank line] Signed-off-by:

[PATCH 02/45] libfdt: Fix undefined behaviour in fdt_offset_ptr()

2018-07-18 Thread Sebastian Huber
From: David Gibson Using pointer arithmetic to generate a pointer outside a known object is, technically, undefined behaviour in C. Unfortunately, we were using that in fdt_offset_ptr() to detect overflows. To fix this we need to do our bounds / overflow checking on the offsets before

[PATCH 06/45] Correct a missing space in a fdt_header cast

2018-07-18 Thread Sebastian Huber
From: Simon Glass The code style here is slightly incorrect. Fix it. Signed-off-by: Simon Glass Signed-off-by: David Gibson --- cpukit/include/libfdt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpukit/include/libfdt.h b/cpukit/include/libfdt.h index

[PATCH 05/45] Correct line lengths in libfdt.h

2018-07-18 Thread Sebastian Huber
From: Simon Glass There are a few lines that are over 80 columns. Fix these. Signed-off-by: Simon Glass Signed-off-by: David Gibson --- cpukit/include/libfdt.h | 35 +++ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/cpukit/include/libfdt.h

[PATCH 03/45] libfdt: simplify fdt_node_check_compatible()

2018-07-18 Thread Sebastian Huber
From: Masahiro Yamada Because fdt_stringlist_contains() returns 1 or 0, fdt_node_check_compatible() can just return the inverted value. Signed-off-by: Masahiro Yamada Signed-off-by: David Gibson --- cpukit/dtc/libfdt/fdt_ro.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff

[PATCH 13/45] Fix some typing errors in libfdt.h and livetree.c

2018-07-18 Thread Sebastian Huber
From: Thomas Huth Correct some typos discovered with the codespell utility. Signed-off-by: Thomas Huth Signed-off-by: David Gibson --- cpukit/include/libfdt.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpukit/include/libfdt.h b/cpukit/include/libfdt.h index

[PATCH 36/45] libfdt: Safer access to strings section

2018-07-18 Thread Sebastian Huber
From: David Gibson fdt_string() is used to retrieve strings from a DT blob's strings section. It's rarely used directly, but is widely used internally. However, it doesn't do any bounds checking, which means in the case of a corrupted blob it could access bad memory, which libfdt is supposed to

[PATCH 34/45] libfdt: Improve sequential write state checking

2018-07-18 Thread Sebastian Huber
From: David Gibson When creating a tree with the sequential write functions, certain things have to be done in a certain order. You must create the memory reserve map and only then can you create the actual tree structure. The -FDT_ERR_BADSTATE return code is for if you try to do things out of

[PATCH 20/45] libfdt: fix fdt_stringlist_search()

2018-07-18 Thread Sebastian Huber
From: Masahiro Yamada If fdt_getprop() fails, negative error code should be returned. Signed-off-by: Masahiro Yamada Signed-off-by: David Gibson --- cpukit/dtc/libfdt/fdt_ro.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpukit/dtc/libfdt/fdt_ro.c

Re: [PATCH 01/45] libfdt: check for potential overrun in _fdt_splice()

2018-07-18 Thread Sebastian Huber
Sorry, I forgot the cover letter. This patch series update the libfdt to the latest upstream version, see also https://devel.rtems.org/ticket/3471 -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47

[PATCH 33/45] libfdt: Clean up header checking functions

2018-07-18 Thread Sebastian Huber
From: David Gibson Many of the libfdt entry points call some sort of sanity check function before doing anything else. These need to do slightly different things for the various classes of functions. The read-only version is shared with the exported fdt_check_header(), which limits us a bit in

[PATCH 41/45] pylibfdt: Add functions to update properties

2018-07-18 Thread Sebastian Huber
From: Simon Glass Allow updating and creating properties, including special methods for integers. Signed-off-by: Simon Glass Reviewed-by: David Gibson Signed-off-by: David Gibson --- cpukit/include/libfdt.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cpukit/include/libfdt.h

[PATCH 42/45] libfdt: Add helpers for accessing unaligned words

2018-07-18 Thread Sebastian Huber
From: David Gibson This adds some helpers to load (32 or 64 bit) words from an fdt blob, even if they're unaligned and we're on a platform that doesn't like plain unaligned loads and stores. We then use the helpers in a number of places. There are two purposes for this: 1) This makes libfdt

[PATCH 16/45] libfdt: Add overlay application function

2018-07-18 Thread Sebastian Huber
From: Maxime Ripard The device tree overlays are a good way to deal with user-modifyable boards or boards with some kind of an expansion mechanism where we can easily plug new board in (like the BBB, the Raspberry Pi or the CHIP). Add a new function to merge overlays with a base device tree.

[PATCH 15/45] libfdt: Extend the reach of FDT_ERR_BADPHANDLE

2018-07-18 Thread Sebastian Huber
From: Maxime Ripard So far, the BADPHANDLE error was only used for incorrect phandle values. Extend that meaning to an improperly formatted phandle property. Signed-off-by: Maxime Ripard Signed-off-by: David Gibson --- cpukit/include/libfdt.h | 6 -- 1 file changed, 4 insertions(+), 2

[PATCH 44/45] libfdt: Add necessary header padding in fdt_create()

2018-07-18 Thread Sebastian Huber
From: David Gibson At present fdt_create() will succeed if there is exactly enough space to put in the fdt header. However, it sets the off_mem_rsvmap field, a few bytes past that in order to align the memory reservation block. Having block pointers pointing past the end of the fdt is pretty

[PATCH 43/45] libfdt: Copy the struct region in fdt_resize()

2018-07-18 Thread Sebastian Huber
From: Simon Glass At present this function appears to copy only the data before the struct region and the data in the string region. It does not seem to copy the struct region itself. >From the arguments of this function it seems that it should support fdt and buf being different. This patch

[PATCH 18/45] fdt: strerr: Remove spurious BADOVERLAY

2018-07-18 Thread Sebastian Huber
From: Maxime Ripard There's one FDT_ERR_BADOVERLAY too many in the fdt error table. Signed-off-by: Maxime Ripard Signed-off-by: David Gibson --- cpukit/dtc/libfdt/fdt_strerror.c | 1 - 1 file changed, 1 deletion(-) diff --git a/cpukit/dtc/libfdt/fdt_strerror.c

[PATCH 19/45] libfdt: fix fdt_stringlist_count()

2018-07-18 Thread Sebastian Huber
From: Masahiro Yamada If fdt_getprop() fails, negative error code should be returned. Signed-off-by: Masahiro Yamada Signed-off-by: David Gibson --- cpukit/dtc/libfdt/fdt_ro.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpukit/dtc/libfdt/fdt_ro.c

[PATCH 24/45] libfdt: Change names of sparse helper macros

2018-07-18 Thread Sebastian Huber
From: David Gibson The default libfdt_env.h (for POSIXish userland builds) supports sparse checking. It has a couple of helper macros, __force and __bitwise which expand the relevant sparse attributes to enable checking for incorrect or missing endian conversions. Those are bad names: for one,

[PATCH 39/45] libfdt: Add fdt_header_size()

2018-07-18 Thread Sebastian Huber
From: David Gibson We have a couple of places within libfdt and its tests where we need to find the size of the header, based on the version. Add a helper function for it. Signed-off-by: David Gibson Reviewed-by: Simon Glass Tested-by: Alexey Kardashevskiy Reviewed-by: Alexey Kardashevskiy

[PATCH] cpu-supplement: Update interrupt stack paragraph

2018-07-18 Thread Sebastian Huber
Close #3459. --- cpu-supplement/port.rst | 24 ++-- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/cpu-supplement/port.rst b/cpu-supplement/port.rst index dec91a7..bf1de3e 100644 --- a/cpu-supplement/port.rst +++ b/cpu-supplement/port.rst @@ -222,9 +222,9 @@

Re: [GSoC - x86_64] Clock driver - which hardware source to support primarily?

2018-07-18 Thread Amaan Cheval
Hey! On Wed, Jul 18, 2018 at 11:01 AM, Sebastian Huber wrote: > Hello Amaan, > > On 17/07/18 19:18, Amaan Cheval wrote: >> >> Hi! >> >> Now that I'm working on the clock driver, we need to pick what we >> support first. Our options in brief are: > > > The clock driver needs an interrupt. What is

[PATCH 11/45] libfdt: Add fdt_setprop_inplace_namelen_partial

2018-07-18 Thread Sebastian Huber
From: Maxime Ripard Add a function to modify inplace only a portion of a property.. This is especially useful when the property is an array of values, and you want to update one of them without changing the DT size. Acked-by: Simon Glass Reviewed-by: David Gibson Signed-off-by: Maxime Ripard

[PATCH 01/45] libfdt: check for potential overrun in _fdt_splice()

2018-07-18 Thread Sebastian Huber
From: Courtney Cavin This patch catches the conditions where: - 'splicepoint' is set to a point outside of [ fdt, fdt_totalsize(fdt) ) - 'newlen' is negative, or 'splicepoint' plus 'newlen' results in overflow Either of these cases can be caused by math which overflows in calling functions,

[PATCH 29/45] Fix some errors in comments

2018-07-18 Thread Sebastian Huber
From: David Gibson A comment in tests/stringlist.c refers to fdt_get_string(), which is not a function that exists. From the content, it's supposed to be referring to fdt_getprop_string(). A comment in libfdt.h has an extraneous space in a function name. Signed-off-by: David Gibson ---

[PATCH 25/45] Adjust libfdt.h to work with swig

2018-07-18 Thread Sebastian Huber
From: Simon Glass There are a few places where libfdt.h cannot be used as is with swig: - macros like fdt_totalsize() have to be defined as C declarations - fdt_offset_ptr() and fdt_getprop_namelen() need special treatment due to a TODO in the wrapper for fdt_getprop(). However they are not

[PATCH 23/45] libfdt: Add fdt_setprop_empty()

2018-07-18 Thread Sebastian Huber
From: David Gibson Device trees can contain empty (zero length) properties, which are often used as boolean flags. These can already be created using fdt_setprop() passing a length of zero and a pointer which is ignored. It is safe to pass NULL, but that may not be obvious from the interface.

[PATCH 31/45] implement strnlen for systems that need it

2018-07-18 Thread Sebastian Huber
From: John Arbuckle Prior the Mac OS 10.7, the function strnlen() was not available. This patch implements strnlen() on Mac OS X versions that are below 10.7. Signed-off-by: John Arbuckle Signed-off-by: David Gibson --- cpukit/include/libfdt_env.h | 27 +++ 1 file

[PATCH 30/45] libfdt: Remove leading underscores from identifiers

2018-07-18 Thread Sebastian Huber
From: David Gibson In a lot of places libfdt uses a leading _ character to mark an identifier as "internal" (not part of the published libfdt API). This is a bad idea, because identifiers with a leading _ are generally reserved by the C library or system. It's particularly dangerous for

[PATCH 38/45] libfdt: Safer access to memory reservations

2018-07-18 Thread Sebastian Huber
From: David Gibson fdt_num_mem_rsv() and fdt_get_mem_rsv() currently don't sanity check their parameters, or the memory reserve section offset in the header. That means that on a corrupted blob they could access outside of the range of memory that they should. This improves their safety

[PATCH 32/45] Add limited read-only support for older (V2 and V3) device tree to libfdt.

2018-07-18 Thread Sebastian Huber
From: Nathan Whitehorn This can be useful in particular in the kernel when booting on systems with FDT-emitting firmware that is out of date. Releases of kexec-tools on ppc64 prior to the end of 2014 are notable examples of such. Signed-off-by: Nathan Whitehorn [dwg: Some whitespace cleanups]

[PATCH 37/45] libfdt: Propagate name errors in fdt_getprop_by_offset()

2018-07-18 Thread Sebastian Huber
From: David Gibson fdt_getprop_by_offset() doesn't check for errors from fdt_string() - after all, until very recently it couldn't fail. Now it can, so we need to propagate errors up to the caller. Signed-off-by: David Gibson Tested-by: Alexey Kardashevskiy Reviewed-by: Alexey Kardashevskiy

[PATCH 40/45] libfdt: Add fdt_check_full() function

2018-07-18 Thread Sebastian Huber
From: David Gibson This new function implements a complete and thorough check of an fdt blob's structure. Given a buffer containing an fdt, it should return 0 only if the fdt within is structurally sound in all regards. It doesn't check anything about the blob's contents (i.e. the actual

[PATCH 35/45] libfdt: Make fdt_check_header() more thorough

2018-07-18 Thread Sebastian Huber
From: David Gibson Currently fdt_check_header() performs only some rudimentary checks, which is not really what the name suggests. This strengthens fdt_check_header() to check as much about the blob as is possible from the header alone: as well as checking the magic number and version, it

[PATCH 27/45] Fix a few whitespace and style nits

2018-07-18 Thread Sebastian Huber
From: Simon Glass These were noticed when synching with U-Boot's downstream tree. Signed-off-by: Simon Glass Signed-off-by: David Gibson --- cpukit/dtc/libfdt/fdt_empty_tree.c | 1 - cpukit/dtc/libfdt/fdt_ro.c | 4 ++-- cpukit/dtc/libfdt/fdt_rw.c | 4 ++--

[PATCH 09/45] libfdt: Add max phandle retrieval function

2018-07-18 Thread Sebastian Huber
From: Maxime Ripard Add a function to retrieve the highest phandle in a given device tree. Acked-by: Simon Glass Reviewed-by: Stefan Agner Reviewed-by: David Gibson Signed-off-by: Maxime Ripard Signed-off-by: David Gibson --- cpukit/dtc/libfdt/fdt_ro.c | 26 ++

[PATCH 28/45] Introduce fdt_setprop_placeholder() method

2018-07-18 Thread Sebastian Huber
From: Pantelis Antoniou In some cases you need to add a property but the contents of it are not known at creation time, merely the extend of it. This method allows you to create a property of a given size (filled with garbage) while a pointer to the property data will be provided.

[PATCH 14/45] libfdt: Add new errors for the overlay code

2018-07-18 Thread Sebastian Huber
From: Maxime Ripard Add a few new error codes to report the failure conditions we might encounter in the overlay application code: - FDT_ERR_BADOVERLAY, when an overlay cannot be parsed, even though its structure is correct - FDT_ERR_NOPHANDLES, when we ran out of available phandles

[PATCH 26/45] Add a libfdt function to write a property placeholder

2018-07-18 Thread Sebastian Huber
From: Simon Glass The existing function to add a new property to a tree being built requires that the entire contents of the new property be passed in. For some applications it is more convenient to be able to add the property contents later, perhaps by reading from a file. This avoids

[PATCH 17/45] libfdt: Add BADPHANDLE error string

2018-07-18 Thread Sebastian Huber
From: Maxime Ripard The BADPHANDLE error was missing a string, leading to an string being returned if you were to call fdt_strerror. Signed-off-by: Maxime Ripard Signed-off-by: David Gibson --- cpukit/dtc/libfdt/fdt_strerror.c | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH 21/45] libfdt: add missing errors to fdt_strerror()

2018-07-18 Thread Sebastian Huber
From: Benjamin Fair Some error values were missing from the table which meant that they could not be translated by fdt_strerror(). Signed-off-by: Benjamin Fair Signed-off-by: David Gibson --- cpukit/dtc/libfdt/fdt_strerror.c | 3 +++ 1 file changed, 3 insertions(+) diff --git

[PATCH 22/45] libfdt: Remove undefined behaviour setting empty properties

2018-07-18 Thread Sebastian Huber
From: David Gibson The standard way of setting an empty property using libfdt is: fdt_setprop(fdt, nodeoffset, propname, NULL, 0); However, the implementation of this includes an unconditional: memcpy(prop->data, NULL, 0); Which although it will be a no-op (which is what we want) on

[PATCH 07/45] libfdt: Add a subnodes iterator macro

2018-07-18 Thread Sebastian Huber
From: Thierry Reding The fdt_for_each_subnode() iterator macro provided by this patch can be used to iterate over a device tree node's subnodes. At each iteration a loop variable will be set to the next subnode. Signed-off-by: Thierry Reding Signed-off-by: Maxime Ripard Signed-off-by: David

Re: [GSoC - x86_64] Clock driver - which hardware source to support primarily?

2018-07-18 Thread Amaan Cheval
Hi! Thanks a ton for all the details, they definitely help clarify the direction a fair bit. I think we're settling on working on interrupt support and the APIC timer (and some PIT work to calibrate the APIC timer) in the immediate future. After ticker.exe passes through the APIC timer, we'll

Re: [GSoC - x86_64] Clock driver - which hardware source to support primarily?

2018-07-18 Thread Gedare Bloom
On Wed, Jul 18, 2018 at 10:17 AM, Joel Sherrill wrote: > > > On Wed, Jul 18, 2018 at 12:31 AM, Sebastian Huber > wrote: >> >> Hello Amaan, >> >> On 17/07/18 19:18, Amaan Cheval wrote: >>> >>> Hi! >>> >>> Now that I'm working on the clock driver, we need to pick what we >>> support first. Our

Re: [PATCH 1/1] user: Add x86_64 BSP chapter

2018-07-18 Thread Gedare Bloom
Ping -- joel On Fri, Jul 13, 2018 at 9:19 AM, Gedare Bloom wrote: > This looks fine to push > > On Fri, Jul 13, 2018 at 3:32 AM, Amaan Cheval wrote: >> --- >> user/bsps/bsps-x86_64.rst | 143 >> +- >> 1 file changed, 142 insertions(+), 1 deletion(-)

Re: [PATCH 1/1] user: Add x86_64 BSP chapter

2018-07-18 Thread Joel Sherrill
Thanks Gedare. It is pushed now. Just had to find it. On Wed, Jul 18, 2018 at 12:40 PM, Gedare Bloom wrote: > Ping -- joel > > On Fri, Jul 13, 2018 at 9:19 AM, Gedare Bloom wrote: > > This looks fine to push > > > > On Fri, Jul 13, 2018 at 3:32 AM, Amaan Cheval > wrote: > >> --- > >>

Update of libbsd to close to FreeBSD 12 release planned

2018-07-18 Thread Sebastian Huber
Hello, the FreeBSD project is about to prepare the FreeBSD 12 release soon: https://www.freebsd.org/releases/12.0R/schedule.html I would like to use this time frame to update the libbsd stepwise to a FreeBSD trunk version close to the FreeBSD 12 release. If someone has libbsd patches, please

Re: Gcov support in Covoar

2018-07-18 Thread Vijay Kumar Banerjee
On 18 July 2018 at 02:30, Joel Sherrill wrote: > This definitely looks like the right direction. If we don't understand > the file formats, we will never be able to process and correlate them. > > Please put 0x in front of hex numbers. It does help. > > Can you explain the fields in

Re: [PATCH 0/1] [GSoC - x86_64] User documentation for BSP

2018-07-18 Thread Amaan Cheval
Hi! On Fri, Jul 13, 2018 at 7:32 PM, Joel Sherrill wrote: > > > On Fri, Jul 13, 2018 at 8:25 AM, Gedare Bloom wrote: >> >> Hello Amaan, >> >> >> On Fri, Jul 13, 2018 at 3:32 AM, Amaan Cheval >> wrote: >> > The built documentation can more easily be viewed here: >> >

Re: [PATCH 0/1] [GSoC - x86_64] User documentation for BSP

2018-07-18 Thread Gedare Bloom
On Wed, Jul 18, 2018 at 9:09 AM, Amaan Cheval wrote: > Hi! > > On Fri, Jul 13, 2018 at 7:32 PM, Joel Sherrill wrote: >> >> >> On Fri, Jul 13, 2018 at 8:25 AM, Gedare Bloom wrote: >>> >>> Hello Amaan, >>> >>> >>> On Fri, Jul 13, 2018 at 3:32 AM, Amaan Cheval >>> wrote: >>> > The built