[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] Miscellaneous data placement adjustments
# HG changeset patch # User Keir Fraser <keir.fraser@xxxxxxxxxx> # Date 1256727290 0 # Node ID 5a224e101cb314592e1c63cb5287ad2ab970b7ab # Parent 514510e6c7cbd20cc6a099c0dc1d3da8c9c926b5 Miscellaneous data placement adjustments Make various data items const or __read_mostly where possible/reasonable. Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx> --- xen/arch/ia64/linux-xen/acpi.c | 4 +-- xen/arch/ia64/linux-xen/numa.c | 2 - xen/arch/x86/domain.c | 4 +-- xen/arch/x86/genapic/bigsmp.c | 2 - xen/arch/x86/genapic/default.c | 2 - xen/arch/x86/genapic/probe.c | 11 +++++---- xen/arch/x86/genapic/summit.c | 2 - xen/arch/x86/genapic/x2apic.c | 8 +++---- xen/arch/x86/hvm/emulate.c | 2 - xen/arch/x86/hvm/hpet.c | 2 - xen/arch/x86/hvm/intercept.c | 11 +++++---- xen/arch/x86/hvm/quirks.c | 2 - xen/arch/x86/hvm/svm/svm.c | 2 - xen/arch/x86/hvm/vioapic.c | 2 - xen/arch/x86/hvm/vlapic.c | 2 - xen/arch/x86/hvm/vmsi.c | 2 - xen/arch/x86/hvm/vmx/vmcs.c | 8 +++---- xen/arch/x86/hvm/vmx/vmx.c | 2 - xen/arch/x86/microcode_amd.c | 2 - xen/arch/x86/microcode_intel.c | 2 - xen/arch/x86/mm.c | 2 - xen/arch/x86/mm/hap/hap.c | 13 +++++++---- xen/arch/x86/mm/shadow/common.c | 18 +++++++-------- xen/arch/x86/mm/shadow/multi.c | 4 +-- xen/arch/x86/mm/shadow/multi.h | 2 - xen/arch/x86/mm/shadow/private.h | 2 - xen/arch/x86/numa.c | 2 - xen/arch/x86/oprofile/nmi_int.c | 2 - xen/arch/x86/oprofile/op_model_p4.c | 4 +-- xen/arch/x86/oprofile/op_model_ppro.c | 4 +-- xen/arch/x86/setup.c | 32 ++++++++++++++-------------- xen/arch/x86/srat.c | 4 +-- xen/arch/x86/tboot.c | 6 ++--- xen/arch/x86/traps.c | 4 +-- xen/arch/x86/x86_32/entry.S | 2 - xen/arch/x86/x86_32/mm.c | 8 +++---- xen/arch/x86/x86_64/entry.S | 2 - xen/arch/x86/x86_64/mm.c | 2 - xen/arch/x86/x86_emulate/x86_emulate.c | 22 +++++++++---------- xen/arch/x86/x86_emulate/x86_emulate.h | 2 - xen/common/lib.c | 2 - xen/common/libelf/libelf-dominfo.c | 4 +-- xen/common/sched_credit.c | 2 - xen/common/sched_sedf.c | 2 - xen/common/schedule.c | 8 +++---- xen/drivers/char/console.c | 31 ++++++++++++++------------- xen/drivers/char/ns16550.c | 2 - xen/drivers/char/serial.c | 2 - xen/drivers/passthrough/amd/pci_amd_iommu.c | 2 - xen/drivers/passthrough/iommu.c | 14 ++++++------ xen/drivers/passthrough/vtd/iommu.c | 2 - xen/include/asm-ia64/hvm/iommu.h | 2 - xen/include/asm-x86/domain.h | 2 - xen/include/asm-x86/genapic.h | 8 +++---- xen/include/asm-x86/hap.h | 5 ---- xen/include/asm-x86/hvm/iommu.h | 6 ++--- xen/include/xen/ctype.h | 2 - xen/include/xen/hvm/iommu.h | 2 - 58 files changed, 156 insertions(+), 153 deletions(-) diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/ia64/linux-xen/acpi.c --- a/xen/arch/ia64/linux-xen/acpi.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/ia64/linux-xen/acpi.c Wed Oct 28 10:54:50 2009 +0000 @@ -66,9 +66,9 @@ extern u8 numa_slit[MAX_NUMNODES * MAX_N #define PREFIX "ACPI: " -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); unsigned int acpi_cpei_override; diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/ia64/linux-xen/numa.c --- a/xen/arch/ia64/linux-xen/numa.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/ia64/linux-xen/numa.c Wed Oct 28 10:54:50 2009 +0000 @@ -32,7 +32,7 @@ #endif #ifdef XEN -nodemask_t node_online_map = { { [0] = 1UL } }; +nodemask_t __read_mostly node_online_map = { { [0] = 1UL } }; #endif u8 cpu_to_node_map[NR_CPUS] __cacheline_aligned; diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/domain.c --- a/xen/arch/x86/domain.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/domain.c Wed Oct 28 10:54:50 2009 +0000 @@ -61,8 +61,8 @@ DEFINE_PER_CPU(unsigned long, cr4); static void default_idle(void); static void default_dead_idle(void); -void (*pm_idle) (void) = default_idle; -void (*dead_idle) (void) = default_dead_idle; +void (*pm_idle) (void) __read_mostly = default_idle; +void (*dead_idle) (void) __read_mostly = default_dead_idle; static void paravirt_ctxt_switch_from(struct vcpu *v); static void paravirt_ctxt_switch_to(struct vcpu *v); diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/genapic/bigsmp.c --- a/xen/arch/x86/genapic/bigsmp.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/genapic/bigsmp.c Wed Oct 28 10:54:50 2009 +0000 @@ -48,7 +48,7 @@ static __init int probe_bigsmp(void) return dmi_bigsmp; } -struct genapic apic_bigsmp = { +const struct genapic apic_bigsmp = { APIC_INIT("bigsmp", probe_bigsmp), GENAPIC_PHYS }; diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/genapic/default.c --- a/xen/arch/x86/genapic/default.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/genapic/default.c Wed Oct 28 10:54:50 2009 +0000 @@ -20,7 +20,7 @@ static __init int probe_default(void) return 1; } -struct genapic apic_default = { +const struct genapic apic_default = { APIC_INIT("default", probe_default), GENAPIC_FLAT }; diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/genapic/probe.c --- a/xen/arch/x86/genapic/probe.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/genapic/probe.c Wed Oct 28 10:54:50 2009 +0000 @@ -9,19 +9,20 @@ #include <xen/kernel.h> #include <xen/ctype.h> #include <xen/init.h> +#include <asm/cache.h> #include <asm/fixmap.h> #include <asm/mpspec.h> #include <asm/apicdef.h> #include <asm/mach-generic/mach_apic.h> #include <asm/setup.h> -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; -struct genapic *genapic; +const struct genapic *__read_mostly genapic; -struct genapic *apic_probe[] __initdata = { +const struct genapic *apic_probe[] __initdata = { &apic_summit, &apic_bigsmp, &apic_default, /* must be last */ diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/genapic/summit.c --- a/xen/arch/x86/genapic/summit.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/genapic/summit.c Wed Oct 28 10:54:50 2009 +0000 @@ -20,7 +20,7 @@ static __init int probe_summit(void) return 0; } -struct genapic apic_summit = { +const struct genapic apic_summit = { APIC_INIT("summit", probe_summit), GENAPIC_PHYS }; diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/genapic/x2apic.c --- a/xen/arch/x86/genapic/x2apic.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/genapic/x2apic.c Wed Oct 28 10:54:50 2009 +0000 @@ -23,10 +23,10 @@ #include <xen/smp.h> #include <asm/mach-default/mach_mpparse.h> -static int x2apic = 1; +static int __initdata x2apic = 1; boolean_param("x2apic", x2apic); -static int x2apic_phys = 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); static int __init probe_x2apic_phys(void) @@ -41,12 +41,12 @@ static int __init probe_x2apic_cluster(v iommu_supports_eim(); } -struct genapic apic_x2apic_phys= { +const struct genapic apic_x2apic_phys = { APIC_INIT("x2apic_phys", probe_x2apic_phys), GENAPIC_X2APIC_PHYS }; -struct genapic apic_x2apic_cluster= { +const struct genapic apic_x2apic_cluster = { APIC_INIT("x2apic_cluster", probe_x2apic_cluster), GENAPIC_X2APIC_CLUSTER }; diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/hvm/emulate.c --- a/xen/arch/x86/hvm/emulate.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/hvm/emulate.c Wed Oct 28 10:54:50 2009 +0000 @@ -929,7 +929,7 @@ static int hvmemul_invlpg( return rc; } -static struct x86_emulate_ops hvm_emulate_ops = { +static const struct x86_emulate_ops hvm_emulate_ops = { .read = hvmemul_read, .insn_fetch = hvmemul_insn_fetch, .write = hvmemul_write, diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/hvm/hpet.c --- a/xen/arch/x86/hvm/hpet.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/hvm/hpet.c Wed Oct 28 10:54:50 2009 +0000 @@ -485,7 +485,7 @@ static int hpet_range(struct vcpu *v, un (addr < (HPET_BASE_ADDRESS + HPET_MMAP_SIZE))); } -struct hvm_mmio_handler hpet_mmio_handler = { +const struct hvm_mmio_handler hpet_mmio_handler = { .check_handler = hpet_range, .read_handler = hpet_read, .write_handler = hpet_write diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/hvm/intercept.c --- a/xen/arch/x86/hvm/intercept.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/hvm/intercept.c Wed Oct 28 10:54:50 2009 +0000 @@ -32,14 +32,15 @@ #include <xen/event.h> #include <xen/iommu.h> -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; #define HVM_MMIO_HANDLER_NR 4 -static struct hvm_mmio_handler *hvm_mmio_handlers[HVM_MMIO_HANDLER_NR] = +static const struct hvm_mmio_handler *const +hvm_mmio_handlers[HVM_MMIO_HANDLER_NR] = { &hpet_mmio_handler, &vlapic_mmio_handler, diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/hvm/quirks.c --- a/xen/arch/x86/hvm/quirks.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/hvm/quirks.c Wed Oct 28 10:54:50 2009 +0000 @@ -23,7 +23,7 @@ #include <xen/bitmap.h> #include <asm/hvm/support.h> -int hvm_port80_allowed = -1; +int __read_mostly hvm_port80_allowed = -1; boolean_param("hvm_port80", hvm_port80_allowed); static int __init dmi_hvm_deny_port80(/*const*/ struct dmi_system_id *id) diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/hvm/svm/svm.c --- a/xen/arch/x86/hvm/svm/svm.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/hvm/svm/svm.c Wed Oct 28 10:54:50 2009 +0000 @@ -1233,7 +1233,7 @@ static void svm_invlpg_intercept(unsigne svm_asid_g_invlpg(curr, vaddr); } -static struct hvm_function_table svm_function_table = { +static struct hvm_function_table __read_mostly svm_function_table = { .name = "SVM", .cpu_down = svm_cpu_down, .domain_initialise = svm_domain_initialise, diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/hvm/vioapic.c --- a/xen/arch/x86/hvm/vioapic.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/hvm/vioapic.c Wed Oct 28 10:54:50 2009 +0000 @@ -246,7 +246,7 @@ static int vioapic_range(struct vcpu *v, (addr < vioapic->base_address + VIOAPIC_MEM_LENGTH))); } -struct hvm_mmio_handler vioapic_mmio_handler = { +const struct hvm_mmio_handler vioapic_mmio_handler = { .check_handler = vioapic_range, .read_handler = vioapic_read, .write_handler = vioapic_write diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/hvm/vlapic.c --- a/xen/arch/x86/hvm/vlapic.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/hvm/vlapic.c Wed Oct 28 10:54:50 2009 +0000 @@ -713,7 +713,7 @@ static int vlapic_range(struct vcpu *v, return (!vlapic_hw_disabled(vlapic) && (offset < PAGE_SIZE)); } -struct hvm_mmio_handler vlapic_mmio_handler = { +const struct hvm_mmio_handler vlapic_mmio_handler = { .check_handler = vlapic_range, .read_handler = vlapic_read, .write_handler = vlapic_write diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/hvm/vmsi.c --- a/xen/arch/x86/hvm/vmsi.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/hvm/vmsi.c Wed Oct 28 10:54:50 2009 +0000 @@ -290,7 +290,7 @@ static int msixtbl_range(struct vcpu *v, return !!virt; } -struct hvm_mmio_handler msixtbl_mmio_handler = { +const struct hvm_mmio_handler msixtbl_mmio_handler = { .check_handler = msixtbl_range, .read_handler = msixtbl_read, .write_handler = msixtbl_write diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/hvm/vmx/vmcs.c --- a/xen/arch/x86/hvm/vmx/vmcs.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/hvm/vmx/vmcs.c Wed Oct 28 10:54:50 2009 +0000 @@ -38,10 +38,10 @@ #include <asm/shadow.h> #include <asm/tboot.h> -static int opt_vpid_enabled = 1; +static int __read_mostly opt_vpid_enabled = 1; boolean_param("vpid", opt_vpid_enabled); -static int opt_unrestricted_guest_enabled = 1; +static int __read_mostly opt_unrestricted_guest_enabled = 1; boolean_param("unrestricted_guest", opt_unrestricted_guest_enabled); /* @@ -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 = 41; +static unsigned int __read_mostly ple_gap = 41; integer_param("ple_gap", ple_gap); -static unsigned int ple_window = 4096; +static unsigned int __read_mostly ple_window = 4096; integer_param("ple_window", ple_window); /* Dynamic (run-time adjusted) execution control flags. */ diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/hvm/vmx/vmx.c --- a/xen/arch/x86/hvm/vmx/vmx.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/hvm/vmx/vmx.c Wed Oct 28 10:54:50 2009 +0000 @@ -1389,7 +1389,7 @@ static void vmx_set_info_guest(struct vc vmx_vmcs_exit(v); } -static struct hvm_function_table vmx_function_table = { +static struct hvm_function_table __read_mostly vmx_function_table = { .name = "VMX", .domain_initialise = vmx_domain_initialise, .domain_destroy = vmx_domain_destroy, diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/microcode_amd.c --- a/xen/arch/x86/microcode_amd.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/microcode_amd.c Wed Oct 28 10:54:50 2009 +0000 @@ -323,7 +323,7 @@ static int microcode_resume_match(int cp return 0; } -static struct microcode_ops microcode_amd_ops = { +static const struct microcode_ops microcode_amd_ops = { .microcode_resume_match = microcode_resume_match, .cpu_request_microcode = cpu_request_microcode, .collect_cpu_info = collect_cpu_info, diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/microcode_intel.c --- a/xen/arch/x86/microcode_intel.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/microcode_intel.c Wed Oct 28 10:54:50 2009 +0000 @@ -368,7 +368,7 @@ static int microcode_resume_match(int cp (uci->cpu_sig.rev > nsig->rev)); } -static struct microcode_ops microcode_intel_ops = { +static const struct microcode_ops microcode_intel_ops = { .microcode_resume_match = microcode_resume_match, .cpu_request_microcode = cpu_request_microcode, .collect_cpu_info = collect_cpu_info, diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/mm.c --- a/xen/arch/x86/mm.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/mm.c Wed Oct 28 10:54:50 2009 +0000 @@ -4418,7 +4418,7 @@ static int ptwr_emulated_cmpxchg( container_of(ctxt, struct ptwr_emulate_ctxt, ctxt)); } -static struct x86_emulate_ops ptwr_emulate_ops = { +static const struct x86_emulate_ops ptwr_emulate_ops = { .read = ptwr_emulated_read, .insn_fetch = ptwr_emulated_read, .write = ptwr_emulated_write, diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/mm/hap/hap.c --- a/xen/arch/x86/mm/hap/hap.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/mm/hap/hap.c Wed Oct 28 10:54:50 2009 +0000 @@ -674,6 +674,11 @@ int hap_domctl(struct domain *d, xen_dom } } +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 = &hap_paging_real_mode; @@ -812,7 +817,7 @@ static unsigned long hap_gva_to_gfn_real } /* Entry points into this mode of the hap code. */ -struct paging_mode hap_paging_real_mode = { +static const struct paging_mode hap_paging_real_mode = { .page_fault = hap_page_fault, .invlpg = hap_invlpg, .gva_to_gfn = hap_gva_to_gfn_real_mode, @@ -822,7 +827,7 @@ struct paging_mode hap_paging_real_mode .guest_levels = 1 }; -struct paging_mode hap_paging_protected_mode = { +static const struct paging_mode hap_paging_protected_mode = { .page_fault = hap_page_fault, .invlpg = hap_invlpg, .gva_to_gfn = hap_gva_to_gfn_2level, @@ -832,7 +837,7 @@ struct paging_mode hap_paging_protected_ .guest_levels = 2 }; -struct paging_mode hap_paging_pae_mode = { +static const struct paging_mode hap_paging_pae_mode = { .page_fault = hap_page_fault, .invlpg = hap_invlpg, .gva_to_gfn = hap_gva_to_gfn_3level, @@ -842,7 +847,7 @@ struct paging_mode hap_paging_pae_mode = .guest_levels = 3 }; -struct paging_mode hap_paging_long_mode = { +static const struct paging_mode hap_paging_long_mode = { .page_fault = hap_page_fault, .invlpg = hap_invlpg, .gva_to_gfn = hap_gva_to_gfn_4level, diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/mm/shadow/common.c --- a/xen/arch/x86/mm/shadow/common.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/mm/shadow/common.c Wed Oct 28 10:54:50 2009 +0000 @@ -290,7 +290,7 @@ hvm_emulate_cmpxchg(enum x86_segment seg return X86EMUL_UNHANDLEABLE; } -static struct x86_emulate_ops hvm_shadow_emulator_ops = { +static const struct x86_emulate_ops hvm_shadow_emulator_ops = { .read = hvm_emulate_read, .insn_fetch = hvm_emulate_insn_fetch, .write = hvm_emulate_write, @@ -367,14 +367,14 @@ pv_emulate_cmpxchg(enum x86_segment seg, return X86EMUL_UNHANDLEABLE; } -static struct x86_emulate_ops pv_shadow_emulator_ops = { +static const struct x86_emulate_ops pv_shadow_emulator_ops = { .read = pv_emulate_read, .insn_fetch = pv_emulate_read, .write = pv_emulate_write, .cmpxchg = pv_emulate_cmpxchg, }; -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 static void hash_foreach(struct vcpu *v, unsigned int callback_mask, - hash_callback_t callbacks[], + const hash_callback_t callbacks[], mfn_t callback_mfn) /* Walk the hash table looking at the types of the entries and * calling the appropriate callback function for each entry. @@ -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] = { + static const hash_callback_t callbacks[SH_type_unused] = { 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; /* Dispatch table for getting per-type functions */ - static hash_callback_t callbacks[SH_type_unused] = { + static const hash_callback_t callbacks[SH_type_unused] = { 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 /* 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] = { + static const hash_callback_t callbacks[SH_type_unused] = { NULL, /* none */ NULL, /* l1_32 */ NULL, /* fl1_32 */ @@ -2852,7 +2852,7 @@ static void sh_update_paging_modes(struc static void sh_update_paging_modes(struct vcpu *v) { struct domain *d = v->domain; - struct paging_mode *old_mode = v->arch.paging.mode; + const struct paging_mode *old_mode = v->arch.paging.mode; ASSERT(shadow_locked_by_me(d)); @@ -3855,7 +3855,7 @@ void shadow_audit_tables(struct vcpu *v) void shadow_audit_tables(struct vcpu *v) { /* Dispatch table for getting per-type functions */ - static hash_callback_t callbacks[SH_type_unused] = { + static const hash_callback_t callbacks[SH_type_unused] = { NULL, /* none */ SHADOW_INTERNAL_NAME(sh_audit_l1_table, 2), /* l1_32 */ SHADOW_INTERNAL_NAME(sh_audit_fl1_table, 2), /* fl1_32 */ diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/mm/shadow/multi.c --- a/xen/arch/x86/mm/shadow/multi.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/mm/shadow/multi.c Wed Oct 28 10:54:50 2009 +0000 @@ -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 = 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 = { +const struct paging_mode sh_paging_mode = { .page_fault = sh_page_fault, .invlpg = sh_invlpg, .gva_to_gfn = sh_gva_to_gfn, diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/mm/shadow/multi.h --- a/xen/arch/x86/mm/shadow/multi.h Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/mm/shadow/multi.h Wed Oct 28 10:54:50 2009 +0000 @@ -113,7 +113,7 @@ SHADOW_INTERNAL_NAME(sh_destroy_monitor_ SHADOW_INTERNAL_NAME(sh_destroy_monitor_table, GUEST_LEVELS) (struct vcpu *v, mfn_t mmfn); -extern struct paging_mode +extern const struct paging_mode SHADOW_INTERNAL_NAME(sh_paging_mode, GUEST_LEVELS); #if SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/mm/shadow/private.h --- a/xen/arch/x86/mm/shadow/private.h Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/mm/shadow/private.h Wed Oct 28 10:54:50 2009 +0000 @@ -747,7 +747,7 @@ struct sh_emulate_ctxt { #endif }; -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); diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/numa.c --- a/xen/arch/x86/numa.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/numa.c Wed Oct 28 10:54:50 2009 +0000 @@ -39,7 +39,7 @@ unsigned char apicid_to_node[MAX_LOCAL_A }; cpumask_t node_to_cpumask[MAX_NUMNODES] __read_mostly; -nodemask_t node_online_map = { { [0] = 1UL } }; +nodemask_t __read_mostly node_online_map = { { [0] = 1UL } }; /* Default NUMA to off for now. acpi=on required to enable it. */ int numa_off __initdata = 1; diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/oprofile/nmi_int.c --- a/xen/arch/x86/oprofile/nmi_int.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/oprofile/nmi_int.c Wed Oct 28 10:54:50 2009 +0000 @@ -29,7 +29,7 @@ struct op_counter_config counter_config[OP_MAX_COUNTER]; -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]; diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/oprofile/op_model_p4.c --- a/xen/arch/x86/oprofile/op_model_p4.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/oprofile/op_model_p4.c Wed Oct 28 10:54:50 2009 +0000 @@ -109,7 +109,7 @@ static int p4_unused_cccr[NUM_UNUSED_CCC /* p4 event codes in libop/op_event.h are indices into this table. */ -static struct p4_event_binding p4_events[NUM_EVENTS] = { +static const struct p4_event_binding p4_events[NUM_EVENTS] = { { /* BRANCH_RETIRED */ 0x05, 0x06, @@ -485,7 +485,7 @@ static void pmc_setup_one_p4_counter(uns unsigned int escr = 0; unsigned int high = 0; unsigned int counter_bit; - struct p4_event_binding *ev = NULL; + const struct p4_event_binding *ev = NULL; unsigned int stag; stag = get_stagger(); diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/oprofile/op_model_ppro.c --- a/xen/arch/x86/oprofile/op_model_ppro.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/oprofile/op_model_ppro.c Wed Oct 28 10:54:50 2009 +0000 @@ -309,7 +309,7 @@ void arch_perfmon_setup_counters(void) op_ppro_spec.num_controls = num_counters; } -struct op_x86_model_spec op_ppro_spec = { +struct op_x86_model_spec __read_mostly op_ppro_spec = { .num_counters = 2, .num_controls = 2, .fill_in_addresses = &ppro_fill_in_addresses, @@ -324,7 +324,7 @@ struct op_x86_model_spec op_ppro_spec = .save_msr = &ppro_save_msr }; -struct op_x86_model_spec op_arch_perfmon_spec = { +struct op_x86_model_spec __read_mostly op_arch_perfmon_spec = { /* num_counters/num_controls filled in at runtime */ .fill_in_addresses = &ppro_fill_in_addresses, .setup_ctrs = &ppro_setup_ctrs, diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/setup.c --- a/xen/arch/x86/setup.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/setup.c Wed Oct 28 10:54:50 2009 +0000 @@ -55,15 +55,15 @@ extern struct boot_video_info boot_vid_i extern struct boot_video_info boot_vid_info; /* opt_nosmp: If true, secondary processors are ignored. */ -static int opt_nosmp = 0; +static int __initdata opt_nosmp = 0; boolean_param("nosmp", opt_nosmp); /* maxcpus: maximum number of CPUs to activate. */ -static unsigned int max_cpus = NR_CPUS; +static unsigned int __initdata max_cpus = NR_CPUS; integer_param("maxcpus", max_cpus); /* opt_watchdog: If true, run a watchdog NMI on each processor. */ -static int opt_watchdog = 0; +static int __initdata opt_watchdog = 0; boolean_param("watchdog", opt_watchdog); /* opt_tsc_unstable: Override all tests; assume TSC is unreliable. */ @@ -94,13 +94,14 @@ boolean_param("cpuidle", xen_cpuidle); int early_boot = 1; -cpumask_t cpu_present_map; - -unsigned long xen_phys_start; +cpumask_t __read_mostly cpu_present_map; + +unsigned long __read_mostly xen_phys_start; #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 DEFINE_PER_CPU_READ_MOSTLY(struct desc_struct *, gdt_table) = boot_cpu_gdt_table; @@ -113,15 +114,14 @@ DEFINE_PER_CPU(struct tss_struct, init_t char __attribute__ ((__section__(".bss.stack_aligned"))) cpu0_stack[STACK_SIZE]; -struct cpuinfo_x86 boot_cpu_data = { 0, 0, 0, 0, -1 }; - -unsigned long mmu_cr4_features = X86_CR4_PSE | X86_CR4_PGE | X86_CR4_PAE; -EXPORT_SYMBOL(mmu_cr4_features); - -int acpi_disabled; - -int acpi_force; -char acpi_param[10] = ""; +struct cpuinfo_x86 __read_mostly boot_cpu_data = { 0, 0, 0, 0, -1 }; + +unsigned long __read_mostly mmu_cr4_features = X86_CR4_PSE | X86_CR4_PGE | X86_CR4_PAE; + +int __read_mostly acpi_disabled; + +int __read_mostly acpi_force; +static char __initdata acpi_param[10] = ""; static void __init parse_acpi_param(char *s) { /* Save the parameter so it can be propagated to domain0. */ diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/srat.c --- a/xen/arch/x86/srat.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/srat.c Wed Oct 28 10:54:50 2009 +0000 @@ -20,12 +20,12 @@ #include <asm/e820.h> #include <asm/page.h> -static struct acpi_table_slit *acpi_slit; +static struct acpi_table_slit *__read_mostly acpi_slit; static nodemask_t nodes_parsed __initdata; static nodemask_t nodes_found __initdata; static struct node nodes[MAX_NUMNODES] __initdata; -static u8 pxm2node[256] = { [0 ... 255] = 0xff }; +static u8 __read_mostly pxm2node[256] = { [0 ... 255] = 0xff }; /* Too small nodes confuse the VM badly. Usually they result from BIOS bugs. */ diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/tboot.c --- a/xen/arch/x86/tboot.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/tboot.c Wed Oct 28 10:54:50 2009 +0000 @@ -13,7 +13,7 @@ #include <crypto/vmac.h> /* tboot=<physical address of shared page> */ -static char opt_tboot[20] = ""; +static char __initdata opt_tboot[20] = ""; string_param("tboot", opt_tboot); /* Global pointer to shared data; NULL means no measured launch. */ @@ -26,8 +26,8 @@ static const uuid_t tboot_shared_uuid = static const uuid_t tboot_shared_uuid = TBOOT_SHARED_UUID; /* 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; /* * TXT configuration registers (offsets from TXT_{PUB, PRIV}_CONFIG_REGS_BASE) diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/traps.c --- a/xen/arch/x86/traps.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/traps.c Wed Oct 28 10:54:50 2009 +0000 @@ -73,9 +73,9 @@ * ignore: The NMI error is cleared and ignored. */ #ifdef NDEBUG -char opt_nmi[10] = "dom0"; +static char __read_mostly opt_nmi[10] = "dom0"; #else -char opt_nmi[10] = "fatal"; +static char __read_mostly opt_nmi[10] = "fatal"; #endif string_param("nmi", opt_nmi); diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/x86_32/entry.S --- a/xen/arch/x86/x86_32/entry.S Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/x86_32/entry.S Wed Oct 28 10:54:50 2009 +0000 @@ -640,7 +640,7 @@ ENTRY(setup_vm86_frame) addl $16,%esp ret -.data +.section .rodata, "a", @progbits ENTRY(exception_table) .long do_divide_error diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/x86_32/mm.c --- a/xen/arch/x86/x86_32/mm.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/x86_32/mm.c Wed Oct 28 10:54:50 2009 +0000 @@ -36,10 +36,10 @@ l2_pgentry_t __attribute__ ((__section__ extern l1_pgentry_t l1_identmap[L1_PAGETABLE_ENTRIES]; -unsigned int PAGE_HYPERVISOR = __PAGE_HYPERVISOR; -unsigned int PAGE_HYPERVISOR_NOCACHE = __PAGE_HYPERVISOR_NOCACHE; - -static unsigned long mpt_size; +unsigned int __read_mostly PAGE_HYPERVISOR = __PAGE_HYPERVISOR; +unsigned int __read_mostly PAGE_HYPERVISOR_NOCACHE = __PAGE_HYPERVISOR_NOCACHE; + +static unsigned long __read_mostly mpt_size; void *alloc_xen_pagetable(void) { diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/x86_64/entry.S --- a/xen/arch/x86/x86_64/entry.S Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/x86_64/entry.S Wed Oct 28 10:54:50 2009 +0000 @@ -629,7 +629,7 @@ ENTRY(machine_check) movl $TRAP_machine_check,4(%rsp) jmp handle_ist_exception -.data +.section .rodata, "a", @progbits ENTRY(exception_table) .quad do_divide_error diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/x86_64/mm.c --- a/xen/arch/x86/x86_64/mm.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/x86_64/mm.c Wed Oct 28 10:54:50 2009 +0000 @@ -43,7 +43,7 @@ unsigned long __read_mostly pfn_hole_mas unsigned long __read_mostly pfn_hole_mask = 0; unsigned int __read_mostly pfn_pdx_hole_shift = 0; -unsigned int m2p_compat_vstart = __HYPERVISOR_COMPAT_VIRT_START; +unsigned int __read_mostly m2p_compat_vstart = __HYPERVISOR_COMPAT_VIRT_START; DEFINE_PER_CPU_READ_MOSTLY(void *, compat_arg_xlat); diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/x86_emulate/x86_emulate.c --- a/xen/arch/x86/x86_emulate/x86_emulate.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/x86_emulate/x86_emulate.c Wed Oct 28 10:54:50 2009 +0000 @@ -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 = 0; return ops->read(seg, offset, val, bytes, ctxt); @@ -848,7 +848,7 @@ static int static int get_cpl( struct x86_emulate_ctxt *ctxt, - struct x86_emulate_ops *ops) + const struct x86_emulate_ops *ops) { struct segment_register reg; @@ -865,7 +865,7 @@ static int static int _mode_iopl( struct x86_emulate_ctxt *ctxt, - struct x86_emulate_ops *ops) + const struct x86_emulate_ops *ops) { int cpl = get_cpl(ctxt, ops); if ( cpl == -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 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 @@ static int 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 @@ static int static int in_longmode( struct x86_emulate_ctxt *ctxt, - struct x86_emulate_ops *ops) + const struct x86_emulate_ops *ops) { uint64_t efer; @@ -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 == NULL) || (ops->write_segment == NULL) ) @@ -1202,7 +1202,7 @@ int 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 = *ctxt->regs; diff -r 514510e6c7cb -r 5a224e101cb3 xen/arch/x86/x86_emulate/x86_emulate.h --- a/xen/arch/x86/x86_emulate/x86_emulate.h Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/arch/x86/x86_emulate/x86_emulate.h Wed Oct 28 10:54:50 2009 +0000 @@ -395,7 +395,7 @@ int int x86_emulate( struct x86_emulate_ctxt *ctxt, - struct x86_emulate_ops *ops); + const struct x86_emulate_ops *ops); /* * Given the 'reg' portion of a ModRM byte, and a register block, return a diff -r 514510e6c7cb -r 5a224e101cb3 xen/common/lib.c --- a/xen/common/lib.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/common/lib.c Wed Oct 28 10:54:50 2009 +0000 @@ -5,7 +5,7 @@ #include <asm/byteorder.h> /* for ctype.h */ -unsigned char _ctype[] = { +const unsigned char _ctype[] = { _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 */ diff -r 514510e6c7cb -r 5a224e101cb3 xen/common/libelf/libelf-dominfo.c --- a/xen/common/libelf/libelf-dominfo.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/common/libelf/libelf-dominfo.c Wed Oct 28 10:54:50 2009 +0000 @@ -7,14 +7,14 @@ /* ------------------------------------------------------------------------ */ /* xen features */ -const char *elf_xen_feature_names[] = { +static const char *const elf_xen_feature_names[] = { [XENFEAT_writable_page_tables] = "writable_page_tables", [XENFEAT_writable_descriptor_tables] = "writable_descriptor_tables", [XENFEAT_auto_translated_physmap] = "auto_translated_physmap", [XENFEAT_supervisor_mode_kernel] = "supervisor_mode_kernel", [XENFEAT_pae_pgdir_above_4gb] = "pae_pgdir_above_4gb" }; -const int elf_xen_features = +static const int elf_xen_features = sizeof(elf_xen_feature_names) / sizeof(elf_xen_feature_names[0]); int elf_xen_parse_features(const char *features, diff -r 514510e6c7cb -r 5a224e101cb3 xen/common/sched_credit.c --- a/xen/common/sched_credit.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/common/sched_credit.c Wed Oct 28 10:54:50 2009 +0000 @@ -1375,7 +1375,7 @@ static void csched_tick_resume(void) - now % MILLISECS(CSCHED_MSECS_PER_TICK) ); } -struct scheduler sched_credit_def = { +const struct scheduler sched_credit_def = { .name = "SMP Credit Scheduler", .opt_name = "credit", .sched_id = XEN_SCHEDULER_CREDIT, diff -r 514510e6c7cb -r 5a224e101cb3 xen/common/sched_sedf.c --- a/xen/common/sched_sedf.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/common/sched_sedf.c Wed Oct 28 10:54:50 2009 +0000 @@ -1456,7 +1456,7 @@ static int sedf_adjust(struct domain *p, return 0; } -struct scheduler sched_sedf_def = { +const struct scheduler sched_sedf_def = { .name = "Simple EDF Scheduler", .opt_name = "sedf", .sched_id = XEN_SCHEDULER_SEDF, diff -r 514510e6c7cb -r 5a224e101cb3 xen/common/schedule.c --- a/xen/common/schedule.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/common/schedule.c Wed Oct 28 10:54:50 2009 +0000 @@ -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); -extern struct scheduler sched_sedf_def; -extern struct scheduler sched_credit_def; -static struct scheduler *schedulers[] = { +extern const struct scheduler sched_sedf_def; +extern const struct scheduler sched_credit_def; +static const struct scheduler *__initdata schedulers[] = { &sched_sedf_def, &sched_credit_def, NULL }; -static struct scheduler ops; +static struct scheduler __read_mostly ops; #define SCHED_OP(fn, ...) \ (( ops.fn != NULL ) ? ops.fn( __VA_ARGS__ ) \ diff -r 514510e6c7cb -r 5a224e101cb3 xen/drivers/char/console.c --- a/xen/drivers/char/console.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/drivers/char/console.c Wed Oct 28 10:54:50 2009 +0000 @@ -44,19 +44,19 @@ string_param("console", opt_console); /* Char 1: CTRL+<char1> 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] = "a"; +static unsigned char __read_mostly opt_conswitch[3] = "a"; string_param("conswitch", opt_conswitch); /* 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); /* 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); /* 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); /* conring_size: allows a large console ring than default (16kB). */ @@ -65,10 +65,11 @@ size_param("conring_size", opt_conring_s #define _CONRING_SIZE 16384 #define CONRING_IDX_MASK(i) ((i)&(conring_size-1)) -static char _conring[_CONRING_SIZE], *conring = _conring; -static uint32_t conring_size = _CONRING_SIZE, conringc, conringp; - -static int sercon_handle = -1; +static char _conring[_CONRING_SIZE], *__read_mostly conring = _conring; +static uint32_t __read_mostly conring_size = _CONRING_SIZE; +static uint32_t conringc, conringp; + +static int __read_mostly sercon_handle = -1; static DEFINE_SPINLOCK(console_lock); @@ -103,10 +104,10 @@ static DEFINE_SPINLOCK(console_lock); #define XENLOG_DEFAULT 1 /* XENLOG_WARNING */ #define XENLOG_GUEST_DEFAULT 1 /* XENLOG_WARNING */ -static int xenlog_upper_thresh = XENLOG_UPPER_THRESHOLD; -static int xenlog_lower_thresh = XENLOG_LOWER_THRESHOLD; -static int xenlog_guest_upper_thresh = XENLOG_GUEST_UPPER_THRESHOLD; -static int xenlog_guest_lower_thresh = XENLOG_GUEST_LOWER_THRESHOLD; +static int __read_mostly xenlog_upper_thresh = XENLOG_UPPER_THRESHOLD; +static int __read_mostly xenlog_lower_thresh = XENLOG_LOWER_THRESHOLD; +static int __read_mostly xenlog_guest_upper_thresh = XENLOG_GUEST_UPPER_THRESHOLD; +static int __read_mostly xenlog_guest_lower_thresh = XENLOG_GUEST_LOWER_THRESHOLD; static void parse_loglvl(char *s); static void parse_guest_loglvl(char *s); @@ -273,7 +274,7 @@ static void sercon_puts(const char *s) /* CTRL-<switch_char> switches input direction between Xen and DOM0. */ #define switch_code (opt_conswitch[0]-'a'+1) -static int xen_rx = 1; /* FALSE => serial input passed to domain 0. */ +static int __read_mostly xen_rx = 1; /* FALSE => serial input passed to domain 0. */ static void switch_serial_input(void) { @@ -773,10 +774,10 @@ int __printk_ratelimit(int ratelimit_ms, } /* minimum time in ms between messages */ -int printk_ratelimit_ms = 5 * 1000; +static int __read_mostly printk_ratelimit_ms = 5 * 1000; /* number of messages we send before ratelimiting */ -int printk_ratelimit_burst = 10; +static int __read_mostly printk_ratelimit_burst = 10; int printk_ratelimit(void) { diff -r 514510e6c7cb -r 5a224e101cb3 xen/drivers/char/ns16550.c --- a/xen/drivers/char/ns16550.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/drivers/char/ns16550.c Wed Oct 28 10:54:50 2009 +0000 @@ -272,7 +272,7 @@ static int ns16550_irq(struct serial_por return ((uart->irq > 0) ? uart->irq : -1); } -static struct uart_driver ns16550_driver = { +static struct uart_driver __read_mostly ns16550_driver = { .init_preirq = ns16550_init_preirq, .init_postirq = ns16550_init_postirq, .endboot = ns16550_endboot, diff -r 514510e6c7cb -r 5a224e101cb3 xen/drivers/char/serial.c --- a/xen/drivers/char/serial.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/drivers/char/serial.c Wed Oct 28 10:54:50 2009 +0000 @@ -18,7 +18,7 @@ /* Never drop characters, even if the async transmit buffer fills. */ /* #define SERIAL_NEVER_DROP_CHARS 1 */ -unsigned int serial_txbufsz = 16384; +unsigned int __read_mostly serial_txbufsz = 16384; size_param("serial_tx_buffer", serial_txbufsz); #define mask_serial_rxbuf_idx(_i) ((_i)&(serial_rxbufsz-1)) diff -r 514510e6c7cb -r 5a224e101cb3 xen/drivers/passthrough/amd/pci_amd_iommu.c --- a/xen/drivers/passthrough/amd/pci_amd_iommu.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c Wed Oct 28 10:54:50 2009 +0000 @@ -430,7 +430,7 @@ static int amd_iommu_group_id(u8 bus, u8 return rt; } -struct iommu_ops amd_iommu_ops = { +const struct iommu_ops amd_iommu_ops = { .init = amd_iommu_domain_init, .add_device = amd_iommu_add_device, .remove_device = amd_iommu_remove_device, diff -r 514510e6c7cb -r 5a224e101cb3 xen/drivers/passthrough/iommu.c --- a/xen/drivers/passthrough/iommu.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/drivers/passthrough/iommu.c Wed Oct 28 10:54:50 2009 +0000 @@ -292,7 +292,7 @@ int iommu_get_device_group(struct domain int group_id, sdev_id; u32 bdf; int i = 0; - struct iommu_ops *ops = hd->platform_ops; + const struct iommu_ops *ops = hd->platform_ops; if ( !iommu_enabled || !ops || !ops->get_device_group_id ) return 0; @@ -327,39 +327,39 @@ void iommu_update_ire_from_apic( void iommu_update_ire_from_apic( unsigned int apic, unsigned int reg, unsigned int value) { - struct iommu_ops *ops = iommu_get_ops(); + const struct iommu_ops *ops = 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 = iommu_get_ops(); + const struct iommu_ops *ops = iommu_get_ops(); ops->update_ire_from_msi(msi_desc, msg); } void iommu_read_msi_from_ire( struct msi_desc *msi_desc, struct msi_msg *msg) { - struct iommu_ops *ops = iommu_get_ops(); + const struct iommu_ops *ops = iommu_get_ops(); ops->read_msi_from_ire(msi_desc, msg); } unsigned int iommu_read_apic_from_ire(unsigned int apic, unsigned int reg) { - struct iommu_ops *ops = iommu_get_ops(); + const struct iommu_ops *ops = iommu_get_ops(); return ops->read_apic_from_ire(apic, reg); } void iommu_resume() { - struct iommu_ops *ops = iommu_get_ops(); + const struct iommu_ops *ops = iommu_get_ops(); if ( iommu_enabled ) ops->resume(); } void iommu_suspend() { - struct iommu_ops *ops = iommu_get_ops(); + const struct iommu_ops *ops = iommu_get_ops(); if ( iommu_enabled ) ops->suspend(); } diff -r 514510e6c7cb -r 5a224e101cb3 xen/drivers/passthrough/vtd/iommu.c --- a/xen/drivers/passthrough/vtd/iommu.c Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/drivers/passthrough/vtd/iommu.c Wed Oct 28 10:54:50 2009 +0000 @@ -1944,7 +1944,7 @@ static void vtd_resume(void) } } -struct iommu_ops intel_iommu_ops = { +const struct iommu_ops intel_iommu_ops = { .init = intel_iommu_domain_init, .add_device = intel_iommu_add_device, .remove_device = intel_iommu_remove_device, diff -r 514510e6c7cb -r 5a224e101cb3 xen/include/asm-ia64/hvm/iommu.h --- a/xen/include/asm-ia64/hvm/iommu.h Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/include/asm-ia64/hvm/iommu.h Wed Oct 28 10:54:50 2009 +0000 @@ -8,7 +8,7 @@ #include <asm/iosapic.h> struct iommu_ops; -extern struct iommu_ops intel_iommu_ops; +extern const struct iommu_ops intel_iommu_ops; extern int intel_vtd_setup(void); #define iommu_get_ops() (&intel_iommu_ops) diff -r 514510e6c7cb -r 5a224e101cb3 xen/include/asm-x86/domain.h --- a/xen/include/asm-x86/domain.h Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/include/asm-x86/domain.h Wed Oct 28 10:54:50 2009 +0000 @@ -187,7 +187,7 @@ struct paging_domain { 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 */ diff -r 514510e6c7cb -r 5a224e101cb3 xen/include/asm-x86/genapic.h --- a/xen/include/asm-x86/genapic.h Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/include/asm-x86/genapic.h Wed Oct 28 10:54:50 2009 +0000 @@ -18,7 +18,7 @@ struct mpc_config_processor; struct mpc_config_processor; struct genapic { - char *name; + const char *name; int (*probe)(void); /* When one of the next two hooks returns 1 the genapic @@ -48,9 +48,9 @@ struct genapic { APICFUNC(mps_oem_check), \ APICFUNC(acpi_madt_oem_check) -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; void init_apic_ldr_flat(void); void clustered_apic_check_flat(void); diff -r 514510e6c7cb -r 5a224e101cb3 xen/include/asm-x86/hap.h --- a/xen/include/asm-x86/hap.h Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/include/asm-x86/hap.h Wed Oct 28 10:54:50 2009 +0000 @@ -97,11 +97,6 @@ int hap_track_dirty_vram(struct domain unsigned long nr, XEN_GUEST_HANDLE_64(uint8) dirty_bitmap); -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 */ /* diff -r 514510e6c7cb -r 5a224e101cb3 xen/include/asm-x86/hvm/iommu.h --- a/xen/include/asm-x86/hvm/iommu.h Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/include/asm-x86/hvm/iommu.h Wed Oct 28 10:54:50 2009 +0000 @@ -2,12 +2,12 @@ #define __ASM_X86_HVM_IOMMU_H__ 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); -static inline struct iommu_ops *iommu_get_ops(void) +static inline const struct iommu_ops *iommu_get_ops(void) { switch ( boot_cpu_data.x86_vendor ) { diff -r 514510e6c7cb -r 5a224e101cb3 xen/include/xen/ctype.h --- a/xen/include/xen/ctype.h Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/include/xen/ctype.h Wed Oct 28 10:54:50 2009 +0000 @@ -15,7 +15,7 @@ #define _X 0x40 /* hex digit */ #define _SP 0x80 /* hard space (0x20) */ -extern unsigned char _ctype[]; +extern const unsigned char _ctype[]; #define __ismask(x) (_ctype[(int)(unsigned char)(x)]) diff -r 514510e6c7cb -r 5a224e101cb3 xen/include/xen/hvm/iommu.h --- a/xen/include/xen/hvm/iommu.h Wed Oct 28 10:54:20 2009 +0000 +++ b/xen/include/xen/hvm/iommu.h Wed Oct 28 10:54:50 2009 +0000 @@ -43,7 +43,7 @@ struct hvm_iommu { struct page_info *root_table; /* iommu_ops */ - struct iommu_ops *platform_ops; + const struct iommu_ops *platform_ops; }; #endif /* __XEN_HVM_IOMMU_H__ */ _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |