From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934018AbcHJU2n (ORCPT ); Wed, 10 Aug 2016 16:28:43 -0400 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:13035 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933884AbcHJSTp (ORCPT ); Wed, 10 Aug 2016 14:19:45 -0400 Date: Wed, 10 Aug 2016 17:59:58 +0800 From: Jisheng Zhang To: , , Kees Cook CC: , Subject: Re: [PATCH] ARM: VDSO: put read only/mostly objects into proper sections Message-ID: <20160810175958.4dcfc5e3@xhacker> In-Reply-To: <1470820187-1032-1-git-send-email-jszhang@marvell.com> References: <1470820187-1032-1-git-send-email-jszhang@marvell.com> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-08-10_07:,, signatures=0 X-Proofpoint-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-1604210000 definitions=main-1608100107 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org + Kees On Wed, 10 Aug 2016 17:09:47 +0800 wrote: > vdso_data_mapping is never modified, so mark it as const. > > vdso_data_page and vdso_text_mapping are initialized by vdso_init(), > thereafter are mostly read during vdso special mapping handling. > > The fact that they are mostly read and not written to makes them > candidates for __read_mostly declarations. Inspired by Kees's "arm: apply more __ro_after_init", is it better to mark these vars as __ro_after_init? Thanks, Jisheng > > Signed-off-by: Jisheng Zhang > --- > arch/arm/kernel/vdso.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/arch/arm/kernel/vdso.c b/arch/arm/kernel/vdso.c > index 994e971..c946092 100644 > --- a/arch/arm/kernel/vdso.c > +++ b/arch/arm/kernel/vdso.c > @@ -47,13 +47,13 @@ unsigned int vdso_total_pages __read_mostly; > static union vdso_data_store vdso_data_store __page_aligned_data; > static struct vdso_data *vdso_data = &vdso_data_store.data; > > -static struct page *vdso_data_page; > -static struct vm_special_mapping vdso_data_mapping = { > +static struct page *vdso_data_page __read_mostly; > +static const struct vm_special_mapping vdso_data_mapping = { > .name = "[vvar]", > .pages = &vdso_data_page, > }; > > -static struct vm_special_mapping vdso_text_mapping = { > +static struct vm_special_mapping vdso_text_mapping __read_mostly = { > .name = "[vdso]", > }; >