From patchwork Fri Feb 19 11:44:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12095123 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B175BC433DB for ; Fri, 19 Feb 2021 11:46:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 69CF364EC0 for ; Fri, 19 Feb 2021 11:46:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230378AbhBSLqJ (ORCPT ); Fri, 19 Feb 2021 06:46:09 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:59273 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230308AbhBSLqH (ORCPT ); Fri, 19 Feb 2021 06:46:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613735080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=98X4DsBNdk1BN09KWcHx0mE3/gzzTZdKxOLSGajyIeI=; b=NtMesX1+Zeqvpm9/jZNRgi1h4EN5bIYdcec9PvD9MpsI067OC7+Ra5jscK2053LG5ADn02 ekJcpy94Oj5PTsbjMqUN8nO2Z96s9GddyUWYUK98lpmDGPq69H171LQ6jT+YtPC1Z8K52z 4GSvGFKhHf+SvH375bFUqbRhSelBBow= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-508-RpR5mxJUPa-9twbBIAnbmQ-1; Fri, 19 Feb 2021 06:44:38 -0500 X-MC-Unique: RpR5mxJUPa-9twbBIAnbmQ-1 Received: by mail-wm1-f71.google.com with SMTP id b201so2353510wmb.9 for ; Fri, 19 Feb 2021 03:44:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=98X4DsBNdk1BN09KWcHx0mE3/gzzTZdKxOLSGajyIeI=; b=bo8O9xJsG0C37oRFi51piBi3j4+HUu8p182tmWi1O/23aL7GnO77GX9tIkFNRqkuEn X2ICIroGFP3Ms9Dna5/bppa0oNLn3K2pNWUAQoSwN/4yMif/54yzPpuIxsrgsQX/RIAI RnTaNR7FEBsVQyiTMJFBb3KbSNgSbCzjEKKqhYkD5NP19k+j2mTZkOZWawEHhoKmpcmB UZTkLYS/RFLbPpw53tWkPXT8sVR4nZ2OpSWuCaiWM9Gzjvx1gYH9y5My8flQ1UsgKPwM FfneMsAfhRqwMJagpDccHFZpn4QkiTd7KFhxE1NzYTTme0hU4BCd87oAaZLyGBlgDVjE cI+A== X-Gm-Message-State: AOAM530yX+t3SPgdKOFH8iDrzmxYi7Mpqilg8USD28TZuIta7MzuN8cQ XhjWGYA9tly5+TdpBo7/zMMx6ayrWSZeRYG30OaV6r0hTEurR9dTs4Va3u+1dNJH94OXAf9qn3B KLOujmeqS3Maa X-Received: by 2002:adf:b357:: with SMTP id k23mr8694387wrd.354.1613735077426; Fri, 19 Feb 2021 03:44:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJy8BoyDIy3MZrDx4a9/uBNg8Gu4uQrRfjBpdhkb1HenxWvZ3lMMW1roaXGxl/Jsmb64BZpXBA== X-Received: by 2002:adf:b357:: with SMTP id k23mr8694350wrd.354.1613735077292; Fri, 19 Feb 2021 03:44:37 -0800 (PST) Received: from localhost.localdomain (68.red-83-57-175.dynamicip.rima-tde.net. [83.57.175.68]) by smtp.gmail.com with ESMTPSA id w81sm11424135wmb.3.2021.02.19.03.44.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Feb 2021 03:44:36 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Radoslaw Biernacki , Paolo Bonzini , qemu-s390x@nongnu.org, Greg Kurz , Marcel Apfelbaum , qemu-arm@nongnu.org, Cornelia Huck , Aleksandar Rikalo , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , BALATON Zoltan , Huacai Chen , Aurelien Jarno , Richard Henderson , "Edgar E. Iglesias" , Christian Borntraeger , Leif Lindholm , Alistair Francis , Thomas Huth , Peter Maydell , Eduardo Habkost , Jiaxun Yang , Halil Pasic , David Hildenbrand , qemu-ppc@nongnu.org, =?utf-8?q?Herv=C3=A9_Poussineau?= , David Gibson , Mark Cave-Ayland , kvm@vger.kernel.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 1/7] accel/kvm: Check MachineClass kvm_type() return value Date: Fri, 19 Feb 2021 12:44:22 +0100 Message-Id: <20210219114428.1936109-2-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210219114428.1936109-1-philmd@redhat.com> References: <20210219114428.1936109-1-philmd@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org MachineClass::kvm_type() can return -1 on failure. Document it, and add a check in kvm_init(). Signed-off-by: Philippe Mathieu-Daudé --- include/hw/boards.h | 3 ++- accel/kvm/kvm-all.c | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/hw/boards.h b/include/hw/boards.h index a46dfe5d1a6..68d3d10f6b0 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -127,7 +127,8 @@ typedef struct { * implement and a stub device is required. * @kvm_type: * Return the type of KVM corresponding to the kvm-type string option or - * computed based on other criteria such as the host kernel capabilities. + * computed based on other criteria such as the host kernel capabilities + * (which can't be negative), or -1 on error. * @numa_mem_supported: * true if '--numa node.mem' option is supported and false otherwise * @smp_parse: diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 84c943fcdb2..b069938d881 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -2057,6 +2057,12 @@ static int kvm_init(MachineState *ms) "kvm-type", &error_abort); type = mc->kvm_type(ms, kvm_type); + if (type < 0) { + ret = -EINVAL; + fprintf(stderr, "Failed to detect kvm-type for machine '%s'\n", + mc->name); + goto err; + } } do { From patchwork Fri Feb 19 11:44:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12095129 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0175C433E6 for ; Fri, 19 Feb 2021 11:46:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8C91464ED6 for ; Fri, 19 Feb 2021 11:46:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230401AbhBSLqQ (ORCPT ); Fri, 19 Feb 2021 06:46:16 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:43934 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230308AbhBSLqN (ORCPT ); Fri, 19 Feb 2021 06:46:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613735087; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KroGD2ykh3pOVhGFDhJBF9D2GPtRIz+7OKOBV/uF+8M=; b=GJLQTgmi/JFLQPK/vALSqIn5FC6CL/YpjZ722xUmxF2VWzdyP6XITFq8pObi8L8xiSNawI gM/i4DdTHnax/bOdIbFkOR9H5HYGzBICc3mB30AE/sMw8/o5NImzHRvJkhn2W6tE1ujNSN NDW2GWEmqnpB86CFsFZtp9nzFFcfUZo= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-525-sZr34-H9NKOeEzjLkYRw3w-1; Fri, 19 Feb 2021 06:44:44 -0500 X-MC-Unique: sZr34-H9NKOeEzjLkYRw3w-1 Received: by mail-wm1-f69.google.com with SMTP id i5so366422wmq.0 for ; Fri, 19 Feb 2021 03:44:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KroGD2ykh3pOVhGFDhJBF9D2GPtRIz+7OKOBV/uF+8M=; b=oOHUUsFCuoL0ubNm2SB3t4Y8CFh8FV6APhdbXT0CoLFg7ysFN2mDeDDUnACTstP6ZG 1BbfZ9U1/K2NjglXE8MO9pElEB8snpoErSuTUwOSWLtb0iE6Av2HvOjv9PdJs1jsvMp8 st1RIbgQ07+I8VNy0J646IyrNoVbvJODXC6MxPGke5ED6ET0LfXucBhQNuSK73wNJOc9 lcynp10L1G7S9PE67mi9HRM1gA/Kg5rXHLbf9wVDwScAMklWDKgNCARWffF4hInpoC/T uoM66pSgQX7aSZMeuQ002Ww7/Gy2LzfLgcRkOeR4pMwd6Ols/Sux84/oQgNy6U96kQeV jusg== X-Gm-Message-State: AOAM533J6jfYr2440qVgM/u1+wgCGVyluu47BWfAiy/FINFKXGnF5Vul Gb8XvCnOMESJ7bjlDIf94aYG0sCS58RBD5VCxLK1Tpv36vnKaeDY8hbX7o3GkHrlw8fCMp7YuvG 08Rpwxn6xAE3y X-Received: by 2002:adf:b342:: with SMTP id k2mr8775456wrd.264.1613735083595; Fri, 19 Feb 2021 03:44:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJzTU+1RNp+4PgoRKirdLYmchYJdEj6kCfrIRKlfJu5y+NrUB3ZU6NxI5lqZZ59zN2qat0RgFg== X-Received: by 2002:adf:b342:: with SMTP id k2mr8775447wrd.264.1613735083454; Fri, 19 Feb 2021 03:44:43 -0800 (PST) Received: from localhost.localdomain (68.red-83-57-175.dynamicip.rima-tde.net. [83.57.175.68]) by smtp.gmail.com with ESMTPSA id k15sm11528304wmj.6.2021.02.19.03.44.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Feb 2021 03:44:43 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Radoslaw Biernacki , Paolo Bonzini , qemu-s390x@nongnu.org, Greg Kurz , Marcel Apfelbaum , qemu-arm@nongnu.org, Cornelia Huck , Aleksandar Rikalo , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , BALATON Zoltan , Huacai Chen , Aurelien Jarno , Richard Henderson , "Edgar E. Iglesias" , Christian Borntraeger , Leif Lindholm , Alistair Francis , Thomas Huth , Peter Maydell , Eduardo Habkost , Jiaxun Yang , Halil Pasic , David Hildenbrand , qemu-ppc@nongnu.org, =?utf-8?q?Herv=C3=A9_Poussineau?= , David Gibson , Mark Cave-Ayland , kvm@vger.kernel.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 2/7] hw/boards: Introduce 'kvm_supported' field to MachineClass Date: Fri, 19 Feb 2021 12:44:23 +0100 Message-Id: <20210219114428.1936109-3-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210219114428.1936109-1-philmd@redhat.com> References: <20210219114428.1936109-1-philmd@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Introduce the 'kvm_supported' field to express whether a machine supports KVM acceleration or not. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/boards.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/hw/boards.h b/include/hw/boards.h index 68d3d10f6b0..0959aa743ee 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -129,6 +129,8 @@ typedef struct { * Return the type of KVM corresponding to the kvm-type string option or * computed based on other criteria such as the host kernel capabilities * (which can't be negative), or -1 on error. + * @kvm_supported: + * true if '-enable-kvm' option is supported and false otherwise. * @numa_mem_supported: * true if '--numa node.mem' option is supported and false otherwise * @smp_parse: @@ -209,6 +211,7 @@ struct MachineClass { bool nvdimm_supported; bool numa_mem_supported; bool auto_enable_numa; + bool kvm_supported; const char *default_ram_id; HotplugHandler *(*get_hotplug_handler)(MachineState *machine, From patchwork Fri Feb 19 11:44:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12095127 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0AED2C43381 for ; Fri, 19 Feb 2021 11:46:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B2FD564E92 for ; Fri, 19 Feb 2021 11:46:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230408AbhBSLqU (ORCPT ); Fri, 19 Feb 2021 06:46:20 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:42128 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230308AbhBSLqS (ORCPT ); Fri, 19 Feb 2021 06:46:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613735092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H2sRdB0zIoimpAVT57VzO2FhLqlcfJwpEUsEldtsV6E=; b=IVI8idI2fOPiXQUalz6tx4ri9bh3BpVsrs5TkY5kOtoJsVlGKpdUXTt9vp5DXYuKB2jNTm GUXCw798T8kPYurSAh9ONiwDts6M6wsIReYmnq2AOz6z9AboKrwe0ThDzQ4BLlcsvXopGp JsPTQYEXLV0S4lHoVXy0cPkp2h26BH8= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-134-CW7A2RPpO5OXEHJLtsDUBg-1; Fri, 19 Feb 2021 06:44:50 -0500 X-MC-Unique: CW7A2RPpO5OXEHJLtsDUBg-1 Received: by mail-wr1-f71.google.com with SMTP id e12so2321142wrw.14 for ; Fri, 19 Feb 2021 03:44:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=H2sRdB0zIoimpAVT57VzO2FhLqlcfJwpEUsEldtsV6E=; b=e1OpBO21FaqsRTHJlqGYXWHwXXEP5kgxFgC/3kdcH9Vn3UkmBL0a1gPYSPtKSLtWXw I5anIX13P/qQVU3MBUEw2AIu4KDKGpzbeKiUEOYWYoNBbW8NQuhodduCaZPBxU54b7QH QdaJd8A0PTPFMSED4KJatVy1xbCXQYJ6GCFJjjMltZEBcm3otlpOtiskRf/Q65ysXxE0 v8SIIAIC/lSIHvIWSXhk5eB2eKsBwEm6WKEtY+OW9dcVm0zUkAKdSnyrc/EdxJjYLeYF QvqKBgvATANyELprH20PiSNsoCBge11KfuKMJUx89xh133sv9I6hKgeeUmVIW3qwHBBO 2weA== X-Gm-Message-State: AOAM530v1MV3ET7y3BYra/sRigWXpPVd/MoWTcf8TfKMzgA6z4laqnkO 3yS4DbPilAQxPVBWo7PAcl68g+kkgUuEWRm1BUFFbDg+KEoUCY3O80zSaC7jLlaFMduSmmeK7dE +5NhB4QYp8yjZ X-Received: by 2002:a1c:23c2:: with SMTP id j185mr7787108wmj.96.1613735089336; Fri, 19 Feb 2021 03:44:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJzgm4hoiLeIRkPi+gaIG0uc4d/99GH2Q3rzeROPR607tJ3j/N9Qtv1NMuMxJComOxflJzzI2w== X-Received: by 2002:a1c:23c2:: with SMTP id j185mr7787095wmj.96.1613735089135; Fri, 19 Feb 2021 03:44:49 -0800 (PST) Received: from localhost.localdomain (68.red-83-57-175.dynamicip.rima-tde.net. [83.57.175.68]) by smtp.gmail.com with ESMTPSA id z63sm11490157wme.8.2021.02.19.03.44.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Feb 2021 03:44:48 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Radoslaw Biernacki , Paolo Bonzini , qemu-s390x@nongnu.org, Greg Kurz , Marcel Apfelbaum , qemu-arm@nongnu.org, Cornelia Huck , Aleksandar Rikalo , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , BALATON Zoltan , Huacai Chen , Aurelien Jarno , Richard Henderson , "Edgar E. Iglesias" , Christian Borntraeger , Leif Lindholm , Alistair Francis , Thomas Huth , Peter Maydell , Eduardo Habkost , Jiaxun Yang , Halil Pasic , David Hildenbrand , qemu-ppc@nongnu.org, =?utf-8?q?Herv=C3=A9_Poussineau?= , David Gibson , Mark Cave-Ayland , kvm@vger.kernel.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 3/7] hw/arm: Set kvm_supported for KVM-compatible machines Date: Fri, 19 Feb 2021 12:44:24 +0100 Message-Id: <20210219114428.1936109-4-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210219114428.1936109-1-philmd@redhat.com> References: <20210219114428.1936109-1-philmd@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org The following ARM machines support KVM: - virt - sbsa-ref - xlnx-versal-virt Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/sbsa-ref.c | 1 + hw/arm/virt.c | 1 + hw/arm/xlnx-versal-virt.c | 1 + 3 files changed, 3 insertions(+) diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c index 9f707351531..6923b6e77ff 100644 --- a/hw/arm/sbsa-ref.c +++ b/hw/arm/sbsa-ref.c @@ -858,6 +858,7 @@ static void sbsa_ref_class_init(ObjectClass *oc, void *data) mc->possible_cpu_arch_ids = sbsa_ref_possible_cpu_arch_ids; mc->cpu_index_to_instance_props = sbsa_ref_cpu_index_to_props; mc->get_default_cpu_node_id = sbsa_ref_get_default_cpu_node_id; + mc->kvm_supported = true; } static const TypeInfo sbsa_ref_info = { diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 371147f3ae9..7e3748b6cd6 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2582,6 +2582,7 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) mc->cpu_index_to_instance_props = virt_cpu_index_to_props; mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a15"); mc->get_default_cpu_node_id = virt_get_default_cpu_node_id; + mc->kvm_supported = true; mc->kvm_type = virt_kvm_type; assert(!mc->get_hotplug_handler); mc->get_hotplug_handler = virt_machine_get_hotplug_handler; diff --git a/hw/arm/xlnx-versal-virt.c b/hw/arm/xlnx-versal-virt.c index 8482cd61960..fb623c0cd54 100644 --- a/hw/arm/xlnx-versal-virt.c +++ b/hw/arm/xlnx-versal-virt.c @@ -621,6 +621,7 @@ static void versal_virt_machine_class_init(ObjectClass *oc, void *data) mc->default_cpus = XLNX_VERSAL_NR_ACPUS; mc->no_cdrom = true; mc->default_ram_id = "ddr"; + mc->kvm_supported = true; } static const TypeInfo versal_virt_machine_init_typeinfo = { From patchwork Fri Feb 19 11:44:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12095125 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19892C433E9 for ; Fri, 19 Feb 2021 11:46:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DB08E64EC7 for ; Fri, 19 Feb 2021 11:46:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230428AbhBSLqZ (ORCPT ); Fri, 19 Feb 2021 06:46:25 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:26238 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230308AbhBSLqY (ORCPT ); Fri, 19 Feb 2021 06:46:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613735098; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0vt/SIQERosIkjtlGwMC0PxcViyxR2oXSsZjlPDjv1Q=; b=GGDmoaS9jdLKVppjy3ZKiJqKVoTGa3BMQYPgvR4WUxgT0zhp/2bjwOPmyIdkVComj0cWYk Ew05+C0ezgQwifztGT6ImAVeGF6xP2DO3FXu4xLC4XPQ+prY1JA9SLqmDTTwxlM+UdWi2E 5UBkk2GzfXL5QRFuIhg77S6dTklFZy8= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-219-xvpwuQMZPOWuKu5-X_DqXA-1; Fri, 19 Feb 2021 06:44:56 -0500 X-MC-Unique: xvpwuQMZPOWuKu5-X_DqXA-1 Received: by mail-wr1-f70.google.com with SMTP id y6so2316834wrl.9 for ; Fri, 19 Feb 2021 03:44:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0vt/SIQERosIkjtlGwMC0PxcViyxR2oXSsZjlPDjv1Q=; b=iz3KSUoYXQyFPtnvAd+kGTaCiBR8qMvC7V07i5H7vcs40vdrtT/n86960rnAGnvKgo uSldB5bJ+JEmz2IggCqFDTZ7Y/bPu/epSNJ31n7ivyyJ59W/k65EWVOeC4twxk9Gvux6 YSzEo4anjNoY3Uqd0vXk2w0cAysIdLlHv8gsN5N+wWOkcY9gc/6oHSx1Fb0SI9aLcYQd sY74y+bslcwDyUM4yMmEbCt188X1Yayh6MhhATk74e3/M75BT9Sk+/9oE7r5vueUrdhn 9A2C9Wucd931AwokaPXfGctZqrdVEy8yQREPUr+bvwlP+nGZ6JSAEhOGGcuqQl7/ysNM k04A== X-Gm-Message-State: AOAM533+ah86hIhf+fyOyTFy4JKwq7m/181S8LiYKvVzrTjDtrOMm8t5 VTt2cNrhDhHqKdDyjHAY1MHW6bjka+vf3rqwUV3pb8FJMoTgMEPIhRuSFU+akbVsclJRa/+kxS4 0SBTk3TzlkBTe X-Received: by 2002:a1c:28c1:: with SMTP id o184mr7567122wmo.183.1613735095191; Fri, 19 Feb 2021 03:44:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJyKgapT4Wk26+iPVTffeQai1yYGvwGLxBWsJgyU3zvvSdjwgGSG7pAUOZ3XrSXF4+i1f3+P6A== X-Received: by 2002:a1c:28c1:: with SMTP id o184mr7567079wmo.183.1613735095017; Fri, 19 Feb 2021 03:44:55 -0800 (PST) Received: from localhost.localdomain (68.red-83-57-175.dynamicip.rima-tde.net. [83.57.175.68]) by smtp.gmail.com with ESMTPSA id y62sm13962465wmy.9.2021.02.19.03.44.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Feb 2021 03:44:54 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Radoslaw Biernacki , Paolo Bonzini , qemu-s390x@nongnu.org, Greg Kurz , Marcel Apfelbaum , qemu-arm@nongnu.org, Cornelia Huck , Aleksandar Rikalo , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , BALATON Zoltan , Huacai Chen , Aurelien Jarno , Richard Henderson , "Edgar E. Iglesias" , Christian Borntraeger , Leif Lindholm , Alistair Francis , Thomas Huth , Peter Maydell , Eduardo Habkost , Jiaxun Yang , Halil Pasic , David Hildenbrand , qemu-ppc@nongnu.org, =?utf-8?q?Herv=C3=A9_Poussineau?= , David Gibson , Mark Cave-Ayland , kvm@vger.kernel.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 4/7] hw/mips: Set kvm_supported for KVM-compatible machines Date: Fri, 19 Feb 2021 12:44:25 +0100 Message-Id: <20210219114428.1936109-5-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210219114428.1936109-1-philmd@redhat.com> References: <20210219114428.1936109-1-philmd@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org The following MIPS machines support KVM: - malta - loongson3-virt Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/loongson3_virt.c | 1 + hw/mips/malta.c | 1 + 2 files changed, 2 insertions(+) diff --git a/hw/mips/loongson3_virt.c b/hw/mips/loongson3_virt.c index d4a82fa5367..c5ef44819a7 100644 --- a/hw/mips/loongson3_virt.c +++ b/hw/mips/loongson3_virt.c @@ -622,6 +622,7 @@ 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_supported = true; mc->kvm_type = mips_kvm_type; mc->minimum_page_bits = 14; } diff --git a/hw/mips/malta.c b/hw/mips/malta.c index 9afc0b427bf..f06bd3eff25 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -1456,6 +1456,7 @@ static void mips_malta_machine_init(MachineClass *mc) mc->default_cpu_type = MIPS_CPU_TYPE_NAME("24Kf"); #endif mc->default_ram_id = "mips_malta.ram"; + mc->kvm_supported = true; } DEFINE_MACHINE("malta", mips_malta_machine_init) From patchwork Fri Feb 19 11:44:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12095131 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED0F1C433DB for ; Fri, 19 Feb 2021 11:46:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9E4E064EB3 for ; Fri, 19 Feb 2021 11:46:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230456AbhBSLqe (ORCPT ); Fri, 19 Feb 2021 06:46:34 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:59154 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230308AbhBSLqb (ORCPT ); Fri, 19 Feb 2021 06:46:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613735103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0R9Vee28fdo2aFv1gdPK3UOKRB7Gj2iTxIGnYkVmUYc=; b=AoHQ4PLZ/EHe2CB1OGVS4D2mjAn63KhwL9ecpe14qFsh5+0PiDMD2Ivn+8qQ6yJrHYEZdr ROswG1h9QiWaLS79EgVwyFBJtae2m/2wMsfZwQu0HbHeVPRy83M6qvdJVpsZbo4d22AMDo K/72uBtGX4mZei37yK30yyEINvfZ81E= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-474-MFCFYQVFOhSaBNeqwZJ5jQ-1; Fri, 19 Feb 2021 06:45:02 -0500 X-MC-Unique: MFCFYQVFOhSaBNeqwZJ5jQ-1 Received: by mail-wr1-f71.google.com with SMTP id l3so699127wrx.15 for ; Fri, 19 Feb 2021 03:45:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0R9Vee28fdo2aFv1gdPK3UOKRB7Gj2iTxIGnYkVmUYc=; b=KShytqOSqg93bAQfz/8kdtzeA+ljs4b0e3szvFQWahRv76S/b5UGnKM+Q42uy9tJPw p2XjnMKIXmmjczBAyCUSrMn16UCHlEjyhZu1DUECRV9xPoLEMp0gBQVMwrL+FuY4Oo1f JJ7YqDgS6oB7Jdqobnc5zGkP1U37XjODMbzz1qc9ubQqUGkBqT2hf+jR4v6/gAK97moS 3z6rpSm17uhJqMJAG2xqMWHTOMPIvH5tsOj0GGXW3ey3XWV2HS4uoj+L0P26ldjhK9UR 9WeFdDwlEu81A8hSYem40UJKMTvZKDGlI9UsKHe7Zi9OIL1AxSVclLyZjIH8fqzeB5VN Yy0w== X-Gm-Message-State: AOAM532FUIQSgmsr8CpSfzrPv+UZMTMcOvbeDrPCDqy0aZ1iYPgTuSaU Bf9E/gFV8aCth2fPmtiAn673OG7V34H+6b8HkuWcelgN88rMYIYkkBN30nfByBVH9y5krgnmEdB 4SOvzwYbX+urI X-Received: by 2002:a7b:c348:: with SMTP id l8mr7731701wmj.72.1613735100770; Fri, 19 Feb 2021 03:45:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJweV2p/U7baigA+j88GyCGfsAg1IKU59k57aoCfr06SWWmLdY29RRpGNsZxGKV53eNicH2Xaw== X-Received: by 2002:a7b:c348:: with SMTP id l8mr7731669wmj.72.1613735100571; Fri, 19 Feb 2021 03:45:00 -0800 (PST) Received: from localhost.localdomain (68.red-83-57-175.dynamicip.rima-tde.net. [83.57.175.68]) by smtp.gmail.com with ESMTPSA id o13sm15918266wrs.45.2021.02.19.03.44.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Feb 2021 03:45:00 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Radoslaw Biernacki , Paolo Bonzini , qemu-s390x@nongnu.org, Greg Kurz , Marcel Apfelbaum , qemu-arm@nongnu.org, Cornelia Huck , Aleksandar Rikalo , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , BALATON Zoltan , Huacai Chen , Aurelien Jarno , Richard Henderson , "Edgar E. Iglesias" , Christian Borntraeger , Leif Lindholm , Alistair Francis , Thomas Huth , Peter Maydell , Eduardo Habkost , Jiaxun Yang , Halil Pasic , David Hildenbrand , qemu-ppc@nongnu.org, =?utf-8?q?Herv=C3=A9_Poussineau?= , David Gibson , Mark Cave-Ayland , kvm@vger.kernel.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 5/7] hw/ppc: Set kvm_supported for KVM-compatible machines Date: Fri, 19 Feb 2021 12:44:26 +0100 Message-Id: <20210219114428.1936109-6-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210219114428.1936109-1-philmd@redhat.com> References: <20210219114428.1936109-1-philmd@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org The following PowerPC machines support KVM: - 40p - bamboo - g3beige - mac99 - mpc8544ds - ppce500 - pseries - sam460ex - virtex-ml507 Signed-off-by: Philippe Mathieu-Daudé --- RFC: I'm surprise by this list, but this is the result of auditing calls to kvm_enabled() checks. --- hw/ppc/e500plat.c | 1 + hw/ppc/mac_newworld.c | 1 + hw/ppc/mac_oldworld.c | 1 + hw/ppc/mpc8544ds.c | 1 + hw/ppc/ppc440_bamboo.c | 1 + hw/ppc/prep.c | 1 + hw/ppc/sam460ex.c | 1 + hw/ppc/spapr.c | 1 + 8 files changed, 8 insertions(+) diff --git a/hw/ppc/e500plat.c b/hw/ppc/e500plat.c index bddd5e7c48f..bf95b68bc03 100644 --- a/hw/ppc/e500plat.c +++ b/hw/ppc/e500plat.c @@ -98,6 +98,7 @@ static void e500plat_machine_class_init(ObjectClass *oc, void *data) mc->max_cpus = 32; mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("e500v2_v30"); mc->default_ram_id = "mpc8544ds.ram"; + mc->kvm_supported = true; machine_class_allow_dynamic_sysbus_dev(mc, TYPE_ETSEC_COMMON); } diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index e991db4addb..573502f7b5b 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -595,6 +595,7 @@ static void core99_machine_class_init(ObjectClass *oc, void *data) mc->max_cpus = MAX_CPUS; mc->default_boot_order = "cd"; mc->default_display = "std"; + mc->kvm_supported = true; mc->kvm_type = core99_kvm_type; #ifdef TARGET_PPC64 mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("970fx_v3.1"); diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index 44ee99be886..4b34106919d 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -444,6 +444,7 @@ static void heathrow_class_init(ObjectClass *oc, void *data) #endif /* TOFIX "cad" when Mac floppy is implemented */ mc->default_boot_order = "cd"; + mc->kvm_supported = true; mc->kvm_type = heathrow_kvm_type; mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("750_v3.1"); mc->default_display = "std"; diff --git a/hw/ppc/mpc8544ds.c b/hw/ppc/mpc8544ds.c index 81177505f02..4b750ca0555 100644 --- a/hw/ppc/mpc8544ds.c +++ b/hw/ppc/mpc8544ds.c @@ -56,6 +56,7 @@ static void e500plat_machine_class_init(ObjectClass *oc, void *data) mc->max_cpus = 15; mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("e500v2_v30"); mc->default_ram_id = "mpc8544ds.ram"; + mc->kvm_supported = true; } #define TYPE_MPC8544DS_MACHINE MACHINE_TYPE_NAME("mpc8544ds") diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c index b156bcb9990..f3258a1f229 100644 --- a/hw/ppc/ppc440_bamboo.c +++ b/hw/ppc/ppc440_bamboo.c @@ -304,6 +304,7 @@ static void bamboo_machine_init(MachineClass *mc) mc->init = bamboo_init; mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("440epb"); mc->default_ram_id = "ppc4xx.sdram"; + mc->kvm_supported = true; } DEFINE_MACHINE("bamboo", bamboo_machine_init) diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index 7e72f6e4a9b..96b6f68d663 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -441,6 +441,7 @@ static void ibm_40p_machine_init(MachineClass *mc) mc->default_boot_order = "c"; mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("604"); mc->default_display = "std"; + mc->kvm_supported = true; } DEFINE_MACHINE("40p", ibm_40p_machine_init) diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c index e459b43065b..43cccad1591 100644 --- a/hw/ppc/sam460ex.c +++ b/hw/ppc/sam460ex.c @@ -513,6 +513,7 @@ static void sam460ex_machine_init(MachineClass *mc) mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("460exb"); mc->default_ram_size = 512 * MiB; mc->default_ram_id = "ppc4xx.sdram"; + mc->kvm_supported = true; } DEFINE_MACHINE("sam460ex", sam460ex_machine_init) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 85fe65f8947..3f83c2ce2ca 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -4426,6 +4426,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data) mc->default_ram_size = 512 * MiB; mc->default_ram_id = "ppc_spapr.ram"; mc->default_display = "std"; + mc->kvm_supported = true; mc->kvm_type = spapr_kvm_type; machine_class_allow_dynamic_sysbus_dev(mc, TYPE_SPAPR_PCI_HOST_BRIDGE); mc->pci_allow_0_address = true; From patchwork Fri Feb 19 11:44:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12095133 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08B98C433E0 for ; Fri, 19 Feb 2021 11:46:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AD09C64EB3 for ; Fri, 19 Feb 2021 11:46:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230462AbhBSLqk (ORCPT ); Fri, 19 Feb 2021 06:46:40 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:43215 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230438AbhBSLqf (ORCPT ); Fri, 19 Feb 2021 06:46:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613735109; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FSOzp7uQzDcR4IYxMZ7wQ2qt5GIWM3B9STvSPsjq1vc=; b=P7V5WTzyCkj+OSNAXTB0ChpNKNApf9nO8ezuauv8NqC47BHrkjpePPsCUGaKvlWTbfSlY5 JrsmPxVtAEsxRZ61Me/WdcNuOcBoxZyt2GS5WaNr0aboJ64zqm4Z9UepvV4IzuB9FD6uDr 2jXk82hOFYCPolOQstImeATu3zDs8d4= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-349-_UMdGcv9Nh6m-Q4T8UkPIw-1; Fri, 19 Feb 2021 06:45:07 -0500 X-MC-Unique: _UMdGcv9Nh6m-Q4T8UkPIw-1 Received: by mail-wr1-f70.google.com with SMTP id l3so699224wrx.15 for ; Fri, 19 Feb 2021 03:45:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FSOzp7uQzDcR4IYxMZ7wQ2qt5GIWM3B9STvSPsjq1vc=; b=Hr2NMJGcO9FImw1uJfprac4AgSuWq4s0WOByG8YKFCywLCh4HCvGsuXKEXF1BD7l9V iIpb3bNQgbyHshR/aLdKqouzVq8afl8t7lowsqKJsMoDE7senLBTWyJBFvKFLdc3x9HM HLPVKGZhkx8asrkSB6isA4BZnHV8iFIBJ9jZcnC2qAdIP7ftusMN1Ch/LU9heQP7eEJ5 jRJsbevSUh7eQPqr8rFztoTI54R00YOEFC/JbolDmqIWiu8e8LHM/TkiwZX7yUWUC4jk 1oJoT2gJlsKCWLTBRSRGGu78cubSEGYkvadGep5eBbRz7RT+hEunW9fQju4xeQmuZi76 IWOw== X-Gm-Message-State: AOAM532YrXWu76bYbS8tZHz12X1a7tXniY1l2zPCYNrNDhQXRQflbMPK eukkNvBIVRkXgsysRU9yyKnfxKzIcLbYYWNspDmlEf02tJNJBEmTzl6wAoR+RkKiicNWLcCDc0/ pH+5TTjh/mBkO X-Received: by 2002:a1c:9d52:: with SMTP id g79mr1792871wme.144.1613735106319; Fri, 19 Feb 2021 03:45:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJy5NDROWWBmKNQhqQPWK1fZiiO56f2O6/VVl8Y9duIpMUqxZOlYU2Hbr0aPfnX0v4HquetdhQ== X-Received: by 2002:a1c:9d52:: with SMTP id g79mr1792832wme.144.1613735106189; Fri, 19 Feb 2021 03:45:06 -0800 (PST) Received: from localhost.localdomain (68.red-83-57-175.dynamicip.rima-tde.net. [83.57.175.68]) by smtp.gmail.com with ESMTPSA id a11sm3917199wmh.25.2021.02.19.03.45.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Feb 2021 03:45:05 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Radoslaw Biernacki , Paolo Bonzini , qemu-s390x@nongnu.org, Greg Kurz , Marcel Apfelbaum , qemu-arm@nongnu.org, Cornelia Huck , Aleksandar Rikalo , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , BALATON Zoltan , Huacai Chen , Aurelien Jarno , Richard Henderson , "Edgar E. Iglesias" , Christian Borntraeger , Leif Lindholm , Alistair Francis , Thomas Huth , Peter Maydell , Eduardo Habkost , Jiaxun Yang , Halil Pasic , David Hildenbrand , qemu-ppc@nongnu.org, =?utf-8?q?Herv=C3=A9_Poussineau?= , David Gibson , Mark Cave-Ayland , kvm@vger.kernel.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 6/7] hw/s390x: Set kvm_supported to s390-ccw-virtio machines Date: Fri, 19 Feb 2021 12:44:27 +0100 Message-Id: <20210219114428.1936109-7-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210219114428.1936109-1-philmd@redhat.com> References: <20210219114428.1936109-1-philmd@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org All s390-ccw-virtio machines support KVM. Signed-off-by: Philippe Mathieu-Daudé --- hw/s390x/s390-virtio-ccw.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 2972b607f36..259b4b4397e 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -612,6 +612,7 @@ static void ccw_machine_class_init(ObjectClass *oc, void *data) mc->possible_cpu_arch_ids = s390_possible_cpu_arch_ids; /* it is overridden with 'host' cpu *in kvm_arch_init* */ mc->default_cpu_type = S390_CPU_TYPE_NAME("qemu"); + mc->kvm_supported = true; hc->plug = s390_machine_device_plug; hc->unplug_request = s390_machine_device_unplug_request; nc->nmi_monitor_handler = s390_nmi; From patchwork Fri Feb 19 11:44:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12095135 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA657C433DB for ; Fri, 19 Feb 2021 11:46:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8DC9264EB3 for ; Fri, 19 Feb 2021 11:46:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230468AbhBSLqp (ORCPT ); Fri, 19 Feb 2021 06:46:45 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:47847 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230461AbhBSLqm (ORCPT ); Fri, 19 Feb 2021 06:46:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613735115; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YJlwy/QOkf0QIlTzPZ6przivK3+kqukDr5TR8oal+wM=; b=dJVP5+S1tMVic0IRKW2XmEswBeQV8YIS+t1d3w+xxw75aN4BbJft5z8j8elVX8zlG4mtrd Hxf3OlSMIAAt/ID4rqLcfJ5RVBSqodb3LTI7giRjJUA7Wx6XtpUk/s4cW6n636kO983pzl KnNPLkMRPtJaobU1I3E+gpVgVo19sz8= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-62-kZgZ5Q5CM5CBmJtd3ctDKA-1; Fri, 19 Feb 2021 06:45:13 -0500 X-MC-Unique: kZgZ5Q5CM5CBmJtd3ctDKA-1 Received: by mail-wr1-f70.google.com with SMTP id l10so2325943wry.16 for ; Fri, 19 Feb 2021 03:45:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YJlwy/QOkf0QIlTzPZ6przivK3+kqukDr5TR8oal+wM=; b=IyntMUs9P42dVBZFeb2W4zmjUBy9Wuj2Q+UUnNcNr2tGl6qj3NhwOPD/YnhuPK9HPl s2NuUqYd2hyFvHB03qYywlklKSbDPEa26ifefS8lgRxBHig3nQSJE0RN0rrMApU+P9H8 M+xylZ/L20ZND8+KSgVrue+i1rmmJik9dAGfwo2OR//mGuyW3hYgPegObZg+vhAmM3Zo LnwFGWCw8rPxoBqDA+QZSEQ4Tf85Mr8qo8rHGYfVsQlnVWUGmZF9AB19u3i/18TDmzUU Xnya764d2yhTRCFpCDp9HsQ4jDt3hILdoE2WYYU9+4kmkk5kh79vEnd0ViqNOqMAGqv+ AMxA== X-Gm-Message-State: AOAM532BSwYLt//7E3h1HLq9jIZh+3sM5yfrhJRxXOCTj3rLltnGrXh1 D18WLbnrLSoenDg3hBAN72iS2vJ1JsupQacq16g5bTkfCJWEgSMHao21h+UekS219XMvzrIO0mH jYeSEI2ZG6qqF X-Received: by 2002:adf:bbca:: with SMTP id z10mr8877272wrg.168.1613735112115; Fri, 19 Feb 2021 03:45:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJxZHhoZ2Wy0Wkb5v1FsmoSovOJoQjV0ghbc4hAJ/cIFmfZspDESkeyO+OZmJZh6DupK3/KHUQ== X-Received: by 2002:adf:bbca:: with SMTP id z10mr8877239wrg.168.1613735111985; Fri, 19 Feb 2021 03:45:11 -0800 (PST) Received: from localhost.localdomain (68.red-83-57-175.dynamicip.rima-tde.net. [83.57.175.68]) by smtp.gmail.com with ESMTPSA id z17sm15710920wrv.9.2021.02.19.03.45.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Feb 2021 03:45:11 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Radoslaw Biernacki , Paolo Bonzini , qemu-s390x@nongnu.org, Greg Kurz , Marcel Apfelbaum , qemu-arm@nongnu.org, Cornelia Huck , Aleksandar Rikalo , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , BALATON Zoltan , Huacai Chen , Aurelien Jarno , Richard Henderson , "Edgar E. Iglesias" , Christian Borntraeger , Leif Lindholm , Alistair Francis , Thomas Huth , Peter Maydell , Eduardo Habkost , Jiaxun Yang , Halil Pasic , David Hildenbrand , qemu-ppc@nongnu.org, =?utf-8?q?Herv=C3=A9_Poussineau?= , David Gibson , Mark Cave-Ayland , kvm@vger.kernel.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 7/7] accel/kvm: Exit gracefully when KVM is not supported Date: Fri, 19 Feb 2021 12:44:28 +0100 Message-Id: <20210219114428.1936109-8-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210219114428.1936109-1-philmd@redhat.com> References: <20210219114428.1936109-1-philmd@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Now that we added the 'kvm_supported' field to MachineClass and all our machines able to use KVM have this field set, we can check it in kvm_init() and exit gracefully with a friendly error message. Before: $ qemu-system-aarch64 -M raspi3b -enable-kvm qemu-system-aarch64: /build/qemu-ETIdrs/qemu-4.2/exec.c:865: cpu_address_space_init: Assertion `asidx == 0 || !kvm_enabled()' failed. Aborted $ qemu-system-aarch64 -M xlnx-zcu102 -enable-kvm -smp 6 qemu-system-aarch64: kvm_init_vcpu: kvm_arch_init_vcpu failed (0): Invalid argument After: $ qemu-system-aarch64 -M raspi3b -enable-kvm Machine 'raspi3b' does not support KVM $ qemu-system-aarch64 -M xlnx-zcu102 -enable-kvm -smp 6 Machine 'xlnx-zcu102' does not support KVM Signed-off-by: Philippe Mathieu-Daudé --- accel/kvm/kvm-all.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index b069938d881..8a8d3f64248 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -2001,6 +2001,12 @@ static int kvm_init(MachineState *ms) s = KVM_STATE(ms->accelerator); + if (!mc->kvm_supported) { + ret = -EINVAL; + fprintf(stderr, "Machine '%s' does not support KVM\n", mc->name); + exit(1); + } + /* * On systems where the kernel can support different base page * sizes, host page size may be different from TARGET_PAGE_SIZE,