From patchwork Mon Jul 3 10:05:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 698660 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1666504wrs; Mon, 3 Jul 2023 03:14:13 -0700 (PDT) X-Google-Smtp-Source: APBJJlGj0xDRmq+3XNhY3B39S2WiwbptgFN2+qlkPabW2majPT0+PV+vDbdJp7uzqJ1ZASK3bWR/ X-Received: by 2002:a05:6214:c3:b0:635:de52:8385 with SMTP id f3-20020a05621400c300b00635de528385mr8685872qvs.65.1688379253631; Mon, 03 Jul 2023 03:14:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688379253; cv=none; d=google.com; s=arc-20160816; b=KmuZQMqWn2P9vBIrpwfh2lJzRD8upuQo0glcTdhUmZhXuo2W4OwfUpha0ErIxe9r1u s4cA5I4HFXuc4R9K9bjuNEZTOJHaioy8Z84phmaREa2+iL2xcwaXGqcA+am3Lg/Z+XeJ jqPCjAB03G9NSvIoV/q7vqXuZ6TPwX3GXfJGlAq0w4RgZYICiLQkYhzx/AxYiIJm6+HY 6Px44o7QIZC07miK/X8tAUh54SFQJngHSz0+GKAF7t4dNpCKViMvoYzOL/aO9Rwgzc64 nOB0pm7x0mb15O6OyhgvmJU0c+NFPOSf5Vx06+UJJJaCsIcKHHmtYO/jhgyhenDweeyo QLhw== 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=; fh=DiqGMcF5+wJ0/Fe6a4a0YfMDHaiC5n3qovds/BNTPmI=; b=IvIaFq9698/j7PpOy7hXd1cbCNH8v9T/0wwlbQ5SLSv8PJczkaoyTHQSncLL+BRQlg oQlruFIw84HnqkCdBjTE1Pm4uCsRppb5/E9gbXvOeCgp5SgusG4w2FTsWouU2bBpAvNS QGLsj0NZJEIFJHVPI2j+1Ys3YvElCFIdnL3YsZ++SAsOnBcq5tl+GdA8Ea/38iomrgiA 1oxt+UmPYxULkW9IylYfmswLssOik396wECC4/QsM9E1SJRth33lYhclFAwnDhYmeLVk Wy49MGCaBYmXvdBZO3cyUaOG15AG7LHoZj0OP/KSlgDEY2dXuXofSnYTFQbuT9BJVdMX JfVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CyHtq4Su; 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 gu1-20020a056214260100b005adb460bc9bsi8226580qvb.412.2023.07.03.03.14.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 03:14:13 -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=CyHtq4Su; 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 1qGGS8-0003gw-D9; Mon, 03 Jul 2023 06:06:40 -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 1qGGRg-00037c-4b for qemu-devel@nongnu.org; Mon, 03 Jul 2023 06:06:12 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qGGRP-0005xv-47 for qemu-devel@nongnu.org; Mon, 03 Jul 2023 06:06:11 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3141140f51bso5747773f8f.1 for ; Mon, 03 Jul 2023 03:05:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688378753; x=1690970753; 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=CyHtq4SuWKPtI0enq0XMRv9MmHffCsVArxB+WqMcFwOePyiyBKr7+ngSf1TchOnl7X LAqaN0+c+/DRVoHb/6FWoHCUqhtI3erVZ1zldHnSwOtPJogJOPn5n/SvLV02nvYRQAup eqk3dr/aeKoIAZ24Fc17rnpqo4Fm7LdzbbPTVaVobK4ChNXqmfe8mv5z2PSZdQPGGnrs mnnOIodGxXKI0z4TkWpUBARUaAN+osWtHDhiVZblyUDzRyWWzZBzizm1q6leYKPtXV/4 RuUv+bV0wvN93xyfNrL7D3vRlQg6UjO4dAQViMJA/6+vDLith9OlnljFy3HrvZOJ5d6c 38Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688378753; x=1690970753; 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=EgNgO9ozIF0XC3/mPl38BsLpG9PhjDcUGtCmJvPUmk7S54ShdsNIluXdmQLlIiHq6K +axBYEUJMST8h2m+LzkVq0wokWHeUB1QlZ45rHJIW0SY2NeHCfBZH9SVvRc55F3bnpzE vyTGnWp4J4INhbC0b9Qn4tDayF/KnjoSPVS8WKPcPcWCPE9E8ltqMzwN6zT9sJSpQwEX 8lIPluylbGPqleu6RdCjYUWgnm5lGGZQblAIiVUjRdg9ubQKY/ndTl8XUsXAx3pAdTWx nsiB6MNLZK7Iw7zca2PleKal1hsgXfy6Di3/YBdjs+Co7itUa+lgQxKM4dHt1DwKqIgY vkLQ== X-Gm-Message-State: ABy/qLYzZrmx5zjrl4OIVHveQrLvYbjOPR8SpmMzc5QNYScN6RRhd68i uU/OEvP5Fu2LbX8kaV41wgz9qko6Kue4q1rLB7+Fsg== X-Received: by 2002:a5d:54c1:0:b0:314:3b78:da77 with SMTP id x1-20020a5d54c1000000b003143b78da77mr430121wrv.29.1688378753715; Mon, 03 Jul 2023 03:05:53 -0700 (PDT) Received: from stoup.home (91.232.79.188.dynamic.jazztel.es. [188.79.232.91]) by smtp.gmail.com with ESMTPSA id t5-20020a05600001c500b00313f7b077fesm18446562wrx.59.2023.07.03.03.05.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 03:05:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-riscv@nongnu.org, pbonzini@redhat.com, eduardo@habkost.net, alistair.francis@wdc.com, danielhb413@gmail.com Subject: [PATCH v4 30/37] target/riscv: Use aesdec_ISB_ISR_AK Date: Mon, 3 Jul 2023 12:05:13 +0200 Message-Id: <20230703100520.68224-31-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230703100520.68224-1-richard.henderson@linaro.org> References: <20230703100520.68224-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=richard.henderson@linaro.org; helo=mail-wr1-x42c.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=unavailable 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 Reviewed-by: Philippe Mathieu-Daudé --- 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)