From: kernel test robot <lkp@intel.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
Ingo Molnar <mingo@kernel.org>
Subject: arch/arm/kernel/patch.c:94:11: error: implicit declaration of function '__opcode_to_mem_thumb32'
Date: Sun, 21 Feb 2021 03:08:04 +0800 [thread overview]
Message-ID: <202102210300.uMKy3Arz-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 5932 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: f40ddce88593482919761f74910f42f4b84c004b
commit: 5a735583b764750726621b0396d03e4782911b77 arm/ftrace: Use __patch_text()
date: 1 year, 3 months ago
config: arm-randconfig-r014-20210220 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5a735583b764750726621b0396d03e4782911b77
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 5a735583b764750726621b0396d03e4782911b77
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
arch/arm/kernel/patch.c: In function '__patch_text_real':
>> arch/arm/kernel/patch.c:94:11: error: implicit declaration of function '__opcode_to_mem_thumb32' [-Werror=implicit-function-declaration]
94 | insn = __opcode_to_mem_thumb32(insn);
| ^~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/__opcode_to_mem_thumb32 +94 arch/arm/kernel/patch.c
ab0615e2d6fb07 Rabin Vincent 2014-04-24 55
ab0615e2d6fb07 Rabin Vincent 2014-04-24 56 void __kprobes __patch_text_real(void *addr, unsigned int insn, bool remap)
b21d55e98ac2bb Rabin Vincent 2012-02-18 57 {
b21d55e98ac2bb Rabin Vincent 2012-02-18 58 bool thumb2 = IS_ENABLED(CONFIG_THUMB2_KERNEL);
ab0615e2d6fb07 Rabin Vincent 2014-04-24 59 unsigned int uintaddr = (uintptr_t) addr;
ab0615e2d6fb07 Rabin Vincent 2014-04-24 60 bool twopage = false;
ab0615e2d6fb07 Rabin Vincent 2014-04-24 61 unsigned long flags;
ab0615e2d6fb07 Rabin Vincent 2014-04-24 62 void *waddr = addr;
b21d55e98ac2bb Rabin Vincent 2012-02-18 63 int size;
b21d55e98ac2bb Rabin Vincent 2012-02-18 64
ab0615e2d6fb07 Rabin Vincent 2014-04-24 65 if (remap)
ab0615e2d6fb07 Rabin Vincent 2014-04-24 66 waddr = patch_map(addr, FIX_TEXT_POKE0, &flags);
ab0615e2d6fb07 Rabin Vincent 2014-04-24 67 else
ab0615e2d6fb07 Rabin Vincent 2014-04-24 68 __acquire(&patch_lock);
ab0615e2d6fb07 Rabin Vincent 2014-04-24 69
b21d55e98ac2bb Rabin Vincent 2012-02-18 70 if (thumb2 && __opcode_is_thumb16(insn)) {
ab0615e2d6fb07 Rabin Vincent 2014-04-24 71 *(u16 *)waddr = __opcode_to_mem_thumb16(insn);
b21d55e98ac2bb Rabin Vincent 2012-02-18 72 size = sizeof(u16);
ab0615e2d6fb07 Rabin Vincent 2014-04-24 73 } else if (thumb2 && (uintaddr & 2)) {
b21d55e98ac2bb Rabin Vincent 2012-02-18 74 u16 first = __opcode_thumb32_first(insn);
b21d55e98ac2bb Rabin Vincent 2012-02-18 75 u16 second = __opcode_thumb32_second(insn);
ab0615e2d6fb07 Rabin Vincent 2014-04-24 76 u16 *addrh0 = waddr;
ab0615e2d6fb07 Rabin Vincent 2014-04-24 77 u16 *addrh1 = waddr + 2;
ab0615e2d6fb07 Rabin Vincent 2014-04-24 78
ab0615e2d6fb07 Rabin Vincent 2014-04-24 79 twopage = (uintaddr & ~PAGE_MASK) == PAGE_SIZE - 2;
ab0615e2d6fb07 Rabin Vincent 2014-04-24 80 if (twopage && remap)
ab0615e2d6fb07 Rabin Vincent 2014-04-24 81 addrh1 = patch_map(addr + 2, FIX_TEXT_POKE1, NULL);
ab0615e2d6fb07 Rabin Vincent 2014-04-24 82
ab0615e2d6fb07 Rabin Vincent 2014-04-24 83 *addrh0 = __opcode_to_mem_thumb16(first);
ab0615e2d6fb07 Rabin Vincent 2014-04-24 84 *addrh1 = __opcode_to_mem_thumb16(second);
b21d55e98ac2bb Rabin Vincent 2012-02-18 85
ab0615e2d6fb07 Rabin Vincent 2014-04-24 86 if (twopage && addrh1 != addr + 2) {
ab0615e2d6fb07 Rabin Vincent 2014-04-24 87 flush_kernel_vmap_range(addrh1, 2);
ab0615e2d6fb07 Rabin Vincent 2014-04-24 88 patch_unmap(FIX_TEXT_POKE1, NULL);
ab0615e2d6fb07 Rabin Vincent 2014-04-24 89 }
b21d55e98ac2bb Rabin Vincent 2012-02-18 90
b21d55e98ac2bb Rabin Vincent 2012-02-18 91 size = sizeof(u32);
b21d55e98ac2bb Rabin Vincent 2012-02-18 92 } else {
b21d55e98ac2bb Rabin Vincent 2012-02-18 93 if (thumb2)
b21d55e98ac2bb Rabin Vincent 2012-02-18 @94 insn = __opcode_to_mem_thumb32(insn);
b21d55e98ac2bb Rabin Vincent 2012-02-18 95 else
b21d55e98ac2bb Rabin Vincent 2012-02-18 96 insn = __opcode_to_mem_arm(insn);
b21d55e98ac2bb Rabin Vincent 2012-02-18 97
ab0615e2d6fb07 Rabin Vincent 2014-04-24 98 *(u32 *)waddr = insn;
b21d55e98ac2bb Rabin Vincent 2012-02-18 99 size = sizeof(u32);
b21d55e98ac2bb Rabin Vincent 2012-02-18 100 }
b21d55e98ac2bb Rabin Vincent 2012-02-18 101
ab0615e2d6fb07 Rabin Vincent 2014-04-24 102 if (waddr != addr) {
ab0615e2d6fb07 Rabin Vincent 2014-04-24 103 flush_kernel_vmap_range(waddr, twopage ? size / 2 : size);
ab0615e2d6fb07 Rabin Vincent 2014-04-24 104 patch_unmap(FIX_TEXT_POKE0, &flags);
ab0615e2d6fb07 Rabin Vincent 2014-04-24 105 } else
ab0615e2d6fb07 Rabin Vincent 2014-04-24 106 __release(&patch_lock);
ab0615e2d6fb07 Rabin Vincent 2014-04-24 107
b21d55e98ac2bb Rabin Vincent 2012-02-18 108 flush_icache_range((uintptr_t)(addr),
b21d55e98ac2bb Rabin Vincent 2012-02-18 109 (uintptr_t)(addr) + size);
b21d55e98ac2bb Rabin Vincent 2012-02-18 110 }
b21d55e98ac2bb Rabin Vincent 2012-02-18 111
:::::: The code at line 94 was first introduced by commit
:::::: b21d55e98ac2bbcbbeec9a8cb091f717fd95b072 ARM: 7332/1: extract out code patch function from kprobes
:::::: TO: Rabin Vincent <rabin@rab.in>
:::::: CC: Russell King <rmk+kernel@arm.linux.org.uk>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 36699 bytes --]
next reply other threads:[~2021-02-20 19:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-20 19:08 kernel test robot [this message]
2021-02-22 3:25 ` Randy Dunlap
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202102210300.uMKy3Arz-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®