|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v6 1/4] xen: introduce SYMBOL
Hi Jan, On 1/15/19 8:21 AM, Jan Beulich wrote: On 14.01.19 at 22:18, <sstabellini@xxxxxxxxxx> wrote:Hi Jan, One question below to make a decision on the way forward. On Mon, 14 Jan 2019, Jan Beulich wrote:On 14.01.19 at 04:45, <Stewart.Hildebrand@xxxxxxxxxxxxxxx> wrote:So let's keep the linker-accessible variable as a type that works for the linker (which really could be anything as long as you use the address, not the value), but name it something else - a name that screams "DON'T USE ME UNLESS YOU KNOW WHAT YOU'RE DOING". And then before the first use, copy that value to "uintptr_t _start;". The following is a quick proof of concept for aarch64. I changed the type of _start and _end, and added code to copy the linker-assigned value to _start and _end. Upon booting, I see the correct values:Global symbols starting with underscores should already be shouting enough. But what's worse - the whole idea if using array types is to avoid the intermediate variables.--- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -726,6 +726,12 @@ static void __init setup_mm(unsigned long dtb_paddr,size_t dtb_size)size_t __read_mostly dcache_line_bytes; +typedef char TYPE_DOESNT_MATTER;+extern TYPE_DOESNT_MATTER _start_linker_assigned_dont_use_me, + _end_linker_assigned_dont_use_me;This and ... Do you have a pointer to the series using startof/sizeof? If you are OK with it, do you have any suggestions on how would you like the intermediate variables to be called? I went with _start/start_ and _end/end_ but I am open to suggestions. Also to which assembly file you would like the new variables being added -- I created a new one for the purpose named var.S in the attached example.First of all we should explore whether the variables could also be linker generated, in particular to avoid the current symbols to be global (thus making it impossible to access them from C files in the first place). Failing that, I don't think it matters much where these helper symbols live, and hence your choice is probably fine (I'd prefer though if, just like on Arm, the x86 file didn't live in the boot/ subdirectory; in the end it might even be possible to have some of them in xen/common/var.S). From my test [1], I don't think intermediate variables are necessary. You could directly define the symbol with uintptr_t. Cheers, [1] https://lists.xen.org/archives/html/xen-devel/2019-01/msg01109.html Jan -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |