Received: by 10.223.185.116 with SMTP id b49csp3854876wrg; Tue, 13 Feb 2018 08:45:07 -0800 (PST) X-Google-Smtp-Source: AH8x225QTx+fIsNzwMlIkL194bBUVJL8O87N3ZGuYI7xMUPuyXKptVoSkiB5Sig/vjlOmsYYYBo1 X-Received: by 10.98.57.146 with SMTP id u18mr1801814pfj.237.1518540307764; Tue, 13 Feb 2018 08:45:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518540307; cv=none; d=google.com; s=arc-20160816; b=nCiWW5YarfKNnqsMzVxg2riIHY1XOpSebOeORDfzSnx3iUQ6O9BW8P28FN3mlMAHRt D5zNcBRwcm9i5EVVHcVEmeOfvRDQHY9SrpHNjp5E5xsXrLxmDRZrohisK4gGB7P2dP+Z z5FkgawXWgSpjNqRXYjCL6bfF+8HaDmcvsWr6wfOiQoV5XCiq1OC0C9IUuohn28Lp+tN qu6yZOj53AAxe/MXwiXNiH7C31ZfegAp9mroH65E8LT+ftBRjelp7z/giQj6KzGInrW8 CXAnZB/lOiCK9Cqjp1cYn0m/HS3aMxfvdGJhallQltrZaJ9z60CBpn/a1hujF7k0GdRl XDzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date :arc-authentication-results; bh=O7IqPhO1r8Zx1aCbRr/MdhkCf+QKJDMLWZBjtmCWPLE=; b=N2HAhwwOJEFH2nVp6CLWGYIvW7Lt3Ng2/Fl0CzpraFebiQYgfsgYYj5EzkxRLz7yY4 wlKZm83T4WC3es9JONC59TULGncoIxMrY2JqRQ1P30iS6p6jYtujLYtfKC4hu+4T3Hrq Ww5F+DqHquN6l6Cg7XPVSK+F00sRo9XjBYzgsYjtS3/bbL87d+Z2M8/vcai3EbZaWgk+ xsvrvF3RPMo0Yh3ahbENumrlDABdez260tl1o1qR5h3hsPPHDVeooEZuDLan3otqKK0a 8xLnPPQ/civilUiErdk6e42/2V1wepON/wIEvy3PUrsXn6miLY/CTSBiXjMufXK2vnIn ayQg== ARC-Authentication-Results: i=1; mx.google.com; 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 u85si19691pfi.5.2018.02.13.08.44.52; Tue, 13 Feb 2018 08:45:07 -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; 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 S934933AbeBMQoI (ORCPT + 99 others); Tue, 13 Feb 2018 11:44:08 -0500 Received: from gateway22.websitewelcome.com ([192.185.46.131]:36670 "EHLO gateway22.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934779AbeBMQoH (ORCPT ); Tue, 13 Feb 2018 11:44:07 -0500 Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway22.websitewelcome.com (Postfix) with ESMTP id 6BADD1C4F0 for ; Tue, 13 Feb 2018 10:44:06 -0600 (CST) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id ldgce31HnuMnyldgceiY15; Tue, 13 Feb 2018 10:44:06 -0600 Received: from [189.175.4.238] (port=35024 helo=embeddedor) by gator4166.hostgator.com with esmtpa (Exim 4.89_1) (envelope-from ) id 1eldgb-0013xh-UM; Tue, 13 Feb 2018 10:44:06 -0600 Date: Tue, 13 Feb 2018 10:44:04 -0600 From: "Gustavo A. R. Silva" To: Borislav Petkov , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org Cc: linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" Subject: [PATCH] x86/microcode/intel: Use 64-bit arithmetic instead of 32-bit Message-ID: <20180213164404.GA11664@embeddedor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 189.175.4.238 X-Source-L: No X-Exim-ID: 1eldgb-0013xh-UM X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedor) [189.175.4.238]:35024 X-Source-Auth: garsilva@embeddedor.com X-Email-Count: 6 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add suffix ULL to constant 1024 in order to give the compiler complete information about the proper arithmetic to use. Notice that this constant is used in a context that expects an expression of type u64 (64 bits, unsigned). The expression c->x86_cache_size * 1024 is currently being evaluated using 32-bit arithmetic. Addresses-Coverity-ID: 1464429 Signed-off-by: Gustavo A. R. Silva --- arch/x86/kernel/cpu/microcode/intel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c index f7c55b0..e5edb92 100644 --- a/arch/x86/kernel/cpu/microcode/intel.c +++ b/arch/x86/kernel/cpu/microcode/intel.c @@ -982,7 +982,7 @@ static struct microcode_ops microcode_intel_ops = { static int __init calc_llc_size_per_core(struct cpuinfo_x86 *c) { - u64 llc_size = c->x86_cache_size * 1024; + u64 llc_size = c->x86_cache_size * 1024ULL; do_div(llc_size, c->x86_max_cores); -- 2.7.4