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 56944C3DA63 for ; Tue, 23 Jul 2024 19:25:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D050F6B0098; Tue, 23 Jul 2024 15:25:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C66FE6B0099; Tue, 23 Jul 2024 15:25:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B089F6B009A; Tue, 23 Jul 2024 15:25:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 8E8906B0098 for ; Tue, 23 Jul 2024 15:25:48 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 109D3C03B9 for ; Tue, 23 Jul 2024 19:25:48 +0000 (UTC) X-FDA: 82371997176.25.9DBCCE1 Received: from mail-oa1-f51.google.com (mail-oa1-f51.google.com [209.85.160.51]) by imf22.hostedemail.com (Postfix) with ESMTP id 3C7CEC001C for ; Tue, 23 Jul 2024 19:25:46 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=linaro.org header.s=google header.b=kVh+8x1z; dmarc=pass (policy=none) header.from=linaro.org; spf=pass (imf22.hostedemail.com: domain of dan.carpenter@linaro.org designates 209.85.160.51 as permitted sender) smtp.mailfrom=dan.carpenter@linaro.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721762693; 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:in-reply-to:references:references:dkim-signature; bh=Pui+9x9FoZL7DPEwk7OsZErD91Sf56G6xXu9R9mUzZw=; b=UknrC3n37RWcDGdGsPUajppji4sx7vc3fuqu11wP6sl4Dy4c97NlDlGtlHi6fCzal1ZDbw 9b+Jm3b7un3cg28IonSeXua/EBoeIgKj7UzVN75VEJSgaY4pj4cWTlS98iPIzCXeg+gNKB K3ePp9oxTrTXfxsmJosPQuEpTHKarZs= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721762693; a=rsa-sha256; cv=none; b=LbHvooRlgQoddgbrZF5AR5kMqZ20PS1lJUC2JP2SxAVteLKFt+cuFKWCUgSwh2NZ9FEoX1 LUUxVmlqcGXxt6/62i1PgyHPlSgp5eARzHPXBONxdno+jsLT7k1erNUoEI3X03hClO5g1i pq1621oivAYy+lZAX7m1VxYuK3YCn2w= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=linaro.org header.s=google header.b=kVh+8x1z; dmarc=pass (policy=none) header.from=linaro.org; spf=pass (imf22.hostedemail.com: domain of dan.carpenter@linaro.org designates 209.85.160.51 as permitted sender) smtp.mailfrom=dan.carpenter@linaro.org Received: by mail-oa1-f51.google.com with SMTP id 586e51a60fabf-260e8c98cc2so3108091fac.0 for ; Tue, 23 Jul 2024 12:25:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721762745; x=1722367545; darn=kvack.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Pui+9x9FoZL7DPEwk7OsZErD91Sf56G6xXu9R9mUzZw=; b=kVh+8x1z+E1gxbVIRdksMEFv0geuwzOWf5LPlgpxjeOQD+Bdov5nLbTF8m00x10uH4 GTovV1XpC6pQ3yI5iRnnWnDPSe1/UFO+QblpY3ZtT96DLRpOkelRg1Z6K6PfqT9drI4o 6QdGQLz6GVmUYb95s4Eo5M63Z5gCDy/eZ2PRYJKvgL96DhwA7NGEDOhSkZmyZ39GVdLU VHMp2ORH0rCucnsHVjRWV39NcY/7s+McrWBB6vcgPwEhRQ0oZlHjolLTVYvEqqYfc/cq 40Gtx9a7efVSFrlk3BuxFgueVQM5jnvRvyz7/mIB8cbHKc17JKU0UiABDBespC+U4MBn 63hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721762745; x=1722367545; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Pui+9x9FoZL7DPEwk7OsZErD91Sf56G6xXu9R9mUzZw=; b=hR8nAOdFea7ls0A3RTGe01v8Pszz+EJ3tPw8K2beABexQWrO6OhpbPxZPPWU6cULNN hz71AwLbmhSckUgf/gdStQVcjRoBNIg+Q/oR1ABS0Kbz5ic+vAHiNhfWw05FfUBNyPpX fFuTCajgwux4ogjunERD+/YDJlfco5KKmk/Z51pT6y5wVNS4rhep4g6TY5pboYOfujug /pA5QWA5MnRH+UID4VS1JFSg8mfgRdNduQs5r6oC3sSXCL5qE7mXsNcR0iV1xRXGuVHR IErXBIyzSX9kY8tZ/RKCthKHnFU4PkispF6KU+i5m7JlBY1USMCpu19lFRJElMF2Tkb3 kCPQ== X-Forwarded-Encrypted: i=1; AJvYcCVg9KUdOqtPtKXrDJ/ARKCRT0J37C9184fv0LPS5Kv8mcxgWDpR+K+4EOG7LKtvEEM2+l3mUehGmo9ffzfNUrYwwng= X-Gm-Message-State: AOJu0Yw7374I8iW4HpoCWlkk0fHbw6I/eIayXmerz+hr9wst6OMHCy9V H5VPBQ8CMd6Q39DgFWmVEmlDcAFwVjzuD//XMSccGv1Cf/gcr7cZbSK8/TOU32g= X-Google-Smtp-Source: AGHT+IFK35cPinVU5a7QDczHk9xYaa/R1+E1cVI6qxjtLLNfAtfgGOQT0RHMXouRLR5H17+aGJtHcg== X-Received: by 2002:a05:6870:8327:b0:261:1f7d:cf61 with SMTP id 586e51a60fabf-2638dee771dmr10166241fac.9.1721762745086; Tue, 23 Jul 2024 12:25:45 -0700 (PDT) Received: from localhost ([2603:8080:b800:f700:eca3:bb93:d28d:1005]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-2610c76c74asm2308306fac.19.2024.07.23.12.25.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jul 2024 12:25:44 -0700 (PDT) Date: Tue, 23 Jul 2024 14:25:42 -0500 From: Dan Carpenter To: Matthew Brost Cc: oe-kbuild@lists.linux.dev, lkp@intel.com, oe-kbuild-all@lists.linux.dev, Linux Memory Management List , Nirmoy Das Subject: Re: [linux-next:master 13298/13495] drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c:183 send_tlb_invalidation() warn: variable dereferenced before check 'fence' (see line 178) Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 3C7CEC001C X-Stat-Signature: k7x9zr444wr1uuaqsx7958jg5jg7yggn X-Rspam-User: X-HE-Tag: 1721762746-407408 X-HE-Meta: U2FsdGVkX1/JgH47BqQAdcrtmjnqh4eR/Ny0uRr4yNX3LJGF2kwVFOLwDvb5jK1RhAvYcbJfrkbcBXa9yFobMX9UQgZvl5MaYehOzY1xEzVmpyu/9PpCn+6lDaAkp02cSShb+Ia+u031xZZ1/Blyou/+BwlPK9rpdMWTs9Z2phyB2u+amueEEuENTvThC5mkpA7244aYsSEUUIzaMzbCQ76+gQOIuzx9BYFVW3ts6vyss+hVjuH9xW+jlXteOjDyVVigkuTi+OZXdEK8LouId47axp6SNCmGfPDDGPDqUyGIaIl1hhs/PXgC2HYyUqrd/gSJNyGdBu1ppkDVaAkYc/mQ5bALc2wzAKkEyz+KK9kaE+KpWY6DOu3usenGcshEeqRUhspZkV8UcXm8A6QZFnMv9l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nOxMM0SeZo7sunk7/N3+VoyIACdcS8Zq2WM= 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: On Tue, Jul 23, 2024 at 06:59:07PM +0000, Matthew Brost wrote: > On Tue, Jul 23, 2024 at 01:52:46PM -0500, Dan Carpenter wrote: > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master > > head: dee7f101b64219f512bb2f842227bd04c14efe30 > > commit: 61ac035361ae555ee5a17a7667fe96afdde3d59a [13298/13495] drm/xe: Drop xe_gt_tlb_invalidation_wait > > config: i386-randconfig-141-20240722 (https://download.01.org/0day-ci/archive/20240723/202407231049.esig0Fkb-lkp@intel.com/config) > > compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1) > > > > 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 > > | Reported-by: Dan Carpenter > > | Closes: https://lore.kernel.org/r/202407231049.esig0Fkb-lkp@intel.com/ > > > > New smatch warnings: > > drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c:183 send_tlb_invalidation() warn: variable dereferenced before check 'fence' (see line 178) > > > > vim +/fence +183 drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c > > > > fc108a8b759f52 Matthew Brost 2023-01-17 159 static int send_tlb_invalidation(struct xe_guc *guc, > > 332dd0116c82a7 Matthew Brost 2023-01-24 160 struct xe_gt_tlb_invalidation_fence *fence, > > 332dd0116c82a7 Matthew Brost 2023-01-24 161 u32 *action, int len) > > a9351846d94568 Matthew Brost 2023-01-17 162 { > > a9351846d94568 Matthew Brost 2023-01-17 163 struct xe_gt *gt = guc_to_gt(guc); > > 501c4255c40935 Radhakrishna Sripada 2024-06-07 164 struct xe_device *xe = gt_to_xe(gt); > > a9351846d94568 Matthew Brost 2023-01-17 165 int seqno; > > a9351846d94568 Matthew Brost 2023-01-17 166 int ret; > > a9351846d94568 Matthew Brost 2023-01-17 167 > > 61ac035361ae55 Matthew Brost 2024-07-19 168 xe_gt_assert(gt, fence); > > We assert the fence is not NULL here. It is invalid call with a NULL fence. > This assert just does a drm_WARN(). It doesn't call called BUG() or do anything that affects flow analysis. These type of asserts are deliberately ignored by Smatch. With Smatch, I generally try not to print warnings about inconsistent NULL checking when I know the extra checks are harmless. If you had cross function analysis enabled then possibly that would silence the warning. (This code is too new for me to have tested it on my own system yet so I can't be sure if Smatch parses the callers correctly). Unfortunately, cross function stuff doesn't scale well enough so we can't use it on in the kbuild bot. regards, dan carpenter