From patchwork Sat Jun 3 02:34:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 688790 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d8a:0:0:0:0:0 with SMTP id b10csp1165410wru; Fri, 2 Jun 2023 19:40:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4tCe2LtrkC+4Qz3gP1vPXCe3onFRJcJPixJNyU+ylMRiIeMMVQIg+Z/IVm/Q+ORW1N/STQ X-Received: by 2002:ad4:4eae:0:b0:621:562c:4e22 with SMTP id ed14-20020ad44eae000000b00621562c4e22mr380472qvb.47.1685760040378; Fri, 02 Jun 2023 19:40:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685760040; cv=none; d=google.com; s=arc-20160816; b=r7OMprSVfnAFgharcYUjohRj+mSXduxyu4W/UMFXzlommbnwYNn+WNkVrrchhvGcxR Ci1Pmmj5iD1Um7bjkBj8NXbFTI4vGGWGwrD1xkDq0U/TvzbLpM0m1jxFU38Y5UfELv6H uSxAhnfD0rWaikbbGqzq4w5E6o6TSkzcesOCGNV7DbjOLE3CT5Za2sNNP325+HtjhDnx bfa3gmJxnr0m1il8TOSCVTAZqlYa4tUEYUxWwMFo/BNrBUp3v04IS1roIcT0mXkr2y1e hFBI5uvhyp39LzfoBC2wSLy4nzS08d+U54yw4kszcX+UOuw45X3ZZYzEpp6JNeF2xWUM TZZw== 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=jW/LkFvDYs7wuWSeKP7O4G0IgkgaVuXTO9qaWXdUTaM=; b=Csiam4UWjrcPgBZvZHRzeVNwqywb74POQ2t1rROuQFn0QqdnQ/wk5oG3gIw14nh54y Alqz0aXFRvGufuaMEnec7pyAmQVWMNgGTZ8FBOD8N2Yho2N0EdskgBUhrf+ZINtm9PJi whXlLf2t5v+dGexm8wEeZeq4UDENCxoIQOvilFhAepssAJifQaggxBC83HexltK622Xn ecCI7EgrAPRZ90NqJFBdG8w+vkY+dEvv6O0Pfs7vqTHOMmKzOIWpbOBfkEb0BT/jHsli rTxsxdMxAlyLohhY7/g1/hicbxl92SqsAU11c0oj1YSszNCI9od4qgWJCnP8naTrvKN8 YqAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hnPFh4f+; 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 jk3-20020ad45d43000000b0056eb16d587asi1888772qvb.444.2023.06.02.19.40.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 02 Jun 2023 19:40:40 -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=hnPFh4f+; 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 1q5H7j-0003C5-Bp; Fri, 02 Jun 2023 22:36:11 -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 1q5H6e-0000cb-BS for qemu-devel@nongnu.org; Fri, 02 Jun 2023 22:35:05 -0400 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q5H6Q-0004sA-40 for qemu-devel@nongnu.org; Fri, 02 Jun 2023 22:35:03 -0400 Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-2566f66190dso2373451a91.1 for ; Fri, 02 Jun 2023 19:34:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685759688; x=1688351688; 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=jW/LkFvDYs7wuWSeKP7O4G0IgkgaVuXTO9qaWXdUTaM=; b=hnPFh4f+AWxBJf5sbiE7g8pqu1YrrALaXeTJJCgO4St7e6bMBIWNOHxZUk97tx2Qj9 /dwDaOxRJdEKwwVA8MUBdz0TNFlFMP4b9wsZJpraNGTqO44pczDLLXawC3LlGP73+Hst mcJipySYYmPK9m2GQ/OUMeGJKtrmuMJIewlUg5YrSCS1s+HninI5yMAyjW+3WldrwIaZ iH+Ww38QCpGOGlxwnVVeQnwzuLSLXMamJyuSGkYjOhZuNYsFtNhXOEsoAqdsNMy89CDb HXDyDgDVglMZlJatc+hC1LgVaJaOtbf6xwix+7ARTsyrYX+ZXyU1MCapzXBy6GWiAJpW t/Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685759688; x=1688351688; 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=jW/LkFvDYs7wuWSeKP7O4G0IgkgaVuXTO9qaWXdUTaM=; b=Tp6fnGE8qzlSn5Lv8sEs2ZV99Ngt8FszG473Lst7gTFHYIDyklLNZ7ztsmbT3bmnVY m0t7OxveuwFbCSeyAnQMi6pywe2VKdabRbBG4JGkloKuSnnjp8mbD73LAUJjWeM6myiY GLuivXtXwxdTyMyy/hZ0Mg4IUQAa5R1/flMaUdCbJgANp4oZ0QzO6O6jicvZBtzyo3ZN ZXkcdU7wCBuH0Wny6dCGtj0AR6OLQ9yzCO8LHdYPk3NqnD92VG8h01T7zklVfLDaJpDM VdJ08H0eyO30e+Q8gs7DfJfd3EMqEGwUoi7P9Njets8z9zPjatcmaCkzKz8xHDccc07H D3UA== X-Gm-Message-State: AC+VfDwKQJtfPJ25A2DBBBO7/CEEkj44S1M46K9uJPaJRMPmizwAHCjj 5VcOO0Yq0kgI42d6rvu/IQhV7+sA8/oRRbUDTpM= X-Received: by 2002:a17:90b:4c51:b0:258:6e0d:26e3 with SMTP id np17-20020a17090b4c5100b002586e0d26e3mr1337673pjb.48.1685759688708; Fri, 02 Jun 2023 19:34:48 -0700 (PDT) Received: from stoup.. ([2602:ae:1598:4c01:66a6:82c2:d794:68f6]) by smtp.gmail.com with ESMTPSA id e91-20020a17090a6fe400b002508d73f4e8sm3914289pjk.57.2023.06.02.19.34.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jun 2023 19:34:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: ardb@kernel.org, berrange@redhat.com, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, pbonzini@redhat.com Subject: [PATCH 23/35] target/ppc: Use aesenc_SB_SR_MC_AK Date: Fri, 2 Jun 2023 19:34:14 -0700 Message-Id: <20230603023426.1064431-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230603023426.1064431-1-richard.henderson@linaro.org> References: <20230603023426.1064431-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.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 VCIPHER instruction. Signed-off-by: Richard Henderson --- 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 444beb1779..c7f8b39e9a 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)