On Mon, Sep 13 2021 at 13:01, Sohil Mehta wrote:
The user interrupt MSRs and the user interrupt state is task specific.Derefencing the UPID, i.e. accessing task->upid->foo helps in which way?
During task fork and exit clear the task state, clear the MSRs and
dereference the shared resources.
Some of the memory resources like the UPID are referenced in the file
descriptor and could be in use while the uintr_fd is still valid.
Instead of freeing up the UPID just dereference it.
You want to drop the reference count I assume. Then please write that
so.
@@ -260,6 +260,7 @@ int fpu_clone(struct task_struct *dst)1) If the FPU registers are up to date then this can be completely
{
struct fpu *src_fpu = ¤t->thread.fpu;
struct fpu *dst_fpu = &dst->thread.fpu;
+ struct uintr_state *uintr_state;
/* The new task's FPU state cannot be valid in the hardware. */
dst_fpu->last_cpu = -1;
@@ -284,6 +285,14 @@ int fpu_clone(struct task_struct *dst)
else
save_fpregs_to_fpstate(dst_fpu);
+
+ /* UINTR state is not expected to be inherited (in the current design). */
+ if (static_cpu_has(X86_FEATURE_UINTR)) {
+ uintr_state = get_xsave_addr(&dst_fpu->state.xsave, XFEATURE_UINTR);
+ if (uintr_state)
+ memset(uintr_state, 0, sizeof(*uintr_state));
+ }
avoided by excluding the UINTR component from XSAVES
2) If the task never used that muck then UINTR is in init state and
clearing that memory is a redunant exercise because it has been
cleared already
+ * exit_thread() can happen in current context when the current thread isA right that makes sense. If a new thread is created then it can call
+ * exiting or it can happen for a new thread that is being created.
exit_thread(), right?
+ * For new threads is_uintr_receiver() should fail.Should fail?