From: okaya-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org
To: Alex Williamson
<alex.williamson-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
timur-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 2/2] iommu: add warning when sharing groups
Date: Tue, 14 Feb 2017 22:53:35 -0500 [thread overview]
Message-ID: <e7535138133c514c77004d64e40b4180@codeaurora.org> (raw)
In-Reply-To: <20170214165155.7c49485e-1yVPhWWZRC1BDLzU/O5InQ@public.gmane.org>
On 2017-02-14 18:51, Alex Williamson wrote:
> On Tue, 14 Feb 2017 16:25:22 -0500
> Sinan Kaya <okaya-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> wrote:
>
>> The ACS requirement has been obscured in the current code and is only
>> known by certain individuals who happen to read the code. Print out a
>> warning with ACS path failure when ACS requirement is not met.
>>
>> Signed-off-by: Sinan Kaya <okaya-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
>> ---
>> drivers/iommu/iommu.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
>> index dbe7f65..049ee0a 100644
>> --- a/drivers/iommu/iommu.c
>> +++ b/drivers/iommu/iommu.c
>> @@ -811,6 +811,9 @@ struct iommu_group *pci_device_group(struct device
>> *dev)
>> if (IS_ERR(group))
>> return NULL;
>>
>> + if (pci_is_root_bus(bus))
>> + dev_warn_once(&pdev->dev, "using shared group due to ACS path
>> failure\n");
>> +
>> return group;
>> }
>>
>
> The premise here is flawed. An IOMMU group based at the root bus
> doesn't necessarily imply a lack of ACS. There are devices on root
> buses, integrated endpoints and root ports. Naturally an IOMMU group
> for these devices needs to be based at the root bus. Additionally,
> there can be IOMMU groups developed around a lack of ACS that don't
> intersect with the root bus. Since this is a warn_once, the false
> positives for root bus devices are going to be enumerated first. On an
> Intel system there's typically a device as 00.0 that will always be
> pointlessly listed first. Also, it's not clear that grouping devices
> together is always wrong, as Robin pointed out in the EHCI/OHCI
> example. Lack of ACS on downtream ports is likely to cause problems,
> especially if that downstream port exposes a slot. Maybe that would be
> a good place to start. Also, what is someone supposed to do when they
> see this error? If we can hope they'll look for the error in the code
> (unlikely) a big comment with useful external links might be
> necessary. Based on how easily vendors ignore kernel warnings, I'm
> dubious there's any value to this path though. Thanks,
Maybe, a better solution would be to add some sentences into vfio.txt
documentation.
I'm ready to drop this patch. I just don't want ACS requirement to be
hidden between the source code.
Would you be willing to do that?
I know I read all pci and vfio documents in the past. I could have
captured this requirement if it was there.
>
> Alex
WARNING: multiple messages have this Message-ID (diff)
From: okaya@codeaurora.org
To: Alex Williamson <alex.williamson@redhat.com>
Cc: linux-pci@vger.kernel.org, timur@codeaurora.org,
linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org,
linux-arm-msm@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/2] iommu: add warning when sharing groups
Date: Tue, 14 Feb 2017 22:53:35 -0500 [thread overview]
Message-ID: <e7535138133c514c77004d64e40b4180@codeaurora.org> (raw)
In-Reply-To: <20170214165155.7c49485e@t450s.home>
On 2017-02-14 18:51, Alex Williamson wrote:
> On Tue, 14 Feb 2017 16:25:22 -0500
> Sinan Kaya <okaya@codeaurora.org> wrote:
>
>> The ACS requirement has been obscured in the current code and is only
>> known by certain individuals who happen to read the code. Print out a
>> warning with ACS path failure when ACS requirement is not met.
>>
>> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
>> ---
>> drivers/iommu/iommu.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
>> index dbe7f65..049ee0a 100644
>> --- a/drivers/iommu/iommu.c
>> +++ b/drivers/iommu/iommu.c
>> @@ -811,6 +811,9 @@ struct iommu_group *pci_device_group(struct device
>> *dev)
>> if (IS_ERR(group))
>> return NULL;
>>
>> + if (pci_is_root_bus(bus))
>> + dev_warn_once(&pdev->dev, "using shared group due to ACS path
>> failure\n");
>> +
>> return group;
>> }
>>
>
> The premise here is flawed. An IOMMU group based at the root bus
> doesn't necessarily imply a lack of ACS. There are devices on root
> buses, integrated endpoints and root ports. Naturally an IOMMU group
> for these devices needs to be based at the root bus. Additionally,
> there can be IOMMU groups developed around a lack of ACS that don't
> intersect with the root bus. Since this is a warn_once, the false
> positives for root bus devices are going to be enumerated first. On an
> Intel system there's typically a device as 00.0 that will always be
> pointlessly listed first. Also, it's not clear that grouping devices
> together is always wrong, as Robin pointed out in the EHCI/OHCI
> example. Lack of ACS on downtream ports is likely to cause problems,
> especially if that downstream port exposes a slot. Maybe that would be
> a good place to start. Also, what is someone supposed to do when they
> see this error? If we can hope they'll look for the error in the code
> (unlikely) a big comment with useful external links might be
> necessary. Based on how easily vendors ignore kernel warnings, I'm
> dubious there's any value to this path though. Thanks,
Maybe, a better solution would be to add some sentences into vfio.txt
documentation.
I'm ready to drop this patch. I just don't want ACS requirement to be
hidden between the source code.
Would you be willing to do that?
I know I read all pci and vfio documents in the past. I could have
captured this requirement if it was there.
>
> Alex
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: okaya@codeaurora.org (okaya at codeaurora.org)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] iommu: add warning when sharing groups
Date: Tue, 14 Feb 2017 22:53:35 -0500 [thread overview]
Message-ID: <e7535138133c514c77004d64e40b4180@codeaurora.org> (raw)
In-Reply-To: <20170214165155.7c49485e@t450s.home>
On 2017-02-14 18:51, Alex Williamson wrote:
> On Tue, 14 Feb 2017 16:25:22 -0500
> Sinan Kaya <okaya@codeaurora.org> wrote:
>
>> The ACS requirement has been obscured in the current code and is only
>> known by certain individuals who happen to read the code. Print out a
>> warning with ACS path failure when ACS requirement is not met.
>>
>> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
>> ---
>> drivers/iommu/iommu.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
>> index dbe7f65..049ee0a 100644
>> --- a/drivers/iommu/iommu.c
>> +++ b/drivers/iommu/iommu.c
>> @@ -811,6 +811,9 @@ struct iommu_group *pci_device_group(struct device
>> *dev)
>> if (IS_ERR(group))
>> return NULL;
>>
>> + if (pci_is_root_bus(bus))
>> + dev_warn_once(&pdev->dev, "using shared group due to ACS path
>> failure\n");
>> +
>> return group;
>> }
>>
>
> The premise here is flawed. An IOMMU group based at the root bus
> doesn't necessarily imply a lack of ACS. There are devices on root
> buses, integrated endpoints and root ports. Naturally an IOMMU group
> for these devices needs to be based at the root bus. Additionally,
> there can be IOMMU groups developed around a lack of ACS that don't
> intersect with the root bus. Since this is a warn_once, the false
> positives for root bus devices are going to be enumerated first. On an
> Intel system there's typically a device as 00.0 that will always be
> pointlessly listed first. Also, it's not clear that grouping devices
> together is always wrong, as Robin pointed out in the EHCI/OHCI
> example. Lack of ACS on downtream ports is likely to cause problems,
> especially if that downstream port exposes a slot. Maybe that would be
> a good place to start. Also, what is someone supposed to do when they
> see this error? If we can hope they'll look for the error in the code
> (unlikely) a big comment with useful external links might be
> necessary. Based on how easily vendors ignore kernel warnings, I'm
> dubious there's any value to this path though. Thanks,
Maybe, a better solution would be to add some sentences into vfio.txt
documentation.
I'm ready to drop this patch. I just don't want ACS requirement to be
hidden between the source code.
Would you be willing to do that?
I know I read all pci and vfio documents in the past. I could have
captured this requirement if it was there.
>
> Alex
WARNING: multiple messages have this Message-ID (diff)
From: okaya@codeaurora.org
To: Alex Williamson <alex.williamson@redhat.com>
Cc: linux-pci@vger.kernel.org, timur@codeaurora.org,
iommu@lists.linux-foundation.org, linux-arm-msm@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] iommu: add warning when sharing groups
Date: Tue, 14 Feb 2017 22:53:35 -0500 [thread overview]
Message-ID: <e7535138133c514c77004d64e40b4180@codeaurora.org> (raw)
In-Reply-To: <20170214165155.7c49485e@t450s.home>
On 2017-02-14 18:51, Alex Williamson wrote:
> On Tue, 14 Feb 2017 16:25:22 -0500
> Sinan Kaya <okaya@codeaurora.org> wrote:
>
>> The ACS requirement has been obscured in the current code and is only
>> known by certain individuals who happen to read the code. Print out a
>> warning with ACS path failure when ACS requirement is not met.
>>
>> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
>> ---
>> drivers/iommu/iommu.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
>> index dbe7f65..049ee0a 100644
>> --- a/drivers/iommu/iommu.c
>> +++ b/drivers/iommu/iommu.c
>> @@ -811,6 +811,9 @@ struct iommu_group *pci_device_group(struct device
>> *dev)
>> if (IS_ERR(group))
>> return NULL;
>>
>> + if (pci_is_root_bus(bus))
>> + dev_warn_once(&pdev->dev, "using shared group due to ACS path
>> failure\n");
>> +
>> return group;
>> }
>>
>
> The premise here is flawed. An IOMMU group based at the root bus
> doesn't necessarily imply a lack of ACS. There are devices on root
> buses, integrated endpoints and root ports. Naturally an IOMMU group
> for these devices needs to be based at the root bus. Additionally,
> there can be IOMMU groups developed around a lack of ACS that don't
> intersect with the root bus. Since this is a warn_once, the false
> positives for root bus devices are going to be enumerated first. On an
> Intel system there's typically a device as 00.0 that will always be
> pointlessly listed first. Also, it's not clear that grouping devices
> together is always wrong, as Robin pointed out in the EHCI/OHCI
> example. Lack of ACS on downtream ports is likely to cause problems,
> especially if that downstream port exposes a slot. Maybe that would be
> a good place to start. Also, what is someone supposed to do when they
> see this error? If we can hope they'll look for the error in the code
> (unlikely) a big comment with useful external links might be
> necessary. Based on how easily vendors ignore kernel warnings, I'm
> dubious there's any value to this path though. Thanks,
Maybe, a better solution would be to add some sentences into vfio.txt
documentation.
I'm ready to drop this patch. I just don't want ACS requirement to be
hidden between the source code.
Would you be willing to do that?
I know I read all pci and vfio documents in the past. I could have
captured this requirement if it was there.
>
> Alex
next prev parent reply other threads:[~2017-02-15 3:53 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-14 21:25 [PATCH 1/2] PCI: add QCOM root port quirks for ACS Sinan Kaya
2017-02-14 21:25 ` Sinan Kaya
2017-02-14 21:25 ` Sinan Kaya
2017-02-14 21:25 ` Sinan Kaya
2017-02-14 21:25 ` [PATCH 2/2] iommu: add warning when sharing groups Sinan Kaya
2017-02-14 21:25 ` Sinan Kaya
2017-02-14 21:25 ` Sinan Kaya
2017-02-14 21:25 ` Sinan Kaya
2017-02-14 23:51 ` Alex Williamson
2017-02-14 23:51 ` Alex Williamson
2017-02-14 23:51 ` Alex Williamson
[not found] ` <20170214165155.7c49485e-1yVPhWWZRC1BDLzU/O5InQ@public.gmane.org>
2017-02-15 3:53 ` okaya-sgV2jX0FEOL9JmXXK+q4OQ [this message]
2017-02-15 3:53 ` okaya
2017-02-15 3:53 ` okaya at codeaurora.org
2017-02-15 3:53 ` okaya
2017-02-15 19:36 ` Alex Williamson
2017-02-15 19:36 ` Alex Williamson
2017-02-15 19:36 ` Alex Williamson
[not found] ` <20170215123613.1df4b33a-1yVPhWWZRC1BDLzU/O5InQ@public.gmane.org>
2017-02-15 21:43 ` Sinan Kaya
2017-02-15 21:43 ` Sinan Kaya
2017-02-15 21:43 ` Sinan Kaya
2017-02-15 21:43 ` Sinan Kaya
2017-02-16 22:09 ` Sinan Kaya
2017-02-16 22:09 ` Sinan Kaya
2017-02-16 22:09 ` Sinan Kaya
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e7535138133c514c77004d64e40b4180@codeaurora.org \
--to=okaya-sgv2jx0feol9jmxxk+q4oq@public.gmane.org \
--cc=alex.williamson-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=timur-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.