Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3539030rwa; Tue, 23 Aug 2022 06:25:00 -0700 (PDT) X-Google-Smtp-Source: AA6agR7+x228/cOiq9XChPrDwlXH9OGPMsBU6b6PqsvFR8gg3LRnotoZem8GGjNRtG2+BVBMqntH X-Received: by 2002:a17:90b:4f45:b0:1f5:6554:d555 with SMTP id pj5-20020a17090b4f4500b001f56554d555mr3345862pjb.226.1661261100480; Tue, 23 Aug 2022 06:25:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661261100; cv=none; d=google.com; s=arc-20160816; b=kg1xZ/EVPm17t+XJRR2QwqamHWbYRuxouWxwJ/xc1/XSI7MmXHQSlPKGwdDMvifQGs TXrTVv3HQ4Qn8fVUDiNY5cOra+7xQPcf6MC3rgvOC1pVh47ThVSu7d8D/N7fdzszjuWB suE2Z8sMEtSnT+UXsqck3LwKWm4Bji8TC2KhnHvtLoM08C+HDlYGKeXQvy38xU4K4HGO gbrXs/ne5cSNc5JUT+2JN24zlx11IJtxBpYYeaBrT0ob6vrBiDAL2S1OGYFcJJZsH0oE m+aGw4/6iUsBti490hp0NqbE5XrP0Ea/lQ7aWK7iMOykHFBhmwVyTqzQDYys/2RebVJH lgKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SbbW5tPe1YG+vVkAWxXwM++h0GvfFvTVZ2C6Jy7/IPg=; b=mLSmtlz3e1uWlp550ZQSAtIbbI90HGaTCgBeOi4dsgTYogGwxaMmrZWtWkhPQ3UHEF T5vJSIop9WsGFTNytKPBll6+YRoDIPn87JIXuu6rDRqbZCUeXexCicYH4ZAGY1j/r8FO FR6K8ffjNZsFopAYVEUqTaWM6wxPiOKBj0M9JMfRaculEzbb42x1kv/+8F1D0OA8It4E kfI8btRfq7s89jPkKcsxSzxysgVPavNB5HbYjA4h5yZIDUC9sqRCnKrsbDB/T9Cw+E2V WxFMbO4qJTE7a1xUBiIs5QLMk1H9x+VBMCC5iMznSJm3NJTqh+Trsphg8/nZC8Y3CwBb A3xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=naTaMCDl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j190-20020a6380c7000000b0041e17e03f26si15369129pgd.37.2022.08.23.06.24.49; Tue, 23 Aug 2022 06:25:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=naTaMCDl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242021AbiHWNVg (ORCPT + 99 others); Tue, 23 Aug 2022 09:21:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236311AbiHWNVO (ORCPT ); Tue, 23 Aug 2022 09:21:14 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92CDD80EA9 for ; Tue, 23 Aug 2022 03:20:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661250004; x=1692786004; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rIBijWYDCuJCpKPJprGFsO7FPm8DX5/N35/ZVITEqGo=; b=naTaMCDliVO427M3E3jDiZ/uqaqyTSw0/IPE2CaosVPgq4I56XW/gmfO OnUVqvNaTjxp5YSgx5TAHiNhMcpl/2SDVw0mN3zDS4zK0ZwTMbTnJnfhA rIXdxW0MAMUNbfRWZSt2vhN4L3KhszgpC8ExWjnzuLDBPiEdpHBGK0qFr 0vDdfCrh2B0wdZey0brkWQP/h29z2LWV9tCPwrhQtlx8zgEknOxEDvSdW 6r13BRqLocwi99iCntQwaIDp6eF3C6vmYqKDuSBc2utIqkyVdHwT0wxiu tbkmSAitvWsN0YAaaeetIkUY8wKPGKq+iG9z81bbFLgsVW6Pw5wxx6LT0 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10447"; a="319692020" X-IronPort-AV: E=Sophos;i="5.93,257,1654585200"; d="scan'208";a="319692020" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Aug 2022 03:18:28 -0700 X-IronPort-AV: E=Sophos;i="5.93,257,1654585200"; d="scan'208";a="751640019" Received: from jabish-mobl2.amr.corp.intel.com (HELO paris.amr.corp.intel.com) ([10.254.9.209]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Aug 2022 03:18:23 -0700 From: Gwan-gyeong Mun To: intel-gfx@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, mchehab@kernel.org, chris@chris-wilson.co.uk, matthew.auld@intel.com, thomas.hellstrom@linux.intel.com, jani.nikula@intel.com, nirmoy.das@intel.com, airlied@linux.ie, daniel@ffwll.ch, andi.shyti@linux.intel.com, andrzej.hajda@intel.com, keescook@chromium.org, mauro.chehab@linux.intel.com, intel-gfx-trybot@lists.freedesktop.org Subject: [PATCH v8 8/8] drm/i915: Remove truncation warning for large objects Date: Tue, 23 Aug 2022 19:17:29 +0900 Message-Id: <20220823101729.2098841-9-gwan-gyeong.mun@intel.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220823101729.2098841-1-gwan-gyeong.mun@intel.com> References: <20220823101729.2098841-1-gwan-gyeong.mun@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham 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 From: Chris Wilson Having addressed the issues surrounding incorrect types for local variables and potential integer truncation in using the scatterlist API, we have closed all the loop holes we had previously identified with dangerously large object creation. As such, we can eliminate the warning put in place to remind us to complete the review. Signed-off-by: Chris Wilson Signed-off-by: Gwan-gyeong Mun Cc: Tvrtko Ursulin Cc: Brian Welty Cc: Matthew Auld Cc: Thomas Hellström Testcase: igt@gem_create@create-massive Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4991 Reviewed-by: Nirmoy Das Reviewed-by: Mauro Carvalho Chehab Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/i915/gem/i915_gem_object.h | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.h b/drivers/gpu/drm/i915/gem/i915_gem_object.h index 0cf31adbfd41..dd2762da332f 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_object.h +++ b/drivers/gpu/drm/i915/gem/i915_gem_object.h @@ -20,25 +20,10 @@ enum intel_region_id; -/* - * XXX: There is a prevalence of the assumption that we fit the - * object's page count inside a 32bit _signed_ variable. Let's document - * this and catch if we ever need to fix it. In the meantime, if you do - * spot such a local variable, please consider fixing! - * - * We can check for invalidly typed locals with typecheck(), see for example - * i915_gem_object_get_sg(). - */ -#define GEM_CHECK_SIZE_OVERFLOW(sz) \ - GEM_WARN_ON((sz) >> PAGE_SHIFT > INT_MAX) - static inline bool i915_gem_object_size_2big(u64 size) { struct drm_i915_gem_object *obj; - if (GEM_CHECK_SIZE_OVERFLOW(size)) - return true; - if (overflows_type(size, obj->base.size)) return true; -- 2.37.1