All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>, Daniel Kiper <daniel.kiper@oracle.com>
Cc: Juergen Gross <JGross@suse.com>,
	sstabellini@kernel.org, cardoe@cardoe.com, pgnet.dev@gmail.com,
	ning.sun@intel.com, david.vrabel@citrix.com,
	xen-devel@lists.xenproject.org, qiaowei.ren@intel.com,
	richard.l.maliszewski@intel.com, gang.wei@intel.com,
	fu.wei@linaro.org
Subject: Re: [PATCH v4 02/19] x86/boot: remove multiboot1_header_end from symbol table
Date: Tue, 9 Aug 2016 15:09:19 +0100	[thread overview]
Message-ID: <576074cd-934e-7dae-3ce2-ed1fb7c2156c@citrix.com> (raw)
In-Reply-To: <57A9FC2202000078001044DD@prv-mh.provo.novell.com>

On 09/08/16 14:52, Jan Beulich wrote:
>>>> On 09.08.16 at 15:24, <andrew.cooper3@citrix.com> wrote:
>> On 06/08/16 00:04, Daniel Kiper wrote:
>>> --- a/xen/arch/x86/boot/head.S
>>> +++ b/xen/arch/x86/boot/head.S
>>> @@ -32,7 +32,7 @@ multiboot1_header_start:       /*** MULTIBOOT1 HEADER ****/
>>>          .long   MULTIBOOT_HEADER_FLAGS
>>>          /* Checksum: must be the negated sum of the first two fields. */
>>>          .long   -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)
>>> -multiboot1_header_end:
>>> +.Lmultiboot1_header_end:
>> I put this in as a non local symbol for a very good reason, and see no
>> justification to change it.
>>
>> It is very important to be able to distinguish data from opcode in the
>> disassembly, and one extra global symbol will not break the bank.
> Well, I was about to commit it, but will hold of now that you object.
> Nevertheless I disagree, and would like to see the patch go in: If
> there is code starting past this label, then that code should itself
> have a label, and any padding between the end label above and the
> code start label is neither code nor data anyway.

andrewcoop@andrewcoop:/local/xen.git/xen$ objdump -d xen-syms
xen-syms:     file format elf64-x86-64


Disassembly of section .text:

ffff82d080100000 <_start>:
ffff82d080100000:       e9 2b d0 19 00          jmpq   ffff82d08029d030
<__start>
ffff82d080100005:       0f 1f 00                nopl   (%rax)

ffff82d080100008 <multiboot1_header_start>:
ffff82d080100008:       02 b0 ad 1b 03 00       add    0x31bad(%rax),%dh
ffff82d08010000e:       00 00                   add    %al,(%rax)
ffff82d080100010:       fb                      sti   
ffff82d080100011:       4f 52                   rex.WRXB push %r10
ffff82d080100013:       e4 66                   in     $0x66,%al

ffff82d080100014 <multiboot1_header_end>:
ffff82d080100014:       66 66 66 2e 0f 1f 84    data16 data16 nopw
%cs:0x0(%rax,%rax,1)
ffff82d08010001b:       00 00 00 00 00

ffff82d080100020 <__high_start>:
ffff82d080100020:       0f 01 15 df 1f 20 00    lgdt  
0x201fdf(%rip)        # ffff82d080302006 <gdt_descr>
ffff82d080100027:       b9 00 00 00 00          mov    $0x0,%ecx

There is padding, so the symbol doesn't overlap, but given that one byte
at the end of the multiboot header is indistinguishable from the the
7-byte nop immediately following it, the lack of multiboot1_header_end
is very deceptive.

Leaving this symbol in does not have any downside, and has significant
upside in terms of clarity of the disassembled source.

~Andrew

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

  reply	other threads:[~2016-08-09 14:09 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-05 23:04 [PATCH v4 00/19] x86: multiboot2 protocol support Daniel Kiper
2016-08-05 23:04 ` [PATCH v4 01/19] x86: allow EFI reboot method neither on EFI platforms Daniel Kiper
2016-08-09 12:08   ` Jan Beulich
2016-08-05 23:04 ` [PATCH v4 02/19] x86/boot: remove multiboot1_header_end from symbol table Daniel Kiper
2016-08-09 13:24   ` Andrew Cooper
2016-08-09 13:52     ` Jan Beulich
2016-08-09 14:09       ` Andrew Cooper [this message]
2016-08-09 14:30         ` Jan Beulich
2016-08-05 23:04 ` [PATCH v4 03/19] x86/boot: create *.lnk files with linker script Daniel Kiper
2016-08-11 13:40   ` Jan Beulich
2016-08-05 23:04 ` [PATCH v4 04/19] x86/boot/reloc: reduce assembly usage as much as possible Daniel Kiper
2016-08-11 13:56   ` Jan Beulich
2016-08-05 23:04 ` [PATCH v4 05/19] x86/boot: call reloc() using stdcall calling convention Daniel Kiper
2016-08-11 13:59   ` Jan Beulich
2016-08-05 23:04 ` [PATCH v4 06/19] x86/boot/reloc: create generic alloc and copy functions Daniel Kiper
2016-08-11 14:12   ` Jan Beulich
2016-08-11 14:17     ` Jan Beulich
2016-08-18  8:53       ` Daniel Kiper
2016-08-18  9:41         ` Jan Beulich
2016-08-18 12:18           ` Daniel Kiper
2016-08-18 13:21             ` Jan Beulich
2016-08-05 23:04 ` [PATCH v4 07/19] x86/boot: use %ecx instead of %eax Daniel Kiper
2016-08-05 23:04 ` [PATCH v4 08/19] x86/boot/reloc: Rename some variables and rearrange code a bit Daniel Kiper
2016-08-11 14:16   ` Jan Beulich
2016-08-05 23:04 ` [PATCH v4 09/19] x86: add multiboot2 protocol support Daniel Kiper
2016-08-17 15:39   ` Jan Beulich
2016-08-18  9:23     ` Daniel Kiper
2016-08-18  9:43       ` Jan Beulich
2016-08-18 11:41         ` Daniel Kiper
2016-08-18 13:19           ` Jan Beulich
2016-08-05 23:04 ` [PATCH v4 10/19] efi: move efi struct initialization to xen/common/lib.c Daniel Kiper
2016-08-17 15:56   ` Jan Beulich
2016-08-18 10:17     ` Daniel Kiper
2016-08-18 11:17       ` Jan Beulich
2016-08-05 23:04 ` [PATCH v4 11/19] efi: create efi_enabled() Daniel Kiper
2016-08-17 16:08   ` Jan Beulich
2016-08-05 23:04 ` [PATCH v4 12/19] efi: introduce EFI_RS to ease control on runtime services usage Daniel Kiper
2016-08-17 16:12   ` Jan Beulich
2016-08-18 10:30     ` Daniel Kiper
2016-08-18 11:18       ` Jan Beulich
2016-08-18 11:49         ` Daniel Kiper
2016-08-05 23:04 ` [PATCH v4 13/19] efi: EFI_RS bit in efi.flags must be controlled by efi=[no-]rs command line argument Daniel Kiper
2016-08-05 23:04 ` [PATCH v4 14/19] efi: build xen.gz with EFI code Daniel Kiper
2016-08-19  9:24   ` Jan Beulich
2016-08-19 10:09     ` Daniel Kiper
2016-08-05 23:04 ` [PATCH v4 15/19] x86/efi: create new early memory allocator Daniel Kiper
2016-08-05 23:04 ` [PATCH v4 16/19] x86: add multiboot2 protocol support for EFI platforms Daniel Kiper
2016-08-05 23:04 ` [PATCH v4 17/19] x86/boot: implement early command line parser in C Daniel Kiper
2016-08-05 23:04 ` [PATCH v4 18/19] x86: make Xen early boot code relocatable Daniel Kiper
2016-08-05 23:04 ` [PATCH v4 19/19] x86: add multiboot2 protocol support for relocatable images Daniel Kiper

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=576074cd-934e-7dae-3ce2-ed1fb7c2156c@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=JGross@suse.com \
    --cc=cardoe@cardoe.com \
    --cc=daniel.kiper@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=fu.wei@linaro.org \
    --cc=gang.wei@intel.com \
    --cc=ning.sun@intel.com \
    --cc=pgnet.dev@gmail.com \
    --cc=qiaowei.ren@intel.com \
    --cc=richard.l.maliszewski@intel.com \
    --cc=sstabellini@kernel.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.