Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1235387 > unrolled thread

[PATCH] x86: fix build failure

Started byAndrey Ryabinin <ryabinin.a.a@gmail.com>
First post2015-09-29 18:50 +0200
Last post2015-10-01 09:20 +0200
Articles 5 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] x86: fix build failure Andrey Ryabinin <ryabinin.a.a@gmail.com> - 2015-09-29 18:50 +0200
    Re: [PATCH] x86: fix build failure Sedat Dilek <sedat.dilek@gmail.com> - 2015-09-29 21:00 +0200
      Re: [PATCH] x86: fix build failure Sedat Dilek <sedat.dilek@gmail.com> - 2015-09-30 09:00 +0200
        Re: [PATCH] x86: fix build failure Sedat Dilek <sedat.dilek@gmail.com> - 2015-09-30 10:00 +0200
    [tip:x86/urgent] x86, efi, kasan:   Fix build failure on !KASAN && KMEMCHECK=y kernels tip-bot for Andrey Ryabinin <tipbot@zytor.com> - 2015-10-01 09:20 +0200

#1235387 — [PATCH] x86: fix build failure

FromAndrey Ryabinin <ryabinin.a.a@gmail.com>
Date2015-09-29 18:50 +0200
Subject[PATCH] x86: fix build failure
Message-ID<qe6gi-3Gy-19@gated-at.bofh.it>
With KMEMCHECK=y, KASAN=n:

arch/x86/platform/efi/efi.c:673:3: error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration]
arch/x86/platform/efi/efi_64.c:139:2: error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration]
arch/x86/include/asm/desc.h:121:2: error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration]

Don't #undef memcpy if KASAN=n.

Reported-by: Ingo Molnar <mingo@kernel.org>
Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
Fixes: 769a8089c1fd ("x86, efi, kasan: #undef memset/memcpy/memmove per arch")
Signed-off-by: Andrey Ryabinin <ryabinin.a.a@gmail.com>
---
 arch/x86/include/asm/efi.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h
index ab5f1d4..ae68be9 100644
--- a/arch/x86/include/asm/efi.h
+++ b/arch/x86/include/asm/efi.h
@@ -86,6 +86,7 @@ extern u64 asmlinkage efi_call(void *fp, ...);
 extern void __iomem *__init efi_ioremap(unsigned long addr, unsigned long size,
 					u32 type, u64 attribute);
 
+#ifdef CONFIG_KASAN
 /*
  * CONFIG_KASAN may redefine memset to __memset.  __memset function is present
  * only in kernel binary.  Since the EFI stub linked into a separate binary it
@@ -95,6 +96,7 @@ extern void __iomem *__init efi_ioremap(unsigned long addr, unsigned long size,
 #undef memcpy
 #undef memset
 #undef memmove
+#endif
 
 #endif /* CONFIG_X86_32 */
 
-- 
2.4.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1235490

FromSedat Dilek <sedat.dilek@gmail.com>
Date2015-09-29 21:00 +0200
Message-ID<qe8i6-6x1-5@gated-at.bofh.it>
In reply to#1235387
On Tue, Sep 29, 2015 at 6:40 PM, Andrey Ryabinin <ryabinin.a.a@gmail.com> wrote:
> With KMEMCHECK=y, KASAN=n:
>
> arch/x86/platform/efi/efi.c:673:3: error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration]
> arch/x86/platform/efi/efi_64.c:139:2: error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration]
> arch/x86/include/asm/desc.h:121:2: error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration]
>
> Don't #undef memcpy if KASAN=n.
>

Good catch.
This broke my llvmlinux-patches Linux v4.3-rcN.

The subject-line is not very meaningful - to me at least ?

- Sedat -

> Reported-by: Ingo Molnar <mingo@kernel.org>
> Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
> Fixes: 769a8089c1fd ("x86, efi, kasan: #undef memset/memcpy/memmove per arch")
> Signed-off-by: Andrey Ryabinin <ryabinin.a.a@gmail.com>
> ---
>  arch/x86/include/asm/efi.h | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h
> index ab5f1d4..ae68be9 100644
> --- a/arch/x86/include/asm/efi.h
> +++ b/arch/x86/include/asm/efi.h
> @@ -86,6 +86,7 @@ extern u64 asmlinkage efi_call(void *fp, ...);
>  extern void __iomem *__init efi_ioremap(unsigned long addr, unsigned long size,
>                                         u32 type, u64 attribute);
>
> +#ifdef CONFIG_KASAN
>  /*
>   * CONFIG_KASAN may redefine memset to __memset.  __memset function is present
>   * only in kernel binary.  Since the EFI stub linked into a separate binary it
> @@ -95,6 +96,7 @@ extern void __iomem *__init efi_ioremap(unsigned long addr, unsigned long size,
>  #undef memcpy
>  #undef memset
>  #undef memmove
> +#endif
>
>  #endif /* CONFIG_X86_32 */
>
> --
> 2.4.6
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1235815

FromSedat Dilek <sedat.dilek@gmail.com>
Date2015-09-30 09:00 +0200
Message-ID<qejwS-5Mf-13@gated-at.bofh.it>
In reply to#1235490
On Tue, Sep 29, 2015 at 8:59 PM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
> On Tue, Sep 29, 2015 at 6:40 PM, Andrey Ryabinin <ryabinin.a.a@gmail.com> wrote:
>> With KMEMCHECK=y, KASAN=n:
>>
>> arch/x86/platform/efi/efi.c:673:3: error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration]
>> arch/x86/platform/efi/efi_64.c:139:2: error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration]
>> arch/x86/include/asm/desc.h:121:2: error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration]
>>
>> Don't #undef memcpy if KASAN=n.
>>
>
> Good catch.
> This broke my llvmlinux-patches Linux v4.3-rcN.
>
> The subject-line is not very meaningful - to me at least ?
>

What about...?

"x86, efi, kasan: Fix error implicit declaration of memcpy"

"x86, efi, kasan: Add missing CONFIG_KASAN check for #undef
memset/memcpy/memmove"

- Sedat -

> - Sedat -
>
>> Reported-by: Ingo Molnar <mingo@kernel.org>
>> Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
>> Fixes: 769a8089c1fd ("x86, efi, kasan: #undef memset/memcpy/memmove per arch")
>> Signed-off-by: Andrey Ryabinin <ryabinin.a.a@gmail.com>
>> ---
>>  arch/x86/include/asm/efi.h | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h
>> index ab5f1d4..ae68be9 100644
>> --- a/arch/x86/include/asm/efi.h
>> +++ b/arch/x86/include/asm/efi.h
>> @@ -86,6 +86,7 @@ extern u64 asmlinkage efi_call(void *fp, ...);
>>  extern void __iomem *__init efi_ioremap(unsigned long addr, unsigned long size,
>>                                         u32 type, u64 attribute);
>>
>> +#ifdef CONFIG_KASAN
>>  /*
>>   * CONFIG_KASAN may redefine memset to __memset.  __memset function is present
>>   * only in kernel binary.  Since the EFI stub linked into a separate binary it
>> @@ -95,6 +96,7 @@ extern void __iomem *__init efi_ioremap(unsigned long addr, unsigned long size,
>>  #undef memcpy
>>  #undef memset
>>  #undef memmove
>> +#endif
>>
>>  #endif /* CONFIG_X86_32 */
>>
>> --
>> 2.4.6
>>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1235864

FromSedat Dilek <sedat.dilek@gmail.com>
Date2015-09-30 10:00 +0200
Message-ID<qeksX-76X-23@gated-at.bofh.it>
In reply to#1235815
On Wed, Sep 30, 2015 at 8:55 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
> On Tue, Sep 29, 2015 at 8:59 PM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>> On Tue, Sep 29, 2015 at 6:40 PM, Andrey Ryabinin <ryabinin.a.a@gmail.com> wrote:
>>> With KMEMCHECK=y, KASAN=n:
>>>
>>> arch/x86/platform/efi/efi.c:673:3: error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration]
>>> arch/x86/platform/efi/efi_64.c:139:2: error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration]
>>> arch/x86/include/asm/desc.h:121:2: error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration]
>>>
>>> Don't #undef memcpy if KASAN=n.
>>>
>>
>> Good catch.
>> This broke my llvmlinux-patches Linux v4.3-rcN.
>>
>> The subject-line is not very meaningful - to me at least ?
>>
>
> What about...?
>
> "x86, efi, kasan: Fix error implicit declaration of memcpy"
>
> "x86, efi, kasan: Add missing CONFIG_KASAN check for #undef
> memset/memcpy/memmove"
>

I tested this with latest llvmlinux kernel and it looks good...

$ grep 'kernel/setup.o' build-log_4.3.0-rc3-10-llvmlinux-amd64.txt
  CC      arch/x86/kernel/setup.o

Feel free to add my...

    Tested-by: Sedat Dilek <sedat.dilek@gmail.com>

...when you do a v2.

Thanks.

- Sedat -

> - Sedat -
>
>> - Sedat -
>>
>>> Reported-by: Ingo Molnar <mingo@kernel.org>
>>> Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
>>> Fixes: 769a8089c1fd ("x86, efi, kasan: #undef memset/memcpy/memmove per arch")
>>> Signed-off-by: Andrey Ryabinin <ryabinin.a.a@gmail.com>
>>> ---
>>>  arch/x86/include/asm/efi.h | 2 ++
>>>  1 file changed, 2 insertions(+)
>>>
>>> diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h
>>> index ab5f1d4..ae68be9 100644
>>> --- a/arch/x86/include/asm/efi.h
>>> +++ b/arch/x86/include/asm/efi.h
>>> @@ -86,6 +86,7 @@ extern u64 asmlinkage efi_call(void *fp, ...);
>>>  extern void __iomem *__init efi_ioremap(unsigned long addr, unsigned long size,
>>>                                         u32 type, u64 attribute);
>>>
>>> +#ifdef CONFIG_KASAN
>>>  /*
>>>   * CONFIG_KASAN may redefine memset to __memset.  __memset function is present
>>>   * only in kernel binary.  Since the EFI stub linked into a separate binary it
>>> @@ -95,6 +96,7 @@ extern void __iomem *__init efi_ioremap(unsigned long addr, unsigned long size,
>>>  #undef memcpy
>>>  #undef memset
>>>  #undef memmove
>>> +#endif
>>>
>>>  #endif /* CONFIG_X86_32 */
>>>
>>> --
>>> 2.4.6
>>>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1237058 — [tip:x86/urgent] x86, efi, kasan: Fix build failure on !KASAN && KMEMCHECK=y kernels

Fromtip-bot for Andrey Ryabinin <tipbot@zytor.com>
Date2015-10-01 09:20 +0200
Subject[tip:x86/urgent] x86, efi, kasan: Fix build failure on !KASAN && KMEMCHECK=y kernels
Message-ID<qeGjM-58Q-3@gated-at.bofh.it>
In reply to#1235387
Commit-ID:  4ac86a6dcec1c3878de9747bf5a2aa4455be69e3
Gitweb:     http://git.kernel.org/tip/4ac86a6dcec1c3878de9747bf5a2aa4455be69e3
Author:     Andrey Ryabinin <ryabinin.a.a@gmail.com>
AuthorDate: Tue, 29 Sep 2015 19:40:14 +0300
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 30 Sep 2015 09:29:53 +0200

x86, efi, kasan: Fix build failure on !KASAN && KMEMCHECK=y kernels

With KMEMCHECK=y, KASAN=n we get this build failure:

  arch/x86/platform/efi/efi.c:673:3:    error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration]
  arch/x86/platform/efi/efi_64.c:139:2: error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration]
  arch/x86/include/asm/desc.h:121:2:    error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration]

Don't #undef memcpy if KASAN=n.

Reported-by: Ingo Molnar <mingo@kernel.org>
Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matt Fleming <matt.fleming@intel.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: 769a8089c1fd ("x86, efi, kasan: #undef memset/memcpy/memmove per arch")
Link: http://lkml.kernel.org/r/1443544814-20122-1-git-send-email-ryabinin.a.a@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/include/asm/efi.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h
index ab5f1d4..ae68be9 100644
--- a/arch/x86/include/asm/efi.h
+++ b/arch/x86/include/asm/efi.h
@@ -86,6 +86,7 @@ extern u64 asmlinkage efi_call(void *fp, ...);
 extern void __iomem *__init efi_ioremap(unsigned long addr, unsigned long size,
 					u32 type, u64 attribute);
 
+#ifdef CONFIG_KASAN
 /*
  * CONFIG_KASAN may redefine memset to __memset.  __memset function is present
  * only in kernel binary.  Since the EFI stub linked into a separate binary it
@@ -95,6 +96,7 @@ extern void __iomem *__init efi_ioremap(unsigned long addr, unsigned long size,
 #undef memcpy
 #undef memset
 #undef memmove
+#endif
 
 #endif /* CONFIG_X86_32 */
 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web