Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp986344rdb; Wed, 1 Nov 2023 08:17:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEmSiOY5rWHdkkWMb8tynFQF8OQ1YWrmJdFZVzXDqDsGJeoBf43IMmgLnAAC6xWADUjQ+PT X-Received: by 2002:a17:90b:3887:b0:27d:433e:e69c with SMTP id mu7-20020a17090b388700b0027d433ee69cmr8261608pjb.18.1698851850421; Wed, 01 Nov 2023 08:17:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698851850; cv=none; d=google.com; s=arc-20160816; b=lmi40Y76N18g+0hPiXxaLWjR5flz5MdjPnp7NMSxsqFglaWwZzqi8GAPK+RKTuZSb6 vNqGVDU+iA1jIFWE4jN5JvoiFv5WsR5/drBGrmhATCbmFp2TDD6lIGXqPwuCGrwURlkJ 7fsnDSTF+pLMFhaBspywC6oPLu2NXVUZrkH6oQ++/+uG1+Owyc+q07PLYf2O338D/hKy Edr9+gwsSPKt+T0m/jpDT+09X3UlCc0abmxdC74ceRl7dBDSnrT2IbZs4jFv088WRjOS Wpzvw6UbHDjN/f+HQH0zaoBSZAD2O0z0ceqQ61ReTThX+Nolb+VmT1x9EC9T/35qMJi5 QDaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :feedback-id:dkim-signature:dkim-signature; bh=rfJ8NsCUvbCjddA6Gq2JRigs1j0SZ4J6oShnKu8GER4=; fh=7IIVG7Z5uBUiGqF92YYc9bge9oWMe+bYNkQEjjS1HU8=; b=X4S91QTDENOM4YUoptUUxClKhO2pCvdErLBZlFf98uBBHIah8wVy5SNkVYCSFQ7EWQ LiAr4kuWZaA+MmcFLWkDlaFRo+fgTwNvTZwyXINuh1GAC1cmftz1BTyPKIJFDtFvRW4G ITijLFW+p1r/b6xh5JHiqe2u1d926VcYfy+5T/usad2JW7HKHnzCmfJDE6juKFXrJI0O t58X3/Ne4vPnBzPFoXGZQ3TUcsnhEt/eKeOpEKZLTHw9RjzcHvy17XkBPwxE237/YzHl uES7imWtLRGQvtw9iLTdQvA/BZqadgm3Y3Vx/VfVfyir4WmE45GTfl8jU6eDj9FWyDhZ ZWOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm1 header.b=VvkLJUB5; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=cbTM0SnO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id nn7-20020a17090b38c700b002808736e2b3si1113359pjb.142.2023.11.01.08.17.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 08:17:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm1 header.b=VvkLJUB5; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=cbTM0SnO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 22AC48129E36; Wed, 1 Nov 2023 08:17:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233717AbjKAPRX (ORCPT + 99 others); Wed, 1 Nov 2023 11:17:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233321AbjKAPRT (ORCPT ); Wed, 1 Nov 2023 11:17:19 -0400 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A751125; Wed, 1 Nov 2023 08:16:46 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 0FBB65C0282; Wed, 1 Nov 2023 11:16:46 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 01 Nov 2023 11:16:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1698851806; x=1698938206; bh=rfJ8NsCUvbCjddA6Gq2JRigs1j0SZ4J6oSh nKu8GER4=; b=VvkLJUB5wsNp4XJ1T/zesbCIIT7H4cwSpZB/KyQBKVwRGP4uDz/ 0pwUzkliwMAd06C3IWgl5ybLGCI4V7pUUoE5vZOUkbo2sAWjsuNl/iaw5Aqu3V7L Vu95r2911bwaCKJix33axtmfuXwWLbl28NDRFT90Er3kuloGBgrAPVD2fTaFoqcW mzFS7/TvNCH9PbcoqakGnVuu4qQj1w6Z+jMShTDpfwMunSP+ToTxS2TzPUkW4ly8 sZ6VEfEO0C8leGUsY1FGj1aOBUZkcNlcmAPRp8PJQpKRwGCyFJATWgzqf6oqnwML Ki3hkBUnCcis3inEQDxbALpc1vwQe3MbTqQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1698851806; x=1698938206; bh=rfJ8NsCUvbCjddA6Gq2JRigs1j0SZ4J6oSh nKu8GER4=; b=cbTM0SnOeM9q1h/gSBazmSH+cMBcKmsWGsirLvXuVuWD7PQguTR IqPsrYL8v615lBNIEZ+Mj1v6J+gs5v/b8HTDa+DHfjL1g6WwXYPnNGC/GwiHcvW4 1ody6RBWX79ch4YfdzSmauffviFUNoqTe/ONRWxFKCaT0pkWhVmc7CwHkwo9AvE9 K3LB+PE7p5c1LEK/ECPCXDSto9dSC2HH6Vs/1N9WrsQIglI8uEfVTEozJZ9jptdc NO7y6k0vE3pmcZI3JYUDdzKLoXVe3he7k2FvCF2DuN0se6HZcCZwI9Fd5hcl/GgW DUiLVD5GyUkd3biSsZhM+Bxy/35rQEqzIcg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedruddtgedgjeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdejnecuhfhrohhmpeflihgr gihunhcujggrnhhguceojhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomheqne cuggftrfgrthhtvghrnhepvdekiefhfeevkeeuveetfeelffekgedugefhtdduudeghfeu veegffegudekjeelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomh X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 1 Nov 2023 11:16:44 -0400 (EDT) From: Jiaxun Yang Date: Wed, 01 Nov 2023 11:39:07 +0000 Subject: [PATCH fixes 1/3] MIPS: Loongson64: Reserve vgabios memory on boot MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20231101-loongson64_fixes-v1-1-2a2582a4bfa9@flygoat.com> References: <20231101-loongson64_fixes-v1-0-2a2582a4bfa9@flygoat.com> In-Reply-To: <20231101-loongson64_fixes-v1-0-2a2582a4bfa9@flygoat.com> To: Thomas Bogendoerfer Cc: Huacai Chen , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Jiaxun Yang , stable@vger.kernel.org X-Mailer: b4 0.12.4 X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DATE_IN_PAST_03_06, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 01 Nov 2023 08:17:29 -0700 (PDT) vgabios is passed from firmware to kernel on Loongson64 systems. Sane firmware will keep this pointer in reserved memory space passed from the firmware but insane firmware keeps it in low memory before kernel entry that is not reserved. Previously kernel won't try to allocate memory from low memory before kernel entry on boot, but after converting to memblock it will do that. Fix by resversing those memory on early boot. Cc: stable@vger.kernel.org Fixes: a94e4f24ec83 ("MIPS: init: Drop boot_mem_map") Signed-off-by: Jiaxun Yang --- arch/mips/loongson64/init.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/mips/loongson64/init.c b/arch/mips/loongson64/init.c index ee8de1735b7c..d62262f93069 100644 --- a/arch/mips/loongson64/init.c +++ b/arch/mips/loongson64/init.c @@ -88,6 +88,11 @@ void __init szmem(unsigned int node) break; } } + + /* Reserve vgabios if it comes from firmware */ + if (loongson_sysconf.vgabios_addr) + memblock_reserve(virt_to_phys((void *)loongson_sysconf.vgabios_addr), + SZ_256K); } #ifndef CONFIG_NUMA -- 2.34.1