From: "Jan Beulich" Subject: [PATCH 03/11] VT-d: section adjustments to DMAR parsing code Date: Wed, 09 Mar 2011 12:25:55 +0000 Message-ID: <4D777FE30200007800035812@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartE0CCD7C3.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. --=__PartE0CCD7C3.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Move whatever possible into .init.*, and some data items into .data.read_mostly. Signed-off-by: Jan Beulich --- 2011-01-17.orig/xen/drivers/passthrough/vtd/dmar.c +++ 2011-01-17/xen/drivers/passthrough/vtd/dmar.c @@ -41,13 +41,12 @@ #define MIN_SCOPE_LEN (sizeof(struct acpi_pci_path) + \ sizeof(struct acpi_dev_scope)) =20 -LIST_HEAD(acpi_drhd_units); -LIST_HEAD(acpi_rmrr_units); -LIST_HEAD(acpi_atsr_units); -LIST_HEAD(acpi_rhsa_units); +LIST_HEAD_READ_MOSTLY(acpi_drhd_units); +LIST_HEAD_READ_MOSTLY(acpi_rmrr_units); +static LIST_HEAD_READ_MOSTLY(acpi_atsr_units); +static LIST_HEAD_READ_MOSTLY(acpi_rhsa_units); =20 -static u64 igd_drhd_address; -u8 dmar_host_address_width; +static u64 __read_mostly igd_drhd_address; =20 void dmar_scope_add_buses(struct dmar_scope *scope, u16 sec_bus, u16 = sub_bus) { @@ -679,6 +678,7 @@ static int __init acpi_parse_dmar(struct { struct acpi_table_dmar *dmar; struct acpi_dmar_entry_header *entry_header; + u8 dmar_host_address_width; int ret =3D 0; =20 dmar =3D (struct acpi_table_dmar *)table; --- 2011-01-17.orig/xen/drivers/passthrough/vtd/dmar.h +++ 2011-01-17/xen/drivers/passthrough/vtd/dmar.h @@ -24,8 +24,6 @@ #include #include =20 -extern u8 dmar_host_address_width; - /* This one is for interrupt remapping */ struct acpi_ioapic_unit { struct list_head list; --- 2011-01-17.orig/xen/include/xen/list.h +++ 2011-01-17/xen/include/xen/list.h @@ -36,6 +36,9 @@ struct list_head { #define LIST_HEAD(name) \ struct list_head name =3D LIST_HEAD_INIT(name) =20 +#define LIST_HEAD_READ_MOSTLY(name) \ + struct list_head __read_mostly name =3D LIST_HEAD_INIT(name) + static inline void INIT_LIST_HEAD(struct list_head *list) { list->next =3D list; --=__PartE0CCD7C3.0__= Content-Type: text/plain; name="vtd-dmar-sections.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="vtd-dmar-sections.patch" Move whatever possible into .init.*, and some data items into=0A.data.read_= mostly.=0A=0ASigned-off-by: Jan Beulich =0A=0A--- = 2011-01-17.orig/xen/drivers/passthrough/vtd/dmar.c=0A+++ 2011-01-17/xen/dri= vers/passthrough/vtd/dmar.c=0A@@ -41,13 +41,12 @@=0A #define MIN_SCOPE_LEN = (sizeof(struct acpi_pci_path) + \=0A sizeof(struct = acpi_dev_scope))=0A =0A-LIST_HEAD(acpi_drhd_units);=0A-LIST_HEAD(acpi_rmrr_= units);=0A-LIST_HEAD(acpi_atsr_units);=0A-LIST_HEAD(acpi_rhsa_units);=0A+LI= ST_HEAD_READ_MOSTLY(acpi_drhd_units);=0A+LIST_HEAD_READ_MOSTLY(acpi_rmrr_un= its);=0A+static LIST_HEAD_READ_MOSTLY(acpi_atsr_units);=0A+static = LIST_HEAD_READ_MOSTLY(acpi_rhsa_units);=0A =0A-static u64 igd_drhd_address;= =0A-u8 dmar_host_address_width;=0A+static u64 __read_mostly igd_drhd_addres= s;=0A =0A void dmar_scope_add_buses(struct dmar_scope *scope, u16 sec_bus, = u16 sub_bus)=0A {=0A@@ -679,6 +678,7 @@ static int __init acpi_parse_dmar(s= truct=0A {=0A struct acpi_table_dmar *dmar;=0A struct acpi_dmar_ent= ry_header *entry_header;=0A+ u8 dmar_host_address_width;=0A int ret = =3D 0;=0A =0A dmar =3D (struct acpi_table_dmar *)table;=0A--- = 2011-01-17.orig/xen/drivers/passthrough/vtd/dmar.h=0A+++ 2011-01-17/xen/dri= vers/passthrough/vtd/dmar.h=0A@@ -24,8 +24,6 @@=0A #include =0A= #include =0A =0A-extern u8 dmar_host_address_width;=0A-=0A = /* This one is for interrupt remapping */=0A struct acpi_ioapic_unit {=0A = struct list_head list;=0A--- 2011-01-17.orig/xen/include/xen/list.h=0A++= + 2011-01-17/xen/include/xen/list.h=0A@@ -36,6 +36,9 @@ struct list_head = {=0A #define LIST_HEAD(name) \=0A struct list_head name =3D LIST_HEAD_I= NIT(name)=0A =0A+#define LIST_HEAD_READ_MOSTLY(name) \=0A+ struct = list_head __read_mostly name =3D LIST_HEAD_INIT(name)=0A+=0A static inline = void INIT_LIST_HEAD(struct list_head *list)=0A {=0A list->next =3D = list;=0A --=__PartE0CCD7C3.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 --=__PartE0CCD7C3.0__=--