Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2674903pxb; Sun, 17 Oct 2021 22:25:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSPy+Y+j6bogVK1ahHC4pH7DkwFcf9Utf41EklN7zd4Uj2wJxUWp4Ca+mISTVelAEEppO1 X-Received: by 2002:a17:903:248f:b029:128:d5ea:18a7 with SMTP id p15-20020a170903248fb0290128d5ea18a7mr25338948plw.83.1634534748562; Sun, 17 Oct 2021 22:25:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634534748; cv=none; d=google.com; s=arc-20160816; b=X+GCX2OiX8/I8W4W8R2iEFOltnYBqdUyZs87NoFJMBxKGv5RL4quVuifbDvS1BLFCJ DPMft4yKIh3kjoNDG+F6vDiJNvE8A71L3b7kJ6qF/g86wBksIidniHLOoJqssbQon4kz C0DJntmrthyzWMAGz8oaGGEsxFMJpjh+Q9McokVzGYPt2kXz5CwX662FCb1zSlxTwAb5 UfRO2kzrmxNlFiiq7cTJmACeXQJv/AFI1imwlPoWpcnbv+wtEMrcj2RSJV8+zN5R9zZs giOusijaApDfS5uFfAEnloXmWoXXdK/eDNiNOCEgPxFWo8wzvgy1FB9bCGvkJErEUxYc WmtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=KAm6Yl0g3VjxG+2yXnB0axsvYkKbqrDCY6iWIJ65noE=; b=blh0xjXlD794UZlNxUETXsOuMeJPgm3Z2C3PGrIMsUKYNjQFH1Rkl9fGgkpVZBF+kF fSi6i2xqhVxRG2Un7Gi0A8wlpzIz275teStn6B+lWqn+9kDNLePbhX888MXUhhqQzzR8 XVe36SXTA3OvrJILWkf6+d2hnmxyOO4umVKp79JflehFu5AOtXzcqf6Y/1mRK7qL42ZY iVVW/0/REgYHG4+puc+FwHAbO3qE0EZMuh/3Hq2m3G76x0fjXQpuIhOLKCOigF7Y3wPh Xr0D8tdAAK/wBGct2+8Rq+CV3hMsCPqfks+NPQrQ+uHX6B6yJ3+XTeg5jAxgNpTs3ky9 wC7Q== 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 f10si20308173pfj.200.2021.10.17.22.25.35; Sun, 17 Oct 2021 22:25:48 -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 S229804AbhJRFZG (ORCPT + 99 others); Mon, 18 Oct 2021 01:25:06 -0400 Received: from smtpbguseast3.qq.com ([54.243.244.52]:52403 "EHLO smtpbguseast3.qq.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229634AbhJRFZG (ORCPT ); Mon, 18 Oct 2021 01:25:06 -0400 X-QQ-mid: bizesmtp33t1634534565twpnz1q1 Received: from pcl66.. (unknown [218.17.115.194]) by esmtp6.qq.com (ESMTP) with id ; Mon, 18 Oct 2021 13:22:39 +0800 (CST) X-QQ-SSF: 01400000002000F0O000000B0000000 X-QQ-FEAT: sAyD0HLl0PAPF9h2XXao3xBCuwKIX1GvyL9/k10otrZOpvTx2dLnas1dTvxks AcbIRiF+Nwn4z4tU9GRsmFEbA0VyRqZzJZYXHPGLhvclumq0XNEDIxCZmNJV2yelYObLymb zzHmmpuZRU9okNwO4uUy1ZCpH3Y5lBAYjoNkRcUy8ZGeW4PhhnZHn33NZfiGVRT44Rnamj2 +wLyV0mHD5AylhTMIKMAPoh/OwKUgD6pVHJ1lvf1z71Bhyul0Qk2I248psCInFC+SMQtP2v 8y086yFfAQ5mKLdzl341uNliAZrSzTM0KxC2a8loHFu9v5RVbYHPeMsDWm3swdaAU7kck8v iEjizGLo4fK0ruS9mOKcrXmRG2DrKwTCqdDkba+ X-QQ-GoodBg: 1 From: Chen Lu <181250012@smail.nju.edu.cn> To: palmer@dabbelt.com Cc: paul.walmsley@sifive.com, aou@eecs.berkeley.edu, alex@ghiti.fr, vitaly.wool@konsulko.com, anup@brainfault.org, seanga2@gmail.com, wangkefeng.wang@huawei.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, yuzihao@ict.ac.cn, Chen Lu <181250012@smail.nju.edu.cn> Subject: [PATCH] riscv: fix misalgned trap vector base address Date: Mon, 18 Oct 2021 13:22:38 +0800 Message-Id: <20211018052238.522905-1-181250012@smail.nju.edu.cn> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:smail.nju.edu.cn:qybgforeign:qybgforeign5 X-QQ-Bgrelay: 1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * The trap vector marked by label .Lsecondary_park should align on a 4-byte boundary. If not, CSR_TVEC may be set to an incorrect address. * This bug is introduced at commit e011995e826f8 ("RISC-V: Move relocate and few other functions out of __init"). * This bug is exposed with an educational emualtor. Signed-off-by: Chen Lu <181250012@smail.nju.edu.cn> --- arch/riscv/kernel/head.S | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S index fce5184b22c3..52c5ff9804c5 100644 --- a/arch/riscv/kernel/head.S +++ b/arch/riscv/kernel/head.S @@ -193,6 +193,7 @@ setup_trap_vector: csrw CSR_SCRATCH, zero ret +.align 2 .Lsecondary_park: /* We lack SMP support or have too many harts, so park this hart */ wfi -- 2.30.2