From: Ian Campbell <Ian.Campbell@citrix.com>
To: Andrii Anisov <andrii.anisov@globallogic.com>
Cc: Tim Deegan <tim@xen.org>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: Hypervisor compilation for arm without debug=y
Date: Mon, 19 Aug 2013 16:11:52 +0100 [thread overview]
Message-ID: <1376925112.9708.27.camel@dagon.hellion.org.uk> (raw)
In-Reply-To: <CAGQvs6i3YcLk=WJTmx8a7HkPt8MU5Fg=stiy94Uts7nN6idO1A@mail.gmail.com>
On Mon, 2013-08-19 at 14:44 +0300, Andrii Anisov wrote:
> Hello,
>
>
> I tried to get hypervisor built without debug=y option.
> Unfortunately built binary doesn't boot.
> I've localized a problem and get a workaround for it:
Thanks.
> diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
> index d1290cd..aa8e057 100644
> --- a/xen/arch/arm/mm.c
> +++ b/xen/arch/arm/mm.c
> @@ -332,7 +332,7 @@ void __cpuinit setup_virt_paging(void)
>
> /* Boot-time pagetable setup.
> * Changes here may need matching changes in head.S */
> -void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
> +void __attribute__((optimize("-fno-omit-frame-pointer"))) __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
> {
> unsigned long dest_va;
> lpae_t pte, *p;
>
>
> Is it a known issue?
I suspect none of us has ever really used a non-debug build!
> Is there a better solution for it?
So the confusing double negative -fno-omit-frame-pointer is causing the
frame pointer to be omitted for this function?
I wonder why the frame pointer is a problem here. This function is a bit
sensitive since it relocates Xen in physical RAM but it doesn't change
the virtual address space so I would expect fp, sp etc to remain valid.
The danger is if something is written to the stack between the initial
copy and the switch over, but I'd have thought that the frame pointer
would be written to the stack near the start and popped at the end and
mostly not touched in the middle.
I guess what I'm trying to say is I'm not confident that adding that
flag has "fixed" the issue, rather than just causing the compiler to
behave a bit differently and avoid it.
Are you able to post any details about the boot failure? Is it a crash
or something more subtle? Are you able to localise it to a particular
instruction or section of code?
> I work with 4.3 release, build with gcc version 4.6.3 (Ubuntu/Linaro
> 4.6.3-1ubuntu5)
For ARM stuff you are probably better off tracking mainline (unstable)
xen. Depending on what you are doing of course.
Ian.
next prev parent reply other threads:[~2013-08-19 15:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-19 11:44 Hypervisor compilation for arm without debug=y Andrii Anisov
2013-08-19 15:11 ` Ian Campbell [this message]
2013-08-19 15:49 ` Andrii Anisov
2013-08-20 16:03 ` Andrii Anisov
2013-08-20 16:59 ` Julien Grall
2013-08-20 17:07 ` Julien Grall
2013-08-21 10:38 ` Andrii Anisov
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=1376925112.9708.27.camel@dagon.hellion.org.uk \
--to=ian.campbell@citrix.com \
--cc=andrii.anisov@globallogic.com \
--cc=tim@xen.org \
--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).