From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 148C6C433E0 for ; Mon, 8 Mar 2021 19:34:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DCD5E65287 for ; Mon, 8 Mar 2021 19:34:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231201AbhCHTeH (ORCPT ); Mon, 8 Mar 2021 14:34:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:50056 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230075AbhCHTdw (ORCPT ); Mon, 8 Mar 2021 14:33:52 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id BEC1165287 for ; Mon, 8 Mar 2021 19:33:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615232031; bh=DM0rKDaLb7B/JShd7XPcETbrdwDndqNLTREc2OMkJWo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=KDRj/mXQmuAt4KfsI9B52LLS2Kp5PIsmOyUCzyzXEON6+rFu9lKtul/CmcHloxTtB A+7dZYUsagSvQUE1TBI4rMBXZ27zBbv0rDH/tU0MQzf/LZlVUivtqtVSTc2ixqKh8d IXhfMObEfuvpwDxUiTyY2pBj2uBePEDOBiQMurZ09BYMIndseWmYtyTeV9Dy1vwHoD Rxnl2zgKB5UU33zye7TQBpXg7HZY4txRhC1bs4tE5Cbcglt1UkVsazPFfUoBRvOUXV Q9Eqlr9g3ruRYcr9vPC6Z6Ly7d+wjTh80RaxG0z97BJOGGFmQC0C+SR1bLbNJHE7MT hI4quyeUkAKLg== Received: by mail-ot1-f48.google.com with SMTP id j8so10419586otc.0 for ; Mon, 08 Mar 2021 11:33:51 -0800 (PST) X-Gm-Message-State: AOAM532b4fzqdP3rOaMxrn/CMeLa2T9NqM5Z5BGmD8a/wq1hbWZp45Wx PCSe9spqsOS3QU6igqy72mxmRxNkGzKzJBJMRP8= X-Google-Smtp-Source: ABdhPJx2iehk1VgS7ag9nTJiTmLtuyCadIeJmEJ4CBdyRKvl5jJisQ7/TsKYnLdY99mC500mvmJStI3bl+HkwR1kRXc= X-Received: by 2002:a05:6830:148c:: with SMTP id s12mr3450789otq.251.1615232031118; Mon, 08 Mar 2021 11:33:51 -0800 (PST) MIME-Version: 1.0 References: <20210308153359.2513446-1-arnd@kernel.org> <176cae4d-33bc-1d51-a7d7-58eeeea5180e@amd.com> <92a6c999-c20a-2311-4e31-209a2d9229ed@amd.com> In-Reply-To: <92a6c999-c20a-2311-4e31-209a2d9229ed@amd.com> From: Arnd Bergmann Date: Mon, 8 Mar 2021 20:33:34 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] drm/amdkfd: fix build error with missing AMD_IOMMU_V2 To: Felix Kuehling Cc: Alex Deucher , =?UTF-8?Q?Christian_K=C3=B6nig?= , David Airlie , Daniel Vetter , Oded Gabbay , Colin Ian King , Philip Yang , amd-gfx list , dri-devel , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 8, 2021 at 8:11 PM Felix Kuehling wrote: > > Am 2021-03-08 um 2:05 p.m. schrieb Arnd Bergmann: > > On Mon, Mar 8, 2021 at 5:24 PM Felix Kuehling wrote: > >> The driver build should work without IOMMUv2. In amdkfd/Makefile, we > >> have this condition: > >> > >> ifneq ($(CONFIG_AMD_IOMMU_V2),) > >> AMDKFD_FILES += $(AMDKFD_PATH)/kfd_iommu.o > >> endif > >> > >> In amdkfd/kfd_iommu.h we define inline stubs of the functions that are > >> causing your link-failures if IOMMU_V2 is not enabled: > >> > >> #if defined(CONFIG_AMD_IOMMU_V2_MODULE) || defined(CONFIG_AMD_IOMMU_V2) > >> ... function declarations ... > >> #else > >> ... stubs ... > >> #endif > > Right, that is the problem I tried to explain in my patch description. > > > > Should we just drop the 'imply' then and add a proper dependency like this? > > > > depends on DRM_AMDGPU && (X86_64 || ARM64 || PPC64) > > depends on AMD_IOMMU_V2=y || DRM_AMDGPU=m > > > > I can send a v2 after some testing if you prefer this version. > > No. My point is, there should not be a hard dependency. The build should > work without CONFIG_AMD_IOMMU_V2. I don't understand why it's not > working for you. It looks like you're building kfd_iommu.o, which should > not be happening when AMD_IOMMU_V2 is not enabled. The condition in > amdkfd/Makefile should make sure that kfd_iommu.o doesn't get built with > your kernel config. Again, as I explained in the changelog text, AMD_IOMMU_V2 configured as a loadable module, while AMDGPU is configured as built-in. The causes a link failure for the vmlinux file, because the linker cannot resolve addresses of loadable modules at compile time -- they have not been loaded yet. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5BBDC433DB for ; Mon, 8 Mar 2021 19:33:54 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7CE2E65290 for ; Mon, 8 Mar 2021 19:33:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7CE2E65290 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 97DC46E874; Mon, 8 Mar 2021 19:33:53 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0741E892D5; Mon, 8 Mar 2021 19:33:52 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id C70A5652AD; Mon, 8 Mar 2021 19:33:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615232031; bh=DM0rKDaLb7B/JShd7XPcETbrdwDndqNLTREc2OMkJWo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=KDRj/mXQmuAt4KfsI9B52LLS2Kp5PIsmOyUCzyzXEON6+rFu9lKtul/CmcHloxTtB A+7dZYUsagSvQUE1TBI4rMBXZ27zBbv0rDH/tU0MQzf/LZlVUivtqtVSTc2ixqKh8d IXhfMObEfuvpwDxUiTyY2pBj2uBePEDOBiQMurZ09BYMIndseWmYtyTeV9Dy1vwHoD Rxnl2zgKB5UU33zye7TQBpXg7HZY4txRhC1bs4tE5Cbcglt1UkVsazPFfUoBRvOUXV Q9Eqlr9g3ruRYcr9vPC6Z6Ly7d+wjTh80RaxG0z97BJOGGFmQC0C+SR1bLbNJHE7MT hI4quyeUkAKLg== Received: by mail-ot1-f54.google.com with SMTP id r24so2261354otp.12; Mon, 08 Mar 2021 11:33:51 -0800 (PST) X-Gm-Message-State: AOAM532/HIipAW8KFw3xwWYiAuhWqY/NBUq462O2JE2vx6vjzZBpPHq7 dtB497Hw15g7sQumXpgkP32PhBzxugdUNAkbuWw= X-Google-Smtp-Source: ABdhPJx2iehk1VgS7ag9nTJiTmLtuyCadIeJmEJ4CBdyRKvl5jJisQ7/TsKYnLdY99mC500mvmJStI3bl+HkwR1kRXc= X-Received: by 2002:a05:6830:148c:: with SMTP id s12mr3450789otq.251.1615232031118; Mon, 08 Mar 2021 11:33:51 -0800 (PST) MIME-Version: 1.0 References: <20210308153359.2513446-1-arnd@kernel.org> <176cae4d-33bc-1d51-a7d7-58eeeea5180e@amd.com> <92a6c999-c20a-2311-4e31-209a2d9229ed@amd.com> In-Reply-To: <92a6c999-c20a-2311-4e31-209a2d9229ed@amd.com> From: Arnd Bergmann Date: Mon, 8 Mar 2021 20:33:34 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] drm/amdkfd: fix build error with missing AMD_IOMMU_V2 To: Felix Kuehling X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Philip Yang , David Airlie , "linux-kernel@vger.kernel.org" , amd-gfx list , dri-devel , Alex Deucher , Colin Ian King , =?UTF-8?Q?Christian_K=C3=B6nig?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Mon, Mar 8, 2021 at 8:11 PM Felix Kuehling wrote: > > Am 2021-03-08 um 2:05 p.m. schrieb Arnd Bergmann: > > On Mon, Mar 8, 2021 at 5:24 PM Felix Kuehling wrote: > >> The driver build should work without IOMMUv2. In amdkfd/Makefile, we > >> have this condition: > >> > >> ifneq ($(CONFIG_AMD_IOMMU_V2),) > >> AMDKFD_FILES += $(AMDKFD_PATH)/kfd_iommu.o > >> endif > >> > >> In amdkfd/kfd_iommu.h we define inline stubs of the functions that are > >> causing your link-failures if IOMMU_V2 is not enabled: > >> > >> #if defined(CONFIG_AMD_IOMMU_V2_MODULE) || defined(CONFIG_AMD_IOMMU_V2) > >> ... function declarations ... > >> #else > >> ... stubs ... > >> #endif > > Right, that is the problem I tried to explain in my patch description. > > > > Should we just drop the 'imply' then and add a proper dependency like this? > > > > depends on DRM_AMDGPU && (X86_64 || ARM64 || PPC64) > > depends on AMD_IOMMU_V2=y || DRM_AMDGPU=m > > > > I can send a v2 after some testing if you prefer this version. > > No. My point is, there should not be a hard dependency. The build should > work without CONFIG_AMD_IOMMU_V2. I don't understand why it's not > working for you. It looks like you're building kfd_iommu.o, which should > not be happening when AMD_IOMMU_V2 is not enabled. The condition in > amdkfd/Makefile should make sure that kfd_iommu.o doesn't get built with > your kernel config. Again, as I explained in the changelog text, AMD_IOMMU_V2 configured as a loadable module, while AMDGPU is configured as built-in. The causes a link failure for the vmlinux file, because the linker cannot resolve addresses of loadable modules at compile time -- they have not been loaded yet. Arnd _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D4F7C433E0 for ; Mon, 8 Mar 2021 19:33:53 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3D41C6529E for ; Mon, 8 Mar 2021 19:33:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3D41C6529E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=amd-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EB9C86E0B9; Mon, 8 Mar 2021 19:33:52 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0741E892D5; Mon, 8 Mar 2021 19:33:52 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id C70A5652AD; Mon, 8 Mar 2021 19:33:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615232031; bh=DM0rKDaLb7B/JShd7XPcETbrdwDndqNLTREc2OMkJWo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=KDRj/mXQmuAt4KfsI9B52LLS2Kp5PIsmOyUCzyzXEON6+rFu9lKtul/CmcHloxTtB A+7dZYUsagSvQUE1TBI4rMBXZ27zBbv0rDH/tU0MQzf/LZlVUivtqtVSTc2ixqKh8d IXhfMObEfuvpwDxUiTyY2pBj2uBePEDOBiQMurZ09BYMIndseWmYtyTeV9Dy1vwHoD Rxnl2zgKB5UU33zye7TQBpXg7HZY4txRhC1bs4tE5Cbcglt1UkVsazPFfUoBRvOUXV Q9Eqlr9g3ruRYcr9vPC6Z6Ly7d+wjTh80RaxG0z97BJOGGFmQC0C+SR1bLbNJHE7MT hI4quyeUkAKLg== Received: by mail-ot1-f54.google.com with SMTP id r24so2261354otp.12; Mon, 08 Mar 2021 11:33:51 -0800 (PST) X-Gm-Message-State: AOAM532/HIipAW8KFw3xwWYiAuhWqY/NBUq462O2JE2vx6vjzZBpPHq7 dtB497Hw15g7sQumXpgkP32PhBzxugdUNAkbuWw= X-Google-Smtp-Source: ABdhPJx2iehk1VgS7ag9nTJiTmLtuyCadIeJmEJ4CBdyRKvl5jJisQ7/TsKYnLdY99mC500mvmJStI3bl+HkwR1kRXc= X-Received: by 2002:a05:6830:148c:: with SMTP id s12mr3450789otq.251.1615232031118; Mon, 08 Mar 2021 11:33:51 -0800 (PST) MIME-Version: 1.0 References: <20210308153359.2513446-1-arnd@kernel.org> <176cae4d-33bc-1d51-a7d7-58eeeea5180e@amd.com> <92a6c999-c20a-2311-4e31-209a2d9229ed@amd.com> In-Reply-To: <92a6c999-c20a-2311-4e31-209a2d9229ed@amd.com> From: Arnd Bergmann Date: Mon, 8 Mar 2021 20:33:34 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] drm/amdkfd: fix build error with missing AMD_IOMMU_V2 To: Felix Kuehling X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Oded Gabbay , Philip Yang , David Airlie , "linux-kernel@vger.kernel.org" , amd-gfx list , dri-devel , Daniel Vetter , Alex Deucher , Colin Ian King , =?UTF-8?Q?Christian_K=C3=B6nig?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" On Mon, Mar 8, 2021 at 8:11 PM Felix Kuehling wrote: > > Am 2021-03-08 um 2:05 p.m. schrieb Arnd Bergmann: > > On Mon, Mar 8, 2021 at 5:24 PM Felix Kuehling wrote: > >> The driver build should work without IOMMUv2. In amdkfd/Makefile, we > >> have this condition: > >> > >> ifneq ($(CONFIG_AMD_IOMMU_V2),) > >> AMDKFD_FILES += $(AMDKFD_PATH)/kfd_iommu.o > >> endif > >> > >> In amdkfd/kfd_iommu.h we define inline stubs of the functions that are > >> causing your link-failures if IOMMU_V2 is not enabled: > >> > >> #if defined(CONFIG_AMD_IOMMU_V2_MODULE) || defined(CONFIG_AMD_IOMMU_V2) > >> ... function declarations ... > >> #else > >> ... stubs ... > >> #endif > > Right, that is the problem I tried to explain in my patch description. > > > > Should we just drop the 'imply' then and add a proper dependency like this? > > > > depends on DRM_AMDGPU && (X86_64 || ARM64 || PPC64) > > depends on AMD_IOMMU_V2=y || DRM_AMDGPU=m > > > > I can send a v2 after some testing if you prefer this version. > > No. My point is, there should not be a hard dependency. The build should > work without CONFIG_AMD_IOMMU_V2. I don't understand why it's not > working for you. It looks like you're building kfd_iommu.o, which should > not be happening when AMD_IOMMU_V2 is not enabled. The condition in > amdkfd/Makefile should make sure that kfd_iommu.o doesn't get built with > your kernel config. Again, as I explained in the changelog text, AMD_IOMMU_V2 configured as a loadable module, while AMDGPU is configured as built-in. The causes a link failure for the vmlinux file, because the linker cannot resolve addresses of loadable modules at compile time -- they have not been loaded yet. Arnd _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx