From patchwork Mon Jun 17 15:41:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= X-Patchwork-Id: 1948673 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=pW+2j0l3; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=vYM4bIF9; 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 4W2vHv2q5kz20XJ for ; Tue, 18 Jun 2024 01:41:29 +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=9pg7UTSQxfw4msMAhyWUzdD0Za/IdrC5+nx046P/VLE=; b=pW+2j0l34Vy99U eagmeoRDDGt7o+C8Ovi5Rn7bhQjgMX8StW6j0gJaQYCTBYhslGJc1NsJJ8Q80QlQo46+/Yb/jD6pH dJSae6P9N7r6xuNd4lC7xAvpFBXojA7fGbosqUUFn6nGJ4/uMwJv9EDoW7UrtzcpG4P75seQ8AQjl qOZeb1DSE3Ea4oFvCmCfci1kRzu4m6tKFiSUw/1BTRUya7h4DlUINH/h/n7hKpK6/fT+gR9pjN1In yhyg3Ct/XSPQu1PnvHEcS9O9N34x7WyS1TvzLWruUjZwrLkmav5hIW7+oV3BqtjWRLmDnIAqE0bdU S9ACim27p0YszbgDe96Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJETv-0000000BWnf-10mf; Mon, 17 Jun 2024 15:41:19 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJETr-0000000BWlA-1Ypi for opensbi@lists.infradead.org; Mon, 17 Jun 2024 15:41:17 +0000 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4210f0bb857so3974505e9.1 for ; Mon, 17 Jun 2024 08:41:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1718638873; x=1719243673; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=TmBW64XjQB1lqAUqLJ6eTto1Rs8ttsMJJOlhkbj9WAI=; b=vYM4bIF9MKwuQJ5MYR+cmQh2wzqrv9fQuK1Wz4ONM+FK9NRv9bTcSgxU+PiH2Zn1+z 6/hpSKOnd9nl0YKcH/BHDrjQ2RCaPCNxSQwjZoi7vwJIAQNlM2hPYEoTe76t2SVgEiQi 4uCsJ4t1Js8AD0wbNvAbR3aoFu9cBo1G0vWxh8a3beUml3d1M0T++Vg3YJgH84KpB5z/ Kiza9OTzMorYE3xxiUXu4GHxSfx7G2VpVwBFP2vvAzgruLrlED3W+p4oNLRmilJCJVKU jP18bdUpJlJuQpRGKnK7yE56oGga2eydEhxbCWdDdji4TMPgzru2ia5Kw32wefWVO5Dl 346g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718638873; x=1719243673; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=TmBW64XjQB1lqAUqLJ6eTto1Rs8ttsMJJOlhkbj9WAI=; b=WBXXTm0dSUlibvsXm2IcbByVrboOV82XmW6tLW4RYd7LitacadhZdNhhjI/cANolSw K/ZWztg2bCRrnY6Eqha3LRdKVUAQUSn21mIzseI18WXOZBTWndi70HzFFezrMmdzYxs7 kKMyTVsh5FWLl4jS4qI06Omuq3gfgVnnUgY4fDVFHdpjcJ4xwvPLtnLmaaKoWlqn73Mg UMraVFeN0LXIdttOTd4oWrnj7rFIZPSy4c/gs91St4Qhk5Qt9BTQTIaDDGt059feUS5C veR0fmOfzjbRjSqWtNj36c7oNysy3XnT9ZLN5unvRces4eZK46TxJBZSK+4MwXhYei57 X+mQ== X-Gm-Message-State: AOJu0YwkChWcERnfOUI0xmVmYlZFEXqyS3GcXsadj2OfD/Q2tNhejhwJ Uj0uQzqgiiP3wI53yGUfbA3hjauShbPV99Sm4RpmuHH2LvcUiH8znpz1a76s4x+NwicBJ99n/MT JBug= X-Google-Smtp-Source: AGHT+IELTHAp4yy26FXN3il85mKIeHZPNoBXC8Yiv5zYYF+6//VliPORlwY2S4+5cB8wNov+LY7w0g== X-Received: by 2002:a05:600c:35c1:b0:421:67db:f251 with SMTP id 5b1f17b1804b1-42305e70f48mr67090545e9.1.1718638873294; Mon, 17 Jun 2024 08:41:13 -0700 (PDT) Received: from carbon-x1.. ([2a01:e0a:999:a3a0:9f43:3ca4:162c:d540]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36075104d88sm12097923f8f.104.2024.06.17.08.41.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 08:41:12 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: opensbi@lists.infradead.org Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Anup Patel , Atish Patra Subject: [PATCH v2 0/4] Add SBI FWFT extension support Date: Mon, 17 Jun 2024 17:41:00 +0200 Message-ID: <20240617154110.4007865-1-cleger@rivosinc.com> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_084115_537034_14DB4828 X-CRM114-Status: UNSURE ( 8.80 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) 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 series adds support for SBI FWFT extension. FWFT extension is not yet ratified but will be present in SBI V3.0 [1]. Current support can be tested using kvm-unit-tests [2] using the following comm [...] Content analysis details: (-0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:32c listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -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.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 This series adds support for SBI FWFT extension. FWFT extension is not yet ratified but will be present in SBI V3.0 [1]. Current support can be tested using kvm-unit-tests [2] using the following command: $ qemu-system-riscv64 -s -M virt -cpu rv64 -nographic -serial mon:stdio \ -bios /build/platform/generic/firmware/fw_jump.bin -kernel /riscv/sbi_fwft.flat This series is based on Yong-Xuan Wang series [3]. Link: https://lists.riscv.org/g/tech-prs/message/924 [1] Link: https://github.com/clementleger/kvm-unit-tests/tree/dev/cleger/fwft [2] Link: http://lists.infradead.org/pipermail/opensbi/2024-June/006966.html [3] --- V2: - Rebased on top of Yong-Xuan Wang svadu/svade series - Updated wrt latest FWFT spec (removed software check exception deleg) Clément Léger (4): lib: sbi: add support for firmware features extension lib: sbi: fwft: add support for SBI_FWFT_MISALIGNED_EXC_DELEG lib: sbi: fwft: add support for SBI_FWFT_PTE_AD_HW_UPDATING lib: sbi: implement SBI FWFT extension include/sbi/sbi_ecall_interface.h | 27 ++++ include/sbi/sbi_fwft.h | 23 +++ lib/sbi/Kconfig | 4 + lib/sbi/objects.mk | 4 + lib/sbi/sbi_ecall_fwft.c | 49 ++++++ lib/sbi/sbi_fwft.c | 261 ++++++++++++++++++++++++++++++ lib/sbi/sbi_hsm.c | 15 ++ lib/sbi/sbi_init.c | 11 ++ 8 files changed, 394 insertions(+) create mode 100644 include/sbi/sbi_fwft.h create mode 100644 lib/sbi/sbi_ecall_fwft.c create mode 100644 lib/sbi/sbi_fwft.c