342
348
fprintf(fp, "%sVM_XEN", others++ ? "|" : "");
343
349
if (machdep->flags & VM_XEN_RHEL4)
344
350
fprintf(fp, "%sVM_XEN_RHEL4", others++ ? "|" : "");
351
if (machdep->flags & VMEMMAP)
352
fprintf(fp, "%sVMEMMAP", others++ ? "|" : "");
345
353
if (machdep->flags & NO_TSS)
346
354
fprintf(fp, "%sNO_TSS", others++ ? "|" : "");
347
355
if (machdep->flags & SCHED_TEXT)
438
446
fprintf(fp, " vmalloc_end: %016lx\n", (ulong)ms->vmalloc_end);
439
447
fprintf(fp, " modules_vaddr: %016lx\n", (ulong)ms->modules_vaddr);
440
448
fprintf(fp, " modules_end: %016lx\n", (ulong)ms->modules_end);
449
fprintf(fp, " vmemmap_vaddr: %016lx %s\n", (ulong)ms->vmemmap_vaddr,
450
machdep->flags & VMEMMAP ? "" : "(unused)");
451
fprintf(fp, " vmemmap_end: %016lx %s\n", (ulong)ms->vmemmap_end,
452
machdep->flags & VMEMMAP ? "" : "(unused)");
441
453
fprintf(fp, " phys_base: %lx\n", (ulong)ms->phys_base);
442
454
fprintf(fp, " pml4: %lx\n", (ulong)ms->pml4);
443
455
fprintf(fp, " last_pml4_read: %lx\n", (ulong)ms->last_pml4_read);
3952
3966
// fprintf(fp, " L1 CACHE SIZE: %d\n", l1_cache_size());
3953
3967
fprintf(fp, "KERNEL VIRTUAL BASE: %lx\n", machdep->kvbase);
3954
3968
fprintf(fp, "KERNEL VMALLOC BASE: %lx\n", vt->vmalloc_start);
3969
if (machdep->flags & VMEMMAP)
3970
fprintf(fp, "KERNEL VMEMMAP BASE: %lx\n", machdep->machspec->vmemmap_vaddr);
3955
3971
fprintf(fp, " KERNEL START MAP: %lx\n", __START_KERNEL_map);
3956
3972
fprintf(fp, "KERNEL MODULES BASE: %lx\n", MODULES_VADDR);
3957
3973
fprintf(fp, " KERNEL STACK SIZE: %ld\n", STACKSIZE());
4323
4339
#include "netdump.h"
4326
* Determine the physical address base for relocatable kernels.
4329
x86_64_calc_phys_base(void)
4335
ulong phys_base, text_start, kernel_code_start;
4337
struct vmcore_data *vd;
4340
if (machdep->flags & PHYS_BASE) /* --machdep override */
4343
machdep->machspec->phys_base = 0; /* default/traditional */
4345
if (!kernel_symbol_exists("phys_base"))
4348
if (!symbol_exists("_text"))
4351
text_start = symbol_value("_text");
4354
if ((iomem = fopen("/proc/iomem", "r")) == NULL)
4358
while (fgets(buf, BUFSIZE, iomem)) {
4359
if (strstr(buf, ": Kernel code")) {
4370
if (!(p1 = strstr(buf, "-")))
4376
kernel_code_start = htol(buf, RETURN_ON_ERROR|QUIET, &errflag);
4380
machdep->machspec->phys_base = kernel_code_start -
4381
(text_start - __START_KERNEL_map);
4383
if (CRASHDEBUG(1)) {
4384
fprintf(fp, "_text: %lx ", text_start);
4385
fprintf(fp, "Kernel code: %lx -> ", kernel_code_start);
4386
fprintf(fp, "phys_base: %lx\n\n",
4387
machdep->machspec->phys_base);
4394
* Get relocation value from whatever dumpfile format is being used.
4397
if (DISKDUMP_DUMPFILE()) {
4398
if (diskdump_phys_base(&phys_base)) {
4399
machdep->machspec->phys_base = phys_base;
4401
fprintf(fp, "compressed kdump: phys_base: %lx\n",
4407
if ((vd = get_kdump_vmcore_data())) {
4408
for (i = 0; i < vd->num_pt_load_segments; i++) {
4409
phdr = vd->load64 + i;
4410
if ((phdr->p_vaddr >= __START_KERNEL_map) &&
4411
!(IS_VMALLOC_ADDR(phdr->p_vaddr))) {
4413
machdep->machspec->phys_base = phdr->p_paddr -
4414
(phdr->p_vaddr & ~(__START_KERNEL_map));
4416
if (CRASHDEBUG(1)) {
4417
fprintf(fp, "p_vaddr: %lx p_paddr: %lx -> ",
4418
phdr->p_vaddr, phdr->p_paddr);
4419
fprintf(fp, "phys_base: %lx\n\n",
4420
machdep->machspec->phys_base);
4429
if (XENDUMP_DUMPFILE() && (text_start == __START_KERNEL_map)) {
4431
* Xen kernels are not relocable (yet) and don't have the
4432
* "phys_base" entry point, so this must be a xendump of a
4433
* fully-virtualized relocatable kernel. No clues exist in
4434
* the xendump header, so hardwire phys_base to 2MB and hope
4437
machdep->machspec->phys_base = 0x200000;
4440
"default relocatable default phys_base: %lx\n",
4441
machdep->machspec->phys_base);
4446
4342
* From the xen vmcore, create an index of mfns for each page that makes
4447
4343
* up the dom0 kernel's complete phys_to_machine_mapping[max_pfn] array.
4702
4598
#include "xendump.h"
4601
* Determine the physical address base for relocatable kernels.
4604
x86_64_calc_phys_base(void)
4610
ulong phys_base, text_start, kernel_code_start;
4612
struct vmcore_data *vd;
4613
static struct xendump_data *xd;
4616
if (machdep->flags & PHYS_BASE) /* --machdep override */
4619
machdep->machspec->phys_base = 0; /* default/traditional */
4621
if (!kernel_symbol_exists("phys_base"))
4624
if (!symbol_exists("_text"))
4627
text_start = symbol_value("_text");
4630
if ((iomem = fopen("/proc/iomem", "r")) == NULL)
4634
while (fgets(buf, BUFSIZE, iomem)) {
4635
if (strstr(buf, ": Kernel code")) {
4646
if (!(p1 = strstr(buf, "-")))
4652
kernel_code_start = htol(buf, RETURN_ON_ERROR|QUIET, &errflag);
4656
machdep->machspec->phys_base = kernel_code_start -
4657
(text_start - __START_KERNEL_map);
4659
if (CRASHDEBUG(1)) {
4660
fprintf(fp, "_text: %lx ", text_start);
4661
fprintf(fp, "Kernel code: %lx -> ", kernel_code_start);
4662
fprintf(fp, "phys_base: %lx\n\n",
4663
machdep->machspec->phys_base);
4670
* Get relocation value from whatever dumpfile format is being used.
4673
if (DISKDUMP_DUMPFILE()) {
4674
if (diskdump_phys_base(&phys_base)) {
4675
machdep->machspec->phys_base = phys_base;
4677
fprintf(fp, "compressed kdump: phys_base: %lx\n",
4683
if ((vd = get_kdump_vmcore_data())) {
4684
for (i = 0; i < vd->num_pt_load_segments; i++) {
4685
phdr = vd->load64 + i;
4686
if ((phdr->p_vaddr >= __START_KERNEL_map) &&
4687
!(IS_VMALLOC_ADDR(phdr->p_vaddr))) {
4689
machdep->machspec->phys_base = phdr->p_paddr -
4690
(phdr->p_vaddr & ~(__START_KERNEL_map));
4692
if (CRASHDEBUG(1)) {
4693
fprintf(fp, "p_vaddr: %lx p_paddr: %lx -> ",
4694
phdr->p_vaddr, phdr->p_paddr);
4695
fprintf(fp, "phys_base: %lx\n\n",
4696
machdep->machspec->phys_base);
4705
if ((xd = get_xendump_data())) {
4706
if (text_start == __START_KERNEL_map) {
4708
* Xen kernels are not relocable (yet) and don't have
4709
* the "phys_base" entry point, so this is most likely
4710
* a xendump of a fully-virtualized relocatable kernel.
4711
* No clues exist in the xendump header, so hardwire
4712
* phys_base to 2MB and hope for the best.
4714
machdep->machspec->phys_base = 0x200000;
4717
"default relocatable phys_base: %lx\n",
4718
machdep->machspec->phys_base);
4720
} else if (text_start > __START_KERNEL_map) {
4721
switch (xd->flags & (XC_CORE_ELF|XC_CORE_NO_P2M))
4724
* If this is a new ELF-style xendump with no
4725
* p2m information, then it also must be a
4726
* fully-virtualized relocatable kernel. Again,
4727
* the xendump header is useless, and we don't
4728
* have /proc/iomem, so presume that the kernel
4729
* code starts at 2MB.
4731
case (XC_CORE_ELF|XC_CORE_NO_P2M):
4732
machdep->machspec->phys_base = 0x200000 -
4733
(text_start - __START_KERNEL_map);
4735
fprintf(fp, "default relocatable "
4737
machdep->machspec->phys_base);
4705
4749
* Create an index of mfns for each page that makes up the
4706
4750
* kernel's complete phys_to_machine_mapping[max_pfn] array.