xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@novell.com>
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: [PATCH 5/7] amd-iommu: __init-annotate
Date: Thu, 31 Mar 2011 16:56:39 +0100	[thread overview]
Message-ID: <4D94C05702000078000396C9@vpn.id2.novell.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3360 bytes --]

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 <jbeulich@novell.com>

--- a/xen/drivers/passthrough/amd/Makefile
+++ b/xen/drivers/passthrough/amd/Makefile
@@ -1,6 +1,6 @@
-obj-y += iommu_detect.o
+obj-bin-y += iommu_detect.init.o
 obj-y += iommu_init.o
 obj-y += iommu_map.o
 obj-y += pci_amd_iommu.o
-obj-y += iommu_acpi.o
+obj-bin-y += iommu_acpi.init.o
 obj-y += 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;
 
-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 <asm/hvm/svm/amd-iommu-proto.h>
 #include <asm/hvm/svm/amd-iommu-acpi.h>
 
-unsigned short last_bdf = 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 <asm-x86/fixmap.h>
 #include <mach_apic.h>
 
-static struct amd_iommu **irq_to_iommu;
-static int nr_amd_iommus;
-static long amd_iommu_cmd_buffer_entries = IOMMU_CMD_BUFFER_DEFAULT_ENTRIES;
-static long amd_iommu_event_log_entries = IOMMU_EVENT_LOG_DEFAULT_ENTRIES;
+static struct amd_iommu **__read_mostly irq_to_iommu;
+static int __initdata nr_amd_iommus;
 
 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 = 0;
     iommu->cmd_buffer.alloc_size = PAGE_SIZE <<
                                    get_order_from_bytes(
-                                   PAGE_ALIGN(amd_iommu_cmd_buffer_entries *
-                                   IOMMU_CMD_BUFFER_ENTRY_SIZE));
+                                   PAGE_ALIGN(IOMMU_CMD_BUFFER_DEFAULT_ENTRIES
+                                              * IOMMU_CMD_BUFFER_ENTRY_SIZE));
     iommu->cmd_buffer.entries = iommu->cmd_buffer.alloc_size /
                                 IOMMU_CMD_BUFFER_ENTRY_SIZE;
 
@@ -643,7 +641,7 @@ static int __init allocate_event_log(str
     iommu->event_log_head = 0;
     iommu->event_log.alloc_size = PAGE_SIZE <<
                                   get_order_from_bytes(
-                                  PAGE_ALIGN(amd_iommu_event_log_entries *
+                                  PAGE_ALIGN(IOMMU_EVENT_LOG_DEFAULT_ENTRIES *
                                   IOMMU_EVENT_LOG_ENTRY_SIZE));
     iommu->event_log.entries = iommu->event_log.alloc_size /
                                IOMMU_EVENT_LOG_ENTRY_SIZE;




[-- Attachment #2: amd-iommu-init.patch --]
[-- Type: text/plain, Size: 3354 bytes --]

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 <jbeulich@novell.com>

--- a/xen/drivers/passthrough/amd/Makefile
+++ b/xen/drivers/passthrough/amd/Makefile
@@ -1,6 +1,6 @@
-obj-y += iommu_detect.o
+obj-bin-y += iommu_detect.init.o
 obj-y += iommu_init.o
 obj-y += iommu_map.o
 obj-y += pci_amd_iommu.o
-obj-y += iommu_acpi.o
+obj-bin-y += iommu_acpi.init.o
 obj-y += 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;
 
-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 <asm/hvm/svm/amd-iommu-proto.h>
 #include <asm/hvm/svm/amd-iommu-acpi.h>
 
-unsigned short last_bdf = 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 <asm-x86/fixmap.h>
 #include <mach_apic.h>
 
-static struct amd_iommu **irq_to_iommu;
-static int nr_amd_iommus;
-static long amd_iommu_cmd_buffer_entries = IOMMU_CMD_BUFFER_DEFAULT_ENTRIES;
-static long amd_iommu_event_log_entries = IOMMU_EVENT_LOG_DEFAULT_ENTRIES;
+static struct amd_iommu **__read_mostly irq_to_iommu;
+static int __initdata nr_amd_iommus;
 
 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 = 0;
     iommu->cmd_buffer.alloc_size = PAGE_SIZE <<
                                    get_order_from_bytes(
-                                   PAGE_ALIGN(amd_iommu_cmd_buffer_entries *
-                                   IOMMU_CMD_BUFFER_ENTRY_SIZE));
+                                   PAGE_ALIGN(IOMMU_CMD_BUFFER_DEFAULT_ENTRIES
+                                              * IOMMU_CMD_BUFFER_ENTRY_SIZE));
     iommu->cmd_buffer.entries = iommu->cmd_buffer.alloc_size /
                                 IOMMU_CMD_BUFFER_ENTRY_SIZE;
 
@@ -643,7 +641,7 @@ static int __init allocate_event_log(str
     iommu->event_log_head = 0;
     iommu->event_log.alloc_size = PAGE_SIZE <<
                                   get_order_from_bytes(
-                                  PAGE_ALIGN(amd_iommu_event_log_entries *
+                                  PAGE_ALIGN(IOMMU_EVENT_LOG_DEFAULT_ENTRIES *
                                   IOMMU_EVENT_LOG_ENTRY_SIZE));
     iommu->event_log.entries = iommu->event_log.alloc_size /
                                IOMMU_EVENT_LOG_ENTRY_SIZE;

[-- 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:[~2011-03-31 15:56 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=4D94C05702000078000396C9@vpn.id2.novell.com \
    --to=jbeulich@novell.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 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).