[PATCH 01/29] default-configs: Add TARGET_XML_FILES definition

Alex Bennée posted 29 patches 2 years, 1 month ago
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, Laurent Vivier <laurent@vivier.eu>, "Alex Bennée" <alex.bennee@linaro.org>, Thomas Huth <thuth@redhat.com>, Alexandre Iooss <erdnaxe@crans.org>, Mahmoud Mandour <ma.mandourr@gmail.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Yanan Wang <wangyanan55@huawei.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, John Snow <jsnow@redhat.com>, Cleber Rosa <crosa@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Michael Rolnik <mrolnik@gmail.com>, Brian Cain <bcain@quicinc.com>, Song Gao <gaosong@loongson.cn>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Nicholas Piggin <npiggin@gmail.com>, Daniel Henrique Barboza <danielhb413@gmail.com>, "Cédric Le Goater" <clg@kaod.org>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Bin Meng <bin.meng@windriver.com>, Weiwei Li <liweiwei@iscas.ac.cn>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>, Yoshinori Sato <ysato@users.sourceforge.jp>, David Hildenbrand <david@redhat.com>, Ilya Leoshkevich <iii@linux.ibm.com>, Wainer dos Santos Moschetta <wainersm@redhat.com>, Beraldo Leal <bleal@redhat.com>
[PATCH 01/29] default-configs: Add TARGET_XML_FILES definition
Posted by Alex Bennée 2 years, 1 month ago
From: Akihiko Odaki <akihiko.odaki@daynix.com>

loongarch64-linux-user has references to XML files so include them.

Fixes: d32688ecdb ("default-configs: Add loongarch linux-user support")
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Message-Id: <20231030054834.39145-6-akihiko.odaki@daynix.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 configs/targets/loongarch64-linux-user.mak | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/targets/loongarch64-linux-user.mak b/configs/targets/loongarch64-linux-user.mak
index 7d1b964020..43b8a2160f 100644
--- a/configs/targets/loongarch64-linux-user.mak
+++ b/configs/targets/loongarch64-linux-user.mak
@@ -1,3 +1,4 @@
 # Default configuration for loongarch64-linux-user
 TARGET_ARCH=loongarch64
 TARGET_BASE_ARCH=loongarch
+TARGET_XML_FILES=gdb-xml/loongarch-base32.xml gdb-xml/loongarch-base64.xml gdb-xml/loongarch-fpu.xml
-- 
2.39.2


Re: [PATCH 01/29] default-configs: Add TARGET_XML_FILES definition
Posted by Richard Henderson 2 years, 1 month ago
On 11/3/23 12:59, Alex Bennée wrote:
> From: Akihiko Odaki <akihiko.odaki@daynix.com>
> 
> loongarch64-linux-user has references to XML files so include them.
> 
> Fixes: d32688ecdb ("default-configs: Add loongarch linux-user support")
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
> Message-Id: <20231030054834.39145-6-akihiko.odaki@daynix.com>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   configs/targets/loongarch64-linux-user.mak | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/configs/targets/loongarch64-linux-user.mak b/configs/targets/loongarch64-linux-user.mak
> index 7d1b964020..43b8a2160f 100644
> --- a/configs/targets/loongarch64-linux-user.mak
> +++ b/configs/targets/loongarch64-linux-user.mak
> @@ -1,3 +1,4 @@
>   # Default configuration for loongarch64-linux-user
>   TARGET_ARCH=loongarch64
>   TARGET_BASE_ARCH=loongarch
> +TARGET_XML_FILES=gdb-xml/loongarch-base32.xml gdb-xml/loongarch-base64.xml gdb-xml/loongarch-fpu.xml


The qemu-loongarch64 binary emulates loongarch64 only, not loongarch32.  The inclusion of 
loongarch-base32.xml here is not relevant.

That said, we don't exclude TYPE_LOONGARCH32_CPU or -cpu la132 from CONFIG_USER_ONLY, 
which is a separate mistake.


r~

Re: [PATCH 01/29] default-configs: Add TARGET_XML_FILES definition
Posted by Alex Bennée 2 years, 1 month ago
Richard Henderson <richard.henderson@linaro.org> writes:

> On 11/3/23 12:59, Alex Bennée wrote:
>> From: Akihiko Odaki <akihiko.odaki@daynix.com>
>> loongarch64-linux-user has references to XML files so include them.
>> Fixes: d32688ecdb ("default-configs: Add loongarch linux-user
>> support")
>> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
>> Message-Id: <20231030054834.39145-6-akihiko.odaki@daynix.com>
>> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>>   configs/targets/loongarch64-linux-user.mak | 1 +
>>   1 file changed, 1 insertion(+)
>> diff --git a/configs/targets/loongarch64-linux-user.mak
>> b/configs/targets/loongarch64-linux-user.mak
>> index 7d1b964020..43b8a2160f 100644
>> --- a/configs/targets/loongarch64-linux-user.mak
>> +++ b/configs/targets/loongarch64-linux-user.mak
>> @@ -1,3 +1,4 @@
>>   # Default configuration for loongarch64-linux-user
>>   TARGET_ARCH=loongarch64
>>   TARGET_BASE_ARCH=loongarch
>> +TARGET_XML_FILES=gdb-xml/loongarch-base32.xml gdb-xml/loongarch-base64.xml gdb-xml/loongarch-fpu.xml
>
>
> The qemu-loongarch64 binary emulates loongarch64 only, not
> loongarch32.  The inclusion of loongarch-base32.xml here is not
> relevant.

Does the system binary emulate both?

> That said, we don't exclude TYPE_LOONGARCH32_CPU or -cpu la132 from
> CONFIG_USER_ONLY, which is a separate mistake.

Where should that be done?

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro
Re: [PATCH 01/29] default-configs: Add TARGET_XML_FILES definition
Posted by Richard Henderson 2 years, 1 month ago
On 11/6/23 07:44, Alex Bennée wrote:
>>> +TARGET_XML_FILES=gdb-xml/loongarch-base32.xml gdb-xml/loongarch-base64.xml gdb-xml/loongarch-fpu.xml
>>
>>
>> The qemu-loongarch64 binary emulates loongarch64 only, not
>> loongarch32.  The inclusion of loongarch-base32.xml here is not
>> relevant.
> 
> Does the system binary emulate both?

Yes.

Technically, the user-only binary will emulate the 32-bit cpu just fine.  But much like 
aarch64, there is no ilp32 kernel abi for loongarch.


>> That said, we don't exclude TYPE_LOONGARCH32_CPU or -cpu la132 from
>> CONFIG_USER_ONLY, which is a separate mistake.
> 
> Where should that be done?

Probably target/loongarch/cpu.c, by omitting TYPE_LOONGARCH32_CPU and "la132".


r~