Commit a3d29e82 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Borislav Petkov

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: default avatarPeter Zijlstra <peterz@infradead.org>
Co-developed-by: default avatarFenghua Yu <fenghua.yu@intel.com>
Signed-off-by: default avatarFenghua Yu <fenghua.yu@intel.com>
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Reviewed-by: default avatarTony Luck <tony.luck@intel.com>
Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20220207230254.3342514-8-fenghua.yu@intel.com
parent dc7507dd
...@@ -938,6 +938,9 @@ struct task_struct { ...@@ -938,6 +938,9 @@ struct task_struct {
/* Recursion prevention for eventfd_signal() */ /* Recursion prevention for eventfd_signal() */
unsigned in_eventfd_signal:1; unsigned in_eventfd_signal:1;
#endif #endif
#ifdef CONFIG_IOMMU_SVA
unsigned pasid_activated:1;
#endif
unsigned long atomic_flags; /* Flags requiring atomic access. */ unsigned long atomic_flags; /* Flags requiring atomic access. */
......
...@@ -968,6 +968,10 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node) ...@@ -968,6 +968,10 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node)
tsk->use_memdelay = 0; tsk->use_memdelay = 0;
#endif #endif
#ifdef CONFIG_IOMMU_SVA
tsk->pasid_activated = 0;
#endif
#ifdef CONFIG_MEMCG #ifdef CONFIG_MEMCG
tsk->active_memcg = NULL; tsk->active_memcg = NULL;
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment