linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gcov: clang: fix clang-11+ build
@ 2021-04-12 19:42 Johannes Berg
  2021-04-12 22:41 ` Nick Desaulniers
  0 siblings, 1 reply; 2+ messages in thread
From: Johannes Berg @ 2021-04-12 19:42 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Nick Desaulniers, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

With clang-11+, the code is broken due to my kvmalloc() conversion
(which predated the clang-11 support code) leaving one vmalloc()
in place. Fix that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
This fixes a clang-11 build issue reported against current
linux-next since the clang-11+ support landed in v5.12-rc5
and my kvmalloc() conversion patch is in akpm/linux-next.
I guess this should be folded into

  gcov: use kvmalloc()

If desired, I can send a combined patch instead.
---
 kernel/gcov/clang.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/gcov/clang.c b/kernel/gcov/clang.c
index 04a65443005d..d43ffd0c5ddb 100644
--- a/kernel/gcov/clang.c
+++ b/kernel/gcov/clang.c
@@ -368,7 +368,7 @@ static struct gcov_fn_info *gcov_fn_info_dup(struct gcov_fn_info *fn)
 	INIT_LIST_HEAD(&fn_dup->head);
 
 	cv_size = fn->num_counters * sizeof(fn->counters[0]);
-	fn_dup->counters = vmalloc(cv_size);
+	fn_dup->counters = kvmalloc(cv_size, GFP_KERNEL);
 	if (!fn_dup->counters) {
 		kfree(fn_dup);
 		return NULL;
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] gcov: clang: fix clang-11+ build
  2021-04-12 19:42 [PATCH] gcov: clang: fix clang-11+ build Johannes Berg
@ 2021-04-12 22:41 ` Nick Desaulniers
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Desaulniers @ 2021-04-12 22:41 UTC (permalink / raw)
  To: Johannes Berg; +Cc: Andrew Morton, LKML, Johannes Berg

On Mon, Apr 12, 2021 at 12:42 PM Johannes Berg
<johannes@sipsolutions.net> wrote:
>
> From: Johannes Berg <johannes.berg@intel.com>
>
> With clang-11+, the code is broken due to my kvmalloc() conversion
> (which predated the clang-11 support code) leaving one vmalloc()
> in place. Fix that.
>
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
> This fixes a clang-11 build issue reported against current
> linux-next since the clang-11+ support landed in v5.12-rc5

Thanks for the patch, and noticing the breakage so quickly.  I
recently added GCOV to our CI, but I've been fighting enough fires
this morning that I haven't had time to check this particular build!

Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>

> and my kvmalloc() conversion patch is in akpm/linux-next.
> I guess this should be folded into
>
>   gcov: use kvmalloc()
>
> If desired, I can send a combined patch instead.
> ---
>  kernel/gcov/clang.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/gcov/clang.c b/kernel/gcov/clang.c
> index 04a65443005d..d43ffd0c5ddb 100644
> --- a/kernel/gcov/clang.c
> +++ b/kernel/gcov/clang.c
> @@ -368,7 +368,7 @@ static struct gcov_fn_info *gcov_fn_info_dup(struct gcov_fn_info *fn)
>         INIT_LIST_HEAD(&fn_dup->head);
>
>         cv_size = fn->num_counters * sizeof(fn->counters[0]);
> -       fn_dup->counters = vmalloc(cv_size);
> +       fn_dup->counters = kvmalloc(cv_size, GFP_KERNEL);
>         if (!fn_dup->counters) {
>                 kfree(fn_dup);
>                 return NULL;
> --
> 2.30.2
>


-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-12 22:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-12 19:42 [PATCH] gcov: clang: fix clang-11+ build Johannes Berg
2021-04-12 22:41 ` Nick Desaulniers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).