qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Daniel Henrique Barboza <dbarboza@ventanamicro.com>,
	qemu-devel@nongnu.org
Cc: qemu-riscv@nongnu.org, alistair.francis@wdc.com,
	bmeng@tinylab.org, liweiwei@iscas.ac.cn,
	zhiwei_liu@linux.alibaba.com, palmer@rivosinc.com
Subject: Re: [PATCH 2/2] hw/riscv/virt.c: fix non-KVM --enable-debug build
Date: Tue, 29 Aug 2023 16:18:48 +0200	[thread overview]
Message-ID: <c0089044-54d2-43ab-6b30-854a4fa3aa4f@linaro.org> (raw)
In-Reply-To: <20230829122144.464489-3-dbarboza@ventanamicro.com>

On 29/8/23 14:21, Daniel Henrique Barboza wrote:
> A build with --enable-debug and without KVM will fail as follows:
> 
> /usr/bin/ld: libqemu-riscv64-softmmu.fa.p/hw_riscv_virt.c.o: in function `virt_machine_init':
> ./qemu/build/../hw/riscv/virt.c:1465: undefined reference to `kvm_riscv_aia_create'
> 
> This happens because the code block with "if virt_use_kvm_aia(s)" isn't
> being ignored by the debug build, resulting in an undefined reference to
> a KVM only function.
> 
> Add a stub for kvm_riscv_aia_create() in kvm_riscv.h when CONFIG_KVM is
> false. Adding it as an inline instead of using kvm-stubs.c will make it
> easier in the future to remember to add stubs for kvm functions that are
> used in multiple accelerator code.
> 
> Fixes: dbdb99948e ("target/riscv: select KVM AIA in riscv virt machine")
> Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
> ---
>   target/riscv/kvm_riscv.h | 10 ++++++++++
>   1 file changed, 10 insertions(+)

Similarly:

-- >8 --
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
@@ -79,7 +79,9 @@
  /* KVM AIA only supports APLIC MSI. APLIC Wired is always emulated by 
QEMU. */
  static bool virt_use_kvm_aia(RISCVVirtState *s)
  {
-    return kvm_irqchip_in_kernel() && s->aia_type == 
VIRT_AIA_TYPE_APLIC_IMSIC;
+    return kvm_enabled()
+        && kvm_irqchip_in_kernel()
+        && s->aia_type == VIRT_AIA_TYPE_APLIC_IMSIC;
  }
---

?


  reply	other threads:[~2023-08-29 14:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-29 12:21 [PATCH 0/2] riscv: fix --enable-debug in riscv-to-apply.next Daniel Henrique Barboza
2023-08-29 12:21 ` [PATCH 1/2] hw/intc/riscv_aplic.c fix non-KVM --enable-debug build Daniel Henrique Barboza
2023-08-29 14:17   ` Philippe Mathieu-Daudé
2023-08-29 22:35     ` Daniel Henrique Barboza
2023-08-29 12:21 ` [PATCH 2/2] hw/riscv/virt.c: " Daniel Henrique Barboza
2023-08-29 14:18   ` Philippe Mathieu-Daudé [this message]
2023-08-29 23:09     ` Daniel Henrique Barboza
2023-08-29 23:30       ` Richard Henderson
2023-08-29 23:51         ` Daniel Henrique Barboza
2023-08-30  1:26           ` Richard Henderson
2023-08-30  9:34             ` Daniel Henrique Barboza
2023-08-30 13:49               ` Richard Henderson

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=c0089044-54d2-43ab-6b30-854a4fa3aa4f@linaro.org \
    --to=philmd@linaro.org \
    --cc=alistair.francis@wdc.com \
    --cc=bmeng@tinylab.org \
    --cc=dbarboza@ventanamicro.com \
    --cc=liweiwei@iscas.ac.cn \
    --cc=palmer@rivosinc.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=zhiwei_liu@linux.alibaba.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 NNTP newsgroup(s).