From patchwork Tue Jun 20 11:07:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 694481 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp246911wrm; Tue, 20 Jun 2023 04:16:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Z3sJEG8FKWJxlhFmXvSl9gcbvwcfHQJ+Ju7uXhUyCcNLa1hpgKcsFZNylCYZsENUroQre X-Received: by 2002:a05:6214:2302:b0:626:3375:6fea with SMTP id gc2-20020a056214230200b0062633756feamr13237265qvb.22.1687259759950; Tue, 20 Jun 2023 04:15:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687259759; cv=none; d=google.com; s=arc-20160816; b=X5yYPl+qblivyX/D0KaGeCAL9A2RSI9fQyF4RVV0wIMawdKEkAkIkklxBXDtISsi4Q Ue3FsyZAqBrIoEoq5sH7pkxTBpxcKt/IgwO63+mp9o9RS0/qAVsL8JwDauVqzMFCT56+ WplBrOKY+86eXq/rU2WPe3dniqiGYMNpPJgGBTbIQDBYmkVF4HUImi9VpDJtRNitdEqy 9qk7PwpWU2txmi0B6RCoc9/7lQxDmrNo4zBmez9gGwWzAsdUinpsG2uLuWMpRi0k8Dpa riocL4tKF+ccYZ8jJhxmwwEnXpw3lPpvboHPlsgSdy+czQFw25j7hfR9ctxbjkSrKmds n/dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=QRqjQC8v/J/3z0IiE+GLS9BAOlnmnUcZezvum6TPI3k=; b=WqkCuknStikdaSQe4kCA6qOzy7ppBpUXgmogdnU8cUDNTJqyDzn88VKFQ8lYNHPwGT dJC7qymshlNMjqYVc0vy2uvEqgwxChQbQnHkRgkGUhqqScJxB+e3x74UraVac9xPNoh5 joN/1llmSTwfmcCRv2KfPBI4OCCTUEngdSiiA0M5e4XMEXcdBnMyQZhWTL/INh58FT0m 6bby3+6f8iAu3moFgzcaEQRZAaeg4XxJQPttwo8ezzvghvbHNyE4nu3NdLyxiA5HCiXv bFv//K0SfWNEqYWHFAxIG33E37TbY15L5oEcaubRrDJC8pXy5FpetMtMllz7ycpMvDOQ mjOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="aWp/iwox"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6-20020a05621420e600b0062dec1c9bb8si725266qvk.513.2023.06.20.04.15.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Jun 2023 04:15:59 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="aWp/iwox"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qBZDp-0006GH-TO; Tue, 20 Jun 2023 07:08:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qBZDl-00069L-IL for qemu-devel@nongnu.org; Tue, 20 Jun 2023 07:08:25 -0400 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qBZDj-0004L7-Gu for qemu-devel@nongnu.org; Tue, 20 Jun 2023 07:08:25 -0400 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-982a88ca610so546771166b.2 for ; Tue, 20 Jun 2023 04:08:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687259302; x=1689851302; 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=QRqjQC8v/J/3z0IiE+GLS9BAOlnmnUcZezvum6TPI3k=; b=aWp/iwoxUbkQolVQKW6qGvPmtiWB/WaMvGJvQaoaJUJXr2aRSCbSXU/LPxwFV8lLTS /M5D3laZG6F95r6RJP7kHJ2jYlEBCxIKHLWS+Dl+cxq+ETau5ofZaeadoskTY7rT63mp OclFYSl6GK9j/JvgLaEN15/zR607mB6L+FIePPygL4P5kSG7rDAJEIsZ2ji/iDVlZuAm B+ZAm4fAPBB0ChlkMzsoTBQpRQ2lcrtTCfqX9boJADTspm6d0aiYkNGiOAOY+zNtFv8W ocPabNcOjMN5pCSJv4ROaMtI32+6HwZK/hTKH4y+pBNsT7UaNLywZIxBanBIQqz02sXx OBpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687259302; x=1689851302; 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=QRqjQC8v/J/3z0IiE+GLS9BAOlnmnUcZezvum6TPI3k=; b=KeeIUdZATi13wrCMcWTgKNHWF+or/JwGYrQmC4ymi3txLSe4j0EpH04spuFAuzkEXs wtpc45X687HnmgcaeAl7KXkUx1aFkhJz57Obf8Jiq345NZismtfx3RaMnzfnBzOR3jaB un49WAMjd34xGsvt42dvKTtm5K0f9+ncZkvi1Mw20bt2N7qLZc/DtErorzOkVMPzru59 Y5Kh4Qdm4MNE9FvVVzW6yelkS/Ixi8eRwpxn+/r3jipqPbVBQlFuO8Cx6XTr6be3Iu66 Gq5sUiLs3YznU+DyBCVUcav974GUQAsz8LvxgzcKRf1jUo1DstSOfMbXlNlArxGOG+dZ FNMg== X-Gm-Message-State: AC+VfDw2ykqlgr3aRwNdi7f+Da0OfjaYYnwFPHOBcZzEbTNi5m+b8zc9 2ImB2FnKMCw1Dl3Rfy4uUpdN8aD4rhgxvaCVkXKyFbKO X-Received: by 2002:a17:906:f84d:b0:965:6a32:7de6 with SMTP id ks13-20020a170906f84d00b009656a327de6mr7917240ejb.30.1687259302192; Tue, 20 Jun 2023 04:08:22 -0700 (PDT) Received: from stoup.lan ([176.176.183.29]) by smtp.gmail.com with ESMTPSA id x17-20020a170906711100b009884f015a44sm1170687ejj.49.2023.06.20.04.08.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 04:08:21 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: berrange@redhat.com, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org Subject: [PATCH v3 15/37] target/riscv: Use aesdec_ISB_ISR_AK Date: Tue, 20 Jun 2023 13:07:36 +0200 Message-Id: <20230620110758.787479-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230620110758.787479-1-richard.henderson@linaro.org> References: <20230620110758.787479-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-ej1-x62b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This implements the AES64DS instruction. Signed-off-by: Richard Henderson --- target/riscv/crypto_helper.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/target/riscv/crypto_helper.c b/target/riscv/crypto_helper.c index b072fed3e2..e61f7fe1e5 100644 --- a/target/riscv/crypto_helper.c +++ b/target/riscv/crypto_helper.c @@ -213,7 +213,12 @@ target_ulong HELPER(aes64es)(target_ulong rs1, target_ulong rs2) target_ulong HELPER(aes64ds)(target_ulong rs1, target_ulong rs2) { - return aes64_operation(rs1, rs2, false, false); + AESState t; + + t.d[HOST_BIG_ENDIAN] = rs1; + t.d[!HOST_BIG_ENDIAN] = rs2; + aesdec_ISB_ISR_AK(&t, &t, &aes_zero, false); + return t.d[HOST_BIG_ENDIAN]; } target_ulong HELPER(aes64dsm)(target_ulong rs1, target_ulong rs2)