From: "Jan Beulich" Subject: [PATCH 5/7] amd-iommu: __init-annotate Date: Thu, 31 Mar 2011 16:56:39 +0100 Message-ID: <4D94C05702000078000396C9@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part321EE627.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. --=__Part321EE627.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Besides marking a few more items __init/__initdata, use the recently introduced .init.o mechanism to move all the literal strings into .init.rodata in those files that consist of only contributions to .init.*. Signed-off-by: Jan Beulich --- a/xen/drivers/passthrough/amd/Makefile +++ b/xen/drivers/passthrough/amd/Makefile @@ -1,6 +1,6 @@ -obj-y +=3D iommu_detect.o +obj-bin-y +=3D iommu_detect.init.o obj-y +=3D iommu_init.o obj-y +=3D iommu_map.o obj-y +=3D pci_amd_iommu.o -obj-y +=3D iommu_acpi.o +obj-bin-y +=3D iommu_acpi.init.o obj-y +=3D iommu_intr.o --- a/xen/drivers/passthrough/amd/iommu_acpi.c +++ b/xen/drivers/passthrough/amd/iommu_acpi.c @@ -28,11 +28,12 @@ extern unsigned long amd_iommu_page_entries; extern unsigned short ivrs_bdf_entries; extern struct ivrs_mappings *ivrs_mappings; -extern unsigned short last_bdf; extern int ioapic_bdf[MAX_IO_APICS]; extern void *shared_intremap_table; =20 -static void add_ivrs_mapping_entry( +static unsigned short __initdata last_bdf; + +static void __init add_ivrs_mapping_entry( u16 bdf, u16 alias_id, u8 flags, struct amd_iommu *iommu) { u8 sys_mgt, lint1_pass, lint0_pass, nmi_pass, ext_int_pass, init_pass;= --- a/xen/drivers/passthrough/amd/iommu_detect.c +++ b/xen/drivers/passthrough/amd/iommu_detect.c @@ -27,8 +27,6 @@ #include #include =20 -unsigned short last_bdf =3D 0; - static int __init get_iommu_msi_capabilities(u8 bus, u8 dev, u8 func, struct amd_iommu *iommu) { --- a/xen/drivers/passthrough/amd/iommu_init.c +++ b/xen/drivers/passthrough/amd/iommu_init.c @@ -28,10 +28,8 @@ #include #include =20 -static struct amd_iommu **irq_to_iommu; -static int nr_amd_iommus; -static long amd_iommu_cmd_buffer_entries =3D IOMMU_CMD_BUFFER_DEFAULT_ENTR= IES; -static long amd_iommu_event_log_entries =3D IOMMU_EVENT_LOG_DEFAULT_ENTRIE= S; +static struct amd_iommu **__read_mostly irq_to_iommu; +static int __initdata nr_amd_iommus; =20 unsigned short ivrs_bdf_entries; struct ivrs_mappings *ivrs_mappings; @@ -629,8 +627,8 @@ static int __init allocate_cmd_buffer(st iommu->cmd_buffer_tail =3D 0; iommu->cmd_buffer.alloc_size =3D PAGE_SIZE << get_order_from_bytes( - PAGE_ALIGN(amd_iommu_cmd_buffer_entries= * - IOMMU_CMD_BUFFER_ENTRY_SIZE)); + PAGE_ALIGN(IOMMU_CMD_BUFFER_DEFAULT_ENT= RIES + * IOMMU_CMD_BUFFER_ENTRY_SIZ= E)); iommu->cmd_buffer.entries =3D iommu->cmd_buffer.alloc_size / IOMMU_CMD_BUFFER_ENTRY_SIZE; =20 @@ -643,7 +641,7 @@ static int __init allocate_event_log(str iommu->event_log_head =3D 0; iommu->event_log.alloc_size =3D PAGE_SIZE << get_order_from_bytes( - PAGE_ALIGN(amd_iommu_event_log_entries = * + PAGE_ALIGN(IOMMU_EVENT_LOG_DEFAULT_ENTRI= ES * IOMMU_EVENT_LOG_ENTRY_SIZE)); iommu->event_log.entries =3D iommu->event_log.alloc_size / IOMMU_EVENT_LOG_ENTRY_SIZE; --=__Part321EE627.0__= Content-Type: text/plain; name="amd-iommu-init.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="amd-iommu-init.patch" Besides marking a few more items __init/__initdata, use the recently=0Aintr= oduced .init.o mechanism to move all the literal strings into=0A.init.rodat= a in those files that consist of only contributions to=0A.init.*.=0A=0ASign= ed-off-by: Jan Beulich =0A=0A--- a/xen/drivers/passthr= ough/amd/Makefile=0A+++ b/xen/drivers/passthrough/amd/Makefile=0A@@ -1,6 = +1,6 @@=0A-obj-y +=3D iommu_detect.o=0A+obj-bin-y +=3D iommu_detect.init.o= =0A obj-y +=3D iommu_init.o=0A obj-y +=3D iommu_map.o=0A obj-y +=3D = pci_amd_iommu.o=0A-obj-y +=3D iommu_acpi.o=0A+obj-bin-y +=3D iommu_acpi.ini= t.o=0A obj-y +=3D iommu_intr.o=0A--- a/xen/drivers/passthrough/amd/iommu_ac= pi.c=0A+++ b/xen/drivers/passthrough/amd/iommu_acpi.c=0A@@ -28,11 +28,12 = @@=0A extern unsigned long amd_iommu_page_entries;=0A extern unsigned = short ivrs_bdf_entries;=0A extern struct ivrs_mappings *ivrs_mappings;=0A-e= xtern unsigned short last_bdf;=0A extern int ioapic_bdf[MAX_IO_APICS];=0A = extern void *shared_intremap_table;=0A =0A-static void add_ivrs_mapping_ent= ry(=0A+static unsigned short __initdata last_bdf;=0A+=0A+static void = __init add_ivrs_mapping_entry(=0A u16 bdf, u16 alias_id, u8 flags, = struct amd_iommu *iommu)=0A {=0A u8 sys_mgt, lint1_pass, lint0_pass, = nmi_pass, ext_int_pass, init_pass;=0A--- a/xen/drivers/passthrough/amd/iomm= u_detect.c=0A+++ b/xen/drivers/passthrough/amd/iommu_detect.c=0A@@ -27,8 = +27,6 @@=0A #include =0A #include =0A =0A-unsigned short last_bdf =3D 0;=0A-=0A static = int __init get_iommu_msi_capabilities(u8 bus, u8 dev, u8 func,=0A = struct amd_iommu *iommu)=0A {=0A--- a/xen/drivers/passthrough/amd/iommu_= init.c=0A+++ b/xen/drivers/passthrough/amd/iommu_init.c=0A@@ -28,10 +28,8 = @@=0A #include =0A #include =0A =0A-static = struct amd_iommu **irq_to_iommu;=0A-static int nr_amd_iommus;=0A-static = long amd_iommu_cmd_buffer_entries =3D IOMMU_CMD_BUFFER_DEFAULT_ENTRIES;=0A-= static long amd_iommu_event_log_entries =3D IOMMU_EVENT_LOG_DEFAULT_ENTRIES= ;=0A+static struct amd_iommu **__read_mostly irq_to_iommu;=0A+static int = __initdata nr_amd_iommus;=0A =0A unsigned short ivrs_bdf_entries;=0A = struct ivrs_mappings *ivrs_mappings;=0A@@ -629,8 +627,8 @@ static int = __init allocate_cmd_buffer(st=0A iommu->cmd_buffer_tail =3D 0;=0A = iommu->cmd_buffer.alloc_size =3D PAGE_SIZE <<=0A = get_order_from_bytes(=0A- = PAGE_ALIGN(amd_iommu_cmd_buffer_entries *=0A- = IOMMU_CMD_BUFFER_ENTRY_SIZE));=0A+ = PAGE_ALIGN(IOMMU_CMD_BUFFER_DEFAULT_ENTRIES=0A+ = * IOMMU_CMD_BUFFER_ENTRY_SIZE));=0A iommu->cmd_buffer= .entries =3D iommu->cmd_buffer.alloc_size /=0A = IOMMU_CMD_BUFFER_ENTRY_SIZE;=0A =0A@@ -643,7 +641,7 @@ static int = __init allocate_event_log(str=0A iommu->event_log_head =3D 0;=0A = iommu->event_log.alloc_size =3D PAGE_SIZE <<=0A = get_order_from_bytes(=0A- = PAGE_ALIGN(amd_iommu_event_log_entries *=0A+ = PAGE_ALIGN(IOMMU_EVENT_LOG_DEFAULT_ENTRIES *=0A = IOMMU_EVENT_LOG_ENTRY_SIZE));=0A iommu->event_log.entries = =3D iommu->event_log.alloc_size /=0A = IOMMU_EVENT_LOG_ENTRY_SIZE;=0A --=__Part321EE627.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 --=__Part321EE627.0__=--