From patchwork Fri Jun 9 02:23:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 690884 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d8a:0:0:0:0:0 with SMTP id b10csp599086wru; Thu, 8 Jun 2023 19:31:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ78nCFZAE3obcIAJQd5lP4pGKRjylcmRYiZsBNYB2dPCmef0Gf0L+oj6HR1yC/D2KhNgb4G X-Received: by 2002:a05:620a:2185:b0:75d:5a17:abb with SMTP id g5-20020a05620a218500b0075d5a170abbmr7380709qka.57.1686277906780; Thu, 08 Jun 2023 19:31:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686277906; cv=none; d=google.com; s=arc-20160816; b=NjpDb/Ez+Ivg5+qgZJqTo3JQmb3RgN8qvpUh7t4q4w4pn8iE5vnDQ8d/PJehTdPs5a qNkhohbSBy5VFCsRMdbDey3SxL0DYuiLOZn+dgoMkWSkak0mKCbc0BNP+NdBaGukVWFP rLIXXwoyvDiRVjIS9LF2rTv/+VGWWx1K7d2ToC0Ip0aUlsj8nPgpkUUPTi7JSBYtUX/5 E0LA786lfIrXXdAA1oJZ8AJMnwqFU0SxPY+h/tHt7N/R7Kf8+oOE0bmCA6q+mkszmFVA ivUOZSu63GOY3fB6zr/112S4jDeKSSQ657XlR3UeqtAKZO1sT9p1v942nBS86NAlPCYD TZRA== 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=FQOiC9SIpWhLDJC5dJWrza0HqQ3AfVmdAkI4Y5VxtuI=; b=hPJ89Uyq6rtIWnERgIvlVVDgYoL2XXETLcmO9Lv++jEzOkTetJVEdnIwN/rW2krjaK oayY4oGRI5AIR8U5f8S9sakUld8UuX/blT6zuqxUE7JsN2gUCX+0RsFv7V7Hl4zPRqUg J1M2HFc57/lMdLpwGQi6YNEBlrN8LsUCOUpV9CdEVurZoSwz93v+5dWd2fjPCRGFObSo rr0Liqng62WOO/LGMuBZJfQut2KfeCq/rJN3AWyoPFoAjXr2zxFFYCs2hzUyJVVuuGcb fBBhDSEhwXXkwc5Ct42usfFLND7iAbE5i+J5nrhup2dL7LOOZdb09igjqhU7Cpv1hwRG o8hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T1skUYop; 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 x13-20020ae9e90d000000b0075ce8438357si1539884qkf.654.2023.06.08.19.31.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Jun 2023 19:31:46 -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=T1skUYop; 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 1q7RoY-0003MT-Lg; Thu, 08 Jun 2023 22:25:22 -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 1q7Rnp-0002ps-QL for qemu-devel@nongnu.org; Thu, 08 Jun 2023 22:24:37 -0400 Received: from mail-oi1-x22c.google.com ([2607:f8b0:4864:20::22c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q7RnS-0005b1-4j for qemu-devel@nongnu.org; Thu, 08 Jun 2023 22:24:37 -0400 Received: by mail-oi1-x22c.google.com with SMTP id 5614622812f47-38dec65ab50so218523b6e.2 for ; Thu, 08 Jun 2023 19:24:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686277452; x=1688869452; 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=FQOiC9SIpWhLDJC5dJWrza0HqQ3AfVmdAkI4Y5VxtuI=; b=T1skUYop3HfIG2z9MyhHxKr99PxVJk/3qBbP/JgPnZQ79XZ9YYdqIfHNJcvTIJbVNR ZurUxpx+AqrHLASVvkWmUxm69ypvaYi5Dm8qlfGd+YmST2Y+Qru5by6BT9nLOJhBVBGX nPFLj6TQkJtF3Fus21Zo+6xd7gaR5oIs+C87KlMFOBZPrThDRtBWuCCOL4G3uMLb1Hj/ 40NVbzf9wVwkgHUTzzeCuu0YQOtwZ3tEwWpEktBNQ70UZzkKYHQLPObvm1hMGdmxGbN2 8Uyu+EI0CLFcFR82x5RojwYuCcfkLD5tTUJfzRiQFk8x2oCLNfLXsC+AkWt72D8ka3oy fs7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686277452; x=1688869452; 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=FQOiC9SIpWhLDJC5dJWrza0HqQ3AfVmdAkI4Y5VxtuI=; b=DH+1EKYjACDiprJ1mHTgN8YEfigbOKwSOrT1i/tyNc83WCghBQtzEAsC/hmzA0XMCu aKIl/JaClTKVnrIX/vH1p5EDvosNYo1wPlvj23u0dPS7H4NxEBNdys5JR8xmw+vizCNm HU758IHUTR/XkVDbxehQDeOaOoO+DiJWSACoZTMhbjXb1iU0ToarKrSujyjgDB/jkphC A8N5xSPV1X+hbuXrmF46iEQV2tjiUcx64LX+E5y1gQzZM/ubgeudTCllntFRANJEJd7a eUiNwgVoEzlcU7dh878cb7qt76BXMDvYttXHqrXn+7HiuWc0dXKXvx+BIdMj/l2RQ0iA zf3Q== X-Gm-Message-State: AC+VfDy0cxBxvbcafnv9i4iZjsNHKx/1m7rcATOfYnTvAEPQvT30n+xI ajqu4n4sUzhao+kpQ9k59JPB19amxvQZs30+Bvw= X-Received: by 2002:aca:2403:0:b0:398:36a0:d42 with SMTP id n3-20020aca2403000000b0039836a00d42mr277660oic.39.1686277452622; Thu, 08 Jun 2023 19:24:12 -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.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 19:24:12 -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 10/38] target/ppc: Use aesenc_SB_SR_AK Date: Thu, 8 Jun 2023 19:23:33 -0700 Message-Id: <20230609022401.684157-11-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::22c; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22c.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 VCIPHERLAST instruction. Signed-off-by: Richard Henderson Reviewed-by: Daniel Henrique Barboza Reviewed-by: Philippe Mathieu-Daudé --- target/ppc/int_helper.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c index d97a7f1f28..34257e9d76 100644 --- a/target/ppc/int_helper.c +++ b/target/ppc/int_helper.c @@ -25,6 +25,7 @@ #include "qemu/log.h" #include "exec/helper-proto.h" #include "crypto/aes.h" +#include "crypto/aes-round.h" #include "fpu/softfloat.h" #include "qapi/error.h" #include "qemu/guest-random.h" @@ -2947,13 +2948,7 @@ void helper_vcipher(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) void helper_vcipherlast(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) { - ppc_avr_t result; - int i; - - VECTOR_FOR_INORDER_I(i, u8) { - result.VsrB(i) = b->VsrB(i) ^ (AES_sbox[a->VsrB(AES_shifts[i])]); - } - *r = result; + aesenc_SB_SR_AK((AESState *)r, (AESState *)a, (AESState *)b, true); } void helper_vncipher(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)