From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752835AbdCBNb4 (ORCPT ); Thu, 2 Mar 2017 08:31:56 -0500 Received: from prv3-mh.provo.novell.com ([137.65.250.26]:33241 "EHLO prv3-mh.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752618AbdCBNbs (ORCPT ); Thu, 2 Mar 2017 08:31:48 -0500 Subject: Re: [PATCH 1/2] irqdomain: add empty irq_domain_check_msi_remap To: Auger Eric , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, marc.zyngier@arm.com, alex.williamson@redhat.com Cc: will.deacon@arm.com References: <20170302100132.20502-1-yousaf.kaukab@suse.com> <7aa0b755-844d-f0f6-d733-276a38b53d11@suse.com> From: Mian Yousaf Kaukab Message-ID: <6545e332-ecf4-d273-5b2c-84205cfdb266@suse.com> Date: Thu, 2 Mar 2017 14:31:37 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/02/2017 02:12 PM, Auger Eric wrote: > Hi Yousaf, > > On 02/03/2017 13:23, Mian Yousaf Kaukab wrote: >> On 03/02/2017 11:24 AM, Auger Eric wrote: >>> Hi Mian Yousaf, >>> >>> On 02/03/2017 11:01, Mian Yousaf Kaukab wrote: >>>> Fix following build error for s390: >>>> drivers/vfio/vfio_iommu_type1.c: In function >>>> 'vfio_iommu_type1_attach_group': >>>> drivers/vfio/vfio_iommu_type1.c:1290:25: error: implicit declaration >>>> of function 'irq_domain_check_msi_remap' >>>> >>>> Signed-off-by: Mian Yousaf Kaukab >>>> --- >>>> include/linux/irqdomain.h | 4 ++++ >>>> 1 file changed, 4 insertions(+) >>>> >>>> diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h >>>> index 188eced6813e..137817b08cdc 100644 >>>> --- a/include/linux/irqdomain.h >>>> +++ b/include/linux/irqdomain.h >>>> @@ -524,6 +524,10 @@ static inline struct irq_domain >>>> *irq_find_matching_fwnode( >>>> { >>>> return NULL; >>>> } >>>> +static inline bool irq_domain_check_msi_remap(void) >>>> +{ >>>> + return true; >>> By default you should rather return false, reporting there is no MSI >>> remapping capability on irq domain side. Besides thank you for the fix. >> I choose to return true based on the function header comments of >> irq_domain_check_msi_remap. It says >> >> "Return: false if any MSI irq domain does not support IRQ remapping, >> true otherwise (including if there is no MSI irq domain)" >> >> So function should return true in case of no MSI irq domain. Have I miss >> understood this? > This behavior is indeed mandated on ARM - where MSI are translated by > the smmu - to allow safe device assignment if there is no MSI domain, > ie. in this situation there is no risk an assigned device writes into an > MSI doorbell. > > As the function is not implemented at all in your case, personally I > would rather be defensive though and return false. You were not able to > check the capability. OK Agree. I will send an update as soon as a decision is made on 2/2. BR, Yousaf