All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kernel@openeuler.org
Cc: oe-kbuild-all@lists.linux.dev
Subject: [openeuler:openEuler-1.0-LTS 13138/21542] arch/x86/kernel/livepatch.c:225:5: warning: no previous prototype for 'arch_klp_init_func'
Date: Thu, 11 Jan 2024 15:06:00 +0800	[thread overview]
Message-ID: <202401111415.LckCd1Fu-lkp@intel.com> (raw)

tree:   https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS
head:   9b8b6ad39cc58aa26fb70284f482daec61e17c22
commit: 7e2ab91ea07673f855f16b54b7c6e6853b2efc1c [13138/21542] livepatch/x86: support livepatch without ftrace
config: x86_64-openeuler_defconfig (https://download.01.org/0day-ci/archive/20240111/202401111415.LckCd1Fu-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240111/202401111415.LckCd1Fu-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202401111415.LckCd1Fu-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> arch/x86/kernel/livepatch.c:225:5: warning: no previous prototype for 'arch_klp_init_func' [-Wmissing-prototypes]
     225 | int arch_klp_init_func(struct klp_object *obj, struct klp_func *func)
         |     ^~~~~~~~~~~~~~~~~~
>> arch/x86/kernel/livepatch.c:230:6: warning: no previous prototype for 'arch_klp_free_func' [-Wmissing-prototypes]
     230 | void arch_klp_free_func(struct klp_object *obj, struct klp_func *limit)
         |      ^~~~~~~~~~~~~~~~~~
>> arch/x86/kernel/livepatch.c:258:6: warning: no previous prototype for 'arch_klp_code_modify_prepare' [-Wmissing-prototypes]
     258 | void arch_klp_code_modify_prepare(void)
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> arch/x86/kernel/livepatch.c:264:6: warning: no previous prototype for 'arch_klp_code_modify_post_process' [-Wmissing-prototypes]
     264 | void arch_klp_code_modify_post_process(void)
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
>> kernel/livepatch/core.c:75:16: warning: no previous prototype for 'klp_check_patch_kprobed' [-Wmissing-prototypes]
      75 | struct kprobe *klp_check_patch_kprobed(struct klp_patch *patch)
         |                ^~~~~~~~~~~~~~~~~~~~~~~
>> kernel/livepatch/core.c:402:5: warning: no previous prototype for 'klp_try_disable_patch' [-Wmissing-prototypes]
     402 | int klp_try_disable_patch(void *data)
         |     ^~~~~~~~~~~~~~~~~~~~~
   kernel/livepatch/core.c: In function 'klp_try_disable_patch':
   kernel/livepatch/core.c:435:38: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
     435 |                         klp_smp_isb();
         |                                      ^
   kernel/livepatch/core.c: At top level:
>> kernel/livepatch/core.c:441:13: warning: no previous prototype for 'arch_klp_code_modify_prepare' [-Wmissing-prototypes]
     441 | void __weak arch_klp_code_modify_prepare(void)
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> kernel/livepatch/core.c:445:13: warning: no previous prototype for 'arch_klp_code_modify_post_process' [-Wmissing-prototypes]
     445 | void __weak arch_klp_code_modify_post_process(void)
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> kernel/livepatch/core.c:617:5: warning: no previous prototype for 'klp_try_enable_patch' [-Wmissing-prototypes]
     617 | int klp_try_enable_patch(void *data)
         |     ^~~~~~~~~~~~~~~~~~~~
   kernel/livepatch/core.c: In function 'klp_try_enable_patch':
   kernel/livepatch/core.c:650:38: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
     650 |                         klp_smp_isb();
         |                                      ^
   kernel/livepatch/core.c: At top level:
>> kernel/livepatch/core.c:1013:12: warning: no previous prototype for 'arch_klp_func_can_patch' [-Wmissing-prototypes]
    1013 | int __weak arch_klp_func_can_patch(struct klp_func *func)
         |            ^~~~~~~~~~~~~~~~~~~~~~~


vim +/arch_klp_init_func +225 arch/x86/kernel/livepatch.c

   224	
 > 225	int arch_klp_init_func(struct klp_object *obj, struct klp_func *func)
   226	{
   227		return 0;
   228	}
   229	
 > 230	void arch_klp_free_func(struct klp_object *obj, struct klp_func *limit)
   231	{
   232	
   233	}
   234	
   235	static int klp_calc_offset(long pc, long addr)
   236	{
   237		return (int)(addr - pc);
   238	}
   239	
   240	static unsigned char *klp_jmp_code(unsigned long ip, unsigned long addr)
   241	{
   242		static union klp_code_union calc;
   243	
   244		calc.e9 = 0xe9;
   245		calc.offset = klp_calc_offset(ip + JMP_E9_INSN_SIZE, addr);
   246	
   247		return calc.code;
   248	}
   249	
   250	static unsigned char *klp_old_code(unsigned char *code)
   251	{
   252		static union klp_code_union old_code;
   253	
   254		strncpy(old_code.code, code, JMP_E9_INSN_SIZE);
   255		return old_code.code;
   256	}
   257	
 > 258	void arch_klp_code_modify_prepare(void)
   259	{
   260		set_kernel_text_rw();
   261		set_all_modules_text_rw();
   262	}
   263	
 > 264	void arch_klp_code_modify_post_process(void)
   265	{
   266		set_all_modules_text_ro();
   267		set_kernel_text_ro();
   268	}
   269	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2024-01-11  7:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202401111415.LckCd1Fu-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kernel@openeuler.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.