From patchwork Mon Feb 26 12:46:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 206612 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2048579dyb; Mon, 26 Feb 2024 04:48:14 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV1ve2COZN0KiJGUP+TSbr4Yr9fGtXrU7BKpybsGmttXuYyj//dcDgQTEfzm1JWdgUWj5GfAlCaPLqjrPcYp9HOkABNZw== X-Google-Smtp-Source: AGHT+IFirNTw45Df9FfcHvoFGaW6Orj42Lio8XRpQ2v6dnclYks8BlLT0CJvxVChjzjfKbj3ed1/ X-Received: by 2002:a17:906:fb07:b0:a43:4876:983b with SMTP id lz7-20020a170906fb0700b00a434876983bmr1897927ejb.57.1708951693801; Mon, 26 Feb 2024 04:48:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708951693; cv=pass; d=google.com; s=arc-20160816; b=uW1fTek+aW/VbTIpo34ieDCUALC4mcALMaKB/jToYOLZUcn0yAoKEiAQfWfyYVAjJf ZUXQBh+A4tMt3/vx/PKI8KiwUtQgBPTeJ7XHBs3cfRytK9JmLmCwKXFNh4YxZzETwdjN crcooRfrP6uTP4z85275TBzARpPGtfTE9lAWNCsQGpoVJAW+PAGmOOhPM1AL6Ux0rwJ6 TbgstM7ilDcfaK9Of9ou7D5ikz4Sgm8aGdANXUJ/RzFvl98v9mIEyRPSwgPgwUCT/KAJ mKu1OW0lDPJGElmVjDBS15gpeIZPbPlkOXaTc56tF7LL9kAeVkWpTQjdo17SiHAx6LyT 51cQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=iD3v2Ou7opydLf7BV2zQNv5Q6avksFmwr21fP3d+Tu8=; fh=f8i86EdiQTzDTREZDCLliK+apaxdqTjVfw1axe/nDog=; b=t3c5NVQWNBAnVXZ8HYPNfEsnYAPjncj+7bPhhwahAbEARc02Fzfd+SsI1DHLJmhXRc 02XDhUiBDoDJh2tjZfY84m3vRTGdHdJCSOg4bMxRL0G05Vp+yKNChVbKvUWoJLOid5a4 ss6/O6JQwC7b9jaqSx4e3SK8roojJGCJ285WlJE2dZnJHE/yBILVcbCwZmeloqmh4lTK M+xd956vFOLCbp1pkWYcCDpmMtcql5QEnfkMgwt6LzbXnXjIOmPdPNZLUaxoBbCtA5s9 NQ5nWCtUmp24x5qUvKgE6whisskzXkwaGt8WmAaYwqQy8n8yVqjAGS5pt6vvXSAJqnMs M7/w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FYqHb7pj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-81405-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81405-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id dp18-20020a170906c15200b00a42f340eba9si1956248ejc.472.2024.02.26.04.48.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 04:48:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81405-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FYqHb7pj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-81405-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81405-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 6DC7A1F245E4 for ; Mon, 26 Feb 2024 12:48:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CE36D8063A; Mon, 26 Feb 2024 12:47:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FYqHb7pj" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C468604D4 for ; Mon, 26 Feb 2024 12:47:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708951664; cv=none; b=mI+EZq0Iko+mkndVDSoZQVJP5ioUeKyrTav+rnXAHZ+XC+i/xdSXwgn7nE9ka7gAgbu9h76QZQG6nCYOyUQny3LqO/jOLRboUwTWEPuVWeisJsQi0hK/uBSjHMuAtkv4ZOknbxNyQSllRMz5Lm6SyhX1JIaamqScgbwnPyMhV5A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708951664; c=relaxed/simple; bh=vPnudlAxEBtSwaSh16NplVrq2SvEXPSzaOEsHkk1YQc=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=mWotCCamXp9X8CXrHWneJfGbSQAjMLcAKs0RFBSQUApGyLvugdZDmuJyeA4DSHTeDMtDbrl322ygSwXRdN6CWsyqhTJpr4oqQ9YUFfyOXblT/6i/QX0mTbtRykefO77PooZt7eSa5B1XiKOZlGUFh6jDS/SzJb8cAKnhEqJJ2AE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FYqHb7pj; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7236EC433C7; Mon, 26 Feb 2024 12:47:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708951663; bh=vPnudlAxEBtSwaSh16NplVrq2SvEXPSzaOEsHkk1YQc=; h=From:To:Cc:Subject:Date:From; b=FYqHb7pjQYLZRQcpUsUksBUteFXpvb15TA3fQeT3qftscQBkT/quRXHxaBoDeIZK/ OHn7d7D0euJdnIYvpn8QsSgcGMOgThM0dfJKN1CsdkG9G0bzYJkpNraiDWziCSkgaW zGh4Kx1eVSqy2ZXI0YrpKu3sXdtn2lfpfixfieFK/MZWgDYZT+dMfAdA9m1yi1UOiW fXbq3nlo9J+G7J81H5P8n2Yy/+Kxbym8cwD//m2h3qFI7C3hcgky8XB6ZN02yY7b4i Wd9aKoGJYKdN729IMDTUYV65OV2Mdp0SYGBNZ9ggOKbyptFCiY7OViVw4HJe7M+aO8 Lo7b2hwIQuOMw== From: Arnd Bergmann To: Lucas De Marchi , Oded Gabbay , =?utf-8?q?Thomas_Hellstr=C3=B6m?= Cc: Arnd Bergmann , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Rodrigo Vivi , Matthew Brost , Jani Nikula , Matt Roper , intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] [v2] drm/xe/kunit: fix link failure with built-in xe Date: Mon, 26 Feb 2024 13:46:36 +0100 Message-Id: <20240226124736.1272949-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791965730829931839 X-GMAIL-MSGID: 1791965730829931839 From: Arnd Bergmann When the driver is built-in but the tests are in loadable modules, the helpers don't actually get put into the driver: ERROR: modpost: "xe_kunit_helper_alloc_xe_device" [drivers/gpu/drm/xe/tests/xe_test.ko] undefined! Change the Makefile to ensure they are always part of the driver even when the rest of the kunit tests are in loadable modules. Fixes: 5095d13d758b ("drm/xe/kunit: Define helper functions to allocate fake xe device") Signed-off-by: Arnd Bergmann Reviewed-by: Lucas De Marchi --- v2: don't remove KUNIT dependency --- drivers/gpu/drm/xe/Kconfig | 1 + drivers/gpu/drm/xe/Kconfig.debug | 1 - drivers/gpu/drm/xe/Makefile | 6 ++++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/xe/Kconfig b/drivers/gpu/drm/xe/Kconfig index 6d4428b19a4c..c3a3b204ae5b 100644 --- a/drivers/gpu/drm/xe/Kconfig +++ b/drivers/gpu/drm/xe/Kconfig @@ -11,6 +11,7 @@ config DRM_XE select DRM_BUDDY select DRM_EXEC select DRM_KMS_HELPER + select DRM_KUNIT_TEST_HELPERS if DRM_XE_KUNIT_TEST != n select DRM_PANEL select DRM_SUBALLOC_HELPER select DRM_DISPLAY_DP_HELPER diff --git a/drivers/gpu/drm/xe/Kconfig.debug b/drivers/gpu/drm/xe/Kconfig.debug index 549065f57a78..df02e5d17d26 100644 --- a/drivers/gpu/drm/xe/Kconfig.debug +++ b/drivers/gpu/drm/xe/Kconfig.debug @@ -76,7 +76,6 @@ config DRM_XE_KUNIT_TEST depends on DRM_XE && KUNIT && DEBUG_FS default KUNIT_ALL_TESTS select DRM_EXPORT_FOR_TESTS if m - select DRM_KUNIT_TEST_HELPERS help Choose this option to allow the driver to perform selftests under the kunit framework diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile index 4c6ffe4b2172..b596e4482a9b 100644 --- a/drivers/gpu/drm/xe/Makefile +++ b/drivers/gpu/drm/xe/Makefile @@ -158,8 +158,10 @@ xe-$(CONFIG_PCI_IOV) += \ xe_lmtt_2l.o \ xe_lmtt_ml.o -xe-$(CONFIG_DRM_XE_KUNIT_TEST) += \ - tests/xe_kunit_helpers.o +# include helpers for tests even when XE is built-in +ifdef CONFIG_DRM_XE_KUNIT_TEST +xe-y += tests/xe_kunit_helpers.o +endif # i915 Display compat #defines and #includes subdir-ccflags-$(CONFIG_DRM_XE_DISPLAY) += \ From patchwork Mon Feb 26 12:46:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 206613 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2048739dyb; Mon, 26 Feb 2024 04:48:37 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXonQH6uNwXje2f4TbJgVGNT3RkgXnguVI0PvXhd3aruMAaZtIeafN3sTI0FTLunYqURr0jsHBx9d0CIQocMzXx1VX9ew== X-Google-Smtp-Source: AGHT+IE6EA1Wr3z10nsDT6vMN3prGuiczuHR64nLUbkdAUdde47q2ex7kDpKZKwJZqZYbJS+bW8n X-Received: by 2002:a05:6214:202c:b0:690:690:ce84 with SMTP id 12-20020a056214202c00b006900690ce84mr4152238qvf.6.1708951717560; Mon, 26 Feb 2024 04:48:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708951717; cv=pass; d=google.com; s=arc-20160816; b=GUkeOCWY/uCMR/+RDBXyaZuzrx943agGlmo6OnrJjq1iXGwazk/HvgqBGlY17Iv5C8 Kg7Ks6faXMUx0jfJP6TBJkYcRFDawDl+ycAbvF2XmVQjwjE+ZmEmHPciQ+ySogL2r0/t QmPgROZhMFUBrx3b4QjlDf59D3bL6dTqYHtsIW4O8RCWjkSdKMed3gKSN7PUGHv9ZQ/E AlldVh3Vs/vt2zEXsvG5YRiGirhEUPioNOJVTsUrM+BBGVbnm3bdUP8cF/v7+OMgHUhF Uw/MzoKbEUtoG+j5TB4wZjjW+6gg1A+BymQ4jRSh2vr9qq/7hZhD+P2lrVRdq6IWwQM+ UKNA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=hnkGjdrLayinTjSFm+iK8mnpfmKmHIi84NKh3rBIhbs=; fh=DqK3/oIS1/k2eHjBxY23c3ZbhLUW/1pWCRydn1TZwZc=; b=b+wMn5G07aHz2QpvZsLBNYsimHMDWoxpclcz1Z3iOGmD7R2h1f/2e27DY39aasbnbJ 2xWGD2nn8HKP27JuKNGzW4XFLGrlBzv2UFQ/YCaoTEu2/D/WZZY0b0YA6sWfaTqnKuYw lvy5QyPzy6rBlS75RMjGSz1EjyLxrkK+ugUuWZD6e0U3cVgVHXEkOl2q0iIHJ0GHtkle 6oEcnoB6vDub2xERO7mL28FMwNlo59N1KjPAD1gib1bcSg87thQirNWa8wKg4QSPDy+T XTz7rDmdpt9H5kKI+YDcC2/HRXbirf1czBHMfh7KvEQetDw1Q0GvNQWTk8lZp9XmaSpz z0Fw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Bq8V8bu+; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-81406-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81406-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id iv14-20020ad45cee000000b0068f973111ddsi5094265qvb.572.2024.02.26.04.48.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 04:48:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81406-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Bq8V8bu+; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-81406-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81406-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 5D3601C238E0 for ; Mon, 26 Feb 2024 12:48:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DD6787FBDF; Mon, 26 Feb 2024 12:48:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Bq8V8bu+" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3FA89EC7; Mon, 26 Feb 2024 12:48:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708951700; cv=none; b=tcu0ilXoIQ2jLg6I0LOsTXOaehD9yAEeQMRen/JzVOgdVfMuek1Djvi9QqNkkxvddE6hNPtmjGhrnmFHpiB3uomZtHVFM3Q0ODgaKHG2tukDiUrcpSm8JPA8Tfpl/FHmDDoCbEjQfTK0n4aoSS7gr247tHpbRFs/eNYhIvQX9o0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708951700; c=relaxed/simple; bh=nwHarD6e/noK0RLpyMyg49ecLqGeQ0DNCXP39VJcJnU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=VMpDgaGtCjOt6YmNCOE1b4ur/Q/TS9SEKDsUFSojHU5+2yETA2EA92wGQVbsufu+oepad+JbbdqWm18lSnVFXyd7I5Osf/9oJzHCTVhaxTjgtxrNYtuWFTVCOH8tHtodHfa7Swo0p/kl/4SzkjtQcf6Qr/lkiDtB4GOSBm66BeI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Bq8V8bu+; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87566C433F1; Mon, 26 Feb 2024 12:48:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708951699; bh=nwHarD6e/noK0RLpyMyg49ecLqGeQ0DNCXP39VJcJnU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bq8V8bu+AnNPQ618fedRUM7MYXae1yTLy649cK81/fffiV4+DdQr+B6CwBXjv1QA/ 9XwitYZerkPdzT5oQ/BMnkEy4pIshL73oouNzyIJoPfQp9+cQuhHNB3RpERuh9m4fH E9M8scMGqCESeLu8Ph8VEitEHpGBWF+T8lMDqXAWow9kDmXkSJ2EMmuDiOL61oW5ak 8GXdCtwNHiGHcJIJA6zt7gf/AdcrTa9iQtsvwNLiQU3QsjS7Nq5smBFZwrq9/k7ZvA uB0u6Yts0KZNO9gSsCmBl/IqxfViSV3BHGkV+4r+G1t7huI2eVrHUs+49XbtkKfIzY CjL4rZQN+bcqg== From: Arnd Bergmann To: Lucas De Marchi , Oded Gabbay , =?utf-8?q?Thomas_Hellstr=C3=B6m?= Cc: Arnd Bergmann , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Rodrigo Vivi , Matt Roper , Matthew Auld , Matthew Brost , intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH 2/3] [v2] drm/xe/mmio: fix build warning for BAR resize on 32-bit Date: Mon, 26 Feb 2024 13:46:37 +0100 Message-Id: <20240226124736.1272949-2-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240226124736.1272949-1-arnd@kernel.org> References: <20240226124736.1272949-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791965756214638705 X-GMAIL-MSGID: 1791965756214638705 From: Arnd Bergmann clang complains about a nonsensical test on builds with a 32-bit phys_addr_t, which means resizing will always fail: drivers/gpu/drm/xe/xe_mmio.c:109:23: error: result of comparison of constant 4294967296 with expression of type 'resource_size_t' (aka 'unsigned int') is always false [-Werror,-Wtautological-constant-out-of-range-compare] 109 | root_res->start > 0x100000000ull) | ~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~ Previously, BAR resize was always disallowed on 32-bit kernels, but this apparently changed recently. Since 32-bit machines can in theory support PAE/LPAE for large address spaces, this may end up useful, so change the driver to shut up the warning but still work when phys_addr_t/resource_size_t is 64 bit wide. Fixes: 9a6e6c14bfde ("drm/xe/mmio: Use non-atomic writeq/readq variant for 32b") Fixes: 237412e45390 ("drm/xe: Enable 32bits build") Signed-off-by: Arnd Bergmann Reviewed-by: Lucas De Marchi --- v2: use correct Fixes tag --- drivers/gpu/drm/xe/xe_mmio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/xe/xe_mmio.c b/drivers/gpu/drm/xe/xe_mmio.c index e3db3a178760..7ba2477452d7 100644 --- a/drivers/gpu/drm/xe/xe_mmio.c +++ b/drivers/gpu/drm/xe/xe_mmio.c @@ -106,7 +106,7 @@ static void xe_resize_vram_bar(struct xe_device *xe) pci_bus_for_each_resource(root, root_res, i) { if (root_res && root_res->flags & (IORESOURCE_MEM | IORESOURCE_MEM_64) && - root_res->start > 0x100000000ull) + (u64)root_res->start > 0x100000000ul) break; } From patchwork Mon Feb 26 12:46:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 206624 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2070762dyb; Mon, 26 Feb 2024 05:22:42 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXi8FpQgIA2Fevhd8YnGrae9PMMtZwvPGlzdOjE12ej0TTpSbAl8lS1AqawCfKKW8nSnai27+QyRfupIfWr8mCv/Zh0Qw== X-Google-Smtp-Source: AGHT+IGGwGIIplGxMHNtWQvSA1scqIItp/+8T38NAcAxxHukoERStpWmGbjE3OOQc92l31dKEU4r X-Received: by 2002:a05:6358:7f87:b0:17b:c8d:f396 with SMTP id c7-20020a0563587f8700b0017b0c8df396mr10088563rwo.29.1708953762670; Mon, 26 Feb 2024 05:22:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708953762; cv=pass; d=google.com; s=arc-20160816; b=GsgB7ku15bqFx0tF4/SWx9dk3fJvcXhFzZPIR3FPBw3POhDx8Nk6XEdnDS3z7XJjv0 3eHUXxLmeUE/g3hoVXDIkMdSku+uNp/K+3tTC5BPNpUUCJCzy6P5j277dp5QFmUuU31h UxZqXMZBS04ZpK3adH6/5sVXGaLnQnbCY8mBaETyqfkiL64K13xH+WN5ysp0ofiqfzHK eG210LkrAZ0Nvs4svwhlcjHWpKFzVjrgXFUITx+r3opkTnC5K24VZBI83SOyUwUD1oH1 mA7Y/ykSaaR6jgOPVgOvRjedD9GdJ70o7nyf+5g13gXtKza+9G6kA1dso0muVEpOwpE1 sRlw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=17ahSFh/eKpmcygEqatVZh4Si+jTpsfUHm1LJ3Q2WxE=; fh=3AVzhxMHlCDYUvMlVTBT8zggu3rBxTju+/hqxuBNucA=; b=is7Drpk94qKDMubZYq4IXAffCrx7+er3NdB0vQhmKvviomvFnCLxgCeDt9uk6y1OO+ spWiYNhJ4U5paxnGJV7/PK5ozozCx49EiFYcJS45hQu7pbeG0hwI57F/aipGOV41mVmZ gAPcfjnAnU5b3Qe6iuuLPAa9vSnS64EEiLjA0xAbGQm+fcesItcD3KPjYU3tyNxqKoiy BjFSedVd9Rc/KbjtHe7XrtAn/IJgGNpt4bO/htupztUXPb3ZteNxC2wB1zZR2Gc14w9c FnhiBKA1UxZlMgUqXTi0/uj6KXQ/pygk4APnLi/e3XTELliJl7fZCicBauSvleKnP0aE x9+A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="j5gwv/oL"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-81409-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81409-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id f19-20020a635553000000b005d9252c9d05si3718890pgm.103.2024.02.26.05.22.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 05:22:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81409-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="j5gwv/oL"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-81409-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81409-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id E5F46B2BB00 for ; Mon, 26 Feb 2024 12:49:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EC30E83A01; Mon, 26 Feb 2024 12:48:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="j5gwv/oL" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 53F06EC7 for ; Mon, 26 Feb 2024 12:48:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708951734; cv=none; b=FXiyO5tFg5b/LQTLiphCILcsByvTta7ETIoBbcdWohEbkxg9AzMlylkxqpG/ZL6oMrHHITyvegmOx3ofbdlfIz5WuqlPkqP2NS7m3YQ5bZTOwRhAJjZNrTnciwgLwWOiErmoiZK3iQh7PUkI9hrqHdVj0rus92+fvevrUE6mkDk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708951734; c=relaxed/simple; bh=Q3NH181a85YRTFivknWhvRlGzUVX6ut6yEVQtESkJik=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=omZEzyZRPO5y37Q3VlK2MIqXk7bypSvwVOXjfLmOsRIztJajxcFO6RcnJEcoYNiD6BNDFDJqPJ08CP/ChaiT3NPJBIqXfcMy2CDU2LSMslp4mYEQW91NjfMsIMGXomAui+o0LGzzN4mLDK8t5NilNbeuE8JpupvAidA020yzUyg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=j5gwv/oL; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD553C43390; Mon, 26 Feb 2024 12:48:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708951734; bh=Q3NH181a85YRTFivknWhvRlGzUVX6ut6yEVQtESkJik=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j5gwv/oLxGBvshYM4XJsakKQspn+4PiYoY+JB8H+VNY+uM3lMbovSewvvS7qT4pPq NSpcoaLyasTfkJ9GZE0Ekv0zTg4XXDqtbcUNwIa2GVPeWQe70PVIrWjdD6hzUaCMKg hG24PwowVape7egBViKaXaknYe26QfBheDfrpqGdB6IE4W81shxhUm6pSrLgtDMM9C +RDgNYsJh8GwsjSI8kboes7lAMcB+jJH7zl70rs8XL+f6J+pgewKs/puDY8dj2mX3U 5h1Khj5tIT8dSvdkzBje5gz/b6PPaTcopUTRzqdEVRU6BHxqN8SfcOcS0G42nq+oWN 54jKq5HRKHgiw== From: Arnd Bergmann To: Lucas De Marchi , Oded Gabbay , =?utf-8?q?Thomas_Hellstr=C3=B6m?= Cc: Arnd Bergmann , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Rodrigo Vivi , Matt Roper , Matthew Brost , intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] [v2] drm/xe/xe2: fix 64-bit division in pte_update_size Date: Mon, 26 Feb 2024 13:46:38 +0100 Message-Id: <20240226124736.1272949-3-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240226124736.1272949-1-arnd@kernel.org> References: <20240226124736.1272949-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791967900701023284 X-GMAIL-MSGID: 1791967900701023284 From: Arnd Bergmann This function does not build on 32-bit targets when the compiler fails to reduce DIV_ROUND_UP() into a shift: ld.lld: error: undefined symbol: __aeabi_uldivmod >>> referenced by xe_migrate.c >>> drivers/gpu/drm/xe/xe_migrate.o:(pte_update_size) in archive vmlinux.a There are two instances in this function. Change the first to use an open-coded shift with the same behavior, and the second one to a 32-bit calculation, which is sufficient here as the size is never more than 2^32 pages (16TB). Fixes: 237412e45390 ("drm/xe: Enable 32bits build") Signed-off-by: Arnd Bergmann Reviewed-by: Lucas De Marchi --- v2: use correct Fixes tag --- drivers/gpu/drm/xe/xe_migrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c index a66fdf2d2991..ee1bb938c493 100644 --- a/drivers/gpu/drm/xe/xe_migrate.c +++ b/drivers/gpu/drm/xe/xe_migrate.c @@ -462,7 +462,7 @@ static u32 pte_update_size(struct xe_migrate *m, } else { /* Clip L0 to available size */ u64 size = min(*L0, (u64)avail_pts * SZ_2M); - u64 num_4k_pages = DIV_ROUND_UP(size, XE_PAGE_SIZE); + u32 num_4k_pages = (size + XE_PAGE_SIZE - 1) >> XE_PTE_SHIFT; *L0 = size; *L0_ofs = xe_migrate_vm_addr(pt_ofs, 0);