From patchwork Fri Jun 9 02:23:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 690858 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d8a:0:0:0:0:0 with SMTP id b10csp598001wru; Thu, 8 Jun 2023 19:26:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6tqR3RaLDxuoIrL2IIwHV2ElmdGqHfd+YipCnG2HKOdCybw7A/NVTmJeTGZ5WF/LjyJ5rC X-Received: by 2002:a05:620a:2711:b0:75b:23a0:d9ec with SMTP id b17-20020a05620a271100b0075b23a0d9ecmr7824545qkp.66.1686277595168; Thu, 08 Jun 2023 19:26:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686277595; cv=none; d=google.com; s=arc-20160816; b=05zGYmWKGm9UTVcYXvS1icTDj/5cYb4hwhQPp58bsfDM8bqFjWOdcUEabARFlCmFKh 50ROO/qzI4ReiW85o4OzBd0CZg11I4U4uyy1sC5Z8+VWLSfGMy00J3i2ibZWym6U0Lgn QMBbBWrMs0eeEFSKCFaGug2RLUTUNAzLdpYEWllzMJiupZJWFaRAl2FWoMif0PqoMRuw quzdsZ9HIaAO70ByH1Y1gBDfy/nqlqjMiBekU66n19jVfwZG8xKwSCgzyv/MF5/3r1Gx 6GIQFWpLUa8X+3HnytcmnAXDeFWwLAIt8boadfLA/YShi7nw7qz7PAPxqcbJzAmxfASI yxYQ== 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=7JP6u0tX67kSxwDAELDlJJkYXsAQIbSKpvhIf/W0vRc=; b=0MKVhLvb8rVvRd/M3kEvVNDKzeajdJjXVLYNSY2oo7jyPAoH6mftxqXF9f2bapfHI8 7bN1MSANgGjQ3eHzh7Ls3tdG7+5PjMYFaiV1CJ8XsY7W3KSuhBRIW44poa8foZodl70u iGZTyVCKdpKAFTcY2zlcsAUwnxLehA3mO02U4vtgqu4C2UBKz09+8Vbw1Fo3+vfLrpTh O759Of2DIhftd3vgy0b2D85IVsp+jyB5SjEEnL4hOUyc+oFlDs4XM0OdilCDRcQWDqOA a4VM7yVxE/quhj7MkfO7iMa0oL5ik1qLCmcbcIqc1eufLUuv0qKh4zXQ1jLupkwwH4V6 GXog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BAFaiSc3; 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 j7-20020a05620a000700b0075b27c6c609si1563604qki.421.2023.06.08.19.26.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Jun 2023 19:26:35 -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=BAFaiSc3; 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 1q7Rp9-00051y-6c; Thu, 08 Jun 2023 22:25:59 -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 1q7RoE-00034N-GU for qemu-devel@nongnu.org; Thu, 08 Jun 2023 22:25:04 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q7Rnf-0005js-9l for qemu-devel@nongnu.org; Thu, 08 Jun 2023 22:25:00 -0400 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-655d1fc8ad8so1068900b3a.1 for ; Thu, 08 Jun 2023 19:24:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686277466; x=1688869466; 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=7JP6u0tX67kSxwDAELDlJJkYXsAQIbSKpvhIf/W0vRc=; b=BAFaiSc3LngntDSxUcEja3J9+Fn+TlYkCW/cLky8eybc4cHAvaT5/SkWL67JqUBp9m AhHQ5ViRyBaDwnuwnc6GpEnX/rJOuLg1jUwN++/CgFEP9otUK8mo9qtdVJl1S2Oi5aAm VhGGC692BOfzSSSkw00KfpUg+YHO9YsVKLDALCbcjpAvFRm3ZNm1+RQ0aGxF/0wUxiWE EoKeFWSh+510fUtPIqUNktPbrH3Dwr+jG1xlTjfUqOlV5CCS8VhJZyZSTJZVT0ANYN1R dPbeb1+gp/GyuQJcxuCrby+sOtqOtr+655ZAief1A+TjMaRlrzwVOvlaGBhPkABKTrRL dkcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686277466; x=1688869466; 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=7JP6u0tX67kSxwDAELDlJJkYXsAQIbSKpvhIf/W0vRc=; b=BabbHRpHNLSdCKyKRhrRxWLd7nw4WTy1DDqE2gUBhcWmx4oob/FrQBF9kfyHaab/Bf cZAE46gWQ7nwKMpptpBum37uuL8NcBzXDsXLhyDmI6q7IP/66dpZqin8hyetWZ2dmnYN IB1tCajQ4xJ/8EkybXJyC2+5RteDJOBTy38CGMmAMngPx2C3W/b/rZvMsD+7jfKhuV+3 //1dCWzStL9GGdmQEZYoFgXElie0ilOmsQD4dsUFpruPLk682pEXvuheI0WEPfsC/SIz 8rl2Oyq+8jYQv1KXIACPJknVzV0II/raHhVjl4MwcjTihnUcHrRp/k1/Z0oD5j2HhMUc 6DYw== X-Gm-Message-State: AC+VfDxVGmMW8XhyvS6LVS+RbLY/S6rWJxj9s2fSVGUcZFRlvcYtKYtU HtgNaRAchoEji1nLdogN7F/c+WF4cc41RrBMuyI= X-Received: by 2002:a05:6a00:148c:b0:644:ad29:fd37 with SMTP id v12-20020a056a00148c00b00644ad29fd37mr8041865pfu.28.1686277466068; Thu, 08 Jun 2023 19:24:26 -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.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 19:24:25 -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 25/38] target/ppc: Use aesenc_SB_SR_MC_AK Date: Thu, 8 Jun 2023 19:23:48 -0700 Message-Id: <20230609022401.684157-26-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::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.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 VCIPHER instruction. Signed-off-by: Richard Henderson Reviewed-by: Daniel Henrique Barboza --- target/ppc/int_helper.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c index 15f07fca2b..1e477924b7 100644 --- a/target/ppc/int_helper.c +++ b/target/ppc/int_helper.c @@ -2933,17 +2933,11 @@ void helper_vsbox(ppc_avr_t *r, ppc_avr_t *a) void helper_vcipher(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) { - ppc_avr_t result; - int i; + AESState *ad = (AESState *)r; + AESState *st = (AESState *)a; + AESState *rk = (AESState *)b; - VECTOR_FOR_INORDER_I(i, u32) { - result.VsrW(i) = b->VsrW(i) ^ - (AES_Te0[a->VsrB(AES_shifts[4 * i + 0])] ^ - AES_Te1[a->VsrB(AES_shifts[4 * i + 1])] ^ - AES_Te2[a->VsrB(AES_shifts[4 * i + 2])] ^ - AES_Te3[a->VsrB(AES_shifts[4 * i + 3])]); - } - *r = result; + aesenc_SB_SR_MC_AK(ad, st, rk, true); } void helper_vcipherlast(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)