From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D74C5C43217 for ; Tue, 24 May 2022 17:51:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 40EE38D0005; Tue, 24 May 2022 13:51:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 397458D0002; Tue, 24 May 2022 13:51:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2363D8D0005; Tue, 24 May 2022 13:51:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 15C8F8D0002 for ; Tue, 24 May 2022 13:51:48 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id E1680608F9 for ; Tue, 24 May 2022 17:51:47 +0000 (UTC) X-FDA: 79501379454.07.E81873C Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by imf28.hostedemail.com (Postfix) with ESMTP id 3392EC00C2 for ; Tue, 24 May 2022 17:51:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653414707; x=1684950707; h=date:from:to:cc:subject:message-id:mime-version; bh=RqBppTw2w1ZxER/yzzazxwJfPDRW5fSfKGIZeTi4Suk=; b=XsHVWZk3MHVSLgUhHYC/bTAKPvCDgKi431m7zYleXj8bHYL+6V6ZQhdm PTpxDoyrwcLpflsPSgXFbOyGBLyBcooISOqsDxnOtwc59pU2y9mhEGj93 Zm2W0ka4JckjnDEDYr3AyI6yG6wtIL2607k3oDsr48MnujX8ibvmbDd22 IWlJAqRs+B9bzToWO5qZO4JHJt8mab8LnS4Xp0YAe3Nvj/+Tdkn5dECc8 /5vEVyqDZsw51SgWIU5iazGM0eVFR8/5nC3CiLfhG1Wxhf2+2U5R1Cblk +k3HYC03uqcOudnetcHYXq/ZU02qD3CRhUy9/4KQ5CWUoIsnXRpf+SPq8 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10357"; a="272430193" X-IronPort-AV: E=Sophos;i="5.91,248,1647327600"; d="scan'208";a="272430193" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2022 10:46:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,248,1647327600"; d="scan'208";a="608770127" Received: from lkp-server01.sh.intel.com (HELO db63a1be7222) ([10.239.97.150]) by orsmga001.jf.intel.com with ESMTP; 24 May 2022 10:46:04 -0700 Received: from kbuild by db63a1be7222 with local (Exim 4.95) (envelope-from ) id 1ntYbc-0002Io-1G; Tue, 24 May 2022 17:46:04 +0000 Date: Wed, 25 May 2022 01:45:59 +0800 From: kernel test robot To: Liao Chang Cc: kbuild-all@lists.01.org, Linux Memory Management List , Palmer Dabbelt Subject: [linux-next:master 12645/14079] arch/riscv/kernel/machine_kexec.c:69:25: sparse: sparse: incorrect type in argument 2 (different address spaces) Message-ID: <202205250121.3OgasbW3-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Rspamd-Queue-Id: 3392EC00C2 X-Stat-Signature: fxfebp6m5nhkqm1kz7g15dqss8z84e8y Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=XsHVWZk3; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf28.hostedemail.com: domain of lkp@intel.com has no SPF policy when checking 192.55.52.120) smtp.mailfrom=lkp@intel.com X-Rspam-User: X-Rspamd-Server: rspam06 X-HE-Tag: 1653414674-113342 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 09ce5091ff971cdbfd67ad84dc561ea27f10d67a commit: b7fb4d78a6ade6026d9e5cf438c2a46ab962e032 [12645/14079] RISC-V: use memcpy for kexec_file mode config: riscv-allyesconfig (https://download.01.org/0day-ci/archive/20220525/202205250121.3OgasbW3-lkp@intel.com/config) compiler: riscv64-linux-gcc (GCC) 11.3.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # apt-get install sparse # sparse version: v0.6.4-14-g5a0004b5-dirty # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=b7fb4d78a6ade6026d9e5cf438c2a46ab962e032 git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git git fetch --no-tags linux-next master git checkout b7fb4d78a6ade6026d9e5cf438c2a46ab962e032 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=riscv SHELL=/bin/bash arch/riscv/ kernel// If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot sparse warnings: (new ones prefixed by >>) >> arch/riscv/kernel/machine_kexec.c:69:25: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const * @@ got void [noderef] __user *buf @@ arch/riscv/kernel/machine_kexec.c:69:25: sparse: expected void const * arch/riscv/kernel/machine_kexec.c:69:25: sparse: got void [noderef] __user *buf arch/riscv/kernel/machine_kexec.c:169:1: sparse: sparse: symbol 'machine_kexec' redeclared with different type (different modifiers): arch/riscv/kernel/machine_kexec.c:169:1: sparse: void extern [addressable] [noreturn] [toplevel] machine_kexec( ... ) arch/riscv/kernel/machine_kexec.c: note: in included file: include/linux/kexec.h:325:13: sparse: note: previously declared as: include/linux/kexec.h:325:13: sparse: void extern [addressable] [toplevel] machine_kexec( ... ) vim +69 arch/riscv/kernel/machine_kexec.c 42 43 /* 44 * machine_kexec_prepare - Initialize kexec 45 * 46 * This function is called from do_kexec_load, when the user has 47 * provided us with an image to be loaded. Its goal is to validate 48 * the image and prepare the control code buffer as needed. 49 * Note that kimage_alloc_init has already been called and the 50 * control buffer has already been allocated. 51 */ 52 int 53 machine_kexec_prepare(struct kimage *image) 54 { 55 struct kimage_arch *internal = &image->arch; 56 struct fdt_header fdt = {0}; 57 void *control_code_buffer = NULL; 58 unsigned int control_code_buffer_sz = 0; 59 int i = 0; 60 61 kexec_image_info(image); 62 63 /* Find the Flattened Device Tree and save its physical address */ 64 for (i = 0; i < image->nr_segments; i++) { 65 if (image->segment[i].memsz <= sizeof(fdt)) 66 continue; 67 68 if (image->file_mode) > 69 memcpy(&fdt, image->segment[i].buf, sizeof(fdt)); 70 else if (copy_from_user(&fdt, image->segment[i].buf, sizeof(fdt))) 71 continue; 72 73 if (fdt_check_header(&fdt)) 74 continue; 75 76 internal->fdt_addr = (unsigned long) image->segment[i].mem; 77 break; 78 } 79 80 if (!internal->fdt_addr) { 81 pr_err("Device tree not included in the provided image\n"); 82 return -EINVAL; 83 } 84 85 /* Copy the assembler code for relocation to the control page */ 86 if (image->type != KEXEC_TYPE_CRASH) { 87 control_code_buffer = page_address(image->control_code_page); 88 control_code_buffer_sz = page_size(image->control_code_page); 89 90 if (unlikely(riscv_kexec_relocate_size > control_code_buffer_sz)) { 91 pr_err("Relocation code doesn't fit within a control page\n"); 92 return -EINVAL; 93 } 94 95 memcpy(control_code_buffer, riscv_kexec_relocate, 96 riscv_kexec_relocate_size); 97 98 /* Mark the control page executable */ 99 set_memory_x((unsigned long) control_code_buffer, 1); 100 } 101 102 return 0; 103 } 104 -- 0-DAY CI Kernel Test Service https://01.org/lkp