From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Juergen Gross <jgross@suse.com>,
Xen-devel <xen-devel@lists.xenproject.org>,
Daniel De Graaf <dgdegra@tycho.nsa.gov>
Subject: Re: [Xen-devel] [PATCH v3 1/3] xen/flask: Drop the gen-policy.py script
Date: Mon, 9 Dec 2019 17:01:41 +0000 [thread overview]
Message-ID: <f37194ce-bd20-0286-e4a7-c6e6b38eaee9@citrix.com> (raw)
In-Reply-To: <57b4ce90-7756-6073-0985-0310f8709f25@suse.com>
On 09/12/2019 13:38, Jan Beulich wrote:
> On 07.12.2019 22:16, Andrew Cooper wrote:
>> --- /dev/null
>> +++ b/xen/xsm/flask/flask-policy.S
>> @@ -0,0 +1,20 @@
>> + .section .init.rodata, "a", %progbits
>> +
>> +/* const unsigned char xsm_flask_init_policy[] __initconst */
>> + .align 4
> I'm afraid .align is not universal enough to be used here - iirc
> some architectures have it alias .p2align rather than (how e.g.
> x86 behaves) .balign. Looks like .p2align is available in all
> binutils versions we claim to be able to be built with. (I'm
> not sure the one here is needed anyway, but the one below we
> surely want.)
I can switch to p2align, but...
>
>> + .global xsm_flask_init_policy
>> +xsm_flask_init_policy:
>> + .incbin "policy.bin"
>> +.Lend:
>> +
>> + .type xsm_flask_init_policy, %object
>> + .size xsm_flask_init_policy, . - xsm_flask_init_policy
>> +
>> +/* const unsigned int __initconst xsm_flask_init_policy_size */
>> + .align 4
>> + .global xsm_flask_init_policy_size
>> +xsm_flask_init_policy_size:
>> + .long .Lend - xsm_flask_init_policy
> Similarly .long isn't really universal (various arches override
> it in gas). Aiui .dc.l is intended to be portable (despite still
> carrying the 'l' in its name, and despite even this one getting
> overridden by two arches). But perhaps best to ask on the
> binutils list.
... this is not a clear or obvious way to go, not least because it makes
a different expectation that int will never change from being 32 bits.
At least .long will work even if it becomes longer in a future toolchain.
What is used here doesn't need to be universal - it only needs to work
for the architectures we support.
If hand writing an asm file isn't considered good enough, then the other
options are a C file with inline asm incbin, or `objdump
--rename-section`. The latter one would require a few changes elsewhere
in the code, but only for linkage purposes.
~Andrew
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2019-12-09 17:02 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-07 21:16 [Xen-devel] [PATCH for-4.13 v3 0/3] xen: Build fixes related to Python3 Andrew Cooper
2019-12-07 21:16 ` [Xen-devel] [PATCH v3 1/3] xen/flask: Drop the gen-policy.py script Andrew Cooper
2019-12-09 10:38 ` George Dunlap
2019-12-09 13:38 ` Jan Beulich
2019-12-09 17:01 ` Andrew Cooper [this message]
2019-12-10 7:58 ` Jan Beulich
2019-12-09 18:00 ` Daniel De Graaf
2019-12-10 12:17 ` [Xen-devel] [PATCH for-4.13 v4 " Andrew Cooper
2019-12-10 12:41 ` Jürgen Groß
2019-12-10 14:04 ` Jan Beulich
2019-12-10 15:29 ` Julien Grall
2019-12-07 21:16 ` [Xen-devel] [PATCH v3 2/3] xen/banner: Drop the fig-to-oct.py script Andrew Cooper
2019-12-09 11:06 ` George Dunlap
2019-12-07 21:16 ` [Xen-devel] [PATCH v3 3/3] xen/build: Automatically locate a suitable python interpreter Andrew Cooper
2019-12-09 11:00 ` George Dunlap
2019-12-10 12:45 ` Jürgen Groß
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=f37194ce-bd20-0286-e4a7-c6e6b38eaee9@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=dgdegra@tycho.nsa.gov \
--cc=jbeulich@suse.com \
--cc=jgross@suse.com \
--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.