From patchwork Thu Jul 6 10:49:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Chauhan X-Patchwork-Id: 1804278 Return-Path: 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=) 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=WbQwNubm; 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=Bt1rtTcv; 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 4QxYFm3mZ0z242V for ; Thu, 6 Jul 2023 20:50:04 +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=NRlcnKHUAkfhjRx7cbIWdsCZf+kVYMpppTILZE+0Crg=; b=WbQwNubm4VmHy6 uEGQTxxbQaFlH7Ofl+2RA6SoT3yFMGaxHEIdngA9pTxLoZx67rM2mj4ktEtu6g++FUIlklvLhtQ+Z 0RnbmPaitdOW/II7KYsU2R0bKrMHSB1cVERYpNKP+y9Mk2l/nvTzUt2fiBRCuK6ejLPDXgA0J7D7f BXYhmLMcijidAEbf3pfGfS4GLblkggGZmHnBxH91TNQKnIshahU/erWTjZ4FJK/EGwuMAH1sfpEIW sCMi8877uirALWZHykl7Cx9HXxJ1lxwZOgW5+hw/sQ2CAA2smKoCcrtKr7sTB/8M0stkYwCzj7by9 5HYnsowFzavHfDH7tR/g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qHMYP-001Gah-3C; Thu, 06 Jul 2023 10:49:42 +0000 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qHMYN-001GX5-1b for opensbi@lists.infradead.org; Thu, 06 Jul 2023 10:49:40 +0000 Received: by mail-oi1-x230.google.com with SMTP id 5614622812f47-3a1f01c6aabso63529b6e.0 for ; Thu, 06 Jul 2023 03:49:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1688640576; x=1691232576; 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=Kiz75rNsuHDqUoAOf7T2HDtBOd69cL4BYWqhXpPaxdo=; b=Bt1rtTcvQBagRX3m1hklXfHYCRCAB+LEoq4Gpp/k8ZjaP4uNpsmXnSO7dKTTP2wW5o usqVvei79rzkNt0//slt2p6vpqkeRZn5y+U8oBj6VzZyvu6oWvcm8HFw9e/LzXiA1D5c 2/TQLFpOLgr0GWa6R5ZwoqDA7//WdvTKwwGT9BZoBkp3EjBPXk+kcn95q4UKpDAVTZMR nENKNxzJ1yfdPcxMVljmJ+0m+kZQywR7eZt5KPmg49q5JbsHOOkudy6PuxtQ96dSECgU SQxXcVXJJUk0bDhWK7T6TG1l/1YM98uzWJBGLjcmbHLxW7M8fW+ZfK5AIzZDPYCT0os+ pO+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688640576; x=1691232576; 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=Kiz75rNsuHDqUoAOf7T2HDtBOd69cL4BYWqhXpPaxdo=; b=ap16aqYpctSkawZTXvPzNwLD8he4CBc3v5sFA793uWViA+wCVgloLeDdehUrLzF60C oTpJs8GvnE3CCFrrxj1n7Al6GUuNFoIYkOrAJ3n7ErtlVStE+gAv2hp/wgs/+UbFkbZ3 xkJSH88Ub60ZqBpAdEdiQUOJlUiVX4n//vdckLmmwLaGpdSq+l7H3L+G9otzerHKdtQ8 2EAa6yOM581O/JJMltqhC79m1DlO9m5p1DFPindjBbAfAizniFKoUhPB4yh87gz1pjXL Cs7xXVKuL5ORzL9jvhC5aTcxajlf2kCn/966v6sl0ETBaXa9iBj03sXUUJsFQhkipRSJ j7SQ== X-Gm-Message-State: ABy/qLaN41+NNZQhNWfqyR4EOjoRjGy3JU7pm0YOpyzchLl0hKL2WlV/ t79GBGhHCzbXXyssqX99S57VCMwgj8nrxkmEtIiah4dZ X-Google-Smtp-Source: APBJJlEne+tGbxIbLcJs6b327mma2UQXGmKy4FdqGR+f6JF1udx/v99TM6mUeI5tZgjoFzM4G2yZ/Q== X-Received: by 2002:aca:bbd6:0:b0:3a1:d4c4:ac4b with SMTP id l205-20020acabbd6000000b003a1d4c4ac4bmr863365oif.3.1688640575739; Thu, 06 Jul 2023 03:49:35 -0700 (PDT) Received: from saptrishi.. ([2405:201:d019:cbd3:9126:16c2:7e:c7e5]) by smtp.gmail.com with ESMTPSA id gn20-20020a17090ac79400b002635341a7e8sm3670746pjb.3.2023.07.06.03.49.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jul 2023 03:49:35 -0700 (PDT) From: Himanshu Chauhan To: opensbi@lists.infradead.org Cc: Himanshu Chauhan Subject: [PATCH v2 0/8] Add support for Smepmp Date: Thu, 6 Jul 2023 16:19:20 +0530 Message-Id: <20230706104928.3391947-1-hchauhan@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230620143212.2701598-1-hchauhan@ventanamicro.com> References: <20230620143212.2701598-1-hchauhan@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230706_034939_541096_CCD33D3C X-CRM114-Status: GOOD ( 11.21 ) 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: This patch series adds support for the Smepmp specification. The detection of Smepmp support in platform depends on the ISA string present in the FDT. If "smepmp" is present in ISA string in FDT, Smep [...] 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:230 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This patch series adds support for the Smepmp specification. The detection of Smepmp support in platform depends on the ISA string present in the FDT. If "smepmp" is present in ISA string in FDT, Smepmp is enabled. When Smepmp is enabled, the M-mode software's free access to S/U memory region is revoked. Hence, all the shared memory access between M-mode and S/U-mode must be done only after mapping the shared memory. changes in v2: * Split into futher patches - FDT ISA string parsing is now separate patch - Map/Unmap functions for shared memory are in different patch * Addressed other general comments. Himanshu Chauhan (8): include: sbi: Add macro definitions for mseccfg CSR lib: sbi: Add functions to manipulate PMP entries include: sbi: Add Smepmp specific access flags for PMP entries lib: sbi: Add smepmp in hart extensions lib: utils: Add detection of Smepmp from ISA string in FDT lib: sbi: Add support for Smepmp lib: sbi: Add functions to map/unmap shared memory lib: sbi: Map/Unmap debug console shared memory buffers include/sbi/riscv_asm.h | 6 + include/sbi/riscv_encoding.h | 12 ++ include/sbi/sbi_domain.h | 84 +++++++++++++- include/sbi/sbi_hart.h | 19 ++++ include/sbi_utils/fdt/fdt_helper.h | 3 + lib/sbi/riscv_asm.c | 42 +++++++ lib/sbi/sbi_domain.c | 14 ++- lib/sbi/sbi_ecall_dbcn.c | 3 + lib/sbi/sbi_hart.c | 177 +++++++++++++++++++++++++---- lib/sbi/sbi_init.c | 22 ++-- lib/utils/fdt/fdt_helper.c | 111 ++++++++++++++++++ platform/generic/platform.c | 9 ++ 12 files changed, 464 insertions(+), 38 deletions(-)