Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1716541ioo; Mon, 23 May 2022 01:19:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqzzWGceTSrJVghehRLs4WVqk1Z25Cr3rQMyvAxn+9ZOQSFPZsCudrIQA9ItzzG5I9cdJM X-Received: by 2002:a17:902:e9d3:b0:161:aa01:b956 with SMTP id 19-20020a170902e9d300b00161aa01b956mr21862179plk.110.1653293955574; Mon, 23 May 2022 01:19:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653293955; cv=none; d=google.com; s=arc-20160816; b=i9ZY4Q3wIoVJ+izyr6U0pngagdw5m3Wua768AmCIQFkWJraTWOEMZuzpOn3tc9AO4K KDUmTH33ui8VChRJyBM9Udtgl9IWi/OO4I0TFf6dTjfhLm5EZv+pf8uUGWxwXUP2pglR Ju/JFAgUZPhk2PWghpM+dRgoMRanzeqzw4DNwP3RLaxUOXiEqnRr3ai22URnEZenRIAT FJ/8w0mwwEWIKdS8zAYC8R3b8ldqO3rjkb8fWzorukzeSPm/CsF9BT8rEL2PVCJE6Xph CeCu8eZJV2vIauKH3OyxHXUmq6d6gX0zyw7oZZkFE1EeSRNrY5hkoY3Qa065+ECgpjP/ K4kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=SO4tR58i6red7fHOY7z0a95JNofcHU5pbvUg5sGpIbY=; b=mADxKy48EFVMp5fjv57J/uMqv4KZDNUDOJW2tro57VTL3hd71LBJ1E5JAT7Eo49vZA xMIJ8ancxUHk0LmBipE6+9axDJPXUkVsz49lkThxfHMUTM+Vp32ErNnj6Zz4po8xXaq8 wQwqK+t3wRUtRDgrI2h3SN3u13mHa1IH/8OQnVqfigsDebhSD96AJFa8QAopXI+uuxCb EIs6Is9F8ZpH909iCqsgcJC4oITJ0vg6qM0cWRA8TArme9DavaJMEF0oKOxeXScrGAZ/ FziJAwPk2mMAgh5OdmSWgS7WY05uJmKU/rS+mVc2SY2JHhi9mXE3b58mmSTJbsQ0HYa5 MfLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eTF9rk4H; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id q16-20020a17090311d000b0015bfd115dcesi8543457plh.455.2022.05.23.01.19.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 01:19:15 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eTF9rk4H; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D0E04473A3; Mon, 23 May 2022 00:22:50 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344904AbiEVMa0 (ORCPT + 99 others); Sun, 22 May 2022 08:30:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238812AbiEVMaZ (ORCPT ); Sun, 22 May 2022 08:30:25 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5381F3CA6A for ; Sun, 22 May 2022 05:30:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653222624; x=1684758624; h=date:from:to:cc:subject:message-id:mime-version; bh=yl6oCepAkkyMdyLVyBENcfFzAAEHfF1+hGSnyy1z5Is=; b=eTF9rk4HUX0lxrHhSt6kZ/G7dMmDKQh+2EcDg8vwQjaPMAdMAztlq2e5 XDI1uGBaMM/8EspXwgfYvFjLMDrmrQIf8NgUg5FeSEyGWvj8Ue3El09oz bEpwiSCRtCQhmUj4iuyuPbSfvBLIt7YZdndHhmjmB6VPxFYIs5JL+UoxS EcSJNg1S3/BKoDdnPkJPWX5nDBvXSaDHRrqyGIQydBdd23L6G+kxSzHXT dccRTt8rH2rJVzORK/746pNIuHz3Uks07jlYlT6ZNaRNRdQ3KR/5OcdaJ zhYxn2WLWAnw5NaibtofM2uLTxBAlUUf2B/BcBXZC7yuW2P94wKM73Gbj Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10354"; a="273113710" X-IronPort-AV: E=Sophos;i="5.91,244,1647327600"; d="scan'208";a="273113710" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 May 2022 05:30:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,244,1647327600"; d="scan'208";a="702544936" Received: from lkp-server01.sh.intel.com (HELO db63a1be7222) ([10.239.97.150]) by orsmga004.jf.intel.com with ESMTP; 22 May 2022 05:30:22 -0700 Received: from kbuild by db63a1be7222 with local (Exim 4.95) (envelope-from ) id 1nskiz-0000M3-JI; Sun, 22 May 2022 12:30:21 +0000 Date: Sun, 22 May 2022 20:30:15 +0800 From: kernel test robot To: Toke =?iso-8859-1?Q?H=F8iland-J=F8rgensen?= Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org, Daniel Borkmann Subject: kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression Message-ID: <202205222029.xpW3PM1y-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: eaea45fc0e7b6ae439526b4a41d91230c8517336 commit: 782347b6bcad07ddb574422e01e22c92e05928c8 xdp: Add proper __rcu annotations to redirect map entries date: 11 months ago config: ia64-randconfig-s031-20220522 (https://download.01.org/0day-ci/archive/20220522/202205222029.xpW3PM1y-lkp@intel.com/config) compiler: ia64-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-dirty # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=782347b6bcad07ddb574422e01e22c92e05928c8 git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git git fetch --no-tags linus master git checkout 782347b6bcad07ddb574422e01e22c92e05928c8 # 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=ia64 SHELL=/bin/bash kernel/bpf/ If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot sparse warnings: (new ones prefixed by >>) kernel/bpf/devmap.c:561:29: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct bpf_dtab_netdev *dst @@ got struct bpf_dtab_netdev [noderef] __rcu * @@ kernel/bpf/devmap.c:561:29: sparse: expected struct bpf_dtab_netdev *dst kernel/bpf/devmap.c:561:29: sparse: got struct bpf_dtab_netdev [noderef] __rcu * kernel/bpf/devmap.c:657:29: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct bpf_dtab_netdev *dst @@ got struct bpf_dtab_netdev [noderef] __rcu * @@ kernel/bpf/devmap.c:657:29: sparse: expected struct bpf_dtab_netdev *dst kernel/bpf/devmap.c:657:29: sparse: got struct bpf_dtab_netdev [noderef] __rcu * >> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression >> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression >> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression >> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression >> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression >> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression >> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression >> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression >> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression >> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression >> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression >> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression >> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression >> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression >> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression >> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression >> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression >> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression >> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression >> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression >> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression >> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression >> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression >> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression >> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression >> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression >> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression >> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression vim +/__rcu +1030 kernel/bpf/devmap.c 990 991 static int dev_map_notification(struct notifier_block *notifier, 992 ulong event, void *ptr) 993 { 994 struct net_device *netdev = netdev_notifier_info_to_dev(ptr); 995 struct bpf_dtab *dtab; 996 int i, cpu; 997 998 switch (event) { 999 case NETDEV_REGISTER: 1000 if (!netdev->netdev_ops->ndo_xdp_xmit || netdev->xdp_bulkq) 1001 break; 1002 1003 /* will be freed in free_netdev() */ 1004 netdev->xdp_bulkq = alloc_percpu(struct xdp_dev_bulk_queue); 1005 if (!netdev->xdp_bulkq) 1006 return NOTIFY_BAD; 1007 1008 for_each_possible_cpu(cpu) 1009 per_cpu_ptr(netdev->xdp_bulkq, cpu)->dev = netdev; 1010 break; 1011 case NETDEV_UNREGISTER: 1012 /* This rcu_read_lock/unlock pair is needed because 1013 * dev_map_list is an RCU list AND to ensure a delete 1014 * operation does not free a netdev_map entry while we 1015 * are comparing it against the netdev being unregistered. 1016 */ 1017 rcu_read_lock(); 1018 list_for_each_entry_rcu(dtab, &dev_map_list, list) { 1019 if (dtab->map.map_type == BPF_MAP_TYPE_DEVMAP_HASH) { 1020 dev_map_hash_remove_netdev(dtab, netdev); 1021 continue; 1022 } 1023 1024 for (i = 0; i < dtab->map.max_entries; i++) { 1025 struct bpf_dtab_netdev *dev, *odev; 1026 1027 dev = rcu_dereference(dtab->netdev_map[i]); 1028 if (!dev || netdev != dev->dev) 1029 continue; > 1030 odev = unrcu_pointer(cmpxchg(&dtab->netdev_map[i], RCU_INITIALIZER(dev), NULL)); 1031 if (dev == odev) 1032 call_rcu(&dev->rcu, 1033 __dev_map_entry_free); 1034 } 1035 } 1036 rcu_read_unlock(); 1037 break; 1038 default: 1039 break; 1040 } 1041 return NOTIFY_OK; 1042 } 1043 -- 0-DAY CI Kernel Test Service https://01.org/lkp