Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp27780605rwd; Tue, 4 Jul 2023 07:47:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6D6ryF8aZwfHg0I3UR+ad95+DyuaH7m4J8ETnLOT1KitPYd/UJ1Azfpin3gCvtDQnL1cA6 X-Received: by 2002:a05:6808:1b1e:b0:39e:bcdc:4bd7 with SMTP id bx30-20020a0568081b1e00b0039ebcdc4bd7mr14029989oib.24.1688482023659; Tue, 04 Jul 2023 07:47:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688482023; cv=none; d=google.com; s=arc-20160816; b=MHE1y9/59KatFEdoEBay+yWOdr3ynnY7UgeIRT1Yv1/9MbztKvlyhxWMoblMPvIep6 Ax0jWHYQxG6lCSgV5J+76sF/m5UJQkKW904nEEDs5AAru7fvB+S7Y179pV4ePSs4sLAQ rud68XFfIiZzHk0AyMGOk32tVtWdnJoLXYQ6BvS9d9IrQU4jZM0VQAMz79qmsGxcEjGE iV8v4IwMSN6J2Ceu2xan8Hr4hJrhTpsP21xF8azrYbMVOXesk0dWWvjEf6KBfBetbV6E G4SMV3oeJut2E3288RAo2AyEhQtqBhl2oGeXEnEwnxi0r+Q8k4J5UEHJg9BY8/Xy9tyY SSRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:subject:cc:to:from :date:references:in-reply-to:message-id:mime-version:user-agent :feedback-id:dkim-signature:dkim-signature; bh=aqNsrJHVCnGS5M3xoGiJRBSxbIqtfC2tngpdKmlsVZU=; fh=voWAzoFLoQ9WUd6RGNmf9xaoCFAt1UP34Vzy2Zr7zLg=; b=FQeRx2p4oFJUXlHD0tUoq/9p3Uo+8c4+VBMWNNJd0ytN7ZqZanGCBAUJnQnbppsxj8 7eL+7jHWzOOj3meQVQL5d8LGgQWGsgyd9MOGL0BXMi3gwt+K+gLaeDf0J0F2GlTjzOr7 J37wiHWy1oxO+sDk0NwUg6xtTpp3M+DDLDn+Ny0YPPwmlat4NGG9CcyEl8AQ81Ta8b11 wdUoeR/BL9iYHVh2gikVQ8G5VO37R/nvWTT48/d4CsaD153RUolFA+Y5o153X/DKp3mE tWeZ0yCNVxfiWlO2CkTLsokh8V4yceulpPkW9OSLOooDw+gcSKlxFXB+VNKVC00o4cBi 6SHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm2 header.b="RI/bfPN9"; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=BhdV1iWl; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k186-20020a6384c3000000b0055b6a7bee6csi9208114pgd.711.2023.07.04.07.46.47; Tue, 04 Jul 2023 07:47:03 -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=@arndb.de header.s=fm2 header.b="RI/bfPN9"; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=BhdV1iWl; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231417AbjGDOby (ORCPT + 99 others); Tue, 4 Jul 2023 10:31:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229647AbjGDObv (ORCPT ); Tue, 4 Jul 2023 10:31:51 -0400 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63CF6E47 for ; Tue, 4 Jul 2023 07:31:50 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 358AC5C022A; Tue, 4 Jul 2023 10:31:47 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Tue, 04 Jul 2023 10:31:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1688481107; x=1688567507; bh=aqNsrJHVCnGS5M3xoGiJRBSxbIqtfC2tngp dKmlsVZU=; b=RI/bfPN9cjPntRtrW/Dbhv9tP8VrrltI/MZdGagrm86vvoc0yef NROG9VgHWAWe8NcWA0/rNzns3UCg72E4fB1KVUpbDy5OXb8AEMYx2rTC59zR2ERz A+uaYnleg/oE9VVFjEBaX2szm5bvkYdnYZTQPYbhEi8f/E4IVGN75SBz82tAQkSs 7pisihqSoBEZsKqTVHzm3yXOrIDLpYElPq1outbbZ8JpbBMggoYg3nsA/aN0GEWB CR4qj9XPh6CbKSz3o9bg8YFBrZay3g871CZV8ZO0IRqtq3imdDxjLmtZgII+MxMi LaMa/jHTqZYh4cvXDdghsGnkFZtA6mppE9w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1688481107; x=1688567507; bh=aqNsrJHVCnGS5M3xoGiJRBSxbIqtfC2tngp dKmlsVZU=; b=BhdV1iWlRIff/+xmjml84Pc86sgHA5/c+T5LXLSssMgArI8+Icn 0Ae0+dk9C0Va5vfQ5+jOVeHh0qOmIVcJl6DWBRWNbBgSyTlMrPV578a6YSNnRaOl 72B+E3R+icS3raoq2yuuuwoYLf2Tu3/Vs2qU92ta7WZVt8Gb1t+GAqYf/PYoypfG Vx7VKIc91RCJsFJcRcptvsPSSOQ9+xIU4qRAm7fd0gtUVv3Iwc5f0zExjrlh2ulx J2DHGmtxjDRub9f5FyrNK8RLfcsKflgDFEtnMvfJ+JmRdcTVHKj3rYIBjbK0cT7D DDTHF7eDTuYmg4d6I180VCWH2hjlj7ShjpA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudeggdejjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgfgsehtqhertderreejnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepgeefjeehvdelvdffieejieejiedvvdfhleeivdelveehjeelteegudektdfg jeevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 525ACB60089; Tue, 4 Jul 2023 10:31:46 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-527-gee7b8d90aa-fm-20230629.001-gee7b8d90 Mime-Version: 1.0 Message-Id: <9b03246d-b46e-4b91-968a-e9ffc2fc26db@app.fastmail.com> In-Reply-To: References: <20230703123557.3355657-1-arnd@kernel.org> <788147c6-defd-496a-8174-1571b73d1a71@app.fastmail.com> Date: Tue, 04 Jul 2023 16:31:25 +0200 From: "Arnd Bergmann" To: =?UTF-8?Q?Christian_K=C3=B6nig?= , "Arnd Bergmann" , "Alex Deucher" , "Pan, Xinhui" , "Dave Airlie" , "Daniel Vetter" Cc: "Hawking Zhang" , "Lijo Lazar" , "Mario Limonciello" , "YiPeng Chai" , "Le Ma" , "Bokun Zhang" , "Srinivasan Shanmugam" , "Shiwu Zhang" , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/amdgpu: avoid integer overflow warning in amdgpu_device_resize_fb_bar() Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, 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 On Tue, Jul 4, 2023, at 14:33, Christian K=C3=B6nig wrote: > Am 04.07.23 um 14:24 schrieb Arnd Bergmann: >> On Tue, Jul 4, 2023, at 08:54, Christian K=C3=B6nig wrote: >>> Am 03.07.23 um 14:35 schrieb Arnd Bergmann: >> Not sure I understand the specific requirement. Do you mean the entire >> amdgpu driver requires 64-bit BAR addressing, or just the bits that >> resize the BARs? > > Well a bit of both. > > Modern AMD GPUs have 16GiB of local memory (VRAM), making those=20 > accessible to a CPU which can only handle 32bit addresses by resizing=20 > the BAR is impossible to begin with. > > But going a step further even without resizing it is pretty hard to ge= t=20 > that hardware working on such an architecture. I'd still like to understand this part better, as we have a lot of arm64 chips with somewhat flawed PCIe implementations, often with a tiny 64-bit memory space, but otherwise probably capable of using a GPU. What exactly do you expect to happen here? a) Use only part of the VRAM but otherwise work as expected b) Access all of the VRAM, but at a performance cost for bank switching? c) Require kernel changes to make a) or b) work, otherwise fail to load d) have no chance of working even with driver changes >>> It might be cleaner to just not build the whole driver on such syste= ms >>> or at least leave out this function. >> How about this version? This also addresses the build failure, but >> I don't know if this makes any sense: >> >> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c >> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c >> @@ -1325,6 +1325,9 @@ int amdgpu_device_resize_fb_bar(struct amdgpu_d= evice *adev) >> u16 cmd; >> int r; >> =20 >> + if (!IS_ENABLED(CONFIG_PHYS_ADDR_T_64BIT)) >> + return 0; >> + > > Yes, if that suppresses the warning as well then that makes perfect=20 > sense to me. Ok, I'll send that as a v2 then. Arnd