Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp1582570img; Wed, 27 Feb 2019 01:44:30 -0800 (PST) X-Google-Smtp-Source: AHgI3IZP1Kv3MzQT6tZ1u0EImy+r1R21jhPxfno1QD0E2P1mXbsTqzKaX+OyP8flilS6K1mtzGHN X-Received: by 2002:aa7:9286:: with SMTP id j6mr725827pfa.47.1551260670818; Wed, 27 Feb 2019 01:44:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551260670; cv=none; d=google.com; s=arc-20160816; b=EJfwzSmt0ewPBXIagPDKz4ddVLUDXu+iLzG8bRTOXIj1FoPnO0tI944hvqOfN3+pDH H7hcaxM+6zui1pgrlwuJJQWoVhUnL37s01QckxaIzRTxMw/BBiS0/E5KPD4BGOyXcQtV YIRHvp2jNDbnQWrAbrbhyJ82MjufCRLOduW1MPZog4bwXrGNVNvEuNdUL3jrol3knBg7 19driQ6rowH2z9xg2/AyuTLELpos3GR5it2qvEcOjwUfrDtRMVAgWg3ge7Eadt8ApzKj ekTqjMbfpuyENJPAc+9y4StQqNR9s4Zexwg1MuJljAGwwEboTfIZ3+46NaTy0cygINgN 7uuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=5tHO7JgbuOQNsfESnWzr+gOewGdgIfdNhpBbbMNz0vI=; b=x7GOG98AHtLNQbB/98i2Fr7Zd28u81FXUn+W7276wc231S1SWE3IMrm1M9ea1q7wjl JuWgOVEuBEJDkN4CJh3XUeg/jeVAyMdSrB543xSlcYpsvKP0W6BxdpbHZGvSnYpX7Jkv ZgY1aj5PJuD30hdPx3wxwY3cF9nlJwDnqLA008hrgSa9qeAikagArrGGzbPzJbmK0JhL A7kExVX2MVaTBl8T0+kVSjCWZXksniG/tzyySPzb6cCGyEVl3vim94I/uex+dsfOc+aw e62GEjebnqu1h7L8PqHnY8jcBZixY6SH0UK9pkNmLuFMmDjPYGHj4WtcUhZbeTpasoib KXBQ== 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 e2si14206674pgs.387.2019.02.27.01.44.15; Wed, 27 Feb 2019 01:44:30 -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 S1729868AbfB0JnL (ORCPT + 99 others); Wed, 27 Feb 2019 04:43:11 -0500 Received: from mx2.suse.de ([195.135.220.15]:33122 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725881AbfB0JnL (ORCPT ); Wed, 27 Feb 2019 04:43:11 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D4D9FADFB; Wed, 27 Feb 2019 09:43:09 +0000 (UTC) From: Thomas Bogendoerfer To: Ralf Baechle , Paul Burton , James Hogan , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Mike Rapoport Subject: [PATCH v2] MIPS: fix memory setup for platforms with PHYS_OFFSET != 0 Date: Wed, 27 Feb 2019 10:42:56 +0100 Message-Id: <20190227094256.7658-1-tbogendoerfer@suse.de> X-Mailer: git-send-email 2.13.7 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For platforms, which use a PHYS_OFFSET != 0, symbol _end also contains that offset. So when calling memblock_reserve() for reserving kernel the size argument needs to be adjusted. Fixes: bcec54bf3118 ("mips: switch to NO_BOOTMEM") Acked-by: Mike Rapoport Signed-off-by: Thomas Bogendoerfer --- arch/mips/kernel/setup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index 8c6c48ed786a..d2e5a5ad0e6f 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c @@ -384,7 +384,8 @@ static void __init bootmem_init(void) init_initrd(); reserved_end = (unsigned long) PFN_UP(__pa_symbol(&_end)); - memblock_reserve(PHYS_OFFSET, reserved_end << PAGE_SHIFT); + memblock_reserve(PHYS_OFFSET, + (reserved_end << PAGE_SHIFT) - PHYS_OFFSET); /* * max_low_pfn is not a number of pages. The number of pages -- 2.13.7