Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1359897rwb; Fri, 19 Aug 2022 02:10:33 -0700 (PDT) X-Google-Smtp-Source: AA6agR5On17idttebvQcxzBSmtS/FgHoxXzYx5SyC+Pq/0skzHfUWYIIq3+xF6lf8exZkNU++Lzj X-Received: by 2002:a17:90b:3ec2:b0:1f7:3f49:17c3 with SMTP id rm2-20020a17090b3ec200b001f73f4917c3mr12720120pjb.203.1660900233513; Fri, 19 Aug 2022 02:10:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660900233; cv=none; d=google.com; s=arc-20160816; b=Yb6jXS8w9txsq7+7OlG4ZTxHGoKiMb3sP7oHhJFSFoUVSMqDDIPLF/kxtDS4sYGoDm KIClzgvv2C56vP02GblfLXNXYzcDWXqrKXj3TH1mVgiKN8gUbemTpM82ejeFQsffrQi9 nNSaREJyrdKk+lO0HjW3J6+WgC1eRDkykbMSvjfGb1MUrn5WwthBwooBawvM6ggunKZF ovkRJ5YNjzCatH/NCiEsW51mkQ5/qeu6LR2CW1on8tvynYQP2v3R9oUOfrWEDu/z5X9W F0Gp/NWEnyNGlYL7WS8i70JZOfKFo1W5SH1bdSDiHTHEJH2HYsZcKCzT8BHfboA9SzrS MGyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=+v9nT8ZKH5nQZXkGNwDvqukouuQUqGry8Hdy6T8DPAY=; b=Jp+nAxtgnlkR1E2sUG40hc2XQaEM6VJlS9jBtnVIRhoOiBitrEmG6q01lLAwc7z/mQ ia231WP3XHP1mTpe3taVBG6nzfpN13PORLj2XGQ51sSNCTYm0WcWluABqrJbQkspEmeO v4UYD4fg9qRpgCkua0c3+pPeYamlVRrzRnsVjKpsAjrnX5MhD0hO2/574FANycHhvDvK q2UiqdFUKOLQjXPDc35pQuZ6n7quu40iR30TsuoR0VZCjQD0iKZ6atEDr7J0RyZvcdhx nJgyxtqQre2JEo+QQiTSD95Nod9qQkCYD7NnWDpGuZMRiq877kfLgQY+sOLyS1tSZ3fH aHqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b="kB/tv/Iz"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t14-20020a170902e84e00b0016c29e43c72si3373424plg.140.2022.08.19.02.10.22; Fri, 19 Aug 2022 02:10:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b="kB/tv/Iz"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347451AbiHSIob (ORCPT + 99 others); Fri, 19 Aug 2022 04:44:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347626AbiHSIo1 (ORCPT ); Fri, 19 Aug 2022 04:44:27 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21007B7EEC; Fri, 19 Aug 2022 01:44:25 -0700 (PDT) Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27J8Gu3L022264; Fri, 19 Aug 2022 08:44:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=+v9nT8ZKH5nQZXkGNwDvqukouuQUqGry8Hdy6T8DPAY=; b=kB/tv/IzObAQjKJ5pJkzJHnejJaIoaO9+UqvSRi1IDf/wQ/9k2ye6IjbDqFPTbYvwEh2 N4HgycFDsUSWUT1eMrMi/8YIly4nO87AYmSEX5/h5eIitLo5s70RuprbvumxKzcoGVdK KCNkIrgRYZevIBSD/QLzGZoUHDmmpUZovLT04kY6EIoe/G5uLv9VZcES4NJnADVCI+js +C4sWTLIs+CNY1l/HmPtwfqB64n9laRDA7tKT3Wux0vLUtchsiRl22oiJvcL2hv90dDF tTJKvIDifu3u1pYZVuDfkaR3ykLX6PfZUU/QMtkxpqV99FKBAY2eKfhUpvnKwxxVyg5Z Gg== Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3j26vd8m93-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 19 Aug 2022 08:44:17 +0000 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 27J8KwLh024220; Fri, 19 Aug 2022 08:44:15 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma01fra.de.ibm.com with ESMTP id 3hx3k957kt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 19 Aug 2022 08:44:15 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 27J8iVWo25297284 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 19 Aug 2022 08:44:31 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D68B7AE045; Fri, 19 Aug 2022 08:44:11 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B7073AE053; Fri, 19 Aug 2022 08:44:10 +0000 (GMT) Received: from [9.171.49.238] (unknown [9.171.49.238]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 19 Aug 2022 08:44:10 +0000 (GMT) Message-ID: <0d7d055d-f323-acba-cb79-f859b5e182b4@linux.ibm.com> Date: Fri, 19 Aug 2022 10:44:10 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [PATCH] KVM: s390: pci: Hook to access KVM lowlevel from VFIO Content-Language: en-US To: Niklas Schnelle , mjrosato@linux.ibm.com Cc: rdunlap@infradead.org, linux-kernel@vger.kernel.org, lkp@intel.com, borntraeger@linux.ibm.com, farman@linux.ibm.com, linux-s390@vger.kernel.org, kvm@vger.kernel.org, gor@linux.ibm.com, hca@linux.ibm.com, frankja@linux.ibm.com References: <20220818164652.269336-1-pmorel@linux.ibm.com> <2ae0bf9abffe2eb3eb2fb3f84873720d39f73d4d.camel@linux.ibm.com> From: Pierre Morel In-Reply-To: <2ae0bf9abffe2eb3eb2fb3f84873720d39f73d4d.camel@linux.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: aPDdiq_Kpt3i5btmzuGdKT24gvc8NZin X-Proofpoint-GUID: aPDdiq_Kpt3i5btmzuGdKT24gvc8NZin X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-19_04,2022-08-18_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 phishscore=0 suspectscore=0 impostorscore=0 malwarescore=0 adultscore=0 spamscore=0 lowpriorityscore=0 mlxscore=0 bulkscore=0 clxscore=1015 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208190033 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/19/22 09:14, Niklas Schnelle wrote: > On Thu, 2022-08-18 at 18:46 +0200, Pierre Morel wrote: >> We have a cross dependency between KVM and VFIO when using >> s390 vfio_pci_zdev extensions for PCI passthrough >> To be able to keep both subsystem modular we add a registering >> hook inside the S390 core code. >> >> This fixes a build problem when VFIO is built-in and KVM is built >> as a module. >> >> Reported-by: Randy Dunlap >> Reported-by: kernel test robot >> Signed-off-by: Pierre Morel >> Fixes: 09340b2fca007 ("KVM: s390: pci: add routines to start/stop inter..") > > Please don't shorten the Fixes tag, the subject line is likely also > checked by some automated tools. It's okay for this line to be over the > column limit and checkpatch.pl --strict also accepts it. > OK >> Cc: >> --- >> arch/s390/include/asm/kvm_host.h | 17 ++++++----------- >> arch/s390/kvm/pci.c | 10 ++++++---- >> arch/s390/pci/Makefile | 2 ++ >> arch/s390/pci/pci_kvm_hook.c | 11 +++++++++++ >> drivers/vfio/pci/vfio_pci_zdev.c | 8 ++++++-- >> 5 files changed, 31 insertions(+), 17 deletions(-) >> create mode 100644 arch/s390/pci/pci_kvm_hook.c >> >> > ---8<--- >> >> kvm_put_kvm(kvm); >> } >> -EXPORT_SYMBOL_GPL(kvm_s390_pci_unregister_kvm); >> >> void kvm_s390_pci_init_list(struct kvm *kvm) >> { >> @@ -678,6 +678,8 @@ int kvm_s390_pci_init(void) >> >> spin_lock_init(&aift->gait_lock); >> mutex_init(&aift->aift_lock); >> + zpci_kvm_hook.kvm_register = kvm_s390_pci_register_kvm; >> + zpci_kvm_hook.kvm_unregister = kvm_s390_pci_unregister_kvm; >> >> return 0; >> } >> diff --git a/arch/s390/pci/Makefile b/arch/s390/pci/Makefile >> index bf557a1b789c..c02dbfb415d9 100644 >> --- a/arch/s390/pci/Makefile >> +++ b/arch/s390/pci/Makefile >> @@ -7,3 +7,5 @@ obj-$(CONFIG_PCI) += pci.o pci_irq.o pci_dma.o pci_clp.o pci_sysfs.o \ >> pci_event.o pci_debug.o pci_insn.o pci_mmio.o \ >> pci_bus.o >> obj-$(CONFIG_PCI_IOV) += pci_iov.o >> + >> +obj-y += pci_kvm_hook.o > > I thought we wanted to compile this only for CONFIG_PCI? Ah sorry, that is indeed what I understood with Matt but then I misunderstood your own answer from yesterday. I change to obj-$(CONFIG_PCI) += pci_kvm_hook.o > >> diff --git a/arch/s390/pci/pci_kvm_hook.c b/arch/s390/pci/pci_kvm_hook.c >> new file mode 100644 >> index 000000000000..ff34baf50a3e > ---8<--- > -- Pierre Morel IBM Lab Boeblingen