[PATCH] qemu-options: Enable the -enable-kvm option for loongarch

Miao Wang via B4 Relay posted 1 patch 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260705-add-loong64-kvm-v1-1-aa8b85ecfa32@gmail.com
qemu-options.hx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] qemu-options: Enable the -enable-kvm option for loongarch
Posted by Miao Wang via B4 Relay 3 weeks ago
From: Miao Wang <shankerwangmiao@gmail.com>

Signed-off-by: Miao Wang <shankerwangmiao@gmail.com>
---
 qemu-options.hx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index e44b47de68137120da9979fb081d0c108f13179c..c7dbbd01e73367380fcf653fa8d0d18795dde9a7 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -5164,7 +5164,7 @@ ERST
 DEF("enable-kvm", 0, QEMU_OPTION_enable_kvm, \
     "-enable-kvm     enable KVM full virtualization support\n",
     QEMU_ARCH_ARM | QEMU_ARCH_I386 | QEMU_ARCH_MIPS | QEMU_ARCH_PPC |
-    QEMU_ARCH_RISCV | QEMU_ARCH_S390X)
+    QEMU_ARCH_RISCV | QEMU_ARCH_S390X | QEMU_ARCH_LOONGARCH)
 SRST
 ``-enable-kvm``
     Enable KVM full virtualization support. This option is only

---
base-commit: 30e8a06b64aa58a3990ba39cb5d09531e7d265e0
change-id: 20260705-add-loong64-kvm-d271ec6d0ebf

Best regards,
-- 
Miao Wang <shankerwangmiao@gmail.com>
Re: [PATCH] qemu-options: Enable the -enable-kvm option for loongarch
Posted by Philippe Mathieu-Daudé 2 weeks, 5 days ago
Hi,

On 4/7/26 21:50, Miao Wang via B4 Relay wrote:
> From: Miao Wang <shankerwangmiao@gmail.com>
> 
> Signed-off-by: Miao Wang <shankerwangmiao@gmail.com>
> ---
>   qemu-options.hx | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/qemu-options.hx b/qemu-options.hx
> index e44b47de68137120da9979fb081d0c108f13179c..c7dbbd01e73367380fcf653fa8d0d18795dde9a7 100644
> --- a/qemu-options.hx
> +++ b/qemu-options.hx
> @@ -5164,7 +5164,7 @@ ERST
>   DEF("enable-kvm", 0, QEMU_OPTION_enable_kvm, \
>       "-enable-kvm     enable KVM full virtualization support\n",
>       QEMU_ARCH_ARM | QEMU_ARCH_I386 | QEMU_ARCH_MIPS | QEMU_ARCH_PPC |
> -    QEMU_ARCH_RISCV | QEMU_ARCH_S390X)
> +    QEMU_ARCH_RISCV | QEMU_ARCH_S390X | QEMU_ARCH_LOONGARCH)
>   SRST
>   ``-enable-kvm``
>       Enable KVM full virtualization support. This option is only

Isn't the legacy option for "-accel kvm"? (Apparently since commit
303d4e865b7 which is from September 2010). Maybe we should get rid
of the '-enable-kvm' use in examples / scripts...
Re: [PATCH] qemu-options: Enable the -enable-kvm option for loongarch
Posted by Miao Wang 2 weeks, 5 days ago
Hi,

> 2026年7月7日 16:57,Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> 写道:
> 
> Hi,
> 
> On 4/7/26 21:50, Miao Wang via B4 Relay wrote:
>> From: Miao Wang <shankerwangmiao@gmail.com>
>> Signed-off-by: Miao Wang <shankerwangmiao@gmail.com>
>> ---
>>  qemu-options.hx | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> diff --git a/qemu-options.hx b/qemu-options.hx
>> index e44b47de68137120da9979fb081d0c108f13179c..c7dbbd01e73367380fcf653fa8d0d18795dde9a7 100644
>> --- a/qemu-options.hx
>> +++ b/qemu-options.hx
>> @@ -5164,7 +5164,7 @@ ERST
>>  DEF("enable-kvm", 0, QEMU_OPTION_enable_kvm, \
>>      "-enable-kvm     enable KVM full virtualization support\n",
>>      QEMU_ARCH_ARM | QEMU_ARCH_I386 | QEMU_ARCH_MIPS | QEMU_ARCH_PPC |
>> -    QEMU_ARCH_RISCV | QEMU_ARCH_S390X)
>> +    QEMU_ARCH_RISCV | QEMU_ARCH_S390X | QEMU_ARCH_LOONGARCH)
>>  SRST
>>  ``-enable-kvm``
>>      Enable KVM full virtualization support. This option is only
> 
> Isn't the legacy option for "-accel kvm"? (Apparently since commit
> 303d4e865b7 which is from September 2010). Maybe we should get rid
> of the '-enable-kvm' use in examples / scripts...


Yes, but I noticed that there are still users of it. I believe that
either we can fully remove this option or we should enable this
option for every architecture for which kvm is actually supported.

Cheers,

Miao Wang
Re: [PATCH] qemu-options: Enable the -enable-kvm option for loongarch
Posted by Philippe Mathieu-Daudé 2 weeks, 5 days ago
On 7/7/26 11:01, Miao Wang wrote:
> Hi,
> 
>> 2026年7月7日 16:57,Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> 写道:
>>
>> Hi,
>>
>> On 4/7/26 21:50, Miao Wang via B4 Relay wrote:
>>> From: Miao Wang <shankerwangmiao@gmail.com>
>>> Signed-off-by: Miao Wang <shankerwangmiao@gmail.com>
>>> ---
>>>   qemu-options.hx | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>> diff --git a/qemu-options.hx b/qemu-options.hx
>>> index e44b47de68137120da9979fb081d0c108f13179c..c7dbbd01e73367380fcf653fa8d0d18795dde9a7 100644
>>> --- a/qemu-options.hx
>>> +++ b/qemu-options.hx
>>> @@ -5164,7 +5164,7 @@ ERST
>>>   DEF("enable-kvm", 0, QEMU_OPTION_enable_kvm, \
>>>       "-enable-kvm     enable KVM full virtualization support\n",
>>>       QEMU_ARCH_ARM | QEMU_ARCH_I386 | QEMU_ARCH_MIPS | QEMU_ARCH_PPC |
>>> -    QEMU_ARCH_RISCV | QEMU_ARCH_S390X)
>>> +    QEMU_ARCH_RISCV | QEMU_ARCH_S390X | QEMU_ARCH_LOONGARCH)
>>>   SRST
>>>   ``-enable-kvm``
>>>       Enable KVM full virtualization support. This option is only
>>
>> Isn't the legacy option for "-accel kvm"? (Apparently since commit
>> 303d4e865b7 which is from September 2010). Maybe we should get rid
>> of the '-enable-kvm' use in examples / scripts...
> 
> 
> Yes, but I noticed that there are still users of it. I believe that
> either we can fully remove this option or we should enable this
> option for every architecture for which kvm is actually supported.

Why do you want to add this legacy option to an architecture which is
newer than the new CLI option and don't even need it listed at all in
the help message?


Re: [PATCH] qemu-options: Enable the -enable-kvm option for loongarch
Posted by Miao Wang 2 weeks, 5 days ago
Hi,

> 2026年7月7日 17:50,Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> 写道:
> 
> On 7/7/26 11:01, Miao Wang wrote:
>> Hi,
>>> 2026年7月7日 16:57,Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> 写道:
>>> 
>>> Hi,
>>> 
>>> On 4/7/26 21:50, Miao Wang via B4 Relay wrote:
>>>> From: Miao Wang <shankerwangmiao@gmail.com>
>>>> Signed-off-by: Miao Wang <shankerwangmiao@gmail.com>
>>>> ---
>>>>  qemu-options.hx | 2 +-
>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>> diff --git a/qemu-options.hx b/qemu-options.hx
>>>> index e44b47de68137120da9979fb081d0c108f13179c..c7dbbd01e73367380fcf653fa8d0d18795dde9a7 100644
>>>> --- a/qemu-options.hx
>>>> +++ b/qemu-options.hx
>>>> @@ -5164,7 +5164,7 @@ ERST
>>>>  DEF("enable-kvm", 0, QEMU_OPTION_enable_kvm, \
>>>>      "-enable-kvm     enable KVM full virtualization support\n",
>>>>      QEMU_ARCH_ARM | QEMU_ARCH_I386 | QEMU_ARCH_MIPS | QEMU_ARCH_PPC |
>>>> -    QEMU_ARCH_RISCV | QEMU_ARCH_S390X)
>>>> +    QEMU_ARCH_RISCV | QEMU_ARCH_S390X | QEMU_ARCH_LOONGARCH)
>>>>  SRST
>>>>  ``-enable-kvm``
>>>>      Enable KVM full virtualization support. This option is only
>>> 
>>> Isn't the legacy option for "-accel kvm"? (Apparently since commit
>>> 303d4e865b7 which is from September 2010). Maybe we should get rid
>>> of the '-enable-kvm' use in examples / scripts...
>> Yes, but I noticed that there are still users of it. I believe that
>> either we can fully remove this option or we should enable this
>> option for every architecture for which kvm is actually supported.
> 
> Why do you want to add this legacy option to an architecture which is
> newer than the new CLI option and don't even need it listed at all in
> the help message?

That's because utilities and scripts may expect that there should be
an unified option to enable kvm acceleration. "-enable-kvm" might be
their choice. However, if "-enable-kvm" is considered legacy and new
users should switch to "-accel kvm", I can accept it, not moving
this patch forward.

Cheers,

Miao Wang
Re: [PATCH] qemu-options: Enable the -enable-kvm option for loongarch
Posted by Philippe Mathieu-Daudé 2 weeks, 5 days ago
On 7/7/26 11:54, Miao Wang wrote:
> Hi,
> 
>> 2026年7月7日 17:50,Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> 写道:
>>
>> On 7/7/26 11:01, Miao Wang wrote:
>>> Hi,
>>>> 2026年7月7日 16:57,Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> 写道:
>>>>
>>>> Hi,
>>>>
>>>> On 4/7/26 21:50, Miao Wang via B4 Relay wrote:
>>>>> From: Miao Wang <shankerwangmiao@gmail.com>
>>>>> Signed-off-by: Miao Wang <shankerwangmiao@gmail.com>
>>>>> ---
>>>>>   qemu-options.hx | 2 +-
>>>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>>> diff --git a/qemu-options.hx b/qemu-options.hx
>>>>> index e44b47de68137120da9979fb081d0c108f13179c..c7dbbd01e73367380fcf653fa8d0d18795dde9a7 100644
>>>>> --- a/qemu-options.hx
>>>>> +++ b/qemu-options.hx
>>>>> @@ -5164,7 +5164,7 @@ ERST
>>>>>   DEF("enable-kvm", 0, QEMU_OPTION_enable_kvm, \
>>>>>       "-enable-kvm     enable KVM full virtualization support\n",
>>>>>       QEMU_ARCH_ARM | QEMU_ARCH_I386 | QEMU_ARCH_MIPS | QEMU_ARCH_PPC |
>>>>> -    QEMU_ARCH_RISCV | QEMU_ARCH_S390X)
>>>>> +    QEMU_ARCH_RISCV | QEMU_ARCH_S390X | QEMU_ARCH_LOONGARCH)
>>>>>   SRST
>>>>>   ``-enable-kvm``
>>>>>       Enable KVM full virtualization support. This option is only
>>>>
>>>> Isn't the legacy option for "-accel kvm"? (Apparently since commit
>>>> 303d4e865b7 which is from September 2010). Maybe we should get rid
>>>> of the '-enable-kvm' use in examples / scripts...
>>> Yes, but I noticed that there are still users of it. I believe that
>>> either we can fully remove this option or we should enable this
>>> option for every architecture for which kvm is actually supported.
>>
>> Why do you want to add this legacy option to an architecture which is
>> newer than the new CLI option and don't even need it listed at all in
>> the help message?
> 
> That's because utilities and scripts may expect that there should be
> an unified option to enable kvm acceleration. "-enable-kvm" might be
> their choice. However, if "-enable-kvm" is considered legacy and new
> users should switch to "-accel kvm", I can accept it, not moving
> this patch forward.

When qemu-system-loongarch64 was introduced, "-enable-kvm" was already
legacy and "-accel kvm" was already available, and "-enable-kvm" has
never been listed for this binary, so I expect the users to use the
correct up-to-date syntax. No need to confuse them.

Thanks,

Phil.