Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp957353yba; Fri, 3 May 2019 13:21:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqwNMq8ZlN92bHmOBBvK9a77IR39tmbpaxTOJn5+CAxpJlk6WMG5bCzZRrEOhOZs7y3/Aysx X-Received: by 2002:a63:30c5:: with SMTP id w188mr13176011pgw.76.1556914900507; Fri, 03 May 2019 13:21:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556914900; cv=none; d=google.com; s=arc-20160816; b=NFkUnqub4zq/asSAHRV0XfGueLQfG5X3RqGw7NbAyIvfWHxqhcXAKUljbmr22iuGqO ZWy64cs9ZIiUQHPCk4dManRBdQVmhH/hRinoi5cMX3SHUEvqYdSRQjbCGiOOgXEWXyG3 c+Q3WIB/2bve5oU+Qwh98s2M80TPE3MBo6zdVDGxXkSp4boqzCwIMSURUwAIoR3tA139 2yk95f+oytbIEh0C0InaofQcytLMrXQrcRs4V/iB5h5etGaPWGBvNOfBJF2g37Tl4HIk Pu2sF2iq61KgtN95LlJqGohwfqF0tR2+E3tHwRCP6kLwEufH/QkDXSmvsrhK024czXO5 Qgiw== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QQUuLg/zS2tfsDPJ/SWrp4NtSrhhV6zRMowLIWOaos8=; b=Se0HFxu3bOLkxTrhAATFaQlh/pqpZ0aTCGrZBKoa0PYUlly66vZeAx45HzIL8gZB9f l7WNliHi8Wpvs+nvqUSMsc2mU9G/fIlsjnnkZa963jSd6tzvaRcslwJuO9aQalg6IKHU hWDFtJDFdiJjQx65XiG75cbQ02bHyy6FZWVwz5E/ASlNNK8TnvuGBhJMGXhp24qO5q3m 8bMu+qbnceSrqduJJNbzJHZBItIAihpmRhCPk9TO9/09R7TWIfq9n/rNq9qKJqHg/0sd D9LcM/yhVx/GEBHmgXDuBkU4uh+H1c3485ES5W1VSr9fh83PBkdXrOGZfU2NON0aQF8I NnAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tscQTSsd; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5si3408403pgw.359.2019.05.03.13.21.12; Fri, 03 May 2019 13:21:40 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=tscQTSsd; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728833AbfECRvn (ORCPT + 99 others); Fri, 3 May 2019 13:51:43 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:34950 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728801AbfECRvk (ORCPT ); Fri, 3 May 2019 13:51:40 -0400 Received: by mail-lj1-f194.google.com with SMTP id z26so1121757ljj.2; Fri, 03 May 2019 10:51:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QQUuLg/zS2tfsDPJ/SWrp4NtSrhhV6zRMowLIWOaos8=; b=tscQTSsdX0uvuETo/lXEstXhGPV0xHg/5z2O/HEl0htSa4teJd7jROGZofZeXoQZGh m1Bq80/JmIXmHOHRVSPOuqsOerDSouwC+CQpCGNWsrK1AwGmBg+ll2XvWyRTxyL7ILZ8 NPx4IpkHxAMGOGRlxRviY2nnK2LOgdYWyzhbCZgAU1AnXaS8oWVRARWcdoVhdIiKAQMo fESSlfH1Y1icYTKhb4BX5TGxLcS01E9wzo5MIcyPujHTLhwf3mEjuJg8t4BoKDDHqUbK 0qzZgWd94RIHJQ9A93WCcJv4f9WW+CGmYBsDn97N+8dpuWTH8pqM3GM+92rdkHdMDPVZ c1Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QQUuLg/zS2tfsDPJ/SWrp4NtSrhhV6zRMowLIWOaos8=; b=alBdZexBALKFE229Ozs5wE1IxqFvokjR5zw24PPN+1aj68Rsn6Tu7Fg+QQWTYJuc44 6D7wxRXwjzXzh8LaR3hoCKAWk9kS+vSSdI/Q0rqevnVNVum1i9b7zyZVUmFIcXExYSuU ZbowZP/VZTRDinPAMY3m8U85pEnCzwT7JlaJDwrs3pZQu5kDBHkcff/8SkqJDE8vQ5cO 2WAR8Txi9wzIdgRWo8k7+dGhbocgzKO9rR5KvQsgDWQYh7zgn1LzZv76tAn8zbCZxGcY vsvtHyx0ZvkOKtqh7FwI+EcggfB3AJey3RUWPrL14OmEK1OjinD4FQBxzR1hocfQnoct aF8Q== X-Gm-Message-State: APjAAAUyk5L3nbm5rkjrFHVVK5MLCoXoYhy/9+S6IMYRJWQlNVk+YMqp mH812+Q6VufkwXm206HoW84= X-Received: by 2002:a2e:2d02:: with SMTP id t2mr5293405ljt.148.1556905898225; Fri, 03 May 2019 10:51:38 -0700 (PDT) Received: from localhost.localdomain ([5.164.217.122]) by smtp.gmail.com with ESMTPSA id z30sm533435lfb.87.2019.05.03.10.51.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 May 2019 10:51:37 -0700 (PDT) From: Serge Semin To: Ralf Baechle , Paul Burton , James Hogan , Mike Rapoport , Andrew Morton , Michal Hocko , Greg Kroah-Hartman , Thomas Bogendoerfer , Huacai Chen , Stefan Agner , Stephen Rothwell , Alexandre Belloni , Juergen Gross Cc: Serge Semin , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Matt Redfearn Subject: [PATCH v2 2/5] mips: Perform early low memory test Date: Fri, 3 May 2019 20:50:38 +0300 Message-Id: <20190503175041.7949-3-fancer.lancer@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190503175041.7949-1-fancer.lancer@gmail.com> References: <20190503175041.7949-1-fancer.lancer@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org memblock subsystem provides a method to optionally test the passed memory region in case if it was requested via special kernel boot argument. Lets add the function at the bottom of the arch_mem_init() method. Testing at this point in the boot sequence should be safe since all critical areas are now reserved and a minimum of allocations have been done. Reviewed-by: Matt Redfearn Signed-off-by: Serge Semin --- arch/mips/kernel/setup.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index ca493fdf69b0..fbd216b4e929 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c @@ -826,6 +826,8 @@ static void __init arch_mem_init(char **cmdline_p) __pa_symbol(&__nosave_end) - __pa_symbol(&__nosave_begin)); memblock_dump_all(); + + early_memtest(PFN_PHYS(min_low_pfn), PFN_PHYS(max_low_pfn)); } static void __init resource_init(void) -- 2.21.0