From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753511AbdJPPCj (ORCPT ); Mon, 16 Oct 2017 11:02:39 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:54426 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753139AbdJPPCh (ORCPT ); Mon, 16 Oct 2017 11:02:37 -0400 Subject: Re: [RFC 03/19] s390/zcrypt: new AP matrix bus To: Martin Schwidefsky Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, freude@de.ibm.com, heiko.carstens@de.ibm.com, borntraeger@de.ibm.com, cohuck@redhat.com, kwankhede@nvidia.com, bjsdjshi@linux.vnet.ibm.com, pbonzini@redhat.com, alex.williamson@redhat.com, pmorel@linux.vnet.ibm.com, alifm@linux.vnet.ibm.com, mjrosato@linux.vnet.ibm.com, qemu-s390x@nongnu.org, jjherne@linux.vnet.ibm.com, thuth@redhat.com, pasic@linux.vnet.ibm.com References: <1507916344-3896-1-git-send-email-akrowiak@linux.vnet.ibm.com> <1507916344-3896-4-git-send-email-akrowiak@linux.vnet.ibm.com> <20171016104723.71b683c3@mschwideX1> From: Tony Krowiak Date: Mon, 16 Oct 2017 11:02:28 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20171016104723.71b683c3@mschwideX1> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-TM-AS-GCONF: 00 x-cbid: 17101615-0024-0000-0000-000002E385A1 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007899; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000236; SDB=6.00931983; UDB=6.00469285; IPR=6.00712273; BA=6.00005641; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017560; XFM=3.00000015; UTC=2017-10-16 15:02:33 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17101615-0025-0000-0000-000045BF739A Message-Id: <94e4bdcc-aa28-c37e-ef58-7ed1b18b2faa@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-10-16_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1710160212 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/16/2017 04:47 AM, Martin Schwidefsky wrote: > On Fri, 13 Oct 2017 13:38:48 -0400 > Tony Krowiak wrote: > >> Introduces an AP matrix bus. The sysfs location of the >> AP matrix bus is: >> >> /sys/bus/ap_matrix >> >> The AP matrix bus will create an AP matrix device that will >> hold the AP queues reserved for use by KVM guests. >> >> Signed-off-by: Tony Krowiak >> --- >> MAINTAINERS | 8 +++++ >> drivers/s390/crypto/Makefile | 4 +- >> drivers/s390/crypto/ap_matrix_bus.c | 52 +++++++++++++++++++++++++++++++++++ >> drivers/s390/crypto/ap_matrix_bus.h | 15 ++++++++++ >> 4 files changed, 77 insertions(+), 2 deletions(-) >> create mode 100644 drivers/s390/crypto/ap_matrix_bus.c >> create mode 100644 drivers/s390/crypto/ap_matrix_bus.h >> >> diff --git a/MAINTAINERS b/MAINTAINERS >> index ef23cf5..cbd6f7c 100644 >> --- a/MAINTAINERS >> +++ b/MAINTAINERS >> @@ -11711,6 +11711,14 @@ W: http://www.ibm.com/developerworks/linux/linux390/ >> S: Supported >> F: drivers/s390/crypto/ >> >> +S390 VFIO AP MATRIX DRIVER >> +M: Tony Krowiak >> +L: linux-s390@vger.kernel.org >> +W: http://www.ibm.com/developerworks/linux/linux390/ >> +S: Supported >> +F: drivers/s390/crypto/ap_matrix_bus.h >> +F: drivers/s390/crypto/ap_matrix_bus.c >> + >> S390 ZFCP DRIVER >> M: Steffen Maier >> M: Benjamin Block >> diff --git a/drivers/s390/crypto/Makefile b/drivers/s390/crypto/Makefile >> index be36f10..87646ca 100644 >> --- a/drivers/s390/crypto/Makefile >> +++ b/drivers/s390/crypto/Makefile >> @@ -2,7 +2,7 @@ >> # S/390 crypto devices >> # >> >> -ap-objs := ap_bus.o ap_card.o ap_queue.o >> +ap-objs := ap_bus.o ap_card.o ap_queue.o ap_matrix_bus.o >> obj-$(subst m,y,$(CONFIG_ZCRYPT)) += ap.o >> # zcrypt_api.o and zcrypt_msgtype*.o depend on ap.o >> zcrypt-objs := zcrypt_api.o zcrypt_card.o zcrypt_queue.o >> @@ -13,4 +13,4 @@ obj-$(CONFIG_ZCRYPT) += zcrypt_pcixcc.o zcrypt_cex2a.o zcrypt_cex4.o >> >> # pkey kernel module >> pkey-objs := pkey_api.o >> -obj-$(CONFIG_PKEY) += pkey.o >> +obj-$(CONFIG_PKEY) += pkey.o >> \ No newline at end of file > Try to avoid this newline hunk please. It is removed again with patch #5. Will do. > >> diff --git a/drivers/s390/crypto/ap_matrix_bus.c b/drivers/s390/crypto/ap_matrix_bus.c >> new file mode 100644 >> index 0000000..fbae175 >> --- /dev/null >> +++ b/drivers/s390/crypto/ap_matrix_bus.c >> @@ -0,0 +1,52 @@ >> +/* >> + * Copyright IBM Corp. 2017 >> + * Author(s): Tony Krowiak >> + * >> + * Adjunct processor matrix bus. >> + * >> + * This program is distributed in the hope that it will be useful, >> + * but WITHOUT ANY WARRANTY; without even the implied warranty of >> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >> + * GNU General Public License for more details. >> + */ >> + >> +#include >> +#include >> +#include >> + >> +#include "ap_matrix_bus.h" >> + >> +MODULE_AUTHOR("Tony Krowiak > +MODULE_DESCRIPTION("AP Matrix, Copyright IBM Corp. 2017"); >> +MODULE_LICENSE("GPL v2"); >> + >> +#define AP_MATRIX_BUS_NAME "ap_matrix" >> + >> +static struct device *ap_matrix_root_device; >> + >> +static struct bus_type ap_matrix_bus_type = { >> + .name = AP_MATRIX_BUS_NAME, >> +}; >> + >> +int __init ap_matrix_init(void) >> +{ >> + int ret; >> + >> + ap_matrix_root_device = root_device_register(AP_MATRIX_BUS_NAME); >> + ret = PTR_RET(ap_matrix_root_device); >> + if (ret) >> + goto done; >> + >> + ret = bus_register(&ap_matrix_bus_type); >> + if (ret) >> + goto bus_reg_err; >> + >> + return 0; >> + >> +bus_reg_err: >> + root_device_unregister(ap_matrix_root_device); >> + >> +done: >> + return ret; >> +} >> +device_initcall(ap_matrix_init); >> diff --git a/drivers/s390/crypto/ap_matrix_bus.h b/drivers/s390/crypto/ap_matrix_bus.h >> new file mode 100644 >> index 0000000..58e116f >> --- /dev/null >> +++ b/drivers/s390/crypto/ap_matrix_bus.h >> @@ -0,0 +1,15 @@ >> +/* >> + * Adjunct processor matrix bus header file >> + * >> + * Copyright IBM Corp. 2017 >> + * Author(s): Tony Krowiak >> + * >> + * Adjunct processor bus header file. >> + */ >> + >> +#ifndef _AP_MATRIX_BUS_H_ >> +#define _AP_MATRIX_BUS_H_ >> + >> +int ap_matrix_init(void); >> + >> +#endif /* _AP_MATRIX_BUS_H_ */ > While I understand the approach to split the patches into meaningful > parts, there is always a balance between too coarse and too fine granular. > > I would merge patch #3, patch #4 and parts of patch #5 that affect > ap_matrix_bus.c & ap_matrix_bus.h. Will do. > >