Message ID | 20230712043436.100548-11-hchauhan@ventanamicro.com |
---|---|
State | Accepted |
Headers | show
Return-Path: <opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=<UNKNOWN>) 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=MX5gd07V; 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=WBuZHYnv; dkim-atps=neutral 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 (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R14fh1qG3z20cD for <incoming@patchwork.ozlabs.org>; Wed, 12 Jul 2023 14:35:24 +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: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=ada+uvO+noctgYa3/kjWU6H3RlrJluq8LR9Qt8rkAtQ=; b=MX5gd07VKp4Rp6 naoX2fJd8+AP8s2czLEfEwIZWS+J2CzpTFEYx4iT1fY425afWtBDAftBnIocUZsKMu0JP/rqsZwDd LUtcJvlxg1aoKH43Nb6oZJcF5G9Ci/IsG4V5/W4qNdLDMmP4COHzZeqHllBu/lwjlJk0qvuqyeTCs F19+7wn0gcDFAqVkRoVl/5VJOO3L2F7yMjrdnD8iRyfJ92vBoLmZnGIuXF4wsaSIgq2h0KZVosQSI shMFwj3jmXnZeSZrFxZzJwvacfTIhz3fksGLYFNTvQNyiYvm/8eUGCSdfK0hgKfFoi1iw91iWiLzy ow+sRG91KB7xViz1SFjQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qJRZG-00GV04-01; Wed, 12 Jul 2023 04:35:10 +0000 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qJRZD-00GUxi-2O for opensbi@lists.infradead.org; Wed, 12 Jul 2023 04:35:08 +0000 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1b8c364ad3bso11605195ad.1 for <opensbi@lists.infradead.org>; Tue, 11 Jul 2023 21:35:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1689136506; x=1691728506; 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=Tv59Op70FKzGCwZuThoVyhu/lDJD9aIgaIHKB24tcPk=; b=WBuZHYnvSldgIav3OS/Pc0riaoC7lZCbi/jmtuw5WluYJpCULb59344D++Ggu38exY scTG60VeY5Y7tU4T52eqpQGU+ops3tgoDq1BgR6ByXSNfmERZn47lRANO9mPbZj4Plry QcgDU1/Y/kvvNrQiTPRE/3LFFXiId1PmBpNcGapj4cMghj30V8I18QCp6PH2Kv/4K7Yh NtJEecUtke2CzzuHE0DjQt+RbBGqG8TsuMKsF3ar4MZ6CJvRMPeVmXWQK09Qph4bMFaX lLbmVMDMlS2cvwmF44RUE3nKVX83qctlnGaxB9PF+/DrXCGi4xe3C8rNSSgHmV5VD54S rWvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689136506; x=1691728506; 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=Tv59Op70FKzGCwZuThoVyhu/lDJD9aIgaIHKB24tcPk=; b=I9K4vSR4mVXL5eCs72I4q28eZ1jJXR0RVZW0twz6SnGZQ76gvSuo0B5MnKJ8vmgNJp HMHccgLmENeqFrnq3aG73/fYPN/I0veygMSQjRGxkMRbk3aojO+UMbSSv4TjAfZoTajJ 9sSFu4cPpKPcT8yDahIDexjCGxwihVVkFImqCryd37OIQwTMYMuclMl7kaZ8ojHCm3l1 c//28z8G2G3uDd+wgERM8APhBC/dFk70ryD4fxVeAvgSoB0IS1ZACY/3R8gXZDqiGHry rU5k+8NXUqo56x3vPeM7Qx9p83qqneLfsmBsnKjbAaVL+7C0Id4LjgxjVkbcSyc2WPQV GU1A== X-Gm-Message-State: ABy/qLZJne2+90/SlekWqBrA+z3+ZjKC3EwgTYeNiKK/6dZo4x09w/E7 F+A3I5JD4pVTOprZ9BZzpFCLo+UTZJM7fX2JQQs= X-Google-Smtp-Source: APBJJlELA8o0j5mktYuHMot3GFXiuUF5Wup78L6YP5wNCLyXxIZxMvI0809wTvb4R2117Gxljgx1tA== X-Received: by 2002:a17:903:244e:b0:1b8:b4f6:1327 with SMTP id l14-20020a170903244e00b001b8b4f61327mr22074380pls.6.1689136506106; Tue, 11 Jul 2023 21:35:06 -0700 (PDT) Received: from saptrishi.. ([2409:40f2:101d:c560:cb32:f5f5:1d86:260a]) by smtp.gmail.com with ESMTPSA id ix13-20020a170902f80d00b001b896686c78sm2806152plb.66.2023.07.11.21.35.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jul 2023 21:35:05 -0700 (PDT) From: Himanshu Chauhan <hchauhan@ventanamicro.com> To: opensbi@lists.infradead.org Cc: Himanshu Chauhan <hchauhan@ventanamicro.com>, Anup Patel <anup@brainfault.org> Subject: [PATCH v3 10/10] lib: sbi: Map/Unmap debug console shared memory buffers Date: Wed, 12 Jul 2023 10:04:36 +0530 Message-Id: <20230712043436.100548-11-hchauhan@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230712043436.100548-1-hchauhan@ventanamicro.com> References: <20230706104928.3391947-1-hchauhan@ventanamicro.com> <20230712043436.100548-1-hchauhan@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230711_213507_778128_CB17B25F X-CRM114-Status: UNSURE ( 9.70 ) X-CRM114-Notice: Please train this message. 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: With Smepmp enabled, it is necessary for shared memory from S/U mode to be mapped/unmapped before and after read/write of the memory region. This patch maps the debug console shared memory before acce [...] 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:631 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_VALID Message has at least one valid DKIM or DK signature 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 X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <opensbi.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/opensbi>, <mailto:opensbi-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/opensbi/> List-Post: <mailto:opensbi@lists.infradead.org> List-Help: <mailto:opensbi-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/opensbi>, <mailto:opensbi-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "opensbi" <opensbi-bounces@lists.infradead.org> Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org |
Series |
Add support for Smepmp
|
expand
|
diff --git a/lib/sbi/sbi_ecall_dbcn.c b/lib/sbi/sbi_ecall_dbcn.c index 8e68729..18cd6c8 100644 --- a/lib/sbi/sbi_ecall_dbcn.c +++ b/lib/sbi/sbi_ecall_dbcn.c @@ -14,6 +14,7 @@ #include <sbi/sbi_ecall_interface.h> #include <sbi/sbi_trap.h> #include <sbi/riscv_asm.h> +#include <sbi/sbi_hart.h> static int sbi_ecall_dbcn_handler(unsigned long extid, unsigned long funcid, const struct sbi_trap_regs *regs, @@ -46,10 +47,12 @@ static int sbi_ecall_dbcn_handler(unsigned long extid, unsigned long funcid, regs->a1, regs->a0, smode, SBI_DOMAIN_READ|SBI_DOMAIN_WRITE)) return SBI_ERR_INVALID_PARAM; + sbi_hart_map_saddr(regs->a1, regs->a0); if (funcid == SBI_EXT_DBCN_CONSOLE_WRITE) *out_val = sbi_nputs((const char *)regs->a1, regs->a0); else *out_val = sbi_ngets((char *)regs->a1, regs->a0); + sbi_hart_unmap_saddr(); return 0; case SBI_EXT_DBCN_CONSOLE_WRITE_BYTE: sbi_putc(regs->a0);