mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Daniel Bristot de Oliveira <bristot@redhat.com>
Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org,
	tipbuild@zytor.com, Ingo Molnar <mingo@kernel.org>
Subject: [tip:WIP.x86/alternatives 7/9] arch/x86/kernel/alternative.c:896:42: sparse: Using plain integer as NULL pointer
Date: Sat, 20 Apr 2019 16:08:04 +0800	[thread overview]
Message-ID: <201904201602.4E4b6oEg%lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git WIP.x86/alternatives
head:   1f30946b1a01baf22df6faf74c0a1e602bb6cac7
commit: 76ec759ad71c1fa0c4b327367e82b2650109a22f [7/9] x86/alternative: Batch of patch operations
reproduce:
        # apt-get install sparse
        git checkout 76ec759ad71c1fa0c4b327367e82b2650109a22f
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>



sparse warnings: (new ones prefixed by >>)

>> arch/x86/kernel/alternative.c:896:42: sparse: Using plain integer as NULL pointer

vim +896 arch/x86/kernel/alternative.c

   836	
   837	/**
   838	 * text_poke_bp() -- update instructions on live kernel on SMP
   839	 * @addr:	address to patch
   840	 * @opcode:	opcode of new instruction
   841	 * @len:	length to copy
   842	 * @handler:	address to jump to when the temporary breakpoint is hit
   843	 *
   844	 * Modify multi-byte instruction by using int3 breakpoint on SMP.
   845	 * We completely avoid stop_machine() here, and achieve the
   846	 * synchronization using int3 breakpoint.
   847	 *
   848	 * The way it is done:
   849	 *	- add a int3 trap to the address that will be patched
   850	 *	- sync cores
   851	 *	- update all but the first byte of the patched range
   852	 *	- sync cores
   853	 *	- replace the first byte (int3) by the first byte of
   854	 *	  replacing opcode
   855	 *	- sync cores
   856	 */
   857	void *text_poke_bp(void *addr, const void *opcode, size_t len, void *handler)
   858	{
   859		unsigned char int3 = 0xcc;
   860	
   861		lockdep_assert_held(&text_mutex);
   862	
   863		bp_int3_handler = handler;
   864		bp_int3_addr = (u8 *)addr + sizeof(int3);
   865	
   866		bp_patching_in_progress = true;
   867		/*
   868		 * Corresponding read barrier in int3 notifier for making sure the
   869		 * in_progress and handler are correctly ordered wrt. patching.
   870		 */
   871		smp_wmb();
   872	
   873		text_poke_bp_set_handler(addr, handler, int3);
   874	
   875		on_each_cpu(do_sync_core, NULL, 1);
   876	
   877		if (len - sizeof(int3) > 0) {
   878			patch_all_but_first_byte(addr, opcode, len, int3);
   879			/*
   880			 * According to Intel, this core syncing is very likely
   881			 * not necessary and we'd be safe even without it. But
   882			 * better safe than sorry (plus there's not only Intel).
   883			 */
   884			on_each_cpu(do_sync_core, NULL, 1);
   885		}
   886	
   887		patch_first_byte(addr, opcode, int3);
   888	
   889		on_each_cpu(do_sync_core, NULL, 1);
   890		/*
   891		 * sync_core() implies an smp_mb() and orders this store against
   892		 * the writing of the new instruction.
   893		 */
   894		bp_patching_in_progress = false;
   895	
 > 896		bp_int3_handler = bp_int3_addr = 0;
   897		return addr;
   898	}
   899	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

                 reply	other threads:[~2019-04-20  8:18 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=201904201602.4E4b6oEg%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=bristot@redhat.com \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tipbuild@zytor.com \
    /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®