[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9a3b1c39-8c4f-6376-ff00-2e06190d0c67@c-s.fr>
Date: Wed, 15 Jan 2020 15:55:54 +0100
From: Christophe Leroy <christophe.leroy@....fr>
To: Michael Bringmann <mwb@...ux.ibm.com>,
linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
Michael Ellerman <mpe@...erman.id.au>,
Gustavo Walbon <gwalbon@...ux.ibm.com>,
Paul Mackerras <paulus@...ba.org>
Subject: Re: [PATCH v2] Fix display of Maximum Memory
Le 15/01/2020 à 15:53, Michael Bringmann a écrit :
> Correct overflow problem in calculation+display of Maximum Memory
> value to syscfg where 32bits is insufficient.
>
> Signed-off-by: Michael Bringmann <mwb@...ux.ibm.com>
Reviewed-by: Christophe Leroy <christophe.leroy@....fr>
> ---
> arch/powerpc/platforms/pseries/lparcfg.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/powerpc/platforms/pseries/lparcfg.c b/arch/powerpc/platforms/pseries/lparcfg.c
> index e33e8bc..f00411c 100644
> --- a/arch/powerpc/platforms/pseries/lparcfg.c
> +++ b/arch/powerpc/platforms/pseries/lparcfg.c
> @@ -433,12 +433,12 @@ static void parse_em_data(struct seq_file *m)
>
> static void maxmem_data(struct seq_file *m)
> {
> - unsigned long maxmem = 0;
> + u64 maxmem = 0;
>
> - maxmem += drmem_info->n_lmbs * drmem_info->lmb_size;
> - maxmem += hugetlb_total_pages() * PAGE_SIZE;
> + maxmem += (u64)drmem_info->n_lmbs * drmem_info->lmb_size;
> + maxmem += (u64)hugetlb_total_pages() * PAGE_SIZE;
>
> - seq_printf(m, "MaxMem=%ld\n", maxmem);
> + seq_printf(m, "MaxMem=%llu\n", maxmem);
> }
>
> static int pseries_lparcfg_data(struct seq_file *m, void *v)
>
Powered by blists - more mailing lists