All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pstore/ram: Fix pmsg address when per-cpu ftrace buffers are enabled
@ 2022-05-25 22:18 pso
  2022-05-26 21:47 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: pso @ 2022-05-25 22:18 UTC (permalink / raw)
  To: LKML
  Cc: Dmitry Torokhov, Paramjit Oberoi, Anton Vorontsov, Colin Cross,
	Kees Cook, Tony Luck

From: Paramjit Oberoi <pso@chromium.org>

When allocating ftrace pstore zones, there may be space left over at the
end of the region. The paddr pointer needs to be advanced to account for
this so that the next region (pmsg) ends up at the correct location.

Signed-off-by: Paramjit Oberoi <pso@chromium.org>
---

 fs/pstore/ram.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index fefe3d391d3af..3bca6cd34c02a 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -554,10 +554,12 @@ static int ramoops_init_przs(const char *name,
 			goto fail;
 		}
 		*paddr += zone_sz;
+		mem_sz -= zone_sz;
 		prz_ar[i]->type = pstore_name_to_type(name);
 	}
 
 	*przs = prz_ar;
+	*paddr += mem_sz;
 	return 0;
 
 fail:
-- 
2.36.1.124.g0e6072fb45-goog


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

* Re: [PATCH] pstore/ram: Fix pmsg address when per-cpu ftrace buffers are enabled
  2022-05-25 22:18 [PATCH] pstore/ram: Fix pmsg address when per-cpu ftrace buffers are enabled pso
@ 2022-05-26 21:47 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2022-05-26 21:47 UTC (permalink / raw)
  To: pso
  Cc: LKML, Dmitry Torokhov, Anton Vorontsov, Colin Cross, Kees Cook,
	Tony Luck

On Wed, May 25, 2022 at 03:18:55PM -0700, pso@chromium.org wrote:
> From: Paramjit Oberoi <pso@chromium.org>
> 
> When allocating ftrace pstore zones, there may be space left over at the
> end of the region. The paddr pointer needs to be advanced to account for
> this so that the next region (pmsg) ends up at the correct location.
> 
> Signed-off-by: Paramjit Oberoi <pso@chromium.org>

This looks correct to me.

Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

> ---
> 
>  fs/pstore/ram.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
> index fefe3d391d3af..3bca6cd34c02a 100644
> --- a/fs/pstore/ram.c
> +++ b/fs/pstore/ram.c
> @@ -554,10 +554,12 @@ static int ramoops_init_przs(const char *name,
>  			goto fail;
>  		}
>  		*paddr += zone_sz;
> +		mem_sz -= zone_sz;
>  		prz_ar[i]->type = pstore_name_to_type(name);
>  	}
>  
>  	*przs = prz_ar;
> +	*paddr += mem_sz;
>  	return 0;
>  
>  fail:
> -- 
> 2.36.1.124.g0e6072fb45-goog
> 

Thanks.

-- 
Dmitry

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

end of thread, other threads:[~2022-05-26 21:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-25 22:18 [PATCH] pstore/ram: Fix pmsg address when per-cpu ftrace buffers are enabled pso
2022-05-26 21:47 ` Dmitry Torokhov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.