From patchwork Thu Mar 11 23:47:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 397576 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp738965jai; Thu, 11 Mar 2021 15:49:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJzaGcR/lwJnlbBvSrXdxICPYHf2uhCEnW6OuxDUXhR52SjyvFnPSVW2qb5Bb2ltXRmpYH04 X-Received: by 2002:a5d:9599:: with SMTP id a25mr8164662ioo.25.1615506545755; Thu, 11 Mar 2021 15:49:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615506545; cv=none; d=google.com; s=arc-20160816; b=wyhSaEvrDGU6zfIgDCYzNXZKaUBfL0ySpxKFzYM4CSDnJjh3R0HAogDuYOnRD9r87R /+TfMvpB2vuF0t/38qzS0Qd7Rk6QQubU50W91Rm0oqIgSrBmp70mkJWdfaEc1Y9FsT4b B0W7KQt+EMGfaxxKqqFyx2znPnsopQ3wM8CyPjRtIPUnVjzmpooZ5/zPgPqi0hcECHuU 8fYpcAafseIUJDp0xDtvBypBA1Jm1hrWDCPVLlaEPSYoaVe7nzkpFKwolfTHFUyZoUGj 8nb+zU0DX7JYVUIzigCDF04LPvI7RRvA6MdN5XF7f2Y7WRyuS/xTjEdj8f5lHCMRgU4F iJ3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature; bh=wh9EwU4i06ioYEqsPWPov44GpqVJVHuB8gjUzCfLwQs=; b=TgpnbvASwsYl9tQB/mZxIo8H3kqpHdGWKkn6JPgwhaL+CQmGazbgq0dPuXP20MCXIr 4JDWILiDAvhW6mFMFWbff/s4iGo5T8pBx+J/r1COSmK+HzoilfcneDnfQjG9NsKwEbsS zQNrg/+osu0M9NihgF2GJGWWsjlMQr/hiW3D2rME38ql+yhIAT2DKWFun8xCpFTt0gbQ mSgHl+LSNJOIfszHm0Ag5+OTDj48TAlzuSaeg0O42kXYMI7Da0FO+0SsqJFRIK3nm9Tb F21MffGw2CauoqUajHpFCU6Zy+QdVNiQrOnGX3dvFS+fPFa6/vqqpGB2ZYTPp6rS6y5V 1yoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=diRKxDBT; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l10si999684ilh.37.2021.03.11.15.49.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Mar 2021 15:49:05 -0800 (PST) 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=fail header.i=@gmail.com header.s=20161025 header.b=diRKxDBT; 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" Received: from localhost ([::1]:55696 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lKV3B-0007I2-0t for patch@linaro.org; Thu, 11 Mar 2021 18:49:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57710) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKV1r-0007CT-EZ; Thu, 11 Mar 2021 18:47:43 -0500 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]:37479) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lKV1p-0004pf-BT; Thu, 11 Mar 2021 18:47:43 -0500 Received: by mail-pl1-x633.google.com with SMTP id 30so6477205ple.4; Thu, 11 Mar 2021 15:47:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wh9EwU4i06ioYEqsPWPov44GpqVJVHuB8gjUzCfLwQs=; b=diRKxDBTlmvuzpcijsYMSTDfcXcl4CPzNNgZaShLSbNBbNh5/dDIi86Zsd/iTvpkiJ nvVjT8VUhKCK/5OFPSa4z6X10Wr4M/ClCclzZwD9fGiuuTemy26HmIvhzFIFaC+37cQC AtEDJfHY2JW53d+BPJsAjKAsU/OisLhl1TgH1oQmfCj/JTbsN4Ba4cW21tqU03fPnY05 VFhYP1OCmSy73WJgLDTyg5wD5NJxDUKaZ5zWr7ahdLMi5JaBWcBmg2T/xbBJyRpr2Pbl nCvfK5KB+05qpzEf3buR+TxnFFzDDyRzBESYMEk4xzGPCPdz5KcvF/TYqmvnMVw0ZHsS mJ6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=wh9EwU4i06ioYEqsPWPov44GpqVJVHuB8gjUzCfLwQs=; b=UYEDA7L9aNLV13d1WiULdaU27YgY9wKw92SyjaTWVT2z7VfrqhUJIjNq9x04RVD/4E iGCuAofQTLLZyB7CWQICEMgZTMF831R5wd47xqujc22OjQztgTj4l1NqSZ5JITu/wv5H A8UK9y/VpQpTJekDufiL4L7bzFaPfFYpAtVm2ikotzAr3lC+AwEfyR9YAKg3zIJO7+NG TXB7xEBBXyHfVfA67/RHEhq2uWXsAEmNZk4IAQ0SsnzRACMR4JrY3/ngVcjtAcqO7DgU 9AgqotyN27g05LEZk9qZsJuKu4Fz/HEqhjoNlgwHkLcj4sK1YqswEzPFph5m4pOdAinG ewlw== X-Gm-Message-State: AOAM531NJUyMKI2t8lstTgJqff5QQNpP3a6seS2Hxj84ASVLicvNwFDZ n2VUWEfK0wUaoXcy5q88tPI= X-Received: by 2002:a17:90b:fd2:: with SMTP id gd18mr11249517pjb.115.1615506459291; Thu, 11 Mar 2021 15:47:39 -0800 (PST) Received: from localhost.localdomain ([45.124.203.14]) by smtp.gmail.com with ESMTPSA id a204sm3357005pfd.106.2021.03.11.15.47.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 15:47:38 -0800 (PST) From: Joel Stanley To: =?utf-8?q?C=C3=A9dric_Le_Goater?= , Thomas Huth , Laurent Vivier Subject: [PATCH v2 0/3] hw/misc: Model ASPEED hash and crpyto engine Date: Fri, 12 Mar 2021 10:17:23 +1030 Message-Id: <20210311234726.437676-1-joel@jms.id.au> X-Mailer: git-send-email 2.30.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=joel.stan@gmail.com; helo=mail-pl1-x633.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery , Paolo Bonzini , qemu-arm@nongnu.org, qemu-devel@nongnu.org, Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" v2: Address review from Andrew and Phillepe. Adds a qtest. This adds a model for the ASPEED hash and crypto engine (HACE) found on all supported ASPEED SoCs. The model uses Qemu's gcrypto API to perform the SHA and MD5 hashing directly in the machine's emulated memory space, which I found a neat use of Qemu's features. It has been tested using u-boot and from Linux userspace, and v2 adds a qtest for the model running as part of the ast2600-evb machine. Joel Stanley (3): hw: Model ASPEED's Hash and Crypto Engine aspeed: Integrate HACE tests/qtest: Add test for Aspeed HACE docs/system/arm/aspeed.rst | 2 +- include/hw/arm/aspeed_soc.h | 3 + include/hw/misc/aspeed_hace.h | 33 ++++ hw/arm/aspeed_ast2600.c | 14 ++ hw/arm/aspeed_soc.c | 15 ++ hw/misc/aspeed_hace.c | 312 +++++++++++++++++++++++++++++++++ tests/qtest/aspeed_hace-test.c | 215 +++++++++++++++++++++++ MAINTAINERS | 1 + hw/misc/meson.build | 2 +- tests/qtest/meson.build | 3 + 10 files changed, 598 insertions(+), 2 deletions(-) create mode 100644 include/hw/misc/aspeed_hace.h create mode 100644 hw/misc/aspeed_hace.c create mode 100644 tests/qtest/aspeed_hace-test.c -- 2.30.1