[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] tests/x86emul: Annotate test blobs as executable code


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <JBeulich@xxxxxxxx>
  • Date: Mon, 5 Aug 2019 09:01:02 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=suse.com;dmarc=pass action=none header.from=suse.com;dkim=pass header.d=suse.com;arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XygOxPB94RzU27oZja5re5JMwK+BaprhTBGP/tbFptg=; b=GmJIf6wNapYQkzm2gUTIxMHRDyiovMAc/dzMOkOFQ873nRbTjxV/YO3zJcue+CPaNrO5ClDIQE2xxXp0rKKWUkPaEVEKGhdcTyCYS6crA84eHSPP6eV745fdpR4BK3bzYOeoC5tprAsL+5zV0nVDWv4oM35LuN/foSFHkG4PdFfyhdlLSDxosZJQUkRT2LiIaMIV5HkBLDmcpyw2/h/16Xvu5B3p8bpUsHHj3TRxiuaK75MDgXFexF+RYoyA4hLLq4Fv0uCbzetDyKMVwBKJMIJxxV5cd0G0UvYu1Uo5Cqs394GrBpopV2qvQ+SlmLnppo2Fcyom9OczRx8nlVL0cQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EzJgO1mM3rlqXQ2TpBs+nnxo0zjWT63YNMPjshpK9Ie8AoWG3RI+ARrsOU/1BJn1ALwtimvnYrirly1fAhdjFGZdc0Di1KNJ3SLMbPmTg/360gIjQ/kyGUYR3DPAhqbIeKA2gX6TvJ++F7QyTzv+cIZ1higoAHfeMooR+itCgYlysN0hkgnJ0Dnq97o1wv6ajydzuW+HdB8t6OVrCLKkzPBggRoBtIDzIwCLHbYlgit4WK3LcN8ybJaEELgKdl3mCY6xwaR28lcrj3r6Yy6AC9IwoCxKfaXe4bV24N1aQyNJkkV9liCRQIgkzq1C9474MD9SUn/BS3OWARF5g50jkw==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=JBeulich@xxxxxxxx;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Mon, 05 Aug 2019 09:04:30 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVMYy6AFJGJVgH7EeLWuDdwzrRe6boXisogAQXWAA=
  • Thread-topic: [PATCH] tests/x86emul: Annotate test blobs as executable code

On 02.08.2019 20:31, Andrew Cooper wrote:
> On 03/07/2019 11:47, Jan Beulich wrote:
>>>>> On 24.05.19 at 17:15, <andrew.cooper3@xxxxxxxxxx> wrote:
>>> --- a/tools/tests/x86_emulator/Makefile
>>> +++ b/tools/tests/x86_emulator/Makefile
>>> @@ -149,7 +149,7 @@ $(addsuffix .h,$(TESTCASES)): %.h: %.c testcase.mk 
>>> Makefile
>>>             (echo 'static const unsigned int __attribute__((section(".test, 
>>> \"ax\", @progbits #")))' \
>>>                   "$${prefix}_$(arch)$${flavor}[] = {"; \
>>>              od -v -t x $*.bin | sed -e 's/^[0-9]* /0x/' -e 's/ /, 0x/g' -e 
>>> 's/$$/,/'; \
>>> -            echo "};") >>$@.new; \
>>> +            echo "}; asm(\".type $${prefix}_$(arch)$${flavor}, 
>>> STT_FUNC;\");") >>$@.new; \
>> While I think we've sufficiently agreed on future gas behavior
>> that I'd consider this change fine to make as long as you add
>> an intermediate step going through STT_NOTYPE, I'd like to note
>> that your mileage from this will only be about 50%: While the
>> 64-bit blobs will disassemble fine, I'm afraid the 32-bit ones
>> will be somewhat garbled. Sadly there's no annotation or alike
>> (like Arm's mapping symbols) that one could use to make
>> disassemblers switch bitness for separate blocks of code.
> 
> Thats fine.
> 
> Disassembling twice, once with -mi386 works well, as the symbol names
> still get emitted sensibly.  I even use -m i8086 for bits of Xen's
> trampoline.
> 
> Its rare to need to look at a different disassembly, but its very easy
> to do so if you need to.
> 
> Can I take this reply as an ack for using the STT_NOTYPE intermediate step?

Yes - sorry for not being explicit in this regard.

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.