Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1642631pxy; Mon, 2 Aug 2021 06:56:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBE79+rlpMzrnEguaQ7buMi6PZWkIMdARB78HEBA7+ivjEbSfQV6OKBRKhhJYR/Rm3ZSAT X-Received: by 2002:a92:190f:: with SMTP id 15mr11166ilz.45.1627912595516; Mon, 02 Aug 2021 06:56:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627912595; cv=none; d=google.com; s=arc-20160816; b=h5uz4vbBqCwBhVNLvB9xvwS7d+bb+i7DbA2z9F0HHcd2gpAhzffJaz8HbjMKt+KPuL yiSKfw6Tq2WbRnomeSCVaEM3zLRzKtE0phT3CeLyHc2GN1h4xs96atvsSyey0GZw8el+ uNMAJdH6ng6wcVQOsJ9dub+NtlBzEOyHrsXH8WZqK78CKxqzvogvRGid0fGyJtNbaggX Rfp9Nu4vDmU8WhRwoNvuvdUzszBqdpHqavrJ+FP1nXkAh9DGYEpRCNWU+/wEIOZDs9Yh uCuQpsQ/Qz6vl1zXUCZo/9EQKysJSMfVlo3RLngRqRqeCehie5kbOf0rH3Hexs2Pr6j4 9pWg== 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=T1DYErc8+HfMlgf/qlHpkJsXAeZBeTejY5ddL+bdI3s=; b=k/v43moPFYjsq18vHjNNoOFqoOFPPOFnhj2Txbohro78s1ye86lwjMaxY0tLYYB0E6 x7qbE38dmqLLrfkzomdFUqZrRjFBebu3tJVkz+hQSFetdxOpO5bbHuseuE/z+OI1+9Dn TC8EipnRBXT4mVDXhyaxHCfCqnyAH1gvcP6FJndnXNv/+zBBdZXOKCLVcaifL/BvY8Td ANBNsr2bGA9INKC1z35/jee6/kVkBN/qehbjpAnb+74jEWS/y7tUsyeKFoXch7BPt+rc AIM2g21mdlfgEXNn0mfcgTdsNxaJAFjB1BeODqg1v5tLo8BkEH3iHjuM7kyzmw4tvC20 C/AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yg4wX2oJ; 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 a6si15665695ilv.81.2021.08.02.06.56.23; Mon, 02 Aug 2021 06:56:35 -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=yg4wX2oJ; 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 S234412AbhHBNzg (ORCPT + 99 others); Mon, 2 Aug 2021 09:55:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:34138 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234873AbhHBNuW (ORCPT ); Mon, 2 Aug 2021 09:50:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7224361101; Mon, 2 Aug 2021 13:50:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627912212; bh=fvodgirbJz/RQvpMeDVfNe4kWcq9jASI9+NFQyIHmVI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yg4wX2oJnfMGUcI0lO2hpAR8Wf28eZ6ORcJdjrHi5DXSV74kr8uXVrwhsoXQrrTE/ FKLMlwiFjCYHmmAdWRwhUzYxRFKjfoGMqZlqQJD/qHkSnNmQ09BMg7E0wFicYh9IR4 I5nykG1SC35HgEjh+dTmujqP4oSHy6SqUhSZmiT0= 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 4.19 28/30] powerpc/pseries: Fix regression while building external modules Date: Mon, 2 Aug 2021 15:45:06 +0200 Message-Id: <20210802134334.991094715@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210802134334.081433902@linuxfoundation.org> References: <20210802134334.081433902@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 @@ -76,7 +76,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;