[PATCH 2/3] makedumpfile: Xen4: copy Xen4 memory distribution symbol values from xen header file
Petr Tesarik
ptesarik at suse.cz
Tue Jul 24 17:32:44 EDT 2012
Forgot one thing:
Dne Pá 22. června 2012 17:48:26 Norbert Trapp napsal(a):
>[...]
> diff --git a/arch/x86_64.c b/arch/x86_64.c
> index 6d2f9cc..da61fd8 100644
> --- a/arch/x86_64.c
> +++ b/arch/x86_64.c
>[...]
> @@ -350,34 +398,45 @@ int get_xen_info_x86_64(void)
> }
>
> if (SYMBOL(frame_table) == NOT_FOUND_SYMBOL) {
> - ERRMSG("Can't get the symbol of frame_table.\n");
> - return FALSE;
> - }
> - if (!readmem(VADDR_XEN, SYMBOL(frame_table), &frame_table_vaddr,
> - sizeof(frame_table_vaddr))) {
> - ERRMSG("Can't get the value of frame_table.\n");
> - return FALSE;
> - }
> - info->frame_table_vaddr = frame_table_vaddr;
> -
> - if (SYMBOL(xenheap_phys_end) == NOT_FOUND_SYMBOL) {
> - ERRMSG("Can't get the symbol of xenheap_phys_end.\n");
> - return FALSE;
> - }
> - if (!readmem(VADDR_XEN, SYMBOL(xenheap_phys_end), &xen_end,
> - sizeof(xen_end))) {
> - ERRMSG("Can't get the value of xenheap_phys_end.\n");
> - return FALSE;
> + if (info->elf_machine != EM_X86_64) {
> + ERRMSG("Can't get the symbol of frame_table.\n");
> + return FALSE;
> + }
> + info->frame_table_vaddr = FRAMETABLE_VIRT_START;
> + } else {
> + if (!readmem(VADDR_XEN, SYMBOL(frame_table), &frame_table_vaddr,
> + sizeof(frame_table_vaddr))) {
> + ERRMSG("Can't get the value of frame_table.\n");
> + return FALSE;
> + }
> + info->frame_table_vaddr = frame_table_vaddr;
> }
> - info->xen_heap_start = 0;
> - info->xen_heap_end = paddr_to_pfn(xen_end);
> -
> - /*
> - * pickled_id == domain addr for x86_64
> - */
> - for (i = 0; i < info->num_domain; i++) {
> - info->domain_list[i].pickled_id =
> - info->domain_list[i].domain_addr;
> + if (info->xen_major_version < 4) {
Except that this condition is wrong. The algorithm for computing pickled
domain IDs changed in Xen-3.4 already.
Petr Tesarik
SUSE Linux
> + if (SYMBOL(xenheap_phys_end) == NOT_FOUND_SYMBOL) {
> + ERRMSG("Can't get the symbol of xenheap_phys_end.\n");
> + return FALSE;
> + }
> + if (!readmem(VADDR_XEN, SYMBOL(xenheap_phys_end), &xen_end,
> + sizeof(xen_end))) {
> + ERRMSG("Can't get the value of xenheap_phys_end.\n");
> + return FALSE;
> + }
> + info->xen_heap_start = 0;
> + info->xen_heap_end = paddr_to_pfn(xen_end);
> +
> + /*
> + * pickled_id == domain addr for x86_64
> + */
> + for (i = 0; i < info->num_domain; i++) {
> + info->domain_list[i].pickled_id =
> + info->domain_list[i].domain_addr;
> + }
> + } else {
> + for (i = 0; i < info->num_domain; i++) {
> + info->domain_list[i].pickled_id =
> + ((unsigned long)info->domain_list[i].domain_addr -
> + DIRECTMAP_VIRT_START) >> PAGESHIFT();
> + }
> }
>
> return TRUE;
>[...]
More information about the kexec
mailing list