summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2021-07-06 12:52:55 +0200
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2021-07-06 13:49:50 +0200
commitf86788bac0c8aaa0903aa2ef3b98ec0327a56d5b (patch)
treeaa4667efb839d8f18826357178c1068b8953d3a9
parent8dc3b0976651277b49123ab7cdf7ffe5bd250f8d (diff)
downloadenea-kernel-cache-f86788bac0c8aaa0903aa2ef3b98ec0327a56d5b.tar.gz
features/cpulist_abbrev: Add "63" alias for "last"
Change-Id: Ie82d70f74f36f9c064411b2f8ef0a7391aee9284 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
-rw-r--r--features/cpulist_abbrev/0001-cpumask-Add-63-alias-for-last-in-cpu-list.patch58
-rw-r--r--features/cpulist_abbrev/cpulist_abbrev_enea.scc1
2 files changed, 59 insertions, 0 deletions
diff --git a/features/cpulist_abbrev/0001-cpumask-Add-63-alias-for-last-in-cpu-list.patch b/features/cpulist_abbrev/0001-cpumask-Add-63-alias-for-last-in-cpu-list.patch
new file mode 100644
index 0000000..3ba61df
--- /dev/null
+++ b/features/cpulist_abbrev/0001-cpumask-Add-63-alias-for-last-in-cpu-list.patch
@@ -0,0 +1,58 @@
1From c52f05fb623b0e12c2c91aec6d02c7bd6f6cab0b Mon Sep 17 00:00:00 2001
2From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
3Date: Tue, 6 Jul 2021 10:39:05 +0000
4Subject: [PATCH] cpumask: Add "63" alias for "last" in cpu list
5
6Enea Edge currently hardcodes the kernel args based on previous
7releases' contents, bringing in arguments like "isolcpus=1-63",
8which are no longer supported (the last CPU has to be a valid CPU
9number after [1, 2]).
10
11To work around this issue (at least until the proper mechanism is
12implemented to generate the correct kernel arguments), we have to
13deal with the "63" hardcoded value at the kernel level. Since "63"
14was actually meant to be the last CPU, treat "63" as just another
15token for "last" (since we don't currently support machines with
16more than 64 cores).
17
18This is a terrible workaround for a very complex issue on Enea
19Edge upgrade/downgrade via OSTree deployments and should be
20removed as soon as the proper mechanism for generating kernel args
21is in place.
22
23Upstream-Status: Inappropiate [Enea specific]
24
25[1] https://github.com/torvalds/linux/commit/e22cdc3f
26[2] https://github.com/torvalds/linux/commit/edb93821
27
28Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
29---
30 lib/cpumask.c | 9 +++++++++
31 1 file changed, 9 insertions(+)
32
33diff --git a/lib/cpumask.c b/lib/cpumask.c
34index e4b8a8c252c7..6739a93b4c8d 100644
35--- a/lib/cpumask.c
36+++ b/lib/cpumask.c
37@@ -211,9 +211,18 @@ int __ref cpulist_parse(const char *buf, struct cpumask *dstp)
38 /*
39 * bitmap_parselist has no concept of "last" CPU, so we have to
40 * replace "last" with a real number in dest copy of the string.
41+ *
42+ * ENEA_start
43+ * Due to compatibility restrictions with kernel args imposed by earlier
44+ * releases, we need to support cpulists in the form of "0-63". To keep
45+ * it simple, we will just define "63" as an alias for "last", as we
46+ * don't support machines with more than 64 cores, at least not in the
47+ * current release.
48+ * ENEA_end
49 */
50 sprintf(last_cpu, "%d", cpumask_last(cpu_present_mask));
51 cpulist_replace_token(cpulist, buf, "last", last_cpu);
52+ cpulist_replace_token(cpulist, buf, "63", last_cpu);
53
54 r = bitmap_parselist(cpulist, cpumask_bits(dstp), nr_cpumask_bits);
55
56--
572.17.1
58
diff --git a/features/cpulist_abbrev/cpulist_abbrev_enea.scc b/features/cpulist_abbrev/cpulist_abbrev_enea.scc
new file mode 100644
index 0000000..5914ce9
--- /dev/null
+++ b/features/cpulist_abbrev/cpulist_abbrev_enea.scc
@@ -0,0 +1 @@
patch 0001-cpumask-Add-63-alias-for-last-in-cpu-list.patch