[PATCH] kexec-tools: Read always one vmcoreinfo file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dne Po 23. ?ervence 2012 14:56:07 Petr Tesarik napsal(a):
> Dne ?t 5. ?ervence 2012 14:16:35 Daniel Kiper napsal(a):
> > vmcoreinfo file could exists under /sys/kernel (valid on baremetal only)
> > and/or under /sys/hypervisor (valid when Xen dom0 is running).
> > Read only one of them. It means that only one PT_NOTE will be
> > always created. Remove extra code for second PT_NOTE creation.
> 
> Hi Daniel,
> 
> are you absolutely sure this is the right thing to do? IIUC these two
> VMCORINFO notes are very different. The one from /sys/kernel/vmcoreinfo
> describes the Dom0 kernel (type 'VMCOREINFO'), while the one from
> /sys/hypervisor describes the Xen hypervisor (type 'XEN_VMCOREINFO'). If
> you keep only the hypervisor note, then e.g. makedumpfile won't be able to
> use dumplevel greater than 1, nor will it be able to extract the log
> buffer.

I've just verified this, and I'm confident we have to keep both notes in the 
dump file. Simon, please revert Daniel's patch to avoid regressions.

I'm attaching a sample VMCOREINFO_XEN and VMCOREINFO to demonstrate the 
difference. Note that the VMCOREINFO_XEN note is actually too big, because Xen 
doesn't bother to maintain the correct note size in the note header, so it 
always spans a complete page minus sizeof(Elf64_Nhdr)...

Regards,
Petr Tesarik

> Petr Tesarik
> SUSE Linux
> 
> > Signed-off-by: Daniel Kiper <daniel.kiper at oracle.com>
> > ---
> > 
> >  kexec/crashdump-elf.c |   33 +++++++--------------------------
> >  1 files changed, 7 insertions(+), 26 deletions(-)
> > 
> > diff --git a/kexec/crashdump-elf.c b/kexec/crashdump-elf.c
> > index 8d82db9..ec66548 100644
> > --- a/kexec/crashdump-elf.c
> > +++ b/kexec/crashdump-elf.c
> > @@ -40,8 +40,6 @@ int FUNC(struct kexec_info *info,
> > 
> >  	uint64_t notes_addr, notes_len;
> >  	uint64_t vmcoreinfo_addr, vmcoreinfo_len;
> >  	int has_vmcoreinfo = 0;
> > 
> > -	uint64_t vmcoreinfo_addr_xen, vmcoreinfo_len_xen;
> > -	int has_vmcoreinfo_xen = 0;
> > 
> >  	int (*get_note_info)(int cpu, uint64_t *addr, uint64_t *len);
> >  	
> >  	if (xen_present())
> > 
> > @@ -53,16 +51,14 @@ int FUNC(struct kexec_info *info,
> > 
> >  		return -1;
> >  	
> >  	}
> > 
> > -	if (get_kernel_vmcoreinfo(&vmcoreinfo_addr, &vmcoreinfo_len) == 0) {
> > -		has_vmcoreinfo = 1;
> > -	}
> > -
> > -	if (xen_present() &&
> > -	    get_xen_vmcoreinfo(&vmcoreinfo_addr_xen, &vmcoreinfo_len_xen) == 
0)
> > { -		has_vmcoreinfo_xen = 1;
> > -	}
> > +	if (xen_present()) {
> > +		if (!get_xen_vmcoreinfo(&vmcoreinfo_addr, &vmcoreinfo_len))
> > +			has_vmcoreinfo = 1;
> > +	} else
> > +		if (!get_kernel_vmcoreinfo(&vmcoreinfo_addr, &vmcoreinfo_len))
> > +			has_vmcoreinfo = 1;
> > 
> > -	sz = sizeof(EHDR) + (nr_cpus + has_vmcoreinfo + has_vmcoreinfo_xen) 
*
> > sizeof(PHDR) + +	sz = sizeof(EHDR) + (nr_cpus + has_vmcoreinfo) *
> > sizeof(PHDR) +
> > 
> >  	     ranges * sizeof(PHDR);
> >  	
> >  	/*
> > 
> > @@ -179,21 +175,6 @@ int FUNC(struct kexec_info *info,
> > 
> >  		dbgprintf_phdr("vmcoreinfo header", phdr);
> >  	
> >  	}
> > 
> > -	if (has_vmcoreinfo_xen) {
> > -		phdr = (PHDR *) bufp;
> > -		bufp += sizeof(PHDR);
> > -		phdr->p_type	= PT_NOTE;
> > -		phdr->p_flags	= 0;
> > -		phdr->p_offset  = phdr->p_paddr = vmcoreinfo_addr_xen;
> > -		phdr->p_vaddr   = 0;
> > -		phdr->p_filesz	= phdr->p_memsz	= vmcoreinfo_len_xen;
> > -		/* Do we need any alignment of segments? */
> > -		phdr->p_align	= 0;
> > -
> > -		(elf->e_phnum)++;
> > -		dbgprintf_phdr("vmcoreinfo_xen header", phdr);
> > -	}
> > -
> > 
> >  	/* Setup an PT_LOAD type program header for the region where
> >  	
> >  	 * Kernel is mapped if elf_info->kern_size is non-zero.
> >  	 */
> 
> _______________________________________________
> kexec mailing list
> kexec at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec
-------------- next part --------------
PAGESIZE=4096
SYMBOL(domain_list)=ffff82c48029e0f0
SYMBOL(frame_table)=ffff82c48020d908
SYMBOL(max_page)=ffff82c4802c1a68
SIZE(page_info)=32
SIZE(domain)=5504
OFFSET(page_info.count_info)=8
OFFSET(page_info._domain)=24
OFFSET(domain.domain_id)=0
OFFSET(domain.next_in_list)=96
SYMBOL(dom_xen)=ffff82c4802c1a78
SYMBOL(dom_io)=ffff82c4802c1a80
SYMBOL(pgd_l4)=ffff82c480294000

-------------- next part --------------
OSRELEASE=3.0.34-0.7-xen
PAGESIZE=4096
SYMBOL(init_uts_ns)=ffffffff806b2fc0
SYMBOL(node_online_map)=ffffffff8070e968
SYMBOL(swapper_pg_dir)=ffffffff80783000
SYMBOL(_stext)=ffffffff80004000
SYMBOL(vmlist)=ffffffff8082ea40
SYMBOL(mem_map)=ffffffff8082e950
SYMBOL(contig_page_data)=ffffffff80700f80
SIZE(page)=56
SIZE(pglist_data)=6912
SIZE(zone)=1664
SIZE(free_area)=88
SIZE(list_head)=16
SIZE(nodemask_t)=8
OFFSET(page.flags)=0
OFFSET(page._count)=8
OFFSET(page.mapping)=24
OFFSET(page.lru)=40
OFFSET(pglist_data.node_zones)=0
OFFSET(pglist_data.nr_zones)=6744
OFFSET(pglist_data.node_mem_map)=6752
OFFSET(pglist_data.node_start_pfn)=6768
OFFSET(pglist_data.node_spanned_pages)=6784
OFFSET(pglist_data.node_id)=6792
OFFSET(zone.free_area)=88
OFFSET(zone.vm_stat)=1304
OFFSET(zone.spanned_pages)=1576
OFFSET(free_area.free_list)=0
OFFSET(list_head.next)=0
OFFSET(list_head.prev)=8
OFFSET(vm_struct.addr)=8
LENGTH(zone.free_area)=11
SYMBOL(log_buf)=ffffffff806b8470
SYMBOL(log_end)=ffffffff80796ac0
SYMBOL(log_buf_len)=ffffffff806b8464
SYMBOL(logged_chars)=ffffffff807d6bc0
LENGTH(free_area.free_list)=5
NUMBER(NR_FREE_PAGES)=0
NUMBER(PG_lru)=6
NUMBER(PG_private)=12
NUMBER(PG_head)=16
NUMBER(PG_swapcache)=18
SYMBOL(init_level4_pgt)=ffffffff80783000
CRASHTIME=1341922380


[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux