From: "Jan Beulich" Subject: [PATCH] miscellaneous data placement adjustments Date: Tue, 27 Oct 2009 11:52:01 +0000 Message-ID: <4AE6ECF1020000780001C2EC@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline 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 Make various data items const or __read_mostly where possible/reasonable. Signed-off-by: Jan Beulich --- 2009-10-27.orig/xen/arch/ia64/linux-xen/acpi.c 2009-05-27 = 13:54:05.000000000 +0200 +++ 2009-10-27/xen/arch/ia64/linux-xen/acpi.c 2009-10-27 12:07:32.0000000= 00 +0100 @@ -66,9 +66,9 @@ extern u8 numa_slit[MAX_NUMNODES * MAX_N =20 #define PREFIX "ACPI: " =20 -void (*pm_idle) (void); +void (*pm_idle) (void) __read_mostly; EXPORT_SYMBOL(pm_idle); -void (*pm_power_off) (void); +void (*pm_power_off) (void) __read_mostly; EXPORT_SYMBOL(pm_power_off); =20 unsigned int acpi_cpei_override; --- 2009-10-27.orig/xen/arch/ia64/linux-xen/numa.c 2006-10-30 = 12:07:18.000000000 +0100 +++ 2009-10-27/xen/arch/ia64/linux-xen/numa.c 2009-10-27 12:07:32.0000000= 00 +0100 @@ -32,7 +32,7 @@ #endif =20 #ifdef XEN -nodemask_t node_online_map =3D { { [0] =3D 1UL } }; +nodemask_t __read_mostly node_online_map =3D { { [0] =3D 1UL } }; #endif =20 u8 cpu_to_node_map[NR_CPUS] __cacheline_aligned; --- 2009-10-27.orig/xen/arch/x86/domain.c 2009-10-22 08:18:54.0000000= 00 +0200 +++ 2009-10-27/xen/arch/x86/domain.c 2009-10-27 12:07:32.000000000 = +0100 @@ -61,8 +61,8 @@ DEFINE_PER_CPU(unsigned long, cr4); =20 static void default_idle(void); static void default_dead_idle(void); -void (*pm_idle) (void) =3D default_idle; -void (*dead_idle) (void) =3D default_dead_idle; +void (*pm_idle) (void) __read_mostly =3D default_idle; +void (*dead_idle) (void) __read_mostly =3D default_dead_idle; =20 static void paravirt_ctxt_switch_from(struct vcpu *v); static void paravirt_ctxt_switch_to(struct vcpu *v); --- 2009-10-27.orig/xen/arch/x86/genapic/bigsmp.c 2007-08-07 = 15:00:27.000000000 +0200 +++ 2009-10-27/xen/arch/x86/genapic/bigsmp.c 2009-10-27 12:07:32.0000000= 00 +0100 @@ -48,7 +48,7 @@ static __init int probe_bigsmp(void) return dmi_bigsmp; }=20 =20 -struct genapic apic_bigsmp =3D { +const struct genapic apic_bigsmp =3D { APIC_INIT("bigsmp", probe_bigsmp), GENAPIC_PHYS }; --- 2009-10-27.orig/xen/arch/x86/genapic/default.c 2006-04-05 = 09:50:16.000000000 +0200 +++ 2009-10-27/xen/arch/x86/genapic/default.c 2009-10-27 12:07:32.0000000= 00 +0100 @@ -20,7 +20,7 @@ static __init int probe_default(void) return 1; }=20 =20 -struct genapic apic_default =3D { +const struct genapic apic_default =3D { APIC_INIT("default", probe_default), GENAPIC_FLAT }; --- 2009-10-27.orig/xen/arch/x86/genapic/probe.c 2009-10-07 = 13:31:36.000000000 +0200 +++ 2009-10-27/xen/arch/x86/genapic/probe.c 2009-10-27 12:09:01.0000000= 00 +0100 @@ -9,19 +9,20 @@ #include #include #include +#include #include #include #include #include #include =20 -extern struct genapic apic_summit; -extern struct genapic apic_bigsmp; -extern struct genapic apic_default; +extern const struct genapic apic_summit; +extern const struct genapic apic_bigsmp; +extern const struct genapic apic_default; =20 -struct genapic *genapic; +const struct genapic *__read_mostly genapic; =20 -struct genapic *apic_probe[] __initdata =3D {=20 +const struct genapic *apic_probe[] __initdata =3D { &apic_summit, &apic_bigsmp,=20 &apic_default, /* must be last */ --- 2009-10-27.orig/xen/arch/x86/genapic/summit.c 2006-04-05 = 09:50:16.000000000 +0200 +++ 2009-10-27/xen/arch/x86/genapic/summit.c 2009-10-27 12:07:32.0000000= 00 +0100 @@ -20,7 +20,7 @@ static __init int probe_summit(void) return 0; }=20 =20 -struct genapic apic_summit =3D { +const struct genapic apic_summit =3D { APIC_INIT("summit", probe_summit), GENAPIC_PHYS }; --- 2009-10-27.orig/xen/arch/x86/genapic/x2apic.c 2009-10-01 = 10:53:02.000000000 +0200 +++ 2009-10-27/xen/arch/x86/genapic/x2apic.c 2009-10-27 12:07:32.0000000= 00 +0100 @@ -23,10 +23,10 @@ #include #include =20 -static int x2apic =3D 1; +static int __initdata x2apic =3D 1; boolean_param("x2apic", x2apic); =20 -static int x2apic_phys =3D 0; /* By default we use logical cluster mode. = */ +static int __initdata x2apic_phys; /* By default we use logical cluster = mode. */ boolean_param("x2apic_phys", x2apic_phys); =20 static int __init probe_x2apic_phys(void) @@ -41,12 +41,12 @@ static int __init probe_x2apic_cluster(v iommu_supports_eim(); } =20 -struct genapic apic_x2apic_phys=3D { +const struct genapic apic_x2apic_phys =3D { APIC_INIT("x2apic_phys", probe_x2apic_phys), GENAPIC_X2APIC_PHYS }; =20 -struct genapic apic_x2apic_cluster=3D { +const struct genapic apic_x2apic_cluster =3D { APIC_INIT("x2apic_cluster", probe_x2apic_cluster), GENAPIC_X2APIC_CLUSTER }; --- 2009-10-27.orig/xen/arch/x86/hvm/emulate.c 2009-10-07 13:31:36.0000000= 00 +0200 +++ 2009-10-27/xen/arch/x86/hvm/emulate.c 2009-10-27 12:07:32.0000000= 00 +0100 @@ -929,7 +929,7 @@ static int hvmemul_invlpg( return rc; } =20 -static struct x86_emulate_ops hvm_emulate_ops =3D { +static const struct x86_emulate_ops hvm_emulate_ops =3D { .read =3D hvmemul_read, .insn_fetch =3D hvmemul_insn_fetch, .write =3D hvmemul_write, --- 2009-10-27.orig/xen/arch/x86/hvm/hpet.c 2009-07-10 08:51:30.0000000= 00 +0200 +++ 2009-10-27/xen/arch/x86/hvm/hpet.c 2009-10-27 12:07:32.000000000 = +0100 @@ -485,7 +485,7 @@ static int hpet_range(struct vcpu *v, un (addr < (HPET_BASE_ADDRESS + HPET_MMAP_SIZE))); } =20 -struct hvm_mmio_handler hpet_mmio_handler =3D { +const struct hvm_mmio_handler hpet_mmio_handler =3D { .check_handler =3D hpet_range, .read_handler =3D hpet_read, .write_handler =3D hpet_write --- 2009-10-27.orig/xen/arch/x86/hvm/intercept.c 2009-04-09 = 14:05:35.000000000 +0200 +++ 2009-10-27/xen/arch/x86/hvm/intercept.c 2009-10-27 12:07:32.0000000= 00 +0100 @@ -32,14 +32,15 @@ #include #include =20 -extern struct hvm_mmio_handler hpet_mmio_handler; -extern struct hvm_mmio_handler vlapic_mmio_handler; -extern struct hvm_mmio_handler vioapic_mmio_handler; -extern struct hvm_mmio_handler msixtbl_mmio_handler; +extern const struct hvm_mmio_handler hpet_mmio_handler; +extern const struct hvm_mmio_handler vlapic_mmio_handler; +extern const struct hvm_mmio_handler vioapic_mmio_handler; +extern const struct hvm_mmio_handler msixtbl_mmio_handler; =20 #define HVM_MMIO_HANDLER_NR 4 =20 -static struct hvm_mmio_handler *hvm_mmio_handlers[HVM_MMIO_HANDLER_NR] = =3D +static const struct hvm_mmio_handler *const +hvm_mmio_handlers[HVM_MMIO_HANDLER_NR] =3D { &hpet_mmio_handler, &vlapic_mmio_handler, --- 2009-10-27.orig/xen/arch/x86/hvm/quirks.c 2009-06-29 11:58:15.0000000= 00 +0200 +++ 2009-10-27/xen/arch/x86/hvm/quirks.c 2009-10-27 12:07:32.0000000= 00 +0100 @@ -23,7 +23,7 @@ #include #include =20 -int hvm_port80_allowed =3D -1; +int __read_mostly hvm_port80_allowed =3D -1; boolean_param("hvm_port80", hvm_port80_allowed); =20 static int __init dmi_hvm_deny_port80(/*const*/ struct dmi_system_id *id) --- 2009-10-27.orig/xen/arch/x86/hvm/svm/svm.c 2009-10-26 14:42:47.0000000= 00 +0100 +++ 2009-10-27/xen/arch/x86/hvm/svm/svm.c 2009-10-27 12:07:32.0000000= 00 +0100 @@ -1233,7 +1233,7 @@ static void svm_invlpg_intercept(unsigne svm_asid_g_invlpg(curr, vaddr); } =20 -static struct hvm_function_table svm_function_table =3D { +static struct hvm_function_table __read_mostly svm_function_table =3D { .name =3D "SVM", .cpu_down =3D svm_cpu_down, .domain_initialise =3D svm_domain_initialise, --- 2009-10-27.orig/xen/arch/x86/hvm/vioapic.c 2009-09-21 08:39:42.0000000= 00 +0200 +++ 2009-10-27/xen/arch/x86/hvm/vioapic.c 2009-10-27 12:07:32.0000000= 00 +0100 @@ -246,7 +246,7 @@ static int vioapic_range(struct vcpu *v, (addr < vioapic->base_address + VIOAPIC_MEM_LENGTH))); } =20 -struct hvm_mmio_handler vioapic_mmio_handler =3D { +const struct hvm_mmio_handler vioapic_mmio_handler =3D { .check_handler =3D vioapic_range, .read_handler =3D vioapic_read, .write_handler =3D vioapic_write --- 2009-10-27.orig/xen/arch/x86/hvm/vlapic.c 2009-10-01 10:53:02.0000000= 00 +0200 +++ 2009-10-27/xen/arch/x86/hvm/vlapic.c 2009-10-27 12:07:32.0000000= 00 +0100 @@ -713,7 +713,7 @@ static int vlapic_range(struct vcpu *v,=20 return (!vlapic_hw_disabled(vlapic) && (offset < PAGE_SIZE)); } =20 -struct hvm_mmio_handler vlapic_mmio_handler =3D { +const struct hvm_mmio_handler vlapic_mmio_handler =3D { .check_handler =3D vlapic_range, .read_handler =3D vlapic_read, .write_handler =3D vlapic_write --- 2009-10-27.orig/xen/arch/x86/hvm/vmsi.c 2009-10-22 08:18:54.0000000= 00 +0200 +++ 2009-10-27/xen/arch/x86/hvm/vmsi.c 2009-10-27 12:07:32.000000000 = +0100 @@ -290,7 +290,7 @@ static int msixtbl_range(struct vcpu *v, return !!virt; } =20 -struct hvm_mmio_handler msixtbl_mmio_handler =3D { +const struct hvm_mmio_handler msixtbl_mmio_handler =3D { .check_handler =3D msixtbl_range, .read_handler =3D msixtbl_read, .write_handler =3D msixtbl_write --- 2009-10-27.orig/xen/arch/x86/hvm/vmx/vmcs.c 2009-10-01 10:53:02.0000000= 00 +0200 +++ 2009-10-27/xen/arch/x86/hvm/vmx/vmcs.c 2009-10-27 12:07:32.0000000= 00 +0100 @@ -38,10 +38,10 @@ #include #include =20 -static int opt_vpid_enabled =3D 1; +static int __read_mostly opt_vpid_enabled =3D 1; boolean_param("vpid", opt_vpid_enabled); =20 -static int opt_unrestricted_guest_enabled =3D 1; +static int __read_mostly opt_unrestricted_guest_enabled =3D 1; boolean_param("unrestricted_guest", opt_unrestricted_guest_enabled); =20 /* @@ -53,9 +53,9 @@ boolean_param("unrestricted_guest", opt_ * Time is measured based on a counter that runs at the same rate as the = TSC, * refer SDM volume 3b section 21.6.13 & 22.1.3. */ -static unsigned int ple_gap =3D 41; +static unsigned int __read_mostly ple_gap =3D 41; integer_param("ple_gap", ple_gap); -static unsigned int ple_window =3D 4096; +static unsigned int __read_mostly ple_window =3D 4096; integer_param("ple_window", ple_window); =20 /* Dynamic (run-time adjusted) execution control flags. */ --- 2009-10-27.orig/xen/arch/x86/hvm/vmx/vmx.c 2009-10-26 14:42:47.0000000= 00 +0100 +++ 2009-10-27/xen/arch/x86/hvm/vmx/vmx.c 2009-10-27 12:07:32.0000000= 00 +0100 @@ -1389,7 +1389,7 @@ static void vmx_set_info_guest(struct vc vmx_vmcs_exit(v); } =20 -static struct hvm_function_table vmx_function_table =3D { +static struct hvm_function_table __read_mostly vmx_function_table =3D { .name =3D "VMX", .domain_initialise =3D vmx_domain_initialise, .domain_destroy =3D vmx_domain_destroy, --- 2009-10-27.orig/xen/arch/x86/microcode_amd.c 2009-07-13 = 13:05:40.000000000 +0200 +++ 2009-10-27/xen/arch/x86/microcode_amd.c 2009-10-27 12:07:32.0000000= 00 +0100 @@ -323,7 +323,7 @@ static int microcode_resume_match(int cp return 0; } =20 -static struct microcode_ops microcode_amd_ops =3D { +static const struct microcode_ops microcode_amd_ops =3D { .microcode_resume_match =3D microcode_resume_match, .cpu_request_microcode =3D cpu_request_microcode, .collect_cpu_info =3D collect_cpu_info, --- 2009-10-27.orig/xen/arch/x86/microcode_intel.c 2009-07-13 = 13:05:40.000000000 +0200 +++ 2009-10-27/xen/arch/x86/microcode_intel.c 2009-10-27 12:07:32.0000000= 00 +0100 @@ -368,7 +368,7 @@ static int microcode_resume_match(int cp (uci->cpu_sig.rev > nsig->rev)); } =20 -static struct microcode_ops microcode_intel_ops =3D { +static const struct microcode_ops microcode_intel_ops =3D { .microcode_resume_match =3D microcode_resume_match, .cpu_request_microcode =3D cpu_request_microcode, .collect_cpu_info =3D collect_cpu_info, --- 2009-10-27.orig/xen/arch/x86/mm.c 2009-10-26 14:42:47.000000000 = +0100 +++ 2009-10-27/xen/arch/x86/mm.c 2009-10-27 12:07:32.000000000 = +0100 @@ -4418,7 +4418,7 @@ static int ptwr_emulated_cmpxchg( container_of(ctxt, struct ptwr_emulate_ctxt, ctxt)); } =20 -static struct x86_emulate_ops ptwr_emulate_ops =3D { +static const struct x86_emulate_ops ptwr_emulate_ops =3D { .read =3D ptwr_emulated_read, .insn_fetch =3D ptwr_emulated_read, .write =3D ptwr_emulated_write, --- 2009-10-27.orig/xen/arch/x86/mm/hap/hap.c 2009-10-01 10:53:02.0000000= 00 +0200 +++ 2009-10-27/xen/arch/x86/mm/hap/hap.c 2009-10-27 12:07:32.0000000= 00 +0100 @@ -674,6 +674,11 @@ int hap_domctl(struct domain *d, xen_dom } } =20 +static const struct paging_mode hap_paging_real_mode; +static const struct paging_mode hap_paging_protected_mode; +static const struct paging_mode hap_paging_pae_mode; +static const struct paging_mode hap_paging_long_mode; + void hap_vcpu_init(struct vcpu *v) { v->arch.paging.mode =3D &hap_paging_real_mode; @@ -812,7 +817,7 @@ static unsigned long hap_gva_to_gfn_real } =20 /* Entry points into this mode of the hap code. */ -struct paging_mode hap_paging_real_mode =3D { +static const struct paging_mode hap_paging_real_mode =3D { .page_fault =3D hap_page_fault, .invlpg =3D hap_invlpg, .gva_to_gfn =3D hap_gva_to_gfn_real_mode, @@ -822,7 +827,7 @@ struct paging_mode hap_paging_real_mode=20 .guest_levels =3D 1 }; =20 -struct paging_mode hap_paging_protected_mode =3D { +static const struct paging_mode hap_paging_protected_mode =3D { .page_fault =3D hap_page_fault, .invlpg =3D hap_invlpg, .gva_to_gfn =3D hap_gva_to_gfn_2level, @@ -832,7 +837,7 @@ struct paging_mode hap_paging_protected_ .guest_levels =3D 2 }; =20 -struct paging_mode hap_paging_pae_mode =3D { +static const struct paging_mode hap_paging_pae_mode =3D { .page_fault =3D hap_page_fault, .invlpg =3D hap_invlpg, .gva_to_gfn =3D hap_gva_to_gfn_3level, @@ -842,7 +847,7 @@ struct paging_mode hap_paging_pae_mode =3D .guest_levels =3D 3 }; =20 -struct paging_mode hap_paging_long_mode =3D { +static const struct paging_mode hap_paging_long_mode =3D { .page_fault =3D hap_page_fault, .invlpg =3D hap_invlpg, .gva_to_gfn =3D hap_gva_to_gfn_4level, --- 2009-10-27.orig/xen/arch/x86/mm/shadow/common.c 2009-10-26 = 14:42:47.000000000 +0100 +++ 2009-10-27/xen/arch/x86/mm/shadow/common.c 2009-10-27 12:07:32.0000000= 00 +0100 @@ -290,7 +290,7 @@ hvm_emulate_cmpxchg(enum x86_segment seg return X86EMUL_UNHANDLEABLE; } =20 -static struct x86_emulate_ops hvm_shadow_emulator_ops =3D { +static const struct x86_emulate_ops hvm_shadow_emulator_ops =3D { .read =3D hvm_emulate_read, .insn_fetch =3D hvm_emulate_insn_fetch, .write =3D hvm_emulate_write, @@ -367,14 +367,14 @@ pv_emulate_cmpxchg(enum x86_segment seg, return X86EMUL_UNHANDLEABLE; } =20 -static struct x86_emulate_ops pv_shadow_emulator_ops =3D { +static const struct x86_emulate_ops pv_shadow_emulator_ops =3D { .read =3D pv_emulate_read, .insn_fetch =3D pv_emulate_read, .write =3D pv_emulate_write, .cmpxchg =3D pv_emulate_cmpxchg, }; =20 -struct x86_emulate_ops *shadow_init_emulation( +const struct x86_emulate_ops *shadow_init_emulation( struct sh_emulate_ctxt *sh_ctxt, struct cpu_user_regs *regs) { struct segment_register *creg, *sreg; @@ -2154,7 +2154,7 @@ typedef int (*hash_callback_t)(struct vc =20 static void hash_foreach(struct vcpu *v,=20 unsigned int callback_mask,=20 - hash_callback_t callbacks[],=20 + const hash_callback_t callbacks[], mfn_t callback_mfn) /* Walk the hash table looking at the types of the entries and=20 * calling the appropriate callback function for each entry.=20 @@ -2287,7 +2287,7 @@ int sh_remove_write_access(struct vcpu * unsigned long fault_addr) { /* Dispatch table for getting per-type functions */ - static hash_callback_t callbacks[SH_type_unused] =3D { + static const hash_callback_t callbacks[SH_type_unused] =3D { NULL, /* none */ SHADOW_INTERNAL_NAME(sh_rm_write_access_from_l1, 2), /* l1_32 = */ SHADOW_INTERNAL_NAME(sh_rm_write_access_from_l1, 2), /* fl1_32 = */ @@ -2549,7 +2549,7 @@ int sh_remove_all_mappings(struct vcpu * int expected_count, do_locking; =20 /* Dispatch table for getting per-type functions */ - static hash_callback_t callbacks[SH_type_unused] =3D { + static const hash_callback_t callbacks[SH_type_unused] =3D { NULL, /* none */ SHADOW_INTERNAL_NAME(sh_rm_mappings_from_l1, 2), /* l1_32 */ SHADOW_INTERNAL_NAME(sh_rm_mappings_from_l1, 2), /* fl1_32 */ @@ -2703,7 +2703,7 @@ void sh_remove_shadows(struct vcpu *v, m =20 /* Dispatch table for getting per-type functions: each level must * be called with the function to remove a lower-level shadow. */ - static hash_callback_t callbacks[SH_type_unused] =3D { + static const hash_callback_t callbacks[SH_type_unused] =3D { NULL, /* none */ NULL, /* l1_32 */ NULL, /* fl1_32 */ @@ -2852,7 +2852,7 @@ sh_remove_all_shadows_and_parents(struct static void sh_update_paging_modes(struct vcpu *v) { struct domain *d =3D v->domain; - struct paging_mode *old_mode =3D v->arch.paging.mode; + const struct paging_mode *old_mode =3D v->arch.paging.mode; =20 ASSERT(shadow_locked_by_me(d)); =20 @@ -3855,7 +3855,7 @@ int shadow_domctl(struct domain *d,=20 void shadow_audit_tables(struct vcpu *v)=20 { /* Dispatch table for getting per-type functions */ - static hash_callback_t callbacks[SH_type_unused] =3D { + static const hash_callback_t callbacks[SH_type_unused] =3D { NULL, /* none */ SHADOW_INTERNAL_NAME(sh_audit_l1_table, 2), /* l1_32 */ SHADOW_INTERNAL_NAME(sh_audit_fl1_table, 2), /* fl1_32 */ --- 2009-10-27.orig/xen/arch/x86/mm/shadow/multi.c 2009-10-22 = 08:18:54.000000000 +0200 +++ 2009-10-27/xen/arch/x86/mm/shadow/multi.c 2009-10-27 12:07:32.0000000= 00 +0100 @@ -2935,7 +2935,7 @@ static int sh_page_fault(struct vcpu *v, shadow_l1e_t sl1e, *ptr_sl1e; paddr_t gpa; struct sh_emulate_ctxt emul_ctxt; - struct x86_emulate_ops *emul_ops; + const struct x86_emulate_ops *emul_ops; int r; fetch_type_t ft =3D 0; p2m_type_t p2mt; @@ -5188,7 +5188,7 @@ int sh_audit_l4_table(struct vcpu *v, mf /*************************************************************************= */ /* Entry points into this mode of the shadow code. * This will all be mangled by the preprocessor to uniquify everything. = */ -struct paging_mode sh_paging_mode =3D { +const struct paging_mode sh_paging_mode =3D { .page_fault =3D sh_page_fault,=20 .invlpg =3D sh_invlpg, .gva_to_gfn =3D sh_gva_to_gfn, --- 2009-10-27.orig/xen/arch/x86/mm/shadow/multi.h 2009-10-07 = 13:31:36.000000000 +0200 +++ 2009-10-27/xen/arch/x86/mm/shadow/multi.h 2009-10-27 12:07:32.0000000= 00 +0100 @@ -113,7 +113,7 @@ extern void SHADOW_INTERNAL_NAME(sh_destroy_monitor_table, GUEST_LEVELS) (struct vcpu *v, mfn_t mmfn); =20 -extern struct paging_mode=20 +extern const struct paging_mode SHADOW_INTERNAL_NAME(sh_paging_mode, GUEST_LEVELS); =20 #if SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC --- 2009-10-27.orig/xen/arch/x86/mm/shadow/private.h 2009-09-22 = 11:02:53.000000000 +0200 +++ 2009-10-27/xen/arch/x86/mm/shadow/private.h 2009-10-27 12:07:32.0000000= 00 +0100 @@ -747,7 +747,7 @@ struct sh_emulate_ctxt { #endif }; =20 -struct x86_emulate_ops *shadow_init_emulation( +const struct x86_emulate_ops *shadow_init_emulation( struct sh_emulate_ctxt *sh_ctxt, struct cpu_user_regs *regs); void shadow_continue_emulation( struct sh_emulate_ctxt *sh_ctxt, struct cpu_user_regs *regs); --- 2009-10-27.orig/xen/arch/x86/numa.c 2009-08-07 09:20:56.000000000 = +0200 +++ 2009-10-27/xen/arch/x86/numa.c 2009-10-27 12:07:32.000000000 = +0100 @@ -39,7 +39,7 @@ unsigned char apicid_to_node[MAX_LOCAL_A }; cpumask_t node_to_cpumask[MAX_NUMNODES] __read_mostly; =20 -nodemask_t node_online_map =3D { { [0] =3D 1UL } }; +nodemask_t __read_mostly node_online_map =3D { { [0] =3D 1UL } }; =20 /* Default NUMA to off for now. acpi=3Don required to enable it. */ int numa_off __initdata =3D 1; --- 2009-10-27.orig/xen/arch/x86/oprofile/nmi_int.c 2009-10-07 = 13:31:36.000000000 +0200 +++ 2009-10-27/xen/arch/x86/oprofile/nmi_int.c 2009-10-27 12:07:32.0000000= 00 +0100 @@ -29,7 +29,7 @@ =20 struct op_counter_config counter_config[OP_MAX_COUNTER]; =20 -static struct op_x86_model_spec const * model; +static struct op_x86_model_spec const *__read_mostly model; static struct op_msrs cpu_msrs[NR_CPUS]; static unsigned long saved_lvtpc[NR_CPUS]; =20 --- 2009-10-27.orig/xen/arch/x86/oprofile/op_model_p4.c 2009-10-07 = 13:31:36.000000000 +0200 +++ 2009-10-27/xen/arch/x86/oprofile/op_model_p4.c 2009-10-27 = 12:07:32.000000000 +0100 @@ -109,7 +109,7 @@ static int p4_unused_cccr[NUM_UNUSED_CCC =20 /* p4 event codes in libop/op_event.h are indices into this table. */ =20 -static struct p4_event_binding p4_events[NUM_EVENTS] =3D { +static const struct p4_event_binding p4_events[NUM_EVENTS] =3D { =09 { /* BRANCH_RETIRED */ 0x05, 0x06,=20 @@ -485,7 +485,7 @@ static void pmc_setup_one_p4_counter(uns unsigned int escr =3D 0; unsigned int high =3D 0; unsigned int counter_bit; - struct p4_event_binding *ev =3D NULL; + const struct p4_event_binding *ev =3D NULL; unsigned int stag; =20 stag =3D get_stagger(); --- 2009-10-27.orig/xen/arch/x86/oprofile/op_model_ppro.c 2009-10-07 = 13:31:36.000000000 +0200 +++ 2009-10-27/xen/arch/x86/oprofile/op_model_ppro.c 2009-10-27 = 12:07:32.000000000 +0100 @@ -309,7 +309,7 @@ void arch_perfmon_setup_counters(void) op_ppro_spec.num_controls =3D num_counters; } =20 -struct op_x86_model_spec op_ppro_spec =3D { +struct op_x86_model_spec __read_mostly op_ppro_spec =3D { .num_counters =3D 2, .num_controls =3D 2, .fill_in_addresses =3D &ppro_fill_in_addresses, @@ -324,7 +324,7 @@ struct op_x86_model_spec op_ppro_spec =3D=20 .save_msr =3D &ppro_save_msr }; =20 -struct op_x86_model_spec op_arch_perfmon_spec =3D { +struct op_x86_model_spec __read_mostly op_arch_perfmon_spec =3D { /* num_counters/num_controls filled in at runtime */ .fill_in_addresses =3D &ppro_fill_in_addresses, .setup_ctrs =3D &ppro_setup_ctrs, --- 2009-10-27.orig/xen/arch/x86/setup.c 2009-10-15 11:42:12.0000000= 00 +0200 +++ 2009-10-27/xen/arch/x86/setup.c 2009-10-27 12:07:32.000000000 = +0100 @@ -55,15 +55,15 @@ extern u8 boot_edid_info[128]; extern struct boot_video_info boot_vid_info; =20 /* opt_nosmp: If true, secondary processors are ignored. */ -static int opt_nosmp =3D 0; +static int __initdata opt_nosmp =3D 0; boolean_param("nosmp", opt_nosmp); =20 /* maxcpus: maximum number of CPUs to activate. */ -static unsigned int max_cpus =3D NR_CPUS; +static unsigned int __initdata max_cpus =3D NR_CPUS; integer_param("maxcpus", max_cpus); =20 /* opt_watchdog: If true, run a watchdog NMI on each processor. */ -static int opt_watchdog =3D 0; +static int __initdata opt_watchdog =3D 0; boolean_param("watchdog", opt_watchdog); =20 /* opt_tsc_unstable: Override all tests; assume TSC is unreliable. */ @@ -94,13 +94,14 @@ boolean_param("cpuidle", xen_cpuidle); =20 int early_boot =3D 1; =20 -cpumask_t cpu_present_map; +cpumask_t __read_mostly cpu_present_map; =20 -unsigned long xen_phys_start; +unsigned long __read_mostly xen_phys_start; =20 #ifdef CONFIG_X86_32 /* Limits of Xen heap, used to initialise the allocator. */ -unsigned long xenheap_initial_phys_start, xenheap_phys_end; +unsigned long __initdata xenheap_initial_phys_start; +unsigned long __read_mostly xenheap_phys_end; #endif =20 DEFINE_PER_CPU_READ_MOSTLY(struct desc_struct *, gdt_table) =3D boot_cpu_g= dt_table; @@ -113,15 +114,14 @@ DEFINE_PER_CPU(struct tss_struct, init_t =20 char __attribute__ ((__section__(".bss.stack_aligned"))) cpu0_stack[STACK_= SIZE]; =20 -struct cpuinfo_x86 boot_cpu_data =3D { 0, 0, 0, 0, -1 }; +struct cpuinfo_x86 __read_mostly boot_cpu_data =3D { 0, 0, 0, 0, -1 }; =20 -unsigned long mmu_cr4_features =3D X86_CR4_PSE | X86_CR4_PGE | X86_CR4_PAE= ; -EXPORT_SYMBOL(mmu_cr4_features); +unsigned long __read_mostly mmu_cr4_features =3D X86_CR4_PSE | X86_CR4_PGE= | X86_CR4_PAE; =20 -int acpi_disabled; +int __read_mostly acpi_disabled; =20 -int acpi_force; -char acpi_param[10] =3D ""; +int __read_mostly acpi_force; +static char __initdata acpi_param[10] =3D ""; static void __init parse_acpi_param(char *s) { /* Save the parameter so it can be propagated to domain0. */ --- 2009-10-27.orig/xen/arch/x86/srat.c 2009-09-22 11:02:53.000000000 = +0200 +++ 2009-10-27/xen/arch/x86/srat.c 2009-10-27 12:07:32.000000000 = +0100 @@ -20,12 +20,12 @@ #include #include =20 -static struct acpi_table_slit *acpi_slit; +static struct acpi_table_slit *__read_mostly acpi_slit; =20 static nodemask_t nodes_parsed __initdata; static nodemask_t nodes_found __initdata; static struct node nodes[MAX_NUMNODES] __initdata; -static u8 pxm2node[256] =3D { [0 ... 255] =3D 0xff }; +static u8 __read_mostly pxm2node[256] =3D { [0 ... 255] =3D 0xff }; =20 /* Too small nodes confuse the VM badly. Usually they result from BIOS bugs. */ --- 2009-10-27.orig/xen/arch/x86/tboot.c 2009-09-22 17:28:54.0000000= 00 +0200 +++ 2009-10-27/xen/arch/x86/tboot.c 2009-10-27 12:07:32.000000000 = +0100 @@ -13,7 +13,7 @@ #include =20 /* tboot=3D */ -static char opt_tboot[20] =3D ""; +static char __initdata opt_tboot[20] =3D ""; string_param("tboot", opt_tboot); =20 /* Global pointer to shared data; NULL means no measured launch. */ @@ -26,8 +26,8 @@ static vmac_t frametable_mac; /* MAC for static const uuid_t tboot_shared_uuid =3D TBOOT_SHARED_UUID; =20 /* used by tboot_protect_mem_regions() and/or tboot_parse_dmar_table() */ -static uint64_t txt_heap_base, txt_heap_size; -static uint64_t sinit_base, sinit_size; +static uint64_t __initdata txt_heap_base, __initdata txt_heap_size; +static uint64_t __initdata sinit_base, __initdata sinit_size; =20 /* * TXT configuration registers (offsets from TXT_{PUB, PRIV}_CONFIG_REGS_B= ASE) --- 2009-10-27.orig/xen/arch/x86/traps.c 2009-10-07 13:31:36.0000000= 00 +0200 +++ 2009-10-27/xen/arch/x86/traps.c 2009-10-27 12:07:32.000000000 = +0100 @@ -73,9 +73,9 @@ * ignore: The NMI error is cleared and ignored. */ #ifdef NDEBUG -char opt_nmi[10] =3D "dom0"; +static char __read_mostly opt_nmi[10] =3D "dom0"; #else -char opt_nmi[10] =3D "fatal"; +static char __read_mostly opt_nmi[10] =3D "fatal"; #endif string_param("nmi", opt_nmi); =20 --- 2009-10-27.orig/xen/arch/x86/x86_32/entry.S 2009-05-20 08:45:59.0000000= 00 +0200 +++ 2009-10-27/xen/arch/x86/x86_32/entry.S 2009-10-27 12:07:32.0000000= 00 +0100 @@ -640,7 +640,7 @@ ENTRY(setup_vm86_frame) addl $16,%esp ret =20 -.data +.section .rodata, "a", @progbits =20 ENTRY(exception_table) .long do_divide_error --- 2009-10-27.orig/xen/arch/x86/x86_32/mm.c 2009-10-07 13:31:36.0000000= 00 +0200 +++ 2009-10-27/xen/arch/x86/x86_32/mm.c 2009-10-27 12:07:32.000000000 = +0100 @@ -36,10 +36,10 @@ l2_pgentry_t __attribute__ ((__section__ =20 extern l1_pgentry_t l1_identmap[L1_PAGETABLE_ENTRIES]; =20 -unsigned int PAGE_HYPERVISOR =3D __PAGE_HYPERVISOR; -unsigned int PAGE_HYPERVISOR_NOCACHE =3D __PAGE_HYPERVISOR_NOCACHE; +unsigned int __read_mostly PAGE_HYPERVISOR =3D __PAGE_HYPERVISOR; +unsigned int __read_mostly PAGE_HYPERVISOR_NOCACHE =3D __PAGE_HYPERVISOR_N= OCACHE; =20 -static unsigned long mpt_size; +static unsigned long __read_mostly mpt_size; =20 void *alloc_xen_pagetable(void) { --- 2009-10-27.orig/xen/arch/x86/x86_64/entry.S 2009-05-20 08:45:59.0000000= 00 +0200 +++ 2009-10-27/xen/arch/x86/x86_64/entry.S 2009-10-27 12:07:32.0000000= 00 +0100 @@ -629,7 +629,7 @@ ENTRY(machine_check) movl $TRAP_machine_check,4(%rsp) jmp handle_ist_exception =20 -.data +.section .rodata, "a", @progbits =20 ENTRY(exception_table) .quad do_divide_error --- 2009-10-27.orig/xen/arch/x86/x86_64/mm.c 2009-10-15 11:42:12.0000000= 00 +0200 +++ 2009-10-27/xen/arch/x86/x86_64/mm.c 2009-10-27 12:11:22.000000000 = +0100 @@ -43,7 +43,7 @@ unsigned long __read_mostly ma_top_mask=20 unsigned long __read_mostly pfn_hole_mask =3D 0; unsigned int __read_mostly pfn_pdx_hole_shift =3D 0; =20 -unsigned int m2p_compat_vstart =3D __HYPERVISOR_COMPAT_VIRT_START; +unsigned int __read_mostly m2p_compat_vstart =3D __HYPERVISOR_COMPAT_VIRT_= START; =20 DEFINE_PER_CPU_READ_MOSTLY(void *, compat_arg_xlat); =20 --- 2009-10-27.orig/xen/arch/x86/x86_emulate/x86_emulate.c 2009-10-01 = 10:53:02.000000000 +0200 +++ 2009-10-27/xen/arch/x86/x86_emulate/x86_emulate.c 2009-10-27 = 12:07:32.000000000 +0100 @@ -715,7 +715,7 @@ static int read_ulong( unsigned long *val, unsigned int bytes, struct x86_emulate_ctxt *ctxt, - struct x86_emulate_ops *ops) + const struct x86_emulate_ops *ops) { *val =3D 0; return ops->read(seg, offset, val, bytes, ctxt); @@ -848,7 +848,7 @@ test_cc( static int get_cpl( struct x86_emulate_ctxt *ctxt, - struct x86_emulate_ops *ops) + const struct x86_emulate_ops *ops) { struct segment_register reg; =20 @@ -865,7 +865,7 @@ get_cpl( static int _mode_iopl( struct x86_emulate_ctxt *ctxt, - struct x86_emulate_ops *ops) + const struct x86_emulate_ops *ops) { int cpl =3D get_cpl(ctxt, ops); if ( cpl =3D=3D -1 ) @@ -888,7 +888,7 @@ static int ioport_access_check( unsigned int first_port, unsigned int bytes, struct x86_emulate_ctxt *ctxt, - struct x86_emulate_ops *ops) + const struct x86_emulate_ops *ops) { unsigned long iobmp; struct segment_register tr; @@ -933,7 +933,7 @@ static int ioport_access_check( static int in_realmode( struct x86_emulate_ctxt *ctxt, - struct x86_emulate_ops *ops) + const struct x86_emulate_ops *ops) { unsigned long cr0; int rc; @@ -948,7 +948,7 @@ in_realmode( static int in_protmode( struct x86_emulate_ctxt *ctxt, - struct x86_emulate_ops *ops) + const struct x86_emulate_ops *ops) { return !(in_realmode(ctxt, ops) || (ctxt->regs->eflags & EFLG_VM)); } @@ -956,7 +956,7 @@ in_protmode( static int in_longmode( struct x86_emulate_ctxt *ctxt, - struct x86_emulate_ops *ops) + const struct x86_emulate_ops *ops) { uint64_t efer; =20 @@ -972,7 +972,7 @@ realmode_load_seg( enum x86_segment seg, uint16_t sel, struct x86_emulate_ctxt *ctxt, - struct x86_emulate_ops *ops) + const struct x86_emulate_ops *ops) { struct segment_register reg; int rc; @@ -991,7 +991,7 @@ protmode_load_seg( enum x86_segment seg, uint16_t sel, struct x86_emulate_ctxt *ctxt, - struct x86_emulate_ops *ops) + const struct x86_emulate_ops *ops) { struct segment_register desctab, ss, segr; struct { uint32_t a, b; } desc; @@ -1130,7 +1130,7 @@ load_seg( enum x86_segment seg, uint16_t sel, struct x86_emulate_ctxt *ctxt, - struct x86_emulate_ops *ops) + const struct x86_emulate_ops *ops) { if ( (ops->read_segment =3D=3D NULL) || (ops->write_segment =3D=3D NULL) ) @@ -1202,7 +1202,7 @@ decode_segment(uint8_t modrm_reg) int x86_emulate( struct x86_emulate_ctxt *ctxt, - struct x86_emulate_ops *ops) + const struct x86_emulate_ops *ops) { /* Shadow copy of register state. Committed on successful emulation. = */ struct cpu_user_regs _regs =3D *ctxt->regs; --- 2009-10-27.orig/xen/arch/x86/x86_emulate/x86_emulate.h 2008-12-10 = 09:14:08.000000000 +0100 +++ 2009-10-27/xen/arch/x86/x86_emulate/x86_emulate.h 2009-10-27 = 12:07:32.000000000 +0100 @@ -395,7 +395,7 @@ struct x86_emulate_ctxt int x86_emulate( struct x86_emulate_ctxt *ctxt, - struct x86_emulate_ops *ops); + const struct x86_emulate_ops *ops); =20 /* * Given the 'reg' portion of a ModRM byte, and a register block, return = a --- 2009-10-27.orig/xen/common/lib.c 2009-06-29 11:58:15.000000000 = +0200 +++ 2009-10-27/xen/common/lib.c 2009-10-27 12:07:32.000000000 +0100 @@ -5,7 +5,7 @@ #include =20 /* for ctype.h */ -unsigned char _ctype[] =3D { +const unsigned char _ctype[] =3D { _C,_C,_C,_C,_C,_C,_C,_C, /* 0-7 */ _C,_C|_S,_C|_S,_C|_S,_C|_S,_C|_S,_C,_C, /* 8-15 */ _C,_C,_C,_C,_C,_C,_C,_C, /* 16-23 */ --- 2009-10-27.orig/xen/common/libelf/libelf-dominfo.c 2009-01-14 = 09:47:07.000000000 +0100 +++ 2009-10-27/xen/common/libelf/libelf-dominfo.c 2009-10-27 = 12:07:32.000000000 +0100 @@ -7,14 +7,14 @@ /* -----------------------------------------------------------------------= - */ /* xen features = */ =20 -const char *elf_xen_feature_names[] =3D { +static const char *const elf_xen_feature_names[] =3D { [XENFEAT_writable_page_tables] =3D "writable_page_tables", [XENFEAT_writable_descriptor_tables] =3D "writable_descriptor_tables",= [XENFEAT_auto_translated_physmap] =3D "auto_translated_physmap", [XENFEAT_supervisor_mode_kernel] =3D "supervisor_mode_kernel", [XENFEAT_pae_pgdir_above_4gb] =3D "pae_pgdir_above_4gb" }; -const int elf_xen_features =3D +static const int elf_xen_features =3D sizeof(elf_xen_feature_names) / sizeof(elf_xen_feature_names[0]); =20 int elf_xen_parse_features(const char *features, --- 2009-10-27.orig/xen/common/sched_credit.c 2009-10-02 11:40:50.0000000= 00 +0200 +++ 2009-10-27/xen/common/sched_credit.c 2009-10-27 12:07:32.0000000= 00 +0100 @@ -1375,7 +1375,7 @@ static void csched_tick_resume(void) - now % MILLISECS(CSCHED_MSECS_PER_TICK) ); } =20 -struct scheduler sched_credit_def =3D { +const struct scheduler sched_credit_def =3D { .name =3D "SMP Credit Scheduler", .opt_name =3D "credit", .sched_id =3D XEN_SCHEDULER_CREDIT, --- 2009-10-27.orig/xen/common/sched_sedf.c 2009-06-19 11:11:23.0000000= 00 +0200 +++ 2009-10-27/xen/common/sched_sedf.c 2009-10-27 12:07:32.000000000 = +0100 @@ -1456,7 +1456,7 @@ static int sedf_adjust(struct domain *p, return 0; } =20 -struct scheduler sched_sedf_def =3D { +const struct scheduler sched_sedf_def =3D { .name =3D "Simple EDF Scheduler", .opt_name =3D "sedf", .sched_id =3D XEN_SCHEDULER_SEDF, --- 2009-10-27.orig/xen/common/schedule.c 2009-08-31 15:09:04.0000000= 00 +0200 +++ 2009-10-27/xen/common/schedule.c 2009-10-27 12:07:32.000000000 = +0100 @@ -56,15 +56,15 @@ static void poll_timer_fn(void *data); /* This is global for now so that private implementations can reach it */ DEFINE_PER_CPU(struct schedule_data, schedule_data); =20 -extern struct scheduler sched_sedf_def; -extern struct scheduler sched_credit_def; -static struct scheduler *schedulers[] =3D {=20 +extern const struct scheduler sched_sedf_def; +extern const struct scheduler sched_credit_def; +static const struct scheduler *__initdata schedulers[] =3D { &sched_sedf_def, &sched_credit_def, NULL }; =20 -static struct scheduler ops; +static struct scheduler __read_mostly ops; =20 #define SCHED_OP(fn, ...) \ (( ops.fn !=3D NULL ) ? ops.fn( __VA_ARGS__ ) \ --- 2009-10-27.orig/xen/drivers/char/console.c 2009-10-07 13:31:36.0000000= 00 +0200 +++ 2009-10-27/xen/drivers/char/console.c 2009-10-27 12:07:32.0000000= 00 +0100 @@ -44,19 +44,19 @@ string_param("console", opt_console); /* Char 1: CTRL+ is used to switch console input between Xen and = DOM0 */ /* Char 2: If this character is 'x', then do not auto-switch to DOM0 when = it */ /* boots. Any other value, or omitting the char, enables = auto-switch */ -static unsigned char opt_conswitch[3] =3D "a"; +static unsigned char __read_mostly opt_conswitch[3] =3D "a"; string_param("conswitch", opt_conswitch); =20 /* sync_console: force synchronous console output (useful for debugging). = */ -static int opt_sync_console; +static int __read_mostly opt_sync_console; boolean_param("sync_console", opt_sync_console); =20 /* console_to_ring: send guest (incl. dom 0) console data to console = ring. */ -static int opt_console_to_ring; +static int __read_mostly opt_console_to_ring; boolean_param("console_to_ring", opt_console_to_ring); =20 /* console_timestamps: include a timestamp prefix on every Xen console = line. */ -static int opt_console_timestamps; +static int __read_mostly opt_console_timestamps; boolean_param("console_timestamps", opt_console_timestamps); =20 /* conring_size: allows a large console ring than default (16kB). */ @@ -65,10 +65,11 @@ size_param("conring_size", opt_conring_s =20 #define _CONRING_SIZE 16384 #define CONRING_IDX_MASK(i) ((i)&(conring_size-1)) -static char _conring[_CONRING_SIZE], *conring =3D _conring; -static uint32_t conring_size =3D _CONRING_SIZE, conringc, conringp; +static char _conring[_CONRING_SIZE], *__read_mostly conring =3D _conring; +static uint32_t __read_mostly conring_size =3D _CONRING_SIZE; +static uint32_t conringc, conringp; =20 -static int sercon_handle =3D -1; +static int __read_mostly sercon_handle =3D -1; =20 static DEFINE_SPINLOCK(console_lock); =20 @@ -103,10 +104,10 @@ static DEFINE_SPINLOCK(console_lock); #define XENLOG_DEFAULT 1 /* XENLOG_WARNING */ #define XENLOG_GUEST_DEFAULT 1 /* XENLOG_WARNING */ =20 -static int xenlog_upper_thresh =3D XENLOG_UPPER_THRESHOLD; -static int xenlog_lower_thresh =3D XENLOG_LOWER_THRESHOLD; -static int xenlog_guest_upper_thresh =3D XENLOG_GUEST_UPPER_THRESHOLD; -static int xenlog_guest_lower_thresh =3D XENLOG_GUEST_LOWER_THRESHOLD; +static int __read_mostly xenlog_upper_thresh =3D XENLOG_UPPER_THRESHOLD; +static int __read_mostly xenlog_lower_thresh =3D XENLOG_LOWER_THRESHOLD; +static int __read_mostly xenlog_guest_upper_thresh =3D XENLOG_GUEST_UPPER_= THRESHOLD; +static int __read_mostly xenlog_guest_lower_thresh =3D XENLOG_GUEST_LOWER_= THRESHOLD; =20 static void parse_loglvl(char *s); static void parse_guest_loglvl(char *s); @@ -273,7 +274,7 @@ static void sercon_puts(const char *s) =20 /* CTRL- switches input direction between Xen and DOM0. */ #define switch_code (opt_conswitch[0]-'a'+1) -static int xen_rx =3D 1; /* FALSE =3D> serial input passed to domain 0. = */ +static int __read_mostly xen_rx =3D 1; /* FALSE =3D> serial input passed = to domain 0. */ =20 static void switch_serial_input(void) { @@ -773,10 +774,10 @@ int __printk_ratelimit(int ratelimit_ms, } =20 /* minimum time in ms between messages */ -int printk_ratelimit_ms =3D 5 * 1000; +static int __read_mostly printk_ratelimit_ms =3D 5 * 1000; =20 /* number of messages we send before ratelimiting */ -int printk_ratelimit_burst =3D 10; +static int __read_mostly printk_ratelimit_burst =3D 10; =20 int printk_ratelimit(void) { --- 2009-10-27.orig/xen/drivers/char/ns16550.c 2009-08-31 15:09:04.0000000= 00 +0200 +++ 2009-10-27/xen/drivers/char/ns16550.c 2009-10-27 12:07:32.0000000= 00 +0100 @@ -272,7 +272,7 @@ static int ns16550_irq(struct serial_por return ((uart->irq > 0) ? uart->irq : -1); } =20 -static struct uart_driver ns16550_driver =3D { +static struct uart_driver __read_mostly ns16550_driver =3D { .init_preirq =3D ns16550_init_preirq, .init_postirq =3D ns16550_init_postirq, .endboot =3D ns16550_endboot, --- 2009-10-27.orig/xen/drivers/char/serial.c 2009-08-31 15:09:04.0000000= 00 +0200 +++ 2009-10-27/xen/drivers/char/serial.c 2009-10-27 12:07:32.0000000= 00 +0100 @@ -18,7 +18,7 @@ /* Never drop characters, even if the async transmit buffer fills. */ /* #define SERIAL_NEVER_DROP_CHARS 1 */ =20 -unsigned int serial_txbufsz =3D 16384; +unsigned int __read_mostly serial_txbufsz =3D 16384; size_param("serial_tx_buffer", serial_txbufsz); =20 #define mask_serial_rxbuf_idx(_i) ((_i)&(serial_rxbufsz-1)) --- 2009-10-27.orig/xen/drivers/passthrough/amd/pci_amd_iommu.c 2009-10-07 = 13:31:36.000000000 +0200 +++ 2009-10-27/xen/drivers/passthrough/amd/pci_amd_iommu.c 2009-10-27 = 12:07:32.000000000 +0100 @@ -430,7 +430,7 @@ static int amd_iommu_group_id(u8 bus, u8 return rt; } =20 -struct iommu_ops amd_iommu_ops =3D { +const struct iommu_ops amd_iommu_ops =3D { .init =3D amd_iommu_domain_init, .add_device =3D amd_iommu_add_device, .remove_device =3D amd_iommu_remove_device, --- 2009-10-27.orig/xen/drivers/passthrough/iommu.c 2009-10-22 = 08:18:54.000000000 +0200 +++ 2009-10-27/xen/drivers/passthrough/iommu.c 2009-10-27 12:07:32.0000000= 00 +0100 @@ -292,7 +292,7 @@ int iommu_get_device_group(struct domain int group_id, sdev_id; u32 bdf; int i =3D 0; - struct iommu_ops *ops =3D hd->platform_ops; + const struct iommu_ops *ops =3D hd->platform_ops; =20 if ( !iommu_enabled || !ops || !ops->get_device_group_id ) return 0; @@ -327,39 +327,39 @@ int iommu_get_device_group(struct domain void iommu_update_ire_from_apic( unsigned int apic, unsigned int reg, unsigned int value) { - struct iommu_ops *ops =3D iommu_get_ops(); + const struct iommu_ops *ops =3D iommu_get_ops(); ops->update_ire_from_apic(apic, reg, value); } void iommu_update_ire_from_msi( struct msi_desc *msi_desc, struct msi_msg *msg) { - struct iommu_ops *ops =3D iommu_get_ops(); + const struct iommu_ops *ops =3D iommu_get_ops(); ops->update_ire_from_msi(msi_desc, msg); } =20 void iommu_read_msi_from_ire( struct msi_desc *msi_desc, struct msi_msg *msg) { - struct iommu_ops *ops =3D iommu_get_ops(); + const struct iommu_ops *ops =3D iommu_get_ops(); ops->read_msi_from_ire(msi_desc, msg); } =20 unsigned int iommu_read_apic_from_ire(unsigned int apic, unsigned int = reg) { - struct iommu_ops *ops =3D iommu_get_ops(); + const struct iommu_ops *ops =3D iommu_get_ops(); return ops->read_apic_from_ire(apic, reg); } =20 void iommu_resume() { - struct iommu_ops *ops =3D iommu_get_ops(); + const struct iommu_ops *ops =3D iommu_get_ops(); if ( iommu_enabled ) ops->resume(); } =20 void iommu_suspend() { - struct iommu_ops *ops =3D iommu_get_ops(); + const struct iommu_ops *ops =3D iommu_get_ops(); if ( iommu_enabled ) ops->suspend(); } --- 2009-10-27.orig/xen/drivers/passthrough/vtd/iommu.c 2009-10-27 = 12:04:10.000000000 +0100 +++ 2009-10-27/xen/drivers/passthrough/vtd/iommu.c 2009-10-27 = 12:07:32.000000000 +0100 @@ -1944,7 +1944,7 @@ static void vtd_resume(void) } } =20 -struct iommu_ops intel_iommu_ops =3D { +const struct iommu_ops intel_iommu_ops =3D { .init =3D intel_iommu_domain_init, .add_device =3D intel_iommu_add_device, .remove_device =3D intel_iommu_remove_device, --- 2009-10-27.orig/xen/include/asm-ia64/hvm/iommu.h 2009-03-31 = 17:55:50.000000000 +0200 +++ 2009-10-27/xen/include/asm-ia64/hvm/iommu.h 2009-10-27 12:07:32.0000000= 00 +0100 @@ -8,7 +8,7 @@ #include =20 struct iommu_ops; -extern struct iommu_ops intel_iommu_ops; +extern const struct iommu_ops intel_iommu_ops; extern int intel_vtd_setup(void); =20 #define iommu_get_ops() (&intel_iommu_ops) --- 2009-10-27.orig/xen/include/asm-x86/domain.h 2009-10-22 = 08:18:54.000000000 +0200 +++ 2009-10-27/xen/include/asm-x86/domain.h 2009-10-27 12:07:32.0000000= 00 +0100 @@ -187,7 +187,7 @@ struct paging_domain { =20 struct paging_vcpu { /* Pointers to mode-specific entry points. */ - struct paging_mode *mode; + const struct paging_mode *mode; /* HVM guest: last emulate was to a pagetable */ unsigned int last_write_was_pt:1; /* HVM guest: last write emulation succeeds */ --- 2009-10-27.orig/xen/include/asm-x86/genapic.h 2009-09-07 = 13:22:47.000000000 +0200 +++ 2009-10-27/xen/include/asm-x86/genapic.h 2009-10-27 12:07:32.0000000= 00 +0100 @@ -18,7 +18,7 @@ struct mp_config_table; struct mpc_config_processor; =20 struct genapic {=20 - char *name; + const char *name; int (*probe)(void); =20 /* When one of the next two hooks returns 1 the genapic @@ -48,9 +48,9 @@ struct genapic {=20 APICFUNC(mps_oem_check), \ APICFUNC(acpi_madt_oem_check) =20 -extern struct genapic *genapic; -extern struct genapic apic_x2apic_phys; -extern struct genapic apic_x2apic_cluster; +extern const struct genapic *genapic; +extern const struct genapic apic_x2apic_phys; +extern const struct genapic apic_x2apic_cluster; =20 void init_apic_ldr_flat(void); void clustered_apic_check_flat(void); --- 2009-10-27.orig/xen/include/asm-x86/hap.h 2009-06-05 11:59:48.0000000= 00 +0200 +++ 2009-10-27/xen/include/asm-x86/hap.h 2009-10-27 12:07:32.0000000= 00 +0100 @@ -97,11 +97,6 @@ int hap_track_dirty_vram(struct domain unsigned long nr, XEN_GUEST_HANDLE_64(uint8) dirty_bitmap); =20 -extern struct paging_mode hap_paging_real_mode; -extern struct paging_mode hap_paging_protected_mode; -extern struct paging_mode hap_paging_pae_mode; -extern struct paging_mode hap_paging_long_mode; - #endif /* XEN_HAP_H */ =20 /* --- 2009-10-27.orig/xen/include/asm-x86/hvm/iommu.h 2008-10-17 = 08:29:02.000000000 +0200 +++ 2009-10-27/xen/include/asm-x86/hvm/iommu.h 2009-10-27 12:07:32.0000000= 00 +0100 @@ -2,12 +2,12 @@ #define __ASM_X86_HVM_IOMMU_H__ =20 struct iommu_ops; -extern struct iommu_ops intel_iommu_ops; -extern struct iommu_ops amd_iommu_ops; +extern const struct iommu_ops intel_iommu_ops; +extern const struct iommu_ops amd_iommu_ops; extern int intel_vtd_setup(void); extern int amd_iov_detect(void); =20 -static inline struct iommu_ops *iommu_get_ops(void) +static inline const struct iommu_ops *iommu_get_ops(void) { =20 switch ( boot_cpu_data.x86_vendor ) { --- 2009-10-27.orig/xen/include/xen/ctype.h 2005-11-17 15:51:06.0000000= 00 +0100 +++ 2009-10-27/xen/include/xen/ctype.h 2009-10-27 12:07:32.000000000 = +0100 @@ -15,7 +15,7 @@ #define _X 0x40 /* hex digit */ #define _SP 0x80 /* hard space (0x20) */ =20 -extern unsigned char _ctype[]; +extern const unsigned char _ctype[]; =20 #define __ismask(x) (_ctype[(int)(unsigned char)(x)]) =20 --- 2009-10-27.orig/xen/include/xen/hvm/iommu.h 2009-09-07 13:22:47.0000000= 00 +0200 +++ 2009-10-27/xen/include/xen/hvm/iommu.h 2009-10-27 12:07:32.0000000= 00 +0100 @@ -43,7 +43,7 @@ struct hvm_iommu { struct page_info *root_table; =20 /* iommu_ops */ - struct iommu_ops *platform_ops; + const struct iommu_ops *platform_ops; }; =20 #endif /* __XEN_HVM_IOMMU_H__ */