linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] MIPS: kernel: Fix reservation for VDSO area
@ 2025-11-17 19:18 Thomas Bogendoerfer
  2025-11-18  1:15 ` Huacai Chen
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Bogendoerfer @ 2025-11-17 19:18 UTC (permalink / raw)
  To: Nam Cao, Thomas Weißschuh, Thomas Gleixner, linux-mips,
	linux-kernel

Commit 69896119dc9d ("MIPS: vdso: Switch to generic storage
implementation") switches to a generic vdso storage, but missed to adapt
the max stack top by the number of generic VDSO pages.

Fixes: 69896119dc9d ("MIPS: vdso: Switch to generic storage implementation")
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
---
 arch/mips/kernel/process.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index 29191fa1801e..9eb5b26d4b5f 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -693,6 +693,7 @@ unsigned long mips_stack_top(void)
 	if (current->thread.abi) {
 		top -= PAGE_ALIGN(current->thread.abi->vdso->size);
 		top -= PAGE_SIZE;
+		top -= VDSO_NR_PAGES * PAGE_SIZE;
 		top -= mips_gic_present() ? PAGE_SIZE : 0;
 
 		/* Space to randomize the VDSO base */
-- 
2.43.0


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

* Re: [PATCH] MIPS: kernel: Fix reservation for VDSO area
  2025-11-17 19:18 [PATCH] MIPS: kernel: Fix reservation for VDSO area Thomas Bogendoerfer
@ 2025-11-18  1:15 ` Huacai Chen
  2025-11-20 12:13   ` Thomas Bogendoerfer
  0 siblings, 1 reply; 3+ messages in thread
From: Huacai Chen @ 2025-11-18  1:15 UTC (permalink / raw)
  To: Thomas Bogendoerfer
  Cc: Nam Cao, Thomas Weißschuh, Thomas Gleixner, linux-mips,
	linux-kernel

Hi, Thomas,

I think 69896119dc9d ("MIPS: vdso: Switch to generic storage
implementation") changes the size of VDSO data from one page to
VDSO_NR_PAGES pages, so here we need to remove "top -= PAGE_SIZE".

Huacai

On Tue, Nov 18, 2025 at 3:19 AM Thomas Bogendoerfer
<tsbogend@alpha.franken.de> wrote:
>
> Commit 69896119dc9d ("MIPS: vdso: Switch to generic storage
> implementation") switches to a generic vdso storage, but missed to adapt
> the max stack top by the number of generic VDSO pages.
>
> Fixes: 69896119dc9d ("MIPS: vdso: Switch to generic storage implementation")
> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> ---
>  arch/mips/kernel/process.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
> index 29191fa1801e..9eb5b26d4b5f 100644
> --- a/arch/mips/kernel/process.c
> +++ b/arch/mips/kernel/process.c
> @@ -693,6 +693,7 @@ unsigned long mips_stack_top(void)
>         if (current->thread.abi) {
>                 top -= PAGE_ALIGN(current->thread.abi->vdso->size);
>                 top -= PAGE_SIZE;
> +               top -= VDSO_NR_PAGES * PAGE_SIZE;
>                 top -= mips_gic_present() ? PAGE_SIZE : 0;
>
>                 /* Space to randomize the VDSO base */
> --
> 2.43.0
>
>

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

* Re: [PATCH] MIPS: kernel: Fix reservation for VDSO area
  2025-11-18  1:15 ` Huacai Chen
@ 2025-11-20 12:13   ` Thomas Bogendoerfer
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Bogendoerfer @ 2025-11-20 12:13 UTC (permalink / raw)
  To: Huacai Chen
  Cc: Nam Cao, Thomas Weißschuh, Thomas Gleixner, linux-mips,
	linux-kernel

On Tue, Nov 18, 2025 at 09:15:59AM +0800, Huacai Chen wrote:
> Hi, Thomas,
> 
> I think 69896119dc9d ("MIPS: vdso: Switch to generic storage
> implementation") changes the size of VDSO data from one page to
> VDSO_NR_PAGES pages, so here we need to remove "top -= PAGE_SIZE".

you are right, thank you. Sent v2 of the patch.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

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

end of thread, other threads:[~2025-11-20 12:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-17 19:18 [PATCH] MIPS: kernel: Fix reservation for VDSO area Thomas Bogendoerfer
2025-11-18  1:15 ` Huacai Chen
2025-11-20 12:13   ` Thomas Bogendoerfer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).