Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2641209ybh; Mon, 9 Mar 2020 09:56:44 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv3PfytwMLZWS7JIDGHKVibplbg1jnBsVTruUx3zrAXwgsBV4DpyxGFF7sZHMTw/eF0MBGf X-Received: by 2002:a9d:6b04:: with SMTP id g4mr12973044otp.167.1583773004109; Mon, 09 Mar 2020 09:56:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583773004; cv=none; d=google.com; s=arc-20160816; b=i0MHX3nGz4U0AIvzRjAa2fagqOuXaxZRPcmngJmeXbdghRKlTO0PN0qf8QtQg1lNu1 IT94P/+iaTgkiSQcolQpQxX/g4ToU8ucbeaPOtNpFadUnQ4AGDU1xscZX20xwlxm7pzx npeoyH0f9/F3PXQh5DewWv3xBEsToUBE5NvOEBaiGrR4WrEFnt6ACbpBLbXfZ/lfYSuk ZM6o5g9R4M7EncSs3GNFEa9PWVvPNoZzguHJGeiUZ7Lp9FldRrStORVgiDx23d3dk+t6 Ft+Dfz/obnpXhp9zuggq0NFJ8NaTq9m7L+XMWemHbORpQ6Ew7McbMyjL/sNV87AsFU4S qmxg== 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=eOiyM2uGzUc6zhWPwWC3bZJGaa62phcZiPuWR1LO/LM=; b=zHF2a+pEOEKwxjIR2Ph/wxTFe7jxqASZzhtST2a35za3+X20K/f4VuM0vwc0HO+SgJ FvrsDLTF8VKHZHQOcvZCTsNT0dbC0EI4Cgmv4IJfgxGGiMYjM0uvClHf7sOap9BVYGPz l4EeOOU/GA5qqEA4MQbLh/ZL4XzarhW+l0SPdZ2mdrORB/kcs8ZJAKh8vcakN1ir0hg/ HKw6ZhcYQIycUFj/w3jLM8mOriXmbav8dHI3SpdsQLqlpySNmF3zqo5n7oGBnzAxA0Tz h/ZT2oUTlgaXMh+d9D52nN5wApOKcF3LaqxZ6wJBZkccEd9sXL/Ar2aeFLvC3cNsknk8 haFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b="ns/e6viG"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d3si4024938oia.236.2020.03.09.09.56.32; Mon, 09 Mar 2020 09:56:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b="ns/e6viG"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727329AbgCIQ4E (ORCPT + 99 others); Mon, 9 Mar 2020 12:56:04 -0400 Received: from mail-pj1-f67.google.com ([209.85.216.67]:54314 "EHLO mail-pj1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727224AbgCIQz7 (ORCPT ); Mon, 9 Mar 2020 12:55:59 -0400 Received: by mail-pj1-f67.google.com with SMTP id np16so107451pjb.4 for ; Mon, 09 Mar 2020 09:55:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eOiyM2uGzUc6zhWPwWC3bZJGaa62phcZiPuWR1LO/LM=; b=ns/e6viGugpe2sBeszGUW3QpCkeJB8MrYvhnEDHtLsFIns1NbWHZCL4O++HLMpG59o OZToMHr8HqtFaeMZgdNI84bo+KkGHLigFMo+d557Yf4W/0SCXPOxAR0fPP/oIGxXRiiD LHdnMeG+3aSl9JsQ/5GggSq9GjcobzY+pOknrKIhwPyWslWvDxaC68QjgxC6SxFtzJB7 cQlkoW32VTwAAVI8vxofLhcOEi5csCrBNqTk7V67L+mxKL56djRSWtTmsyr3JvCLagfE XRZurknzTeTBKkXhpY8VNvKYhZoKPi61wa33hrG1ryx8icKuHvQHhb7RUYT0btO1mTUB fWiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eOiyM2uGzUc6zhWPwWC3bZJGaa62phcZiPuWR1LO/LM=; b=IlfNGDtAhlZc5gosDNIwGZQn6A6l1YtfiWqS2LsEPFDaK2bHRq0AVdC3zlR7ZnCO4F XCyZAF2/bM11OpKGbakFrpC/fS/Q3DbKGUl5y8KjykqJTqODllGy4smhY4VtIcebDTUd mD6aPgWVKxc32z5f2pt708oR/Rl4EyoVZQeJcZCKNqm+LwuElzWnLcxzHxUEK4F7P6Lw iCWA2PVtmDm9Rw24tgIUbnGK24GgUmUASJrpgXvbO8lmU4KUQmgPvtRyQ5EhGwGsaPI4 C6dRDVE0G8BMgyveJ+qegwk+y0b7x1s1ZbOmEHDonf2j5caRIObodPJ2xkTrbHZDqGtx YWWQ== X-Gm-Message-State: ANhLgQ0acXp/1H+4f2ruBO9TJVN2Xp723jjtu50pGit6waBb1yzUiIzx /TJJzH9eJw++QrwuhwAmvyXbpw== X-Received: by 2002:a17:902:aa98:: with SMTP id d24mr16957575plr.106.1583772958869; Mon, 09 Mar 2020 09:55:58 -0700 (PDT) Received: from hsinchu02.internal.sifive.com (220-132-236-182.HINET-IP.hinet.net. [220.132.236.182]) by smtp.gmail.com with ESMTPSA id cm2sm104013pjb.23.2020.03.09.09.55.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2020 09:55:58 -0700 (PDT) From: Zong Li To: palmer@dabbelt.com, paul.walmsley@sifive.com, aou@eecs.berkeley.edu, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Zong Li Subject: [PATCH v3 4/9] riscv: move exception table immediately after RO_DATA Date: Tue, 10 Mar 2020 00:55:39 +0800 Message-Id: <5c80357b06faf1caed8fbab2d4dc57a2cbeb8b94.1583772574.git.zong.li@sifive.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: 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 Move EXCEPTION_TABLE immediately after RO_DATA. Make it easy to set the attribution of the sections which should be read-only at a time. Add _data to specify the start of data section with write permission. This patch is prepared for STRICT_KERNEL_RWX support. Signed-off-by: Zong Li --- arch/riscv/kernel/vmlinux.lds.S | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/riscv/kernel/vmlinux.lds.S b/arch/riscv/kernel/vmlinux.lds.S index 1e0193ded420..02e948b620af 100644 --- a/arch/riscv/kernel/vmlinux.lds.S +++ b/arch/riscv/kernel/vmlinux.lds.S @@ -58,6 +58,10 @@ SECTIONS *(.srodata*) } + EXCEPTION_TABLE(0x10) + + _data = .; + RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) .sdata : { __global_pointer$ = . + 0x800; @@ -69,8 +73,6 @@ SECTIONS BSS_SECTION(PAGE_SIZE, PAGE_SIZE, 0) - EXCEPTION_TABLE(0x10) - .rel.dyn : { *(.rel.dyn*) } -- 2.25.1