From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Juergen Gross <jgross@suse.com>
Cc: wei.liu2@citrix.com, xen-devel@lists.xen.org
Subject: Re: [PATCH] pvgrub: use printk() instead of grub_printf()
Date: Wed, 28 Sep 2016 12:59:30 +0200 [thread overview]
Message-ID: <20160928105930.GE4138@var.bordeaux.inria.fr> (raw)
In-Reply-To: <1475051518-3452-1-git-send-email-jgross@suse.com>
Juergen Gross, on Wed 28 Sep 2016 10:31:58 +0200, wrote:
> grub_printf() is supporting only a very limited number of formats.
> Especially some error messages suffer from that, e.g. %lx won't work.
> Switch to use printk() for error messages instead.
>
> Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
> ---
> stubdom/grub/kexec.c | 22 +++++++++++-----------
> 1 file changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/stubdom/grub/kexec.c b/stubdom/grub/kexec.c
> index 8fd9ff9..2ed4f6c 100644
> --- a/stubdom/grub/kexec.c
> +++ b/stubdom/grub/kexec.c
> @@ -246,26 +246,26 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
> tpm_hash2pcr(dom, cmdline);
>
> if ( (rc = xc_dom_boot_xen_init(dom, xc_handle, domid)) != 0 ) {
> - grub_printf("xc_dom_boot_xen_init returned %d\n", rc);
> + printk("xc_dom_boot_xen_init returned %d\n", rc);
> errnum = ERR_BOOT_FAILURE;
> goto out;
> }
> if ( (rc = xc_dom_parse_image(dom)) != 0 ) {
> - grub_printf("xc_dom_parse_image returned %d\n", rc);
> + printk("xc_dom_parse_image returned %d\n", rc);
> errnum = ERR_BOOT_FAILURE;
> goto out;
> }
>
> #ifdef __i386__
> if (strcmp(dom->guest_type, "xen-3.0-x86_32p")) {
> - grub_printf("can only boot x86 32 PAE kernels, not %s\n", dom->guest_type);
> + printk("can only boot x86 32 PAE kernels, not %s\n", dom->guest_type);
> errnum = ERR_EXEC_FORMAT;
> goto out;
> }
> #endif
> #ifdef __x86_64__
> if (strcmp(dom->guest_type, "xen-3.0-x86_64")) {
> - grub_printf("can only boot x86 64 kernels, not %s\n", dom->guest_type);
> + printk("can only boot x86 64 kernels, not %s\n", dom->guest_type);
> errnum = ERR_EXEC_FORMAT;
> goto out;
> }
> @@ -273,7 +273,7 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
>
> /* equivalent of xc_dom_mem_init */
> if (xc_dom_set_arch_hooks(dom)) {
> - grub_printf("xc_dom_set_arch_hooks failed\n");
> + printk("xc_dom_set_arch_hooks failed\n");
> errnum = ERR_EXEC_FORMAT;
> goto out;
> }
> @@ -290,7 +290,7 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
> dom->p2m_host[i] = pfn_to_mfn(i);
>
> if ( (rc = xc_dom_build_image(dom)) != 0 ) {
> - grub_printf("xc_dom_build_image returned %d\n", rc);
> + printk("xc_dom_build_image returned %d\n", rc);
> errnum = ERR_BOOT_FAILURE;
> goto out;
> }
> @@ -306,7 +306,7 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
> dom->shared_info_mfn = PHYS_PFN(start_info.shared_info);
>
> if (!xc_dom_compat_check(dom)) {
> - grub_printf("xc_dom_compat_check failed\n");
> + printk("xc_dom_compat_check failed\n");
> errnum = ERR_EXEC_FORMAT;
> goto out;
> }
> @@ -324,14 +324,14 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
> /* Make sure the bootstrap page table does not RW-map any of our current
> * page table frames */
> if ( (rc = xc_dom_update_guest_p2m(dom))) {
> - grub_printf("xc_dom_update_guest_p2m returned %d\n", rc);
> + printk("xc_dom_update_guest_p2m returned %d\n", rc);
> errnum = ERR_BOOT_FAILURE;
> goto out;
> }
>
> if ( dom->arch_hooks->setup_pgtables )
> if ( (rc = dom->arch_hooks->setup_pgtables(dom))) {
> - grub_printf("setup_pgtables returned %d\n", rc);
> + printk("setup_pgtables returned %d\n", rc);
> errnum = ERR_BOOT_FAILURE;
> goto out;
> }
> @@ -362,8 +362,8 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
> #endif
> xc_dom_p2m(dom, dom->pgtables_seg.pfn),
> dom->guest_domid)) != 0 ) {
> - grub_printf("pin_table(%lx) returned %d\n", xc_dom_p2m(dom,
> - dom->pgtables_seg.pfn), rc);
> + printk("pin_table(%lx) returned %d\n", xc_dom_p2m(dom,
> + dom->pgtables_seg.pfn), rc);
> errnum = ERR_BOOT_FAILURE;
> goto out_remap;
> }
> --
> 2.6.6
>
--
Samuel
Client: "This program has been successfully installed."
Vendeur (surpris): "Et où voyez-vous une erreur ?"
Client: "C'est << HAS BEEN >> !"
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
prev parent reply other threads:[~2016-09-28 10:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-28 8:31 [PATCH] pvgrub: use printk() instead of grub_printf() Juergen Gross
2016-09-28 10:50 ` Wei Liu
2016-09-28 10:59 ` Samuel Thibault [this message]
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=20160928105930.GE4138@var.bordeaux.inria.fr \
--to=samuel.thibault@ens-lyon.org \
--cc=jgross@suse.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).