diff options
-rw-r--r-- | features/cpulist_abbrev/0001-cpumask-Add-63-alias-for-last-in-cpu-list.patch | 58 | ||||
-rw-r--r-- | features/cpulist_abbrev/cpulist_abbrev_enea.scc | 1 |
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 @@ | |||
1 | From c52f05fb623b0e12c2c91aec6d02c7bd6f6cab0b Mon Sep 17 00:00:00 2001 | ||
2 | From: Alexandru Avadanii <Alexandru.Avadanii@enea.com> | ||
3 | Date: Tue, 6 Jul 2021 10:39:05 +0000 | ||
4 | Subject: [PATCH] cpumask: Add "63" alias for "last" in cpu list | ||
5 | |||
6 | Enea Edge currently hardcodes the kernel args based on previous | ||
7 | releases' contents, bringing in arguments like "isolcpus=1-63", | ||
8 | which are no longer supported (the last CPU has to be a valid CPU | ||
9 | number after [1, 2]). | ||
10 | |||
11 | To work around this issue (at least until the proper mechanism is | ||
12 | implemented to generate the correct kernel arguments), we have to | ||
13 | deal with the "63" hardcoded value at the kernel level. Since "63" | ||
14 | was actually meant to be the last CPU, treat "63" as just another | ||
15 | token for "last" (since we don't currently support machines with | ||
16 | more than 64 cores). | ||
17 | |||
18 | This is a terrible workaround for a very complex issue on Enea | ||
19 | Edge upgrade/downgrade via OSTree deployments and should be | ||
20 | removed as soon as the proper mechanism for generating kernel args | ||
21 | is in place. | ||
22 | |||
23 | Upstream-Status: Inappropiate [Enea specific] | ||
24 | |||
25 | [1] https://github.com/torvalds/linux/commit/e22cdc3f | ||
26 | [2] https://github.com/torvalds/linux/commit/edb93821 | ||
27 | |||
28 | Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com> | ||
29 | --- | ||
30 | lib/cpumask.c | 9 +++++++++ | ||
31 | 1 file changed, 9 insertions(+) | ||
32 | |||
33 | diff --git a/lib/cpumask.c b/lib/cpumask.c | ||
34 | index 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 | -- | ||
57 | 2.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 | |||