[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b1ca6094-b561-1962-69a2-e6b678c42d3a@linux.intel.com>
Date: Tue, 9 Feb 2021 08:36:08 +0800
From: Lu Baolu <baolu.lu@...ux.intel.com>
To: Leon Romanovsky <leon@...nel.org>, Megha Dey <megha.dey@...el.com>
Cc: baolu.lu@...ux.intel.com, tglx@...utronix.de,
linux-kernel@...r.kernel.org, dave.jiang@...el.com,
ashok.raj@...el.com, kevin.tian@...el.com, dwmw@...zon.co.uk,
x86@...nel.org, tony.luck@...el.com, dan.j.williams@...el.com,
jgg@...lanox.com, kvm@...r.kernel.org,
iommu@...ts.linux-foundation.org, alex.williamson@...hat.com,
bhelgaas@...gle.com, maz@...nel.org, linux-pci@...r.kernel.org,
ravi.v.shankar@...el.com
Subject: Re: [PATCH 11/12] platform-msi: Add platform check for subdevice irq
domain
Hi Leon,
On 2/8/21 4:21 PM, Leon Romanovsky wrote:
> On Wed, Feb 03, 2021 at 12:56:44PM -0800, Megha Dey wrote:
>> From: Lu Baolu <baolu.lu@...ux.intel.com>
>>
>> The pci_subdevice_msi_create_irq_domain() should fail if the underlying
>> platform is not able to support IMS (Interrupt Message Storage). Otherwise,
>> the isolation of interrupt is not guaranteed.
>>
>> For x86, IMS is only supported on bare metal for now. We could enable it
>> in the virtualization environments in the future if interrupt HYPERCALL
>> domain is supported or the hardware has the capability of interrupt
>> isolation for subdevices.
>>
>> Cc: David Woodhouse <dwmw@...zon.co.uk>
>> Cc: Leon Romanovsky <leon@...nel.org>
>> Cc: Kevin Tian <kevin.tian@...el.com>
>> Suggested-by: Thomas Gleixner <tglx@...utronix.de>
>> Link: https://lore.kernel.org/linux-pci/87pn4nk7nn.fsf@nanos.tec.linutronix.de/
>> Link: https://lore.kernel.org/linux-pci/877dqrnzr3.fsf@nanos.tec.linutronix.de/
>> Link: https://lore.kernel.org/linux-pci/877dqqmc2h.fsf@nanos.tec.linutronix.de/
>> Signed-off-by: Lu Baolu <baolu.lu@...ux.intel.com>
>> Signed-off-by: Megha Dey <megha.dey@...el.com>
>> ---
>> arch/x86/pci/common.c | 74 +++++++++++++++++++++++++++++++++++++++++++++
>> drivers/base/platform-msi.c | 8 +++++
>> include/linux/msi.h | 1 +
>> 3 files changed, 83 insertions(+)
>>
>> diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
>> index 3507f45..263ccf6 100644
>> --- a/arch/x86/pci/common.c
>> +++ b/arch/x86/pci/common.c
>> @@ -12,6 +12,8 @@
>> #include <linux/init.h>
>> #include <linux/dmi.h>
>> #include <linux/slab.h>
>> +#include <linux/iommu.h>
>> +#include <linux/msi.h>
>>
>> #include <asm/acpi.h>
>> #include <asm/segment.h>
>> @@ -724,3 +726,75 @@ struct pci_dev *pci_real_dma_dev(struct pci_dev *dev)
>> return dev;
>> }
>> #endif
>> +
>> +#ifdef CONFIG_DEVICE_MSI
>
> Sorry for my naive question, but I see it in all your patches in this series
> and wonder why did you wrap everything with ifdefs?.
The added code is only called when DEVICE_MSI is configured.
>
> All *.c code is wrapped with those ifdefs, which is hard to navigate and
> unlikely to give any code/size optimization benefit if kernel is compiled
> without CONFIG_DEVICE_MSI. The more common approach is to put those
> ifdef in the public header files and leave to the compiler to drop not
> called functions.
Yes. This looks better.
>
> Thanks
>
Best regards,
baolu
Powered by blists - more mailing lists