Re: [Crash-utility] netdump issue
by Dave Anderson
----- "Anirudh Srinivasan" <srianirudh(a)gmail.com> wrote:
> I am implementing a netdump . I crashed one sever and got the vmcore
> file in /var/crash/vmcore , then i checked the kernel version through
>
> strings vmcore | fgrep -m1 'Linux'
> Linux version 2.4.21-40.ELsmp ( bhcompile(a)hs20-bc1-7.build.redhat.com
> ) (gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-54)) #1 SMP Thu Feb
> 2 22:22:39 EST 2006
>
> So now while installing the kernel-debuginfo , it should match the
> version above i.e something like
> "kernel-debuginfo.2.4.21.40.ELsmp.i368.rpm"
>
> But i installed the closest one and that was
> kernel-debuginfo.2.4.21.40.EL.i386.rpm but after installing them i
> should have /usr/lib/debug/module/vmlinux , which i could'nt see them
> .
OK, so you're running -- and have crashed -- a RHEL3 i686 smp kernel,
and the vmcore pinpoints the version as version 2.4.21-40.ELsmp. So
you need to install the kernel-debuginfo-2.4.21-40.EL.i686.rpm (not
the "i386" version), which contains the vmlinux debug files for that
kernel version:
$ rpm -qpl kernel-debuginfo-2.4.21-40.EL.i686.rpm | grep vmlinux
/usr/lib/debug/boot/vmlinux-2.4.21-40.EL.debug
/usr/lib/debug/boot/vmlinux-2.4.21-40.ELhugemem.debug
/usr/lib/debug/boot/vmlinux-2.4.21-40.ELsmp.debug
$
And the relevant file in your case would be located in
/usr/lib/debug/boot/vmlinux-2.4.21-40.ELsmp.debug.
>
> Can anyone give me the link to the rpm i am looking for , or suggest
> some idea. ( the server that i am dumping vmcore is version 5 )
>
> I have bunch of server with version 2 and version 3 and version 4 in
> my production environment for which i have to configure netdump to
> collect the vmcore in version 5 server .
That's fine -- one way you can get the specific debuginfo package
you need is by going to my people page:
http://people.redhat.com/anderson
1. Click on the "Red Hat Enterprise Linux debuginfo RPMs" link.
2. On that next page, in the "Red Hat Enterprise Linux 3" box,
click on the "AS: i386" link.
That will bring you to the ftp site that contains *all* RHEL3
packages, so you have to search for:
kernel-debuginfo-2.4.21-40.EL.i686.rpm
Again, make sure you get the "i686" version.
Hope this helps,
Dave
15 years, 10 months
Trying to read an 80GB PPC64 crash dump with little luck
by James Washer
Trying to investigate a SLES10SP1 crash dump
Using crash 4.0-7.6
Using -d9, I get the following just before crash gives up.
Any ideas?
thanks
- jim
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "powerpc64-unknown-linux-gnu"...
GETBUF(248 -> 0)
GETBUF(1500 -> 1)
FREEBUF(1)
FREEBUF(0)
<readmem: c00000000039db08, KVADDR, "kernel_config_data", 32768, (ROE),
11721c00>
crash: read error: kernel virtual address: c00000000039db08 type:
"kernel_config_data"
WARNING: cannot read kernel_config_data
GETBUF(248 -> 0)
FREEBUF(0)
GETBUF(16 -> 0)
<readmem: c0000000006470b8, KVADDR, "cpu_possible_map", 16, (ROE),
1071e968>
crash: read error: kernel virtual address: c0000000006470b8 type:
"cpu_possible_map"
WARNING: cannot read cpu_possible_map
<readmem: c000000000653130, KVADDR, "cpu_present_map", 16, (ROE),
1071e968>
crash: read error: kernel virtual address: c000000000653130 type:
"cpu_present_map"
WARNING: cannot read cpu_present_map
<readmem: c0000000006470c8, KVADDR, "cpu_online_map", 16, (ROE),
1071e968>
crash: read error: kernel virtual address: c0000000006470c8 type:
"cpu_online_map"
WARNING: cannot read cpu_online_map
FREEBUF(0)
<readmem: c0000000006d9f00, KVADDR, "xtime", 16, (FOE), 106f4218>
crash: read error: kernel virtual address: c0000000006d9f00 type:
"xtime"
op720lpar5:/washer #
15 years, 10 months
[PATCH] Add support for 'foreign' page sizes in kdump dumps
by Bernhard Walle
This affects only ppc64 and ia64 since that are the only architectures
that have a page size that is configurable at runtime by the system (which means
at boot by the kernel).
It also only affects dumps of the formats diskdump (which includes kdump
compressed dumps created by makedumpfile) and netdump (which includes kdump
ELF dumps copied from /proc/vmcore without any filtering applied and created
by makedumpfile with the -E option).
The patch reads the page size from the diskdump header or from the VMCOREINFO
in case of netdump (if it's there). For ia64 it also evaluates the page size
of the zero page to *change* the page size. In the past id didn't change the
page size, it only printed an error.
The patch has been tested on ppc64 (4k vs. 64k), ia64 (16k vs. 64k) and x86-64
(always 4k). It has been tested for compilation on i386, x86-64, ia64, PPC,
ppc64, s390 and s390x. Everything on a SLES 11/openSUSE 11.1 code base.
Signed-off-by: Bernhard Walle <bwalle(a)suse.de>
3 files changed, 117 insertions(+), 11 deletions(-)
diskdump.c | 18 +++++-----
netdump.c | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
netdump.h | 2 +
15 years, 10 months
Re: [Crash-utility] [PATCH] Add support for 'foreign' page sizes in kdump dumps
by Dave Anderson
----- "Bernhard Walle" <bwalle(a)suse.de> wrote:
> This affects only ppc64 and ia64 since that are the only architectures
> that have a page size that is configurable at runtime by the system (which means
> at boot by the kernel).
OK -- so then I still don't understand why it would ever be necessary
to apply this to 32-bit ELF kdump dumpfiles? Unless ppc64 or ia64
could conceivably create a 32-bit kdump vmcore, there's no need for the
change to dump_Elf32_Nhdr(). And unless I'm missing something,
I don't believe it's even possible because a 32-bit ELF header
cannot contain the virtual address values of 64-bit kernels.
And even if it were possible, the patch to dump_Elf32_Nhdr() references
"nd->elf64", which is only initialized when the vmcore is 64-bit:
@@ -1418,6 +1511,19 @@
netdump_print(" n_type: %lx ", note->n_type);
switch (note->n_type)
{
+ case 0: /* unknown, used for VMCOREINFO */
+
+ if (strncmp(VMCOREINFO_NOTE_NAME, (char *)note+sizeof(Elf64_Nhdr),
+ VMCOREINFO_NOTE_NAME_BYTES) == 0) {
+
+ /* we have VMCOREINFO */
+ nd->vmcoreinfo = (char *)nd->elf64 + offset +
+ (sizeof(Elf64_Nhdr) + ((note->n_namesz + 3) & ~3));
+ nd->size_vmcoreinfo = note->n_descsz;
+ nd->page_size = vmcoreinfo_read_integer("PAGESIZE", 0);
+ }
+ break;
+
So unless you can convince me otherwise, I'll just drop this patch
segment.
Thanks,
Dave
15 years, 10 months
[PATCH] Filter out s390(x) symbols that are local labels
by Bernhard Walle
Because s390 kernel System.map contains symbols that repeat very often
grep -c 'L2^B1$' System.map-2.6.27.7-4-default
276
and the limit for symbols with the same name in get_syment_array() is 200,
we filter out that symbols by modifying s390_verify_symbol() and
s390x_verify_symbol().
The symbols are not needed in crash anyway, because that are only local
labels and not global symbols needed by crash.
This is is a workaround. Andreas Krebbel already worked to resolve the problem
in binutils which prevents that symbols from being included in System.map.
http://sourceware.org/ml/binutils/2009-01/msg00181.html
However, since there are kernels (all 2.6.28 at least) out that contain that
problem, we should also workaround that in crash in my opinion.
Signed-off-by: Bernhard Walle <bwalle(a)suse.de>
2 files changed, 8 insertions(+)
s390.c | 4 ++++
s390x.c | 4 ++++
15 years, 10 months
Re: [Crash-utility] [PATCH] Add support for 'foreign' page sizes in kdump dumps
by Dave Anderson
----- "Bernhard Walle" <bwalle(a)suse.de> wrote:
> * Dave Anderson [2009-01-14 16:32]:
> >
> > Now I'm confused -- since the patches to diskdump.c and netdump.c properly set the
> > page size for ia64, why is there any need to change ia64_init()? If anything,
> > that code could only end up over-writing the pre-determined values returned by
> > diskdump_page_size() and kdump_page_size(), meaning that the diskdump header
> > info or the vmcoreinfo info is in fact invalid?
>
> For kernels that have no VMCOREINFO. I'll remove that part on your
> request.
Right -- that's true. And I think that earlier implementation of VMCOREINFO
didn't have the pagesize either.
But let's see how this shakes out for now.
Thanks,
Dave
15 years, 10 months
[PATCH] Add support for 'foreign' page sizes in kdump dumps
by Bernhard Walle
This affects only ppc64 and ia64 since that are the only architectures
that have a page size that is configurable at runtime by the system (which means
at boot by the kernel).
It also only affects dumps of the formats diskdump (which includes kdump
compressed dumps created by makedumpfile) and netdump (which includes kdump
ELF dumps copied from /proc/vmcore without any filtering applied and created
by makedumpfile with the -E option).
The patch reads the page size from the diskdump header or from the VMCOREINFO
in case of netdump (if it's there). For ia64 it also evaluates the page size
of the zero page to *change* the page size. In the past id didn't change the
page size, it only printed an error.
The patch has been tested on ppc64 (4k vs. 64k), ia64 (16k vs. 64k) and x86-64
(always 4k). It has been tested for compilation on i386, x86-64, ia64, PPC,
ppc64, s390 and s390x. Everything on a SLES 11/openSUSE 11.1 code base.
Signed-off-by: Bernhard Walle <bwalle(a)suse.de>
3 files changed, 127 insertions(+), 13 deletions(-)
diskdump.c | 18 +++++----
netdump.c | 120 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
netdump.h | 2 +
15 years, 10 months
Re: [Xen-devel] [PATCH] Support cross-bitness guest when core-dumping
by Bruce Rogers
The "change" to the format is as follows: Now the file format for a cross-bit configuration will be the same as would have been produced by a same-bitness configuration, which crash of course already handles. So crash should be fine with this change. In fact that was part of how I determined that it was working right.
I consider that the cross-bitness format was simply not valid as there is no reason for there to be a different format for the file simply because the host was a different bitsize than the guest (and it didn't work with crash & gdb-xenserver as it was).
- Bruce
>>> Isaku Yamahata <yamahata(a)valinux.co.jp> 01/14/09 8:17 PM >>>
[CCed to Anderson, Oda and crash-utility ml]
Hi Bruce. Nice patch.
Could you please update the documentation about its format too?
docs/misc/dump-core-format.txt
- Elf header section, and
- revision history at the end of the file.
And what is the impact on the crash utility?
thanks,
On Wed, Jan 14, 2009 at 04:47:41PM -0700, Bruce Rogers wrote:
> This patch allows core-dumping to work on a cross-bit host/guest configuration, whereas previously that was not supported. It supports both PV and FV guests. The core file format generated by the host, needs to match that of the guest, so an alignment issue is addressed, along with the p2m frame list handling being done according to the guest size.
>
> Signed-off-by: Bruce Rogers <brogers(a)novell.com>
>
> diff -r 77476eeb8c42 tools/libxc/xc_core.c
> --- a/tools/libxc/xc_core.c Wed Jan 14 11:39:01 2009 +0000
> +++ b/tools/libxc/xc_core.c Wed Jan 14 16:40:17 2009 -0700
> @@ -57,9 +57,6 @@
>
> /* number of pages to write at a time */
> #define DUMP_INCREMENT (4 * 1024)
> -
> -/* Don't yet support cross-address-size core dump */
> -#define guest_width (sizeof (unsigned long))
>
> /* string table */
> struct xc_core_strtab {
> @@ -240,7 +237,7 @@ xc_core_ehdr_init(Elf64_Ehdr *ehdr)
> ehdr->e_ident[EI_ABIVERSION] = EV_CURRENT;
>
> ehdr->e_type = ET_CORE;
> - ehdr->e_machine = ELF_ARCH_MACHINE;
> + /* e_machine will be filled in later */
> ehdr->e_version = EV_CURRENT;
> ehdr->e_entry = 0;
> ehdr->e_phoff = 0;
> @@ -359,7 +356,8 @@ elfnote_dump_core_header(
> }
>
> static int
> -elfnote_dump_xen_version(void *args, dumpcore_rtn_t dump_rtn, int xc_handle)
> +elfnote_dump_xen_version(void *args, dumpcore_rtn_t dump_rtn, int xc_handle,
> + unsigned int guest_width)
> {
> int sts;
> struct elfnote elfnote;
> @@ -371,6 +369,12 @@ elfnote_dump_xen_version(void *args, dum
> elfnote.descsz = sizeof(xen_version);
> elfnote.type = XEN_ELFNOTE_DUMPCORE_XEN_VERSION;
> elfnote_fill_xen_version(xc_handle, &xen_version);
> + if (guest_width < sizeof(unsigned long))
> + {
> + // 32 bit elf file format differs in pagesize's alignment
> + char *p = (char *)&xen_version.pagesize;
> + memmove(p - 4, p, sizeof(xen_version.pagesize));
> + }
> sts = dump_rtn(args, (char*)&elfnote, sizeof(elfnote));
> if ( sts != 0 )
> return sts;
> @@ -396,6 +400,24 @@ elfnote_dump_format_version(void *args,
> return dump_rtn(args, (char*)&format_version, sizeof(format_version));
> }
>
> +static int
> +get_guest_width(int xc_handle,
> + uint32_t domid,
> + unsigned int *guest_width)
> +{
> + DECLARE_DOMCTL;
> +
> + memset(&domctl, 0, sizeof(domctl));
> + domctl.domain = domid;
> + domctl.cmd = XEN_DOMCTL_get_address_size;
> +
> + if ( do_domctl(xc_handle, &domctl) != 0 )
> + return 1;
> +
> + *guest_width = domctl.u.address_size.size / 8;
> + return 0;
> +}
> +
> int
> xc_domain_dumpcore_via_callback(int xc_handle,
> uint32_t domid,
> @@ -403,7 +425,8 @@ xc_domain_dumpcore_via_callback(int xc_h
> dumpcore_rtn_t dump_rtn)
> {
> xc_dominfo_t info;
> - shared_info_t *live_shinfo = NULL;
> + shared_info_any_t *live_shinfo = NULL;
> + unsigned int guest_width;
>
> int nr_vcpus = 0;
> char *dump_mem, *dump_mem_start = NULL;
> @@ -437,6 +460,12 @@ xc_domain_dumpcore_via_callback(int xc_h
> uint16_t strtab_idx;
> struct xc_core_section_headers *sheaders = NULL;
> Elf64_Shdr *shdr;
> +
> + if ( get_guest_width(xc_handle, domid, &guest_width) != 0 )
> + {
> + PERROR("Could not get address size for domain");
> + return sts;
> + }
>
> xc_core_arch_context_init(&arch_ctxt);
> if ( (dump_mem_start = malloc(DUMP_INCREMENT*PAGE_SIZE)) == NULL )
> @@ -500,7 +529,7 @@ xc_domain_dumpcore_via_callback(int xc_h
> goto out;
> }
>
> - sts = xc_core_arch_map_p2m(xc_handle, &info, live_shinfo,
> + sts = xc_core_arch_map_p2m(xc_handle, guest_width, &info, live_shinfo,
> &p2m, &p2m_size);
> if ( sts != 0 )
> goto out;
> @@ -676,6 +705,7 @@ xc_domain_dumpcore_via_callback(int xc_h
> /* write out elf header */
> ehdr.e_shnum = sheaders->num;
> ehdr.e_shstrndx = strtab_idx;
> + ehdr.e_machine = ELF_ARCH_MACHINE;
> sts = dump_rtn(args, (char*)&ehdr, sizeof(ehdr));
> if ( sts != 0 )
> goto out;
> @@ -697,7 +727,7 @@ xc_domain_dumpcore_via_callback(int xc_h
> goto out;
>
> /* elf note section: xen version */
> - sts = elfnote_dump_xen_version(args, dump_rtn, xc_handle);
> + sts = elfnote_dump_xen_version(args, dump_rtn, xc_handle, guest_width);
> if ( sts != 0 )
> goto out;
>
> @@ -757,9 +787,21 @@ xc_domain_dumpcore_via_callback(int xc_h
>
> if ( !auto_translated_physmap )
> {
> - gmfn = p2m[i];
> - if ( gmfn == INVALID_P2M_ENTRY )
> - continue;
> + if ( guest_width >= sizeof(unsigned long) )
> + {
> + if ( guest_width == sizeof(unsigned long) )
> + gmfn = p2m[i];
> + else
> + gmfn = ((uint64_t *)p2m)[i];
> + if ( gmfn == INVALID_P2M_ENTRY )
> + continue;
> + }
> + else
> + {
> + gmfn = ((uint32_t *)p2m)[i];
> + if ( gmfn == (uint32_t)INVALID_P2M_ENTRY )
> + continue;
> + }
>
> p2m_array[j].pfn = i;
> p2m_array[j].gmfn = gmfn;
> @@ -802,7 +844,7 @@ copy_done:
> /* When live dump-mode (-L option) is specified,
> * guest domain may reduce memory. pad with zero pages.
> */
> - IPRINTF("j (%ld) != nr_pages (%ld)", j , nr_pages);
> + IPRINTF("j (%ld) != nr_pages (%ld)", j, nr_pages);
> memset(dump_mem_start, 0, PAGE_SIZE);
> for (; j < nr_pages; j++) {
> sts = dump_rtn(args, dump_mem_start, PAGE_SIZE);
> @@ -891,7 +933,7 @@ xc_domain_dumpcore(int xc_handle,
> struct dump_args da;
> int sts;
>
> - if ( (da.fd = open(corename, O_CREAT|O_RDWR, S_IWUSR|S_IRUSR)) < 0 )
> + if ( (da.fd = open(corename, O_CREAT|O_RDWR|O_TRUNC, S_IWUSR|S_IRUSR)) < 0 )
> {
> PERROR("Could not open corefile %s", corename);
> return -errno;
> diff -r 77476eeb8c42 tools/libxc/xc_core.h
> --- a/tools/libxc/xc_core.h Wed Jan 14 11:39:01 2009 +0000
> +++ b/tools/libxc/xc_core.h Wed Jan 14 16:40:17 2009 -0700
> @@ -136,12 +136,12 @@ struct xc_core_arch_context;
> struct xc_core_arch_context;
> int xc_core_arch_memory_map_get(int xc_handle,
> struct xc_core_arch_context *arch_ctxt,
> - xc_dominfo_t *info, shared_info_t *live_shinfo,
> + xc_dominfo_t *info, shared_info_any_t *live_shinfo,
> xc_core_memory_map_t **mapp,
> unsigned int *nr_entries);
> -int xc_core_arch_map_p2m(int xc_handle, xc_dominfo_t *info,
> - shared_info_t *live_shinfo, xen_pfn_t **live_p2m,
> - unsigned long *pfnp);
> +int xc_core_arch_map_p2m(int xc_handle, unsigned int guest_width,
> + xc_dominfo_t *info, shared_info_any_t *live_shinfo,
> + xen_pfn_t **live_p2m, unsigned long *pfnp);
>
>
> #if defined (__i386__) || defined (__x86_64__)
> diff -r 77476eeb8c42 tools/libxc/xc_core_ia64.c
> --- a/tools/libxc/xc_core_ia64.c Wed Jan 14 11:39:01 2009 +0000
> +++ b/tools/libxc/xc_core_ia64.c Wed Jan 14 16:40:17 2009 -0700
> @@ -235,7 +235,7 @@ old:
> }
>
> int
> -xc_core_arch_map_p2m(int xc_handle, xc_dominfo_t *info,
> +xc_core_arch_map_p2m(int xc_handle, unsigned int guest_width, xc_dominfo_t *info,
> shared_info_t *live_shinfo, xen_pfn_t **live_p2m,
> unsigned long *pfnp)
> {
> diff -r 77476eeb8c42 tools/libxc/xc_core_x86.c
> --- a/tools/libxc/xc_core_x86.c Wed Jan 14 11:39:01 2009 +0000
> +++ b/tools/libxc/xc_core_x86.c Wed Jan 14 16:40:17 2009 -0700
> @@ -20,9 +20,25 @@
>
> #include "xg_private.h"
> #include "xc_core.h"
> +#include "xc_e820.h"
>
> -/* Don't yet support cross-address-size core dump */
> -#define guest_width (sizeof (unsigned long))
> +#define GET_FIELD(_p, _f) ((guest_width==8) ? ((_p)->x64._f) : ((_p)->x32._f))
> +
> +#ifndef MAX
> +#define MAX(_a, _b) ((_a) >= (_b) ? (_a) : (_b))
> +#endif
> +
> +int
> +xc_core_arch_gpfn_may_present(struct xc_core_arch_context *arch_ctxt,
> + unsigned long pfn)
> +{
> + if ((pfn >= 0xa0 && pfn < 0xc0) /* VGA hole */
> + || (pfn >= (HVM_BELOW_4G_MMIO_START >> PAGE_SHIFT)
> + && pfn < (1ULL<<32) >> PAGE_SHIFT)) /* MMIO */
> + return 0;
> + return 1;
> +}
> +
>
> static int nr_gpfns(int xc_handle, domid_t domid)
> {
> @@ -37,7 +53,7 @@ xc_core_arch_auto_translated_physmap(con
>
> int
> xc_core_arch_memory_map_get(int xc_handle, struct xc_core_arch_context *unused,
> - xc_dominfo_t *info, shared_info_t *live_shinfo,
> + xc_dominfo_t *info, shared_info_any_t *live_shinfo,
> xc_core_memory_map_t **mapp,
> unsigned int *nr_entries)
> {
> @@ -60,17 +76,22 @@ xc_core_arch_memory_map_get(int xc_handl
> }
>
> int
> -xc_core_arch_map_p2m(int xc_handle, xc_dominfo_t *info,
> - shared_info_t *live_shinfo, xen_pfn_t **live_p2m,
> +xc_core_arch_map_p2m(int xc_handle, unsigned int guest_width, xc_dominfo_t *info,
> + shared_info_any_t *live_shinfo, xen_pfn_t **live_p2m,
> unsigned long *pfnp)
> {
> /* Double and single indirect references to the live P2M table */
> xen_pfn_t *live_p2m_frame_list_list = NULL;
> xen_pfn_t *live_p2m_frame_list = NULL;
> + /* Copies of the above. */
> + xen_pfn_t *p2m_frame_list_list = NULL;
> + xen_pfn_t *p2m_frame_list = NULL;
> +
> uint32_t dom = info->domid;
> unsigned long p2m_size = nr_gpfns(xc_handle, info->domid);
> int ret = -1;
> int err;
> + int i;
>
> if ( p2m_size < info->nr_pages )
> {
> @@ -80,7 +101,7 @@ xc_core_arch_map_p2m(int xc_handle, xc_d
>
> live_p2m_frame_list_list =
> xc_map_foreign_range(xc_handle, dom, PAGE_SIZE, PROT_READ,
> - live_shinfo->arch.pfn_to_mfn_frame_list_list);
> + GET_FIELD(live_shinfo, arch.pfn_to_mfn_frame_list_list));
>
> if ( !live_p2m_frame_list_list )
> {
> @@ -88,9 +109,28 @@ xc_core_arch_map_p2m(int xc_handle, xc_d
> goto out;
> }
>
> + /* Get a local copy of the live_P2M_frame_list_list */
> + if ( !(p2m_frame_list_list = malloc(PAGE_SIZE)) )
> + {
> + ERROR("Couldn't allocate p2m_frame_list_list array");
> + goto out;
> + }
> + memcpy(p2m_frame_list_list, live_p2m_frame_list_list, PAGE_SIZE);
> +
> + /* Canonicalize guest's unsigned long vs ours */
> + if ( guest_width > sizeof(unsigned long) )
> + for ( i = 0; i < PAGE_SIZE/sizeof(unsigned long); i++ )
> + if ( i < PAGE_SIZE/guest_width )
> + p2m_frame_list_list[i] = ((uint64_t *)p2m_frame_list_list)[i];
> + else
> + p2m_frame_list_list[i] = 0;
> + else if ( guest_width < sizeof(unsigned long) )
> + for ( i = PAGE_SIZE/sizeof(unsigned long) - 1; i >= 0; i-- )
> + p2m_frame_list_list[i] = ((uint32_t *)p2m_frame_list_list)[i];
> +
> live_p2m_frame_list =
> xc_map_foreign_pages(xc_handle, dom, PROT_READ,
> - live_p2m_frame_list_list,
> + p2m_frame_list_list,
> P2M_FLL_ENTRIES);
>
> if ( !live_p2m_frame_list )
> @@ -99,8 +139,25 @@ xc_core_arch_map_p2m(int xc_handle, xc_d
> goto out;
> }
>
> + /* Get a local copy of the live_P2M_frame_list */
> + if ( !(p2m_frame_list = malloc(P2M_TOOLS_FL_SIZE)) )
> + {
> + ERROR("Couldn't allocate p2m_frame_list array");
> + goto out;
> + }
> + memset(p2m_frame_list, 0, P2M_TOOLS_FL_SIZE);
> + memcpy(p2m_frame_list, live_p2m_frame_list, P2M_GUEST_FL_SIZE);
> +
> + /* Canonicalize guest's unsigned long vs ours */
> + if ( guest_width > sizeof(unsigned long) )
> + for ( i = 0; i < P2M_FL_ENTRIES; i++ )
> + p2m_frame_list[i] = ((uint64_t *)p2m_frame_list)[i];
> + else if ( guest_width < sizeof(unsigned long) )
> + for ( i = P2M_FL_ENTRIES - 1; i >= 0; i-- )
> + p2m_frame_list[i] = ((uint32_t *)p2m_frame_list)[i];
> +
> *live_p2m = xc_map_foreign_pages(xc_handle, dom, PROT_READ,
> - live_p2m_frame_list,
> + p2m_frame_list,
> P2M_FL_ENTRIES);
>
> if ( !*live_p2m )
> @@ -122,6 +179,12 @@ out:
> if ( live_p2m_frame_list )
> munmap(live_p2m_frame_list, P2M_FLL_ENTRIES * PAGE_SIZE);
>
> + if ( p2m_frame_list_list )
> + free(p2m_frame_list_list);
> +
> + if ( p2m_frame_list )
> + free(p2m_frame_list);
> +
> errno = err;
> return ret;
> }
> diff -r 77476eeb8c42 tools/libxc/xc_core_x86.h
> --- a/tools/libxc/xc_core_x86.h Wed Jan 14 11:39:01 2009 +0000
> +++ b/tools/libxc/xc_core_x86.h Wed Jan 14 16:40:17 2009 -0700
> @@ -21,15 +21,8 @@
> #ifndef XC_CORE_X86_H
> #define XC_CORE_X86_H
>
> -#if defined(__i386__) || defined(__x86_64__)
> #define ELF_ARCH_DATA ELFDATA2LSB
> -#if defined (__i386__)
> -# define ELF_ARCH_MACHINE EM_386
> -#else
> -# define ELF_ARCH_MACHINE EM_X86_64
> -#endif
> -#endif /* __i386__ or __x86_64__ */
> -
> +#define ELF_ARCH_MACHINE (guest_width == 8 ? EM_X86_64 : EM_386)
>
> struct xc_core_arch_context {
> /* nothing */
> @@ -40,8 +33,10 @@ struct xc_core_arch_context {
> #define xc_core_arch_context_get(arch_ctxt, ctxt, xc_handle, domid) \
> (0)
> #define xc_core_arch_context_dump(arch_ctxt, args, dump_rtn) (0)
> -#define xc_core_arch_gpfn_may_present(arch_ctxt, i) (1)
>
> +int
> +xc_core_arch_gpfn_may_present(struct xc_core_arch_context *arch_ctxt,
> + unsigned long pfn);
> static inline int
> xc_core_arch_context_get_shdr(struct xc_core_arch_context *arch_ctxt,
> struct xc_core_section_headers *sheaders,
> _______________________________________________
> Xen-devel mailing list
> Xen-devel(a)lists.xensource.com
> http://lists.xensource.com/xen-devel
--
yamahata
_______________________________________________
Xen-devel mailing list
Xen-devel(a)lists.xensource.com
http://lists.xensource.com/xen-devel
15 years, 10 months
Re: [Crash-utility] [PATCH] Add support for 'foreign' page sizes in kdump dumps
by Dave Anderson
----- "Dave Anderson" <anderson(a)redhat.com> wrote:
>
> For starters, I've got a few issues with this patch (in addition to the earlier
> diskdump.c question):
>
> (1) Your patch would only work with 32-bit ELF kdumps since the vmcoreinfo_read_integer()
> function is only called by dump_Elf32_Nhdr() -- and not by dump_Elf64_Nhdr().
> I wouldn't think that ppc64 and ia64 could even create 32-bit ELF kdumps since
> they would by definition have to truncate certain fields? I presume you either
> forgot the 64-bit part of the patch, or maybe incorrectly put the code in the
> wrong function?
>
> (2) Even so, in the dump_Elf32_Nhdr() switch statement, you're taking over the
> "0" case, whereas it used to be picked up by the "default" case -- which
> currently dumps the vmcoreinfo data. Now that code can never be run, and
> I don't want to give up that capability.
>
> (3) I think I'd like to keep it forcibly segregated to ia64 and ppc64, instead of
> letting the other architectures even call vmcoreinfo_read_integer(PAGESIZE).
> I don't want to even allow a *remote* possibility of breaking things on the
> other arches.
>
> (4) vmcore_info_read_integer() shouldn't be called if the "store" paramter isn't set.
>
> (5) Minor nit -- I'd just as soon leave any changes to ia64_init_hyper() to its
> maintainer, especially since it makes no sense to make a follow-up call to
> ia64_check_adjust_pagesize().
>
> Thanks,
> Dave
Now I'm confused -- since the patches to diskdump.c and netdump.c properly set the
page size for ia64, why is there any need to change ia64_init()? If anything,
that code could only end up over-writing the pre-determined values returned by
diskdump_page_size() and kdump_page_size(), meaning that the diskdump header
info or the vmcoreinfo info is in fact invalid?
Dave
15 years, 10 months
Re: [Crash-utility] [PATCH] Add support for 'foreign' page sizes in kdump dumps
by Dave Anderson
----- "Bernhard Walle" <bwalle(a)suse.de> wrote:
> * Dave Anderson [2009-01-14 16:17]:
...
>
> > (5) Minor nit -- I'd just as soon leave any changes to ia64_init_hyper() to its
> > maintainer, especially since it makes no sense to make a follow-up call to
> > ia64_check_adjust_pagesize().
>
> Done.
>
>
> Bernhard
I may be preceeding your next response, and I apologize if I am,
but the more I think of it, the more I think that ia64.c should
just be left as is. If the kdump (compressed or not) advertises
a page size that's incompatible with the vmlinux file (via the
empty_zero_page check) then the user must be using the wrong vmlinux
file, and the session attempt should just be aborted as is done now.
I can't think of a reason where resetting the page size to conflict
with the dumpfile could ever possibly work?
Dave
15 years, 10 months