summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--features/cpulist_abbrev/0001-cpumask-Add-63-alias-for-last-in-cpu-list.patch20
1 files changed, 13 insertions, 7 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
index 3ba61df..f77e2fb 100644
--- 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
@@ -1,4 +1,4 @@
1From c52f05fb623b0e12c2c91aec6d02c7bd6f6cab0b Mon Sep 17 00:00:00 2001 1From eae01ebd0607f0ae29604508b27d177e0d01799b Mon Sep 17 00:00:00 2001
2From: Alexandru Avadanii <Alexandru.Avadanii@enea.com> 2From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
3Date: Tue, 6 Jul 2021 10:39:05 +0000 3Date: Tue, 6 Jul 2021 10:39:05 +0000
4Subject: [PATCH] cpumask: Add "63" alias for "last" in cpu list 4Subject: [PATCH] cpumask: Add "63" alias for "last" in cpu list
@@ -20,6 +20,9 @@ Edge upgrade/downgrade via OSTree deployments and should be
20removed as soon as the proper mechanism for generating kernel args 20removed as soon as the proper mechanism for generating kernel args
21is in place. 21is in place.
22 22
23Note: "last" and "63" (as an alias for "last") cannot be used at
24the same time.
25
23Upstream-Status: Inappropiate [Enea specific] 26Upstream-Status: Inappropiate [Enea specific]
24 27
25[1] https://github.com/torvalds/linux/commit/e22cdc3f 28[1] https://github.com/torvalds/linux/commit/e22cdc3f
@@ -27,14 +30,14 @@ Upstream-Status: Inappropiate [Enea specific]
27 30
28Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com> 31Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
29--- 32---
30 lib/cpumask.c | 9 +++++++++ 33 lib/cpumask.c | 13 ++++++++++++-
31 1 file changed, 9 insertions(+) 34 1 file changed, 12 insertions(+), 1 deletion(-)
32 35
33diff --git a/lib/cpumask.c b/lib/cpumask.c 36diff --git a/lib/cpumask.c b/lib/cpumask.c
34index e4b8a8c252c7..6739a93b4c8d 100644 37index e4b8a8c252c7..1357c10e5b67 100644
35--- a/lib/cpumask.c 38--- a/lib/cpumask.c
36+++ b/lib/cpumask.c 39+++ b/lib/cpumask.c
37@@ -211,9 +211,18 @@ int __ref cpulist_parse(const char *buf, struct cpumask *dstp) 40@@ -211,9 +211,20 @@ int __ref cpulist_parse(const char *buf, struct cpumask *dstp)
38 /* 41 /*
39 * bitmap_parselist has no concept of "last" CPU, so we have to 42 * 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. 43 * replace "last" with a real number in dest copy of the string.
@@ -48,8 +51,11 @@ index e4b8a8c252c7..6739a93b4c8d 100644
48+ * ENEA_end 51+ * ENEA_end
49 */ 52 */
50 sprintf(last_cpu, "%d", cpumask_last(cpu_present_mask)); 53 sprintf(last_cpu, "%d", cpumask_last(cpu_present_mask));
51 cpulist_replace_token(cpulist, buf, "last", last_cpu); 54- cpulist_replace_token(cpulist, buf, "last", last_cpu);
52+ cpulist_replace_token(cpulist, buf, "63", last_cpu); 55+ if (cpumask_find_token(buf, "last"))
56+ cpulist_replace_token(cpulist, buf, "last", last_cpu);
57+ else
58+ cpulist_replace_token(cpulist, buf, "63", last_cpu);
53 59
54 r = bitmap_parselist(cpulist, cpumask_bits(dstp), nr_cpumask_bits); 60 r = bitmap_parselist(cpulist, cpumask_bits(dstp), nr_cpumask_bits);
55 61