From patchwork Fri Mar 15 13:08:59 2024 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: 780500 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp193798wrs; Fri, 15 Mar 2024 06:18:39 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWK6PflHPNDuVFuhjU2umKiQSi10AGV35clQ4pyh/WRdIaECihGHK2BncPZfZia4dbeJBSBhv9XG/xMWqq4dujI X-Google-Smtp-Source: AGHT+IE85qZP2BAzV/yP9Qo5+OsmkdaK15Pv6Y2rSyZW4qmLkIiCEZjmdZDvoqlCh/TGGIDJ5+y/ X-Received: by 2002:a9d:734e:0:b0:6e5:23aa:9afc with SMTP id l14-20020a9d734e000000b006e523aa9afcmr5175826otk.14.1710508719295; Fri, 15 Mar 2024 06:18:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710508719; cv=none; d=google.com; s=arc-20160816; b=qkOvaVQ+9aS4t+OHihJ2x2vCx+1Ix3ad99HDNKKNsDleAV/wEVjZ4P8nmnSs04lQ8I nUItWWKQiANLxfpmRoM4t7nfTCDUUr4cE/narZF78QetnyWk9bXzQ6McCgTZNhkASfMw dSnLMYH3gO5on6NiUhcscskT2E6BvsYhuMwKNz5IWuRws4WYN6+CekiiTSSiLrCLM89w 2CJztA39TyrF6aXAyCDRe16RZyzTPnDX/aVQxVI23AN89NdzjBxyprnhT/9Fg2QusylD To3jdgN/U8Usqxdpek2vWoyVmurF6VIjr3f9uHF14GnDcfpCMnyTV/mAwHK4J6l/WKRw x54A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3PuQ6WSEYLWnTCNPDldZo+Ppk/XGMtRnTbQuxwxDUsU=; fh=PA7Itx6BY35wAM0XPD2z9TDGi1pstgqjn3JUvFuazwM=; b=nFWywB528KEDMrWbqOOEssn6QU1H0Q7J6QkBrWqUMyKE5hATfvYHmR3cTew27QJ9fH kROebEpd2QA3vAe6CZ80Sb+V9qHqqBLm7x4zwtglg/tPqLRyPYDs7qGCnwVoFeoq0q2/ zoN5krQaHJgejf4QTjt5rnTvgPVQZKGclMI2PLvSN+cVWR12nZmmGT4pA69mkkC+x3DB w6NElYenhzBiw9huPjIKDfFXkXWvJHt60rN+mMZe7MWbSBdFg6175rIOW3qdEVeLT31h 6jtgs/ENhqfU0JS+0zzPEZtflJc7C96J9/9kQSHbru0JhqR19Yce50/pdAUZyIghLY+3 etwg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=N8uBIKKO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r21-20020a05622a035500b0042f0f76945bsi1819307qtw.326.2024.03.15.06.18.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Mar 2024 06:18:39 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=N8uBIKKO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rl7LN-0001l5-It; Fri, 15 Mar 2024 09:11:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rl7KW-0007Hv-OB for qemu-devel@nongnu.org; Fri, 15 Mar 2024 09:10:37 -0400 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rl7KQ-00089U-Cr for qemu-devel@nongnu.org; Fri, 15 Mar 2024 09:10:36 -0400 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-a468616ed70so87817766b.3 for ; Fri, 15 Mar 2024 06:10:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710508228; x=1711113028; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3PuQ6WSEYLWnTCNPDldZo+Ppk/XGMtRnTbQuxwxDUsU=; b=N8uBIKKOFTKMTS2NhbYeYgKi9oxDwQ82f1F/hTkHPOKcQrXxY2o+Ar74bgtCAG++33 afYmL6YtPS+Dl7GLQ1swVJ8qMN7WDvjoLCknXnWrNBuItICyvI6oC3RrDdS69t9zF/7w 2F/5ROMzWcySpVTOkrpFHY/mUQrAYEWhLdMJb2a83DNE1o6NarOao0o0QVNz4YzzhtFu 3PwdTOOq4Nsl6Kkyw7CS8iqgTvTJbfp0tknt5avEvdfkq3xoLnlP6WdHcQB4+iDcVopZ 6MhduNeaSoNnCkgr51EDrLu0kMs5ivZ4jLFnOjCwuu2lqLWrzFNgdfrFuDVKisjEBule PwbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710508228; x=1711113028; 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=3PuQ6WSEYLWnTCNPDldZo+Ppk/XGMtRnTbQuxwxDUsU=; b=tY63dYRMP1LsTPo+LzONT1daiyomZU8iyLdYmaNVf26xQFY//U4gjorETa6pxaF3NP jQHgbkbHvsWNx4fS6O1fX0q3JbuTxbPCMA3leiitFVeDy8RZHalC46qUiiSbmV9QDZco tGOu7fG+ItKiyE4opk+iU2WCxi/urXNLOKqugCUjJHf4XuVEZouHrgYgldX2im6eUJ4c tP7dSd03g/R58xKjn46NnqAZdf+DnFWvnmJqrK0YcKpDGMfMWv/VQ/9dlN+5FBSBXvR0 mkEVtWOREiboR8fL0AoKbe9IBU3skVcyFWJZklbf6tNPPtt68cdIShoIat/Nt2xeH9he qiYw== X-Gm-Message-State: AOJu0Yyp21e8g8jPcrOy6hZZdHh+bR/fv3iDU35mktc7djTPlage7DxR KIe+8FIMR3AwxOZw/CE2CHSIZ/yRv/wua1WyaAGQTxkc0z7sSmTVDPWTBuWmI1T8wUT42+jpr+w 0 X-Received: by 2002:a17:906:f845:b0:a3e:8300:1af3 with SMTP id ks5-20020a170906f84500b00a3e83001af3mr3107382ejb.30.1710508228508; Fri, 15 Mar 2024 06:10:28 -0700 (PDT) Received: from m1x-phil.lan ([176.176.145.26]) by smtp.gmail.com with ESMTPSA id jl27-20020a17090775db00b00a45c9945251sm1696627ejc.192.2024.03.15.06.10.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 15 Mar 2024 06:10:28 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-riscv@nongnu.org, Anton Johansson , qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?Daniel_P_=2E_Berrang?= =?utf-8?q?=C3=A9?= , Paolo Bonzini , Eduardo Habkost , Claudio Fontana , Richard Henderson , Peter Maydell , =?utf-8?q?Alex_Benn=C3=A9e?= , Manos Pitsidianakis , Zhao Liu , qemu-arm@nongnu.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eric Blake , Marcel Apfelbaum , Yanan Wang Subject: [PATCH-for-9.1 11/21] qapi: Make CpuDefinitionInfo target agnostic Date: Fri, 15 Mar 2024 14:08:59 +0100 Message-ID: <20240315130910.15750-12-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240315130910.15750-1-philmd@linaro.org> References: <20240315130910.15750-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=philmd@linaro.org; helo=mail-ej1-x631.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Generate the CpuDefinitionInfo type once for all targets. In few commits @query-cpu-definitions will become generic and all target will return their CPUs list. Signed-off-by: Philippe Mathieu-Daudé --- qapi/machine-target.json | 69 ---------------------------------------- qapi/machine.json | 63 ++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 69 deletions(-) diff --git a/qapi/machine-target.json b/qapi/machine-target.json index 0412400df3..7480921d33 100644 --- a/qapi/machine-target.json +++ b/qapi/machine-target.json @@ -212,75 +212,6 @@ 'TARGET_LOONGARCH64', 'TARGET_RISCV' ] } } -## -# @CpuDefinitionInfo: -# -# Virtual CPU definition. -# -# @name: the name of the CPU definition -# -# @migration-safe: whether a CPU definition can be safely used for -# migration in combination with a QEMU compatibility machine when -# migrating between different QEMU versions and between hosts with -# different sets of (hardware or software) capabilities. If not -# provided, information is not available and callers should not -# assume the CPU definition to be migration-safe. (since 2.8) -# -# @static: whether a CPU definition is static and will not change -# depending on QEMU version, machine type, machine options and -# accelerator options. A static model is always migration-safe. -# (since 2.8) -# -# @unavailable-features: List of properties that prevent the CPU model -# from running in the current host. (since 2.8) -# -# @typename: Type name that can be used as argument to -# @device-list-properties, to introspect properties configurable -# using -cpu or -global. (since 2.9) -# -# @alias-of: Name of CPU model this model is an alias for. The target -# of the CPU model alias may change depending on the machine type. -# Management software is supposed to translate CPU model aliases -# in the VM configuration, because aliases may stop being -# migration-safe in the future (since 4.1) -# -# @deprecated: If true, this CPU model is deprecated and may be -# removed in in some future version of QEMU according to the QEMU -# deprecation policy. (since 5.2) -# -# @unavailable-features is a list of QOM property names that represent -# CPU model attributes that prevent the CPU from running. If the QOM -# property is read-only, that means there's no known way to make the -# CPU model run in the current host. Implementations that choose not -# to provide specific information return the property name "type". If -# the property is read-write, it means that it MAY be possible to run -# the CPU model in the current host if that property is changed. -# Management software can use it as hints to suggest or choose an -# alternative for the user, or just to generate meaningful error -# messages explaining why the CPU model can't be used. If -# @unavailable-features is an empty list, the CPU model is runnable -# using the current host and machine-type. If @unavailable-features -# is not present, runnability information for the CPU is not -# available. -# -# Since: 1.2 -## -{ 'struct': 'CpuDefinitionInfo', - 'data': { 'name': 'str', - '*migration-safe': 'bool', - 'static': 'bool', - '*unavailable-features': [ 'str' ], - 'typename': 'str', - '*alias-of' : 'str', - 'deprecated' : 'bool' }, - 'if': { 'any': [ 'TARGET_PPC', - 'TARGET_ARM', - 'TARGET_I386', - 'TARGET_S390X', - 'TARGET_MIPS', - 'TARGET_LOONGARCH64', - 'TARGET_RISCV' ] } } - ## # @query-cpu-definitions: # diff --git a/qapi/machine.json b/qapi/machine.json index 65702c2c78..9c44b8fa82 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -10,6 +10,69 @@ { 'include': 'common.json' } +## +# @CpuDefinitionInfo: +# +# Virtual CPU definition. +# +# @name: the name of the CPU definition +# +# @migration-safe: whether a CPU definition can be safely used for +# migration in combination with a QEMU compatibility machine when +# migrating between different QEMU versions and between hosts with +# different sets of (hardware or software) capabilities. If not +# provided, information is not available and callers should not +# assume the CPU definition to be migration-safe. (since 2.8) +# +# @static: whether a CPU definition is static and will not change +# depending on QEMU version, machine type, machine options and +# accelerator options. A static model is always migration-safe. +# (since 2.8) +# +# @unavailable-features: List of properties that prevent the CPU model +# from running in the current host. (since 2.8) +# +# @typename: Type name that can be used as argument to +# @device-list-properties, to introspect properties configurable +# using -cpu or -global. (since 2.9) +# +# @alias-of: Name of CPU model this model is an alias for. The target +# of the CPU model alias may change depending on the machine type. +# Management software is supposed to translate CPU model aliases +# in the VM configuration, because aliases may stop being +# migration-safe in the future (since 4.1) +# +# @deprecated: If true, this CPU model is deprecated and may be +# removed in in some future version of QEMU according to the QEMU +# deprecation policy. (since 5.2) +# +# @unavailable-features is a list of QOM property names that represent +# CPU model attributes that prevent the CPU from running. If the QOM +# property is read-only, that means there's no known way to make the +# CPU model run in the current host. Implementations that choose not +# to provide specific information return the property name "type". If +# the property is read-write, it means that it MAY be possible to run +# the CPU model in the current host if that property is changed. +# Management software can use it as hints to suggest or choose an +# alternative for the user, or just to generate meaningful error +# messages explaining why the CPU model can't be used. If +# @unavailable-features is an empty list, the CPU model is runnable +# using the current host and machine-type. If @unavailable-features +# is not present, runnability information for the CPU is not +# available. +# +# Since: 1.2 +## +{ 'struct': 'CpuDefinitionInfo', + 'data': { 'name': 'str', + '*migration-safe': 'bool', + 'static': 'bool', + '*unavailable-features': [ 'str' ], + 'typename': 'str', + '*alias-of' : 'str', + 'deprecated' : 'bool' } +} + ## # @CpuModelInfo: #