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 2F0DCC433EF for ; Sat, 16 Jul 2022 16:32:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4DA1E6B0073; Sat, 16 Jul 2022 12:32:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 48A1D6B0074; Sat, 16 Jul 2022 12:32:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 378CA6B0075; Sat, 16 Jul 2022 12:32:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 29F456B0073 for ; Sat, 16 Jul 2022 12:32:29 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id E685060527 for ; Sat, 16 Jul 2022 16:32:28 +0000 (UTC) X-FDA: 79693505976.10.AE5438C Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by imf10.hostedemail.com (Postfix) with ESMTP id BC045C0033 for ; Sat, 16 Jul 2022 16:32:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657989147; x=1689525147; h=date:from:to:cc:subject:message-id:mime-version; bh=U488qM261s+VYYOS1KtH9ma11VoEA/ZxMVhswgWHZcs=; b=Zo00gmR6wVfLxsyYi3Be8dQsCe09a1RWyaS93HN1SvGVannalcmETqUz WsMKyjJCKoXFZU+O0KfhyNJ8/URR6ybMuefUXjYa2W8uVfoUffzSzrEM7 B0cIUMffrh3MAoTsOKI5P5NKodE/7JkrCLzUgblvyksQxyQRnwiR2rCPM 3etrFGAiaFRdwdhYY0gS6D/a3otAy67xlEba60s23yi6oYfMDYUv1DaNu w2nSsic0nwv5B9WrhN/7IU1q91IJ81T8zuNUJH+i9+KOR+8c0loUA3n1I 67RH/8D5qwqpKi683qv+xUbjdeuwRtE1K3F5xh8vS8bnG9SVwhai/oygX w==; X-IronPort-AV: E=McAfee;i="6400,9594,10410"; a="284746560" X-IronPort-AV: E=Sophos;i="5.92,277,1650956400"; d="scan'208";a="284746560" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jul 2022 09:32:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,277,1650956400"; d="scan'208";a="664538871" Received: from lkp-server02.sh.intel.com (HELO ff137eb26ff1) ([10.239.97.151]) by fmsmga004.fm.intel.com with ESMTP; 16 Jul 2022 09:32:24 -0700 Received: from kbuild by ff137eb26ff1 with local (Exim 4.95) (envelope-from ) id 1oCkiO-0001p0-AH; Sat, 16 Jul 2022 16:32:24 +0000 Date: Sun, 17 Jul 2022 00:31:37 +0800 From: kernel test robot To: Xu Kuohai Cc: kbuild-all@lists.01.org, Linux Memory Management List , Daniel Borkmann , Jean-Philippe Brucker Subject: [linux-next:master 9199/10906] arch/arm64/net/bpf_jit_comp.c:1683:16: sparse: sparse: incorrect type in assignment (different base types) Message-ID: <202207170002.kWlaJQkJ-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=Zo00gmR6; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf10.hostedemail.com: domain of lkp@intel.com has no SPF policy when checking 192.55.52.120) smtp.mailfrom=lkp@intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657989148; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=hZpEL3/dAw64hs9QM4AC5fSQMGy/6RlCrS5aCWDeBes=; b=f1jvxTwJa4PNUPkgUOTOIU02uVALQIOJ2kZ53/U/v7eHW1OWCTPqRBBRVjYTYFN74OhR3A A7WJbT64p1o1p/oMc4jvtLjVHUdEjPqpj16pCAlicCL1XaA068r7qfQpnxjMlT9GLvK/eJ Qji2QfhKLCxk459tvDVRxwLGFEZro78= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657989148; a=rsa-sha256; cv=none; b=bebaKvWgf7cNEIz0FfcljR8fCmaelVdGtykTNHfSVyJSjnNLIiTDpvPkprY20aG5x6SZeQ 7ZQsxFJtQYeMnYUCRMGDq7Bslns0yoiMkarammSE+xDCMNA8Dcon7EgI6k8mc4qvXicbfK 9KePbHj9EPiAnTgnjzYIZud8UejA+HE= X-Rspamd-Queue-Id: BC045C0033 X-Rspam-User: Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=Zo00gmR6; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf10.hostedemail.com: domain of lkp@intel.com has no SPF policy when checking 192.55.52.120) smtp.mailfrom=lkp@intel.com X-Rspamd-Server: rspam11 X-Stat-Signature: 1s63t4kdjpfrifcydzr6nupxcakdscid X-HE-Tag: 1657989147-961529 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: 6014cfa5bf32cf8c5c58b3cfd5ee0e1542c8a825 commit: efc9909fdce00a827a37609628223cd45bf95d0b [9199/10906] bpf, arm64: Add bpf trampoline for arm64 config: arm64-randconfig-s043-20220716 (https://download.01.org/0day-ci/archive/20220717/202207170002.kWlaJQkJ-lkp@intel.com/config) compiler: aarch64-linux-gcc (GCC) 12.1.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-39-gce1a6720-dirty # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=efc9909fdce00a827a37609628223cd45bf95d0b 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 efc9909fdce00a827a37609628223cd45bf95d0b # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm64 SHELL=/bin/bash arch/arm64/net/ If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot sparse warnings: (new ones prefixed by >>) >> arch/arm64/net/bpf_jit_comp.c:1683:16: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] *branch @@ got restricted __le32 [usertype] * @@ arch/arm64/net/bpf_jit_comp.c:1683:16: sparse: expected unsigned int [usertype] *branch arch/arm64/net/bpf_jit_comp.c:1683:16: sparse: got restricted __le32 [usertype] * >> arch/arm64/net/bpf_jit_comp.c:1699:52: sparse: sparse: subtraction of different types can't work (different base types) >> arch/arm64/net/bpf_jit_comp.c:1733:29: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] * @@ got restricted __le32 [usertype] * @@ arch/arm64/net/bpf_jit_comp.c:1733:29: sparse: expected unsigned int [usertype] * arch/arm64/net/bpf_jit_comp.c:1733:29: sparse: got restricted __le32 [usertype] * arch/arm64/net/bpf_jit_comp.c:1917:52: sparse: sparse: subtraction of different types can't work (different base types) vim +1683 arch/arm64/net/bpf_jit_comp.c 1640 1641 static void invoke_bpf_prog(struct jit_ctx *ctx, struct bpf_tramp_link *l, 1642 int args_off, int retval_off, int run_ctx_off, 1643 bool save_ret) 1644 { 1645 u32 *branch; 1646 u64 enter_prog; 1647 u64 exit_prog; 1648 struct bpf_prog *p = l->link.prog; 1649 int cookie_off = offsetof(struct bpf_tramp_run_ctx, bpf_cookie); 1650 1651 if (p->aux->sleepable) { 1652 enter_prog = (u64)__bpf_prog_enter_sleepable; 1653 exit_prog = (u64)__bpf_prog_exit_sleepable; 1654 } else { 1655 enter_prog = (u64)__bpf_prog_enter; 1656 exit_prog = (u64)__bpf_prog_exit; 1657 } 1658 1659 if (l->cookie == 0) { 1660 /* if cookie is zero, one instruction is enough to store it */ 1661 emit(A64_STR64I(A64_ZR, A64_SP, run_ctx_off + cookie_off), ctx); 1662 } else { 1663 emit_a64_mov_i64(A64_R(10), l->cookie, ctx); 1664 emit(A64_STR64I(A64_R(10), A64_SP, run_ctx_off + cookie_off), 1665 ctx); 1666 } 1667 1668 /* save p to callee saved register x19 to avoid loading p with mov_i64 1669 * each time. 1670 */ 1671 emit_addr_mov_i64(A64_R(19), (const u64)p, ctx); 1672 1673 /* arg1: prog */ 1674 emit(A64_MOV(1, A64_R(0), A64_R(19)), ctx); 1675 /* arg2: &run_ctx */ 1676 emit(A64_ADD_I(1, A64_R(1), A64_SP, run_ctx_off), ctx); 1677 1678 emit_call(enter_prog, ctx); 1679 1680 /* if (__bpf_prog_enter(prog) == 0) 1681 * goto skip_exec_of_prog; 1682 */ > 1683 branch = ctx->image + ctx->idx; 1684 emit(A64_NOP, ctx); 1685 1686 /* save return value to callee saved register x20 */ 1687 emit(A64_MOV(1, A64_R(20), A64_R(0)), ctx); 1688 1689 emit(A64_ADD_I(1, A64_R(0), A64_SP, args_off), ctx); 1690 if (!p->jited) 1691 emit_addr_mov_i64(A64_R(1), (const u64)p->insnsi, ctx); 1692 1693 emit_call((const u64)p->bpf_func, ctx); 1694 1695 if (save_ret) 1696 emit(A64_STR64I(A64_R(0), A64_SP, retval_off), ctx); 1697 1698 if (ctx->image) { > 1699 int offset = &ctx->image[ctx->idx] - branch; 1700 *branch = A64_CBZ(1, A64_R(0), offset); 1701 } 1702 1703 /* arg1: prog */ 1704 emit(A64_MOV(1, A64_R(0), A64_R(19)), ctx); 1705 /* arg2: start time */ 1706 emit(A64_MOV(1, A64_R(1), A64_R(20)), ctx); 1707 /* arg3: &run_ctx */ 1708 emit(A64_ADD_I(1, A64_R(2), A64_SP, run_ctx_off), ctx); 1709 1710 emit_call(exit_prog, ctx); 1711 } 1712 1713 static void invoke_bpf_mod_ret(struct jit_ctx *ctx, struct bpf_tramp_links *tl, 1714 int args_off, int retval_off, int run_ctx_off, 1715 u32 **branches) 1716 { 1717 int i; 1718 1719 /* The first fmod_ret program will receive a garbage return value. 1720 * Set this to 0 to avoid confusing the program. 1721 */ 1722 emit(A64_STR64I(A64_ZR, A64_SP, retval_off), ctx); 1723 for (i = 0; i < tl->nr_links; i++) { 1724 invoke_bpf_prog(ctx, tl->links[i], args_off, retval_off, 1725 run_ctx_off, true); 1726 /* if (*(u64 *)(sp + retval_off) != 0) 1727 * goto do_fexit; 1728 */ 1729 emit(A64_LDR64I(A64_R(10), A64_SP, retval_off), ctx); 1730 /* Save the location of branch, and generate a nop. 1731 * This nop will be replaced with a cbnz later. 1732 */ > 1733 branches[i] = ctx->image + ctx->idx; 1734 emit(A64_NOP, ctx); 1735 } 1736 } 1737 -- 0-DAY CI Kernel Test Service https://01.org/lkp