Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4453231ybb; Tue, 7 Apr 2020 07:48:31 -0700 (PDT) X-Google-Smtp-Source: APiQypJSbv7Wu5fo+3Z8cDH6Dj7EhcP4sOhUR4H2elhq9xluXBRE72fn0ebVPxtJCNkK2aqpg/IV X-Received: by 2002:a05:6808:253:: with SMTP id m19mr2089973oie.107.1586270911277; Tue, 07 Apr 2020 07:48:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586270911; cv=none; d=google.com; s=arc-20160816; b=zEvKnzHXBeQ5GHUnIuYKIZ7VBB9xoAs4O7MwwJ7CnxxOZllkn/ngXd+iacxGk9+995 UAV1IwugdK4mNUAG2a+aV2ryDhnvMf6JGRr7FoBfivOgv6jlFvrX/OiaMhGe22WT+zqu 27eVBmM8kye3JfBA0tiZo3SejxZTn8GEj3v7H8wfc3wU1Q5uZkLrJRozNvLv0cA0m6V9 ldb0l/pWjEPq4lyQEsp5wkREm3LraL4Db5zz5+9nfm9fziOhUCDnYCM1J9GZ+pVJGrwL ha1fGahw/hK9YTF2hQ+F16xEZqrqE3QFkLwhcZAPycPsp+7L4zbHPa+pKqDU3ZUuInZ3 RDtw== 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=aqQ3taxpRtf9nJt3JZh/sshS9GyadciTUJ/QJJJHjBWJWMAH7B0qauMHC2STomABYb BtG8HCIFAbZZDS5hlKOAnX2yXfraQkofVXewStfsLbbykJN0gpjbCqYZ/5IazcH4EfSC dFBi0qepIEhjtfX7n9mpG5A2jYeVFbVEfCljZvmMi8P276/TB19Uc53UTTbFzeXJ/ZFK /njMpR9p3xITLnFykbDRiDdIz6yhpRf/3KG6u/uUNnczlJimLg26QK8QzB5Eal6mm5LK SB1C6U2CsDADZi3o/FI8T6HuqVlX42ofoPX8xfduGuqREtXCjoeH1pmKn0C23ohlIyP1 m31Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=AHDDzmDi; 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 i6si745498oik.72.2020.04.07.07.48.19; Tue, 07 Apr 2020 07:48:31 -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=AHDDzmDi; 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 S1729356AbgDGOrS (ORCPT + 99 others); Tue, 7 Apr 2020 10:47:18 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:43438 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729328AbgDGOrO (ORCPT ); Tue, 7 Apr 2020 10:47:14 -0400 Received: by mail-pg1-f195.google.com with SMTP id s4so1819396pgk.10 for ; Tue, 07 Apr 2020 07:47:13 -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=AHDDzmDiFHiECrdMx/1zHadC9VdetNvA12RpoCsdBdCEK14bBlGUUaj0dd2H3A+BCH L6TKBWsntI3ec6isKAfpwrdF8gp0hEaVoFmoYPb+coyfeDRwebMhUEHgh1ipHAiVF+Gt 10VKtKonkggb5aWtTNpPY+j9eZcgqAFpLDjyDKnYkMUot/ajync8iCZ+8UgpSFPY7xSL gjON/Bei/AQgPSnbtG4wiHaMXKv+oyO1uxc/6HJCHDrs8EkA0debASne5ARpkVJ0R+FG OlfKbwiqhzHZt9pBeOyExXRS/dhnZB4yK/WSaSA6cpLorZk7MXsQvxmaE7X3t1hFGzjX 5ORw== 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=fiTPsOmVfU/1si3yn4Moj/qYnHqWWCpUKyxdDvjkqnC4PW6ZLHFKxFc0lAEbTnLkca x/L9DQtf3sV/YEAisQAMwREZIxFQSZ1PVxMqpvt8wDxyDtNaBh0ADaMhqwwcIlvoA9k4 zyu8FsHcLH25zXWEG6YflHe8WoF4wlXw+m1hO5fIAOcNjfOCPyQ7tx21LkLmwOT9J9xa 6rU6MCDbDXFKoutcUXpUnede3VWPpW7b7pCdJD0B+yBptH+iOU3u8jgrf52ynd2b/nEO PL+lvKR1pDEIzfUq2Co1FkGNxc2b0jpXl81jpV8O6vZsyKFv6QvE3/vr8fsqj/KTh/MK rZVw== X-Gm-Message-State: AGi0PuZGjsG/UHln0300l2NfrGpzt2nqKHcZ2GYme8Pt/203n+UI7zxJ Y6Tt7AII0yV4UvqYFxo7APTQVA== X-Received: by 2002:a62:154:: with SMTP id 81mr2864787pfb.228.1586270833015; Tue, 07 Apr 2020 07:47:13 -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 y15sm14190093pfc.206.2020.04.07.07.47.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Apr 2020 07:47:12 -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 v4 7/9] riscv: move exception table immediately after RO_DATA Date: Tue, 7 Apr 2020 22:46:52 +0800 Message-Id: <1d1d278ca3957db9103f40ddda008128365d6d72.1586265122.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