From nobody Tue May 14 00:43:14 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1693402596; cv=none; d=zohomail.com; s=zohoarc; b=KQIoMl3xWUPcx3OlIhE4LvBfv3iP+vEMpCY0kT6h/Mik2CvmUS1tlQ9+OwvLnq2pK/IancIEZhw2whqsdE4/NtWx1BonW4JcroyrYZj1T7kHz2NVrSMaPM17Afjt9NdKYD+U3Ykyoevh9XNhOgkNl93zjXAAQdwz4dXN7SePe0M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693402596; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=J6jO5NbvKLRHgcaZZEBjuoMQq9FCY74iMsuIIi+TDS0=; b=EcWAlddVky5ZyR2dOcmtMjuz3zlFtzahOTqtJ/r1OD+o9v6GNhRP3UF3MK96abOqkSIpf7/p3Bth/jOATXq7BZ/eweeje5bQG8OjtF3Wc+Za3wBxd1xVXrld/ybm8Ce+EPQFQHwOjzVtaYem66ePUuK4JDovBjIDzwwY0MqSn5k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693402596765462.2976881625391; Wed, 30 Aug 2023 06:36:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qbLLy-0002A5-C1; Wed, 30 Aug 2023 09:35:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qbLLw-00029g-OH for qemu-devel@nongnu.org; Wed, 30 Aug 2023 09:35:24 -0400 Received: from mail-oo1-xc31.google.com ([2607:f8b0:4864:20::c31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qbLLu-0006Au-EO for qemu-devel@nongnu.org; Wed, 30 Aug 2023 09:35:24 -0400 Received: by mail-oo1-xc31.google.com with SMTP id 006d021491bc7-5731fe1d2bfso2918119eaf.3 for ; Wed, 30 Aug 2023 06:35:21 -0700 (PDT) Received: from grind.. ([177.94.15.194]) by smtp.gmail.com with ESMTPSA id 125-20020a4a0383000000b0057346742d82sm5938997ooi.6.2023.08.30.06.35.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Aug 2023 06:35:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1693402520; x=1694007320; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=J6jO5NbvKLRHgcaZZEBjuoMQq9FCY74iMsuIIi+TDS0=; b=F8CIzPdFrc7jAy2N/XcWBvn4qP25kRqEejetoqeGbc/zg0uXfr3gMhHa58zZbc/Bab /LkiY/Nwdsk25h/A7OIlrI+eifhaCQOuDQgi95rbj452YOBQmd4/8dOBUXu+XomwIlnF BvGbGE9oCPvfDltZaoBUOaNdTrRkcoI7RGnaIfH3zZhKJNXIKX3VMG7ZvauXC/YH99tO OU9zmDXyZQBCIs/1mnuMfqcaGEi8G4WfwMkJXUOHVT7LpdsUIM5pAyiIjCqffnDas4gC WmD1THZ7JZw33Ty6hT+Pz60ILFWsNcktDbf/8WLbK+PZZe3mErFFcm36qCi2XWmsRZrI isYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693402520; x=1694007320; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=J6jO5NbvKLRHgcaZZEBjuoMQq9FCY74iMsuIIi+TDS0=; b=TACOLhM5ZzLkldaiAlaELOEa8P8olmzdzRal9JLE8W6bwOEL9VtNErAdc2Obu9rlm5 P36pOyTYGSQ67MtRM0WGP+frsVPEE5qDz/NBCdmEfegaIqCCThlhrhBsYTr+IOTGwBH+ R+Axf4T3chL3EPdTV6mWM2wghXpSulpgd2xjE6tjl0HFkk/d3sgU2Mj+R9zwRjmXnj7m T3T8OCrqbsJQ/BcRjRTBblfAgGRP/A1tgf/Ap7mHnbx+up+pOQnTblsZN8p7q2m1PUdc aspHB3fMTlNcJuC4UxT/u6qB6YBaLUTlIlFJ0NOKipi0FfiwphFz+neLK8VHTyFX8pf1 KTOQ== X-Gm-Message-State: AOJu0YxUwIIrMW8Ta8wcBIne+s59vz78OgyxJ46ZbvEzgkBfxlcuzuN4 oduikYIJqVra/L0JFuIq1/YriZi6V1KtOEYRmoY= X-Google-Smtp-Source: AGHT+IE9jQQdN+cTXGgeNnLKOoFFBStlvjkeBu7HVp2Qo/2SWLRyRU2Qx0fMX1iUsQ8Ps2pK7CmCkQ== X-Received: by 2002:a4a:6547:0:b0:573:2863:2926 with SMTP id z7-20020a4a6547000000b0057328632926mr2133445oog.8.1693402519928; Wed, 30 Aug 2023 06:35:19 -0700 (PDT) From: Daniel Henrique Barboza To: 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, richard.henderson@linaro.org, Daniel Henrique Barboza Subject: [PATCH v2 1/2] hw/riscv/virt.c: fix non-KVM --enable-debug build Date: Wed, 30 Aug 2023 10:35:02 -0300 Message-ID: <20230830133503.711138-2-dbarboza@ventanamicro.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230830133503.711138-1-dbarboza@ventanamicro.com> References: <20230830133503.711138-1-dbarboza@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::c31; envelope-from=dbarboza@ventanamicro.com; helo=mail-oo1-xc31.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ventanamicro.com) X-ZM-MESSAGEID: 1693402597899100001 Content-Type: text/plain; charset="utf-8" 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 `v= irt_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 'kvm_enabled()' conditional together with virt_use_kvm_aia() will make the compiler crop the kvm_riscv_aia_create() call entirely from a non-KVM build. Note that adding the 'kvm_enabled()' conditional inside virt_use_kvm_aia() won't fix the build because this function would need to be inlined multiple times to make the compiler zero out the entire block. While we're at it, use kvm_enabled() in all instances where virt_use_kvm_aia() is checked to allow the compiler to elide these other kvm-only instances as well. Suggested-by: Richard Henderson Fixes: dbdb99948e ("target/riscv: select KVM AIA in riscv virt machine") Signed-off-by: Daniel Henrique Barboza Reviewed-by: Andrew Jones Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- hw/riscv/virt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 388e52a294..3b259b9305 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -782,7 +782,7 @@ static void create_fdt_sockets(RISCVVirtState *s, const= MemMapEntry *memmap, } =20 /* KVM AIA only has one APLIC instance */ - if (virt_use_kvm_aia(s)) { + if (kvm_enabled() && virt_use_kvm_aia(s)) { create_fdt_socket_aplic(s, memmap, 0, msi_m_phandle, msi_s_phandle, phandle, &intc_phandles[0], xplic_phandles, @@ -808,7 +808,7 @@ static void create_fdt_sockets(RISCVVirtState *s, const= MemMapEntry *memmap, =20 g_free(intc_phandles); =20 - if (virt_use_kvm_aia(s)) { + if (kvm_enabled() && virt_use_kvm_aia(s)) { *irq_mmio_phandle =3D xplic_phandles[0]; *irq_virtio_phandle =3D xplic_phandles[0]; *irq_pcie_phandle =3D xplic_phandles[0]; @@ -1461,7 +1461,7 @@ static void virt_machine_init(MachineState *machine) } } =20 - if (virt_use_kvm_aia(s)) { + if (kvm_enabled() && virt_use_kvm_aia(s)) { kvm_riscv_aia_create(machine, IMSIC_MMIO_GROUP_MIN_SHIFT, VIRT_IRQCHIP_NUM_SOURCES, VIRT_IRQCHIP_NUM_MS= IS, memmap[VIRT_APLIC_S].base, --=20 2.41.0 From nobody Tue May 14 00:43:14 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1693402587; cv=none; d=zohomail.com; s=zohoarc; b=bxbNcK/7CBUAb2dKa1IVxSyi2hqep4vG9kBRMfH6+DY2kGUTxa2lmN8UvnUAptOsVEEtvh8s3GKpMhISDXkuyGns3Afq+zLFglDDUy7w9hz964NRwBrHFOt/SLjG1B3XJNcG0XxxpmsRqsXaiVAlivCPWcqWORTduQM+BZpOWuE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693402587; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=H/k+UuiCQSAnZhFSc5jEFaZQ7FiDDWP92JVM7gxN+po=; b=FsqPaI6Vkz0VQVfFAnNI323bUoB+354AKCehOIEwviYhUnqCFgPhsZz+FXeU4MUAUpvp1rGHkgygftywyt6fpHu6FSFCG0TUhcfduAcjuXicHHdIArcHAM43LeQoefI1kCgFiyr4IC7gIICLPMMgeOesY+IovjKbLqBlgCuKKK0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693402587672209.9391227191146; Wed, 30 Aug 2023 06:36:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qbLM0-0002BV-My; Wed, 30 Aug 2023 09:35:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qbLLz-0002AZ-FZ for qemu-devel@nongnu.org; Wed, 30 Aug 2023 09:35:27 -0400 Received: from mail-oo1-xc2e.google.com ([2607:f8b0:4864:20::c2e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qbLLw-0006Bl-Mi for qemu-devel@nongnu.org; Wed, 30 Aug 2023 09:35:27 -0400 Received: by mail-oo1-xc2e.google.com with SMTP id 006d021491bc7-5738cb00eebso1870803eaf.2 for ; Wed, 30 Aug 2023 06:35:24 -0700 (PDT) Received: from grind.. ([177.94.15.194]) by smtp.gmail.com with ESMTPSA id 125-20020a4a0383000000b0057346742d82sm5938997ooi.6.2023.08.30.06.35.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Aug 2023 06:35:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1693402523; x=1694007323; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=H/k+UuiCQSAnZhFSc5jEFaZQ7FiDDWP92JVM7gxN+po=; b=WR2pXfkB/2WjnLNYgFfr8SVCeu5/Dk5IyLHWQ2rMb9PQMhGjCY6ADWpngq3HDA5PpI vJPZbJT/NAykVPBOMdty7Bjps5jX1mGPWenH3TCoqLZEzfN4tkwFWE6mDO2vQ00tK/pM 5qbVN//PsAQpnQFI8V9RnFv314CgF12k6L/N1EVeyyb8qT/fc4ZDUr5KE3Qcnzig8kW/ lX/cMLioyybHfYaR+qHRtzviuwe1q+lrpflhMh1ytPvYkIJKK54Ed9EdLgdMMqhgEKTS b2RnwolzPQvcpL1WI1Zs/yZN9Ai2ECv/RAn7OlU6dyey9qsrFnQ1IGltbbGAAEDUuKBd ko+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693402523; x=1694007323; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=H/k+UuiCQSAnZhFSc5jEFaZQ7FiDDWP92JVM7gxN+po=; b=Uw+NIOc4CzQq1q5kgL1+kZZXxgl4O5nJd2CQ1oO43t/IgrPrKAFV2kAenSwmdMpu2C Bwduq+YpmUapUOmPNBEM+N4ajgr6ym+6PNKHjuqd6eORXttVobUFhTawnXqId/3+kWUW UEwmGAmnbJqRjhVf17jRwUc6Im17v5AlghG2k0zRASEIPX+dzEhsGuboSo6mfoFKQzKA xqU4QfQsIyUTtQhrrheY6moytUK/B1dv1EymxRpDo6rROPT5SyNu9+uJY2AjHwFLCd/2 I8wIMZLhsuUUBy+5NorMFzgsZsMx1huYxzBJhar2RHRJJfJuNXt1jHkMBrd1BRd9wfa+ gT9g== X-Gm-Message-State: AOJu0Yw259YizFvBHV+F6b5b9TTQsINTmvTBc6r4UQ+0+mRer6XdeVFt lU3oGfHeFe7OWdlh60p5aZQbNTTT66a+kt+uhgg= X-Google-Smtp-Source: AGHT+IGZ3cFJYSYEX+t5gSPEP3ZS0kav5i7FI3wscR13fUpZ3OchZrx+m1jpj88NHcwhtTH49WU7yw== X-Received: by 2002:a4a:3416:0:b0:571:aceb:26ce with SMTP id b22-20020a4a3416000000b00571aceb26cemr2313476ooa.1.1693402522999; Wed, 30 Aug 2023 06:35:22 -0700 (PDT) From: Daniel Henrique Barboza To: 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, richard.henderson@linaro.org, Daniel Henrique Barboza Subject: [PATCH v2 2/2] hw/intc/riscv_aplic.c fix non-KVM --enable-debug build Date: Wed, 30 Aug 2023 10:35:03 -0300 Message-ID: <20230830133503.711138-3-dbarboza@ventanamicro.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230830133503.711138-1-dbarboza@ventanamicro.com> References: <20230830133503.711138-1-dbarboza@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::c2e; envelope-from=dbarboza@ventanamicro.com; helo=mail-oo1-xc2e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ventanamicro.com) X-ZM-MESSAGEID: 1693402588289100002 Content-Type: text/plain; charset="utf-8" Commit 6df0b37e2ab breaks a --enable-debug build in a non-KVM environment with the following error: /usr/bin/ld: libqemu-riscv64-softmmu.fa.p/hw_intc_riscv_aplic.c.o: in funct= ion `riscv_kvm_aplic_request': ./qemu/build/../hw/intc/riscv_aplic.c:486: undefined reference to `kvm_set_= irq' collect2: error: ld returned 1 exit status This happens because the debug build will poke into the 'if (is_kvm_aia(aplic->msimode))' block and fail to find a reference to the KVM only function riscv_kvm_aplic_request(). There are multiple solutions to fix this. We'll go with the same solution from the previous patch, i.e. add a kvm_enabled() conditional to filter out the block. But there's a catch: riscv_kvm_aplic_request() is a local function that would end up being used if the compiler crops the block, and this won't work. Quoting Richard Henderson's explanation in [1]: "(...) the compiler won't eliminate entire unused functions with -O0" We'll solve it by moving riscv_kvm_aplic_request() to kvm.c and add its declaration in kvm_riscv.h, where all other KVM specific public functions are already declared. Other archs handles KVM specific code in this manner and we expect to do the same from now on. [1] https://lore.kernel.org/qemu-riscv/d2f1ad02-eb03-138f-9d08-db676deeed05= @linaro.org/ Signed-off-by: Daniel Henrique Barboza Reviewed-by: Andrew Jones Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- hw/intc/riscv_aplic.c | 8 ++------ target/riscv/kvm.c | 5 +++++ target/riscv/kvm_riscv.h | 1 + 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/hw/intc/riscv_aplic.c b/hw/intc/riscv_aplic.c index 592c3ce768..99aae8ccbe 100644 --- a/hw/intc/riscv_aplic.c +++ b/hw/intc/riscv_aplic.c @@ -32,6 +32,7 @@ #include "target/riscv/cpu.h" #include "sysemu/sysemu.h" #include "sysemu/kvm.h" +#include "kvm_riscv.h" #include "migration/vmstate.h" =20 #define APLIC_MAX_IDC (1UL << 14) @@ -481,11 +482,6 @@ static uint32_t riscv_aplic_idc_claimi(RISCVAPLICState= *aplic, uint32_t idc) return topi; } =20 -static void riscv_kvm_aplic_request(void *opaque, int irq, int level) -{ - kvm_set_irq(kvm_state, irq, !!level); -} - static void riscv_aplic_request(void *opaque, int irq, int level) { bool update =3D false; @@ -840,7 +836,7 @@ static void riscv_aplic_realize(DeviceState *dev, Error= **errp) * have IRQ lines delegated by their parent APLIC. */ if (!aplic->parent) { - if (is_kvm_aia(aplic->msimode)) { + if (kvm_enabled() && is_kvm_aia(aplic->msimode)) { qdev_init_gpio_in(dev, riscv_kvm_aplic_request, aplic->num_irq= s); } else { qdev_init_gpio_in(dev, riscv_aplic_request, aplic->num_irqs); diff --git a/target/riscv/kvm.c b/target/riscv/kvm.c index faee8536ef..ac28a70723 100644 --- a/target/riscv/kvm.c +++ b/target/riscv/kvm.c @@ -46,6 +46,11 @@ #include "sysemu/runstate.h" #include "hw/riscv/numa.h" =20 +void riscv_kvm_aplic_request(void *opaque, int irq, int level) +{ + kvm_set_irq(kvm_state, irq, !!level); +} + static uint64_t kvm_riscv_reg_id(CPURISCVState *env, uint64_t type, uint64_t idx) { diff --git a/target/riscv/kvm_riscv.h b/target/riscv/kvm_riscv.h index 7d4b7c60e2..de8c209ebc 100644 --- a/target/riscv/kvm_riscv.h +++ b/target/riscv/kvm_riscv.h @@ -26,5 +26,6 @@ void kvm_riscv_aia_create(MachineState *machine, uint64_t= group_shift, uint64_t aia_irq_num, uint64_t aia_msi_num, uint64_t aplic_base, uint64_t imsic_base, uint64_t guest_num); +void riscv_kvm_aplic_request(void *opaque, int irq, int level); =20 #endif --=20 2.41.0