lkml.org 
[lkml]   [2024]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] x86/fpu: Introduce the x86_task_fpu() helper method

* Brian Gerst <brgerst@gmail.com> wrote:

> > 17 files changed, 104 insertions(+), 107 deletions(-)
>
> This series would be better if you added the x86_task_fpu() helper in
> an initial patch without any other changes. That would make the
> actual changes more visible with less code churn.

Makes sense - I've split out the patch below and adjusted the rest of the
series. Is this what you had in mind?

Note that I also robustified the macro a bit:

-# define x86_task_fpu(task) ((struct fpu *)((void *)task + sizeof(*task)))
+# define x86_task_fpu(task) ((struct fpu *)((void *)(task) + sizeof(*(task))))

Thanks,

Ingo

========================>
From: Ingo Molnar <mingo@kernel.org>
Date: Thu, 6 Jun 2024 11:01:14 +0200
Subject: [PATCH] x86/fpu: Introduce the x86_task_fpu() helper method

The per-task FPU context/save area is allocated right
next to task_struct() - introduce the x86_task_fpu()
helper that calculates this explicitly from the
task pointer.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/include/asm/processor.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index 920b0beebd11..fb6f030f0692 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -507,6 +507,8 @@ struct thread_struct {
struct fpu *fpu;
};

+#define x86_task_fpu(task) ((struct fpu *)((void *)(task) + sizeof(*(task))))
+
/*
* X86 doesn't need any embedded-FPU-struct quirks:
*/
\
 
 \ /
  Last update: 2024-07-02 23:25    [W:0.147 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site