Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp359579ybb; Wed, 8 Apr 2020 00:59:11 -0700 (PDT) X-Google-Smtp-Source: APiQypIk2LslpJsiUl3BBP/GcW4AJMGU1MpN/H+36D4A5x67NUdbBCQ4qdGMPAwqueGU+X9iaoPR X-Received: by 2002:a9d:6ad8:: with SMTP id m24mr4839218otq.66.1586332751722; Wed, 08 Apr 2020 00:59:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586332751; cv=none; d=google.com; s=arc-20160816; b=RyXhBo0RYEIyhgG/GumuSeaVMKkp0ZCW5dS0vd7lXr39OvFKdkPYX9rlNpTufUuTlN 0lbWVqTh+07ceIgjC3eeIZmGYvxFuyy1s9lqqkgtdWlrRlAiz9Rypid+o5XpyVjuKpzF gpVpkz7qIabGHaG/jAxPAMsAYceRAy3AZrax8vtwNY8cu5xsbRiwDXLBBIjM/QpbNFJT aJEvHfJaXVBR44UexmDhqPMuPkHvtf6uZbst0sOD3VjxweAYtJspY+vKCkGrxd235+Yp XVI6nfPdCI+YSpzWVpRhIz8T5snKydKdiX9MA17qFgwRwNP0ZyVJA06/vINGDtnDPLT6 Ek8g== 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=Quhy5/QZPA8/P4q/9fnjufmjHKuWjkZaQYF9/wabbVw=; b=qqmf0u/ztH1KfLa6wL1fQSxfqBug63CG0jvF0q3n/9JKRTDLo64/VXaBRlPvWJiFBR CLGuqEWl8OMTatr2FR06JNntMZiRF7DtpBf0fQcElo+EdOWlziKXGmxPltjC0pcY2XO8 jeXzUGphfI6AYphiUQQtubFjEWtLPfO57y0hvbBwGLFM8CO7+spy3kXCPF1wtz2t5kCR leHU2WS3L7C5PO1d50Chdr59IZLzdn4wfKpPIpH9Abf3unptFbrhLemSYglhdDVzNQlF 7TNfYjJZ+NKdG1zqWebzbvPN+z5KavYJQjP1rGjKrldOcG1B0IcSF+400AgFeJ6o85q7 QAVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b="mPZ6G/Dv"; 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 k19si2189441otb.279.2020.04.08.00.58.57; Wed, 08 Apr 2020 00:59:11 -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="mPZ6G/Dv"; 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 S1727464AbgDHH5Y (ORCPT + 99 others); Wed, 8 Apr 2020 03:57:24 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:40363 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727376AbgDHH5X (ORCPT ); Wed, 8 Apr 2020 03:57:23 -0400 Received: by mail-pl1-f196.google.com with SMTP id h11so2231557plk.7 for ; Wed, 08 Apr 2020 00:57:23 -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=Quhy5/QZPA8/P4q/9fnjufmjHKuWjkZaQYF9/wabbVw=; b=mPZ6G/DvSUkmvJrsHi7YzN51egMqhQiZtrVAWVMnop5ZSHgLEIBO5VaJpn2sJ8xXc5 ceGghSnnkHeQjGqVbbP2GSy0IaxBEEDD6Uf8jv9x8gIZlTQBljt2bYXg6NVDSFCdlCZu 8816ZszTSt5DuxQO6UH5wDNaGBBzdvNleauumy+j4WmLKypcrS3dk46ERhxQb0XuNgpI ZF9HkUjimJRUSoU1j4w7FGVsVl7LPc7yXlvcMju/o9Dfbc/lTI3GZnewD5hzYZvIjtsT F2Kr+fHNYLd4hVK2lKG/xFoBanJbWknoy5vYCfoT2CFkMrgBE5EeLDHzF4N5HwLlEfYh 7lyw== 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=Quhy5/QZPA8/P4q/9fnjufmjHKuWjkZaQYF9/wabbVw=; b=b+46UimXIn2K2kUhqNrp3qgqV8uDMLbVoifcwGZwvHZSBuJdFQZyErEWwNDBrmDi9m yGNZsI62KN9I312MquSMqan72djNPikzATF8OdeARnh3QrLZLEeT3sAHO2htrNLY6XEm gPf2KJRQpC43njqNELwXtL4zALdpKl/rJb/Dpfs+PnoWpQjEJScBNoAIXARcdxtRysT/ xNggeuuvL2itLCKaxPmGJ9G3tqWjIfOzdU1EuzHKU9xHKCCkhnXNha5pZL6w0aCfpiM0 NvB6h6LU32RPYf+13fL+QaC/1nrQxjH9DbZyh0Mq8Ddj1lXU9nkQem4mco7W7gT+yinu jOtw== X-Gm-Message-State: AGi0PuZnFFdRxAIi/a4S4JAjqCtKq9q2HvIUNmRlHSFWw0KlQkmlMbtq gdtluxfDBs6u6aKuwNt/uEzsqQ== X-Received: by 2002:a17:90a:65c5:: with SMTP id i5mr2480742pjs.18.1586332642779; Wed, 08 Apr 2020 00:57:22 -0700 (PDT) Received: from hsinchu02.internal.sifive.com (114-34-229-221.HINET-IP.hinet.net. [114.34.229.221]) by smtp.gmail.com with ESMTPSA id d85sm485599pfd.157.2020.04.08.00.57.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Apr 2020 00:57:22 -0700 (PDT) From: Zong Li To: palmer@dabbelt.com, paul.walmsley@sifive.com, aou@eecs.berkeley.edu, mhiramat@kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Zong Li , Palmer Dabbelt Subject: [PATCH v5 7/9] riscv: move exception table immediately after RO_DATA Date: Wed, 8 Apr 2020 15:57:02 +0800 Message-Id: <6dba29ff224e253bcacc7891caecadb5666d8059.1586332296.git.zong.li@sifive.com> X-Mailer: git-send-email 2.26.0 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 Suggested-by: Palmer Dabbelt --- 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.26.0