[PATCH][BIONIC] UBUNTU: SAUCE: s390/topology: don't inline cpu_to_node

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH][BIONIC] UBUNTU: SAUCE: s390/topology: don't inline cpu_to_node

Colin King
From: Colin Ian King <[hidden email]>

Inlining cpu_to_node ends up with the GPL exported array cpu_topology
being pulled into all sources that call cpu_to_node and indirectly
makes cpu_to_node into a function that has the same GPL exported
constraints.  This is unlike any other architecture where cpu_to_node
does not have this constraint. Fix this by making cpu_to_node a macro
that calls a non-inlined __cpu_to_node helper function that performs
the same as the original cpu_to_node.

Signed-off-by: Colin Ian King <[hidden email]>
---
 arch/s390/include/asm/topology.h | 7 ++-----
 arch/s390/kernel/topology.c      | 7 +++++++
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/arch/s390/include/asm/topology.h b/arch/s390/include/asm/topology.h
index 55de4eb73604..f81435186161 100644
--- a/arch/s390/include/asm/topology.h
+++ b/arch/s390/include/asm/topology.h
@@ -65,11 +65,8 @@ static inline void topology_expect_change(void) { }
 
 #ifdef CONFIG_NUMA
 
-#define cpu_to_node cpu_to_node
-static inline int cpu_to_node(int cpu)
-{
- return cpu_topology[cpu].node_id;
-}
+extern int __cpu_to_node(int cpu);
+#define cpu_to_node __cpu_to_node
 
 /* Returns a pointer to the cpumask of CPUs on node 'node'. */
 #define cpumask_of_node cpumask_of_node
diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c
index ed0bdd220e1a..11ccbd160177 100644
--- a/arch/s390/kernel/topology.c
+++ b/arch/s390/kernel/topology.c
@@ -64,6 +64,13 @@ EXPORT_SYMBOL_GPL(cpu_topology);
 
 cpumask_t cpus_with_topology;
 
+int __cpu_to_node(int cpu)
+{
+ return cpu_topology[cpu].node_id;
+}
+
+EXPORT_SYMBOL(__cpu_to_node);
+
 static cpumask_t cpu_group_map(struct mask_info *info, unsigned int cpu)
 {
  cpumask_t mask;
--
2.14.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

APPLIED: [PATCH][BIONIC] UBUNTU: SAUCE: s390/topology: don't inline cpu_to_node

Seth Forshee
On Thu, Nov 30, 2017 at 02:58:13PM +0000, Colin King wrote:

> From: Colin Ian King <[hidden email]>
>
> Inlining cpu_to_node ends up with the GPL exported array cpu_topology
> being pulled into all sources that call cpu_to_node and indirectly
> makes cpu_to_node into a function that has the same GPL exported
> constraints.  This is unlike any other architecture where cpu_to_node
> does not have this constraint. Fix this by making cpu_to_node a macro
> that calls a non-inlined __cpu_to_node helper function that performs
> the same as the original cpu_to_node.
>
> Signed-off-by: Colin Ian King <[hidden email]>

Applied, and also re-applied the zfs update which had been reverted.
Thanks!

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team