Message ID | 20230703123557.3355657-1-arnd@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp496030vqx; Mon, 3 Jul 2023 05:48:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6agv6cT5pLAmCZI3aTLZCESVTm+4oa2s7HRWdk74JBVeUV4VL7HoFYddrMktmVGATLa9X5 X-Received: by 2002:aca:e107:0:b0:39c:ecd4:8749 with SMTP id y7-20020acae107000000b0039cecd48749mr6094364oig.5.1688388533787; Mon, 03 Jul 2023 05:48:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688388533; cv=none; d=google.com; s=arc-20160816; b=qHopY19kjFXAEOjumvS2vUWfoM2YrW423RQ7c1IVVxi6DHX6Yq2vFL8yUn8kysn7ze vN1wkF2TMt45LxSIRglWlwImV/kgH1fs9piK3qLU//vYDDD5Ui2tf6FeO7WjEf5jFB10 rFrEhWyB0PKI56M9kEmgaTWLe0+b37B6+QANjTBA2HbN9ZEQYcu+YVwi5yV5T/qWCW24 8gedLwDFz0WEcvGupjZ34hqc/YwD+mRlYpZ5i8PQGm128zFgR+2r4RXDOMfnb9QtqBJS RejzfKFsVecedsKWhTgkjzC61tKl48gqgeG1SjHWpRlaI/3iLIdbpXFkjsnmTH72T2Vj +jPg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=gOgL0M50Rn0HpNfBR62ZTWphKQzIYBz9ZnWiJqQlucA=; fh=UrRYxSJQicISpMys9cciu8ikPh2P21sapDb91IitbL4=; b=f4b7Y9PY2OKt15GOf70Fxxsr5Xg9XqqufzKIRlRBUymMSkvm5wtUg4TkpbJ+VtBjkP VRZG9IAEhnMWIwu+/bdrymB+fhfVyDprY7L2rzoywFGrtPUdsAmMhy1Iyy9vZVScquAV J6XajqGPXeRw6usEnfpkbxj91HthlnP0wVfXW3U3cNfYMmZBgv5cnYo8e+qAwb7y9G7w L2lF2mnGCjZCEiA+NVpyYje7/CPAFXoVKsUxo1brdwC4hR1z5MNbRKjJP6/X6bLBXKGU QzrMSezMziNro/WP9KIO/fHE3M3m1Z5qVy8CNkvYbyE4YxacLVqM9vRXtR3UWz8ZzRUc 0WuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DZLcDDKv; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k184-20020a6324c1000000b00541710a9d44si18050645pgk.114.2023.07.03.05.48.38; Mon, 03 Jul 2023 05:48:53 -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=@kernel.org header.s=k20201202 header.b=DZLcDDKv; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230072AbjGCMgI (ORCPT <rfc822;ivan.orlov0322@gmail.com> + 99 others); Mon, 3 Jul 2023 08:36:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229656AbjGCMgG (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 3 Jul 2023 08:36:06 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0276D115 for <linux-kernel@vger.kernel.org>; Mon, 3 Jul 2023 05:36:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8A08A60F14 for <linux-kernel@vger.kernel.org>; Mon, 3 Jul 2023 12:36:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51115C433D9; Mon, 3 Jul 2023 12:36:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688387765; bh=8pRVnz7l/AWZY8R6a2pMc6+C9qMNZAMoJ59TR8NJIO0=; h=From:To:Cc:Subject:Date:From; b=DZLcDDKvSxSTlWD4URjmpKjyoA7HRwAyBFPaqyTHxpjhmm3nUChEjL5c73BbXSp33 QWU+n/0gPMEpL9fceFAujDyjMffuS1hzoQJsVI6j6ImASFy8SO0oSGq69uotxEhMCw ag4fpWtODUz+PLLJX+iZRIdjp0lph64ubJnFcNprRVbBcpQVLXrecePaqIlJmUPnfw kphGwx6UiNShSXEIjGtmuqJE45gnBCUlonNvSferCdcIOvHM3jSvheiwJ5nO8/WP9L OPC5FB3WoWvY9d4MpwPSA9qKv9YqPYDl5D7+yuF+9GeX9Alj0lZw2kAr/lF6dyPc2S S0J5j13mbhkmQ== From: Arnd Bergmann <arnd@kernel.org> To: Alex Deucher <alexander.deucher@amd.com>, =?utf-8?q?Christian_K=C3=B6nig?= <christian.koenig@amd.com>, "Pan, Xinhui" <Xinhui.Pan@amd.com>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch> Cc: Arnd Bergmann <arnd@arndb.de>, Hawking Zhang <Hawking.Zhang@amd.com>, Lijo Lazar <lijo.lazar@amd.com>, Mario Limonciello <mario.limonciello@amd.com>, YiPeng Chai <YiPeng.Chai@amd.com>, Le Ma <le.ma@amd.com>, Bokun Zhang <Bokun.Zhang@amd.com>, Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>, Shiwu Zhang <shiwu.zhang@amd.com>, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/amdgpu: avoid integer overflow warning in amdgpu_device_resize_fb_bar() Date: Mon, 3 Jul 2023 14:35:49 +0200 Message-Id: <20230703123557.3355657-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 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_PASS,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770403694855348428?= X-GMAIL-MSGID: =?utf-8?q?1770403694855348428?= |
Series |
drm/amdgpu: avoid integer overflow warning in amdgpu_device_resize_fb_bar()
|
|
Commit Message
Arnd Bergmann
July 3, 2023, 12:35 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de> On 32-bit architectures comparing a resource against a value larger than U32_MAX can cause a warning: drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1344:18: 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] res->start > 0x100000000ull) ~~~~~~~~~~ ^ ~~~~~~~~~~~~~~ The compiler is right that this cannot happen in this configuration, which is ok, so just add a cast to shut up the warning. Fixes: 31b8adab3247e ("drm/amdgpu: require a root bus window above 4GB for BAR resize") Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Am 03.07.23 um 14:35 schrieb Arnd Bergmann: > From: Arnd Bergmann <arnd@arndb.de> > > On 32-bit architectures comparing a resource against a value larger than > U32_MAX can cause a warning: > > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1344:18: 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] > res->start > 0x100000000ull) > ~~~~~~~~~~ ^ ~~~~~~~~~~~~~~ > > The compiler is right that this cannot happen in this configuration, which > is ok, so just add a cast to shut up the warning. Well it doesn't make sense to compile that driver on systems with only 32bit phys_addr_t in the first place. It might be cleaner to just not build the whole driver on such systems or at least leave out this function. Regards, Christian > > Fixes: 31b8adab3247e ("drm/amdgpu: require a root bus window above 4GB for BAR resize") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > index 7f069e1731fee..abd13942aac5d 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > @@ -1341,7 +1341,7 @@ int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev) > > pci_bus_for_each_resource(root, res, i) { > if (res && res->flags & (IORESOURCE_MEM | IORESOURCE_MEM_64) && > - res->start > 0x100000000ull) > + (u64)res->start > 0x100000000ull) > break; > } >
On Tue, Jul 4, 2023, at 08:54, Christian König wrote: > Am 03.07.23 um 14:35 schrieb Arnd Bergmann: >> From: Arnd Bergmann <arnd@arndb.de> >> >> On 32-bit architectures comparing a resource against a value larger than >> U32_MAX can cause a warning: >> >> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1344:18: 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] >> res->start > 0x100000000ull) >> ~~~~~~~~~~ ^ ~~~~~~~~~~~~~~ >> >> The compiler is right that this cannot happen in this configuration, which >> is ok, so just add a cast to shut up the warning. > > Well it doesn't make sense to compile that driver on systems with only > 32bit phys_addr_t in the first place. 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? > It might be cleaner to just not build the whole driver on such systems > 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_device *adev) u16 cmd; int r; + if (!IS_ENABLED(CONFIG_PHYS_ADDR_T_64BIT)) + return 0; + /* Bypass for VF */ if (amdgpu_sriov_vf(adev)) return 0; Arnd
Am 04.07.23 um 14:24 schrieb Arnd Bergmann: > On Tue, Jul 4, 2023, at 08:54, Christian König wrote: >> Am 03.07.23 um 14:35 schrieb Arnd Bergmann: >>> From: Arnd Bergmann <arnd@arndb.de> >>> >>> On 32-bit architectures comparing a resource against a value larger than >>> U32_MAX can cause a warning: >>> >>> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1344:18: 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] >>> res->start > 0x100000000ull) >>> ~~~~~~~~~~ ^ ~~~~~~~~~~~~~~ >>> >>> The compiler is right that this cannot happen in this configuration, which >>> is ok, so just add a cast to shut up the warning. >> Well it doesn't make sense to compile that driver on systems with only >> 32bit phys_addr_t in the first place. > 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 accessible to a CPU which can only handle 32bit addresses by resizing the BAR is impossible to begin with. But going a step further even without resizing it is pretty hard to get that hardware working on such an architecture. >> It might be cleaner to just not build the whole driver on such systems >> 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_device *adev) > u16 cmd; > int r; > > + if (!IS_ENABLED(CONFIG_PHYS_ADDR_T_64BIT)) > + return 0; > + Yes, if that suppresses the warning as well then that makes perfect sense to me. Regards, Christian. > /* Bypass for VF */ > if (amdgpu_sriov_vf(adev)) > return 0; > > Arnd
On Tue, Jul 4, 2023, at 14:33, Christian König wrote: > Am 04.07.23 um 14:24 schrieb Arnd Bergmann: >> On Tue, Jul 4, 2023, at 08:54, Christian König 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 > accessible to a CPU which can only handle 32bit addresses by resizing > the BAR is impossible to begin with. > > But going a step further even without resizing it is pretty hard to get > 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 systems >>> 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_device *adev) >> u16 cmd; >> int r; >> >> + if (!IS_ENABLED(CONFIG_PHYS_ADDR_T_64BIT)) >> + return 0; >> + > > Yes, if that suppresses the warning as well then that makes perfect > sense to me. Ok, I'll send that as a v2 then. Arnd
Am 04.07.23 um 16:31 schrieb Arnd Bergmann: > On Tue, Jul 4, 2023, at 14:33, Christian König wrote: >> Am 04.07.23 um 14:24 schrieb Arnd Bergmann: >>> On Tue, Jul 4, 2023, at 08:54, Christian König 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 >> accessible to a CPU which can only handle 32bit addresses by resizing >> the BAR is impossible to begin with. >> >> But going a step further even without resizing it is pretty hard to get >> 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. Yeah, those are unfortunately very well known to us :( > 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? We have tons of x86 systems where we can't resize the BAR (because of lack of BIOS setup of the root PCIe windows). So bank switching is still perfectly supported. > c) Require kernel changes to make a) or b) work, otherwise > fail to load > d) have no chance of working even with driver changes Yeah, that is usually what happens on those arm64 system with flawed PCIe implementations. The problem is not even BAR resize, basically we already had tons of customers which came to us and complained that amdgpu doesn't load or crashes the system after a few seconds. After investigating (which sometimes even includes involving engineers from ARM) we usually find that those boards doesn't even remotely comply to the PCIe specification, both regarding power as well as functional things like DMA coherency. Regards, Christian. > >>>> It might be cleaner to just not build the whole driver on such systems >>>> 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_device *adev) >>> u16 cmd; >>> int r; >>> >>> + if (!IS_ENABLED(CONFIG_PHYS_ADDR_T_64BIT)) >>> + return 0; >>> + >> Yes, if that suppresses the warning as well then that makes perfect >> sense to me. > Ok, I'll send that as a v2 then. > > Arnd
On Tue, Jul 4, 2023, at 16:51, Christian König wrote: > Am 04.07.23 um 16:31 schrieb Arnd Bergmann: >> On Tue, Jul 4, 2023, at 14:33, Christian König wrote: >>> >>> Modern AMD GPUs have 16GiB of local memory (VRAM), making those >>> accessible to a CPU which can only handle 32bit addresses by resizing >>> the BAR is impossible to begin with. >>> >>> But going a step further even without resizing it is pretty hard to get >>> 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. > > Yeah, those are unfortunately very well known to us :( > >> 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? > > We have tons of x86 systems where we can't resize the BAR (because of > lack of BIOS setup of the root PCIe windows). So bank switching is still > perfectly supported. Ok, good. > After investigating (which sometimes even includes involving engineers > from ARM) we usually find that those boards doesn't even remotely comply > to the PCIe specification, both regarding power as well as functional > things like DMA coherency. Makes sense, the power usage is clearly going to make this impossible on a lot of boards. I would have expected noncoherent DMA to be a solvable problem, since that generally works with all drivers that use the dma-mapping interfaces correctly, but I understand that drivers/gpu/* often does its own thing here, which may make that harder. Arnd
Am 04.07.23 um 17:24 schrieb Arnd Bergmann: > On Tue, Jul 4, 2023, at 16:51, Christian König wrote: >> Am 04.07.23 um 16:31 schrieb Arnd Bergmann: >>> On Tue, Jul 4, 2023, at 14:33, Christian König wrote: >>>> Modern AMD GPUs have 16GiB of local memory (VRAM), making those >>>> accessible to a CPU which can only handle 32bit addresses by resizing >>>> the BAR is impossible to begin with. >>>> >>>> But going a step further even without resizing it is pretty hard to get >>>> 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. >> Yeah, those are unfortunately very well known to us :( >> >>> 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? >> We have tons of x86 systems where we can't resize the BAR (because of >> lack of BIOS setup of the root PCIe windows). So bank switching is still >> perfectly supported. > Ok, good. > >> After investigating (which sometimes even includes involving engineers >> from ARM) we usually find that those boards doesn't even remotely comply >> to the PCIe specification, both regarding power as well as functional >> things like DMA coherency. > Makes sense, the power usage is clearly going to make this > impossible on a lot of boards. I would have expected noncoherent > DMA to be a solvable problem, since that generally works with > all drivers that use the dma-mapping interfaces correctly, > but I understand that drivers/gpu/* often does its own thing > here, which may make that harder. Yeah, I've heard that before. The problem is simply that the dma-mapping interface can't handle those cases. User space APIs like Vulkan and some OpenGL extensions make a coherent memory model between GPU and CPU mandatory. In other words you have things like ring buffers between code running on the GPU and code running on the CPU and the kernel is not even involved in that communication. This is all based on the PCIe specification which makes it quite clear that things like snooping caches is mandatory for a compliant root complex. There has been success to some degree by making everything uncached, but then the performance just sucks so badly that you can practically forget it as well. Regards, Christian. > > Arnd
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 7f069e1731fee..abd13942aac5d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -1341,7 +1341,7 @@ int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev) pci_bus_for_each_resource(root, res, i) { if (res && res->flags & (IORESOURCE_MEM | IORESOURCE_MEM_64) && - res->start > 0x100000000ull) + (u64)res->start > 0x100000000ull) break; }