Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3707362imu; Mon, 28 Jan 2019 09:22:40 -0800 (PST) X-Google-Smtp-Source: ALg8bN5dLYS4OeX8xzRo9UTZGmF9mrPzVtjUDxFcjxI45jDwz3EW0cR/spHr9xqC4F67odD4Z2Tp X-Received: by 2002:a17:902:7882:: with SMTP id q2mr23206833pll.305.1548696160406; Mon, 28 Jan 2019 09:22:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548696160; cv=none; d=google.com; s=arc-20160816; b=V+VyR/CLXLAOXcWb+96eDutRv1UHdyF60ZQhizjcjuHK/QLp4xwrLIDPwRxOqO5/m6 7qMbv+ZIUfvm9AJ7frlZR+2htmLxyuW5DFvCjk9V8ExjGP0aWQzG6Bpeoj0IReg0wbit 5SveIag1ELRS/84WQ3UF20zug3Z5eu9OJpu6bL7lML/MwSXvyy8uHIB0vBVEVhlEZGjP awXS14BTL6wBOnXjPj0d1xH20AuQ8BpiR2j0NcGCsovcNwFe8IF1BpS0yFhrygKSMg2y yKGeMyDmPK5aQY4Yetwe8O9E/4oly3oa/xIbVC0/Of+VrBN9mTqv+rTXJA8OeiFl9+bS APNg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=O8y/o6q2bjyhylG85iWOTWq13EnykeEsxr0bWUam224=; b=lbTzrQLRGj7j7NBUcq8bbiakEFOAL1+twZGWT77hlKYDwNXE0wEPfczrgHvM6J2j8e 1qarl1p5MYI4xC5HT6GPrmOztR6uzlJljsApN0NjH/se61VXegUxELcM3qcfIGP4wjho yxXvuo2VQIhfbEm6Osp/SRM+xuhCC15aCD4r07mTOcQBsBOVJVDridfg4gWaNJ6/It7c DmsvPg/tTla8jR/2+SfpWRE9altYrGt3Uykuier5hJp3em9P+9jfPcqsAtqQJtOKPXcE fN7twJ74I8ClsIAqMRvidVqduw1c2hb0dsMMTIrk3NrhDRa41IkOE5btMoSJGPJkHfnx EWSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BiqgwSDB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n3si34554605pfn.285.2019.01.28.09.22.24; Mon, 28 Jan 2019 09:22:40 -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=BiqgwSDB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732110AbfA1RWB (ORCPT + 99 others); Mon, 28 Jan 2019 12:22:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:49042 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731038AbfA1QDn (ORCPT ); Mon, 28 Jan 2019 11:03:43 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 89F082175B; Mon, 28 Jan 2019 16:03:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548691422; bh=fPivsdV5upi/vCuMtLQDGAkqjaG+iNpBlweUYNNgI7s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BiqgwSDBkDbFZ37qjFMOlF9oropsZwzrba4e8wh5KVXFLfEUgQhO36P7atonulB7i PlShxAjMKPxV0C1+y63PcsXU0wbRpqFKUl6++gTMSR0o158/rW8fZEzTH9932lHrS3 tbbCX9z3+a3JQ5M81uSYbqzuxstFpghF0cS7nBik= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Harald Freudenberger , Martin Schwidefsky , Sasha Levin , linux-s390@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 089/258] s390/zcrypt: improve special ap message cmd handling Date: Mon, 28 Jan 2019 10:56:35 -0500 Message-Id: <20190128155924.51521-89-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128155924.51521-1-sashal@kernel.org> References: <20190128155924.51521-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Harald Freudenberger [ 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 2bb1f3bb98ac..48c784f2101a 100644 --- a/arch/s390/include/uapi/asm/zcrypt.h +++ b/arch/s390/include/uapi/asm/zcrypt.h @@ -147,8 +147,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 6f7ebc1dbe10..2e1a27bd97d1 100644 --- a/drivers/s390/crypto/zcrypt_error.h +++ b/drivers/s390/crypto/zcrypt_error.h @@ -52,6 +52,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 @@ -90,6 +91,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