[PATCH] hw/loongarch/virt: inform guest of kvm

Qiang Ma posted 1 patch 5 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20250603031813.31794-1-maqianga@uniontech.com
Maintainers: Song Gao <gaosong@loongson.cn>, Bibo Mao <maobibo@loongson.cn>, Jiaxun Yang <jiaxun.yang@flygoat.com>
hw/loongarch/virt.c | 4 ++++
1 file changed, 4 insertions(+)
[PATCH] hw/loongarch/virt: inform guest of kvm
Posted by Qiang Ma 5 months, 2 weeks ago
Commit bab27ea2e3 ("hw/arm/virt: smbios:
inform guest of kvm") fixes the same issue
on arm.

without this patch:
[root@localhost ~]# virt-what
qemu

with this patch:
[root@localhost ~]# virt-what
kvm

Signed-off-by: Qiang Ma <maqianga@uniontech.com>
---
 hw/loongarch/virt.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c
index 1b504047db..a3d449ca8b 100644
--- a/hw/loongarch/virt.c
+++ b/hw/loongarch/virt.c
@@ -136,6 +136,10 @@ static void virt_build_smbios(LoongArchVirtMachineState *lvms)
         return;
     }
 
+    if (kvm_enabled()) {
+        product = "KVM Virtual Machine";
+    }
+
     smbios_set_defaults("QEMU", product, mc->name);
 
     smbios_get_tables(ms, SMBIOS_ENTRY_POINT_TYPE_64,
-- 
2.20.1
Re: [PATCH] hw/loongarch/virt: inform guest of kvm
Posted by gaosong 5 months, 2 weeks ago
在 2025/6/3 上午11:18, Qiang Ma 写道:
> Commit bab27ea2e3 ("hw/arm/virt: smbios:
> inform guest of kvm") fixes the same issue
> on arm.
>
> without this patch:
> [root@localhost ~]# virt-what
> qemu
>
> with this patch:
> [root@localhost ~]# virt-what
> kvm
>
> Signed-off-by: Qiang Ma <maqianga@uniontech.com>
> ---
>   hw/loongarch/virt.c | 4 ++++
>   1 file changed, 4 insertions(+)
Reviewed-by: Song Gao <gaosong@loongson.cn>

thanks.
Song Gao
> diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c
> index 1b504047db..a3d449ca8b 100644
> --- a/hw/loongarch/virt.c
> +++ b/hw/loongarch/virt.c
> @@ -136,6 +136,10 @@ static void virt_build_smbios(LoongArchVirtMachineState *lvms)
>           return;
>       }
>   
> +    if (kvm_enabled()) {
> +        product = "KVM Virtual Machine";
> +    }
> +
>       smbios_set_defaults("QEMU", product, mc->name);
>   
>       smbios_get_tables(ms, SMBIOS_ENTRY_POINT_TYPE_64,


Re: [PATCH] hw/loongarch/virt: inform guest of kvm
Posted by Bibo Mao 5 months, 2 weeks ago
Reviewed-by: Bibo Mao <maobibo@loongson.cn>

On 2025/6/3 上午11:18, Qiang Ma wrote:
> Commit bab27ea2e3 ("hw/arm/virt: smbios:
> inform guest of kvm") fixes the same issue
> on arm.
> 
> without this patch:
> [root@localhost ~]# virt-what
> qemu
> 
> with this patch:
> [root@localhost ~]# virt-what
> kvm
> 
> Signed-off-by: Qiang Ma <maqianga@uniontech.com>
> ---
>   hw/loongarch/virt.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c
> index 1b504047db..a3d449ca8b 100644
> --- a/hw/loongarch/virt.c
> +++ b/hw/loongarch/virt.c
> @@ -136,6 +136,10 @@ static void virt_build_smbios(LoongArchVirtMachineState *lvms)
>           return;
>       }
>   
> +    if (kvm_enabled()) {
> +        product = "KVM Virtual Machine";
> +    }
> +
>       smbios_set_defaults("QEMU", product, mc->name);
>   
>       smbios_get_tables(ms, SMBIOS_ENTRY_POINT_TYPE_64,
>