* [PATCH] IOMMU: fail HPET MSI setup on AMD
@ 2012-10-19 9:17 Jan Beulich
2012-10-19 13:27 ` Wei Wang
0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2012-10-19 9:17 UTC (permalink / raw)
To: xen-devel; +Cc: Wei Wang
[-- Attachment #1: Type: text/plain, Size: 1244 bytes --]
While the MSI message format doesn't need adjustment for AMD IOMMUs,
the interrupt remapping tables still need updating. The respective code
has to be able to determine the IOMMU responsible, which currently
requires an associated PCI device. The absence of that device in the
HPET case causes the code to crash, and the code determining the source
ID to be used for HPETs (parse_ivhd_device_special() afaict) isn't even
looking at whether it's dealing with an IO-APIC or a HPET (i.e. ignores
the "variety" structure member). If I tried to fix that, I would have
no way to test that I did things right, so all I can do to fix the
crash is make the setup fail if the IOMMU did not provide a handler
(which, considering the above, is the right thing anyway).
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -498,7 +498,7 @@ unsigned int iommu_read_apic_from_ire(un
int __init iommu_setup_hpet_msi(struct msi_desc *msi)
{
const struct iommu_ops *ops = iommu_get_ops();
- return ops->setup_hpet_msi ? ops->setup_hpet_msi(msi) : 0;
+ return ops->setup_hpet_msi ? ops->setup_hpet_msi(msi) : -ENODEV;
}
void iommu_resume()
[-- Attachment #2: x86-HPET-intremap-Intel-only.patch --]
[-- Type: text/plain, Size: 1275 bytes --]
IOMMU: fail HPET MSI setup on AMD
While the MSI message format doesn't need adjustment for AMD IOMMUs,
the interrupt remapping tables still need updating. The respective code
has to be able to determine the IOMMU responsible, which currently
requires an associated PCI device. The absence of that device in the
HPET case causes the code to crash, and the code determining the source
ID to be used for HPETs (parse_ivhd_device_special() afaict) isn't even
looking at whether it's dealing with an IO-APIC or a HPET (i.e. ignores
the "variety" structure member). If I tried to fix that, I would have
no way to test that I did things right, so all I can do to fix the
crash is make the setup fail if the IOMMU did not provide a handler
(which, considering the above, is the right thing anyway).
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -498,7 +498,7 @@ unsigned int iommu_read_apic_from_ire(un
int __init iommu_setup_hpet_msi(struct msi_desc *msi)
{
const struct iommu_ops *ops = iommu_get_ops();
- return ops->setup_hpet_msi ? ops->setup_hpet_msi(msi) : 0;
+ return ops->setup_hpet_msi ? ops->setup_hpet_msi(msi) : -ENODEV;
}
void iommu_resume()
[-- 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] 2+ messages in thread
* Re: [PATCH] IOMMU: fail HPET MSI setup on AMD
2012-10-19 9:17 [PATCH] IOMMU: fail HPET MSI setup on AMD Jan Beulich
@ 2012-10-19 13:27 ` Wei Wang
0 siblings, 0 replies; 2+ messages in thread
From: Wei Wang @ 2012-10-19 13:27 UTC (permalink / raw)
To: Jan Beulich; +Cc: xen-devel
On 10/19/2012 11:17 AM, Jan Beulich wrote:
> While the MSI message format doesn't need adjustment for AMD IOMMUs,
> the interrupt remapping tables still need updating. The respective code
> has to be able to determine the IOMMU responsible, which currently
> requires an associated PCI device. The absence of that device in the
> HPET case causes the code to crash, and the code determining the source
> ID to be used for HPETs (parse_ivhd_device_special() afaict) isn't even
> looking at whether it's dealing with an IO-APIC or a HPET (i.e. ignores
> the "variety" structure member). If I tried to fix that, I would have
> no way to test that I did things right, so all I can do to fix the
> crash is make the setup fail if the IOMMU did not provide a handler
> (which, considering the above, is the right thing anyway).
>
> Signed-off-by: Jan Beulich<jbeulich@suse.com>
>
> --- a/xen/drivers/passthrough/iommu.c
> +++ b/xen/drivers/passthrough/iommu.c
> @@ -498,7 +498,7 @@ unsigned int iommu_read_apic_from_ire(un
> int __init iommu_setup_hpet_msi(struct msi_desc *msi)
> {
> const struct iommu_ops *ops = iommu_get_ops();
> - return ops->setup_hpet_msi ? ops->setup_hpet_msi(msi) : 0;
> + return ops->setup_hpet_msi ? ops->setup_hpet_msi(msi) : -ENODEV;
> }
>
> void iommu_resume()
>
>
>
Acked, I will work on AMD part for HPET MSI remapping.
Thanks,
Wei
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-10-19 13:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-19 9:17 [PATCH] IOMMU: fail HPET MSI setup on AMD Jan Beulich
2012-10-19 13:27 ` Wei Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).