From patchwork Thu Apr 15 14:48:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 423291 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9666C433B4 for ; Thu, 15 Apr 2021 15:05:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D2A6A61166 for ; Thu, 15 Apr 2021 15:05:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234315AbhDOPGE (ORCPT ); Thu, 15 Apr 2021 11:06:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:47036 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232648AbhDOPDx (ORCPT ); Thu, 15 Apr 2021 11:03:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 37E69613EF; Thu, 15 Apr 2021 14:58:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618498712; bh=QTHRy0qn11avl2j/plu94sJH14RZCJpjJZGTvzB4E+8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OovAHFsC72ZSn7JBQDyGZz9tEjhtO7zSGLSrHXA5PYp13IydUb+sqfGCzmn1Cb9eG bWombcuoa++U8HuC7TMmMdVQ07Obg1ZXy0mjHUthiUpzNQDC095Q7EqSHWsGIonDuQ YbjSZtZDiboWpBYHQNh3k25Tg1ax1pgVGxMH2ysw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zihao Yu , Anup Patel , Palmer Dabbelt , Sasha Levin Subject: [PATCH 5.11 19/23] riscv, entry: fix misaligned base for excp_vect_table Date: Thu, 15 Apr 2021 16:48:26 +0200 Message-Id: <20210415144413.750645600@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210415144413.146131392@linuxfoundation.org> References: <20210415144413.146131392@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Zihao Yu [ Upstream commit ac8d0b901f0033b783156ab2dc1a0e73ec42409b ] 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 Reviewed-by: Anup Patel Signed-off-by: Palmer Dabbelt Signed-off-by: Sasha Levin --- 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 744f3209c48d..76274a4a1d8e 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