From patchwork Thu Oct 24 12:34:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Conor Dooley X-Patchwork-Id: 13848918 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7AB4FCE8E6B for ; Thu, 24 Oct 2024 12:39:38 +0000 (UTC) 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=3xLUVPNovOUCLuxxr31ZuIYKYe+Sr+8Aumo/DdqQuiQ=; b=LJ3fB4bfYmnSB/ H2Rtz5785fTlB5DQWtGuZ5VnP/oqWrNFQl/W5MqyvPZSY+/yhpB/DnEEjHXtjsi/wLFPdksa2FfJo g6tYypfZUPSR2GGJZbzpvcwlV0EbNoaNW0bipu4BVX/Zlo00uwFmsUnTicny17ILroGTYiG4rLgKz IB1C5c1YNgq+gb9XZdHXiXXQpbQDjq0jRMAyLjIC1AS2joLyR9Kw54Un7AFQ1BwvLGWbP/lRRLkoX qIVzkweq+QaipqQU7wUn5tp9lwOXyCOZez53m9Pco9aFrGCicuaEMGsMsuTeCo/9Ynf5WG0PYB7sF lhwAvX1Wq1eECPmvinaw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3x7j-00000000Mwn-286o; Thu, 24 Oct 2024 12:39:31 +0000 Received: from nyc.source.kernel.org ([147.75.193.91]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t3x2z-00000000LzE-3hlO for linux-riscv@lists.infradead.org; Thu, 24 Oct 2024 12:34:39 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id D1BD7A4535C; Thu, 24 Oct 2024 12:34:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89700C4CEC7; Thu, 24 Oct 2024 12:34:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1729773276; bh=3ygEjG6hTS+s76bWt2IvYPg8yyhSvz+WHj+DxEVzQJY=; h=From:To:Cc:Subject:Date:From; b=uonhDsAxDtqHpYTOwA0RL5u/lqune/NxVAhq2wVRAgjNeuH3v8KhBLVMCZJImrKIi E0kvBrkUcshfxQXg0K4JFuvrk+GM3j47hylwCwddJmO27BWldvg9kEQrG7xnX63he9 O5/yasof/iY3fMmtYFUgWv4s/L0V4dndgQjnkQXwbpvILjrWdc6oN75ejBQQ42iuCG LbPUpRQ6kAXix5qmxfe4LfTeQg6fFWRMJVbZZAx2GPDWzRJ9fyTCCfl+8FZTKCwHUf vUUkdNSifGBg5hqNsIr9HBl6FP1Pmo1b5/LwPmfMaZ9MYH2UUgM1bbURcnXJEys6DT 7qE0Xku+zq4kg== From: Conor Dooley To: linux-riscv@lists.infradead.org Cc: conor@kernel.org, Conor Dooley , Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Palmer Dabbelt , =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Andy Chiu , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/5] Add some validation for vector, vector crypto and fp stuff Date: Thu, 24 Oct 2024 13:34:28 +0100 Message-ID: <20241024-fanning-enrage-bcc39f8ed47d@spud> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1682; i=conor.dooley@microchip.com; h=from:subject:message-id; bh=rFKvUC5WbGtzbbJAD2E+rOogADPDAQJQjX4YNpHNNNs=; b=owGbwMvMwCFWscWwfUFT0iXG02pJDOlSdlcDu+QXPLh8ReufWddjnuVnZ7a/l1bOe7nIcMcN+ VvVvC07OkpZGMQ4GGTFFFkSb/e1SK3/47LDuectzBxWJpAhDFycAjCRHTUM/zPNewu1Sp/UNPFt nz/93d3+BUw8a5hDlDIK5Zb/W9Fz8zYjQ3vYSXt1ofrkqa7T0qOu+dSJ/J9qzliou0340o5n63a +YQcA X-Developer-Key: i=conor.dooley@microchip.com; a=openpgp; fpr=F9ECA03CF54F12CD01F1655722E2C55B37CF380C X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241024_053438_013727_B744FB0F X-CRM114-Status: UNSURE ( 8.92 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Conor Dooley Yo, This series is partly leveraging Clement's work adding a validate callback in the extension detection code so that things like checking for whether a vector crypto extension is usable can be done like: has_extension() rather than has_vector() && has_extension() which Eric pointed out was a poor design some months ago. The rest of this is adding some requirements to the bindings that prevent combinations of extensions disallowed by the ISA. Cheers, Conor. v2: - Fix an inverted clause Clément pointed out - Add Zvbb validation, that I had missed accidentally - Drop the todo about checking the number of validation rounds, I tried in w/ qemu's max cpu and things looked right CC: Conor Dooley CC: Rob Herring CC: Krzysztof Kozlowski CC: Paul Walmsley CC: Palmer Dabbelt CC: "Clément Léger" CC: Andy Chiu CC: linux-riscv@lists.infradead.org CC: devicetree@vger.kernel.org CC: linux-kernel@vger.kernel.org Conor Dooley (5): RISC-V: add vector crypto extension validation checks RISC-V: add f & d extension validation checks dt-bindings: riscv: d requires f dt-bindings: riscv: add vector sub-extension dependencies dt-bindings: riscv: document vector crypto requirements .../devicetree/bindings/riscv/extensions.yaml | 84 ++++++++++ arch/riscv/include/asm/cpufeature.h | 3 + arch/riscv/kernel/cpufeature.c | 148 ++++++++++++------ 3 files changed, 185 insertions(+), 50 deletions(-)