Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1645663pxy; Mon, 2 Aug 2021 07:00:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxk4cdElgymQ9/gtiYDm39AuSFYwJg6T2I/u4PTIDff8o3m2rx9SVRVlNicBsXn9K+53UzU X-Received: by 2002:a17:907:2096:: with SMTP id pv22mr11511335ejb.443.1627912852292; Mon, 02 Aug 2021 07:00:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627912852; cv=none; d=google.com; s=arc-20160816; b=Ebi1x/wbTeaB0sbEcCHGqMYYlfFzzsMd5qZAg04qmytOA7bw5w0qR05YqszC7CswEC DkDkhu84mMdt98mLgSq88e7GpM3L8/f62A1xrcyHAVvo62izUME6OKXli8kVfIGd9tyk eYb++ziV6xVyQ9UUU91YUgO2I3KgT6nTN3DvbIgTRuqU/NilVAV4Az7lm/HK8DaoNbpK sh/QYidVU41sqHQlelIInxhl+JvZw6SprrFMyv1M3lJoewV7KZw6fvtrJkrzIl6d3t++ cGFjR3XLwVH93AFHD1H00Utn9pLqyG6TUHae/B170C7dbZ73yvbESi60lSYn2ucH9LN7 1cNw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pHZgdWIXZC+lUpmKEeT+yl4GNoklb+l1bcrzv53fPm8=; b=fPcvrkfr6pVZwUHCxQZ9QW+ORxO9poVyvcoihr97mjgbKJO1oHC10ImJjYe3VlRmN4 bSMFo86jStT6rh+F7g9RlQcxleJbnalSrAbHCS7/IdbK955IYX46647jn3Qh+MFIAaNe 7K0AlcLpbcUeMNtC7ajV6XGeElR1hGSIHtJDApk6uSFPQEWqxinBTs9KrICYKZi5aoL4 Qkwf8LwXaharkqaHPBunx3f3aNmsC6QsSOTF7xVroMoZdVnQNV1lgHO3eEUXQcQN11VL 0iilCNfhgTLIT6Kn2ynXvW9DHOJCu+vEsEaKMH4EonMddz5aKfbDVtn2x9LFA5E7IdL+ 5ITA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LH+sCWzW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o18si9626546ejd.330.2021.08.02.07.00.28; Mon, 02 Aug 2021 07:00:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LH+sCWzW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235678AbhHBN65 (ORCPT + 99 others); Mon, 2 Aug 2021 09:58:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:34294 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235276AbhHBNwx (ORCPT ); Mon, 2 Aug 2021 09:52:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C772061106; Mon, 2 Aug 2021 13:51:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627912302; bh=AeDzqH4bg9uXWTQuX9nMpV58zohiDQS1Ex+hgWyz8fI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LH+sCWzWEO5Dt4BKiamCIAoh+JkmakNC5M5rcsbEiMHDMGcAkufMf5X4SX5XWI4+S TzvzxwvpCqTbHOePMkSyXcqZ26U5ikiZyDF0cF2I/gwxeQ9TiB/mpFhLIRgs1+KMjj RtejBjgzmLlylR18VnVes3XI39Z7UdHBFYSdA+BY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, marc.c.dionne@gmail.com, Srikar Dronamraju , Michael Ellerman Subject: [PATCH 5.4 37/40] powerpc/pseries: Fix regression while building external modules Date: Mon, 2 Aug 2021 15:45:17 +0200 Message-Id: <20210802134336.580902550@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210802134335.408294521@linuxfoundation.org> References: <20210802134335.408294521@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Srikar Dronamraju commit 333cf507465fbebb3727f5b53e77538467df312a upstream. With commit c9f3401313a5 ("powerpc: Always enable queued spinlocks for 64s, disable for others") CONFIG_PPC_QUEUED_SPINLOCKS is always enabled on ppc64le, external modules that use spinlock APIs are failing. ERROR: modpost: GPL-incompatible module XXX.ko uses GPL-only symbol 'shared_processor' Before the above commit, modules were able to build without any issues. Also this problem is not seen on other architectures. This problem can be workaround if CONFIG_UNINLINE_SPIN_UNLOCK is enabled in the config. However CONFIG_UNINLINE_SPIN_UNLOCK is not enabled by default and only enabled in certain conditions like CONFIG_DEBUG_SPINLOCKS is set in the kernel config. #include spinlock_t spLock; static int __init spinlock_test_init(void) { spin_lock_init(&spLock); spin_lock(&spLock); spin_unlock(&spLock); return 0; } static void __exit spinlock_test_exit(void) { printk("spinlock_test unloaded\n"); } module_init(spinlock_test_init); module_exit(spinlock_test_exit); MODULE_DESCRIPTION ("spinlock_test"); MODULE_LICENSE ("non-GPL"); MODULE_AUTHOR ("Srikar Dronamraju"); Given that spin locks are one of the basic facilities for module code, this effectively makes it impossible to build/load almost any non GPL modules on ppc64le. This was first reported at https://github.com/openzfs/zfs/issues/11172 Currently shared_processor is exported as GPL only symbol. Fix this for parity with other architectures by exposing shared_processor to non-GPL modules too. Fixes: 14c73bd344da ("powerpc/vcpu: Assume dedicated processors as non-preempt") Cc: stable@vger.kernel.org # v5.5+ Reported-by: marc.c.dionne@gmail.com Signed-off-by: Srikar Dronamraju Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210729060449.292780-1-srikar@linux.vnet.ibm.com Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/platforms/pseries/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c @@ -75,7 +75,7 @@ #include "../../../../drivers/pci/pci.h" DEFINE_STATIC_KEY_FALSE(shared_processor); -EXPORT_SYMBOL_GPL(shared_processor); +EXPORT_SYMBOL(shared_processor); int CMO_PrPSP = -1; int CMO_SecPSP = -1;