All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <sstabellini@kernel.org>
To: Andrii Anisov <andrii.anisov@gmail.com>
Cc: Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Andrii Anisov <andrii_anisov@epam.com>, Wei Liu <wl@xen.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	xen-devel@lists.xenproject.org,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [Xen-devel] [RFC 5/7] WIP:arm64:armds: Build XEN with ARM Compiler 6.6
Date: Wed, 20 Nov 2019 14:56:37 -0800 (PST)	[thread overview]
Message-ID: <alpine.DEB.2.21.1911201452140.25834@sstabellini-ThinkPad-T480s> (raw)
In-Reply-To: <236d8eb7-c079-4244-0b2f-9d18e33efc0d@gmail.com>

On Thu, 14 Nov 2019, Andrii Anisov wrote:
> On 11.11.19 23:26, Stefano Stabellini wrote:
> 
> > Why _srodata and __start_bug_frames cannot both be defined as
> > Load$$_rodata_bug_frames_0$$Base when actually in the case of:
> > 
> > > +#define __per_cpu_data_end          Load$$_bss_percpu$$Limit
> > > +#define __bss_end                   Load$$_bss_percpu$$Limit
> > > +#define _end                        Load$$_bss_percpu$$Limit
> > 
> > They are all defined as "Load$$_bss_percpu$$Limit"? And:
> > 
> > > +#define __init_end                  Load$$_bss$$Base
> > > +#define __bss_start                 Load$$_bss$$Base
> > 
> > They are both defined as "Load$$_bss$$Base"? What's special about
> > "Load$$_rodata_bug_frames_0$$Base"?
> 
> 
> Because in xen/include/asm-arm/bug.h:
>   extern const struct bug_frame __start_bug_frames[]
> 
> and in xen/include/xen/kernel.h
>   extern const char _srodata[];
> 
> After preprocessing we, effectively, have symbol declared with conflicting
> types:
>   extern const struct bug_frame Load$$_rodata_bug_frames_0$$Base[];
>   extern const char Load$$_rodata_bug_frames_0$$Base[];
> 
> Eventually other symbols do not have such conflicts.

That is something to add to the commit message


> > >   - C style shift operators are missed among supported scatter file
> > > expressions,
> > >     so some needed values are hardcoded in scatter file.
> > > 
> > >   - Rename correspondent ARM Linker defined symbols to those needed by
> > > `symbols` tool
> > >     using steering file feature.
> > > 
> > >   - ARM Compiler 6.6 tools are not able to rename sections, so we still
> > > need
> > >     GNU toolchain's objcopy for this.
> > > 
> > > Signed-off-by: Andrii Anisov <andrii_anisov@epam.com>
> > > ---
> > >   xen/Rules.mk                |   6 +
> > >   xen/arch/arm/Makefile       |  24 ++++
> > >   xen/arch/arm/xen.scat.S     | 266
> > > ++++++++++++++++++++++++++++++++++++++++++++
> > 
> > I would strongly suggest to rename this file with something not
> > potentially related to scat
> 
> I just followed examples from ARM documentation, e.g. [1]. I suppose they know
> something about their product.
> Yet, the suggestion is reasonable.

LOL!!
 
 
> > > diff --git a/xen/arch/arm/xen.steer b/xen/arch/arm/xen.steer
> > > new file mode 100644
> > > index 0000000..646e912
> > > --- /dev/null
> > > +++ b/xen/arch/arm/xen.steer
> > > @@ -0,0 +1,5 @@
> > > +RESOLVE _srodata AS Load$$_rodata_bug_frames_0$$Base
> > > +RENAME Load$$_text$$Base AS _stext
> > > +RENAME Load$$_text$$Limit AS _etext
> > > +RENAME Load$$_init_text$$Base AS _sinittext
> > > +RENAME Load$$_init_text$$Limit AS _einittext
> > 
> > I don't get why some if the "symbols" get renamed using RENAME here, and
> > some other we are using a #define in xen/include/asm-arm/armds.h. Can't
> > we rename them all here?
> 
> Well, the situation here is really complicated. I described above a reason why
> _srodata is resolved here.
> Other symbols are renamed here because the tool "xen/tools/symbols", used at
> the latest linking stages, needs `_stext`, `_etext`, and the rest to be
> present in the elf.
> 
> > 
> > > diff --git a/xen/include/asm-arm/armds.h b/xen/include/asm-arm/armds.h
> > > new file mode 100644
> > > index 0000000..5ee2e5d
> > > --- /dev/null
> > > +++ b/xen/include/asm-arm/armds.h
> > 
> > Missing guards. Also, probably you want to make sure this is only #ifdef
> > ARMCC.
> 
> OK.
> 
> > 
> > Is this meant to be used when building C files, asm files, or both?
> 
> Well, I have to check.
> 
> > 
> > I would avoid this header file if we can get away with just xen.steer.
> 
> We can't go with xen.steer only. One of the armlink issues is "ARM linker
> defined symbols are not counted as referred if only mentioned in a steering
> file for rename or resolve". Also, linker-defined symbols are only generated
> when the code references them [2].
> I tried resolving existing symbols (e.g. _start) to armlink defined symbols
> with .steer only, and got errors that armlink can't find those linker-defined
> symbols.
> I tried a specific C file with references to all needed linker-defined
> symbols, then resolving all .lds-style symbols to armlink defined symbols with
> the steering file. But it did not work, I don't remember exactly the issue.
> Maybe C file with externs only (without using them in the effective code) did
> not result in an object file referring those linker-defined symbols.

I don't know what the right solution is, but it would be nice to have
some consistency. Otherwise the next time a new symbol is added we won't
know whether it needs to be added to xen.steer or armds.h. We need to
have a clear rule to follow so that we can easily figure out why each
symbol is in xen.steer and/or armds.h.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2019-11-20 22:57 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-06  9:19 [Xen-devel] [RFC 0/7] Build XEN with ARM Compiler 6.6.3 Andrii Anisov
2019-11-06  9:19 ` [Xen-devel] [RFC 1/7] xen: clang: Support correctly cross-compile Andrii Anisov
2019-11-06 11:07   ` Wei Liu
2019-11-06 15:24   ` Jan Beulich
2019-11-18  6:08   ` Julien Grall
2019-11-06  9:19 ` [Xen-devel] [RFC 2/7] WIP: Compilation with ARM DS-6 compiler Andrii Anisov
2019-11-06 15:28   ` Jan Beulich
2019-11-06 22:08     ` Artem Mygaiev
2019-11-07  7:31       ` Jan Beulich
2019-11-13 17:15         ` Artem Mygaiev
2019-11-13 23:19           ` Julien Grall
2019-11-14 14:12             ` Artem Mygaiev
2019-11-18  6:18               ` Julien Grall
2019-11-19 15:16                 ` Artem Mygaiev
2019-11-19 16:13                   ` Julien Grall
2019-11-06  9:19 ` [Xen-devel] [RFC 3/7] arm64:armds: ARM Compiler 6.6 does not accept `rx` registers naming for AArch64 Andrii Anisov
2019-11-06 15:32   ` Jan Beulich
2019-11-11 20:49     ` Stefano Stabellini
2019-11-13  5:56   ` Julien Grall
2019-11-06  9:19 ` [Xen-devel] [RFC 4/7] arm/gic: Drop pointless assertions Andrii Anisov
2019-11-11 20:52   ` Stefano Stabellini
2019-11-13  1:14     ` Julien Grall
2019-11-20 22:15       ` Stefano Stabellini
2019-11-06  9:19 ` [Xen-devel] [RFC 5/7] WIP:arm64:armds: Build XEN with ARM Compiler 6.6 Andrii Anisov
2019-11-11 21:26   ` Stefano Stabellini
2019-11-13  5:50     ` Julien Grall
2019-11-14 11:31       ` Andrii Anisov
2019-11-18  7:03         ` Julien Grall
2019-11-14 11:14     ` Andrii Anisov
2019-11-20 22:56       ` Stefano Stabellini [this message]
2019-11-06  9:19 ` [Xen-devel] [RFC 6/7] arm: Introduce dummy empty functions for data only C files Andrii Anisov
2019-11-11 20:57   ` Stefano Stabellini
2019-11-13 16:41     ` Andrii Anisov
2019-11-13 23:03     ` Julien Grall
2019-11-14 13:32       ` Artem Mygaiev
2019-11-20 22:20         ` Stefano Stabellini
2019-11-13  5:51   ` Julien Grall
2019-11-13 17:07     ` Andrii Anisov
2019-11-06  9:19 ` [Xen-devel] [RFC 7/7] arm/gic-v3: add GIC version suffix to iomem range variables Andrii Anisov
2019-11-11 20:59   ` Stefano Stabellini
2019-11-13  1:25     ` Julien Grall
2019-11-14  8:35     ` Andrii Anisov
2019-11-20 22:23       ` Stefano Stabellini
2019-11-21  9:05         ` 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=alpine.DEB.2.21.1911201452140.25834@sstabellini-ThinkPad-T480s \
    --to=sstabellini@kernel.org \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=andrii.anisov@gmail.com \
    --cc=andrii_anisov@epam.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=konrad.wilk@oracle.com \
    --cc=wl@xen.org \
    --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.