[PATCH 0/3] ikconfig and load module helper patches.
by Toshikazu Nakayama
Declare get_kernel_config(), load_module_symbols_helper()
for crash outside extension users.
CRASH_MODULE_PATH valiable can apply to search non-standard module path
from load_module_symbols_helper() and "mod" command.
- get_kernel_config("config name", &val)
Return one of target kernel configurations.
If val == NULL, return value is poinited whether config is valid or not.
IKCONFIG_N: kernel config is not set (not valid).
IKCONFIG_Y: kernel config is set y (valid).
IKCONFIG_M: kernel config is set m (valid).
IKCONFIG_STR: kernel config is values or strings, etc (valid).
"help -k" can display ikconfig setup state,
number of valid ikconfig entries, function calls.
Notes:
1. How to activate get_kernel_config().
read_in_kernel_config(IKCFG_SETUP)
-> get_kernel_config() become active.
read_in_kernel_config(IKCFG_FREE)
-> get_kernel_config() become iniactive.
2. This function require CONFIG_IKCONFIG=y. Otherwise user is warned.
Functional change from previous one.
"config name" can be allowed both with or without CONFIG_ prefix strings.
[ Dave's recommendation ]
- load_module_symbols_helper("module name")
Load specified kernel module symbols with argument.
This is simplified usage from original load_module_symbols().
Add "CRASH_MODULE_PATH" valiable which can use to resolve
non-standard module path.
Functional change from previous one.
"CRASH_MODULE_PATH" could be used by the "mod -s" command as well.
[ Dave's recommendation ]
Example usage:
< in .crashrc >
mod -s ext3
mod -s jbd
:
:
export CRASH_MODULE_PATH="your module's root directory"
/usr/sbin/crash
Even if target kernel is changed,
crash will load appropriate ext3 or jbd modules by this valiable.
Toshikazu Nakayama (3):
new ikconfig API.
dump_kernel_table()
load_module_symbols_helper().
crash-5.1.1/defs.h | 14 +++++
crash-5.1.1/kernel.c | 148 ++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 162 insertions(+), 0 deletions(-)
--
1.7.4.rc2.3.g60a2e
13 years, 11 months
[PATCH] load_module_symbols_helper().
by Toshikazu Nakayama
Hi Dave,
I wuold like to send one more patch which is helper of load_module_symbols().
(Simplified usage by resolving some module parameters at API inside.)
This is useful for dynamic module loading from extension modules
to be coordinated with previous ikconfig patch.
Also add new env CRASH_MODULE_PATH which can use from setenv() or export.
If load_module_symbols_helper() result is wrong, set this env properly.
[ remaining issues ]
- Search basic kernel module path to be installed
Try some closer path to default but enough or right?
- .gnu.linkonce.this_module section
In x86_64, module name '-' is changed with '_' in this section.
Is this conversion arch depend? or Any other specific chars?
Thanks,
Toshi.
----------------------------------------------------------
[ Test code image ]
#include <defs.h>
static int kvm_done, kvm_intel_done;
void kvm_symbol_setup(void)
{
/* dummy: structs or global symbols of KVM initilize */
kvm_done = 1;
}
void kvm_intel_symbol_setup(void)
{
/* dummy: structs or global symbols of VMX initilize */
kvm_intel_done = 1;
}
static void __attribute__((constructor))
module_load_test(void)
{
int ikconfig;
read_in_kernel_config(IKCFG_SETUP);
ikconfig = get_kernel_config("KVM", NULL);
if (ikconfig == IKCONFIG_Y)
kvm_symbol_setup();
else if (ikconfig == IKCONFIG_M)
if (load_module_symbols_helper("kvm", "arch/x86/kvm"))
kvm_symbol_setup();
ikconfig = get_kernel_config("KVM_INTEL", NULL);
if (ikconfig == IKCONFIG_Y)
kvm_intel_symbol_setup();
else if (ikconfig == IKCONFIG_M)
if (load_module_symbols_helper("kvm-intel", "arch/x86/kvm"))
kvm_intel_symbol_setup();
if (kvm_done)
fprintf(fp, "kvm module symbols loaded\n");
if (kvm_intel_done)
fprintf(fp, "kvm-intel module symbols loaded\n");
}
static void __attribute__((destructor))
module_load_test_fin(void)
{
read_in_kernel_config(IKCFG_FREE);
}
[ Result ]
crash> mod | grep kvm
ffffffffa008dba0 kvm 175160 (not loaded) [CONFIG_KALLSYMS]
ffffffffa00a4c40 kvm_intel 39368 (not loaded) [CONFIG_KALLSYMS]
crash> extend test.so
kvm module symbols loaded
kvm-intel module symbols loaded
extend: ./test.so: no commands registered: shared object unloaded
crash> mod | grep kvm
ffffffffa008dba0 kvm 175160 /lib/modules/2.6.35/kernel/arch/x86/kvm/kvm.ko
ffffffffa00a4c40 kvm_intel 39368 /lib/modules/2.6.35/kernel/arch/x86/kvm/kvm-intel.ko
Toshikazu Nakayama (1):
Add helper routine for load_module_symbols().
crash-5.1.1/defs.h | 1 +
crash-5.1.1/symbols.c | 89 +++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 90 insertions(+), 0 deletions(-)
--
1.7.4.rc2
13 years, 11 months
[PATCH 0/2] The new API about ikconfig.
by Toshikazu Nakayama
Hi,
I would like to suggest new ikconfig's API from defs.h.
The get_kernel_config("config name without CONFIG_ prefix", &val)
will return one of target kernel configurations.
If val == NULL, return value is poinited whether config is valid or not.
IKCONFIG_N: kernel config is not set (not valid).
IKCONFIG_Y: kernel config is set y (valid).
IKCONFIG_M: kernel config is set m (valid).
IKCONFIG_STR: kernel config is values or strings, etc (valid).
API require CONFIG_IKCONFIG=y. Otherwise user is warned.
I think it is useful for such as extension module developers
to write kernel config switch code.
Although ifdef or symbol APIs can be used instead,
I believe using this API can write more impressive or flexible code
about kernel config depended parts (over my senses...).
Thanks,
Toshi.
-----------------------------------------------------------
Example usage: Resolve RADIX_TREE_MAP_SHIFT from config depends.
[ code of kernel-2.6.35 ]
#define RADIX_TREE_MAP_SHIFT (CONFIG_BASE_SMALL ? 4 : 6)
[ code of crash utility or extension modules ]
static int radix_tree_map_shift = 6;
#define RADIX_TREE_MAP_SHIFT radix_tree_map_shift
int _init(void)
{
read_in_kernel_config(IKCFG_SETUP);
if (get_kernel_config("BASE_SMALL", NULL) == IKCONFIG_Y)
radix_tree_map_shift = 4;
return 0;
}
int int _fini(void)
{
read_in_kernel_config(IKCFG_FREE);
return 0;
}
Toshikazu Nakayama (2):
new ikconfig API.
dump_kernel_table()
crash-5.1.1/defs.h | 13 ++++
crash-5.1.1/kernel.c | 166 +++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 178 insertions(+), 1 deletions(-)
--
1.7.4.rc2
13 years, 11 months
[PATCH 0/7] Make crash work with Xen4 dumps
by Petr Tesarik
Hi Dave et al.
I re-worked my patch series, so it works properly both on Xen4 dumps and Xen
3.3 dumps (and SUSE Xen 3.3 from SLES11 GA, which has some additional tweaks).
The complete patchset comprises:
01: Make the __per_cpu_offset symbol available
02: Make XEN_VIRT_START depend on Xen version
03: Fix missing 'init_tss' symbol in Xen4
04: Allocate the Xen domain vcpu array dynamically
05: Use the size of the Xen domain VCPU array if available
06: Account for the changed type of the domain.vcpu field in Xen4
07: Change the way of determining the Xen scheduler
Petr Tesarik
SUSE Linux
13 years, 11 months
[PATCH] Account for the changed type of the domain.vcpu field in Xen4
by Petr Tesarik
The 'vcpu' field changed from a fixed array to a pointer to an array. Change
xen_hyper_store_domain_context to account for this change.
Signed-off-by: Petr Tesarik <ptesarik(a)suse.cz>
---
xen_hyper.c | 40 +++++++++++++++++++++++++++++++++++++---
xen_hyper_defs.h | 1 +
2 files changed, 38 insertions(+), 3 deletions(-)
--- a/xen_hyper.c
+++ b/xen_hyper.c
@@ -219,6 +219,7 @@ xen_hyper_domain_init(void)
XEN_HYPER_MEMBER_OFFSET_INIT(domain_is_shutting_down, "domain", "is_shutting_down");
XEN_HYPER_MEMBER_OFFSET_INIT(domain_is_shut_down, "domain", "is_shut_down");
XEN_HYPER_MEMBER_OFFSET_INIT(domain_vcpu, "domain", "vcpu");
+ XEN_HYPER_MEMBER_OFFSET_INIT(domain_max_vcpus, "domain", "max_vcpus");
XEN_HYPER_MEMBER_OFFSET_INIT(domain_arch, "domain", "arch");
XEN_HYPER_STRUCT_SIZE_INIT(arch_shared_info, "arch_shared_info");
@@ -1207,6 +1208,8 @@ struct xen_hyper_domain_context *
xen_hyper_store_domain_context(struct xen_hyper_domain_context *dc,
ulong domain, char *dp)
{
+ unsigned int max_vcpus;
+ char *vcpup;
int i;
dc->domain = domain;
@@ -1244,9 +1247,40 @@ xen_hyper_store_domain_context(struct xe
dc->domain_flags = XEN_HYPER_DOMF_ERROR;
}
dc->evtchn = ULONG(dp + XEN_HYPER_OFFSET(domain_evtchn));
- for (i = 0; i < XEN_HYPER_MAX_VIRT_CPUS; i++) {
- dc->vcpu[i] = ULONG(dp + XEN_HYPER_OFFSET(domain_vcpu) + i*sizeof(void *));
- if (dc->vcpu[i]) XEN_HYPER_NR_VCPUS_IN_DOM(dc)++;
+
+ if (XEN_HYPER_VALID_MEMBER(domain_max_vcpus)) {
+ max_vcpus = UINT(dp + XEN_HYPER_OFFSET(domain_max_vcpus));
+ } else {
+ max_vcpus = XEN_HYPER_MAX_VIRT_CPUS;
+ }
+ if (MEMBER_TYPE("domain", "vcpu") == TYPE_CODE_ARRAY)
+ vcpup = dp + XEN_HYPER_OFFSET(domain_vcpu);
+ else {
+ ulong vcpu_array = ULONG(dp + XEN_HYPER_OFFSET(domain_vcpu));
+ if (vcpu_array && max_vcpus) {
+ if (!(vcpup =
+ malloc(max_vcpus * sizeof(void *)))) {
+ error(FATAL, "cannot malloc VCPU array for domain %lx.",
+ domain);
+ }
+ if (!readmem(vcpu_array, KVADDR,
+ vcpup, max_vcpus * sizeof(void*),
+ "VCPU array", RETURN_ON_ERROR)) {
+ error(FATAL, "cannot read VCPU array for domain %lx.",
+ domain);
+ }
+ } else {
+ vcpup = NULL;
+ }
+ }
+ if (vcpup) {
+ for (i = 0; i < max_vcpus; i++) {
+ dc->vcpu[i] = ULONG(vcpup + i*sizeof(void *));
+ if (dc->vcpu[i]) XEN_HYPER_NR_VCPUS_IN_DOM(dc)++;
+ }
+ if (vcpup != dp + XEN_HYPER_OFFSET(domain_vcpu)) {
+ free(vcpup);
+ }
}
return dc;
--- a/xen_hyper_defs.h
+++ b/xen_hyper_defs.h
@@ -674,6 +674,7 @@ struct xen_hyper_offset_table {
long domain_is_shutting_down;
long domain_is_shut_down;
long domain_vcpu;
+ long domain_max_vcpus;
long domain_arch;
#ifdef IA64
/* mm_struct */
13 years, 11 months
[PATCH] Change the way of determining the Xen scheduler
by Petr Tesarik
The command line options (such as opt_sched) are discarded after boot in Xen4,
so they are no longer available. Use the "ops" variable (if exists) to
determine the active scheduler. Without this patch, crash fails during
initialization on Xen4 hypervisor dumps with 'crash: schedule data not
found.'
Signed-off-by: Petr Tesarik <ptesarik(a)suse.cz>
---
xen_hyper.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
--- a/xen_hyper.c
+++ b/xen_hyper.c
@@ -445,13 +445,21 @@ xen_hyper_schedule_init(void)
error(FATAL, "cannot malloc scheduler struct space.\n");
}
buf = GETBUF(XEN_HYPER_SCHEDULER_NAME);
- opt_sched = symbol_value("opt_sched");
+ scheduler_opt_name = XEN_HYPER_OFFSET(scheduler_opt_name);
+ if (symbol_exists("ops")) {
+ if (!readmem(symbol_value("ops") + scheduler_opt_name, KVADDR,
+ &opt_sched, sizeof(ulong), "ops.opt_name",
+ RETURN_ON_ERROR)) {
+ error(FATAL, "cannot read ops.opt_name.\n");
+ }
+ } else {
+ opt_sched = symbol_value("opt_sched");
+ }
if (!readmem(opt_sched, KVADDR, xhscht->opt_sched,
XEN_HYPER_OPT_SCHED_SIZE, "opt_sched,", RETURN_ON_ERROR)) {
error(FATAL, "cannot read opt_sched,.\n");
}
schedulers = symbol_value("schedulers");
- scheduler_opt_name = XEN_HYPER_OFFSET(scheduler_opt_name);
addr = schedulers;
while (xhscht->name == NULL) {
if (!readmem(addr, KVADDR, schedulers_buf,
13 years, 11 months
[PATCH] Fix missing 'init_tss' symbol in Xen4
by Petr Tesarik
In Xen4, init_tss is a per-cpu symbol. Without this patch, crash fails on Xen4
hypervisor dumps during initialization with 'crash: cannot
resolve "init_tss"'.
Signed-off-by: Petr Tesarik <ptesarik(a)suse.cz>
---
xen_hyper.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
--- a/xen_hyper.c
+++ b/xen_hyper.c
@@ -319,6 +319,7 @@
struct xen_hyper_pcpu_context *pcc;
char *buf, *bp;
int i, cpuid;
+ int flag;
XEN_HYPER_MEMBER_OFFSET_INIT(cpu_info_guest_cpu_user_regs, "cpu_info", "guest_cpu_user_regs");
XEN_HYPER_MEMBER_OFFSET_INIT(cpu_info_processor_id, "cpu_info", "processor_id");
@@ -330,11 +331,21 @@
/* get physical cpu context */
xen_hyper_alloc_pcpu_context_space(XEN_HYPER_MAX_CPUS());
- init_tss_base = symbol_value("init_tss");
+ if (symbol_exists("per_cpu__init_tss")) {
+ init_tss_base = symbol_value("per_cpu__init_tss");
+ flag = TRUE;
+ } else {
+ init_tss_base = symbol_value("init_tss");
+ flag = FALSE;
+ }
buf = GETBUF(XEN_HYPER_SIZE(tss_struct));
for_cpu_indexes(i, cpuid)
{
- init_tss = init_tss_base + XEN_HYPER_SIZE(tss_struct) * cpuid;
+ if (flag)
+ init_tss = xen_hyper_per_cpu(init_tss_base, cpuid);
+ else
+ init_tss = init_tss_base +
+ XEN_HYPER_SIZE(tss_struct) * cpuid;
if (!readmem(init_tss, KVADDR, buf,
XEN_HYPER_SIZE(tss_struct), "init_tss", RETURN_ON_ERROR)) {
error(FATAL, "cannot read init_tss.\n");
13 years, 11 months
[PATCH] Make the __per_cpu_offset symbol available
by Petr Tesarik
Hi,
the code in xen_hyper_init() tries to determine the per-cpu shift from the
__per_cpu_shift symbol if available. This doesn't work because the symbol's
value is outside the kernel text address range. This patch makes a special
case for this symbol on Xen targets, so it can be used later.
Without this patch, crash initialization fails on SLES11 Xen hypervisor dumps,
because on incorrect per-cpu offset is assumed. The failure can't be fixed
simply by adding a version check, because SLES11 Xen is patched to increase
the per-cpu shift in order to support more CPUs.
It is also important not to try to relocate ABSOLUTE symbol (such as this
one), so add this condition in store_symbols().
Signed-off-by: Petr Tesarik <ptesarik(a)suse.cz>
---
ia64.c | 22 ++++++++++++++++++++--
symbols.c | 3 ++-
x86.c | 22 ++++++++++++++++++++--
x86_64.c | 22 ++++++++++++++++++++--
4 files changed, 62 insertions(+), 7 deletions(-)
--- a/ia64.c
+++ b/ia64.c
@@ -20,6 +20,7 @@
#include <sys/prctl.h>
static int ia64_verify_symbol(const char *, ulong, char);
+static int ia64_hyper_verify_symbol(const char *, ulong, char);
static int ia64_eframe_search(struct bt_info *);
static void ia64_back_trace_cmd(struct bt_info *);
static void ia64_old_unwind(struct bt_info *);
@@ -571,7 +572,12 @@ ia64_dump_machdep_table(ulong arg)
fprintf(fp, " memory_size: generic_memory_size()\n");
fprintf(fp, " vmalloc_start: ia64_vmalloc_start()\n");
fprintf(fp, " is_task_addr: ia64_is_task_addr()\n");
- fprintf(fp, " verify_symbol: ia64_verify_symbol()\n");
+ if (machdep->verify_symbol == ia64_verify_symbol)
+ fprintf(fp, " verify_symbol: ia64_verify_symbol()\n");
+ else if (machdep->verify_symbol == ia64_hyper_verify_symbol)
+ fprintf(fp, " verify_symbol: ia64_hyper_verify_symbol()\n");
+ else
+ fprintf(fp, " verify_symbol: %lx\n", (ulong)machdep->verify_symbol);
fprintf(fp, " dis_filter: ia64_dis_filter()\n");
fprintf(fp, " cmd_mach: ia64_cmd_mach()\n");
fprintf(fp, " get_smp_cpus: ia64_get_smp_cpus()\n");
@@ -724,6 +730,18 @@ ia64_verify_symbol(const char *name, ulo
(region == KERNEL_VMALLOC_REGION)));
}
+static int
+ia64_hyper_verify_symbol(const char *name, ulong value, char type)
+{
+ if (ia64_verify_symbol(name, value, type))
+ return TRUE;
+
+ if (STREQ(name, "__per_cpu_shift"))
+ return TRUE;
+
+ return FALSE;
+}
+
/*
* Look for likely exception frames in a stack.
@@ -4225,7 +4243,7 @@ ia64_init_hyper(int when)
break;
case PRE_SYMTAB:
- machdep->verify_symbol = ia64_verify_symbol;
+ machdep->verify_symbol = ia64_hyper_verify_symbol;
machdep->machspec = &ia64_machine_specific;
if (pc->flags & KERNEL_DEBUG_QUERY)
return;
--- a/symbols.c
+++ b/symbols.c
@@ -568,7 +568,8 @@ store_symbols(bfd *abfd, int dynamic, vo
bfd_get_symbol_info(abfd, sym, &syminfo);
if (machdep->verify_symbol(syminfo.name, syminfo.value,
syminfo.type)) {
- if (kt->flags & (RELOC_SET|RELOC_FORCE))
+ if ((kt->flags & (RELOC_SET|RELOC_FORCE)) &&
+ sym->section != &bfd_abs_section)
sp->value = relocate(syminfo.value,
(char *)syminfo.name, !(first++));
else
--- a/x86.c
+++ b/x86.c
@@ -986,6 +986,7 @@ static void eframe_init(void);
static char *extract_idt_function(ulong *, char *, ulong *);
static int x86_is_task_addr(ulong);
static int x86_verify_symbol(const char *, ulong, char);
+static int x86_hyper_verify_symbol(const char *, ulong, char);
static int x86_eframe_search(struct bt_info *);
static ulong x86_in_irqstack(ulong);
static int x86_dis_filter(ulong, char *);
@@ -3254,7 +3255,12 @@ x86_dump_machdep_table(ulong arg)
fprintf(fp, " memory_size: x86_memory_size()\n");
fprintf(fp, " vmalloc_start: x86_vmalloc_start()\n");
fprintf(fp, " is_task_addr: x86_is_task_addr()\n");
- fprintf(fp, " verify_symbol: x86_verify_symbol()\n");
+ if (machdep->verify_symbol == x86_verify_symbol)
+ fprintf(fp, " verify_symbol: x86_verify_symbol()\n");
+ else if (machdep->verify_symbol == x86_hyper_verify_symbol)
+ fprintf(fp, " verify_symbol: x86_hyper_verify_symbol()\n");
+ else
+ fprintf(fp, " verify_symbol: %lx\n", (ulong)machdep->verify_symbol);
fprintf(fp, " dis_filter: x86_dis_filter()\n");
fprintf(fp, " cmd_mach: x86_cmd_mach()\n");
fprintf(fp, " get_smp_cpus: x86_get_smp_cpus()\n");
@@ -3789,6 +3795,18 @@ x86_verify_symbol(const char *name, ulon
return TRUE;
}
+static int
+x86_hyper_verify_symbol(const char *name, ulong value, char type)
+{
+ if (x86_verify_symbol(name, value, type))
+ return TRUE;
+
+ if (STREQ(name, "__per_cpu_shift"))
+ return TRUE;
+
+ return FALSE;
+}
+
/*
* Filter disassembly output if the output radix is not gdb's default 10
*/
@@ -4967,7 +4985,7 @@ x86_init_hyper(int when)
switch (when)
{
case PRE_SYMTAB:
- machdep->verify_symbol = x86_verify_symbol;
+ machdep->verify_symbol = x86_hyper_verify_symbol;
if (pc->flags & KERNEL_DEBUG_QUERY)
return;
machdep->pagesize = memory_page_size();
--- a/x86_64.c
+++ b/x86_64.c
@@ -27,6 +27,7 @@ static int x86_64_uvtop_level4_rhel4_xen
static ulong x86_64_vmalloc_start(void);
static int x86_64_is_task_addr(ulong);
static int x86_64_verify_symbol(const char *, ulong, char);
+static int x86_64_hyper_verify_symbol(const char *, ulong, char);
static ulong x86_64_get_task_pgd(ulong);
static int x86_64_translate_pte(ulong, void *, ulonglong);
static ulong x86_64_processor_speed(void);
@@ -491,7 +492,12 @@ x86_64_dump_machdep_table(ulong arg)
fprintf(fp, " memory_size: generic_memory_size()\n");
fprintf(fp, " vmalloc_start: x86_64_vmalloc_start()\n");
fprintf(fp, " is_task_addr: x86_64_is_task_addr()\n");
- fprintf(fp, " verify_symbol: x86_64_verify_symbol()\n");
+ if (machdep->verify_symbol == x86_64_verify_symbol)
+ fprintf(fp, " verify_symbol: x86_64_verify_symbol()\n");
+ else if (machdep->verify_symbol == x86_64_hyper_verify_symbol)
+ fprintf(fp, " verify_symbol: x86_64_hyper_verify_symbol()\n");
+ else
+ fprintf(fp, " verify_symbol: %lx\n", (ulong)machdep->verify_symbol);
fprintf(fp, " dis_filter: x86_64_dis_filter()\n");
fprintf(fp, " cmd_mach: x86_64_cmd_mach()\n");
fprintf(fp, " get_smp_cpus: x86_64_get_smp_cpus()\n");
@@ -1978,6 +1984,18 @@ x86_64_verify_symbol(const char *name, u
return TRUE;
}
+static int
+x86_64_hyper_verify_symbol(const char *name, ulong value, char type)
+{
+ if (x86_64_verify_symbol(name, value, type))
+ return TRUE;
+
+ if (STREQ(name, "__per_cpu_shift"))
+ return TRUE;
+
+ return FALSE;
+}
+
/*
* Get the relevant page directory pointer from a task structure.
@@ -5949,7 +5967,7 @@ x86_64_init_hyper(int when)
switch (when)
{
case PRE_SYMTAB:
- machdep->verify_symbol = x86_64_verify_symbol;
+ machdep->verify_symbol = x86_64_hyper_verify_symbol;
machdep->machspec = &x86_64_machine_specific;
if (pc->flags & KERNEL_DEBUG_QUERY)
return;
13 years, 11 months
[PATCH] Increase max VCPU count for Xen on x86_64
by Petr Tesarik
The new maximum VCPU count is much larger, limited only by the hypervisor
memory layout, currently to 8192 CPUs.
Signed-off-by: Petr Tesarik <ptesarik(a)suse.cz>
---
xen_hyper_defs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/xen_hyper_defs.h
+++ b/xen_hyper_defs.h
@@ -123,7 +123,7 @@ typedef uint32_t Elf_Word;
#define XEN_HYPER_HZ 100
#endif
#ifdef X86_64
-#define XEN_HYPER_MAX_VIRT_CPUS (32)
+#define XEN_HYPER_MAX_VIRT_CPUS (8192)
#define XEN_HYPER_HZ 100
#endif
#ifdef IA64
13 years, 11 months
[PATCH] Make XEN_VIRT_START depend on Xen version
by Petr Tesarik
The XEN_VIRT_START constant was changed in Xen4, so it can no longer be a
simple define. Initialize it to its correct value depending on the Xen major
version.
Signed-off-by: Petr Tesarik <ptesarik(a)suse.cz>
---
xen_hyper.c | 7 +++++++
xen_hyper_defs.h | 5 ++++-
2 files changed, 11 insertions(+), 1 deletion(-)
--- a/xen_hyper.c
+++ b/xen_hyper.c
@@ -42,6 +42,13 @@
long member_offset;
#endif
+#ifdef X86_64
+ if (xen_major_version() >= 4)
+ xht->xen_virt_start = 0xffff82c480000000;
+ else
+ xht->xen_virt_start = 0xffff828c80000000;
+#endif
+
if (machine_type("X86_64") &&
symbol_exists("xen_phys_start") && !xen_phys_start())
error(WARNING,
--- a/xen_hyper_defs.h
+++ b/xen_hyper_defs.h
@@ -65,7 +65,7 @@
#define DIRECTMAP_VIRT_START (0xffff830000000000)
#define DIRECTMAP_VIRT_END (0xffff840000000000)
#define PAGE_OFFSET_XEN_HYPER DIRECTMAP_VIRT_START
-#define XEN_VIRT_START (0xffff828c80000000)
+#define XEN_VIRT_START (xht->xen_virt_start)
#define XEN_VIRT_ADDR(vaddr) \
(((vaddr) >= XEN_VIRT_START) && ((vaddr) < DIRECTMAP_VIRT_START))
#endif
@@ -408,6 +408,9 @@
int percpu_shift;
int idle_vcpu_size;
ulong *idle_vcpu_array;
+#ifdef X86_64
+ ulong xen_virt_start;
+#endif
};
struct xen_hyper_dumpinfo_context {
13 years, 11 months