* [PATCH 2/3] AMD IOMMU: add s3 suspend & resume support
@ 2009-07-03 15:24 Wei Wang2
0 siblings, 0 replies; only message in thread
From: Wei Wang2 @ 2009-07-03 15:24 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 435 bytes --]
Make iommu suspend & resume functions more generic.
Signed-off-by: Wei Wang <wei.wang2@amd.com>
--
AMD GmbH, Germany
Operating System Research Center
Legal Information:
Advanced Micro Devices GmbH
Karl-Hammerschmidt-Str. 34
85609 Dornach b. München
Geschäftsführer: Jochen Polster, Thomas M. McCoy, Giuliano Meroni
Sitz: Dornach, Gemeinde Aschheim, Landkreis München
Registergericht München, HRB Nr. 43632
[-- Attachment #2: interface.patch --]
[-- Type: text/x-diff, Size: 3181 bytes --]
diff -r bc8387fa4b27 xen/drivers/passthrough/amd/pci_amd_iommu.c
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c Thu Jul 02 16:02:11 2009 +0200
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c Fri Jul 03 16:25:50 2009 +0200
@@ -441,4 +441,6 @@ struct iommu_ops amd_iommu_ops = {
.update_ire_from_msi = amd_iommu_msi_msg_update_ire,
.read_apic_from_ire = amd_iommu_read_ioapic_from_ire,
.read_msi_from_ire = amd_iommu_read_msi_from_ire,
+ .suspend = amd_iommu_suspend,
+ .resume = amd_iommu_resume,
};
diff -r bc8387fa4b27 xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c Thu Jul 02 16:02:11 2009 +0200
+++ b/xen/drivers/passthrough/iommu.c Fri Jul 03 16:25:50 2009 +0200
@@ -346,6 +346,20 @@ unsigned int iommu_read_apic_from_ire(un
return ops->read_apic_from_ire(apic, reg);
}
+void iommu_resume()
+{
+ struct iommu_ops *ops = iommu_get_ops();
+ if ( iommu_enabled )
+ ops->resume();
+}
+
+void iommu_suspend()
+{
+ struct iommu_ops *ops = iommu_get_ops();
+ if ( iommu_enabled )
+ ops->suspend();
+}
+
/*
* Local variables:
* mode: C
diff -r bc8387fa4b27 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c Thu Jul 02 16:02:11 2009 +0200
+++ b/xen/drivers/passthrough/vtd/iommu.c Fri Jul 03 16:25:50 2009 +0200
@@ -1852,7 +1852,7 @@ static int intel_iommu_group_id(u8 bus,
}
static u32 iommu_state[MAX_IOMMUS][MAX_IOMMU_REGS];
-void iommu_suspend(void)
+void vtd_suspend(void)
{
struct acpi_drhd_unit *drhd;
struct iommu *iommu;
@@ -1891,7 +1891,7 @@ void iommu_suspend(void)
}
}
-void iommu_resume(void)
+void vtd_resume(void)
{
struct acpi_drhd_unit *drhd;
struct iommu *iommu;
@@ -1938,6 +1938,8 @@ struct iommu_ops intel_iommu_ops = {
.update_ire_from_msi = msi_msg_write_remap_rte,
.read_apic_from_ire = io_apic_read_remap_rte,
.read_msi_from_ire = msi_msg_read_remap_rte,
+ .suspend = vtd_suspend,
+ .resume = vtd_resume,
};
/*
diff -r bc8387fa4b27 xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h Thu Jul 02 16:02:11 2009 +0200
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h Fri Jul 03 16:25:50 2009 +0200
@@ -92,6 +92,10 @@ unsigned int amd_iommu_read_ioapic_from_
unsigned int amd_iommu_read_ioapic_from_ire(
unsigned int apic, unsigned int reg);
+/* power management support */
+void amd_iommu_resume(void);
+void amd_iommu_suspend(void);
+
static inline u32 get_field_from_reg_u32(u32 reg_value, u32 mask, u32 shift)
{
u32 field;
diff -r bc8387fa4b27 xen/include/xen/iommu.h
--- a/xen/include/xen/iommu.h Thu Jul 02 16:02:11 2009 +0200
+++ b/xen/include/xen/iommu.h Fri Jul 03 16:25:50 2009 +0200
@@ -109,6 +109,8 @@ struct iommu_ops {
void (*update_ire_from_msi)(struct msi_desc *msi_desc, struct msi_msg *msg);
void (*read_msi_from_ire)(struct msi_desc *msi_desc, struct msi_msg *msg);
unsigned int (*read_apic_from_ire)(unsigned int apic, unsigned int reg);
+ void (*suspend)(void);
+ void (*resume)(void);
};
void iommu_update_ire_from_apic(unsigned int apic, unsigned int reg, unsigned int value);
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-07-03 15:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-03 15:24 [PATCH 2/3] AMD IOMMU: add s3 suspend & resume support Wei Wang2
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.