From: "Jan Beulich" Subject: [PATCH] adjust section annotations in pass-through code Date: Thu, 18 Nov 2010 16:42:41 +0000 Message-ID: <4CE565910200007800023115@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part072AA391.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part072AA391.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Most importantly, anything Dom0 construction related can be __init. Signed-off-by: Jan Beulich --- a/xen/drivers/passthrough/amd/pci_amd_iommu.c +++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c @@ -117,7 +117,7 @@ static void amd_iommu_setup_domain_devic spin_unlock_irqrestore(&iommu->lock, flags); } =20 -static void amd_iommu_setup_dom0_devices(struct domain *d) +static void __init amd_iommu_setup_dom0_devices(struct domain *d) { struct amd_iommu *iommu; struct pci_dev *pdev; @@ -232,7 +232,7 @@ static int amd_iommu_domain_init(struct=20 return 0; } =20 -static void amd_iommu_dom0_init(struct domain *d) +static void __init amd_iommu_dom0_init(struct domain *d) { unsigned long i;=20 =20 --- a/xen/drivers/passthrough/iommu.c +++ b/xen/drivers/passthrough/iommu.c @@ -40,7 +40,7 @@ static int iommu_populate_page_table(str custom_param("iommu", parse_iommu_param); bool_t __read_mostly iommu_enabled =3D 1; bool_t __read_mostly force_iommu; -bool_t __read_mostly iommu_dom0_strict; +bool_t __initdata iommu_dom0_strict; bool_t __read_mostly iommu_verbose; bool_t __read_mostly iommu_workaround_bios_bug; bool_t __read_mostly iommu_passthrough; @@ -102,7 +102,7 @@ int iommu_domain_init(struct domain *d) return hd->platform_ops->init(d); } =20 -void iommu_dom0_init(struct domain *d) +void __init iommu_dom0_init(struct domain *d) { struct hvm_iommu *hd =3D domain_hvm_iommu(d); =20 --- a/xen/drivers/passthrough/vtd/ia64/vtd.c +++ b/xen/drivers/passthrough/vtd/ia64/vtd.c @@ -92,8 +92,8 @@ void hvm_dpci_isairq_eoi(struct domain * /* dummy */ } =20 -static int do_dom0_iommu_mapping(unsigned long start, unsigned long end, - void *arg) +static int __init do_dom0_iommu_mapping(unsigned long start, + unsigned long end, void *arg) { unsigned long tmp, pfn, j, page_addr =3D start; struct domain *d =3D (struct domain *)arg; @@ -120,7 +120,7 @@ static int do_dom0_iommu_mapping(unsigne return 0; } =20 -void iommu_set_dom0_mapping(struct domain *d) +void __init iommu_set_dom0_mapping(struct domain *d) { if (dom0) BUG_ON(d !=3D dom0); --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -1231,7 +1231,7 @@ static int intel_iommu_domain_init(struc return 0; } =20 -static void intel_iommu_dom0_init(struct domain *d) +static void __init intel_iommu_dom0_init(struct domain *d) { struct acpi_drhd_unit *drhd; =20 @@ -1826,7 +1826,7 @@ static int intel_iommu_remove_device(str return domain_context_unmap(pdev->domain, pdev->bus, pdev->devfn); } =20 -static void setup_dom0_devices(struct domain *d) +static void __init setup_dom0_devices(struct domain *d) { struct pci_dev *pdev; int bus, devfn; @@ -1961,7 +1961,7 @@ static int init_vtd_hw(void) return 0; } =20 -static void setup_dom0_rmrr(struct domain *d) +static void __init setup_dom0_rmrr(struct domain *d) { struct acpi_rmrr_unit *rmrr; u16 bdf; --- a/xen/drivers/passthrough/vtd/x86/ats.c +++ b/xen/drivers/passthrough/vtd/x86/ats.c @@ -28,7 +28,7 @@ #include "../vtd.h" #include "../extern.h" =20 -LIST_HEAD(ats_dev_drhd_units); +static LIST_HEAD(ats_dev_drhd_units); =20 #define ATS_REG_CAP 4 #define ATS_REG_CTL 6 @@ -47,9 +47,9 @@ static LIST_HEAD(ats_devices); static void parse_ats_param(char *s); custom_param("ats", parse_ats_param); =20 -int ats_enabled =3D 1; +int __read_mostly ats_enabled =3D 1; =20 -static void parse_ats_param(char *s) +static void __init parse_ats_param(char *s) { char *ss; =20 --- a/xen/drivers/passthrough/vtd/x86/vtd.c +++ b/xen/drivers/passthrough/vtd/x86/vtd.c @@ -34,7 +34,7 @@ * iommu_inclusive_mapping: when set, all memory below 4GB is included in = dom0 * 1:1 iommu mappings except xen and unusable regions. */ -static int iommu_inclusive_mapping =3D 1; +static int __read_mostly iommu_inclusive_mapping =3D 1; boolean_param("iommu_inclusive_mapping", iommu_inclusive_mapping); =20 void *map_vtd_domain_page(u64 maddr) @@ -127,7 +127,7 @@ void hvm_dpci_isairq_eoi(struct domain * spin_unlock(&d->event_lock); } =20 -void iommu_set_dom0_mapping(struct domain *d) +void __init iommu_set_dom0_mapping(struct domain *d) { u64 i, j, tmp, max_pfn; extern int xen_in_range(unsigned long mfn); --=__Part072AA391.0__= Content-Type: text/plain; name="passthrough-sections.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="passthrough-sections.patch" Most importantly, anything Dom0 construction related can be __init.=0A=0ASi= gned-off-by: Jan Beulich =0A=0A--- a/xen/drivers/passt= hrough/amd/pci_amd_iommu.c=0A+++ b/xen/drivers/passthrough/amd/pci_amd_iomm= u.c=0A@@ -117,7 +117,7 @@ static void amd_iommu_setup_domain_devic=0A = spin_unlock_irqrestore(&iommu->lock, flags);=0A }=0A =0A-static void = amd_iommu_setup_dom0_devices(struct domain *d)=0A+static void __init = amd_iommu_setup_dom0_devices(struct domain *d)=0A {=0A struct = amd_iommu *iommu;=0A struct pci_dev *pdev;=0A@@ -232,7 +232,7 @@ = static int amd_iommu_domain_init(struct =0A return 0;=0A }=0A = =0A-static void amd_iommu_dom0_init(struct domain *d)=0A+static void = __init amd_iommu_dom0_init(struct domain *d)=0A {=0A unsigned long i; = =0A =0A--- a/xen/drivers/passthrough/iommu.c=0A+++ b/xen/drivers/passthroug= h/iommu.c=0A@@ -40,7 +40,7 @@ static int iommu_populate_page_table(str=0A = custom_param("iommu", parse_iommu_param);=0A bool_t __read_mostly = iommu_enabled =3D 1;=0A bool_t __read_mostly force_iommu;=0A-bool_t = __read_mostly iommu_dom0_strict;=0A+bool_t __initdata iommu_dom0_strict;=0A= bool_t __read_mostly iommu_verbose;=0A bool_t __read_mostly iommu_workarou= nd_bios_bug;=0A bool_t __read_mostly iommu_passthrough;=0A@@ -102,7 +102,7 = @@ int iommu_domain_init(struct domain *d)=0A return hd->platform_ops->= init(d);=0A }=0A =0A-void iommu_dom0_init(struct domain *d)=0A+void __init = iommu_dom0_init(struct domain *d)=0A {=0A struct hvm_iommu *hd =3D = domain_hvm_iommu(d);=0A =0A--- a/xen/drivers/passthrough/vtd/ia64/vtd.c=0A+= ++ b/xen/drivers/passthrough/vtd/ia64/vtd.c=0A@@ -92,8 +92,8 @@ void = hvm_dpci_isairq_eoi(struct domain *=0A /* dummy */=0A }=0A =0A-static = int do_dom0_iommu_mapping(unsigned long start, unsigned long end,=0A- = void *arg)=0A+static int __init do_dom0_iommu_mapping(unsig= ned long start,=0A+ unsigned long end, = void *arg)=0A {=0A unsigned long tmp, pfn, j, page_addr =3D start;=0A = struct domain *d =3D (struct domain *)arg;=0A@@ -120,7 +120,7 @@ static = int do_dom0_iommu_mapping(unsigne=0A return 0;=0A }=0A =0A-void = iommu_set_dom0_mapping(struct domain *d)=0A+void __init iommu_set_dom0_mapp= ing(struct domain *d)=0A {=0A if (dom0)=0A BUG_ON(d !=3D = dom0);=0A--- a/xen/drivers/passthrough/vtd/iommu.c=0A+++ b/xen/drivers/pass= through/vtd/iommu.c=0A@@ -1231,7 +1231,7 @@ static int intel_iommu_domain_i= nit(struc=0A return 0;=0A }=0A =0A-static void intel_iommu_dom0_init(st= ruct domain *d)=0A+static void __init intel_iommu_dom0_init(struct domain = *d)=0A {=0A struct acpi_drhd_unit *drhd;=0A =0A@@ -1826,7 +1826,7 @@ = static int intel_iommu_remove_device(str=0A return domain_context_unmap= (pdev->domain, pdev->bus, pdev->devfn);=0A }=0A =0A-static void setup_dom0_= devices(struct domain *d)=0A+static void __init setup_dom0_devices(struct = domain *d)=0A {=0A struct pci_dev *pdev;=0A int bus, devfn;=0A@@ = -1961,7 +1961,7 @@ static int init_vtd_hw(void)=0A return 0;=0A }=0A = =0A-static void setup_dom0_rmrr(struct domain *d)=0A+static void __init = setup_dom0_rmrr(struct domain *d)=0A {=0A struct acpi_rmrr_unit = *rmrr;=0A u16 bdf;=0A--- a/xen/drivers/passthrough/vtd/x86/ats.c=0A+++ = b/xen/drivers/passthrough/vtd/x86/ats.c=0A@@ -28,7 +28,7 @@=0A #include = "../vtd.h"=0A #include "../extern.h"=0A =0A-LIST_HEAD(ats_dev_drhd_units);= =0A+static LIST_HEAD(ats_dev_drhd_units);=0A =0A #define ATS_REG_CAP = 4=0A #define ATS_REG_CTL 6=0A@@ -47,9 +47,9 @@ static LIST_HEAD(ats_devi= ces);=0A static void parse_ats_param(char *s);=0A custom_param("ats", = parse_ats_param);=0A =0A-int ats_enabled =3D 1;=0A+int __read_mostly = ats_enabled =3D 1;=0A =0A-static void parse_ats_param(char *s)=0A+static = void __init parse_ats_param(char *s)=0A {=0A char *ss;=0A =0A--- = a/xen/drivers/passthrough/vtd/x86/vtd.c=0A+++ b/xen/drivers/passthrough/vtd= /x86/vtd.c=0A@@ -34,7 +34,7 @@=0A * iommu_inclusive_mapping: when set, = all memory below 4GB is included in dom0=0A * 1:1 iommu mappings except = xen and unusable regions.=0A */=0A-static int iommu_inclusive_mapping =3D = 1;=0A+static int __read_mostly iommu_inclusive_mapping =3D 1;=0A boolean_pa= ram("iommu_inclusive_mapping", iommu_inclusive_mapping);=0A =0A void = *map_vtd_domain_page(u64 maddr)=0A@@ -127,7 +127,7 @@ void hvm_dpci_isairq_= eoi(struct domain *=0A spin_unlock(&d->event_lock);=0A }=0A =0A-void = iommu_set_dom0_mapping(struct domain *d)=0A+void __init iommu_set_dom0_mapp= ing(struct domain *d)=0A {=0A u64 i, j, tmp, max_pfn;=0A extern = int xen_in_range(unsigned long mfn);=0A --=__Part072AA391.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__Part072AA391.0__=--