* [PATCH] AMD IOMMU: fill msi_desc fields required by commit fe017c59
@ 2013-04-29 8:34 Jan Beulich
2013-05-02 14:55 ` Jan Beulich
2013-05-06 22:43 ` Suravee Suthikulanit
0 siblings, 2 replies; 7+ messages in thread
From: Jan Beulich @ 2013-04-29 8:34 UTC (permalink / raw)
To: xen-devel; +Cc: Jacob Shin, suravee.suthikulpanit
[-- Attachment #1: Type: text/plain, Size: 1283 bytes --]
Since the AMD IOMMU code relies on the x86 generic MSI code, it also
needs to be updated to match "x86/MSI: cleanup to prepare for multi-
vector MSI".
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -775,9 +775,16 @@ static bool_t __init set_iommu_interrupt
control = pci_conf_read16(iommu->seg, PCI_BUS(iommu->bdf),
PCI_SLOT(iommu->bdf), PCI_FUNC(iommu->bdf),
iommu->msi.msi_attrib.pos + PCI_MSI_FLAGS);
- iommu->msi.msi_attrib.maskbit = !!(control & PCI_MSI_FLAGS_MASKBIT);
- desc->handler = control & PCI_MSI_FLAGS_MASKBIT ?
- &iommu_maskable_msi_type : &iommu_msi_type;
+ iommu->msi.msi.nvec = 1;
+ if ( is_mask_bit_support(control) )
+ {
+ iommu->msi.msi_attrib.maskbit = 1;
+ iommu->msi.msi.mpos = msi_mask_bits_reg(iommu->msi.msi_attrib.pos,
+ is_64bit_address(control));
+ desc->handler = &iommu_maskable_msi_type;
+ }
+ else
+ desc->handler = &iommu_msi_type;
ret = request_irq(irq, iommu_interrupt_handler, 0, "amd_iommu", iommu);
if ( ret )
{
[-- Attachment #2: AMD-IOMMU-set-MSI-properties.patch --]
[-- Type: text/plain, Size: 1340 bytes --]
AMD IOMMU: fill msi_desc fields required by commit fe017c59
Since the AMD IOMMU code relies on the x86 generic MSI code, it also
needs to be updated to match "x86/MSI: cleanup to prepare for multi-
vector MSI".
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -775,9 +775,16 @@ static bool_t __init set_iommu_interrupt
control = pci_conf_read16(iommu->seg, PCI_BUS(iommu->bdf),
PCI_SLOT(iommu->bdf), PCI_FUNC(iommu->bdf),
iommu->msi.msi_attrib.pos + PCI_MSI_FLAGS);
- iommu->msi.msi_attrib.maskbit = !!(control & PCI_MSI_FLAGS_MASKBIT);
- desc->handler = control & PCI_MSI_FLAGS_MASKBIT ?
- &iommu_maskable_msi_type : &iommu_msi_type;
+ iommu->msi.msi.nvec = 1;
+ if ( is_mask_bit_support(control) )
+ {
+ iommu->msi.msi_attrib.maskbit = 1;
+ iommu->msi.msi.mpos = msi_mask_bits_reg(iommu->msi.msi_attrib.pos,
+ is_64bit_address(control));
+ desc->handler = &iommu_maskable_msi_type;
+ }
+ else
+ desc->handler = &iommu_msi_type;
ret = request_irq(irq, iommu_interrupt_handler, 0, "amd_iommu", iommu);
if ( ret )
{
[-- Attachment #3: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] AMD IOMMU: fill msi_desc fields required by commit fe017c59
2013-04-29 8:34 [PATCH] AMD IOMMU: fill msi_desc fields required by commit fe017c59 Jan Beulich
@ 2013-05-02 14:55 ` Jan Beulich
2013-05-06 22:43 ` Suravee Suthikulanit
1 sibling, 0 replies; 7+ messages in thread
From: Jan Beulich @ 2013-05-02 14:55 UTC (permalink / raw)
To: Jacob Shin, suravee.suthikulpanit; +Cc: xen-devel
>>> On 29.04.13 at 10:34, "Jan Beulich" <JBeulich@suse.com> wrote:
Ping?
> Since the AMD IOMMU code relies on the x86 generic MSI code, it also
> needs to be updated to match "x86/MSI: cleanup to prepare for multi-
> vector MSI".
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> --- a/xen/drivers/passthrough/amd/iommu_init.c
> +++ b/xen/drivers/passthrough/amd/iommu_init.c
> @@ -775,9 +775,16 @@ static bool_t __init set_iommu_interrupt
> control = pci_conf_read16(iommu->seg, PCI_BUS(iommu->bdf),
> PCI_SLOT(iommu->bdf), PCI_FUNC(iommu->bdf),
> iommu->msi.msi_attrib.pos + PCI_MSI_FLAGS);
> - iommu->msi.msi_attrib.maskbit = !!(control & PCI_MSI_FLAGS_MASKBIT);
> - desc->handler = control & PCI_MSI_FLAGS_MASKBIT ?
> - &iommu_maskable_msi_type : &iommu_msi_type;
> + iommu->msi.msi.nvec = 1;
> + if ( is_mask_bit_support(control) )
> + {
> + iommu->msi.msi_attrib.maskbit = 1;
> + iommu->msi.msi.mpos = msi_mask_bits_reg(iommu->msi.msi_attrib.pos,
> + is_64bit_address(control));
> + desc->handler = &iommu_maskable_msi_type;
> + }
> + else
> + desc->handler = &iommu_msi_type;
> ret = request_irq(irq, iommu_interrupt_handler, 0, "amd_iommu", iommu);
> if ( ret )
> {
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] AMD IOMMU: fill msi_desc fields required by commit fe017c59
2013-04-29 8:34 [PATCH] AMD IOMMU: fill msi_desc fields required by commit fe017c59 Jan Beulich
2013-05-02 14:55 ` Jan Beulich
@ 2013-05-06 22:43 ` Suravee Suthikulanit
2013-05-07 7:56 ` Jan Beulich
1 sibling, 1 reply; 7+ messages in thread
From: Suravee Suthikulanit @ 2013-05-06 22:43 UTC (permalink / raw)
To: Jan Beulich; +Cc: Shin, Jacob, xen-devel
This looks fine and tested. Thanks for the patch.
Suravee
On 4/29/2013 3:34 AM, Jan Beulich wrote:
> Since the AMD IOMMU code relies on the x86 generic MSI code, it also
> needs to be updated to match "x86/MSI: cleanup to prepare for multi-
> vector MSI".
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> --- a/xen/drivers/passthrough/amd/iommu_init.c
> +++ b/xen/drivers/passthrough/amd/iommu_init.c
> @@ -775,9 +775,16 @@ static bool_t __init set_iommu_interrupt
> control = pci_conf_read16(iommu->seg, PCI_BUS(iommu->bdf),
> PCI_SLOT(iommu->bdf), PCI_FUNC(iommu->bdf),
> iommu->msi.msi_attrib.pos + PCI_MSI_FLAGS);
> - iommu->msi.msi_attrib.maskbit = !!(control & PCI_MSI_FLAGS_MASKBIT);
> - desc->handler = control & PCI_MSI_FLAGS_MASKBIT ?
> - &iommu_maskable_msi_type : &iommu_msi_type;
> + iommu->msi.msi.nvec = 1;
> + if ( is_mask_bit_support(control) )
> + {
> + iommu->msi.msi_attrib.maskbit = 1;
> + iommu->msi.msi.mpos = msi_mask_bits_reg(iommu->msi.msi_attrib.pos,
> + is_64bit_address(control));
> + desc->handler = &iommu_maskable_msi_type;
> + }
> + else
> + desc->handler = &iommu_msi_type;
> ret = request_irq(irq, iommu_interrupt_handler, 0, "amd_iommu", iommu);
> if ( ret )
> {
>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] AMD IOMMU: fill msi_desc fields required by commit fe017c59
2013-05-06 22:43 ` Suravee Suthikulanit
@ 2013-05-07 7:56 ` Jan Beulich
2013-05-07 13:47 ` Suravee Suthikulanit
0 siblings, 1 reply; 7+ messages in thread
From: Jan Beulich @ 2013-05-07 7:56 UTC (permalink / raw)
To: Suravee Suthikulanit; +Cc: Jacob Shin, xen-devel
>>> On 07.05.13 at 00:43, Suravee Suthikulanit <suravee.suthikulpanit@amd.com> wrote:
> This looks fine and tested. Thanks for the patch.
Tested also underneath the multi-vector MSI series? I.e. did the
assertion you were hitting not get triggered anymore with this in
place, as expected?
Thanks, Jan
> On 4/29/2013 3:34 AM, Jan Beulich wrote:
>> Since the AMD IOMMU code relies on the x86 generic MSI code, it also
>> needs to be updated to match "x86/MSI: cleanup to prepare for multi-
>> vector MSI".
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>
>> --- a/xen/drivers/passthrough/amd/iommu_init.c
>> +++ b/xen/drivers/passthrough/amd/iommu_init.c
>> @@ -775,9 +775,16 @@ static bool_t __init set_iommu_interrupt
>> control = pci_conf_read16(iommu->seg, PCI_BUS(iommu->bdf),
>> PCI_SLOT(iommu->bdf), PCI_FUNC(iommu->bdf),
>> iommu->msi.msi_attrib.pos + PCI_MSI_FLAGS);
>> - iommu->msi.msi_attrib.maskbit = !!(control & PCI_MSI_FLAGS_MASKBIT);
>> - desc->handler = control & PCI_MSI_FLAGS_MASKBIT ?
>> - &iommu_maskable_msi_type : &iommu_msi_type;
>> + iommu->msi.msi.nvec = 1;
>> + if ( is_mask_bit_support(control) )
>> + {
>> + iommu->msi.msi_attrib.maskbit = 1;
>> + iommu->msi.msi.mpos = msi_mask_bits_reg(iommu->msi.msi_attrib.pos,
>> + is_64bit_address(control));
>> + desc->handler = &iommu_maskable_msi_type;
>> + }
>> + else
>> + desc->handler = &iommu_msi_type;
>> ret = request_irq(irq, iommu_interrupt_handler, 0, "amd_iommu",
> iommu);
>> if ( ret )
>> {
>>
>>
>>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] AMD IOMMU: fill msi_desc fields required by commit fe017c59
2013-05-07 7:56 ` Jan Beulich
@ 2013-05-07 13:47 ` Suravee Suthikulanit
2013-05-07 14:06 ` Jan Beulich
0 siblings, 1 reply; 7+ messages in thread
From: Suravee Suthikulanit @ 2013-05-07 13:47 UTC (permalink / raw)
To: Jan Beulich; +Cc: Jacob Shin, xen-devel
On 5/7/2013 2:56 AM, Jan Beulich wrote:
>>>> On 07.05.13 at 00:43, Suravee Suthikulanit<suravee.suthikulpanit@amd.com> wrote:
>> >This looks fine and tested. Thanks for the patch.
> Tested also underneath the multi-vector MSI series? I.e. did the
> assertion you were hitting not get triggered anymore with this in
> place, as expected?
>
> Thanks, Jan
Yes, I have tested it with the previous set (the x86/IOMMU: multi-vector
MSI) that I report the ASSERTION plus the change I made to fix the
IOAPIC. With this additional patch, it was no longer asserting since
nvec is now 1 (instead of 0 in prior case).
Suravee
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] AMD IOMMU: fill msi_desc fields required by commit fe017c59
2013-05-07 13:47 ` Suravee Suthikulanit
@ 2013-05-07 14:06 ` Jan Beulich
2013-05-08 5:21 ` Suravee Suthikulpanit
0 siblings, 1 reply; 7+ messages in thread
From: Jan Beulich @ 2013-05-07 14:06 UTC (permalink / raw)
To: Suravee Suthikulanit; +Cc: Jacob Shin, xen-devel
>>> On 07.05.13 at 15:47, Suravee Suthikulanit <suravee.suthikulpanit@amd.com>
wrote:
> On 5/7/2013 2:56 AM, Jan Beulich wrote:
>>>>> On 07.05.13 at 00:43, Suravee Suthikulanit<suravee.suthikulpanit@amd.com>
> wrote:
>>> >This looks fine and tested. Thanks for the patch.
>> Tested also underneath the multi-vector MSI series? I.e. did the
>> assertion you were hitting not get triggered anymore with this in
>> place, as expected?
>>
> Yes, I have tested it with the previous set (the x86/IOMMU: multi-vector
> MSI) that I report the ASSERTION plus the change I made to fix the
> IOAPIC. With this additional patch, it was no longer asserting since
> nvec is now 1 (instead of 0 in prior case).
Which suggests I could put your ack under the AMD patches when
I resubmit that series after 4.3 got branched?
Jan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] AMD IOMMU: fill msi_desc fields required by commit fe017c59
2013-05-07 14:06 ` Jan Beulich
@ 2013-05-08 5:21 ` Suravee Suthikulpanit
0 siblings, 0 replies; 7+ messages in thread
From: Suravee Suthikulpanit @ 2013-05-08 5:21 UTC (permalink / raw)
To: Jan Beulich; +Cc: Jacob Shin, xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 903 bytes --]
On 5/7/2013 9:06 AM, Jan Beulich wrote:
>>>> On 07.05.13 at 15:47, Suravee Suthikulanit <suravee.suthikulpanit@amd.com>
> wrote:
>> On 5/7/2013 2:56 AM, Jan Beulich wrote:
>>>>>> On 07.05.13 at 00:43, Suravee Suthikulanit<suravee.suthikulpanit@amd.com>
>> wrote:
>>>>> This looks fine and tested. Thanks for the patch.
>>> Tested also underneath the multi-vector MSI series? I.e. did the
>>> assertion you were hitting not get triggered anymore with this in
>>> place, as expected?
>>>
>> Yes, I have tested it with the previous set (the x86/IOMMU: multi-vector
>> MSI) that I report the ASSERTION plus the change I made to fix the
>> IOAPIC. With this additional patch, it was no longer asserting since
>> nvec is now 1 (instead of 0 in prior case).
> Which suggests I could put your ack under the AMD patches when
> I resubmit that series after 4.3 got branched?
>
> Jan
>
>
Yes, please do.
Suravee
[-- Attachment #1.2: Type: text/html, Size: 2405 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-05-08 5:21 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-29 8:34 [PATCH] AMD IOMMU: fill msi_desc fields required by commit fe017c59 Jan Beulich
2013-05-02 14:55 ` Jan Beulich
2013-05-06 22:43 ` Suravee Suthikulanit
2013-05-07 7:56 ` Jan Beulich
2013-05-07 13:47 ` Suravee Suthikulanit
2013-05-07 14:06 ` Jan Beulich
2013-05-08 5:21 ` Suravee Suthikulpanit
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.