From: Wei Wang2 <wei.wang2@amd.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH 2/3] AMD IOMMU: add s3 suspend & resume support
Date: Fri, 3 Jul 2009 17:24:38 +0200 [thread overview]
Message-ID: <200907031724.38507.wei.wang2@amd.com> (raw)
[-- 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
reply other threads:[~2009-07-03 15:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=200907031724.38507.wei.wang2@amd.com \
--to=wei.wang2@amd.com \
--cc=xen-devel@lists.xensource.com \
/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.