[Xen-devel] [PATCH] coverage: GCC coverage libfdt Makefile fix

Viktor Mitin posted 1 patch 1 year, 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/xen tags/patchew/20190516111354.15195-1-viktor.mitin.19@gmail.com
xen/common/libfdt/Makefile | 1 +
1 file changed, 1 insertion(+)

[Xen-devel] [PATCH] coverage: GCC coverage libfdt Makefile fix

Posted by Viktor Mitin 1 year, 9 months ago
The patch resolves 'xencov' crashes in case of Aarch64.

All the .init.* sections are stripped after boot,
it means that anything in .init.data cannot be accessed anymore.
The build system explicitly compiles any .init binary without gcov option.
The problem is coming from libfdt.
The entire library is moved to .init using:
$(OBJCOPY) $(foreach s,$(SECTIONS),--rename-section .$(s)=.init.$(s)) $< $@
So we need to tell the top Makefile to filter out libfdt.

Reported-by: Viktor Mitin <viktor.mitin.19@gmail.com>
Signed-off-by: Julien Grall <julien.grall@arm.com>
Tested-by: Viktor Mitin <viktor.mitin.19@gmail.com>
---
 xen/common/libfdt/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/common/libfdt/Makefile b/xen/common/libfdt/Makefile
index d81f54b6b8..c075bbf546 100644
--- a/xen/common/libfdt/Makefile
+++ b/xen/common/libfdt/Makefile
@@ -3,6 +3,7 @@ include Makefile.libfdt
 SECTIONS := text data $(SPECIAL_DATA_SECTIONS)
 
 obj-y += libfdt.o
+nocov-y += libfdt.o
 
 CFLAGS += -I$(BASEDIR)/include/xen/libfdt/
 
-- 
2.17.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH] coverage: GCC coverage libfdt Makefile fix

Posted by Wei Liu 1 year, 9 months ago
On Thu, May 16, 2019 at 02:13:54PM +0300, Viktor Mitin wrote:
> The patch resolves 'xencov' crashes in case of Aarch64.
> 
> All the .init.* sections are stripped after boot,
> it means that anything in .init.data cannot be accessed anymore.
> The build system explicitly compiles any .init binary without gcov option.
> The problem is coming from libfdt.
> The entire library is moved to .init using:
> $(OBJCOPY) $(foreach s,$(SECTIONS),--rename-section .$(s)=.init.$(s)) $< $@
> So we need to tell the top Makefile to filter out libfdt.
> 
> Reported-by: Viktor Mitin <viktor.mitin.19@gmail.com>
> Signed-off-by: Julien Grall <julien.grall@arm.com>
> Tested-by: Viktor Mitin <viktor.mitin.19@gmail.com>

Reviewed-by: Wei Liu <wei.liu2@citrix.com>

Although I would like to ask you to adjust the subject to be more
specific:

  coverage: filter out libfdt.o

if you agree, this can be done while committing.

Wei.


> ---
>  xen/common/libfdt/Makefile | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/xen/common/libfdt/Makefile b/xen/common/libfdt/Makefile
> index d81f54b6b8..c075bbf546 100644
> --- a/xen/common/libfdt/Makefile
> +++ b/xen/common/libfdt/Makefile
> @@ -3,6 +3,7 @@ include Makefile.libfdt
>  SECTIONS := text data $(SPECIAL_DATA_SECTIONS)
>  
>  obj-y += libfdt.o
> +nocov-y += libfdt.o
>  
>  CFLAGS += -I$(BASEDIR)/include/xen/libfdt/
>  
> -- 
> 2.17.1
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH] coverage: GCC coverage libfdt Makefile fix

Posted by Julien Grall 1 year, 9 months ago

On 16/05/2019 12:26, Wei Liu wrote:
> On Thu, May 16, 2019 at 02:13:54PM +0300, Viktor Mitin wrote:
>> The patch resolves 'xencov' crashes in case of Aarch64.
>>
>> All the .init.* sections are stripped after boot,
>> it means that anything in .init.data cannot be accessed anymore.
>> The build system explicitly compiles any .init binary without gcov option.
>> The problem is coming from libfdt.
>> The entire library is moved to .init using:
>> $(OBJCOPY) $(foreach s,$(SECTIONS),--rename-section .$(s)=.init.$(s)) $< $@
>> So we need to tell the top Makefile to filter out libfdt.
>>
>> Reported-by: Viktor Mitin <viktor.mitin.19@gmail.com>
>> Signed-off-by: Julien Grall <julien.grall@arm.com>
>> Tested-by: Viktor Mitin <viktor.mitin.19@gmail.com>
> 
> Reviewed-by: Wei Liu <wei.liu2@citrix.com>
> 
> Although I would like to ask you to adjust the subject to be more
> specific:
> 
>    coverage: filter out libfdt.o
> 
> if you agree, this can be done while committing.

There are more than that the title to fix on commit. The Signed-off-by 
and does not match the From for instance.

I initially suggested the change, so Suggested-by would be more 
suitable. And then Viktor needs to add his signed-off-by.

Also, could we also fix libelf at the same time?

Cheers,

-- 
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH] coverage: GCC coverage libfdt Makefile fix

Posted by Wei Liu 1 year, 9 months ago
On Thu, May 16, 2019 at 11:37:33AM +0000, Julien Grall wrote:
> 
> 
> On 16/05/2019 12:26, Wei Liu wrote:
> > On Thu, May 16, 2019 at 02:13:54PM +0300, Viktor Mitin wrote:
> >> The patch resolves 'xencov' crashes in case of Aarch64.
> >>
> >> All the .init.* sections are stripped after boot,
> >> it means that anything in .init.data cannot be accessed anymore.
> >> The build system explicitly compiles any .init binary without gcov option.
> >> The problem is coming from libfdt.
> >> The entire library is moved to .init using:
> >> $(OBJCOPY) $(foreach s,$(SECTIONS),--rename-section .$(s)=.init.$(s)) $< $@
> >> So we need to tell the top Makefile to filter out libfdt.
> >>
> >> Reported-by: Viktor Mitin <viktor.mitin.19@gmail.com>
> >> Signed-off-by: Julien Grall <julien.grall@arm.com>
> >> Tested-by: Viktor Mitin <viktor.mitin.19@gmail.com>
> > 
> > Reviewed-by: Wei Liu <wei.liu2@citrix.com>
> > 
> > Although I would like to ask you to adjust the subject to be more
> > specific:
> > 
> >    coverage: filter out libfdt.o
> > 
> > if you agree, this can be done while committing.
> 
> There are more than that the title to fix on commit. The Signed-off-by 
> and does not match the From for instance.
> 
> I initially suggested the change, so Suggested-by would be more 
> suitable. And then Viktor needs to add his signed-off-by.
> 
> Also, could we also fix libelf at the same time?

+1. Viktor?

Wei.

> 
> Cheers,
> 
> -- 
> Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH] coverage: GCC coverage libfdt Makefile fix

Posted by Viktor Mitin 1 year, 9 months ago
Hi All,

Thank you for replies. Will do all the mentioned updates and will send
patch v2 after retesting it on target board (with libelf Makefile
update).

Thanks

On Thu, May 16, 2019 at 2:40 PM Wei Liu <wei.liu2@citrix.com> wrote:
>
> On Thu, May 16, 2019 at 11:37:33AM +0000, Julien Grall wrote:
> >
> >
> > On 16/05/2019 12:26, Wei Liu wrote:
> > > On Thu, May 16, 2019 at 02:13:54PM +0300, Viktor Mitin wrote:
> > >> The patch resolves 'xencov' crashes in case of Aarch64.
> > >>
> > >> All the .init.* sections are stripped after boot,
> > >> it means that anything in .init.data cannot be accessed anymore.
> > >> The build system explicitly compiles any .init binary without gcov option.
> > >> The problem is coming from libfdt.
> > >> The entire library is moved to .init using:
> > >> $(OBJCOPY) $(foreach s,$(SECTIONS),--rename-section .$(s)=.init.$(s)) $< $@
> > >> So we need to tell the top Makefile to filter out libfdt.
> > >>
> > >> Reported-by: Viktor Mitin <viktor.mitin.19@gmail.com>
> > >> Signed-off-by: Julien Grall <julien.grall@arm.com>
> > >> Tested-by: Viktor Mitin <viktor.mitin.19@gmail.com>
> > >
> > > Reviewed-by: Wei Liu <wei.liu2@citrix.com>
> > >
> > > Although I would like to ask you to adjust the subject to be more
> > > specific:
> > >
> > >    coverage: filter out libfdt.o
> > >
> > > if you agree, this can be done while committing.
> >
> > There are more than that the title to fix on commit. The Signed-off-by
> > and does not match the From for instance.
> >
> > I initially suggested the change, so Suggested-by would be more
> > suitable. And then Viktor needs to add his signed-off-by.
> >
> > Also, could we also fix libelf at the same time?
>
> +1. Viktor?
>
> Wei.
>
> >
> > Cheers,
> >
> > --
> > Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH] coverage: GCC coverage libfdt Makefile fix

Posted by Andrew Cooper 1 year, 9 months ago
On 16/05/2019 12:26, Wei Liu wrote:
> On Thu, May 16, 2019 at 02:13:54PM +0300, Viktor Mitin wrote:
>> The patch resolves 'xencov' crashes in case of Aarch64.
>>
>> All the .init.* sections are stripped after boot,
>> it means that anything in .init.data cannot be accessed anymore.
>> The build system explicitly compiles any .init binary without gcov option.
>> The problem is coming from libfdt.
>> The entire library is moved to .init using:
>> $(OBJCOPY) $(foreach s,$(SECTIONS),--rename-section .$(s)=.init.$(s)) $< $@
>> So we need to tell the top Makefile to filter out libfdt.
>>
>> Reported-by: Viktor Mitin <viktor.mitin.19@gmail.com>
>> Signed-off-by: Julien Grall <julien.grall@arm.com>
>> Tested-by: Viktor Mitin <viktor.mitin.19@gmail.com>
> Reviewed-by: Wei Liu <wei.liu2@citrix.com>
>
> Although I would like to ask you to adjust the subject to be more
> specific:
>
>   coverage: filter out libfdt.o
>
> if you agree, this can be done while committing.

+1

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel