From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B09B7C433E0 for ; Thu, 28 May 2020 12:00:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 87A24215A4 for ; Thu, 28 May 2020 12:00:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590667252; bh=EbX82Yzt8Q0VSvMLZGGbjmMR+0pvA1lN1B3Jn3//PhY=; h=From:To:Cc:Subject:Date:List-ID:From; b=O24g34k/jkj35sZbU/7tOynZfVzROFStP63Rkvhzk7ZaCrJB2/pdvkF/OCu8IWtHp dMwhSb8Rh/fcxKfeJyVWnUB+uZWTouV2+IZxpdIzlFBrzwowBgLmi1F2k3GkOU3Tnw qCWs1yAC58F10nDdEbnFSro6B9QWgNH42vc7NB6c= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389433AbgE1MAv (ORCPT ); Thu, 28 May 2020 08:00:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:50844 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389166AbgE1L6C (ORCPT ); Thu, 28 May 2020 07:58:02 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7D8F421655; Thu, 28 May 2020 11:58:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590667082; bh=EbX82Yzt8Q0VSvMLZGGbjmMR+0pvA1lN1B3Jn3//PhY=; h=From:To:Cc:Subject:Date:From; b=piGuzNpp6sdsn3O+7188R25mgF8wHRj0Yxy+oO9qLE+DvwtMn8kdT8a1C3ICEeZSv YpJuBidT+18SdL0VX8rGADI7OMyI24ozR4/5Wh5t+8KRK0DJziHeu2h8HlmAZBL/tq K7u8oqgfvmk3IWrIPMfGQXP09k2AyW3K2SV1iTfM= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Eugeniy Paltsev , Paul Greco , Vineet Gupta , Sasha Levin , linux-snps-arc@lists.infradead.org Subject: [PATCH AUTOSEL 4.9 1/9] ARC: Fix ICCM & DCCM runtime size checks Date: Thu, 28 May 2020 07:57:52 -0400 Message-Id: <20200528115800.1406703-1-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eugeniy Paltsev [ Upstream commit 43900edf67d7ef3ac8909854d75b8a1fba2d570c ] As of today the ICCM and DCCM size checks are incorrectly using mismatched units (KiB checked against bytes). The CONFIG_ARC_DCCM_SZ and CONFIG_ARC_ICCM_SZ are in KiB, but the size calculated in runtime and stored in cpu->dccm.sz and cpu->iccm.sz is in bytes. Fix that. Reported-by: Paul Greco Signed-off-by: Eugeniy Paltsev Signed-off-by: Vineet Gupta Signed-off-by: Sasha Levin --- arch/arc/kernel/setup.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c index 9f96120eee6e..82464fae7772 100644 --- a/arch/arc/kernel/setup.c +++ b/arch/arc/kernel/setup.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -333,12 +334,12 @@ static void arc_chk_core_config(void) if ((unsigned int)__arc_dccm_base != cpu->dccm.base_addr) panic("Linux built with incorrect DCCM Base address\n"); - if (CONFIG_ARC_DCCM_SZ != cpu->dccm.sz) + if (CONFIG_ARC_DCCM_SZ * SZ_1K != cpu->dccm.sz) panic("Linux built with incorrect DCCM Size\n"); #endif #ifdef CONFIG_ARC_HAS_ICCM - if (CONFIG_ARC_ICCM_SZ != cpu->iccm.sz) + if (CONFIG_ARC_ICCM_SZ * SZ_1K != cpu->iccm.sz) panic("Linux built with incorrect ICCM Size\n"); #endif -- 2.25.1