Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp586917ybm; Wed, 27 May 2020 03:05:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/5k3SlQdmQjqWZgpEjCvuZgi4E/jdqi4lxKfYWi4UbRlWOZq0g+/B1edLCybGCT7bXXwI X-Received: by 2002:aa7:cf12:: with SMTP id a18mr17772457edy.193.1590573923645; Wed, 27 May 2020 03:05:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590573923; cv=none; d=google.com; s=arc-20160816; b=rjfRWciZwHwwOptuWNeAYHwOeJWf2FXXbJt9QqKGk2ULlz1NAHVIK9ot3DfevQELWK F3+GH4GqM4r70F/fdXkS3Qj5/i3HqKlElMZg2f+3OQdbyECGo3poBltVBhT2pdOp0Tej gw2ZvJ6Jex3/VztZwloHtJ2B7omBt4MrIKKMsGbB5BAWgGoxOuJTrq0Q6GWsL9glt0Tq RsHic6zG9XJ1YUDWmuPTrzze8QeXkYPkg3o5AEE9eTTrHB9i6EdzKhwBofu0N2EvMpYQ dF4z6IJOcHcBIYPsKvTrMXEvVgNWARlTXIHyEbjjpLIRx6unnJBmRFaE0nuMLTuyiMcI MjOw== 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=GE7rB7GAzPsyNiomPxQcdWte0TNxcueSUIriQ1y5ZkA=; b=FqRw2ioFwsMNMw3jrpXwMiHKqqlvV1koOxb2NKqKERHmyXj9CiZGQ9DfWC/gfWiNmO 8Qp8VNrCigU5mKUs7WuEOtjaezt4V3AX98UjvI8iIuv/alBUmheP3B/C99ZbxfeIsN4f B9SWrT7wUknYUNrKGsY7D2RK/U165L0U5p8xHeU2Qch2Ho63hgsuKzjQKeazIaCBSOSn UW5LCiGJGwfh3d+A82OQZP0L+WnEUSWzsJW5Vrz5ZLU9mw6Olfuz8iYbtLKpz7NBEmk3 eFaHbDCKKY7FRg6pyAL39IIvGVYvhbypv/aVviN1irc4990BQEjKstt93MlzvBKu1Vws ieig== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@flygoat.com header.s=vultr header.b=XZ0Zn1op; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i64si1292948edd.574.2020.05.27.03.05.00; Wed, 27 May 2020 03:05:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@flygoat.com header.s=vultr header.b=XZ0Zn1op; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728732AbgE0Gfs (ORCPT + 99 others); Wed, 27 May 2020 02:35:48 -0400 Received: from vultr.net.flygoat.com ([149.28.68.211]:34432 "EHLO vultr.net.flygoat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725613AbgE0Gfs (ORCPT ); Wed, 27 May 2020 02:35:48 -0400 Received: from localhost.localdomain (unknown [IPv6:2001:da8:20f:4430:250:56ff:fe9a:7470]) by vultr.net.flygoat.com (Postfix) with ESMTPSA id A176620D28; Wed, 27 May 2020 06:35:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=flygoat.com; s=vultr; t=1590561348; bh=8VJCyc5wm9dKhC2IY7gypReS7SA7o6U7AMsatbtINZ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XZ0Zn1opBlPlBfjOREAlapSbP9ADeBrZfSfMD96IAxVJObeKG8JkmBPu0FEWasWRy 5HuwMrMD2kSToT4+tVgQN963tCamjyLqz0jsPbheM1F0sQ0kxYAdx/tsSMC4cbjHua eZ6FPZjbJhIaJONnfwYRNYuDixbbitMCE87CjRKUP76JeEWWvMuQn3X5mpvxpIBqv+ AlxC74J/sErJX23qeO0d64Mo9C+Rr1u601DWNK995ZUTJXMgwBEduAQMXkZZcBZWyr yG/vINsV8YRySjwA14AR/P7WGVFHUYzM2Rm8PJxbqWYI4IotPTdmGF1p7PdYQbdNVd 67q927/Vw84Bw== From: Jiaxun Yang To: linux-mips@vger.kernel.org Cc: Jiaxun Yang , Thomas Bogendoerfer , Kees Cook , Borislav Petkov , Heiko Carstens , Fangrui Song , linux-kernel@vger.kernel.org Subject: [PATCH v2 2/3] MIPS: Move kernel head into a standalone section Date: Wed, 27 May 2020 14:34:33 +0800 Message-Id: <20200527063438.391949-3-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.27.0.rc0 In-Reply-To: <20200527063438.391949-1-jiaxun.yang@flygoat.com> References: <20200527063438.391949-1-jiaxun.yang@flygoat.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 That's what already done by Arm64 and other architectures. That would allow us put more things like PE headers safely into the header. Signed-off-by: Jiaxun Yang --- arch/mips/kernel/head.S | 4 ++-- arch/mips/kernel/vmlinux.lds.S | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S index c7c2795837e7..8081a905a71c 100644 --- a/arch/mips/kernel/head.S +++ b/arch/mips/kernel/head.S @@ -59,6 +59,8 @@ #endif .endm + __HEAD +_head: #ifndef CONFIG_NO_EXCEPT_FILL /* * Reserved space for exception handlers. @@ -67,8 +69,6 @@ .fill 0x400 #endif -EXPORT(_stext) - /* * Give us a fighting chance of running if execution beings at the * kernel load address. This is needed because this platform does diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S index f185a85a27c1..b9ace667b82b 100644 --- a/arch/mips/kernel/vmlinux.lds.S +++ b/arch/mips/kernel/vmlinux.lds.S @@ -57,8 +57,12 @@ SECTIONS #endif . = LINKER_LOAD_ADDRESS; /* read-only */ - _text = .; /* Text and read-only data */ - .text : { + .head.text : { + _text = .; + HEAD_TEXT + } + .text : { /* Real text segment */ + _stext = .; /* Text and read-only data */ TEXT_TEXT SCHED_TEXT CPUIDLE_TEXT -- 2.27.0.rc0