From: WANG Xuerui <i.qemu@xen0n.name>
To: Song Gao <gaosong@loongson.cn>
Cc: peter.maydell@linaro.org, thuth@redhat.com, f4bug@amsat.org,
wuxiaotian@loongson.cn, alex.bennee@linaro.org,
richard.henderson@linaro.org, qemu-devel@nongnu.org,
peterx@redhat.com, laurent@vivier.eu, yangxiaojuan@loongson.cn,
alistair.francis@wdc.com, maobibo@loongson.cn,
pbonzini@redhat.com, bmeng.cn@gmail.com, philmd@redhat.com,
chenhuacai@loongson.cn
Subject: Re: [PATCH v7 21/21] scripts: add loongarch64 binfmt config
Date: Thu, 21 Oct 2021 15:45:42 +0800 [thread overview]
Message-ID: <c198a78a-83ea-5445-7ec2-82a1d88065e6@xen0n.name> (raw)
In-Reply-To: <462f4784-bcfe-0783-12c5-7afaca4a3b89@loongson.cn>
On 2021/10/21 14:24, Song Gao wrote:
> Hi, Xuerui
>
> On 10/18/2021 11:49 PM, WANG Xuerui wrote:
>> Hi Song,
>>
>> On 10/18/21 20:47, Song Gao wrote:
>>> Signed-off-by: Song Gao <gaosong@loongson.cn>
>>> Signed-off-by: Xiaojuan Yang <yangxiaojuan@loongson.cn>
>>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>>> ---
>>> scripts/qemu-binfmt-conf.sh | 6 +++++-
>>> 1 file changed, 5 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh
>>> index 7de996d..5575bdd 100755
>>> --- a/scripts/qemu-binfmt-conf.sh
>>> +++ b/scripts/qemu-binfmt-conf.sh
>>> @@ -4,7 +4,7 @@
>>> qemu_target_list="i386 i486 alpha arm armeb sparc sparc32plus sparc64 \
>>> ppc ppc64 ppc64le m68k mips mipsel mipsn32 mipsn32el mips64 mips64el \
>>> sh4 sh4eb s390x aarch64 aarch64_be hppa riscv32 riscv64 xtensa xtensaeb \
>>> -microblaze microblazeel or1k x86_64 hexagon"
>>> +microblaze microblazeel or1k x86_64 hexagon loongarch64"
>>> i386_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00'
>>> i386_mask='\xff\xff\xff\xff\xff\xfe\xfe\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'
>>> @@ -140,6 +140,10 @@ hexagon_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x
>>> hexagon_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'
>>> hexagon_family=hexagon
>>> +loongarch64_magic='\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02\x01'
>>> +loongarch64_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'
>> Here the EI_OSABI (7th, 0-based offset) byte is ignored which is okay (we want at least ELFOSABI_SYSV=0 and ELFOSABI_GNU=3 but not others, mask of this byte could be "\xfc" to exclude values > 3).
>>
> The EI_OSABI can not be modified. If we support FreeBSD and OpenBSD in the future.
Then the respective changes would belong to a different place than here,
i.e. "binfmt" which is IIRC Linux-only? We can't support running BSD
binaries on top of Linux with user-only emulation AFAIK.
But again, leaving this as-is should pose minimal risk. Even if we only
accept 0~3 at binfmt_misc matching time, we would still let through 1
and 2, so that's not enough and wouldn't make any difference. So while I
don't think you're right wrt the reason you stated, I'd still agree with
not touching this EI_OSABI mask byte.
prev parent reply other threads:[~2021-10-21 7:48 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-18 12:47 [PATCH v7 00/21] Add LoongArch linux-user emulation support Song Gao
2021-10-18 12:47 ` [PATCH v7 01/21] target/loongarch: Add README Song Gao
2021-10-18 12:47 ` [PATCH v7 02/21] target/loongarch: Add core definition Song Gao
2021-10-18 16:06 ` WANG Xuerui
2021-10-18 17:38 ` Philippe Mathieu-Daudé
2021-10-20 8:54 ` Song Gao
2021-10-20 12:00 ` WANG Xuerui
2021-10-20 13:56 ` Richard Henderson
2021-10-21 3:21 ` Song Gao
2021-10-21 4:10 ` WANG Xuerui
2021-10-22 0:12 ` Bob Proulx
2021-10-22 2:04 ` yangxiaojuan
2021-10-18 12:47 ` [PATCH v7 03/21] target/loongarch: Add main translation routines Song Gao
2021-10-18 12:58 ` Philippe Mathieu-Daudé
2021-10-18 12:47 ` [PATCH v7 04/21] target/loongarch: Add fixed point arithmetic instruction translation Song Gao
2021-10-18 12:47 ` [PATCH v7 05/21] target/loongarch: Add fixed point shift " Song Gao
2021-10-18 12:47 ` [PATCH v7 06/21] target/loongarch: Add fixed point bit " Song Gao
2021-10-18 12:47 ` [PATCH v7 07/21] target/loongarch: Add fixed point load/store " Song Gao
2021-10-18 12:47 ` [PATCH v7 08/21] target/loongarch: Add fixed point atomic " Song Gao
2021-10-18 12:47 ` [PATCH v7 09/21] target/loongarch: Add fixed point extra " Song Gao
2021-10-18 12:47 ` [PATCH v7 10/21] target/loongarch: Add floating point arithmetic " Song Gao
2021-10-18 12:47 ` [PATCH v7 11/21] target/loongarch: Add floating point comparison " Song Gao
2021-10-18 12:47 ` [PATCH v7 12/21] target/loongarch: Add floating point conversion " Song Gao
2021-10-18 12:47 ` [PATCH v7 13/21] target/loongarch: Add floating point move " Song Gao
2021-10-18 12:47 ` [PATCH v7 14/21] target/loongarch: Add floating point load/store " Song Gao
2021-10-18 12:47 ` [PATCH v7 15/21] target/loongarch: Add branch " Song Gao
2021-10-18 12:47 ` [PATCH v7 16/21] target/loongarch: Add disassembler Song Gao
2021-10-18 15:38 ` WANG Xuerui
2021-10-18 17:29 ` Richard Henderson
2021-10-18 18:18 ` WANG Xuerui
2021-10-18 18:33 ` Richard Henderson
2021-10-18 18:57 ` Philippe Mathieu-Daudé
2021-10-20 6:37 ` Song Gao
2021-10-18 12:47 ` [PATCH v7 17/21] LoongArch Linux User Emulation Song Gao
2021-10-18 15:22 ` WANG Xuerui
2021-10-18 12:47 ` [PATCH v7 18/21] default-configs: Add loongarch linux-user support Song Gao
2021-10-18 12:47 ` [PATCH v7 19/21] target/loongarch: Add target build suport Song Gao
2021-10-18 12:47 ` [PATCH v7 20/21] target/loongarch: 'make check-tcg' support Song Gao
2021-10-18 12:47 ` [PATCH v7 21/21] scripts: add loongarch64 binfmt config Song Gao
2021-10-18 15:49 ` WANG Xuerui
2021-10-21 6:24 ` Song Gao
2021-10-21 7:45 ` WANG Xuerui [this message]
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=c198a78a-83ea-5445-7ec2-82a1d88065e6@xen0n.name \
--to=i.qemu@xen0n.name \
--cc=alex.bennee@linaro.org \
--cc=alistair.francis@wdc.com \
--cc=bmeng.cn@gmail.com \
--cc=chenhuacai@loongson.cn \
--cc=f4bug@amsat.org \
--cc=gaosong@loongson.cn \
--cc=laurent@vivier.eu \
--cc=maobibo@loongson.cn \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=peterx@redhat.com \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=thuth@redhat.com \
--cc=wuxiaotian@loongson.cn \
--cc=yangxiaojuan@loongson.cn \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).