From patchwork Tue Nov 7 11:15:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 162421 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:aa0b:0:b0:403:3b70:6f57 with SMTP id k11csp162088vqo; Tue, 7 Nov 2023 03:17:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IEl6GGqayIERkx6zhe1f6+EUTIujok/re/R1fmW3cRfI4a9Y3+IRdFM6qfXt+cLugoLnW9f X-Received: by 2002:a05:6a21:3d94:b0:180:7df:76ca with SMTP id bj20-20020a056a213d9400b0018007df76camr22986820pzc.62.1699355861160; Tue, 07 Nov 2023 03:17:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699355861; cv=none; d=google.com; s=arc-20160816; b=RNpGVhy1l0SmyS1FlH/pYSNGVPIecoHVoj7ThGmj+Xstuehd/PSMGVMMZZ5cK8p2EB 6ai/uJ4LLV1+03G43/L26+XpA962XexscYv9ba6mVNd8UZBu3vKpHlTnP8DkzQQVglpZ 8nXHhrcH25Z2PUkRnlOsDsfIF/s8n5FBeuSQrHtPKBosn+kBpeA79JBGJ1QC8RnFCsyF 0J6NbIIPGYwTjLupZaZOhuk52qG9/jp5YG6ki8CXTQmGnrvbhouIUUMoX1Ezyv2UOKtT 743A+bg6uq5fIwDRopfdcCK3yhLLuxLlb/EST2dDL+1TifFat5NhxwkRrH602xFPJuru dwCQ== 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=40sUdJj73bfBxLsZPe0Q+r0SogTHEc7qeg3Eq8ciTbw=; fh=w76ouUUcNAIj51G6iEgrLOyhlDSAnt/qoR0MDPSLYSs=; b=D3bKZ+cCiZELCxgQOuVwCSXziPX+rYj/UhKCdqNnxoxlnvDRHlA1jLwI34NTn8tQmL BYFsHrXfkFu/ZWLVLq6WuWyRqwLjr1k+voiS5LDdVFWZRWqmX+IPKNNA+cZ2XrXIQn/u 1Q8RlKBnQO/1JPXm85rfOamqxdvjE7JB8eeiW4knZAhIt6G9v//SBOV7N38VcdBZi0fm YAvrlj9N0wCvLaFfplyO8d7cQBhrsQ6A3oViBU4OsvzrUB9X9R5e+kn2OrOrzC/tEByc Cbc8rOspHFRiXf71RNpqGVHDXjhlr7o+l3pAt4JiuDXBfbU5r1mPy3MGSGxv5GwT0Xvp 9ZWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm1 header.b=0iQPVbQ8; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b="q9RxcSs/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id oc14-20020a17090b1c0e00b00276b35bc424si11114231pjb.26.2023.11.07.03.17.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Nov 2023 03:17:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm1 header.b=0iQPVbQ8; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b="q9RxcSs/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 443B7807C872; Tue, 7 Nov 2023 03:16:03 -0800 (PST) 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 S234248AbjKGLPw (ORCPT + 32 others); Tue, 7 Nov 2023 06:15:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233980AbjKGLPt (ORCPT ); Tue, 7 Nov 2023 06:15:49 -0500 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9424FED; Tue, 7 Nov 2023 03:15:46 -0800 (PST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 0E9BC5C023F; Tue, 7 Nov 2023 06:15:46 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 07 Nov 2023 06:15:46 -0500 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= 1699355746; x=1699442146; bh=40sUdJj73bfBxLsZPe0Q+r0SogTHEc7qeg3 Eq8ciTbw=; b=0iQPVbQ8mrxnoOxPg+RCSLetUnI4nXjDZjur8d0W9AebnFQ87UF PLK0QUPhQh5Iod39xjUAn2R4SZ9Ubnevttvd2Nce3yDiSx/RG+elzQvIFoClPM42 TsdG5PmrRq65FpvmUK8VKzsOhY15L6fV2UFZL68CQUQKCH3yKk5mA90NLrVh3It1 d4JAKsbtuNir779mYDDIWQ/ZbV4sa2q0XrzvSgd5G3zAnHWvQYNAdfKMWtVB+DqT qxWbb/bQVGFteOHoFnws9kuQo6WYYq5e8YfKPk2yyoZY+k3Jz4+UxodupIzBKFkF evyDa15XrpJWtSn+74Bsj37+LETS7seejKw== 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= 1699355746; x=1699442146; bh=40sUdJj73bfBxLsZPe0Q+r0SogTHEc7qeg3 Eq8ciTbw=; b=q9RxcSs/VxR/qMsDV4mTzHR9oq0hKPhQN4AMhf3kZY8qN6mjORu CWiWPm9Y5Dah7Wx81eI1OJwLNxYLz+2H1bafkIH0Gh/dlR1hsptTxKKOxwlMANKV 9P4HPl7+pm7tBq/5soXrl0jDKN3mWfFNHdsqZw9Yc5ozmto/YdL0G6fMREAMFPob whRnqvSfW9kkU4EINxhxWNDqNS7iSXNUM2s0+UWTuOj/kx+AyWnBsznFNoNyVwok TBOCxV6q3vYu63JqdAzs5NlBVcIy9HkD1q9rUi33Ch+xWGqaZwQeDz7ugM1+Z/k7 7SPaMA45wgs0I0YHgMCEYh+d7teFLdUQazg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudduiedgvdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdejnecuhfhrohhmpeflihgr gihunhcujggrnhhguceojhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomheqne cuggftrfgrthhtvghrnhepvdekiefhfeevkeeuveetfeelffekgedugefhtdduudeghfeu veegffegudekjeelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomh X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 7 Nov 2023 06:15:44 -0500 (EST) From: Jiaxun Yang Date: Tue, 07 Nov 2023 11:15:18 +0000 Subject: [PATCH fixes v2 1/3] MIPS: Loongson64: Reserve vgabios memory on boot MIME-Version: 1.0 Message-Id: <20231107-loongson64_fixes-v2-1-5c49ceed7950@flygoat.com> References: <20231107-loongson64_fixes-v2-0-5c49ceed7950@flygoat.com> In-Reply-To: <20231107-loongson64_fixes-v2-0-5c49ceed7950@flygoat.com> To: Thomas Bogendoerfer Cc: Huacai Chen , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Sergey Shtylyov , Jiaxun Yang , stable@vger.kernel.org X-Mailer: b4 0.12.4 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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]); Tue, 07 Nov 2023 03:16:03 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781903771736578866 X-GMAIL-MSGID: 1781903771736578866 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 --- v2: - Fix typo in commit message (Sergey) --- 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