Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp378252rwe; Wed, 24 Aug 2022 02:33:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR4k3zFaiD1EBpZpLFnXjKePAO0QyMb19phwrFk6bK1spjZ69x/+LhFMMI/R7nlZc/W6A7Ra X-Received: by 2002:a17:907:3ea3:b0:73d:71b5:1120 with SMTP id hs35-20020a1709073ea300b0073d71b51120mr2356571ejc.34.1661333630162; Wed, 24 Aug 2022 02:33:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661333630; cv=none; d=google.com; s=arc-20160816; b=T3Pbw0yUwgR2RAYu1FSxsPpJl4nZUoyQgVZLXk9KYZY+tl+A4Pbn47lvBi2OikWQ1D KwXInFXPySx08EN5VFC3ppsXay7jgabpuNzJcXVsHLGb0E//HLk9S6nMnr9+wJPl6Eev jIKlXKKWbUegYNSaKD2mlrnlGvnCIgxCsaUXAB0r9Z1LT/Nb7oE1xQ4gQDFapneiPJxn miBxXzwHI3WtMX8/vsAoqtJOd3+i6G5O73r8n3tjNcQxawa1NhLu9v4xWUDNWt+hefQu tY/RK4ESZyZF9tTgW9jKYks0GLXSyD93cC+xiGpDauREFwBGsdkbugXSwGChGBrn29h2 QGoQ== 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=vKpBzg1RSrXDY1SYZv73/lw3KgXSBvuWGFxBmL2xvUc9NrNTB2vUabRUJy+tL9z+XP ZG307JlXange3n55CXaYZEOCK8i2fZiiqMJuCxKFY7mizPt1YLyASXZxYxCy/HsYLjhs jt8/1jjRcYijgkX02aFWHoetEqHOgyOKmS/1rGrpNIfmJqsL/CWwh2avtSDVwumcTzhE 4RUMK+CpMoBmgk77UxUbEcDhzk8wPTZL8BcPfeYAVbsqzjvD3e9YfzDmArQFRcWdvIzP E4cYb4jF+CcSkcQXvQtnvGPg0v5N1U0D6XATvQQFMQf/ccTdKebpZvhT4nyBXwXh4Z2s JEEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=iy911PyX; 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 ia7-20020a170907a06700b0073d9a2c69d6si1458534ejc.847.2022.08.24.02.33.24; Wed, 24 Aug 2022 02:33:50 -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=iy911PyX; 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 S236049AbiHXIr7 (ORCPT + 99 others); Wed, 24 Aug 2022 04:47:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236126AbiHXIp6 (ORCPT ); Wed, 24 Aug 2022 04:45:58 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA82772FE9 for ; Wed, 24 Aug 2022 01:45:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661330755; x=1692866755; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rIBijWYDCuJCpKPJprGFsO7FPm8DX5/N35/ZVITEqGo=; b=iy911PyXMISMCafGEqr2Op9uXaOpb7ohrL6EDLhA6Ssq5YCiPQkXOZGy cgtC09XYIRmltQpLuTUrwFFFKIErdss+zppdKCc3VUKPEpsSUwKSRWz5g hUVz7m9MF2Sp8krPb2GnhsA4PazUZAW4uuXQaVDIEL/A6h6xmYoJG3wmg /zS4xJOsM+fQGy4PDDbW+LDwv3JoAF1A93c72yyLj/WBFxKYWqZnjcDZR bgPG4NBJwHobvwmBpq+TWH9iCO+SAX2h4FvtvEwr3voSWoNhpKIioXPCJ km9St1ZlepWi3w+RmKnobcaA0RemHJpn/7tSkiVHJPwRtEg/ejddEjKqu Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10448"; a="357882564" X-IronPort-AV: E=Sophos;i="5.93,260,1654585200"; d="scan'208";a="357882564" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Aug 2022 01:45:55 -0700 X-IronPort-AV: E=Sophos;i="5.93,260,1654585200"; d="scan'208";a="785554080" Received: from yuhsuanc-mobl.gar.corp.intel.com (HELO paris.amr.corp.intel.com) ([10.254.38.238]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Aug 2022 01:45:52 -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 v9 8/8] drm/i915: Remove truncation warning for large objects Date: Wed, 24 Aug 2022 17:45:14 +0900 Message-Id: <20220824084514.2261614-9-gwan-gyeong.mun@intel.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220824084514.2261614-1-gwan-gyeong.mun@intel.com> References: <20220824084514.2261614-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,URIBL_BLOCKED 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