Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2768313imj; Mon, 11 Feb 2019 08:11:01 -0800 (PST) X-Google-Smtp-Source: AHgI3IYHt8TbXhbLl4VXiFwRMGadXVuAgLuHqto6LLUjxhcV3O4lW6eOoBmUskWCyx1XAlio3PVm X-Received: by 2002:a17:902:8f83:: with SMTP id z3mr37270921plo.328.1549901461585; Mon, 11 Feb 2019 08:11:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549901461; cv=none; d=google.com; s=arc-20160816; b=UnwLWj5MFhupuyhDg+CSRTU0972nbooO3RegcelG98WwxhxcyWsZix66fHY+mjp26B XVQrt5EHJxui7TgzQDCvdgIeimX25N/2M3sSLyKfD1WK2+eLL1nmBMvH02ObB5T2gG+g KKjtKT21bRHeeGjabCiXLay1N10YXjyAV/SroXc+06QwxLFdiwe5zMTUuxcAWKEYcNqM 2IPnBwWPCrPtMuvNOJqFrUE/6xz1E2WHRKNMQ+KLu9G5t3Yz/P3tjW9ZHF9DX3ievRSv lqxtIY/Yhlr6x2Yl//8Qb3h1acfNnTWM8ORmfA0Tbjr9CXZE1E4wPR3kA3DgwQOyiTFF 7UFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2IOLGCm7YiuYQyPFFiIgmzArVxPEepoDXqQUjWs7F/g=; b=O0sq7aKhdO2miFC7TxwFGS9AjcYigilMw285yGhjCRthPZE/Ks9SMen3cR7GAeXWfm iU3ONUtwHdgrdd787u8EtFVWZG1FTf/BmV6Aro1gBCnSvO3aOzcbpsLH/vkb6brDD3H6 Dq3iNUMEBMJgCgNz0FG68nKp1q6wmYsazVWIV8WYnCgth2oLZseST8u6UG/iowj4Ip9W ymSBZ8/fTlsr0CPHfvb9jCq02rilkLgnU/ZG0DK+AA51AL85z5QS/0DL++MhDyJfLfrl x7MFZM7dmUAb6Cv+HhMtZR53uVAGyg/B5jrbAYbxEqPWLLnFOcLOJ1diAhK5h63YFKBz cPcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JNiU5RXf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b66si10712655pfj.106.2019.02.11.08.10.45; Mon, 11 Feb 2019 08:11:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JNiU5RXf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727816AbfBKOZS (ORCPT + 99 others); Mon, 11 Feb 2019 09:25:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:58630 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726228AbfBKOZP (ORCPT ); Mon, 11 Feb 2019 09:25:15 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 08BDD20821; Mon, 11 Feb 2019 14:25:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895114; bh=DrV65zrKwH/sv9GZ3Anv8n2YUPa/YjTcWzuX2qNIafk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JNiU5RXfOeEQL17JT6/8XBznlggjhBWkzaxxnmPN+m1xpvM8WRRg9LCblA2MwkRrI 8hOPa8wbW47iCrJA42AlPz+EaseuqFRp112k2LuFFan9QxORL5LMuW4ZoEvke1yC+o DafNuwpzLeQdkUgQviW/mI2/We/+W+yIUrJd0mu4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Harald Freudenberger , Martin Schwidefsky , Sasha Levin Subject: [PATCH 4.20 096/352] s390/zcrypt: improve special ap message cmd handling Date: Mon, 11 Feb 2019 15:15:23 +0100 Message-Id: <20190211141851.957203560@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit be534791011100d204602e2e0496e9e6ce8edf63 ] There exist very few ap messages which need to have the 'special' flag enabled. This flag tells the firmware layer to do some pre- and maybe postprocessing. However, it may happen that this special flag is enabled but the firmware is unable to deal with this kind of message and thus returns with reply code 0x41. For example older firmware may not know the newest messages triggered by the zcrypt device driver and thus react with reject and the named reply code. Unfortunately this reply code is not known to the zcrypt error routines and thus default behavior is to switch the ap queue offline. This patch now makes the ap error routine aware of the reply code and so userspace is informed about the bad processing result but the queue is not switched to offline state any more. Signed-off-by: Harald Freudenberger Signed-off-by: Martin Schwidefsky Signed-off-by: Sasha Levin --- arch/s390/include/uapi/asm/zcrypt.h | 4 ++-- drivers/s390/crypto/zcrypt_error.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/s390/include/uapi/asm/zcrypt.h b/arch/s390/include/uapi/asm/zcrypt.h index 42c81a95e97b..494c34c50716 100644 --- a/arch/s390/include/uapi/asm/zcrypt.h +++ b/arch/s390/include/uapi/asm/zcrypt.h @@ -150,8 +150,8 @@ struct ica_xcRB { * @cprb_len: CPRB header length [0x0020] * @cprb_ver_id: CPRB version id. [0x04] * @pad_000: Alignment pad bytes - * @flags: Admin cmd [0x80] or functional cmd [0x00] - * @func_id: Function id / subtype [0x5434] + * @flags: Admin bit [0x80], Special bit [0x20] + * @func_id: Function id / subtype [0x5434] "T4" * @source_id: Source id [originator id] * @target_id: Target id [usage/ctrl domain id] * @ret_code: Return code diff --git a/drivers/s390/crypto/zcrypt_error.h b/drivers/s390/crypto/zcrypt_error.h index 240b27f3f5f6..f34ee41cbed8 100644 --- a/drivers/s390/crypto/zcrypt_error.h +++ b/drivers/s390/crypto/zcrypt_error.h @@ -51,6 +51,7 @@ struct error_hdr { #define REP82_ERROR_FORMAT_FIELD 0x29 #define REP82_ERROR_INVALID_COMMAND 0x30 #define REP82_ERROR_MALFORMED_MSG 0x40 +#define REP82_ERROR_INVALID_SPECIAL_CMD 0x41 #define REP82_ERROR_INVALID_DOMAIN_PRECHECK 0x42 #define REP82_ERROR_RESERVED_FIELDO 0x50 /* old value */ #define REP82_ERROR_WORD_ALIGNMENT 0x60 @@ -89,6 +90,7 @@ static inline int convert_error(struct zcrypt_queue *zq, case REP88_ERROR_MESSAGE_MALFORMD: case REP82_ERROR_INVALID_DOMAIN_PRECHECK: case REP82_ERROR_INVALID_DOMAIN_PENDING: + case REP82_ERROR_INVALID_SPECIAL_CMD: // REP88_ERROR_INVALID_KEY // '82' CEX2A // REP88_ERROR_OPERAND // '84' CEX2A // REP88_ERROR_OPERAND_EVEN_MOD // '85' CEX2A -- 2.19.1