From patchwork Fri Jun 9 02:23:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 690889 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d8a:0:0:0:0:0 with SMTP id b10csp599397wru; Thu, 8 Jun 2023 19:32:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7oJiD48Vksnm3eM/Kw/IQ6dUbbhwY8uWPfwhbneSOUtFUTRDuj1L9vB62nn6tngNWWX3Bm X-Received: by 2002:a05:6214:20a7:b0:625:976b:572e with SMTP id 7-20020a05621420a700b00625976b572emr343363qvd.38.1686277973715; Thu, 08 Jun 2023 19:32:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686277973; cv=none; d=google.com; s=arc-20160816; b=Ar0jMCRYmVnYrDrPd5j5zYXWkaWJOz6YWmF3tLCh+56S0u+fwUj4Y1VX68tsMQ82dd pm6cgfYmauqv7dP+sJ+FIP6WJJ7Zac6F4zOqTRjIQYl52Q4VaBP5QqKHX28uc7l3etRz 2yu72SHmbYirXeSB70itSrbgQZDpPdgEGGbC/tpKjq0rN7QIfi6udwGgGLa+RghEEoqW AHzIjuo3xgp56+FarMLs8Xl9z4snvPEDOzM0TONghKn3PSdWLbXxAsZTVZJUYLKV+Y7v nursbxRdOBD1W1RyJi5cTPp0VhUHB4sdDwuBl611Wwdsj7vhglrMYE9RijewoFD1mUpk AkjA== 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=q9vppTZ0kH0Xs3eiJ138RWwvuyXdLrdS2zldn9LG9Ak=; b=Vd8g+qMdv0zVOgwLdk9QHEcENGTYt80GPUF4Ue4yMMn+fEDXX6xYBEORXy7XI63oOF fZlUBp84wK7RNM+Ra/QV4qSG8eodK0UD98CQZvngcNIh2FoAK0aO2NrcD2E8Xx6j2EWr Xvuq3b9FLpLfqGVl4/jLfyj4iCjfbrqh+vpBS/W4MWFFkjyprh8/PzIszylZYI5o9bML nPMFLXDvyVjSpk2ppkP+SAuscxJJnyta0t+vP9jOpVZiEdBcCmsomrP3a8Va0lWcHm1R 6SbXNDs5mTQUVRQia7+M3UvNjjJvXi0OR08TlxSg9WY+5lVLbEK09zzAkb7tJCPF78H2 I5ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nJWCZtF3; 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 r9-20020a0562140c4900b006261ec16848si1684012qvj.38.2023.06.08.19.32.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Jun 2023 19:32:53 -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=nJWCZtF3; 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 1q7RpQ-0007UX-A2; Thu, 08 Jun 2023 22:26:16 -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 1q7RoM-0003Bg-3k for qemu-devel@nongnu.org; Thu, 08 Jun 2023 22:25:13 -0400 Received: from mail-oo1-xc2c.google.com ([2607:f8b0:4864:20::c2c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q7Rnl-0005mj-95 for qemu-devel@nongnu.org; Thu, 08 Jun 2023 22:25:09 -0400 Received: by mail-oo1-xc2c.google.com with SMTP id 006d021491bc7-55b3b3e2928so850858eaf.2 for ; Thu, 08 Jun 2023 19:24:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686277471; x=1688869471; 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=q9vppTZ0kH0Xs3eiJ138RWwvuyXdLrdS2zldn9LG9Ak=; b=nJWCZtF3h06Cbsflk7UBEJ53FYknsNeRYR21bA0viRmaMSPCSgLHyjkoEoE2Bf2wYP KbzSyfnF3LD/3EUE0ouVmvcrenkgmsoRMPzwy2OIKXOgyZuG0quVryf6LigxPquoubdt 1hzXyqNsssLr69USbkwjsNilL7DFL3SVTuMyaJMYq5qYeFho/0MZg/QH2EGuPLvZgjr6 2fpaJ0ZyKZ9ubumQcPkrTXjseaWvy4I0irHsW1cYk79sO3U1Y+LUoRSqo9kFIvGL6MJV 5rz/8h+iTgQ+kRCeKPEGKga9hocec0MFZT/d2uLqXBgSnacI3YnOEXPNiuh6zsVEBNaz 0x3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686277471; x=1688869471; 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=q9vppTZ0kH0Xs3eiJ138RWwvuyXdLrdS2zldn9LG9Ak=; b=cxbjPkB0X/wwAlmP5otS049kplE/I8JHxfa4qzjntfEONlBCCM4OY67ksMAeKRK+NI qLoV8cK9Hch+ywoX63fBuVHi2URHKYvBuXgUpqc+5HwAmbX1ezYE6+pfu0Z8wRDWUymd 7NzXCW+xUqXo0Op1EAGoJCLAM4eLqYyt4LlSqagQtL8HgnHmJXG3X23bzJM/pf2/6C4a fXmZ5WHVh979cWjlB0m5muaYTT6BoDAU13APP0exCLmPRM3rmBBTTueMuJh+I3vHD6sX hOKpy6rj+oZKFHDfM/lw/L3dT0VnNt5N3l85RKq/HfQFJXp0fn2i6nIqI1g20ecRvCvS pTkg== X-Gm-Message-State: AC+VfDwyhvgNu0zrmzCruULa18RJvechE8G9s0ZPNr2oXcHF14gOnOZ1 Qoy5BV6CMcKtJxTGgd4pOed7cuywKjHYkRu1wJg= X-Received: by 2002:a54:4117:0:b0:39a:a9e9:38cb with SMTP id l23-20020a544117000000b0039aa9e938cbmr282605oic.22.1686277471442; Thu, 08 Jun 2023 19:24:31 -0700 (PDT) Received: from stoup.. ([2602:ae:1598:4c01:b071:df63:5761:f449]) by smtp.gmail.com with ESMTPSA id x25-20020a62fb19000000b0063afb08afeesm1686458pfm.67.2023.06.08.19.24.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 19:24:31 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: ardb@kernel.org, berrange@redhat.com, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, pbonzini@redhat.com Subject: [PATCH v2 31/38] target/ppc: Use aesdec_ISB_ISR_AK_IMC Date: Thu, 8 Jun 2023 19:23:54 -0700 Message-Id: <20230609022401.684157-32-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230609022401.684157-1-richard.henderson@linaro.org> References: <20230609022401.684157-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::c2c; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc2c.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 VNCIPHER instruction. Signed-off-by: Richard Henderson Reviewed-by: Daniel Henrique Barboza Reviewed-by: Philippe Mathieu-Daudé --- target/ppc/int_helper.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c index 1e477924b7..834da80fe3 100644 --- a/target/ppc/int_helper.c +++ b/target/ppc/int_helper.c @@ -2947,22 +2947,11 @@ void helper_vcipherlast(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) void helper_vncipher(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) { - /* This differs from what is written in ISA V2.07. The RTL is */ - /* incorrect and will be fixed in V2.07B. */ - int i; - ppc_avr_t tmp; + AESState *ad = (AESState *)r; + AESState *st = (AESState *)a; + AESState *rk = (AESState *)b; - VECTOR_FOR_INORDER_I(i, u8) { - tmp.VsrB(i) = b->VsrB(i) ^ AES_isbox[a->VsrB(AES_ishifts[i])]; - } - - VECTOR_FOR_INORDER_I(i, u32) { - r->VsrW(i) = - AES_imc[tmp.VsrB(4 * i + 0)][0] ^ - AES_imc[tmp.VsrB(4 * i + 1)][1] ^ - AES_imc[tmp.VsrB(4 * i + 2)][2] ^ - AES_imc[tmp.VsrB(4 * i + 3)][3]; - } + aesdec_ISB_ISR_AK_IMC(ad, st, rk, true); } void helper_vncipherlast(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)