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 498E3C5ACB3 for ; Tue, 21 Nov 2023 10:45:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D0DCB6B044B; Tue, 21 Nov 2023 05:45:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CBDBD6B044D; Tue, 21 Nov 2023 05:45:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B85BF6B044F; Tue, 21 Nov 2023 05:45:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id A96B76B044B for ; Tue, 21 Nov 2023 05:45:29 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 8737CB595E for ; Tue, 21 Nov 2023 10:45:29 +0000 (UTC) X-FDA: 81481629978.05.C237E3A Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by imf22.hostedemail.com (Postfix) with ESMTP id 70F23C001D for ; Tue, 21 Nov 2023 10:45:27 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=atNWnSTQ; spf=pass (imf22.hostedemail.com: domain of lkp@intel.com designates 192.55.52.88 as permitted sender) smtp.mailfrom=lkp@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1700563527; 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=dHcZukrHuKLvOVAFznquEry0N2JP/GPUqhWGcQurvoU=; b=riRRrIjAMMyqpUpHaIBS9Hy1LkS5SBa6U6mFASqTk6XQXzDVSYE97/SnS48lGcTDQopaz2 DhseZChrZexRHD+beg4hbb4I4+ow4Qql7GCsAzeTgbam6LiIC9HQSeAkXxik34Hy0OuEt0 GbHt00YWkWq4/u4JwkhvE8MkeBJE/A4= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=atNWnSTQ; spf=pass (imf22.hostedemail.com: domain of lkp@intel.com designates 192.55.52.88 as permitted sender) smtp.mailfrom=lkp@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1700563527; a=rsa-sha256; cv=none; b=DkY/lHaXB7QWl1544TYzkEWTT3f534WiY/ADAOwXBAAjWWS158BggaT1pR7QObEmirFVcU xLf9jX0uDV4KRUbcdGiOAxqCdUujteYCWJWeZC1GKw1ZDFrBfDTMmWx8mFMJhaFvpD5aFi U8FQa7zj0D7hjHHzSZzScS5PGrCOg/A= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700563527; x=1732099527; h=date:from:to:cc:subject:message-id:mime-version; bh=eFBpddGv1YUBB4p+Zo2wKvDVv7VPa2MQqoF+y4msopM=; b=atNWnSTQMKve8zZEDRdmrRo5w209kBQ0GTs0ij1A2f3qPX2CFmVfGV1q kPaWFl5sYntei74W2RNopASU4jnkNtyJTw2gBOD3VjPXkzR5svdOSGU31 J01PfnFQsfMQgGRUWlAcm8HeaNAdBElVLtHWgT5Kv+Eaq86qxRLch7dyf JALjETTf+0u5198FbqXnMO9z5fWJ5V/K/0zdubR9/2y2waFTgA4x2tL4n iM8xXZvf27d0P+cxS1x2IFzCQlkl+Yu1dP83wN3gFRotjUiS0QEklEPR0 oWhSJ/1e8FAEivy6Qw6itLGIon7yGcDcp6vBlJ9CqsvSWMu/Lhxf+EJMX w==; X-IronPort-AV: E=McAfee;i="6600,9927,10900"; a="422910530" X-IronPort-AV: E=Sophos;i="6.04,215,1695711600"; d="scan'208";a="422910530" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2023 02:45:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10900"; a="1013875302" X-IronPort-AV: E=Sophos;i="6.04,215,1695711600"; d="scan'208";a="1013875302" Received: from lkp-server02.sh.intel.com (HELO b8de5498638e) ([10.239.97.151]) by fmsmga006.fm.intel.com with ESMTP; 21 Nov 2023 02:45:24 -0800 Received: from kbuild by b8de5498638e with local (Exim 4.96) (envelope-from ) id 1r5OFZ-0007hX-0X; Tue, 21 Nov 2023 10:45:08 +0000 Date: Tue, 21 Nov 2023 18:44:26 +0800 From: kernel test robot To: Nick Terrell Cc: oe-kbuild-all@lists.linux.dev, Linux Memory Management List Subject: [linux-next:master 2144/2217] lib/zstd/compress/zstd_fast.c:726:28: sparse: sparse: Using plain integer as NULL pointer Message-ID: <202311211842.VCv1S0IX-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Rspamd-Queue-Id: 70F23C001D X-Rspam-User: X-Stat-Signature: oakm8zg8g8kw3gjdgiwbdy5dmsg8idyp X-Rspamd-Server: rspam01 X-HE-Tag: 1700563527-494337 X-HE-Meta: U2FsdGVkX18p8Q/SX6xmeTPaha8a6Rf0FZCVX/vSn+7J+NDY0lD9pML1VWxB1OZd7c61DK3ovddRfb1X/u8CLUAdnB1VpNAuseKyxui9E049LwFUWNuQzgrc1+LvX6ZBa6pOpOza+G9FDMmfGxOMfUaACdKMU/pv4udDJeTdmDfb5HfY0B5m/OWyU9Hlf6rO0p5AoEnR5hcVEW8+5QeonGE46UcALoPv22bsrKfY7J4o8KvOj/k+wj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Mzdf/g7LDlG8e 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: List-Subscribe: List-Unsubscribe: tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 07b677953b9dca02928be323e2db853511305fa9 commit: 98988fc8e9edc4da5825b3dd5544880c210a8738 [2144/2217] zstd: import upstream v1.5.5 config: x86_64-randconfig-r122-20231121 (https://download.01.org/0day-ci/archive/20231121/202311211842.VCv1S0IX-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/20231121/202311211842.VCv1S0IX-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 | Closes: https://lore.kernel.org/oe-kbuild-all/202311211842.VCv1S0IX-lkp@intel.com/ sparse warnings: (new ones prefixed by >>) >> lib/zstd/compress/zstd_fast.c:726:28: sparse: sparse: Using plain integer as NULL pointer vim +726 lib/zstd/compress/zstd_fast.c 683 684 685 static size_t ZSTD_compressBlock_fast_extDict_generic( 686 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], 687 void const* src, size_t srcSize, U32 const mls, U32 const hasStep) 688 { 689 const ZSTD_compressionParameters* const cParams = &ms->cParams; 690 U32* const hashTable = ms->hashTable; 691 U32 const hlog = cParams->hashLog; 692 /* support stepSize of 0 */ 693 size_t const stepSize = cParams->targetLength + !(cParams->targetLength) + 1; 694 const BYTE* const base = ms->window.base; 695 const BYTE* const dictBase = ms->window.dictBase; 696 const BYTE* const istart = (const BYTE*)src; 697 const BYTE* anchor = istart; 698 const U32 endIndex = (U32)((size_t)(istart - base) + srcSize); 699 const U32 lowLimit = ZSTD_getLowestMatchIndex(ms, endIndex, cParams->windowLog); 700 const U32 dictStartIndex = lowLimit; 701 const BYTE* const dictStart = dictBase + dictStartIndex; 702 const U32 dictLimit = ms->window.dictLimit; 703 const U32 prefixStartIndex = dictLimit < lowLimit ? lowLimit : dictLimit; 704 const BYTE* const prefixStart = base + prefixStartIndex; 705 const BYTE* const dictEnd = dictBase + prefixStartIndex; 706 const BYTE* const iend = istart + srcSize; 707 const BYTE* const ilimit = iend - 8; 708 U32 offset_1=rep[0], offset_2=rep[1]; 709 U32 offsetSaved1 = 0, offsetSaved2 = 0; 710 711 const BYTE* ip0 = istart; 712 const BYTE* ip1; 713 const BYTE* ip2; 714 const BYTE* ip3; 715 U32 current0; 716 717 718 size_t hash0; /* hash for ip0 */ 719 size_t hash1; /* hash for ip1 */ 720 U32 idx; /* match idx for ip0 */ 721 const BYTE* idxBase; /* base pointer for idx */ 722 723 U32 offcode; 724 const BYTE* match0; 725 size_t mLength; > 726 const BYTE* matchEnd = 0; /* initialize to avoid warning, assert != 0 later */ 727 728 size_t step; 729 const BYTE* nextStep; 730 const size_t kStepIncr = (1 << (kSearchStrength - 1)); 731 732 (void)hasStep; /* not currently specialized on whether it's accelerated */ 733 734 DEBUGLOG(5, "ZSTD_compressBlock_fast_extDict_generic (offset_1=%u)", offset_1); 735 736 /* switch to "regular" variant if extDict is invalidated due to maxDistance */ 737 if (prefixStartIndex == dictStartIndex) 738 return ZSTD_compressBlock_fast(ms, seqStore, rep, src, srcSize); 739 740 { U32 const curr = (U32)(ip0 - base); 741 U32 const maxRep = curr - dictStartIndex; 742 if (offset_2 >= maxRep) offsetSaved2 = offset_2, offset_2 = 0; 743 if (offset_1 >= maxRep) offsetSaved1 = offset_1, offset_1 = 0; 744 } 745 746 /* start each op */ 747 _start: /* Requires: ip0 */ 748 749 step = stepSize; 750 nextStep = ip0 + kStepIncr; 751 752 /* calculate positions, ip0 - anchor == 0, so we skip step calc */ 753 ip1 = ip0 + 1; 754 ip2 = ip0 + step; 755 ip3 = ip2 + 1; 756 757 if (ip3 >= ilimit) { 758 goto _cleanup; 759 } 760 761 hash0 = ZSTD_hashPtr(ip0, hlog, mls); 762 hash1 = ZSTD_hashPtr(ip1, hlog, mls); 763 764 idx = hashTable[hash0]; 765 idxBase = idx < prefixStartIndex ? dictBase : base; 766 767 do { 768 { /* load repcode match for ip[2] */ 769 U32 const current2 = (U32)(ip2 - base); 770 U32 const repIndex = current2 - offset_1; 771 const BYTE* const repBase = repIndex < prefixStartIndex ? dictBase : base; 772 U32 rval; 773 if ( ((U32)(prefixStartIndex - repIndex) >= 4) /* intentional underflow */ 774 & (offset_1 > 0) ) { 775 rval = MEM_read32(repBase + repIndex); 776 } else { 777 rval = MEM_read32(ip2) ^ 1; /* guaranteed to not match. */ 778 } 779 780 /* write back hash table entry */ 781 current0 = (U32)(ip0 - base); 782 hashTable[hash0] = current0; 783 784 /* check repcode at ip[2] */ 785 if (MEM_read32(ip2) == rval) { 786 ip0 = ip2; 787 match0 = repBase + repIndex; 788 matchEnd = repIndex < prefixStartIndex ? dictEnd : iend; 789 assert((match0 != prefixStart) & (match0 != dictStart)); 790 mLength = ip0[-1] == match0[-1]; 791 ip0 -= mLength; 792 match0 -= mLength; 793 offcode = REPCODE1_TO_OFFBASE; 794 mLength += 4; 795 goto _match; 796 } } 797 798 { /* load match for ip[0] */ 799 U32 const mval = idx >= dictStartIndex ? 800 MEM_read32(idxBase + idx) : 801 MEM_read32(ip0) ^ 1; /* guaranteed not to match */ 802 803 /* check match at ip[0] */ 804 if (MEM_read32(ip0) == mval) { 805 /* found a match! */ 806 goto _offset; 807 } } 808 809 /* lookup ip[1] */ 810 idx = hashTable[hash1]; 811 idxBase = idx < prefixStartIndex ? dictBase : base; 812 813 /* hash ip[2] */ 814 hash0 = hash1; 815 hash1 = ZSTD_hashPtr(ip2, hlog, mls); 816 817 /* advance to next positions */ 818 ip0 = ip1; 819 ip1 = ip2; 820 ip2 = ip3; 821 822 /* write back hash table entry */ 823 current0 = (U32)(ip0 - base); 824 hashTable[hash0] = current0; 825 826 { /* load match for ip[0] */ 827 U32 const mval = idx >= dictStartIndex ? 828 MEM_read32(idxBase + idx) : 829 MEM_read32(ip0) ^ 1; /* guaranteed not to match */ 830 831 /* check match at ip[0] */ 832 if (MEM_read32(ip0) == mval) { 833 /* found a match! */ 834 goto _offset; 835 } } 836 837 /* lookup ip[1] */ 838 idx = hashTable[hash1]; 839 idxBase = idx < prefixStartIndex ? dictBase : base; 840 841 /* hash ip[2] */ 842 hash0 = hash1; 843 hash1 = ZSTD_hashPtr(ip2, hlog, mls); 844 845 /* advance to next positions */ 846 ip0 = ip1; 847 ip1 = ip2; 848 ip2 = ip0 + step; 849 ip3 = ip1 + step; 850 851 /* calculate step */ 852 if (ip2 >= nextStep) { 853 step++; 854 PREFETCH_L1(ip1 + 64); 855 PREFETCH_L1(ip1 + 128); 856 nextStep += kStepIncr; 857 } 858 } while (ip3 < ilimit); 859 860 _cleanup: 861 /* Note that there are probably still a couple positions we could search. 862 * However, it seems to be a meaningful performance hit to try to search 863 * them. So let's not. */ 864 865 /* If offset_1 started invalid (offsetSaved1 != 0) and became valid (offset_1 != 0), 866 * rotate saved offsets. See comment in ZSTD_compressBlock_fast_noDict for more context. */ 867 offsetSaved2 = ((offsetSaved1 != 0) && (offset_1 != 0)) ? offsetSaved1 : offsetSaved2; 868 869 /* save reps for next block */ 870 rep[0] = offset_1 ? offset_1 : offsetSaved1; 871 rep[1] = offset_2 ? offset_2 : offsetSaved2; 872 873 /* Return the last literals size */ 874 return (size_t)(iend - anchor); 875 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki