From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752183AbcKHHPx (ORCPT ); Tue, 8 Nov 2016 02:15:53 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:38786 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751420AbcKHHPv (ORCPT ); Tue, 8 Nov 2016 02:15:51 -0500 Date: Tue, 8 Nov 2016 08:15:43 +0100 From: Heiko Carstens To: Chris Metcalf Cc: linux-kernel@vger.kernel.org, Kees Cook , Martin Schwidefsky Subject: Re: [PATCH] tile: handle RO_AFTER_INIT_DATA References: <1478548227-3476-1-git-send-email-cmetcalf@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1478548227-3476-1-git-send-email-cmetcalf@mellanox.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16110807-0032-0000-0000-00000238C44D X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16110807-0033-0000-0000-00001D9B9193 Message-Id: <20161108071543.GA3528@osiris> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-11-08_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611080133 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 07, 2016 at 02:50:27PM -0500, Chris Metcalf wrote: > This is the minimal change to handle RO_AFTER_INIT_DATA. > The tile architecture already marks RO_DATA as read-only in > the kernel, so grouping RO_AFTER_INIT_DATA with RO_DATA, as is > done by default, means the kernel faults in init when it tries > to write to RO_AFTER_INIT_DATA. For now, just move it past the > end of the RODATA section so it is not specially treated. > --- > This is just to fix 4.9; I will post a more complete fix shortly > targeting 4.10. > > arch/tile/kernel/vmlinux.lds.S | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/arch/tile/kernel/vmlinux.lds.S b/arch/tile/kernel/vmlinux.lds.S > index e1baf094fba4..dcd7445c31a2 100644 > --- a/arch/tile/kernel/vmlinux.lds.S > +++ b/arch/tile/kernel/vmlinux.lds.S > @@ -1,3 +1,6 @@ > +/* Handle ro_after_init data on our own. */ > +#define RO_AFTER_INIT_DATA > + > #include > #include > #include > @@ -87,6 +90,7 @@ SECTIONS > > _sdata = .; /* Start of data section */ > RO_DATA_SECTION(PAGE_SIZE) > + RO_AFTER_INIT_DATA > RW_DATA_SECTION(L2_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) > _edata = .; imho, the minimal fix would be to just #define __ro_after_init __read_mostly within arch/tile/include/asm/cache.h. That's also what parisc currently has.