Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2722974imj; Mon, 11 Feb 2019 07:31:33 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib437qASuaqpqCUCSssoTsYc1ciBdPwGTo+p3Jo3jI3SAsCaF9Hwr5rzoJ16Nbx8RCRMWQM X-Received: by 2002:a62:5884:: with SMTP id m126mr37202751pfb.177.1549899093797; Mon, 11 Feb 2019 07:31:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549899093; cv=none; d=google.com; s=arc-20160816; b=ZQ9MCInU29f49ZfnwSsaTvMHp0yIJsczwYp6oAauI8n/YCYW3P8vxo+ODQnbcXzs6P bUvYcQmsNvJBOa7WtJUj1CrvF2GxTZ7iev7OObxMwNTrUPn29rFYVXTYB1if7VacgCoX OPqlEaDxPGwQ6oV1x5bPrggxvHNTqEqbUxjbg4m+1PkNyKPWEz+oRrv12dOAWBN/bie7 fb7FqK5BrKYTrRWTV/Ivki5idq4gqJ0sz12JfRqZkofESMcU7SV9ragec5jIwLgkUDoF /a7V2oIcGTWDiO4j+lKnp3S+4vmIDWlCDXB5itJVhsuW2ZsDUxrqsCEaS0V64vJCn18A uJ8g== 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=U0E7aRYLfjuKPE1qFtl6UfDOva4GZuyE08UbCaQIPvI=; b=R5Yn5bMnYTv9y371wexrFpz/EQn9/YBq8ydkO4kgtv60Va05kyf2ggfy7NOdYiZ41m Qi+94s3Kd8YjrPLJsZLaD/DkIgkIC5PuLk62vjG2zBEjNxmX1a7KOKMwmNjQnI01Fj0N qVHnXJ1PztR8EPVY/B5/Y/UpnQ359He0xj65ywCLHEXkDakAvPpE3DCou/4JdauuHqOC T11JdnUC0u4GpZCpVKU60mQgNj7FTiSOqOuRje+ZzPen+Ufqoo4G9ByDs2PLT9rKniYv yrmSCG1MbiZmdsltrfwtFoelHepnmW5/eEOHAicpqBlG+fT7hhJqHRRR6EwxvNCxJ67p x5xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=E8qPvom9; 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 bf3si4504794plb.407.2019.02.11.07.31.17; Mon, 11 Feb 2019 07:31:33 -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=E8qPvom9; 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 S2387985AbfBKO6H (ORCPT + 99 others); Mon, 11 Feb 2019 09:58:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:45644 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389471AbfBKO6F (ORCPT ); Mon, 11 Feb 2019 09:58:05 -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 27C4D2229E; Mon, 11 Feb 2019 14:58:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549897084; bh=NQqslhLa5D7VA/EnBM1NgVMWAyMS7plTlpfuGxSEyts=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E8qPvom9qbTj5CtdMeOdGiyrDQVEbs/OeOd8ieE408J8m1ozoIFjnnUqiY78qbKps 6ulIfXum1UJAn2odAuAjjfIatqohIbeEk0IAiH+X9lg4PCd2/E4Bmmbx1YhYY8UqF3 SoaJ5y9/bYsWs4gVv/e8R2aHwz1ijKWFSLxV1xfI= 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.14 055/205] s390/zcrypt: improve special ap message cmd handling Date: Mon, 11 Feb 2019 15:17:33 +0100 Message-Id: <20190211141832.414886842@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141827.214852402@linuxfoundation.org> References: <20190211141827.214852402@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.14-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 137ef473584e..b9fb42089760 100644 --- a/arch/s390/include/uapi/asm/zcrypt.h +++ b/arch/s390/include/uapi/asm/zcrypt.h @@ -161,8 +161,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 13df60209ed3..9499cd3a05f8 100644 --- a/drivers/s390/crypto/zcrypt_error.h +++ b/drivers/s390/crypto/zcrypt_error.h @@ -65,6 +65,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 @@ -103,6 +104,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