From mboxrd@z Thu Jan 1 00:00:00 1970 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=unavailable 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 87C02C433B4 for ; Thu, 15 Apr 2021 15:08:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 537FD610FA for ; Thu, 15 Apr 2021 15:08:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233471AbhDOPIq (ORCPT ); Thu, 15 Apr 2021 11:08:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:47066 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234964AbhDOPAL (ORCPT ); Thu, 15 Apr 2021 11:00:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EF92661409; Thu, 15 Apr 2021 14:56:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618498565; bh=czU1BBx5gFfWn2AkdLFSpb+b7yuGXEGeypDvJmsYFWU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ClBx+QZ0hc04Oha7csX0wG41jfwH3Tl0utqzcDTZzXZmhVzYYLMsJFDZjlh9C6y+b oLFupOlwzxLJqC9xMYDCHp+qSBQLvObi14H0yvEGrOue185Fx1t62OLj3JpAV8n7qQ 26fpdRahpEuoH69JEOaZo+M/jlpuNwPD3mXQ3u5E= 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 4.19 07/13] riscv,entry: fix misaligned base for excp_vect_table Date: Thu, 15 Apr 2021 16:47:56 +0200 Message-Id: <20210415144411.843251257@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210415144411.596695196@linuxfoundation.org> References: <20210415144411.596695196@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 a03821b2656a..d9de22686e27 100644 --- a/arch/riscv/kernel/entry.S +++ b/arch/riscv/kernel/entry.S @@ -449,6 +449,7 @@ ENDPROC(__fstate_restore) .section ".rodata" + .align LGREG /* Exception vector table */ ENTRY(excp_vect_table) RISCV_PTR do_trap_insn_misaligned -- 2.30.2