Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp6578597ybl; Wed, 15 Jan 2020 06:58:27 -0800 (PST) X-Google-Smtp-Source: APXvYqzXtb7I3+osRV5GAcmzUB/DIuoaCrELTU7gWk1wLhwj6km8s26Fj1oO0MOtGcqWtGv0a9mt X-Received: by 2002:aca:c30d:: with SMTP id t13mr109346oif.166.1579100307506; Wed, 15 Jan 2020 06:58:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579100307; cv=none; d=google.com; s=arc-20160816; b=u6Zzi9aTc6IXnwdfK1hv5+zTYaAao+XsBm2O1tLFJdKivt2PKEY+cf3kUNEhYY22uo l6kl146AtDNAstPy6ZbdPK+/5EsEL3HDw5PxnnfjfxRwIZbhjbd7C5HqtoWoqtXUARN8 SF1fRTPTjywOZ/oJT7/5Kte6cx/qEKsb99JZDp5atGdIgg4JvFTUrx3CrmwpReozMYR+ wVaDZOfYu8S1piqKZmRAojFKj4C7t1kIlrFxQkfRh50ywJWuxBUWcpPKwBvvIqNU1u5D fuHezHBTrQBGsyRYpb1+bGVq4M6UJPuAR9SYhoMaiZhQyf7K/El1mKHgUANB3M3GW8Db te/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature; bh=drzSvcOTpHXGDw4v5FPxHbIJiwf/PfYcxldvnk1kSwk=; b=vcbeySw2JlZtx/XBSzYXtsE2518N8D2vbxAQeT60vNRuUzcpK/eFiBNwReehQHN3Nd R8t5MBkT3jcuTHv+B7XzkFxtWe++D3dCou5YRDUotCLxJtVgY/8NgfFWeW8o1PSmlaAr kLL9syQuLNo7sBZRFsiHPH1emFGd2jIiKV6kmrcHeeGHfXh5Tf28rM1xE4f4BkiT2Z8s vS/Bq71PCuhk7hBDNt23esVh0pZ5XIu4TNMJ7x4lIb/FQgZmcqRCDDt289mpecqvEScQ cQRZATs1OX8AjuhWyjPPvP3hZrMFVqE0DNM2TUW5ylfjXctxz6RjI26J2Qqv98Y64S4P A6AA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=WBcizLfB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c19si11309545otp.3.2020.01.15.06.58.14; Wed, 15 Jan 2020 06:58:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=WBcizLfB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729066AbgAOOz4 (ORCPT + 99 others); Wed, 15 Jan 2020 09:55:56 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:9046 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726248AbgAOOzz (ORCPT ); Wed, 15 Jan 2020 09:55:55 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 47yVkd1L6Qz9tylV; Wed, 15 Jan 2020 15:55:53 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=WBcizLfB; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id yej87JrYwKck; Wed, 15 Jan 2020 15:55:53 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 47yVkd0G7Zz9tylT; Wed, 15 Jan 2020 15:55:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1579100153; bh=drzSvcOTpHXGDw4v5FPxHbIJiwf/PfYcxldvnk1kSwk=; h=Subject:To:References:From:Date:In-Reply-To:From; b=WBcizLfBm8MCg5j0/7mTLx79/XdaaeLBVsccrdfLkd25w0FQKLPdjjv2cEs65IzaG n7kbUMCh+PZxCzwPJMNrVX+L9UuptNN6BSkmJe/H8+LBkp0v3k/wUYLdqKncLAGHca 1HF86g2D7YcBKJ5kr3I0fUYximDPIOfMNE5i8k8k= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 82FF08B805; Wed, 15 Jan 2020 15:55:54 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id 4a6NedTi81Jj; Wed, 15 Jan 2020 15:55:54 +0100 (CET) Received: from [172.25.230.100] (po15451.idsi0.si.c-s.fr [172.25.230.100]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 60D828B774; Wed, 15 Jan 2020 15:55:54 +0100 (CET) Subject: Re: [PATCH v2] Fix display of Maximum Memory To: Michael Bringmann , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Michael Ellerman , Gustavo Walbon , Paul Mackerras References: <5577aef8-1d5a-ca95-ff0a-9c7b5977e5bf@linux.ibm.com> From: Christophe Leroy Message-ID: <9a3b1c39-8c4f-6376-ff00-2e06190d0c67@c-s.fr> Date: Wed, 15 Jan 2020 15:55:54 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <5577aef8-1d5a-ca95-ff0a-9c7b5977e5bf@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Reviewed-by: Christophe Leroy > --- > 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) >