qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] hw/loongarch/boot: Use warn_report when no kernel filename
@ 2024-10-30  1:23 Song Gao
  2024-10-30  2:18 ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 2+ messages in thread
From: Song Gao @ 2024-10-30  1:23 UTC (permalink / raw)
  To: qemu-devel, philmd
  Cc: richard.henderson, peter.maydell, jiaxun.yang, maobibo, pbonzini,
	armbru, lixianglai

When we run “qemu-system-loongarch64 -qmp stdio -vnc none -S”,
we get an error message “Need kernel filename” and then we can't use qmp cmd to query some information.
So, we just throw a warning and then the cpus starts running from address VIRT_FLASH0_BASE.

Signed-off-by: Song Gao <gaosong@loongson.cn>
---
 hw/loongarch/boot.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/hw/loongarch/boot.c b/hw/loongarch/boot.c
index cb668703bd..5f194e1a77 100644
--- a/hw/loongarch/boot.c
+++ b/hw/loongarch/boot.c
@@ -278,7 +278,7 @@ static void init_boot_rom(struct loongarch_boot_info *info, void *p)
 static void loongarch_direct_kernel_boot(struct loongarch_boot_info *info)
 {
     void *p, *bp;
-    int64_t kernel_addr = 0;
+    int64_t kernel_addr = VIRT_FLASH0_BASE;
     LoongArchCPU *lacpu;
     CPUState *cs;
 
@@ -286,8 +286,7 @@ static void loongarch_direct_kernel_boot(struct loongarch_boot_info *info)
         kernel_addr = load_kernel_info(info);
     } else {
         if(!qtest_enabled()) {
-            error_report("Need kernel filename\n");
-            exit(1);
+            warn_report("No kernel provided, booting from flash drive. \n");
         }
     }
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] hw/loongarch/boot: Use warn_report when no kernel filename
  2024-10-30  1:23 [PATCH v2] hw/loongarch/boot: Use warn_report when no kernel filename Song Gao
@ 2024-10-30  2:18 ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 2+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-10-30  2:18 UTC (permalink / raw)
  To: Song Gao, qemu-devel
  Cc: richard.henderson, peter.maydell, jiaxun.yang, maobibo, pbonzini,
	armbru, lixianglai

On 29/10/24 22:23, Song Gao wrote:
> When we run “qemu-system-loongarch64 -qmp stdio -vnc none -S”,
> we get an error message “Need kernel filename” and then we can't use qmp cmd to query some information.
> So, we just throw a warning and then the cpus starts running from address VIRT_FLASH0_BASE.
> 
> Signed-off-by: Song Gao <gaosong@loongson.cn>
> ---
>   hw/loongarch/boot.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)


> @@ -286,8 +286,7 @@ static void loongarch_direct_kernel_boot(struct loongarch_boot_info *info)
>           kernel_addr = load_kernel_info(info);
>       } else {
>           if(!qtest_enabled()) {
> -            error_report("Need kernel filename\n");
> -            exit(1);
> +            warn_report("No kernel provided, booting from flash drive. \n");

Stripping trailing " \n",

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>

>           }
>       }
>   



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-10-30  2:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-30  1:23 [PATCH v2] hw/loongarch/boot: Use warn_report when no kernel filename Song Gao
2024-10-30  2:18 ` Philippe Mathieu-Daudé

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).