Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp824804ybm; Wed, 27 May 2020 08:53:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLPg2MXdS2vXHjs0x0Sa2gk+ugCU/+Y8bcKTZ8VrfGut3oZoyARjcnKzGdDw1rAUuxUwLz X-Received: by 2002:a17:906:6841:: with SMTP id a1mr6897981ejs.271.1590594806502; Wed, 27 May 2020 08:53:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590594806; cv=none; d=google.com; s=arc-20160816; b=xff7yFe/Jf6F3CbaFfrdbApb7I//OIxcIvJPTs6SlJwYupv+9WGe2j0mwsQe4PfP32 oZazqXZJlzgJYeqwjDFtuZJwEhbcEXWVaobFyFB8OxcZGqKX5DE9cD15rKyL6dkf4kwb AxT36PpABtZR4DO8mGXekjQxquYLNgGBRytu5PU4jiXA44Vu9HHRC8xnNGU2Qkamy4oz MqKN/5u5wXJFVq6UtucFKWgvwNkfLfq5kmB3DFP/UJNLCJPHgAQk6pylo+5iSrdidpHh Qz1rCHXZlHw0VtTFJms+ME/LnCI+FvI5GQnNQjICqbKTwie39+JXhY1z77XpY3JL1rzD jEWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=zi7rmeVv9wyGNa3nGaq4V4J/5Kk7INkQi7H0KEImAY0=; b=LYDwhvaqGxkYvdsYA/qKErQOyxURX0U2jz09QRAF3rQdTF9gEywO984/MfjYu7K8cl YrltaHBtlwEws5sdWbXc1MoOF/eF6e6nXmNKy9WGhBHAZkYHLYa2O5aTfC/nrxjdujb5 ML2RY80R2lrTiJP5LFOS+M6yPJoO7vmJE3FW97VlpdTIctHtDq6yP5uI78/Fm2ElYsmk RQdyKpCOgNM69IQ+xxVppiyMHfnGLT9Aq+m6pblLosZQ9dj96n3E6rPxjS7lU6NJZw43 0sfnek/GyHcvJpPZPU76+tRFcgYjxitA0avcbqNejlcS3k03GC/2m+PdDdwuHqrKWXMf z+Fg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k5si2073285eds.231.2020.05.27.08.53.03; Wed, 27 May 2020 08:53:26 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388329AbgE0NeK (ORCPT + 99 others); Wed, 27 May 2020 09:34:10 -0400 Received: from elvis.franken.de ([193.175.24.41]:41218 "EHLO elvis.franken.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387901AbgE0NeK (ORCPT ); Wed, 27 May 2020 09:34:10 -0400 Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1jdwC8-0001yv-00; Wed, 27 May 2020 15:34:08 +0200 Received: by alpha.franken.de (Postfix, from userid 1000) id 88D52C059B; Wed, 27 May 2020 15:33:56 +0200 (CEST) Date: Wed, 27 May 2020 15:33:56 +0200 From: Thomas Bogendoerfer To: Jiaxun Yang Cc: linux-mips@vger.kernel.org, Kees Cook , Borislav Petkov , Heiko Carstens , Fangrui Song , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/3] MIPS: Move kernel head into a standalone section Message-ID: <20200527133356.GA16622@alpha.franken.de> References: <20200527063438.391949-1-jiaxun.yang@flygoat.com> <20200527063438.391949-3-jiaxun.yang@flygoat.com> <20200527115354.GC13965@alpha.franken.de> <20200527200522.23c4e86f@halation.net.flygoat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200527200522.23c4e86f@halation.net.flygoat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 27, 2020 at 08:05:22PM +0800, Jiaxun Yang wrote: > On Wed, 27 May 2020 13:53:54 +0200 > Thomas Bogendoerfer wrote: > > > On Wed, May 27, 2020 at 02:34:33PM +0800, Jiaxun Yang wrote: > > > 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. > > > > I'm adding the missing piece, why this change ist broken: > > > > * Necessary for machines which link their kernels at KSEG0. > > > > by putting something in front of that will probably break platforms > > making use of "feature". If we can make sure, we don't need it > > anymore, we should first remove this and then add __HEAD part. > > __HEAD is just marking the section of code. > It will not add anything to the binary. oops, should have looked it up first. You mentioned PE headers and I thought it will be added this way. > Btw: I just noticed this patch may break relocatable kernel. I'll delay > it for next merge window. ok. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]