From patchwork Mon Mar 14 15:15:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 8580761 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0CFFEC0553 for ; Mon, 14 Mar 2016 15:17:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 19C9F201DD for ; Mon, 14 Mar 2016 15:17:49 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1EC262025B for ; Mon, 14 Mar 2016 15:17:48 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1afUDX-0000zo-Ge; Mon, 14 Mar 2016 15:15:35 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1afUDW-0000zd-5j for xen-devel@lists.xenproject.org; Mon, 14 Mar 2016 15:15:34 +0000 Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id 1E/12-13341-595D6E65; Mon, 14 Mar 2016 15:15:33 +0000 X-Env-Sender: JBeulich@suse.com X-Msg-Ref: server-9.tower-206.messagelabs.com!1457968530!28905089!1 X-Originating-IP: [137.65.248.74] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.11; banners=-,-,- X-VirusChecked: Checked Received: (qmail 10013 invoked from network); 14 Mar 2016 15:15:32 -0000 Received: from prv-mh.provo.novell.com (HELO prv-mh.provo.novell.com) (137.65.248.74) by server-9.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 14 Mar 2016 15:15:32 -0000 Received: from INET-PRV-MTA by prv-mh.provo.novell.com with Novell_GroupWise; Mon, 14 Mar 2016 09:15:30 -0600 Message-Id: <56E6E39E02000078000DC1B8@prv-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 14.2.0 Date: Mon, 14 Mar 2016 09:15:26 -0600 From: "Jan Beulich" To: "xen-devel" Mime-Version: 1.0 Cc: Andrew Cooper , Keir Fraser Subject: [Xen-devel] [PATCH] x86: move both exception tables into .rodata X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP While they are being written during early boot (when sorting them), that writing takes place before we actually start fiddling with page table permissions, so these tables can benefit from getting write protected just like ordinary r/o data does (for now only when using 2M mappings). Signed-off-by: Jan Beulich x86: move both exception tables into .rodata While they are being written during early boot (when sorting them), that writing takes place before we actually start fiddling with page table permissions, so these tables can benefit from getting write protected just like ordinary r/o data does (for now only when using 2M mappings). Signed-off-by: Jan Beulich --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -73,6 +73,17 @@ SECTIONS *(.rodata) *(.rodata.*) + . = ALIGN(8); + /* Exception table */ + __start___ex_table = .; + *(.ex_table) + __stop___ex_table = .; + + /* Pre-exception table */ + __start___pre_ex_table = .; + *(.ex_table.pre) + __stop___pre_ex_table = .; + #ifdef LOCK_PROFILE . = ALIGN(POINTER_ALIGN); __lock_profile_start = .; @@ -154,16 +165,6 @@ SECTIONS __2M_rwdata_start = .; /* Start of 2M superpages, mapped RW. */ . = ALIGN(SMP_CACHE_BYTES); .data.read_mostly : { - /* Exception table */ - __start___ex_table = .; - *(.ex_table) - __stop___ex_table = .; - - /* Pre-exception table */ - __start___pre_ex_table = .; - *(.ex_table.pre) - __stop___pre_ex_table = .; - *(.data.read_mostly) . = ALIGN(8); __start_schedulers_array = .; Reviewed-by: Andrew Cooper --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -73,6 +73,17 @@ SECTIONS *(.rodata) *(.rodata.*) + . = ALIGN(8); + /* Exception table */ + __start___ex_table = .; + *(.ex_table) + __stop___ex_table = .; + + /* Pre-exception table */ + __start___pre_ex_table = .; + *(.ex_table.pre) + __stop___pre_ex_table = .; + #ifdef LOCK_PROFILE . = ALIGN(POINTER_ALIGN); __lock_profile_start = .; @@ -154,16 +165,6 @@ SECTIONS __2M_rwdata_start = .; /* Start of 2M superpages, mapped RW. */ . = ALIGN(SMP_CACHE_BYTES); .data.read_mostly : { - /* Exception table */ - __start___ex_table = .; - *(.ex_table) - __stop___ex_table = .; - - /* Pre-exception table */ - __start___pre_ex_table = .; - *(.ex_table.pre) - __stop___pre_ex_table = .; - *(.data.read_mostly) . = ALIGN(8); __start_schedulers_array = .;