Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH] MIPS: Include asm/ptrace.h now linux/sched.h doesn't
@ 2017-03-04  0:32 James Hogan
  2017-03-04  0:32 ` James Hogan
  2017-03-07  7:44 ` Ingo Molnar
  0 siblings, 2 replies; 3+ messages in thread
From: James Hogan @ 2017-03-04  0:32 UTC (permalink / raw)
  To: linux-mips; +Cc: James Hogan, Ralf Baechle, Ingo Molnar

Use of the task_pt_regs() based macros in MIPS' asm/processor.h for
accessing the user context on the kernel stack need the definition of
struct pt_regs from asm/ptrace.h. __own_fpu() in asm/fpu.h uses these
macros but implicitly depended on linux/sched.h to include asm/ptrace.h.

Since commit f780d89a0e82 ("sched/headers: Remove <asm/ptrace.h> from
<linux/sched.h>") however linux/sched.h no longer includes asm/ptrace.h,
so include it explicitly from asm/fpu.h where it is needed instead.

This fixes build errors such as:

./arch/mips/include/asm/fpu.h: In function '__own_fpu':
./arch/mips/include/asm/processor.h:385:31: error: invalid application of 'sizeof' to incomplete type 'struct pt_regs'
     THREAD_SIZE - 32 - sizeof(struct pt_regs))
                               ^

Fixes: f780d89a0e82 ("sched/headers: Remove <asm/ptrace.h> from <linux/sched.h>")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: linux-mips@linux-mips.org
---
 arch/mips/include/asm/fpu.h | 1 +
 1 file changed, 1 insertion(+), 0 deletions(-)

diff --git a/arch/mips/include/asm/fpu.h b/arch/mips/include/asm/fpu.h
index 321752bcbab6..1527efaf4af4 100644
--- a/arch/mips/include/asm/fpu.h
+++ b/arch/mips/include/asm/fpu.h
@@ -20,6 +20,7 @@
 #include <asm/cpu-features.h>
 #include <asm/fpu_emulator.h>
 #include <asm/hazards.h>
+#include <asm/ptrace.h>
 #include <asm/processor.h>
 #include <asm/current.h>
 #include <asm/msa.h>
-- 
git-series 0.8.10

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] MIPS: Include asm/ptrace.h now linux/sched.h doesn't
  2017-03-04  0:32 [PATCH] MIPS: Include asm/ptrace.h now linux/sched.h doesn't James Hogan
@ 2017-03-04  0:32 ` James Hogan
  2017-03-07  7:44 ` Ingo Molnar
  1 sibling, 0 replies; 3+ messages in thread
From: James Hogan @ 2017-03-04  0:32 UTC (permalink / raw)
  To: linux-mips; +Cc: James Hogan, Ralf Baechle, Ingo Molnar

Use of the task_pt_regs() based macros in MIPS' asm/processor.h for
accessing the user context on the kernel stack need the definition of
struct pt_regs from asm/ptrace.h. __own_fpu() in asm/fpu.h uses these
macros but implicitly depended on linux/sched.h to include asm/ptrace.h.

Since commit f780d89a0e82 ("sched/headers: Remove <asm/ptrace.h> from
<linux/sched.h>") however linux/sched.h no longer includes asm/ptrace.h,
so include it explicitly from asm/fpu.h where it is needed instead.

This fixes build errors such as:

./arch/mips/include/asm/fpu.h: In function '__own_fpu':
./arch/mips/include/asm/processor.h:385:31: error: invalid application of 'sizeof' to incomplete type 'struct pt_regs'
     THREAD_SIZE - 32 - sizeof(struct pt_regs))
                               ^

Fixes: f780d89a0e82 ("sched/headers: Remove <asm/ptrace.h> from <linux/sched.h>")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: linux-mips@linux-mips.org
---
 arch/mips/include/asm/fpu.h | 1 +
 1 file changed, 1 insertion(+), 0 deletions(-)

diff --git a/arch/mips/include/asm/fpu.h b/arch/mips/include/asm/fpu.h
index 321752bcbab6..1527efaf4af4 100644
--- a/arch/mips/include/asm/fpu.h
+++ b/arch/mips/include/asm/fpu.h
@@ -20,6 +20,7 @@
 #include <asm/cpu-features.h>
 #include <asm/fpu_emulator.h>
 #include <asm/hazards.h>
+#include <asm/ptrace.h>
 #include <asm/processor.h>
 #include <asm/current.h>
 #include <asm/msa.h>
-- 
git-series 0.8.10

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] MIPS: Include asm/ptrace.h now linux/sched.h doesn't
  2017-03-04  0:32 [PATCH] MIPS: Include asm/ptrace.h now linux/sched.h doesn't James Hogan
  2017-03-04  0:32 ` James Hogan
@ 2017-03-07  7:44 ` Ingo Molnar
  1 sibling, 0 replies; 3+ messages in thread
From: Ingo Molnar @ 2017-03-07  7:44 UTC (permalink / raw)
  To: James Hogan; +Cc: linux-mips, Ralf Baechle


* James Hogan <james.hogan@imgtec.com> wrote:

> Use of the task_pt_regs() based macros in MIPS' asm/processor.h for
> accessing the user context on the kernel stack need the definition of
> struct pt_regs from asm/ptrace.h. __own_fpu() in asm/fpu.h uses these
> macros but implicitly depended on linux/sched.h to include asm/ptrace.h.
> 
> Since commit f780d89a0e82 ("sched/headers: Remove <asm/ptrace.h> from
> <linux/sched.h>") however linux/sched.h no longer includes asm/ptrace.h,
> so include it explicitly from asm/fpu.h where it is needed instead.
> 
> This fixes build errors such as:
> 
> ./arch/mips/include/asm/fpu.h: In function '__own_fpu':
> ./arch/mips/include/asm/processor.h:385:31: error: invalid application of 'sizeof' to incomplete type 'struct pt_regs'
>      THREAD_SIZE - 32 - sizeof(struct pt_regs))
>                                ^
> 
> Fixes: f780d89a0e82 ("sched/headers: Remove <asm/ptrace.h> from <linux/sched.h>")
> Signed-off-by: James Hogan <james.hogan@imgtec.com>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: Ingo Molnar <mingo@kernel.org>
> Cc: linux-mips@linux-mips.org

My build tests missed this bug, thanks James!

Acked-by: Ingo Molnar <mingo@kernel.org>

	Ingo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-03-07  7:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-04  0:32 [PATCH] MIPS: Include asm/ptrace.h now linux/sched.h doesn't James Hogan
2017-03-04  0:32 ` James Hogan
2017-03-07  7:44 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox