Skip to content

Commit a3d29e8

Browse files
Peter Zijlstrasuryasaimadhu
authored andcommitted
sched: Define and initialize a flag to identify valid PASID in the task
Add a new single bit field to the task structure to track whether this task has initialized the IA32_PASID MSR to the mm's PASID. Initialize the field to zero when creating a new task with fork/clone. Signed-off-by: Peter Zijlstra <[email protected]> Co-developed-by: Fenghua Yu <[email protected]> Signed-off-by: Fenghua Yu <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Reviewed-by: Tony Luck <[email protected]> Reviewed-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent dc7507d commit a3d29e8

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

include/linux/sched.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,9 @@ struct task_struct {
938938
/* Recursion prevention for eventfd_signal() */
939939
unsigned in_eventfd_signal:1;
940940
#endif
941+
#ifdef CONFIG_IOMMU_SVA
942+
unsigned pasid_activated:1;
943+
#endif
941944

942945
unsigned long atomic_flags; /* Flags requiring atomic access. */
943946

kernel/fork.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -968,6 +968,10 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node)
968968
tsk->use_memdelay = 0;
969969
#endif
970970

971+
#ifdef CONFIG_IOMMU_SVA
972+
tsk->pasid_activated = 0;
973+
#endif
974+
971975
#ifdef CONFIG_MEMCG
972976
tsk->active_memcg = NULL;
973977
#endif

0 commit comments

Comments
 (0)