From patchwork Fri Mar 15 13:08:58 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: 780492 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp191512wrs; Fri, 15 Mar 2024 06:14:39 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUAOX7jqr82+wtSU9eRJbRvthUXYL4w1DebcnZtcptec78ld07YTvnkKEZHZhQpj4DWz3YwHECtrXh7cHQKGHRm X-Google-Smtp-Source: AGHT+IHKdOUHiRHHpsKU3EsuYca+VfBtyyWp2UWX2Q2+6++Psb8/S/E/+Ecto7jOusvrp50QWGna X-Received: by 2002:a1f:7d8b:0:b0:4d4:2176:6b6a with SMTP id y133-20020a1f7d8b000000b004d421766b6amr4873459vkc.8.1710508478823; Fri, 15 Mar 2024 06:14:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710508478; cv=none; d=google.com; s=arc-20160816; b=rb+IwJCqGLEYcfXkbE/19J1Zsl7q21shtbQNOKFBqaijibyp3fK0/YG4DsTyQOf6L4 DlRim7XrwGo30cVPQLSq9Ar+KXn8vzrKpL47TaAepGMHnjtlNZ/58uw3xrDfeRlsm4HL FL8uQVCK594za6AJY2ear3pSHKT7YptqkC9PjeUOAPdnis/wYWEm4JiizjhvExxdn22L t/Ym+UhASCbpaSpCZ4hUvHIYAFo6sTXUYs19BIiWDOyDekRANikiFhmu+bxVsT/DuEc+ 4ibZuPqtHCg+rCFuoHvk6O+8n884LFC1tiXM1A+lFnruDvmfym5gGcYFO82iyAfdZ5Ox 4zsQ== 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=juKrFHTenueZGgaczYCixm7yTPX2XVgDuiXA1GdKgho=; fh=PA7Itx6BY35wAM0XPD2z9TDGi1pstgqjn3JUvFuazwM=; b=FILAeQABAjSz8ok3WPCbU7bigBKuRnZ7bv6j29s7PZroV52J4/3CbN888yNBTDLOxF LKW6A9WlXWNwzJGdZx6TAMeVBEYEwjs2DscKvmEJ2OxXlp+IKV8s7SYcMi4wi8uD4E59 zAvolbpCPg+TFXdchSLHoTuRSi58AGb/eRWWqOBb6qgKZZd8DCBtVfXBBYDShpTAsYfG nMRActIRWjP/Jw311rd1iHU+vvdV+pWP1sOl1i5woaZ2CcPEY+LYI5fHdzohV9+DwU/1 DJU5fohkEONI7i2t+IuGcF/iZx1Ld67wgIwSjQPVCL2ua36ykmhQFFzOH4di+xIPphlG ONLQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nvfjlwjp; 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 n14-20020ac5c88e000000b004d40884cb62si476567vkl.162.2024.03.15.06.14.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Mar 2024 06:14:38 -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=nvfjlwjp; 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 1rl7LL-0001Wl-1g; Fri, 15 Mar 2024 09:11:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rl7KT-00079Z-AL for qemu-devel@nongnu.org; Fri, 15 Mar 2024 09:10:34 -0400 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rl7KJ-000836-TT for qemu-devel@nongnu.org; Fri, 15 Mar 2024 09:10:32 -0400 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-513cfd48224so2914829e87.2 for ; Fri, 15 Mar 2024 06:10:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710508222; x=1711113022; 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=juKrFHTenueZGgaczYCixm7yTPX2XVgDuiXA1GdKgho=; b=nvfjlwjpj1j6AGq1kErWVZXNMSIghtLCXx8EqZADOAVKOwYClTex9UNbeeJW8EthQy xT01/1h+LZMIN61eu2D+NA3vkmbWeS81w2WoJF79CRfA6N16ROrilpzHZhMkxvK/MjGg zez1N+rT33T15Gyn+wIwzKtFdmrndHfllg0mxY6NniCbXEcShuLFXO/dPbdRiVPNtumU U9egae0Mkt9vdfB/Qcop8cHfpJrZMOBpv9Xb1zbRH39o03HaQH7/UZQpKMizlHo4qo3E IhjUYSJ+Dudx8pp+4qIw+4K5lmpfQgvN6XZdHfBy6L9++mLPAPIwqancZV9/IPHbcXWW k0sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710508222; x=1711113022; 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=juKrFHTenueZGgaczYCixm7yTPX2XVgDuiXA1GdKgho=; b=THTh51O4jwuLo7pQfTwqAlta/Bd0Cj60VAhHbqIf/RK9mjbEYhtZrBA+/m+/l2XOoz wvFVWhA5i7QfB7TU5h9C+u1ZX+vLmKzVoLbXQVHN7l4Q+bccw1Knn6q5k7YuMWvx0CAQ 5So2uozf2jJZPrNSlPGd6KSU8XSSIvOcLZnwtEjnNcEc7dC5qq+VKHWPfOeH24SDy7T4 iKjdswt6EFiVpxptzfKzZ63Gh3NRuAJOWSAfMnZ+ML0eOeeikoxtc9IokzVw7dK23kK4 K0uDNx0+S50BpggjH8/Oo8222AEpE/qHet82IjtqO926XxjOzQNyDaYP9twCYBPQ4Uoi kOag== X-Gm-Message-State: AOJu0YyaQve91zbuyoUpzd7JWF8ow8XTUQg0a0OJyMTYZhVBOSRt9qq8 DSIOyp6+175iChpqWAUqCGhFkundFrctq8aM9JYJ9aMthDpsmllJf602Ud5qUi4egoektvlPKIq M X-Received: by 2002:a19:f807:0:b0:513:2bea:d0e0 with SMTP id a7-20020a19f807000000b005132bead0e0mr2965749lff.62.1710508221669; Fri, 15 Mar 2024 06:10:21 -0700 (PDT) Received: from m1x-phil.lan ([176.176.145.26]) by smtp.gmail.com with ESMTPSA id s11-20020a170906bc4b00b00a4671d37717sm1605908ejv.52.2024.03.15.06.10.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 15 Mar 2024 06:10:21 -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 10/21] qapi: Make CpuModel* definitions target agnostic Date: Fri, 15 Mar 2024 14:08:58 +0100 Message-ID: <20240315130910.15750-11-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::12f; envelope-from=philmd@linaro.org; helo=mail-lf1-x12f.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 CpuModelInfo, CpuModelExpansionType and CpuModelCompareResult are not restricted to any particular target. Define them in machine.json to generate them once. Signed-off-by: Philippe Mathieu-Daudé --- qapi/machine-target.json | 78 --------------------------------------- qapi/machine.json | 79 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+), 78 deletions(-) diff --git a/qapi/machine-target.json b/qapi/machine-target.json index 5f17b25d50..0412400df3 100644 --- a/qapi/machine-target.json +++ b/qapi/machine-target.json @@ -6,84 +6,6 @@ { 'include': 'machine.json' } -## -# @CpuModelInfo: -# -# Virtual CPU model. -# -# A CPU model consists of the name of a CPU definition, to which delta -# changes are applied (e.g. features added/removed). Most magic values -# that an architecture might require should be hidden behind the name. -# However, if required, architectures can expose relevant properties. -# -# @name: the name of the CPU definition the model is based on -# -# @props: a dictionary of QOM properties to be applied -# -# Since: 2.8 -## -{ 'struct': 'CpuModelInfo', - 'data': { 'name': 'str', - '*props': 'any' } } - -## -# @CpuModelExpansionType: -# -# An enumeration of CPU model expansion types. -# -# @static: Expand to a static CPU model, a combination of a static -# base model name and property delta changes. As the static base -# model will never change, the expanded CPU model will be the -# same, independent of QEMU version, machine type, machine -# options, and accelerator options. Therefore, the resulting -# model can be used by tooling without having to specify a -# compatibility machine - e.g. when displaying the "host" model. -# The @static CPU models are migration-safe. -# -# @full: Expand all properties. The produced model is not guaranteed -# to be migration-safe, but allows tooling to get an insight and -# work with model details. -# -# Note: When a non-migration-safe CPU model is expanded in static -# mode, some features enabled by the CPU model may be omitted, -# because they can't be implemented by a static CPU model -# definition (e.g. cache info passthrough and PMU passthrough in -# x86). If you need an accurate representation of the features -# enabled by a non-migration-safe CPU model, use @full. If you -# need a static representation that will keep ABI compatibility -# even when changing QEMU version or machine-type, use @static -# (but keep in mind that some features may be omitted). -# -# Since: 2.8 -## -{ 'enum': 'CpuModelExpansionType', - 'data': [ 'static', 'full' ] } - -## -# @CpuModelCompareResult: -# -# An enumeration of CPU model comparison results. The result is -# usually calculated using e.g. CPU features or CPU generations. -# -# @incompatible: If model A is incompatible to model B, model A is not -# guaranteed to run where model B runs and the other way around. -# -# @identical: If model A is identical to model B, model A is -# guaranteed to run where model B runs and the other way around. -# -# @superset: If model A is a superset of model B, model B is -# guaranteed to run where model A runs. There are no guarantees -# about the other way. -# -# @subset: If model A is a subset of model B, model A is guaranteed to -# run where model B runs. There are no guarantees about the other -# way. -# -# Since: 2.8 -## -{ 'enum': 'CpuModelCompareResult', - 'data': [ 'incompatible', 'identical', 'superset', 'subset' ] } - ## # @CpuModelBaselineInfo: # diff --git a/qapi/machine.json b/qapi/machine.json index 4bc38e86fd..65702c2c78 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -10,6 +10,85 @@ { 'include': 'common.json' } +## +# @CpuModelInfo: +# +# Virtual CPU model. +# +# A CPU model consists of the name of a CPU definition, to which delta +# changes are applied (e.g. features added/removed). Most magic values +# that an architecture might require should be hidden behind the name. +# However, if required, architectures can expose relevant properties. +# +# @name: the name of the CPU definition the model is based on +# +# @props: a dictionary of QOM properties to be applied +# +# Since: 2.8 +## +{ 'struct': 'CpuModelInfo', + 'data': { 'name': 'str', + '*props': 'any' } +} + +## +# @CpuModelExpansionType: +# +# An enumeration of CPU model expansion types. +# +# @static: Expand to a static CPU model, a combination of a static +# base model name and property delta changes. As the static base +# model will never change, the expanded CPU model will be the +# same, independent of QEMU version, machine type, machine +# options, and accelerator options. Therefore, the resulting +# model can be used by tooling without having to specify a +# compatibility machine - e.g. when displaying the "host" model. +# The @static CPU models are migration-safe. +# +# @full: Expand all properties. The produced model is not guaranteed +# to be migration-safe, but allows tooling to get an insight and +# work with model details. +# +# Note: When a non-migration-safe CPU model is expanded in static +# mode, some features enabled by the CPU model may be omitted, +# because they can't be implemented by a static CPU model +# definition (e.g. cache info passthrough and PMU passthrough in +# x86). If you need an accurate representation of the features +# enabled by a non-migration-safe CPU model, use @full. If you +# need a static representation that will keep ABI compatibility +# even when changing QEMU version or machine-type, use @static +# (but keep in mind that some features may be omitted). +# +# Since: 2.8 +## +{ 'enum': 'CpuModelExpansionType', + 'data': [ 'static', 'full' ] } + +## +# @CpuModelCompareResult: +# +# An enumeration of CPU model comparison results. The result is +# usually calculated using e.g. CPU features or CPU generations. +# +# @incompatible: If model A is incompatible to model B, model A is not +# guaranteed to run where model B runs and the other way around. +# +# @identical: If model A is identical to model B, model A is +# guaranteed to run where model B runs and the other way around. +# +# @superset: If model A is a superset of model B, model B is +# guaranteed to run where model A runs. There are no guarantees +# about the other way. +# +# @subset: If model A is a subset of model B, model A is guaranteed to +# run where model B runs. There are no guarantees about the other +# way. +# +# Since: 2.8 +## +{ 'enum': 'CpuModelCompareResult', + 'data': [ 'incompatible', 'identical', 'superset', 'subset' ] } + ## # @SysEmuTarget: #