From patchwork Thu Jul 27 07:31:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13329093 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B9ECC001DC for ; Thu, 27 Jul 2023 07:39:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232586AbjG0Hj5 (ORCPT ); Thu, 27 Jul 2023 03:39:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232561AbjG0Hjk (ORCPT ); Thu, 27 Jul 2023 03:39:40 -0400 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 514E592 for ; Thu, 27 Jul 2023 00:31:47 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-666ecf9a0ceso525163b3a.2 for ; Thu, 27 Jul 2023 00:31:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1690443107; x=1691047907; 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=kND/sAP1+EQqRnqZy1RjucLWpLyH8kHXjE52zNB0+ZU=; b=1rmxoN6pK/bfF17VHISxfbhZSMK3pcw2ESQLTR6SKZxQJeCcFKU7EZnyx2Aw2KbKP6 nYtmSRCfskf6ZkQUEZWNxnMnhtwHLmTfMl3jVNa+5CvTStMxqyNqJw8xBKxvl7ipEfEj 91ClpsOXSJ6Mep0byoC/Tg0UIV/qjelJX5yAuB/YoUrY2d9jL4urO05nbQjLafwbC/df EKy4TkWx7H0VbxpCUP8yLx7u2kV2zugjsVed1gpemPdFvj2pJBuNJ1SXPTirOhqrHQ1t gzAjpFRa3H7MOYig5FHDbfDvpGnXrZPzGeSPziIqTWNcb4rex86hjLA7C9O6VvstLl5a xkAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690443107; x=1691047907; 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=kND/sAP1+EQqRnqZy1RjucLWpLyH8kHXjE52zNB0+ZU=; b=VMBP2eqj+QaDLgurO6HVTmTQ3Jr5ysEAVmwrLVjP4WMb20XJHsYAqBVuhKbdnnayXn cfHVluE1Frz0KNEv7XZ/IFWV06ap9WPhS7HbGygnPpsIBpfdnN4KARrJKixFqRSk6QuQ bwQdL1+V2/i/NiBOYGEgaew3bNlJWvRYBZxZIwH3VluCLQup7/L8LSDHCRMLPnGQovYR 4B/c5g7uNlQ7isWov9Dd63aG58BH6RU5B1kg8RTU/nq0MYnddtLYw5gqAbFdOF9AN8A0 3NhFPO/FJYEsMpY5ln5x2DAOVCHD1YET21UDy7qV5L1Q8pX6zYFo+K9GQrfMx1NRa6Tx f7lg== X-Gm-Message-State: ABy/qLaurqrRz6Ae8M/5MZ+STLwmgjLGGhuYWcw/c9+dHucsIH0b6LuQ YAlcP+KdQsr5MU54SVt4gjonnA== X-Google-Smtp-Source: APBJJlGf5/qwEcqQb+YRRIWpgIri8gmY8P66GnOe7AzCnZb6PsAufb6ciQzjEsoLcRtkUCKnkNb3qA== X-Received: by 2002:a05:6a20:2447:b0:13a:ccb9:d5b7 with SMTP id t7-20020a056a20244700b0013accb9d5b7mr4456373pzc.41.1690443106741; Thu, 27 Jul 2023 00:31:46 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:78d2:b862:10a7:d486]) by smtp.gmail.com with ESMTPSA id d9-20020aa78689000000b0064fa2fdfa9esm802002pfo.81.2023.07.27.00.31.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jul 2023 00:31:46 -0700 (PDT) From: Akihiko Odaki Cc: qemu-devel@nongnu.org, qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , Peter Maydell , Richard Henderson , Akihiko Odaki Subject: [PATCH v5 1/6] kvm: Introduce kvm_arch_get_default_type hook Date: Thu, 27 Jul 2023 16:31:26 +0900 Message-ID: <20230727073134.134102-2-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230727073134.134102-1-akihiko.odaki@daynix.com> References: <20230727073134.134102-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org kvm_arch_get_default_type() returns the default KVM type. This hook is particularly useful to derive a KVM type that is valid for "none" machine model, which is used by libvirt to probe the availability of KVM. For MIPS, the existing mips_kvm_type() is reused. This function ensures the availability of VZ which is mandatory to use KVM on the current QEMU. Signed-off-by: Akihiko Odaki Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- include/sysemu/kvm.h | 2 ++ target/mips/kvm_mips.h | 9 --------- accel/kvm/kvm-all.c | 4 +++- hw/mips/loongson3_virt.c | 2 -- target/arm/kvm.c | 5 +++++ target/i386/kvm/kvm.c | 5 +++++ target/mips/kvm.c | 2 +- target/ppc/kvm.c | 5 +++++ target/riscv/kvm.c | 5 +++++ target/s390x/kvm/kvm.c | 5 +++++ 10 files changed, 31 insertions(+), 13 deletions(-) diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 115f0cca79..ccaf55caf7 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -369,6 +369,8 @@ int kvm_arch_get_registers(CPUState *cpu); int kvm_arch_put_registers(CPUState *cpu, int level); +int kvm_arch_get_default_type(MachineState *ms); + int kvm_arch_init(MachineState *ms, KVMState *s); int kvm_arch_init_vcpu(CPUState *cpu); diff --git a/target/mips/kvm_mips.h b/target/mips/kvm_mips.h index 171d53dbe1..c711269d0a 100644 --- a/target/mips/kvm_mips.h +++ b/target/mips/kvm_mips.h @@ -25,13 +25,4 @@ void kvm_mips_reset_vcpu(MIPSCPU *cpu); int kvm_mips_set_interrupt(MIPSCPU *cpu, int irq, int level); int kvm_mips_set_ipi_interrupt(MIPSCPU *cpu, int irq, int level); -#ifdef CONFIG_KVM -int mips_kvm_type(MachineState *machine, const char *vm_type); -#else -static inline int mips_kvm_type(MachineState *machine, const char *vm_type) -{ - return 0; -} -#endif - #endif /* KVM_MIPS_H */ diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 373d876c05..d591b5079c 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -2458,7 +2458,7 @@ static int kvm_init(MachineState *ms) KVMState *s; const KVMCapabilityInfo *missing_cap; int ret; - int type = 0; + int type; uint64_t dirty_log_manual_caps; qemu_mutex_init(&kml_slots_lock); @@ -2523,6 +2523,8 @@ static int kvm_init(MachineState *ms) type = mc->kvm_type(ms, kvm_type); } else if (mc->kvm_type) { type = mc->kvm_type(ms, NULL); + } else { + type = kvm_arch_get_default_type(ms); } do { diff --git a/hw/mips/loongson3_virt.c b/hw/mips/loongson3_virt.c index 4018b8c1d3..a2c56f7a21 100644 --- a/hw/mips/loongson3_virt.c +++ b/hw/mips/loongson3_virt.c @@ -29,7 +29,6 @@ #include "qemu/datadir.h" #include "qapi/error.h" #include "elf.h" -#include "kvm_mips.h" #include "hw/char/serial.h" #include "hw/intc/loongson_liointc.h" #include "hw/mips/mips.h" @@ -612,7 +611,6 @@ static void loongson3v_machine_class_init(ObjectClass *oc, void *data) mc->max_cpus = LOONGSON_MAX_VCPUS; mc->default_ram_id = "loongson3.highram"; mc->default_ram_size = 1600 * MiB; - mc->kvm_type = mips_kvm_type; mc->minimum_page_bits = 14; mc->default_nic = "virtio-net-pci"; } diff --git a/target/arm/kvm.c b/target/arm/kvm.c index b4c7654f49..40f577bfd5 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -247,6 +247,11 @@ int kvm_arm_get_max_vm_ipa_size(MachineState *ms, bool *fixed_ipa) return ret > 0 ? ret : 40; } +int kvm_arch_get_default_type(MachineState *ms) +{ + return 0; +} + int kvm_arch_init(MachineState *ms, KVMState *s) { int ret = 0; diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index ebfaf3d24c..b45ce20fd8 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -2556,6 +2556,11 @@ static void register_smram_listener(Notifier *n, void *unused) &smram_address_space, 1, "kvm-smram"); } +int kvm_arch_get_default_type(MachineState *ms) +{ + return 0; +} + int kvm_arch_init(MachineState *ms, KVMState *s) { uint64_t identity_base = 0xfffbc000; diff --git a/target/mips/kvm.c b/target/mips/kvm.c index c14e8f550f..e98aad01bd 100644 --- a/target/mips/kvm.c +++ b/target/mips/kvm.c @@ -1266,7 +1266,7 @@ int kvm_arch_msi_data_to_gsi(uint32_t data) abort(); } -int mips_kvm_type(MachineState *machine, const char *vm_type) +int kvm_arch_get_default_type(MachineState *machine) { #if defined(KVM_CAP_MIPS_VZ) int r; diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index a8a935e267..dc1182cd37 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -108,6 +108,11 @@ static int kvm_ppc_register_host_cpu_type(void); static void kvmppc_get_cpu_characteristics(KVMState *s); static int kvmppc_get_dec_bits(void); +int kvm_arch_get_default_type(MachineState *ms) +{ + return 0; +} + int kvm_arch_init(MachineState *ms, KVMState *s) { cap_interrupt_unset = kvm_check_extension(s, KVM_CAP_PPC_UNSET_IRQ); diff --git a/target/riscv/kvm.c b/target/riscv/kvm.c index 9d8a8982f9..4266dce092 100644 --- a/target/riscv/kvm.c +++ b/target/riscv/kvm.c @@ -907,6 +907,11 @@ int kvm_arch_add_msi_route_post(struct kvm_irq_routing_entry *route, return 0; } +int kvm_arch_get_default_type(MachineState *ms) +{ + return 0; +} + int kvm_arch_init(MachineState *ms, KVMState *s) { return 0; diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c index a9e5880349..9117fab6e8 100644 --- a/target/s390x/kvm/kvm.c +++ b/target/s390x/kvm/kvm.c @@ -340,6 +340,11 @@ static void ccw_machine_class_foreach(ObjectClass *oc, void *opaque) mc->default_cpu_type = S390_CPU_TYPE_NAME("host"); } +int kvm_arch_get_default_type(MachineState *ms) +{ + return 0; +} + int kvm_arch_init(MachineState *ms, KVMState *s) { object_class_foreach(ccw_machine_class_foreach, TYPE_S390_CCW_MACHINE, From patchwork Thu Jul 27 07:31:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13329095 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 297BAC001DC for ; Thu, 27 Jul 2023 07:40:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233068AbjG0HkB (ORCPT ); Thu, 27 Jul 2023 03:40:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232769AbjG0Hjk (ORCPT ); Thu, 27 Jul 2023 03:39:40 -0400 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EEEA9E for ; Thu, 27 Jul 2023 00:31:49 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-686d8c8fc65so518800b3a.0 for ; Thu, 27 Jul 2023 00:31:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1690443109; x=1691047909; 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=aiO61RFWQc576A2x8jBmto7Eq50nA+0j/FFgWXdA55I=; b=VNKaMnEOQNKlZR10dtEZyO1TSdS8k+fSD0DHogH1R6yudKKGkTFXMKAarSnSO2Kzhb xvD1EZKgScgBJoiuS8bn3iq9oS82m2GgS+xDRQL1LO1mZUI0h3QAs51vMSM0GF23EJ36 kplgCIlhxqVOD1kJw6Ndxf2MuGlGp3gf7FYdVXtivp0O9KAty+FICxA19fmvqlbFAaNK VaYy5/5qDpFY1/9OGQo8WReDwdFPntnukR2eDMEbxZ3IC+hZuDnSxabg/c1oO/jw/A5N 2zqYrcpUt7hQTCIvlGGKoh2gtLlNZHxV/k1JPuu0ENiemMNzGr+TMDNr5+hLTalPd13F f+kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690443109; x=1691047909; 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=aiO61RFWQc576A2x8jBmto7Eq50nA+0j/FFgWXdA55I=; b=fZ0jZXeOI5SuwNkh6lsBmrRaHNYC2IXysKfQ2nZswlR9sW+SrEPJZbvXeQ6ZNVJOKJ AGhjMJaLTcxsxHtsIt2RVpX+gFYgPIJeMXTj8CtUx2BMEU9IqadwmhhyD05o2+FClafH BAw5fdjm6UEm44s+nulIwxDB3YOs1KlyWraNmvRLwhVx/6PIuUhgdFld3ZQk1tpuaHQC xhtJaDltizSByhHoDUvA65370CN47uQGrEbMxH2Zisre3AXTkBGaDhMEA73BX1cjyXsW gKmLU169NuPw8TD25+i3OSqoWnDQ0coX7mnLingniUKQkdhZfKmbK6Je1WuyeF1sZNYv WfZQ== X-Gm-Message-State: ABy/qLbxlJo+UA8BoGYeXeSeu42/01u0isRqyChyPZMNPdNyn9qvErGu cc7Tm64325AyVo2M+QVrk9dsFQ== X-Google-Smtp-Source: APBJJlEuLZxP0ZyEIi7VHNrW7mhtveHSO5fc5w71A22qd8/dfAl9uK20/rnFzi8GOuvgoOIN1lD60w== X-Received: by 2002:a05:6a00:2184:b0:65e:ec60:b019 with SMTP id h4-20020a056a00218400b0065eec60b019mr4039381pfi.25.1690443108991; Thu, 27 Jul 2023 00:31:48 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:78d2:b862:10a7:d486]) by smtp.gmail.com with ESMTPSA id d9-20020aa78689000000b0064fa2fdfa9esm802002pfo.81.2023.07.27.00.31.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jul 2023 00:31:48 -0700 (PDT) From: Akihiko Odaki Cc: qemu-devel@nongnu.org, qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , Peter Maydell , Richard Henderson , Akihiko Odaki Subject: [PATCH v5 2/6] accel/kvm: Specify default IPA size for arm64 Date: Thu, 27 Jul 2023 16:31:27 +0900 Message-ID: <20230727073134.134102-3-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230727073134.134102-1-akihiko.odaki@daynix.com> References: <20230727073134.134102-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Before this change, the default KVM type, which is used for non-virt machine models, was 0. The kernel documentation says: > On arm64, the physical address size for a VM (IPA Size limit) is > limited to 40bits by default. The limit can be configured if the host > supports the extension KVM_CAP_ARM_VM_IPA_SIZE. When supported, use > KVM_VM_TYPE_ARM_IPA_SIZE(IPA_Bits) to set the size in the machine type > identifier, where IPA_Bits is the maximum width of any physical > address used by the VM. The IPA_Bits is encoded in bits[7-0] of the > machine type identifier. > > e.g, to configure a guest to use 48bit physical address size:: > > vm_fd = ioctl(dev_fd, KVM_CREATE_VM, KVM_VM_TYPE_ARM_IPA_SIZE(48)); > > The requested size (IPA_Bits) must be: > > == ========================================================= > 0 Implies default size, 40bits (for backward compatibility) > N Implies N bits, where N is a positive integer such that, > 32 <= N <= Host_IPA_Limit > == ========================================================= > Host_IPA_Limit is the maximum possible value for IPA_Bits on the host > and is dependent on the CPU capability and the kernel configuration. > The limit can be retrieved using KVM_CAP_ARM_VM_IPA_SIZE of the > KVM_CHECK_EXTENSION ioctl() at run-time. > > Creation of the VM will fail if the requested IPA size (whether it is > implicit or explicit) is unsupported on the host. https://docs.kernel.org/virt/kvm/api.html#kvm-create-vm So if Host_IPA_Limit < 40, specifying 0 as the type will fail. This actually confused libvirt, which uses "none" machine model to probe the KVM availability, on M2 MacBook Air. Fix this by using Host_IPA_Limit as the default type when KVM_CAP_ARM_VM_IPA_SIZE is available. Signed-off-by: Akihiko Odaki Reviewed-by: Peter Maydell --- target/arm/kvm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 40f577bfd5..23aeb09949 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -249,7 +249,9 @@ int kvm_arm_get_max_vm_ipa_size(MachineState *ms, bool *fixed_ipa) int kvm_arch_get_default_type(MachineState *ms) { - return 0; + bool fixed_ipa; + int size = kvm_arm_get_max_vm_ipa_size(ms, &fixed_ipa); + return fixed_ipa ? 0 : size; } int kvm_arch_init(MachineState *ms, KVMState *s) From patchwork Thu Jul 27 07:31:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13329094 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31E01C001E0 for ; Thu, 27 Jul 2023 07:40:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231460AbjG0Hj7 (ORCPT ); Thu, 27 Jul 2023 03:39:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232716AbjG0Hjk (ORCPT ); Thu, 27 Jul 2023 03:39:40 -0400 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 880A5F5 for ; Thu, 27 Jul 2023 00:31:51 -0700 (PDT) Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-686b879f605so447454b3a.1 for ; Thu, 27 Jul 2023 00:31:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1690443111; x=1691047911; 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=26LP4jR8UCRhJyh1M0qdx1yDCFp8JOR+j4jZMhaZd5Y=; b=FMXUAO4Yoxbd/c3ZDAJO2Eft2gOvbLIXf4hOBH5Dj9DW3gt3d58iYHeQbhg3l1Hpmg I19AscWEwJNXso/G1WZ6tivdoRArUDtLLbJ6rH6XmR1/n+H4xd7fhr11URWhGi2HuOoM YRIhUGNyDTY6U/j1ShMhaPgpHYqhrjN5joKZ+zuJf4vgAeLVFubAD1fgso1+zLlpEBIl aQP0NIhtn5cgY5kVQCeKUcrAVL5klU7kvwre68iLoq9uUIhKDR+roXkSeTWsG2Nj05w3 m2v2Gg9ffatEkLhmzvEW8yEulbHU6UGF2Novf97q8cExbXPUMqDh0NstuyISfzWG1n6w OJdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690443111; x=1691047911; 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=26LP4jR8UCRhJyh1M0qdx1yDCFp8JOR+j4jZMhaZd5Y=; b=Bc/N2wiUW2glADLdfoX67hIqoX2Isf1tuNiifVvCXcvuA8kkbbA8/wVd/el4w5sxew XURrR12mqU7WnQxKeNf+sbdLubKiVtI1MHLBFiLVf01ZDt5y9ygw+31R60MqyhlJGnBo ndyOi2eSd/0tb0HYKzIZt4H4aWDN3obDaS3J1G/Ake1zXpO6kzK1MiJsJyYRKy01Ejkc +kFN2bqpv/2YA5BxwCtcJWELGkJV2STPxYwVX39bBj4tLU58CUBRBNYogA5AR1kNTSKe W1vidJ+boJFC9v/ezQtPHtrxP5Ykqfb6eOZymzG8BdmGpgmlhReDu6DsVVtkKf6/N35J hZSw== X-Gm-Message-State: ABy/qLYhXBEsvtIjuB8YA09qlpraHmt3bDV3ckfNLpLOvoBa06IkzHZJ hQxoKqxr3fKlvPhQnjudoDMY5g== X-Google-Smtp-Source: APBJJlF9vyB/rMKDG8kcKzWzhp8EQUmef9v7mW4IywNdEUOM/7FJYAMVAQcRxxvO32/savSwOQjPaA== X-Received: by 2002:a05:6a20:1610:b0:137:53d1:3e2 with SMTP id l16-20020a056a20161000b0013753d103e2mr4116444pzj.41.1690443111088; Thu, 27 Jul 2023 00:31:51 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:78d2:b862:10a7:d486]) by smtp.gmail.com with ESMTPSA id d9-20020aa78689000000b0064fa2fdfa9esm802002pfo.81.2023.07.27.00.31.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jul 2023 00:31:50 -0700 (PDT) From: Akihiko Odaki Cc: qemu-devel@nongnu.org, qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , Peter Maydell , Richard Henderson , Akihiko Odaki Subject: [PATCH v5 3/6] mips: Report an error when KVM_VM_MIPS_VZ is unavailable Date: Thu, 27 Jul 2023 16:31:28 +0900 Message-ID: <20230727073134.134102-4-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230727073134.134102-1-akihiko.odaki@daynix.com> References: <20230727073134.134102-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On MIPS, QEMU requires KVM_VM_MIPS_VZ type for KVM. Report an error in such a case as other architectures do when an error occurred during KVM type decision. Signed-off-by: Akihiko Odaki Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- target/mips/kvm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/mips/kvm.c b/target/mips/kvm.c index e98aad01bd..e22e24ed97 100644 --- a/target/mips/kvm.c +++ b/target/mips/kvm.c @@ -1278,6 +1278,7 @@ int kvm_arch_get_default_type(MachineState *machine) } #endif + error_report("KVM_VM_MIPS_VZ type is not available"); return -1; } From patchwork Thu Jul 27 07:31:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13329096 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01F3FC001DC for ; Thu, 27 Jul 2023 07:40:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231215AbjG0HkE (ORCPT ); Thu, 27 Jul 2023 03:40:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232816AbjG0Hjm (ORCPT ); Thu, 27 Jul 2023 03:39:42 -0400 Received: from mail-oo1-xc34.google.com (mail-oo1-xc34.google.com [IPv6:2607:f8b0:4864:20::c34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0567D3C21 for ; Thu, 27 Jul 2023 00:31:55 -0700 (PDT) Received: by mail-oo1-xc34.google.com with SMTP id 006d021491bc7-56584266c41so505797eaf.2 for ; Thu, 27 Jul 2023 00:31:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1690443113; x=1691047913; 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=WUXy3jNQsy5PFGPCh7DZInihQgiJWpSfcmP70S5aNLc=; b=ErRkuXIDzI8EHN9RJalhLqdArv/g31OAVXPGZTxhgwm4bIExhwd4UPvDSRIJztk0ij 8dWy86F8eEhs10cJ1ENhkeakq42mIoofDOZdQOKp1dEds0/JRCqiJ6HhOsJMRH/UQnvu XZ3bA41tzhxdLnEh+dDQKRh2JsZUz6k7Ciz62r5xlvsrQU86dTcuykBVsw2e58Qcwso8 oeC7DWP3Eel+hhwJofaR9D77yQAaLpOYeISbfXP02vDpcNchsJN0ZtkS9B/TzAEhitnB vv0Vtdgo+pg0o+ZyyM+7Ds0RSgM1M0+ZdxfW0PJGJ0PUhPfSAH1XNeC+9zU3Pp0HHl/8 hjXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690443113; x=1691047913; 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=WUXy3jNQsy5PFGPCh7DZInihQgiJWpSfcmP70S5aNLc=; b=lVPdrmr7+KxOVbs9cmGPbov09roP9fdL4s60nShCfv63jcOv15Lfov6u4qU7bNdmOW 7R2tTZWLKE1x7suhCmTfjtTmFsc/QvevpedJmb3yek3o/s2ZrckxaZDpZMnV3jLeqU1z Xk5dkGQRrlkdL7ohYwDwjfWmKynMfjyj0egjEjv+vOP9mtl0ePA/ONg5AOJGIMmSdXov PTJZk8dgzVFJhp36psBApAjxiEbap4U0gxrXL+2Yh4Q+eJmjVwkSws1GzcbT45UPTjo+ Gz38tTiHLNsjBTTwT9tzb/Gw9QgOjN9kIC6urqr8is2UAzWStBWncDV7wwWHCBYDOVdF kCuw== X-Gm-Message-State: ABy/qLZYXkN6MGnKdCnBP95CnCJEf1eZtTg8dRtu8EVI27Krp+p/+gfa 2yKfd1Z3w5ZsGZpGlqd50E8GMA== X-Google-Smtp-Source: APBJJlFEta7887wC+EH2MCZzxvk/JmjxY935l/UatI0IUcVcQUEaVDafFfiot8/j0cB4J/3Md+iDSQ== X-Received: by 2002:a05:6358:e4a7:b0:135:a52c:1d93 with SMTP id by39-20020a056358e4a700b00135a52c1d93mr1995699rwb.28.1690443113170; Thu, 27 Jul 2023 00:31:53 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:78d2:b862:10a7:d486]) by smtp.gmail.com with ESMTPSA id d9-20020aa78689000000b0064fa2fdfa9esm802002pfo.81.2023.07.27.00.31.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jul 2023 00:31:52 -0700 (PDT) From: Akihiko Odaki Cc: qemu-devel@nongnu.org, qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , Peter Maydell , Richard Henderson , Akihiko Odaki Subject: [PATCH v5 4/6] accel/kvm: Use negative KVM type for error propagation Date: Thu, 27 Jul 2023 16:31:29 +0900 Message-ID: <20230727073134.134102-5-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230727073134.134102-1-akihiko.odaki@daynix.com> References: <20230727073134.134102-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On MIPS, kvm_arch_get_default_type() returns a negative value when an error occurred so handle the case. Also, let other machines return negative values when errors occur and declare returning a negative value as the correct way to propagate an error that happened when determining KVM type. Signed-off-by: Akihiko Odaki Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- accel/kvm/kvm-all.c | 5 +++++ hw/arm/virt.c | 2 +- hw/ppc/spapr.c | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index d591b5079c..94a62efa3c 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -2527,6 +2527,11 @@ static int kvm_init(MachineState *ms) type = kvm_arch_get_default_type(ms); } + if (type < 0) { + ret = -EINVAL; + goto err; + } + do { ret = kvm_ioctl(s, KVM_CREATE_VM, type); } while (ret == -EINTR); diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 8a4c663735..161f3ffbf7 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2977,7 +2977,7 @@ static int virt_kvm_type(MachineState *ms, const char *type_str) "require an IPA range (%d bits) larger than " "the one supported by the host (%d bits)", requested_pa_size, max_vm_pa_size); - exit(1); + return -1; } /* * We return the requested PA log size, unless KVM only supports diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 54dbfd7fe9..1b522e8e40 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3104,7 +3104,7 @@ static int spapr_kvm_type(MachineState *machine, const char *vm_type) } error_report("Unknown kvm-type specified '%s'", vm_type); - exit(1); + return -1; } /* From patchwork Thu Jul 27 07:31:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13329098 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3CBFC001DC for ; Thu, 27 Jul 2023 07:40:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232375AbjG0HkK (ORCPT ); Thu, 27 Jul 2023 03:40:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231429AbjG0Hjm (ORCPT ); Thu, 27 Jul 2023 03:39:42 -0400 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7DF413D for ; Thu, 27 Jul 2023 00:31:55 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-686b91c2744so526991b3a.0 for ; Thu, 27 Jul 2023 00:31:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1690443115; x=1691047915; 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=8W/2glyFNghlOR8aLoJh4rtbBTz1uiLofQu+GK6+ib0=; b=TwyLkq7VkQVku7UEGEJGvOxpiLGKqGNn2Z8k57YpSS6ZkWHfSRznN+VshcyamJEJqB zMw97jUDWAXtbrKFdxDdZwZlTw6jMTuKDc69kpYGQ0SwXjls2dSoY2OhR7sH8bIrD4ut G0xxv4KpICYR9eGhbLk7VBV+IuNi87eZcDIuQc2fsSeQHyMLWy9i4ZRqjfD2vLbCVkaS gH2rgu9ptJReOtFpj98D23kSv1ELspNKBm2SZkYIDSxsUsfqx7DVi5tLI2e5vuNCLyJ3 6YmLAZvRauKh3Zadas84zdgYM3WKD/wsk1snqp9KY3I0KaeJVZx2HrbjHlfEjSasJF89 9OSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690443115; x=1691047915; 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=8W/2glyFNghlOR8aLoJh4rtbBTz1uiLofQu+GK6+ib0=; b=hxE7bCbCkPG4U0M4eFnYf+vuRSZJc4bLGPbfbDk3sgDt6kJcRHoM0KILDNsyWBX39Z +BhQ7mxdpWjlogFe7u+SW4HIVlkQ+nKmrjjkzJKm0tpnwW3UgRHxGK6r23pdw3SPwfkL 8OQajjO2h1htnBM34RD4kfzT0VbGn4G8KVsblfmEZApt/jgfmRFz2lUWWPpyqzniU4a6 cOjj+sdHY8BLHmHS7x6Uykw3Zsx096VBfn71DEvX90ydjWZG0OoVbnmcQser9JyLoWtr IhUesigg4ZONL9IeCJ1sR09WWN2cPVHpkXepc/rRfiDd7hydIT2ryKuqWosdV1d9vuYV /MfQ== X-Gm-Message-State: ABy/qLb+hM5/gYS2tDtC75TIPwTpW7C39ZqzAbFtUtAZp5IZ6esdek3/ gLRyOvODGbScPAAEC9Y4a5/xyRtdsRy8XGpY/fg= X-Google-Smtp-Source: APBJJlGH5IK6xCXrgs0jr2kjrwPluYHvsn81u11F09P420p9JlfCazkD9jzO2BEnsFqFVedHPLVqnQ== X-Received: by 2002:a05:6a00:1515:b0:668:74e9:8eea with SMTP id q21-20020a056a00151500b0066874e98eeamr5088101pfu.33.1690443115301; Thu, 27 Jul 2023 00:31:55 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:78d2:b862:10a7:d486]) by smtp.gmail.com with ESMTPSA id d9-20020aa78689000000b0064fa2fdfa9esm802002pfo.81.2023.07.27.00.31.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jul 2023 00:31:55 -0700 (PDT) From: Akihiko Odaki Cc: qemu-devel@nongnu.org, qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , Peter Maydell , Richard Henderson , Akihiko Odaki Subject: [PATCH v5 5/6] accel/kvm: Free as when an error occurred Date: Thu, 27 Jul 2023 16:31:30 +0900 Message-ID: <20230727073134.134102-6-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230727073134.134102-1-akihiko.odaki@daynix.com> References: <20230727073134.134102-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org An error may occur after s->as is allocated, for example while determining KVM type. Signed-off-by: Akihiko Odaki Reviewed-by: Peter Maydell --- accel/kvm/kvm-all.c | 1 + 1 file changed, 1 insertion(+) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 94a62efa3c..4591669d78 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -2765,6 +2765,7 @@ err: if (s->fd != -1) { close(s->fd); } + g_free(s->as); g_free(s->memory_listener.slots); return ret; From patchwork Thu Jul 27 07:31:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13329097 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79107C001DC for ; Thu, 27 Jul 2023 07:40:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233168AbjG0HkH (ORCPT ); Thu, 27 Jul 2023 03:40:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231614AbjG0Hjm (ORCPT ); Thu, 27 Jul 2023 03:39:42 -0400 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D376B116 for ; Thu, 27 Jul 2023 00:31:57 -0700 (PDT) Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-686b91c2744so527009b3a.0 for ; Thu, 27 Jul 2023 00:31:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1690443117; x=1691047917; 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=KryCFoTvBP3nIdEsg77nTIkWzqmuMWTWodPXHjNoS7w=; b=sT7eY9uWJvO3BMx6lFVxseP9F1PeovS6Qw2urWg1NPKLVRcu28M/oqgLlLGgrpFyTY 1vwQMtWatcerVjfj2BlQVAOCUoNwR3trS/c72W+2MlMSsV0b1SRJ/hNchg3RtkC4MjBI LhHpdeolCx+g0bz21dokX19IdvNXpMNexhbpVAzG9xhFpD/dnUGuRD6/BBwVxZmgLBu3 ftOlzh/5Z0t49+mijXRwEpCB0a4JJkbr+fFG4Q0KsX3EzJG6cdbx4bnfnnj1IcT6kVjr g3anDuem2i5j0Wxo1P875QPwoecKOhkEmjx85WmYodu52vj5jhygb3Hp0UzHRHwyaCzs /ZFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690443117; x=1691047917; 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=KryCFoTvBP3nIdEsg77nTIkWzqmuMWTWodPXHjNoS7w=; b=DuiQnAjEpGOlh17cEH272EiZEy5p6waLu1/3lfxlBqQgKKuseBxts8N6sPLqS8sfUy +MTynYIRHmm+pwPbqAOY6foCgvwtoVidTGGHwUs+LRDc4l8C3om7n01KiA0TUkrmakDQ txqohTlqlff5c8LWTBIi7ry/3qpWead1H0AmUuKxcS9o+GiEbVw+CxZwLlTG1Deww4V4 K8ZUL1bPTy1wGO/+aCo1XHfljoVVyHakE9pZ9T9UmgmqS/r8aBsL81QmVv/LwFrcrHHB lLqPQW94PJhCGVj82pMhyDgklVKdIvGbFrChkFwODREX+5O47gbS0mGsLi09HAW2Oyru FXNA== X-Gm-Message-State: ABy/qLa/t4Gscq9GKwwkJifSYZbNlk5FBZlKmiCst9R6ZOyURFjr+KOC JwYaudTEV2dcwAWRRR6ZsVmT5w== X-Google-Smtp-Source: APBJJlGoR80KicuYnq4Q3XY7GzEAoTXmN+bZbfxdkyHGuoNwvVoBjOiW9+g73QffU6YklFvoelFu/A== X-Received: by 2002:a05:6a00:139c:b0:66b:8d48:8e64 with SMTP id t28-20020a056a00139c00b0066b8d488e64mr4516779pfg.12.1690443117393; Thu, 27 Jul 2023 00:31:57 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:78d2:b862:10a7:d486]) by smtp.gmail.com with ESMTPSA id d9-20020aa78689000000b0064fa2fdfa9esm802002pfo.81.2023.07.27.00.31.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jul 2023 00:31:57 -0700 (PDT) From: Akihiko Odaki Cc: qemu-devel@nongnu.org, qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , Peter Maydell , Richard Henderson , Akihiko Odaki Subject: [PATCH v5 6/6] accel/kvm: Make kvm_dirty_ring_reaper_init() void Date: Thu, 27 Jul 2023 16:31:31 +0900 Message-ID: <20230727073134.134102-7-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230727073134.134102-1-akihiko.odaki@daynix.com> References: <20230727073134.134102-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org The returned value was always zero and had no meaning. Signed-off-by: Akihiko Odaki Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- accel/kvm/kvm-all.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 4591669d78..a4a1b4e05d 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -1454,15 +1454,13 @@ static void *kvm_dirty_ring_reaper_thread(void *data) return NULL; } -static int kvm_dirty_ring_reaper_init(KVMState *s) +static void kvm_dirty_ring_reaper_init(KVMState *s) { struct KVMDirtyRingReaper *r = &s->reaper; qemu_thread_create(&r->reaper_thr, "kvm-reaper", kvm_dirty_ring_reaper_thread, s, QEMU_THREAD_JOINABLE); - - return 0; } static int kvm_dirty_ring_init(KVMState *s) @@ -2744,10 +2742,7 @@ static int kvm_init(MachineState *ms) } if (s->kvm_dirty_ring_size) { - ret = kvm_dirty_ring_reaper_init(s); - if (ret) { - goto err; - } + kvm_dirty_ring_reaper_init(s); } if (kvm_check_extension(kvm_state, KVM_CAP_BINARY_STATS_FD)) {