From patchwork Tue Dec 14 11:34:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Heimes X-Patchwork-Id: 1567676 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=niXG5rdX; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JCx9p3wtyz9sR4 for ; Tue, 14 Dec 2021 22:34:37 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1mx64f-0003eZ-Pa; Tue, 14 Dec 2021 11:34:25 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1mx64d-0003dn-CX for kernel-team@lists.ubuntu.com; Tue, 14 Dec 2021 11:34:23 +0000 Received: from T570.fritz.box (2.general.fheimes.us.vpn [10.172.66.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id B027C3F20B for ; Tue, 14 Dec 2021 11:34:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1639481663; bh=EJ9/d97VwlDA9bQt9yDmsyvYaRMaDp4nk4fcukg4zNg=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=niXG5rdXWv5YV7LkPFo8e7GXk4MoNsm5Gi67suv6JMyJ1LpibXf9BdR2J9QI+uzmI OBnXMWH0rgahmMF+edQMrWczGeQb/JNTy/ZyZpzoxGRyx4qgA0A1pDHXSRZiIfIYcW UQ86qcCDKs2+WZOXIs3ctxUSg0DSH611LWjcTqcaVSYF7CZdkRMYxuWUHi2lpjhJUf lbWuC0OQGysloaFeCYZ7hDyMDyzbMHx82IP82Bmv5aaO/7PuP/TrIMOFUJzj1Q2Rv/ sXskQqjWxrZ8BP07vJMwWyNM+7ljQmEVn314v4SQuEGbIGQxzP+uez/uON6NiIaLc/ 6zOcXbLIya5KQ== From: frank.heimes@canonical.com To: kernel-team@lists.ubuntu.com Subject: [SRU][F][H][PATCH 0/1] zcrypt DD: Toleration for new IBM Z Crypto Hardware (LP: 1954680) Date: Tue, 14 Dec 2021 12:34:17 +0100 Message-Id: <20211214113418.44042-1-frank.heimes@canonical.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1954680 SRU Justification: [Impact] * CEX8 hardware CryptoExpress adapter shall support quantum-safe crypto and therefore require nowadays message sizes > 12kB. * This change here is mainly required to support EP11 responses to admin requests at zNext which due to QS certificates can grow larger than 12kB. * It's to cover a minimal patch to provide toleration support for this feature which shall be back-ported to all distribution releases in service at zNext * This SRU requests belongs to the hardware enablement case. [Fix] * bd39654a2282 bd39654a2282c1a51c044575a6bc00d641d5dfd1 "s390/AP: support new dynamic AP bus size limit" [Test Plan] * An Ubuntu 20.04 (respectively 21.04) LPAR or z/VM guest is needed that has access to at least one online crypto domain. * Ideally using a CEX8 adapter (but can be too early to get one). * Then get the patched kernel installed (see PPA below). * And look for the /sys/devices/ap/cardxx/max_msg_size sysfs attributes. * On top IBM has some more in-depth zcrypt tests (see also LP#1933805). [Where problems could occur] * First of all the modification are limited to: the zcrypt driver ("/drivers/s390/crypto/ap_*.*" and "/drivers/s390/crypto/zcrypt_*.*") hence are s390x platform specific and crypto specific and should even affect CEX8 cards only. So in case anything fails, it's limited to s390x cryptography, which usually allows sw fall-backs. * The function signature of ap_queue_info and ap_test_queue got modified, which may lead to issues if called with the old signatures, but that would be identified by the test compile already. * Some minor new structures like 'info', 'ml' got introduced, but are properly declared and initialized. * The way ap_queue_info and ap_card_create get filled and used was changed, therefore in some code areas slightly different data might be expected, if not properly adapted to the new way. But a verification test will prove this. * The actual msg length is now handled based on bufsize rather than len and with that zq is calculated in a different way (using zcrypt_queue_alloc) which may cause some side effects if not properly (alloc) or not thoroughly done. * in _zcrypt_send_cprb and _zcrypt_send_ep11_cprb some additional calculations and checks (if-stmts) were introduced, but they look sane. * New code to identify older cards got added, since message sizes > 12kB are supported by CEX8 and higher only. The dispatcher responsible for choosing the right card and queue is aware of the individual card AP bus message limit. But already at the user space tools it should be ensured that the right card is used. * Nevertheless, the patch is not small, hence s390x hardware crypto zcrypt driver needs to be properly re-tested. [Other Info] * The above commit/patch is upstream accepted with 5.14. * Impish's Kernel 5.13 was already patched, based on LP#1933805. * With that the patched zcrypt driver is already tested to some extend based on Impish (since with these cherry-picks the zcrypt driver is largely the same now). * Hence the SRU is only needed for Focal and Hirsute (just to avoid regressions on upgrades). Harald Freudenberger (1): s390/AP: support new dynamic AP bus size limit drivers/s390/crypto/ap_bus.c | 50 +++++++++++++++++------- drivers/s390/crypto/ap_bus.h | 11 ++++-- drivers/s390/crypto/ap_card.c | 16 +++++++- drivers/s390/crypto/ap_queue.c | 2 +- drivers/s390/crypto/zcrypt_api.c | 6 +++ drivers/s390/crypto/zcrypt_cex4.c | 9 ++--- drivers/s390/crypto/zcrypt_msgtype50.c | 26 ++++++------- drivers/s390/crypto/zcrypt_msgtype6.c | 54 ++++++++++++++------------ drivers/s390/crypto/zcrypt_msgtype6.h | 2 - drivers/s390/crypto/zcrypt_queue.c | 6 +-- 10 files changed, 116 insertions(+), 66 deletions(-) Acked-by: Tim Gardner Acked-by: Krzysztof Kozlowski