Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3474301rwb; Tue, 16 Aug 2022 03:51:18 -0700 (PDT) X-Google-Smtp-Source: AA6agR4uqrLcG7axCw7LlfmmaeXuGJzhDIUObDRBdpzyGqs22cQJZmrJeA/cR6kBvW9gFVdJCScB X-Received: by 2002:a65:44c1:0:b0:428:ab8f:62dd with SMTP id g1-20020a6544c1000000b00428ab8f62ddmr8611185pgs.211.1660647078658; Tue, 16 Aug 2022 03:51:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660647078; cv=none; d=google.com; s=arc-20160816; b=j06IatKAnoP0+GsYBVFBU4edJaVjcChzmoc+yCqQCx+wFeG7BXi7Uto3GufbEGWLI/ 0Q/06XaXOx5z0H9MLOV6/j0ix8404aAZ22iTo4QXjnkJEaJSJ+zTMcX2jGL1dob9C6C0 bY1ulTWRJGseytHbcoI+XPo6oUUEUPJQRxTSY10a0sFWlucJbGaPpyDE89B7b7yXsXJF XfmiUYOCC7T5blYNSaI6A5A54T9+zfzTf6nHsT1zOP1fdWuL6Sg68xlFARU+LZFCO1wW u29L2BeAk5iflmfA5uYPjN2E1hAPhcRdFMvzRya0QBZ2t9ZJKXyViE089LN1yfRZcZSH xLnA== 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=oCFZjWnvuNgFS7kh82ZywL7ZD5ocEjH3DWnJhgyRVzR/WdYG+HY1HKwK1o95WVvyy5 EkzWZSeZKmuVnU/kHPAK76eQuXs47n8cl5Fav8aH9Do9EaA+nAUQSW7ZK5rHaoV2HjYK P9U9yWO/00fsq0Iv7XQEhKLsI2+49HvQkDzq2OuNdhJ63ysHfKbOK6ORFfgEAmHtrqgG LxzZ4RptTx4J3RpurovIW2D0eax6qC7VnjX61/TAPWjx0B55FibtN72VpRt7lZoPQDLB yzYXXPPJ8Dtq1hXr4kBrrWx+vfsdM1TSqHi6dBCQg1vk5vnGGtlzSoWOsSUs8s6ZrMB+ mDIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YNHY30dU; 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 2-20020a630202000000b0042971e401e3si4910280pgc.307.2022.08.16.03.51.08; Tue, 16 Aug 2022 03:51:18 -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=YNHY30dU; 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 S233659AbiHPKNS (ORCPT + 99 others); Tue, 16 Aug 2022 06:13:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234337AbiHPKMu (ORCPT ); Tue, 16 Aug 2022 06:12:50 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9A5ECCE29 for ; Tue, 16 Aug 2022 02:37:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660642673; x=1692178673; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rIBijWYDCuJCpKPJprGFsO7FPm8DX5/N35/ZVITEqGo=; b=YNHY30dUFVzXwIllLOL8P2PZINdO9+grO0Mv16gMZfRN+yaVG5psAm/P hvR5h8TD3CRIpWdp17L52sNxOMLwFSUKhOM5BdTTYSNGq/jqDYtsrLQfy 1vujU7vbpYEzcNcpHiDZy9ft7BD6c6fz4weU/uNTlV/UW4LU1Np3BYE8g 8NlSt89T+kcJbJZM38Py914kjL06HqgLj1pV2kGcM1PLBdC4+5lcv9UOz rIia+eEPKNERYGHHquevYA3Nahv91NVXeYgdKnVT2dwGg245j5xbsA/GG opnrRzmeyyhRRy/6E8ur7GOW/3VskBN3ypdDm0aGbVHyVDnap6iCIPtx/ Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10440"; a="293446855" X-IronPort-AV: E=Sophos;i="5.93,240,1654585200"; d="scan'208";a="293446855" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Aug 2022 02:36:06 -0700 X-IronPort-AV: E=Sophos;i="5.93,240,1654585200"; d="scan'208";a="733231104" Received: from clbarnes-mobl.amr.corp.intel.com (HELO paris.amr.corp.intel.com) ([10.254.7.166]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Aug 2022 02:36:03 -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 Subject: [PATCH v7 8/8] drm/i915: Remove truncation warning for large objects Date: Tue, 16 Aug 2022 18:35:25 +0900 Message-Id: <20220816093525.184940-9-gwan-gyeong.mun@intel.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220816093525.184940-1-gwan-gyeong.mun@intel.com> References: <20220816093525.184940-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=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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