Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp148588pxf; Wed, 17 Mar 2021 01:27:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRJKDogWPTMqutW04eE6QocuKkjNRYhY0BRKi6J9wM+i0PcIGfTQ3HFM0wIHChm6Ufz2FJ X-Received: by 2002:a17:907:36e:: with SMTP id rs14mr33226344ejb.42.1615969656710; Wed, 17 Mar 2021 01:27:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615969656; cv=none; d=google.com; s=arc-20160816; b=Ar+IwlFVCQZEDOzxTeZ7UVzp3+1NOYqLruJ4hjB8jFh4hHSnL1upsK9qQBx4O0oADY SD1xt9aSAUPvlOnpFkVAMmHti27JLT+HBOFb9uw9+9p0ug2VsQDJCFLLaYMC9UhjCHco nAoGtr48uBvhaXGRQ5C7xaOmvCztIYVA2Os8dkMC/gHXJvOGIyko39kTbySdikHLhlWD A4t8L8Or8yAEVaUEgSy35JsNZEIWRP80RVzUg7FgsMZEL+cdTN90rn0LBxAB5DtISlU2 L2dbt6xaed2hlFLS+At0RymzPEETs//0E+gi/9L0RSvd5PuoXn76cNeKIyGdxgDKx5uS QnEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=xPTOCvk3xUqV/VAjQcYeyAENUoJafS3kuhxPTCCKIf0=; b=LkSiFOBye7PRLhdGtDqvxFJuGY6Y7yb0j4GtKsIPR1s3KlLCO/b3guoMXpQKPiyhvh QmWyyKmbTaAzjcdPEl4/gai0JjPEB0l1cN/8d1VyVpaWkNSZtK63vRoqcNDEu2a4behP mACWRlEQDjfYirXDbQl4hH/Kx8yCofg7ll1QlcFPeer5bbG/X2SJ1g5WuImP6/pGWAPM ATypPZj4yQFm7/XwAdLaZA49hAwYppAl4mn5CD1d/kyPIibqnGFSHdlFAOCViIvj9aVq CIwJYh+Q020wz+oietbXLvUkG5IU852lGcmygk585cwIhYViSu+/VvuXbakPq0O+WqQ0 RU0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l12si15412784edi.290.2021.03.17.01.27.14; Wed, 17 Mar 2021 01:27:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229690AbhCQIZ6 (ORCPT + 99 others); Wed, 17 Mar 2021 04:25:58 -0400 Received: from smtp23.cstnet.cn ([159.226.251.23]:56396 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229607AbhCQIZu (ORCPT ); Wed, 17 Mar 2021 04:25:50 -0400 X-Greylist: delayed 430 seconds by postgrey-1.27 at vger.kernel.org; Wed, 17 Mar 2021 04:25:49 EDT Received: from localhost.localdomain (unknown [116.6.100.50]) by APP-03 (Coremail) with SMTP id rQCowADH6A0pu1Fgwa5oAA--.10281S4; Wed, 17 Mar 2021 16:18:05 +0800 (CST) From: Zihao Yu To: paul.walmsley@sifive.com Cc: palmer@dabbelt.com, aou@eecs.berkeley.edu, yuzihao@ict.ac.cn, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] riscv,entry: fix misaligned base for excp_vect_table Date: Wed, 17 Mar 2021 16:17:25 +0800 Message-Id: <20210317081725.28412-1-yuzihao@ict.ac.cn> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TR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.100.50] X-CM-SenderInfo: p1x2xx1dr6xunwoduhdfq/ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * In RV64, the size of each entry in excp_vect_table is 8 bytes. If the base of the table is not 8-byte aligned, loading an entry in the table will raise a misaligned exception. Although such exception will be handled by opensbi/bbl, this still causes performance degradation. Signed-off-by: Zihao Yu --- arch/riscv/kernel/entry.S | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/riscv/kernel/entry.S b/arch/riscv/kernel/entry.S index 744f3209c..76274a4a1 100644 --- a/arch/riscv/kernel/entry.S +++ b/arch/riscv/kernel/entry.S @@ -447,6 +447,7 @@ ENDPROC(__switch_to) #endif .section ".rodata" + .align LGREG /* Exception vector table */ ENTRY(excp_vect_table) RISCV_PTR do_trap_insn_misaligned -- 2.20.1