From nobody Fri May 10 04:40:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1613735083; cv=none; d=zohomail.com; s=zohoarc; b=BWeTa2QFNX0hGSuzi0nlh5sqmiECUqVrqPCTxtDKdWyCNWtCfPfhXE9bpvw3B3UqOIOsaA5h2jur3b/mfanMHRChrcw/MPVsWFr6HceKdXqu5RQ8bVl3TfRL8HQKNicajDX20QzlwU4pCEbfT+ftFVPKdubPocdv1PH1cGqv+r0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613735083; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=98X4DsBNdk1BN09KWcHx0mE3/gzzTZdKxOLSGajyIeI=; b=gXYMI5Q6Zg88yt0zFo/dAaDdHx8boFMETN6ucoF2IWR3RbRPBq6ofT6zgm9fYbblP4bP9ED3l2aHZFawp8eJ+g/dhYesfGOJEsVq/Eot/MTrUZ9mTXN1fGktAjWuhLX9O4nB7GyBxxkw2HvcMeGr8oUbFMHDJv0/XfsGttQAr58= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1613735083223380.3453129967901; Fri, 19 Feb 2021 03:44:43 -0800 (PST) Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-508-JNFrtoNHNFObkRrlhZYfIQ-1; Fri, 19 Feb 2021 06:44:38 -0500 Received: by mail-wr1-f69.google.com with SMTP id f5so2347099wro.7 for ; Fri, 19 Feb 2021 03:44:38 -0800 (PST) Return-Path: Return-Path: 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613735082; 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=VZxd9Mx9ED8MOgtOUbEKBRL/xmatQvWi6LkfLk5R6JIuVPbN+gL+/7T+gyCX2DjxB1DU3u PuM1MsrdP/YMXbZ4VUsrDSQAg1O35wID3mrz1vQOQH5dm0rAMfVDD07a1nqwl0gOo1m1GT sqXJcJ7oNDK7DF4MIGomvV9t5MkVrZY= X-MC-Unique: JNFrtoNHNFObkRrlhZYfIQ-1 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=Wcyw//f63HFpp+9JDqES3ZlNsE9/npwkme03QEZmtCd3eRntK/n34cKxgZGyJ6vlnZ LKTwYC2YmNFsDfSQm4DoCxPZMNUd+/rB/nB7Ippz/iBAwAAOcSRiLoVW4Mh7Cjioj9ry /v4i7HH9W8kRT6IIDfoVVZauEk1H1Wh5z7iICIroZXqCdLhyq+OdMJiMy4fbRYw6IKzi rux1PzS3AbT2022x9JiCFJWf+nOnPf/wuBOaepLESUP+ZEi1XhbaiWXSj2djBuxe755A nxxYsP6gOJYHQROHnyOIDTmZGqFwf1SYhHNg6P5YidVJwPzJ7GLVrLaxKp8fIAEJHwKa K1XQ== X-Gm-Message-State: AOAM533p2cY1nIom38p8n0EAbb4T4m+IPtFhoBbO0eiP/LrxKCsKAO78 G1J+60bcUa669GocA4NUtxYDvmW9jSXyz2UspiTNa7zoZUzasMht49uNMREYZeLaCZKQ2p6QCUg XLha8SyTPECFcvQ== X-Received: by 2002:adf:b357:: with SMTP id k23mr8694367wrd.354.1613735077421; 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) From: =?UTF-8?q?Philippe=20Mathieu-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=20Mathieu-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=20Poussineau?= , David Gibson , Mark Cave-Ayland , kvm@vger.kernel.org, =?UTF-8?q?Philippe=20Mathieu-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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) MachineClass::kvm_type() can return -1 on failure. Document it, and add a check in kvm_init(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- 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 capabilitie= s. + * 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 =3D mc->kvm_type(ms, kvm_type); + if (type < 0) { + ret =3D -EINVAL; + fprintf(stderr, "Failed to detect kvm-type for machine '%s'\n", + mc->name); + goto err; + } } =20 do { --=20 2.26.2 From nobody Fri May 10 04:40:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1613735090; cv=none; d=zohomail.com; s=zohoarc; b=BSaLyyeE8/eJDSGdHay1M5JkEZCjmeNS4etp/uwsjaI+/3MDNxQLbLpGpHY26uTkmT+YTUQSheL6qYHvetAWPmT8QDzggT0OY6JsVPk9Et0fqy/aNk0wQTEJbSW4q/TEFqQuddvl3HCKKNhIqEahMk2oX230W+GmoTCEVqNUwR4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613735090; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=KroGD2ykh3pOVhGFDhJBF9D2GPtRIz+7OKOBV/uF+8M=; b=AzIUEX/LVSzKujEUaDZ+dp5wpJsM+QjTB1IUCfpx/l4QXj82bW22lbidp2TkYdlCESwIdWvLuWDy41fwDnYokI4rNvBoFFJHZmilFAHE9YgsaWS96zKFFZu5uhRxscqAcoephiTj4o6SkGrVwYr7UTU2j13O+pA5uzmm4mYEM6o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 16137350903201008.1250676658135; Fri, 19 Feb 2021 03:44:50 -0800 (PST) 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-391-X_iTWjwFMS6Dojyzbg2fYw-1; Fri, 19 Feb 2021 06:44:44 -0500 Received: by mail-wm1-f71.google.com with SMTP id t15so4250074wmj.1 for ; Fri, 19 Feb 2021 03:44:44 -0800 (PST) Return-Path: Return-Path: 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613735089; 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=D+NJB2AqLhGrdyZYIgJYha7DbUHcS0E2G4GgDRUNolSW5f6lkdqhGPYd8wJu2cFKuVY7dT tTaMXCH0bYvY5VfL+s8OCJTVfev0A7bP6kB22wWTuC7xFaYGw6kqO6ZQ50o2oCwTxsMgqS IuzLg0xX+26Bx/SzBhGEh63+xitlrz4= X-MC-Unique: X_iTWjwFMS6Dojyzbg2fYw-1 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=E1IpThHzYjpLYqeVAJleXpCD+PjqdQsTvsL80VkSeHSkp0d9U8EKXwsMi4RKIYHl5V HODtDxkJrRtJ+zVf4Uo0Ssjif56wYj9VvJ7xgnf0RNpKilVHdCtOpRF5afHB3rNP6gNP A8T9g298N9BCbDJH6EmYUEUVa8B+2+LljRCFEytpZf8DtVtlncwUl4+A9xBQ2pMn7Ydj htKhL7dfw8NCQQ3PZizJzeeW6elPlXiST+LwuDgEmo/HAIBB/2iSe626tsHDLBw/XS/W 1A7ll8364oec7/TA9nSf7scip455TRu+5xlPN/gyo6+R6RZ3MOj7abRP1eHeAIM7t1ON l7lA== X-Gm-Message-State: AOAM533QJf18/jvuvE/5qntcPZ5X9XlJNejOYaiys+ENQmonreHmKfGP 4xvZr2+pQZlgjnsD7VceOgoHNvKXdHv6t5MPTvy2j+ixChHYytY11ejsWXtQ1MVFqyXBz9wETKs jmBusk+y6fC7fsA== X-Received: by 2002:adf:b342:: with SMTP id k2mr8775472wrd.264.1613735083594; 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) From: =?UTF-8?q?Philippe=20Mathieu-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=20Mathieu-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=20Poussineau?= , David Gibson , Mark Cave-Ayland , kvm@vger.kernel.org, =?UTF-8?q?Philippe=20Mathieu-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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Introduce the 'kvm_supported' field to express whether a machine supports KVM acceleration or not. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- 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; =20 HotplugHandler *(*get_hotplug_handler)(MachineState *machine, --=20 2.26.2 From nobody Fri May 10 04:40:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1613735093407791.997555322939; Fri, 19 Feb 2021 03:44:53 -0800 (PST) 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-34-Lx87P5ocMOCLtr-Ck8Avew-1; Fri, 19 Feb 2021 06:44:50 -0500 Received: by mail-wr1-f70.google.com with SMTP id o10so2328196wru.11 for ; Fri, 19 Feb 2021 03:44:50 -0800 (PST) Return-Path: Return-Path: 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) 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= X-MC-Unique: Lx87P5ocMOCLtr-Ck8Avew-1 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=CkiU8TIL2DNvIiEZ97UGbrotTaSYkfC3aXgd2bZiUgxUU3bwVIV1vzYHQJIFupHdPL N7zcy0mZFry3DLvaTVFVKaB9/bIf0mZPPEGibcBRatF8Re2EykSn2rD43O2YSmp0aguW ocCoPhs9lfOdE/Eo5APmVmIho3yypZkQ8imC53aody2+LuijOrZF3XL/PN4LvqEIbf/8 ubz8OY6V5EONGuApboiL+gm2vmPAMJVXg69B3Q0fRO9BvMPU9DLk6PS7cpu+Ew5pSDv0 ckFrPS0kBs3Ym1bFwWMyXmfF8fNpbH3AZ4jc6VtXb8mHEHEl5jiSlfkPNbTdHG/qlfuu QMSg== X-Gm-Message-State: AOAM532onvkCrVxQMC6a3pnMAvRFell4oA7kd3LUn/jyTfPDXzBadpry lgTmPgAPwsKha8XGg//MGOKrZ78EgoyW1bl82rgG5VGInIQbfY79A2rQz/z1fP4cg0fMOyIxDHz bjkdnjCa3STzBUA== X-Received: by 2002:a1c:23c2:: with SMTP id j185mr7787131wmj.96.1613735089340; 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) From: =?UTF-8?q?Philippe=20Mathieu-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=20Mathieu-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=20Poussineau?= , David Gibson , Mark Cave-Ayland , kvm@vger.kernel.org, =?UTF-8?q?Philippe=20Mathieu-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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) The following ARM machines support KVM: - virt - sbsa-ref - xlnx-versal-virt Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- 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 =3D sbsa_ref_possible_cpu_arch_ids; mc->cpu_index_to_instance_props =3D sbsa_ref_cpu_index_to_props; mc->get_default_cpu_node_id =3D sbsa_ref_get_default_cpu_node_id; + mc->kvm_supported =3D true; } =20 static const TypeInfo sbsa_ref_info =3D { 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 =3D virt_cpu_index_to_props; mc->default_cpu_type =3D ARM_CPU_TYPE_NAME("cortex-a15"); mc->get_default_cpu_node_id =3D virt_get_default_cpu_node_id; + mc->kvm_supported =3D true; mc->kvm_type =3D virt_kvm_type; assert(!mc->get_hotplug_handler); mc->get_hotplug_handler =3D 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 =3D XLNX_VERSAL_NR_ACPUS; mc->no_cdrom =3D true; mc->default_ram_id =3D "ddr"; + mc->kvm_supported =3D true; } =20 static const TypeInfo versal_virt_machine_init_typeinfo =3D { --=20 2.26.2 From nobody Fri May 10 04:40:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1613735099; cv=none; d=zohomail.com; s=zohoarc; b=Ra03LqVFv6NPm2+Mdze05C+DR0Y54Y4bmW+PKv7nXBocBdBeaIqGnkOHpQdMK6B5wbzjPwJct9JOtZphAUsJywilzoieKHhAx/TwbDWM26RCif+Td4P6yr8OH6CJMKti41ehcdAEd/ne85Iw24yv8qKerjJo25sNn7Wk2ngGFe8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613735099; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=0vt/SIQERosIkjtlGwMC0PxcViyxR2oXSsZjlPDjv1Q=; b=LFpq2PCpFHpNc4zGM7xUTdLjdLVlrzxA4ngD/oZQiq0mYRmn6UIVvLc/ZUZKfKg200J8WhQFPO95wZ+sUkq990L1EWHOq4ND2P/N/JOPtMXdSOYHlb3eioNxGOdZyulMIOX1MiXBzupL44qCpBgZwOJ+gEeDxoVWcvaMjpaXLHg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1613735099173376.9012765104678; Fri, 19 Feb 2021 03:44:59 -0800 (PST) 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-160-gnJJcHfON0C72WC7nQBPFg-1; Fri, 19 Feb 2021 06:44:56 -0500 Received: by mail-wr1-f70.google.com with SMTP id e29so2133667wra.12 for ; Fri, 19 Feb 2021 03:44:56 -0800 (PST) Return-Path: Return-Path: 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) 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= X-MC-Unique: gnJJcHfON0C72WC7nQBPFg-1 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=XC3Um1A7A5i7gc9UGRgqHVRHuf4QB9FNhVe1KD5CsPjuPJcoSDd5XuOtXidXSDZrdB /Wy99UCM/4bTrYWrvKlVACMlX3UHgiF+qQYqnAYX4V3HeDHh+gKbW41MANrhUqflkEN0 xM1pDUzy+SYG8gMNPdIt/m/5ANPJnkRahxxJY/j+DB+pQzeR80PKIVpdLT1KsRrOzVCD oSSZm71iWu5Eom+fD6FP3jBn8g/oCfeOKC84P/6pBZXzQ24b4MtBMkx88aUBtaLhrzBL 3ONUxC1QFTkpYCRP1f7C0Mjz7xo7pSdmxucjArg2YCXI7PVv7AR3JndQWs8dS0ZVbn1k omhw== X-Gm-Message-State: AOAM532A18hwi1htwttKWliKej3U4rfHYfZ3Qw5qlX+nBhLmmKN06g3V upN9Q8G0Q4oPsUAwt7yC7bxuveZhuC4Ta5EIgQuJscq/mSMZmcLLV5rnKYuMhFDWMhrm1zvKXLs evRvIwIcfEXwm9g== X-Received: by 2002:a1c:28c1:: with SMTP id o184mr7567110wmo.183.1613735095188; 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) From: =?UTF-8?q?Philippe=20Mathieu-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=20Mathieu-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=20Poussineau?= , David Gibson , Mark Cave-Ayland , kvm@vger.kernel.org, =?UTF-8?q?Philippe=20Mathieu-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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) The following MIPS machines support KVM: - malta - loongson3-virt Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- 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 =3D LOONGSON_MAX_VCPUS; mc->default_ram_id =3D "loongson3.highram"; mc->default_ram_size =3D 1600 * MiB; + mc->kvm_supported =3D true; mc->kvm_type =3D mips_kvm_type; mc->minimum_page_bits =3D 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 =3D MIPS_CPU_TYPE_NAME("24Kf"); #endif mc->default_ram_id =3D "mips_malta.ram"; + mc->kvm_supported =3D true; } =20 DEFINE_MACHINE("malta", mips_malta_machine_init) --=20 2.26.2 From nobody Fri May 10 04:40:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1613735105325177.62937218655134; Fri, 19 Feb 2021 03:45:05 -0800 (PST) Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-483-SBa55szwOvupTKEbqRdyBg-1; Fri, 19 Feb 2021 06:45:02 -0500 Received: by mail-wr1-f69.google.com with SMTP id d7so2300506wri.23 for ; Fri, 19 Feb 2021 03:45:02 -0800 (PST) Return-Path: Return-Path: 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613735104; 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=CeNKbqmsFJ14v8FCUSUC687z3uYdhsWYAAnn6DagzS3rpKd2elcXJsqGm/Zt15FxiDfluG XYXqMkI36WsgI6tRLpu7jogNQSuKKLh9l1ITewk7+sX8N0L2dnF4v0tb3rTTFWg3c2AuQY 9hwiVZ0IRHTchNdstqCWuldRRg0xqYA= X-MC-Unique: SBa55szwOvupTKEbqRdyBg-1 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=VQa5v5gB2aOSfwvG0nffQWBrqfPf7G5XnqeqVRrqORamTV8IDtb3qGMzhcsFeQMaXt FKiN9j7h64lVDGElU07rXYAzcNqyJUasVPIQU3wrz41ZwLG7RKlGYBBuPqmGmFkiOCrD MCuAzdymwPum/Z1fkVrXT1ErtVMvw6DXdvxCQ8E/E15mVBWUc9h/VeUcqa0yOlSaJDV5 FxwEd68ngCPcWwAAXDtChrhFtiyOYMDGAiuLlaZqW6wIQcr2vFNgeaAeUyZeP8wM/u5J ltwrv03PAsr1eDy9CgnvUP0dzkIz2LBU1POWOnsBQHgecM8Bf6Ngy6WKgLK/3FMmbn7j 8Qqg== X-Gm-Message-State: AOAM531SlfAyBqHoNLrC6h4okuTrd2YmOulNM5iPyTId6x34SrQ7qGfJ vzP7SekaBhMjqX57guqG5EFsBKGzPlTEMNoONj6kruqvfHuJcRQiYFCGaKbmjcbMS7Dm+m+Yz1M gEf6YzOrek7/xYA== X-Received: by 2002:a7b:c348:: with SMTP id l8mr7731699wmj.72.1613735100769; 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) From: =?UTF-8?q?Philippe=20Mathieu-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=20Mathieu-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=20Poussineau?= , David Gibson , Mark Cave-Ayland , kvm@vger.kernel.org, =?UTF-8?q?Philippe=20Mathieu-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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) The following PowerPC machines support KVM: - 40p - bamboo - g3beige - mac99 - mpc8544ds - ppce500 - pseries - sam460ex - virtex-ml507 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- 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 =3D 32; mc->default_cpu_type =3D POWERPC_CPU_TYPE_NAME("e500v2_v30"); mc->default_ram_id =3D "mpc8544ds.ram"; + mc->kvm_supported =3D true; machine_class_allow_dynamic_sysbus_dev(mc, TYPE_ETSEC_COMMON); } =20 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 =3D MAX_CPUS; mc->default_boot_order =3D "cd"; mc->default_display =3D "std"; + mc->kvm_supported =3D true; mc->kvm_type =3D core99_kvm_type; #ifdef TARGET_PPC64 mc->default_cpu_type =3D 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 =3D "cd"; + mc->kvm_supported =3D true; mc->kvm_type =3D heathrow_kvm_type; mc->default_cpu_type =3D POWERPC_CPU_TYPE_NAME("750_v3.1"); mc->default_display =3D "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 =3D 15; mc->default_cpu_type =3D POWERPC_CPU_TYPE_NAME("e500v2_v30"); mc->default_ram_id =3D "mpc8544ds.ram"; + mc->kvm_supported =3D true; } =20 #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 =3D bamboo_init; mc->default_cpu_type =3D POWERPC_CPU_TYPE_NAME("440epb"); mc->default_ram_id =3D "ppc4xx.sdram"; + mc->kvm_supported =3D true; } =20 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 =3D "c"; mc->default_cpu_type =3D POWERPC_CPU_TYPE_NAME("604"); mc->default_display =3D "std"; + mc->kvm_supported =3D true; } =20 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 =3D POWERPC_CPU_TYPE_NAME("460exb"); mc->default_ram_size =3D 512 * MiB; mc->default_ram_id =3D "ppc4xx.sdram"; + mc->kvm_supported =3D true; } =20 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 =3D 512 * MiB; mc->default_ram_id =3D "ppc_spapr.ram"; mc->default_display =3D "std"; + mc->kvm_supported =3D true; mc->kvm_type =3D spapr_kvm_type; machine_class_allow_dynamic_sysbus_dev(mc, TYPE_SPAPR_PCI_HOST_BRIDGE); mc->pci_allow_0_address =3D true; --=20 2.26.2 From nobody Fri May 10 04:40:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1613735110; cv=none; d=zohomail.com; s=zohoarc; b=VsmSSCn0+BECNMyM5Bzghhx3qJmTPDoDdm0BmqMk1P3PXCuKj24Yhc08e4RX3fbB1Msst+beKiZwEstJycnPAuYkwO0xxQiKtHDCRxynghmgEQOYugF3I43zB1W++t2sWkM7DuLmdPpBDJEsvITgbhWPT4NXikVfSyuelaa7IVY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613735110; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=FSOzp7uQzDcR4IYxMZ7wQ2qt5GIWM3B9STvSPsjq1vc=; b=bGg9ISKiQvW9uNbJ8qLSwFzHOd/N8x5LckFvLSF0mrQCeokiIKyPyrM+r+2/Qwm12An9Dl7LwmHyksqGjBQBDdryRIsaA9lJXoHS+DKzMfwpbIGDC1jFuKn113EFqKtaAoUJSZrPVDnu1aAs0LQFakGwodKLlGywAeyOuP+5Hc0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1613735110101546.6255755595131; Fri, 19 Feb 2021 03:45:10 -0800 (PST) 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-317-zQBVNP2fPAWpyLdVYLVmMw-1; Fri, 19 Feb 2021 06:45:07 -0500 Received: by mail-wr1-f70.google.com with SMTP id f5so2347619wro.7 for ; Fri, 19 Feb 2021 03:45:07 -0800 (PST) Return-Path: Return-Path: 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) 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= X-MC-Unique: zQBVNP2fPAWpyLdVYLVmMw-1 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=TgECpDLgBaq5cOu/ElyBGAr1hWM62o72QTNtCpyTEPnqlhuagI9Dh+KauP4d+0H++k 78j2fFl52n0DFTHii0tMNp0I6it5cCzJRdkbLHpNNBLvJtQeYPnhfLjNf65q2pBdJs53 rsYKBSl/Iv1XWwGG8h8mZbe43CW1e896z1h/CdZuYgVnv1N2WXSCctaeUXql5WH4M7QJ PgN7snSKWZgQvZ6XwnmoeS6uSwMUcnBzZdZd9IE50YWMjDsJy2SJDXJswQDxlQ7Dxpd6 RX2NHBO4eO4cS7tp/ObqiMo+LmWEKjDqJup+P8l5g5xwZRMGXCCluPTJyCxlgtXj2VVZ UAFg== X-Gm-Message-State: AOAM530eEv+ZN6tsQ2Sk1THyukyySXYGjdeedvupKsYpZcy7WxB3FTcX 1MAeoggJsp2vJJkQu6pW2HksqLeHwRQ3WiEalJVeo3Bklfi+yUVF6Fh4e7Z0MaonW4X5TiRhm31 xqKqssFb1EZt26Q== X-Received: by 2002:a1c:9d52:: with SMTP id g79mr1792869wme.144.1613735106318; 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) From: =?UTF-8?q?Philippe=20Mathieu-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=20Mathieu-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=20Poussineau?= , David Gibson , Mark Cave-Ayland , kvm@vger.kernel.org, =?UTF-8?q?Philippe=20Mathieu-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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) All s390-ccw-virtio machines support KVM. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- 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, voi= d *data) mc->possible_cpu_arch_ids =3D s390_possible_cpu_arch_ids; /* it is overridden with 'host' cpu *in kvm_arch_init* */ mc->default_cpu_type =3D S390_CPU_TYPE_NAME("qemu"); + mc->kvm_supported =3D true; hc->plug =3D s390_machine_device_plug; hc->unplug_request =3D s390_machine_device_unplug_request; nc->nmi_monitor_handler =3D s390_nmi; --=20 2.26.2 From nobody Fri May 10 04:40:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1613735116; cv=none; d=zohomail.com; s=zohoarc; b=mutxlqhBxEdmA2s4bb1WesVGarqiHPcwdjB6Dg5fZGUiEs5Q+iy6jxRbPQjMsvjhTUN/z3TxoxmuoFPQYeK9hKddP5/8cTos/GXYKUJTTkXeKwM1eUlpNmU6epc7PpLR2qPlefyE3Ni5IOs1CvJtNeZr+HnZU1OkU6GuheCZY5I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613735116; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=YJlwy/QOkf0QIlTzPZ6przivK3+kqukDr5TR8oal+wM=; b=W1rB57hE9aiXOwYt4nmFMWUJzThpKc4x2T/0yjeOoO7Hr1skqRvOaNwCoMlq8xyWFwu6m48DUxVEU1iCVl3aZXxwVV2Nve2+9ErLauI3MZcvujxMMLPsMnJpSjgHwmAFfKUj2AmGUTuv3fvJu5d7ODqI7QcLCvyqkRO12lW5EKY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1613735116034496.83935004479736; Fri, 19 Feb 2021 03:45:16 -0800 (PST) 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-157-dIa3dkiLN2qiyUar3bfnOA-1; Fri, 19 Feb 2021 06:45:13 -0500 Received: by mail-wr1-f71.google.com with SMTP id o16so2370435wrn.1 for ; Fri, 19 Feb 2021 03:45:12 -0800 (PST) Return-Path: Return-Path: 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) 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= X-MC-Unique: dIa3dkiLN2qiyUar3bfnOA-1 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=iw5xKPdbv7cPVSIMUJVDDGumDPSxFCQVb3DmFCXticoiI+ALpL82spjoB6uZd0OLHE Utq+EXiztvN5rV9uJUQ+qzmxkosJhHqkppy4ZKwbHdrHRpt/JKqwbdJMllhSI6PMdICD xoc8zDTI4pmGPV2QgiroYw9KWAYs4nG1AsMYBgZ8sqoqiC9Muk2Y+XKRu2snWaKU+zxu T/nVlxddXJ5uxey43bDi1X47mFY1gV6834YUCRgCg0VS/2wQT+4hwVL+iWHF2KCfbUDm Zyv6IpxGppkr67ZzzGf8dx1+hKMewh1aqbJcu3mlPzwhYtUcvmBkxLU7YUvO4QB/6Ua+ wEtw== X-Gm-Message-State: AOAM533FER5ZBH7lbpkYxyz9vI19xOo5o4/FvoMN6eBHEv02QMU2ysb4 HBiZFwSP9H1dv7yTQuPB2E6CcvlvNt8ejzXuyoQ6nitvJJ4qnxR7Ul0ZmaFzRXRKrUYp2J7XlRM YUvJXpM5SHbh/YQ== X-Received: by 2002:adf:bbca:: with SMTP id z10mr8877262wrg.168.1613735112114; 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) From: =?UTF-8?q?Philippe=20Mathieu-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=20Mathieu-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=20Poussineau?= , David Gibson , Mark Cave-Ayland , kvm@vger.kernel.org, =?UTF-8?q?Philippe=20Mathieu-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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) 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 =3D=3D 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): Invali= d 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=C3=A9 --- 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) =20 s =3D KVM_STATE(ms->accelerator); =20 + if (!mc->kvm_supported) { + ret =3D -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, --=20 2.26.2