From patchwork Tue Mar 12 10:28:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1910938 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=IExuW0a7; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ventanamicro.com header.i=@ventanamicro.com header.a=rsa-sha256 header.s=google header.b=Nq55sDu+; 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 4Tv8y55mjFz1yWt for ; Tue, 12 Mar 2024 21:29:01 +1100 (AEDT) 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:References:In-Reply-To: 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: List-Owner; bh=tNAgAXaNGS8CgoustbukT67UcLjvBLByPsgygAl0Mis=; b=IExuW0a7I59087 HHppJXIEIR0V9RU8km6ibMAuilPMb40jtn7BDbfkJUVwMaQz7ZczM748kpX8m0aoiq0i9LkEETw48 IEMDUZUE0ssvC3DglD44XCtLQNI4HnFdt/nCOaMgRSkrEOxpwL8QQcb10jJV9FV2TmGxKKCVvd6c4 mxVVgBJbk5y7kNL152zYZYeFBdslp9o3SPKu0oqG6hUHXILfZ2clHeJ7Lp3vqdVg+5GVDWtGwFQB/ R7e1GX3xmK8ar7tzHYFzybtPbu+4uHhRiiwwS8djWBIxAWr3BdkuQ7ZmRjudp1Gs0IthZ4rqEAVp1 YVXh+h6A24/R9KdEZPpQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rjzNN-00000005Lg3-2GyM; Tue, 12 Mar 2024 10:28:53 +0000 Received: from mail-ot1-x329.google.com ([2607:f8b0:4864:20::329]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rjzNI-00000005Lbp-01O6 for opensbi@lists.infradead.org; Tue, 12 Mar 2024 10:28:51 +0000 Received: by mail-ot1-x329.google.com with SMTP id 46e09a7af769-6e52b9234c0so906377a34.2 for ; Tue, 12 Mar 2024 03:28:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1710239326; x=1710844126; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OO6iNISTGfAGS0A4MdDha01WofXhHPeT0ptdxU2zD/s=; b=Nq55sDu+JABtf91r9Aezy61EFfh7W4tlfb4vxojsqUq3EV+uwRnQsi3ELomLey2o6h 8VoaBXg6gRxoO8W63zgYyFqDamULVhdPEDZL+J3AfdeKn8veY07+GbJtpZXBGIxcrHnw rJ9v3h/QTeckOO+CSggz2MyFPm2mQHyUuJYMHURQS2sxAUZCG3TiMz5F7W6b/zzKYWAn QGuApQ8xsQLCHmSoPihGFG9tgpmcY7+IIwDOMvTQqE9Ur3MSEzhTz+Sc8FcsvO+bMa7N o8CaM/f2svPb704OIUtHVr5IKx5Bt3hB6hHOg49+b2vQe7svU/NUPqpOJnx90EsDxLlT MC0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710239326; x=1710844126; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OO6iNISTGfAGS0A4MdDha01WofXhHPeT0ptdxU2zD/s=; b=bUrE7q10R1Xk3a/c6p5ZOLlBbGNq7dCwxM/oRPoVlqi8cB1SEF4ZPC/RK/4EL+toi/ V0yW/lBBxB+GzHqJO4YJxczzO7N9s+w5N0mZNpe5ejvlmwS7losa7J0MFj6uaQDninMI SYcaEk8E9lcpHKND3m0dRLgwmemjyCUhs7D9TuHZAUMgdQsWOAZ1HzTVtPCk5qpy3fte L5C7cd76ClNu4fsfnzKSa3jopWOreCp4iIGxQAGzE4rRifvjnx6kOirDJEqCYuXKlEjH FTvvLoADY9LnSKj857yckZdJbZlD46Xgh6NC5sNOnAw7wcNKDFl7l4TrvKXqFOz2mESn +a2w== X-Forwarded-Encrypted: i=1; AJvYcCU+TSOir7EZhaQFab6Z+0V98Gf7Aoz9mK1XMxTZqdnkSSWTPo6Fu0XEMqFa8x71kPeQ/WyvCm4QyATXKIm300jXmY07klaPmN/e7uQ= X-Gm-Message-State: AOJu0Yz0jpNIrRWroLyfAXWZ7pHF+KpfdniMlkNZfQOPx0uBvd4MgkVX DtyHi6gN+mkUZru8dP/DPm8n9MXP2VFK27ZeqAlFMfCB00Hl0KgAZhi14VhCcfA= X-Google-Smtp-Source: AGHT+IHYjkYNUm7lA6o8VoQDf0lRRw4MCHp0Sye9kAFEtmUYqvJor1aprr+WIwxoofUor+D26sA3RA== X-Received: by 2002:a9d:4b0b:0:b0:6e4:8a2b:40e8 with SMTP id q11-20020a9d4b0b000000b006e48a2b40e8mr8528957otf.32.1710239326480; Tue, 12 Mar 2024 03:28:46 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id j9-20020a9d7d89000000b006e12266433csm1374540otn.27.2024.03.12.03.28.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 03:28:46 -0700 (PDT) From: Anup Patel To: Atish Patra Cc: Andrew Jones , Anup Patel , opensbi@lists.infradead.org, Anup Patel Subject: [PATCH v2 09/10] lib: sbi: Pass trap context pointer to sbi_ecall_handler() Date: Tue, 12 Mar 2024 15:58:03 +0530 Message-Id: <20240312102804.1436376-10-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240312102804.1436376-1-apatel@ventanamicro.com> References: <20240312102804.1436376-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240312_032848_217076_BE951E45 X-CRM114-Status: GOOD ( 12.14 ) X-Spam-Score: -0.2 (/) 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: To be consistent with other trap handlers, pass trap context pointer to sbi_ecall_handler(). Signed-off-by: Anup Patel --- include/sbi/sbi_ecall.h | 4 ++-- lib/sbi/sbi_ecall.c | 3 ++- lib/sbi/sbi_trap.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:329 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -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_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.0 T_SCC_BODY_TEXT_LINE No description available. 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 To be consistent with other trap handlers, pass trap context pointer to sbi_ecall_handler(). Signed-off-by: Anup Patel Reviewed-by: Samuel Holland Reviewed-by: Clément Léger --- include/sbi/sbi_ecall.h | 4 ++-- lib/sbi/sbi_ecall.c | 3 ++- lib/sbi/sbi_trap.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/sbi/sbi_ecall.h b/include/sbi/sbi_ecall.h index 0bf42d1..0b35eff 100644 --- a/include/sbi/sbi_ecall.h +++ b/include/sbi/sbi_ecall.h @@ -18,7 +18,7 @@ #define SBI_OPENSBI_IMPID 1 struct sbi_trap_regs; -struct sbi_trap_info; +struct sbi_trap_context; struct sbi_ecall_return { /* Return flag to skip register update */ @@ -87,7 +87,7 @@ int sbi_ecall_register_extension(struct sbi_ecall_extension *ext); void sbi_ecall_unregister_extension(struct sbi_ecall_extension *ext); -int sbi_ecall_handler(struct sbi_trap_regs *regs); +int sbi_ecall_handler(struct sbi_trap_context *tcntx); int sbi_ecall_init(void); diff --git a/lib/sbi/sbi_ecall.c b/lib/sbi/sbi_ecall.c index 631c5dd..d4fc58c 100644 --- a/lib/sbi/sbi_ecall.c +++ b/lib/sbi/sbi_ecall.c @@ -95,9 +95,10 @@ void sbi_ecall_unregister_extension(struct sbi_ecall_extension *ext) sbi_list_del_init(&ext->head); } -int sbi_ecall_handler(struct sbi_trap_regs *regs) +int sbi_ecall_handler(struct sbi_trap_context *tcntx) { int ret = 0; + struct sbi_trap_regs *regs = &tcntx->regs; struct sbi_ecall_extension *ext; unsigned long extension_id = regs->a7; unsigned long func_id = regs->a6; diff --git a/lib/sbi/sbi_trap.c b/lib/sbi/sbi_trap.c index ebf454d..0b35d1a 100644 --- a/lib/sbi/sbi_trap.c +++ b/lib/sbi/sbi_trap.c @@ -299,7 +299,7 @@ struct sbi_trap_context *sbi_trap_handler(struct sbi_trap_context *tcntx) break; case CAUSE_SUPERVISOR_ECALL: case CAUSE_MACHINE_ECALL: - rc = sbi_ecall_handler(regs); + rc = sbi_ecall_handler(tcntx); msg = "ecall handler failed"; break; case CAUSE_LOAD_ACCESS: