From patchwork Wed Nov 18 18:15:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 7652091 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 09273BF90C for ; Wed, 18 Nov 2015 18:36:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 254A2205AA for ; Wed, 18 Nov 2015 18:36:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 44496204D3 for ; Wed, 18 Nov 2015 18:36:27 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zz7Ys-0002DO-8X; Wed, 18 Nov 2015 18:34:30 +0000 Received: from mail-pa0-x22c.google.com ([2607:f8b0:400e:c03::22c]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zz7Yp-00026p-QA for linux-arm-kernel@lists.infradead.org; Wed, 18 Nov 2015 18:34:28 +0000 Received: by padhx2 with SMTP id hx2so52562991pad.1 for ; Wed, 18 Nov 2015 10:34:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=/N4QE1BdWD0/Tu2Bepngb5YDiIYHVBHXxW2h6X2WiL8=; b=O0kH/UYHOIkG5qi61rQ4Fvk3ewUQIiwH2JrWQhWBVGvognSk86Z99NCZSZFT+xY5Tl N5Ab+GvyAAHUfvYUv0gt++8bXvYeFl0j6G6FQHRsnUWsxqPvrrQKSOStcbvcmKTyKz0Z 14HJ4ngvUYj+Vp25tfAZ4+D5OaOlhfYXJIKewsebIliKlmZ/khGaa/UKOavJzcE2bhOC syS9Z9YkcscYDl3k4HJPJkUAO9ImveWQKPv0cd7tF7mvyo9zTbzKi5c8HO2l8RlyQD1i eYt7TgF62U509RkgUqTuC2dmztiFVhozSNUomWG34zvnAfM+8InWXrMzpT6h5VIGExyM TSmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=/N4QE1BdWD0/Tu2Bepngb5YDiIYHVBHXxW2h6X2WiL8=; b=YDCrzv4GQKmVMH8NvcZ8QSsbtttYCixjz2sgyCKPqkYEXDnjnOTPRzSN1hqKDyszWz scwOZnoURXHgjxVTq3VGKyqIAhL0UdFRMDmLmYbtKXmzpdeFBX142gdFLqYGsO2GLLsl +RoF1g2PpRF4Q7dy20hmx2Sczk3VUWsWFWj6g01XkPWRJIUwr29Na/NZO7mXBqTwNrIK 9w7iD7rshkTPGjLoMzx1FGue/D0E6cEtI4XN1GvxZUsZmpIOqaXBB7VaMwv1Bjg+S7eY +fzA3P3c1q+xe9BlwJkkTfVFLyOKorkToBDlJwXOB7G7hDxXAF2vuItSfRfRThZdl4Qx YieA== X-Gm-Message-State: ALoCoQlpjta0ExDNMMqFVYz4Yqqmv9Un8z1TPYp8qcZGIkr91JnAn4ZfTtTSld+YjDRheKhRb/ML X-Received: by 10.69.26.36 with SMTP id iv4mr4330774pbd.0.1447871646992; Wed, 18 Nov 2015 10:34:06 -0800 (PST) Received: from yshi-Precision-T5600.corp.ad.wrs.com (unknown-216-82.windriver.com. [147.11.216.82]) by smtp.gmail.com with ESMTPSA id qj4sm5622890pbc.21.2015.11.18.10.34.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Nov 2015 10:34:05 -0800 (PST) From: Yang Shi To: Will.Deacon@arm.com, Catalin.Marinas@arm.com Subject: [PATCH] arm64: restore bogomips information in /proc/cpuinfo Date: Wed, 18 Nov 2015 10:15:05 -0800 Message-Id: <1447870505-19319-1-git-send-email-yang.shi@linaro.org> X-Mailer: git-send-email 2.0.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151118_103427_908032_53262711 X-CRM114-Status: GOOD ( 12.90 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: yang.shi@linaro.org, linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP As what Pavel Machek reported [1], some userspace applications depend on bogomips showed by /proc/cpuinfo. Although there is much less legacy impact on aarch64 than arm, but it does break libvirt. Basically, this patch reverts commit 326b16db9f69fd0d279be873c6c00f88c0a4aad5 ("arm64: delay: don't bother reporting bogomips in /proc/cpuinfo"), but with some tweak due to context change. [1] https://lkml.org/lkml/2015/1/4/132 Signed-off-by: Yang Shi --- arch/arm64/kernel/cpuinfo.c | 5 +++++ arch/arm64/kernel/smp.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c index 706679d..8d4ba77 100644 --- a/arch/arm64/kernel/cpuinfo.c +++ b/arch/arm64/kernel/cpuinfo.c @@ -30,6 +30,7 @@ #include #include #include +#include /* * In case the boot CPU is hotpluggable, we record its initial state and @@ -112,6 +113,10 @@ static int c_show(struct seq_file *m, void *v) */ seq_printf(m, "processor\t: %d\n", i); + seq_printf(m, "BogoMIPS\t: %lu.%02lu\n\n", + loops_per_jiffy / (500000UL/HZ), + loops_per_jiffy / (5000UL/HZ) % 100); + /* * Dump out the common processor features in a single line. * Userspace should read the hwcaps with getauxval(AT_HWCAP) diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index b1adc51..1bed772 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -326,7 +326,12 @@ static void __init hyp_mode_check(void) void __init smp_cpus_done(unsigned int max_cpus) { - pr_info("SMP: Total of %d processors activated.\n", num_online_cpus()); + unsigned long bogosum = loops_per_jiffy * num_online_cpus(); + + pr_info("SMP: Total of %d processors activated (%lu.%02lu BogoMIPS).\n", + num_online_cpus(), bogosum / (500000/HZ), + (bogosum / (5000/HZ)) % 100); + setup_cpu_features(); hyp_mode_check(); apply_alternatives_all();