From patchwork Wed Jun 12 03:24:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Yong" X-Patchwork-Id: 1946628 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=qhNjYbpz; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=g4jEHVDN; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzWBD0qB2z20Pb for ; Wed, 12 Jun 2024 13:24:49 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=+z4bwWI9nWIThJaP/pkM/SB9h5qggIcfc5bHS9BCB+k=; b=qhNjYbpz5eb+L8 XaaBfz51F5AsaqRZ9bnj/7X0IoJJLoGBEVgiDAyWHsM57mBTjgE30T8dKnUo8xiiCVfyK748DEu4n 8EUz/qXEaU22r+5qJvJUli3Kfo1DniaW0omIaiBQ1BRB6sWcPKolmLtjG1QtsQkXH/yAg+3i5mi0h qFz3ctfaESgzQksu/q4I4M4jIGlZNM5sfAmndyOsACH8qOOLVIuyUQOUsKUvc7vvVXSAi7PtMxahD 63mvq3xCSPLbeoAacgCnJeituiH0sFF6bgJYk+evWutmxRHFS4aPoSPwDih9MX5VOMP7R0lHeSgCN eQVeXHioKuHVaOZhZDTg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHEbF-0000000Atkb-382A; Wed, 12 Jun 2024 03:24:37 +0000 Received: from mgamail.intel.com ([198.175.65.10]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHEbD-0000000Atjd-32vx for opensbi@lists.infradead.org; Wed, 12 Jun 2024 03:24:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718162676; x=1749698676; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=b9F8Se4hfHXwJkkqBG1oV58I8kht3EhXI7HFLXww7Zk=; b=g4jEHVDNSsJuMvwjSn8m0MQIc0WQuJDLz0hodwNKxQZkXgOYTTFTNkMd JBA4Xz5XUzblgXipEkBnjirXHSFvSUzsIiwwbW5EJzZ5NjiE4IW+PY72a FYiBfOCtj6XQnTdNY/8At9SlY1KX+/3xlgnnrv4zMezNu23TdTCyv5+JY /tCuTJLSyV51vQzueJNOtm0cMDL9GPDQgZS+tz0JWPc3IF0w8uffMPLXe tqfBGe2N70AdkT52EHw6abD4gx/nCwnLaDGaRDZhc/lgl0WrLDdqLaLgp z19RVqfLC7xZYFHNPGNwxo21anqUSq6Zk3atyfis5dQjpoUp3Qq6dBvCC g==; X-CSE-ConnectionGUID: N/OwzU85Qm2LQ4Cwf0ee/Q== X-CSE-MsgGUID: KJJ0Vm3KSe2ZgViCW8jk/g== X-IronPort-AV: E=McAfee;i="6600,9927,11100"; a="32393758" X-IronPort-AV: E=Sophos;i="6.08,232,1712646000"; d="scan'208";a="32393758" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2024 20:24:32 -0700 X-CSE-ConnectionGUID: FIsq545dQYCbAcKzYOUccA== X-CSE-MsgGUID: UwjcxoCRSTmg+Fv0yeQmUQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,232,1712646000"; d="scan'208";a="62823715" Received: from intel-optiplex-7090.sh.intel.com ([10.239.159.129]) by fmviesa002.fm.intel.com with ESMTP; 11 Jun 2024 20:24:30 -0700 From: Yong Li To: opensbi@lists.infradead.org Cc: Yong Li , Yu Chien Peter Lin Subject: [PATCH] lib:sbi fix the trap_regs point misalignment issue Date: Wed, 12 Jun 2024 11:24:28 +0800 Message-Id: <477b211d01c6f1cefb8b38adac4f41dc00c358fd.1718162420.git.yong.li@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240611_202435_813816_B6339F58 X-CRM114-Status: UNSURE ( 7.61 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.3 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This is to make the trap_regs pointer consistant with the one in CSR_MSCRATCH, in which a new sbi_trap_info and sbi_trap_context were introduced which caused the regression issue in domain context Cc: Yu Chien Peter Lin Signed-off-by: Yong Li --- lib/sbi/sbi_domain_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Content analysis details: (-0.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.0 T_SCC_BODY_TEXT_LINE No description available. -0.1 DKIMWL_WL_HIGH DKIMwl.org - High trust sender X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This is to make the trap_regs pointer consistant with the one in CSR_MSCRATCH, in which a new sbi_trap_info and sbi_trap_context were introduced which caused the regression issue in domain context Cc: Yu Chien Peter Lin Signed-off-by: Yong Li --- lib/sbi/sbi_domain_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sbi/sbi_domain_context.c b/lib/sbi/sbi_domain_context.c index 7528591..5a8f616 100755 --- a/lib/sbi/sbi_domain_context.c +++ b/lib/sbi/sbi_domain_context.c @@ -67,7 +67,7 @@ static void switch_to_next_domain_context(struct sbi_context *ctx, /* Save current trap state and restore target domain's trap state */ trap_regs = (struct sbi_trap_regs *)(csr_read(CSR_MSCRATCH) - - SBI_TRAP_REGS_SIZE); + SBI_TRAP_CONTEXT_SIZE); sbi_memcpy(&ctx->regs, trap_regs, sizeof(*trap_regs)); sbi_memcpy(trap_regs, &dom_ctx->regs, sizeof(*trap_regs));