From: Borislav Petkov <bp@suse.de>
Subject: sched/pasid: Add a kABI workaround
Patch-mainline: Never, kABI workaround
References: jsc#SLE-24350
Add a kABI workaround for
patches.suse/sched-define-and-initialize-a-flag-to-identify-valid-pasid-in-the-task.patch
which adds a new bitfield to task_struct. The offsets remain the same - solely
only one bit gets added, as verified with pahole:
| --- /root/tmp/task_struct.before 2022-05-18 10:53:49.134980574 +0200
| +++ /root/tmp/task_struct.after 2022-05-18 11:09:34.876055028 +0200
| @@ -131,8 +131,9 @@ struct task_struct {
| unsigned int in_memstall:1; /* 2416: 8 4 */
| unsigned int in_page_owner:1; /* 2416: 9 4 */
| unsigned int in_eventfd_signal:1; /* 2416:10 4 */
| + unsigned int pasid_activated:1; /* 2416:11 4 */
|
| - /* XXX 21 bits hole, try to pack */
| + /* XXX 20 bits hole, try to pack */
| /* XXX 4 bytes hole, try to pack */
|
| long unsigned int atomic_flags; /* 2424 8 */
| @@ -392,9 +393,9 @@ struct task_struct {
| /* --- cacheline 144 boundary (9216 bytes) --- */
| struct thread_struct thread __attribute__((__aligned__(64))); /* 9216 4416 */
|
| - /* size: 13632, cachelines: 213, members: 253 */
| + /* size: 13632, cachelines: 213, members: 254 */
| /* sum members: 13451, holes: 22, sum holes: 165 */
| - /* sum bitfield members: 79 bits, bit holes: 2, sum bit holes: 49 bits */
| + /* sum bitfield members: 80 bits, bit holes: 2, sum bit holes: 48 bits */
| /* paddings: 6, sum paddings: 57 */
| /* forced alignments: 10, forced holes: 3, sum forced holes: 92 */
| } __attribute__((__aligned__(64)));
Signed-off-by: Borislav Petkov <bp@suse.de>
---
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -940,8 +940,10 @@ struct task_struct {
unsigned in_eventfd_signal:1;
#endif
#ifdef CONFIG_IOMMU_SVA
+#ifndef __GENKSYMS__
unsigned pasid_activated:1;
#endif
+#endif
unsigned long atomic_flags; /* Flags requiring atomic access. */