QEMU-Devel Archive mirror
 help / color / mirror / Atom feed
From: maobibo <maobibo@loongson.cn>
To: "Thomas Huth" <thuth@redhat.com>,
	"Song Gao" <gaosong@loongson.cn>, "Peter Xu" <peterx@redhat.com>,
	"Fabiano Rosas" <farosas@suse.de>,
	"Laurent Vivier" <lvivier@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH v3 1/5] hw/loongarch: Rename LOONGARCH_MACHINE with VIRT_MACHINE
Date: Tue, 7 May 2024 15:31:19 +0800	[thread overview]
Message-ID: <fd244788-9452-8c25-eb2f-cbfe8484ad27@loongson.cn> (raw)
In-Reply-To: <ea6ca025-8c2a-49ab-a5b5-9e77d1d4114a@redhat.com>



On 2024/5/7 下午2:10, Thomas Huth wrote:
> On 07/05/2024 03.18, maobibo wrote:
>>
>>
>> On 2024/5/6 下午2:09, maobibo wrote:
>>>
>>>
>>> On 2024/5/6 下午12:24, Thomas Huth wrote:
>>>> On 06/05/2024 05.02, Bibo Mao wrote:
>>>>> On LoongArch system, there is only virt machine type now, name
>>>>> LOONGARCH_MACHINE is confused, rename it with VIRT_MACHINE. Machine 
>>>>> name
>>>>> about Other real hw boards can be added in future.
>>>>>
>>>>> Signed-off-by: Bibo Mao <maobibo@loongson.cn>
>>>>> ---
>>>> ...
>>>>> @@ -1245,7 +1244,7 @@ static void loongarch_class_init(ObjectClass 
>>>>> *oc, void *data)
>>>>>   static const TypeInfo loongarch_machine_types[] = {
>>>>>       {
>>>>> -        .name           = TYPE_LOONGARCH_MACHINE,
>>>>> +        .name           = TYPE_VIRT_MACHINE,
>>>>>           .parent         = TYPE_MACHINE,
>>>>>           .instance_size  = sizeof(LoongArchMachineState),
>>>>>           .class_init     = loongarch_class_init,
>>>>> diff --git a/include/hw/loongarch/virt.h b/include/hw/loongarch/virt.h
>>>>> index 4e14bf6060..5ea2f0370d 100644
>>>>> --- a/include/hw/loongarch/virt.h
>>>>> +++ b/include/hw/loongarch/virt.h
>>>>> @@ -73,8 +73,8 @@ struct LoongArchMachineState {
>>>>>       struct loongarch_boot_info bootinfo;
>>>>>   };
>>>>> -#define TYPE_LOONGARCH_MACHINE  MACHINE_TYPE_NAME("virt")
>>>>> -OBJECT_DECLARE_SIMPLE_TYPE(LoongArchMachineState, LOONGARCH_MACHINE)
>>>>> +#define TYPE_VIRT_MACHINE  MACHINE_TYPE_NAME("virt")
>>>>> +OBJECT_DECLARE_SIMPLE_TYPE(LoongArchMachineState, VIRT_MACHINE)
>>>>>   bool loongarch_is_acpi_enabled(LoongArchMachineState *lams);
>>>>>   void loongarch_acpi_setup(LoongArchMachineState *lams);
>>>>>   #endif
>>>>
>>>>   Hi,
>>>>
>>>> there are currently some efforts going on to create the possibility 
>>>> to link a QEMU binary that contains all targets in one binary. Since 
>>>> we already have a TYPE_VIRT_MACHINE for other targets, I wonder 
>>>> whether it might be better to use LOONGARCH_VIRT_MACHINE than just 
>>>> VIRT_MACHINE here? Philippe, could you comment on this?
>>>
>>> It is great if there is one QEMU binary which supports different 
>>> targets. And LOONGARCH_VIRT_MACHINE is ok for me.
>> Hi Thomas, Philippe,
>>
>> Does machine name "virt" need be changed if LOONGARCH_VIRT_MACHINE is 
>> used? There will be compatible issues if "virt" machine type is not 
>> suggested to use.
>>
>> However CPU type "max" is not widely used now, can we get different 
>> architectures from CPU type rather than machine type for one QEMU 
>> binary which supports different targets?
> 
> I assume it should be fine to keep the "virt" machine name and "max" CPU 
> type for each target, we've got a bunch of those already. I assume we'll 
> keep the binary names as symlinks to the generic binary around and then 
> decide via argv[0] about the main target...? Philippe, do you have 
> already concrete plans for this?
The method using symlinks to generic binary is great. It is transparent 
to detailed architectures. I will refresh the patch and use 
LOONGARCH_VIRT_MACHINE macro.

Regards
Bibo Mao
> 
>   Thomas
> 
> 



  reply	other threads:[~2024-05-07  7:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-06  3:02 [PATCH v3 0/5] Add migration test for loongarch64 Bibo Mao
2024-05-06  3:02 ` [PATCH v3 1/5] hw/loongarch: Rename LOONGARCH_MACHINE with VIRT_MACHINE Bibo Mao
2024-05-06  4:24   ` Thomas Huth
2024-05-06  6:09     ` maobibo
2024-05-07  1:18       ` maobibo
2024-05-07  6:10         ` Thomas Huth
2024-05-07  7:31           ` maobibo [this message]
2024-05-06  3:02 ` [PATCH v3 2/5] hw/loongarch: Rename LoongArchMachineState with VirtMachineState Bibo Mao
2024-05-06  3:02 ` [PATCH v3 3/5] hw/loongarch: Add compat machine for 9.0 Bibo Mao
2024-05-06  3:02 ` [PATCH v3 4/5] hw/loongarch: Set minimium memory size as 256M Bibo Mao
2024-05-06  3:02 ` [PATCH v3 5/5] tests: Add migration test for loongarch64 Bibo Mao

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=fd244788-9452-8c25-eb2f-cbfe8484ad27@loongson.cn \
    --to=maobibo@loongson.cn \
    --cc=farosas@suse.de \
    --cc=gaosong@loongson.cn \
    --cc=lvivier@redhat.com \
    --cc=peterx@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).