Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp1148892imc; Mon, 11 Mar 2019 07:29:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqyrFyQJjUYGbib1kLkxug2/CcoZUxiVB1ekuoDgWJ0d0UzCeUFOuszp4pdWuR8NJGce55/a X-Received: by 2002:a62:1ac3:: with SMTP id a186mr33426690pfa.48.1552314588370; Mon, 11 Mar 2019 07:29:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552314588; cv=none; d=google.com; s=arc-20160816; b=Mz3dih5iCrwAE083jjHRToQs9I73UDryyGdp5TINBsXw4RMR2hIJ/QGAX0nrAwvOy6 10YMnze5rb12Qx6qQpzGfS2KCJApuHIzyKlmxE8YUX4x3hpUyITTbwZrVJMxuClq6kI2 Sg8OjNj9ZJbO4mAzOYXFjqzy6dCyQZf4n6rl/CWSDRZRtyoFvq+aVpKeLjTAnt5V48lx O8C2Hf0F6HOZqTGsuQT2dEWnwptpssXOdrZDljuGpVTVxn9Ax2BPY2draXZYJLywmjna HgQzEuDvKhOo9hmdXUSwKvKT68tjrm8PAMtPoyQcBgS3jR8fr7Qmy/VRvPs3aYLrWovV 9J+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date:from :references:cc:to:subject; bh=2IQFD61uzl/JR4+N2pqvRhHo2Za7fXXgLi8n9sTOzaI=; b=oM13iwWRWKsnGQG6HJVhlBFJqCgX6L2+T+T58WOsFp1bkjDtYspeKpBBF9537W0ZvE I0a0v3/cRahWetKF4gTaWZ+Ch9d8Xk8FtsO/4qXzIa4NRSJykmwq/BNe3wSj0PEHaAAE rb+d4qQXge2he2sJXvIoXd0NMq4ZZUc97UDhVFVAPIwj+C6+imnWPSSnAc3d6/DZ8oRk uNT8hYwMSiQo6y0uDrXJ4VPAJW2IQOZWUXQqkmGYsHOpUCqPcP7dbqlOt7oFK4jm9SIK RzL3e9Brz3eThLUZRpMi+i2FuEJ2s1PO34wzI8TVMRqrTPZy7tSa/A2bzT4jQfsMjNAn 6UmA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t11si5517240plr.62.2019.03.11.07.29.31; Mon, 11 Mar 2019 07:29:48 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727595AbfCKO3E (ORCPT + 99 others); Mon, 11 Mar 2019 10:29:04 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:45180 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727462AbfCKO3D (ORCPT ); Mon, 11 Mar 2019 10:29:03 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x2BESxqc012465 for ; Mon, 11 Mar 2019 10:29:02 -0400 Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.150]) by mx0a-001b2d01.pphosted.com with ESMTP id 2r5rg13pcx-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 11 Mar 2019 10:29:01 -0400 Received: from localhost by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 11 Mar 2019 14:28:55 -0000 Received: from b03cxnp08027.gho.boulder.ibm.com (9.17.130.19) by e32.co.us.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 11 Mar 2019 14:28:53 -0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x2BESnds59375856 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Mar 2019 14:28:49 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B0E94136053; Mon, 11 Mar 2019 14:28:49 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8CAA4136051; Mon, 11 Mar 2019 14:28:48 +0000 (GMT) Received: from [9.60.75.235] (unknown [9.60.75.235]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 11 Mar 2019 14:28:48 +0000 (GMT) Subject: Re: [PATCH v3] zcrypt: handle AP Info notification from CHSC SEI command To: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org Cc: freude@de.ibm.com, borntraeger@de.ibm.com, cohuck@redhat.com, pmorel@linux.vnet.ibm.com, pasic@linux.vnet.ibm.com, akrowiak@linux.vnet.ibm.com, oberpar@linux.ibm.com, sebott@linux.ibm.com References: <1550509295-1199-1-git-send-email-akrowiak@linux.ibm.com> From: Tony Krowiak Date: Mon, 11 Mar 2019 10:28:48 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <1550509295-1199-1-git-send-email-akrowiak@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 19031114-0004-0000-0000-000014ECA398 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010739; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000281; SDB=6.01172844; UDB=6.00613161; IPR=6.00953498; MB=3.00025928; MTD=3.00000008; XFM=3.00000015; UTC=2019-03-11 14:28:54 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19031114-0005-0000-0000-00008ADE12A6 Message-Id: <9224eca6-6d2c-7089-1fb2-618a04d7286b@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-03-11_11:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903110105 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/18/19 12:01 PM, Tony Krowiak wrote: > The current AP bus implementation periodically polls the AP configuration > to detect changes. When the AP configuration is dynamically changed via the > SE or an SCLP instruction, the changes will not be reflected to sysfs until > the next time the AP configuration is polled. The CHSC architecture > provides a Store Event Information (SEI) command to make notification of an > AP configuration change. This patch introduces a handler to process > notification from the CHSC SEI command by immediately kicking off an AP bus > scan-after-event. Ping > > Signed-off-by: Tony Krowiak > Reviewed-by: Halil Pasic > Reviewed-by: Sebastian Ott > Reviewed-by: Harald Freudenberger > Reviewed-by: Cornelia Huck > --- > arch/s390/include/asm/ap.h | 11 +++++++++++ > drivers/s390/cio/chsc.c | 13 +++++++++++++ > drivers/s390/crypto/ap_bus.c | 10 ++++++++++ > 3 files changed, 34 insertions(+) > > diff --git a/arch/s390/include/asm/ap.h b/arch/s390/include/asm/ap.h > index 1a6a7092d942..e94a0a28b5eb 100644 > --- a/arch/s390/include/asm/ap.h > +++ b/arch/s390/include/asm/ap.h > @@ -360,4 +360,15 @@ static inline struct ap_queue_status ap_dqap(ap_qid_t qid, > return reg1; > } > > +/* > + * Interface to tell the AP bus code that a configuration > + * change has happened. The bus code should at least do > + * an ap bus resource rescan. > + */ > +#if IS_ENABLED(CONFIG_ZCRYPT) > +void ap_bus_cfg_chg(void); > +#else > +static inline void ap_bus_cfg_chg(void){}; > +#endif > + > #endif /* _ASM_S390_AP_H_ */ > diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c > index a0baee25134c..eaf4699be2c5 100644 > --- a/drivers/s390/cio/chsc.c > +++ b/drivers/s390/cio/chsc.c > @@ -24,6 +24,7 @@ > #include > #include > #include > +#include > > #include "css.h" > #include "cio.h" > @@ -586,6 +587,15 @@ static void chsc_process_sei_scm_avail(struct chsc_sei_nt0_area *sei_area) > " failed (rc=%d).\n", ret); > } > > +static void chsc_process_sei_ap_cfg_chg(struct chsc_sei_nt0_area *sei_area) > +{ > + CIO_CRW_EVENT(3, "chsc: ap config changed\n"); > + if (sei_area->rs != 5) > + return; > + > + ap_bus_cfg_chg(); > +} > + > static void chsc_process_sei_nt2(struct chsc_sei_nt2_area *sei_area) > { > switch (sei_area->cc) { > @@ -612,6 +622,9 @@ static void chsc_process_sei_nt0(struct chsc_sei_nt0_area *sei_area) > case 2: /* i/o resource accessibility */ > chsc_process_sei_res_acc(sei_area); > break; > + case 3: /* ap config changed */ > + chsc_process_sei_ap_cfg_chg(sei_area); > + break; > case 7: /* channel-path-availability information */ > chsc_process_sei_chp_avail(sei_area); > break; > diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c > index 5a699746c357..d0d415954142 100644 > --- a/drivers/s390/crypto/ap_bus.c > +++ b/drivers/s390/crypto/ap_bus.c > @@ -861,6 +861,16 @@ void ap_bus_force_rescan(void) > EXPORT_SYMBOL(ap_bus_force_rescan); > > /* > +* A config change has happened, force an ap bus rescan. > +*/ > +void ap_bus_cfg_chg(void) > +{ > + AP_DBF(DBF_INFO, "%s config change, forcing bus rescan\n", __func__); > + > + ap_bus_force_rescan(); > +} > + > +/* > * hex2bitmap() - parse hex mask string and set bitmap. > * Valid strings are "0x012345678" with at least one valid hex number. > * Rest of the bitmap to the right is padded with 0. No spaces allowed >