From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Wei Liu <wei.liu2@citrix.com>,
Xen-devel <xen-devel@lists.xenproject.org>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
Dario Faggioli <dario.faggioli@citrix.com>,
Ian Campbell <ian.campbell@citrix.com>
Subject: Re: [PATCH v2 2/4] libxc: print more error messages when failed
Date: Fri, 29 May 2015 13:42:56 +0100 [thread overview]
Message-ID: <55685ED0.2080207@citrix.com> (raw)
In-Reply-To: <1432899434-1534-3-git-send-email-wei.liu2@citrix.com>
On 29/05/15 12:37, Wei Liu wrote:
> No functional changes introduced.
>
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> Cc: Ian Campbell <ian.campbell@citrix.com>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
This patch reminds me of a todo item I have wanted to do for a while
using setvcpucontext rather than mapping gfn 0 and manually inserting
`jmp $0x100000`
However, as for the change itself, a definite improvement.
> ---
> tools/libxc/xc_hvm_build_x86.c | 30 +++++++++++++++++++++++++++---
> 1 file changed, 27 insertions(+), 3 deletions(-)
>
> diff --git a/tools/libxc/xc_hvm_build_x86.c b/tools/libxc/xc_hvm_build_x86.c
> index 92422bf..df4b7ed 100644
> --- a/tools/libxc/xc_hvm_build_x86.c
> +++ b/tools/libxc/xc_hvm_build_x86.c
> @@ -259,7 +259,10 @@ static int setup_guest(xc_interface *xch,
>
> memset(&elf, 0, sizeof(elf));
> if ( elf_init(&elf, image, image_size) != 0 )
> + {
> + PERROR("Could not initialise ELF image");
> goto error_out;
> + }
>
> xc_elf_set_logfile(xch, &elf, 1);
>
> @@ -522,15 +525,24 @@ static int setup_guest(xc_interface *xch,
> DPRINTF(" 1GB PAGES: 0x%016lx\n", stat_1gb_pages);
>
> if ( loadelfimage(xch, &elf, dom, page_array) != 0 )
> + {
> + PERROR("Could not load ELF image");
> goto error_out;
> + }
>
> if ( loadmodules(xch, args, m_start, m_end, dom, page_array) != 0 )
> - goto error_out;
> + {
> + PERROR("Could not load ACPI modules");
> + goto error_out;
> + }
>
> if ( (hvm_info_page = xc_map_foreign_range(
> xch, dom, PAGE_SIZE, PROT_READ | PROT_WRITE,
> HVM_INFO_PFN)) == NULL )
> + {
> + PERROR("Could not map hvm info page");
> goto error_out;
> + }
> build_hvm_info(hvm_info_page, args);
> munmap(hvm_info_page, PAGE_SIZE);
>
> @@ -547,7 +559,10 @@ static int setup_guest(xc_interface *xch,
> }
>
> if ( xc_clear_domain_pages(xch, dom, special_pfn(0), NR_SPECIAL_PAGES) )
> - goto error_out;
> + {
> + PERROR("Could not clear special pages");
> + goto error_out;
> + }
>
> xc_hvm_param_set(xch, dom, HVM_PARAM_STORE_PFN,
> special_pfn(SPECIALPAGE_XENSTORE));
> @@ -580,7 +595,10 @@ static int setup_guest(xc_interface *xch,
> }
>
> if ( xc_clear_domain_pages(xch, dom, ioreq_server_pfn(0), NR_IOREQ_SERVER_PAGES) )
> - goto error_out;
> + {
> + PERROR("Could not clear ioreq page");
> + goto error_out;
> + }
>
> /* Tell the domain where the pages are and how many there are */
> xc_hvm_param_set(xch, dom, HVM_PARAM_IOREQ_SERVER_PFN,
> @@ -595,7 +613,10 @@ static int setup_guest(xc_interface *xch,
> if ( (ident_pt = xc_map_foreign_range(
> xch, dom, PAGE_SIZE, PROT_READ | PROT_WRITE,
> special_pfn(SPECIALPAGE_IDENT_PT))) == NULL )
> + {
> + PERROR("Could not map special page ident_pt");
> goto error_out;
> + }
> for ( i = 0; i < PAGE_SIZE / sizeof(*ident_pt); i++ )
> ident_pt[i] = ((i << 22) | _PAGE_PRESENT | _PAGE_RW | _PAGE_USER |
> _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_PSE);
> @@ -610,7 +631,10 @@ static int setup_guest(xc_interface *xch,
> char *page0 = xc_map_foreign_range(
> xch, dom, PAGE_SIZE, PROT_READ | PROT_WRITE, 0);
> if ( page0 == NULL )
> + {
> + PERROR("Could not map page0");
> goto error_out;
> + }
> page0[0] = 0xe9;
> *(uint32_t *)&page0[1] = entry_eip - 5;
> munmap(page0, PAGE_SIZE);
next prev parent reply other threads:[~2015-05-29 12:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-29 11:37 [PATCH v2 0/4] Fix HVM vNUMA Wei Liu
2015-05-29 11:37 ` [PATCH v2 1/4] libxc/libxl: fill xc_hvm_build_args in libxl Wei Liu
2015-05-29 12:29 ` Andrew Cooper
2015-05-29 12:54 ` Wei Liu
2015-05-29 11:37 ` [PATCH v2 2/4] libxc: print more error messages when failed Wei Liu
2015-05-29 12:42 ` Andrew Cooper [this message]
2015-05-29 11:37 ` [PATCH v2 3/4] libxc: rework vnuma bits in setup_guest Wei Liu
2015-05-29 15:02 ` Boris Ostrovsky
2015-05-29 15:38 ` Wei Liu
2015-05-29 11:37 ` [PATCH v2 4/4] libxl: fix HVM vNUMA Wei Liu
2015-05-29 15:50 ` Boris Ostrovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55685ED0.2080207@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=dario.faggioli@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.