From nobody Sat May 4 14:46:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590419344; cv=none; d=zohomail.com; s=zohoarc; b=QXdknm39HBELtirTBYjLyBivjHvkjRa0/KEf0hN9gXVT2Ny1XFz+9a06b3gigY7d8++QY6UCf1bGJY/+snWVfDMSzN2vZuqBB9aEfgqBMcQwJjJN3ZSc0A8KXV+2dTo2Tp0ggx1KEqKV1QbalnA4FXtEuZp7djwQ3WHD8LCeRGU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590419344; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=tb28TaMe2UAwfHSd9/zVdbHeMkOyBwbsrrxB9W155y4=; b=OOdOkMQKklELTTGVDP4R4NXaS6oXU44DflQAZVBMWP3igMoFbSNH0Y/F8VhmdDLKWzH2wAQzyHT/UFyz/m8tb8/G0aJVcMay7wdXn/x01cA38Hsk/SSaBV2Gq3185XeyH19UIUSbwDH74IXl9dqmefHMhxRJ6SAuqz6WtDNg1vo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590419344848854.0718959436273; Mon, 25 May 2020 08:09:04 -0700 (PDT) Received: from localhost ([::1]:57762 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdEit-0006lc-Fy for importer@patchew.org; Mon, 25 May 2020 11:09:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54084) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdEgp-00059I-DD for qemu-devel@nongnu.org; Mon, 25 May 2020 11:06:55 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:46080 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jdEgo-0006e9-4P for qemu-devel@nongnu.org; Mon, 25 May 2020 11:06:55 -0400 Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-399-8M35ZbWZP8uyWSA2Bkn0Zg-1; Mon, 25 May 2020 11:06:52 -0400 Received: by mail-ej1-f69.google.com with SMTP id f17so6418191ejc.7 for ; Mon, 25 May 2020 08:06:51 -0700 (PDT) Received: from x1w.redhat.com (71.red-88-21-204.staticip.rima-tde.net. [88.21.204.71]) by smtp.gmail.com with ESMTPSA id g13sm13999111ejh.119.2020.05.25.08.06.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 May 2020 08:06:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590419213; 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=tb28TaMe2UAwfHSd9/zVdbHeMkOyBwbsrrxB9W155y4=; b=aQ1W75TSEcEkEjOYL7qEQ2r1LnCXu8fpcVCQq5paQw4ygWyE+nUG5USW2lpJJaULRmJ+Bi F2daoabON3YBsBU8Get13w7gkXELuf6+LgVdAekYU7qme2ElRJ9GUmnw9gm+KIY1gufc5F jnrZUhj5jrW+2PcfObsmjDl/ObRBfOc= X-MC-Unique: 8M35ZbWZP8uyWSA2Bkn0Zg-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=tb28TaMe2UAwfHSd9/zVdbHeMkOyBwbsrrxB9W155y4=; b=NnlWkmW18hTqU7WXwzopzJS5WFZxmsqKmMHhPOS90yRmsH60hSMU+QOF5UNE8YJ7rx Hx7Zewq71IeR/6gVbigWOXaIbcuYRW+W1GZhGnaiHM55Kh4QNEVhUk1UDrlqptfyuELT iygdolKUSA2ktLaC9sOOPzOHD83BmPrA7iqCHx0OFS1jYfXR58GPDHpxWGIF+L4Oj6so GdfUY4CTaCnN8fp8jo2t+drrJlENVoQSq41UTEcmc95/P4pGPkiVRgC8CjMKDt5HH/gr TTdK0BEDt7Tx34So38CyeroD7umk+SMMRZv5FGTTstD2Yx24R8pV2n8fNzD7pbtR4rqL 6cYg== X-Gm-Message-State: AOAM533vPhHrpfyCtYLuBXPfftrMiGzDdC4SWm6szZL1TiMcI1rxtkDC PXoI2mMEc5NUewVDjSADrQrms9gf2IQGGVGB84OJzIu9VMC0V6QLifeE5eDzUB3O/l57jKq774x nKghgKV2f3KyMTlw= X-Received: by 2002:a17:906:379b:: with SMTP id n27mr18639528ejc.432.1590419210430; Mon, 25 May 2020 08:06:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWkHNG++T3Jx8Ry6IMruCGNIeXnCrZPXBckZZRoes0Du5j+ZwaTMDMrTAG6ilGYJ21T6GP2A== X-Received: by 2002:a17:906:379b:: with SMTP id n27mr18639485ejc.432.1590419210083; Mon, 25 May 2020 08:06:50 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v3 1/9] target/i386: Restrict X86CPUFeatureWord to X86 targets Date: Mon, 25 May 2020 17:06:32 +0200 Message-Id: <20200525150640.30879-2-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200525150640.30879-1-philmd@redhat.com> References: <20200525150640.30879-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.120; envelope-from=philmd@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/25 08:28:26 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Ben Warren , David Hildenbrand , Markus Armbruster , "Michael S. Tsirkin" , Peter Lieven , "Dr. David Alan Gilbert" , Eduardo Habkost , Max Reitz , Richard Henderson , Ronnie Sahlberg , Igor Mammedov , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Move out x86-specific structures from generic machine code. Acked-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- qapi/machine-target.json | 45 ++++++++++++++++++++++++++++++++++++++ qapi/machine.json | 42 ----------------------------------- target/i386/cpu.c | 2 +- target/i386/machine-stub.c | 22 +++++++++++++++++++ target/i386/Makefile.objs | 3 ++- 5 files changed, 70 insertions(+), 44 deletions(-) create mode 100644 target/i386/machine-stub.c diff --git a/qapi/machine-target.json b/qapi/machine-target.json index f2c82949d8..fb7a4b7850 100644 --- a/qapi/machine-target.json +++ b/qapi/machine-target.json @@ -3,6 +3,51 @@ # This work is licensed under the terms of the GNU GPL, version 2 or later. # See the COPYING file in the top-level directory. =20 +## +# @X86CPURegister32: +# +# A X86 32-bit register +# +# Since: 1.5 +## +{ 'enum': 'X86CPURegister32', + 'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ], + 'if': 'defined(TARGET_I386)' } + +## +# @X86CPUFeatureWordInfo: +# +# Information about a X86 CPU feature word +# +# @cpuid-input-eax: Input EAX value for CPUID instruction for that feature= word +# +# @cpuid-input-ecx: Input ECX value for CPUID instruction for that +# feature word +# +# @cpuid-register: Output register containing the feature bits +# +# @features: value of output register, containing the feature bits +# +# Since: 1.5 +## +{ 'struct': 'X86CPUFeatureWordInfo', + 'data': { 'cpuid-input-eax': 'int', + '*cpuid-input-ecx': 'int', + 'cpuid-register': 'X86CPURegister32', + 'features': 'int' }, + 'if': 'defined(TARGET_I386)' } + +## +# @DummyForceArrays: +# +# Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally +# +# Since: 2.5 +## +{ 'struct': 'DummyForceArrays', + 'data': { 'unused': ['X86CPUFeatureWordInfo'] }, + 'if': 'defined(TARGET_I386)' } + ## # @CpuModelInfo: # diff --git a/qapi/machine.json b/qapi/machine.json index ff7b5032e3..1fe31d374c 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -511,48 +511,6 @@ 'dst': 'uint16', 'val': 'uint8' }} =20 -## -# @X86CPURegister32: -# -# A X86 32-bit register -# -# Since: 1.5 -## -{ 'enum': 'X86CPURegister32', - 'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] } - -## -# @X86CPUFeatureWordInfo: -# -# Information about a X86 CPU feature word -# -# @cpuid-input-eax: Input EAX value for CPUID instruction for that feature= word -# -# @cpuid-input-ecx: Input ECX value for CPUID instruction for that -# feature word -# -# @cpuid-register: Output register containing the feature bits -# -# @features: value of output register, containing the feature bits -# -# Since: 1.5 -## -{ 'struct': 'X86CPUFeatureWordInfo', - 'data': { 'cpuid-input-eax': 'int', - '*cpuid-input-ecx': 'int', - 'cpuid-register': 'X86CPURegister32', - 'features': 'int' } } - -## -# @DummyForceArrays: -# -# Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally -# -# Since: 2.5 -## -{ 'struct': 'DummyForceArrays', - 'data': { 'unused': ['X86CPUFeatureWordInfo'] } } - ## # @NumaCpuOptions: # diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 7a4a8e3847..832498c723 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -37,7 +37,7 @@ #include "qemu/option.h" #include "qemu/config-file.h" #include "qapi/error.h" -#include "qapi/qapi-visit-machine.h" +#include "qapi/qapi-visit-machine-target.h" #include "qapi/qapi-visit-run-state.h" #include "qapi/qmp/qdict.h" #include "qapi/qmp/qerror.h" diff --git a/target/i386/machine-stub.c b/target/i386/machine-stub.c new file mode 100644 index 0000000000..cb301af057 --- /dev/null +++ b/target/i386/machine-stub.c @@ -0,0 +1,22 @@ +/* + * QAPI x86 CPU features stub + * + * Copyright (c) 2020 Red Hat, Inc. + * + * Author: + * Philippe Mathieu-Daud=C3=A9 + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "qapi/qapi-visit-machine-target.h" + +void visit_type_X86CPUFeatureWordInfoList(Visitor *v, const char *name, + X86CPUFeatureWordInfoList **obj, + Error **errp) +{ +} diff --git a/target/i386/Makefile.objs b/target/i386/Makefile.objs index 48e0c28434..1cdfc9f50c 100644 --- a/target/i386/Makefile.objs +++ b/target/i386/Makefile.objs @@ -17,6 +17,7 @@ obj-$(CONFIG_HAX) +=3D hax-all.o hax-mem.o hax-posix.o endif obj-$(CONFIG_HVF) +=3D hvf/ obj-$(CONFIG_WHPX) +=3D whpx-all.o -endif +endif # CONFIG_SOFTMMU obj-$(CONFIG_SEV) +=3D sev.o obj-$(call lnot,$(CONFIG_SEV)) +=3D sev-stub.o +obj-$(call lnot,$(CONFIG_SOFTMMU)) +=3D machine-stub.o --=20 2.21.3 From nobody Sat May 4 14:46:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590419490; cv=none; d=zohomail.com; s=zohoarc; b=P7elzHJEYvTiLRC/NVqyhMFlVTO7fALSwdfY/Qv2igSSU8DVyzz/N8W+v3CEzh03djtMbHcp6kGOvNPUZtTnTeUSYLXWceeG6hvh4rQYoFqtErdfKxW2R7AMNtqnlijRIvcAbiYrOuG9PftZ55TZ4zCLgPKyakKuwxOQ0zwpNdc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590419490; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=bhbiaGeyOZtfxUrFs0y2evFWTskfzhbIggYBhtmEIh4=; b=IfFWHSTb32jLO+q/dZKm3UsYfiSV//I+joWt/EwahiZnTy9wxGv/Zau0iWs7hY7e6u9S3U9Ayp5/i8TvFjg7wrDbZZcXGn5H4VaKAA09oXfmFxjGE3culLQLNPQ17lMmVSOFhewv49j93N7WWmjmPoB0I93/53wv9vykoFxIdcY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590419490183199.74439740336834; Mon, 25 May 2020 08:11:30 -0700 (PDT) Received: from localhost ([::1]:37994 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdElD-0002TL-Fd for importer@patchew.org; Mon, 25 May 2020 11:11:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54092) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdEgu-0005IT-HU for qemu-devel@nongnu.org; Mon, 25 May 2020 11:07:00 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:51667 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jdEgt-0006fd-Iz for qemu-devel@nongnu.org; Mon, 25 May 2020 11:07:00 -0400 Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-271-8U0aNm0zO_yyWMeS8GXg_A-1; Mon, 25 May 2020 11:06:57 -0400 Received: by mail-ej1-f72.google.com with SMTP id pj20so6451662ejb.3 for ; Mon, 25 May 2020 08:06:57 -0700 (PDT) Received: from x1w.redhat.com (71.red-88-21-204.staticip.rima-tde.net. [88.21.204.71]) by smtp.gmail.com with ESMTPSA id l11sm15933206edw.55.2020.05.25.08.06.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 May 2020 08:06:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590419219; 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=bhbiaGeyOZtfxUrFs0y2evFWTskfzhbIggYBhtmEIh4=; b=Vq8TqF+EK+7iyvlGipcCeLsxd3MbONpBw7KW5tFFWmWfTopPVmOKKI5YngA7wazQLqPKr/ z9RBUuG/LEBiE9fckzDCdgoBMglSf7V7kCFCjjT6J1Msz9xFve9j3IF90xyAtij2b6bcoc Sbz5od0cffGRF/hv6R4S5sVjwlqhCJM= X-MC-Unique: 8U0aNm0zO_yyWMeS8GXg_A-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=bhbiaGeyOZtfxUrFs0y2evFWTskfzhbIggYBhtmEIh4=; b=RQ8C/YFEHjaumcBEKnI4qfDH/h0yT/jLTa+NWgk6bbEE02qQCpN3d3xeYaz5RHH2py 7ZP42qdwjoY/diRNq/3g+zRVGTWMYbKOkmPk3fosa1XqDxJ6xMkinUU/rt/STeK70GB+ Pc71wjI/AskD9zUtASnzSpkQAjrfi7hUT2lrtSxIYCP4mi1HLfnMh2rUZIbfX9nzpaYo O1RlBYiE4s/RKm0WniXfuNP3zNQP8I0Q4XGVhJOCnDwcaZ+w+eu4I6RWEhAig5D+QJsZ ULlHNmH2ixN6Rym4bEgfse/T2w/7MPS/DfJxFrOAyzEaAtXODjXy4X0vLYxRGu/DJ9uJ sokA== X-Gm-Message-State: AOAM532GYRo3LT03nx7dwE2x2Osd0Ro448FytYRy4IfDJ8ePH/2jLlP9 Agnbp9vEFevcAuWad8WbJ4ZisnnHpS6xvOQ8ga+OJV0+rZpTNhq96kCprWVV5AME1OMv9NVjeGA zDwM/0YssyuDTNEs= X-Received: by 2002:a05:6402:74b:: with SMTP id p11mr15980622edy.229.1590419216134; Mon, 25 May 2020 08:06:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvhJpAjrRfrPSZwdTOZC8MoK+C+sa55Wt4PJCaq4WMkmLvzC4IP1N1ijqlXxjpvvMRUhRupA== X-Received: by 2002:a05:6402:74b:: with SMTP id p11mr15980592edy.229.1590419215906; Mon, 25 May 2020 08:06:55 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v3 2/9] qapi/misc: Restrict LostTickPolicy enum to machine code Date: Mon, 25 May 2020 17:06:33 +0200 Message-Id: <20200525150640.30879-3-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200525150640.30879-1-philmd@redhat.com> References: <20200525150640.30879-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.120; envelope-from=philmd@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/25 08:28:26 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Ben Warren , David Hildenbrand , Markus Armbruster , "Michael S. Tsirkin" , Peter Lieven , "Dr. David Alan Gilbert" , Eduardo Habkost , Max Reitz , Ronnie Sahlberg , Igor Mammedov , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Markus Armbruster --- qapi/machine.json | 32 ++++++++++++++++++++++++++++++++ qapi/misc.json | 32 -------------------------------- include/hw/rtc/mc146818rtc.h | 2 +- hw/core/qdev-properties.c | 1 + hw/i386/kvm/i8254.c | 2 +- 5 files changed, 35 insertions(+), 34 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json index 1fe31d374c..ca7d58f0c9 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -421,6 +421,38 @@ ## { 'command': 'query-target', 'returns': 'TargetInfo' } =20 +## +# @LostTickPolicy: +# +# Policy for handling lost ticks in timer devices. Ticks end up getting +# lost when, for example, the guest is paused. +# +# @discard: throw away the missed ticks and continue with future injection +# normally. The guest OS will see the timer jump ahead by a +# potentially quite significant amount all at once, as if the +# intervening chunk of time had simply not existed; needless to +# say, such a sudden jump can easily confuse a guest OS which is +# not specifically prepared to deal with it. Assuming the guest +# OS can deal correctly with the time jump, the time in the guest +# and in the host should now match. +# +# @delay: continue to deliver ticks at the normal rate. The guest OS will +# not notice anything is amiss, as from its point of view time will +# have continued to flow normally. The time in the guest should n= ow +# be behind the time in the host by exactly the amount of time dur= ing +# which ticks have been missed. +# +# @slew: deliver ticks at a higher rate to catch up with the missed ticks. +# The guest OS will not notice anything is amiss, as from its point +# of view time will have continued to flow normally. Once the timer +# has managed to catch up with all the missing ticks, the time in +# the guest and in the host should match. +# +# Since: 2.0 +## +{ 'enum': 'LostTickPolicy', + 'data': ['discard', 'delay', 'slew' ] } + ## # @NumaOptionsType: # diff --git a/qapi/misc.json b/qapi/misc.json index 99b90ac80b..2c48ffaa62 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -7,38 +7,6 @@ =20 { 'include': 'common.json' } =20 -## -# @LostTickPolicy: -# -# Policy for handling lost ticks in timer devices. Ticks end up getting -# lost when, for example, the guest is paused. -# -# @discard: throw away the missed ticks and continue with future injection -# normally. The guest OS will see the timer jump ahead by a -# potentially quite significant amount all at once, as if the -# intervening chunk of time had simply not existed; needless to -# say, such a sudden jump can easily confuse a guest OS which is -# not specifically prepared to deal with it. Assuming the guest -# OS can deal correctly with the time jump, the time in the guest -# and in the host should now match. -# -# @delay: continue to deliver ticks at the normal rate. The guest OS will -# not notice anything is amiss, as from its point of view time will -# have continued to flow normally. The time in the guest should n= ow -# be behind the time in the host by exactly the amount of time dur= ing -# which ticks have been missed. -# -# @slew: deliver ticks at a higher rate to catch up with the missed ticks. -# The guest OS will not notice anything is amiss, as from its point -# of view time will have continued to flow normally. Once the timer -# has managed to catch up with all the missing ticks, the time in -# the guest and in the host should match. -# -# Since: 2.0 -## -{ 'enum': 'LostTickPolicy', - 'data': ['discard', 'delay', 'slew' ] } - ## # @add_client: # diff --git a/include/hw/rtc/mc146818rtc.h b/include/hw/rtc/mc146818rtc.h index 3713181b56..9cd04f379a 100644 --- a/include/hw/rtc/mc146818rtc.h +++ b/include/hw/rtc/mc146818rtc.h @@ -9,7 +9,7 @@ #ifndef HW_RTC_MC146818RTC_H #define HW_RTC_MC146818RTC_H =20 -#include "qapi/qapi-types-misc.h" +#include "qapi/qapi-types-machine.h" #include "qemu/queue.h" #include "qemu/timer.h" #include "hw/isa/isa.h" diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index cc924815da..dacf91c877 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -4,6 +4,7 @@ #include "qapi/error.h" #include "hw/pci/pci.h" #include "qapi/qapi-types-block.h" +#include "qapi/qapi-types-machine.h" #include "qapi/qapi-types-misc.h" #include "qapi/qmp/qerror.h" #include "qemu/ctype.h" diff --git a/hw/i386/kvm/i8254.c b/hw/i386/kvm/i8254.c index 876f5aa6fa..22ba6149b5 100644 --- a/hw/i386/kvm/i8254.c +++ b/hw/i386/kvm/i8254.c @@ -25,7 +25,7 @@ =20 #include "qemu/osdep.h" #include -#include "qapi/qapi-types-misc.h" +#include "qapi/qapi-types-machine.h" #include "qapi/error.h" #include "qemu/module.h" #include "qemu/timer.h" --=20 2.21.3 From nobody Sat May 4 14:46:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590419374; cv=none; d=zohomail.com; s=zohoarc; b=eYbnuu2oqw3E+B7ETnUBX0t/mwjN/RugAj9fJfZ1kG2t9p+HvBh6pEJ4QuowWmEKttvZ4V3sm+2v3hedEVOGAikcNtpM74HwRm3k29vrSVhibm0QuQ2GTfOGx5tSapw7uQ+oSq9fZC7tW9xJBgPG3740AC2MHdeLc/zHXgfXQ84= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590419374; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=MQWYf2QYcqkNIHTPoPqPd3tJF9br/Kx677vEgu609W8=; b=oEWsPtIsQSPi+6QotmUjz0WDPDmIzAk+9e6fZiTCpau/egDIQG3eTrU/vbaRfZ6io4zU97gjdGDPDKjWi5naymcyHVrHj1rsFuYrIoXi/8aLUMWJfU7zHA8iwcyvn7C4h3ku3XnV9x96P232JSCAyPO8ULcaT9RXeXGDjSI1rKo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590419374235267.47998224672426; Mon, 25 May 2020 08:09:34 -0700 (PDT) Received: from localhost ([::1]:59048 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdEjN-0007JO-1l for importer@patchew.org; Mon, 25 May 2020 11:09:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54128) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdEh2-0005XE-EZ for qemu-devel@nongnu.org; Mon, 25 May 2020 11:07:08 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:36768 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jdEh1-0006hf-KN for qemu-devel@nongnu.org; Mon, 25 May 2020 11:07:08 -0400 Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-423-jh9kXP0HOzG1G2IJbjJbgQ-1; Mon, 25 May 2020 11:07:03 -0400 Received: by mail-ej1-f72.google.com with SMTP id s13so6379623ejc.18 for ; Mon, 25 May 2020 08:07:03 -0700 (PDT) Received: from x1w.redhat.com (71.red-88-21-204.staticip.rima-tde.net. [88.21.204.71]) by smtp.gmail.com with ESMTPSA id y13sm15544110ejm.107.2020.05.25.08.07.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 May 2020 08:07:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590419227; 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=MQWYf2QYcqkNIHTPoPqPd3tJF9br/Kx677vEgu609W8=; b=eb6Ju+8FLKlOXVpCihRdXAqRVO6tACGqR82FB7+ITVc2hUoLnioRgUCerKQ1I6Z5UFYYV6 DslNpGPg5Rz67X563eTTq6U+pF1G97huTRBGEwXfhEczjC5hhZlzcKsLwQOc1KlJIt5C1e r9xRzTnHUH+SRQNB0wcnffXC5XpssuY= X-MC-Unique: jh9kXP0HOzG1G2IJbjJbgQ-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=MQWYf2QYcqkNIHTPoPqPd3tJF9br/Kx677vEgu609W8=; b=CZNJj1MEIeGHeZBcI6QdNLJB8lpGnmDp7rpzoyaABlB8lGQMr2/ASIBigaD2uIAtJL CZxYltUHMBpG+v95B7C6ru3s+KUUbrOhtJNvCl89a6xLaq1oaVMjjxnUXn6qjm0h7saX iY7ZJWW4sal1FKJlYx/e7/0+MxdvMWm72gGsJ14aIrNHg7QWQbiRwcyo7bMo/cK1orRt OFMHvsby2GWcrEaWLKSMyu6iy06nCGRG4KoP/d496rDe9q0rYw1M/hKoy3apLbV0+hgd 4QtsUhzmr0wn3Z78VFAUcy9hi8A/sRlxo+l1fWSm4w7Cj7R6dNrVha5irSpWghsV4X/i ozrA== X-Gm-Message-State: AOAM533Ov4UdaMvyJiZnWnopoFhYJeAtQxdkQ6fe3OEqUIzKhYf0dvC1 mve4WWBubn615Uqlq0UBRrGPvBY9jaY+qOwx7vgWf9+ToFdXfD+qbZp2xP+moFHxrwyObhAichh FpOZRhxByrr/T0RA= X-Received: by 2002:a17:906:d86:: with SMTP id m6mr20137740eji.434.1590419222213; Mon, 25 May 2020 08:07:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiLti9ujl8zPGB3BoWaIdOxK2Mxmt4QWp+2GEsLKO7ZN/1WHhN/x7yMWjaYTOPSjCoeELqnQ== X-Received: by 2002:a17:906:d86:: with SMTP id m6mr20137701eji.434.1590419221912; Mon, 25 May 2020 08:07:01 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v3 3/9] qapi/misc.json: Correct balloon documentation Date: Mon, 25 May 2020 17:06:34 +0200 Message-Id: <20200525150640.30879-4-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200525150640.30879-1-philmd@redhat.com> References: <20200525150640.30879-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.120; envelope-from=philmd@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/25 08:28:26 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Ben Warren , David Hildenbrand , Markus Armbruster , "Michael S. Tsirkin" , Peter Lieven , "Dr. David Alan Gilbert" , Eduardo Habkost , Max Reitz , Ronnie Sahlberg , Igor Mammedov , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The documentation incorrectly uses the "size of the balloon" description when it should be "logical size of the VM". Fix it. The relation between both values is: logical_vm_size =3D vm_ram_size - balloon_size Reported-by: David Hildenbrand Suggested-by: David Hildenbrand Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: David Hildenbrand --- qapi/misc.json | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/qapi/misc.json b/qapi/misc.json index 2c48ffaa62..446fc8ff83 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -191,7 +191,8 @@ # # Information about the guest balloon device. # -# @actual: the number of bytes the balloon currently contains +# @actual: the logical size of the VM in bytes +# Formula used: logical_vm_size =3D vm_ram_size - balloon_size # # Since: 0.14.0 # @@ -227,7 +228,8 @@ # Emitted when the guest changes the actual BALLOON level. This value is # equivalent to the @actual field return by the 'query-balloon' command # -# @actual: actual level of the guest memory balloon in bytes +# @actual: the logical size of the VM in bytes +# Formula used: logical_vm_size =3D vm_ram_size - balloon_size # # Note: this event is rate-limited. # @@ -756,7 +758,10 @@ # # Request the balloon driver to change its balloon size. # -# @value: the target size of the balloon in bytes +# @value: the target logical size of the VM in bytes +# We can deduce the size of the balloon using this formula: +# logical_vm_size =3D vm_ram_size - balloon_size +# From it we have: balloon_size =3D vm_ram_size - @value # # Returns: - Nothing on success # - If the balloon driver is enabled but not functional because t= he KVM @@ -774,6 +779,8 @@ # -> { "execute": "balloon", "arguments": { "value": 536870912 } } # <- { "return": {} } # +# With a 2.5GiB guest this command inflated the ballon to 3GiB. +# ## { 'command': 'balloon', 'data': {'value': 'int'} } =20 --=20 2.21.3 From nobody Sat May 4 14:46:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590419653; cv=none; d=zohomail.com; s=zohoarc; b=Cz757oo1aUFsZNjqZijYaFEwzW3Qe4TyjOhHevwGNizWnDrZwfh+POQu2afMCR3Umnhir/7dtPEW6GAS5OTWfLwc/SuypVVRGkDnkMjpCJw3DEtUxX3VSccFNFXdqOdrEsvar699cRmJCzIwKkVELFYaB+0JgOawcY3d1Ginriw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590419653; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3Fp5IE9q19WHuKjT5ra7LTNsYPjlLKFjw0nHzkRyPE4=; b=GN6sBzA9VpLuUTQx7rgaA2xz/HKaCkl6mEVHr022Wdz2MZaqrZwRQLNtBat8TUtIy7ggmyiX7H1SQL/ck03itbmZXJHLQ6KfLrc6hcxMw4oJBg+umt+dlrY50gsitjYdNUawfJMnz/pYqRIlNr3RL1SHEP++AS9rjYaMuJ2/SOQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590419653111328.8536789326207; Mon, 25 May 2020 08:14:13 -0700 (PDT) Received: from localhost ([::1]:45712 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdEnr-0005j2-IS for importer@patchew.org; Mon, 25 May 2020 11:14:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54162) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdEh7-0005ct-Dn for qemu-devel@nongnu.org; Mon, 25 May 2020 11:07:13 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:59740 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jdEh6-0006jC-6l for qemu-devel@nongnu.org; Mon, 25 May 2020 11:07:13 -0400 Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-228-0xxLQKKWMf21ioPBFcAS5g-1; Mon, 25 May 2020 11:07:10 -0400 Received: by mail-ej1-f69.google.com with SMTP id nw19so6424756ejb.10 for ; Mon, 25 May 2020 08:07:09 -0700 (PDT) Received: from x1w.redhat.com (71.red-88-21-204.staticip.rima-tde.net. [88.21.204.71]) by smtp.gmail.com with ESMTPSA id zk10sm15742658ejb.9.2020.05.25.08.07.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 May 2020 08:07:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590419231; 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=3Fp5IE9q19WHuKjT5ra7LTNsYPjlLKFjw0nHzkRyPE4=; b=f43K6+SHjGBI6iqPtPQHnjNdZUgIRK2UpABCk27f/Z4y6mEFBzRjmwS9Er0H5hR+pCwkxO dQ0XsGKPiUnZdfO216bESUSDo+Unm1OFIGCeVjWyEeuoRmw78ST/UIZTbq+XHCJenGgkYf v8ke/TUuITfz6PD+u+FnyK6FS/5M3yk= X-MC-Unique: 0xxLQKKWMf21ioPBFcAS5g-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=3Fp5IE9q19WHuKjT5ra7LTNsYPjlLKFjw0nHzkRyPE4=; b=tiuQWqLZKX8B4OM4YdXqybz1jkmi2xGUKqdbrjnIpz8ZStOeB3oeJZY/sbgLxVCnIg D81ewCikxw+XFXmCnT9wExYr7HxiTRRM/yqvPbDcAezCSxTeblKD/5hVDVZkr58vMwT/ iAD4bjDg0sHXTSXh7SDsXAy5ZXhGc+DH5E8k4SQe09zAgSH8gMHPasY793zsJG4/uodx DS4Hjykds0pgXWEjk25ZENTxtrq0b15+/HIqmEXJq9bMWmKdlWH8kt/pydQM/7wJwzdJ Fx5BVjrPVFotKoNWWraAZpQkwSC+yex3EuXhBd/CmrvVOU6OLqQOTy6VkSrJRlVrHriw dpBw== X-Gm-Message-State: AOAM5330wGFOd9de/dqYXn7Sf++e2Gwg1bOe1RJgRs88EsyFN8gIyzzo JDzFd2u9PFrJaGklmLO2wkV/cZ5dIKSKfPqedTTM/I4y5nJe1zEcqJm4Hei+jc36RnTajw98z0F uausk9K2acvjqct4= X-Received: by 2002:a17:906:dbef:: with SMTP id yd15mr18783542ejb.5.1590419228466; Mon, 25 May 2020 08:07:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyc8pIVgB8O+RO+G/FzpLrcqAuivVA+aLfJMVWW2XdLBbHOawNds7BqVTA222UcCOw6X2lDEA== X-Received: by 2002:a17:906:dbef:: with SMTP id yd15mr18783506ejb.5.1590419228178; Mon, 25 May 2020 08:07:08 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v3 4/9] qapi/misc: Restrict balloon-related commands to machine code Date: Mon, 25 May 2020 17:06:35 +0200 Message-Id: <20200525150640.30879-5-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200525150640.30879-1-philmd@redhat.com> References: <20200525150640.30879-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.120; envelope-from=philmd@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/25 01:44:10 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Ben Warren , David Hildenbrand , Markus Armbruster , "Michael S. Tsirkin" , Peter Lieven , "Dr. David Alan Gilbert" , Eduardo Habkost , Max Reitz , Ronnie Sahlberg , Igor Mammedov , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Markus Armbruster Reviewed-by: David Hildenbrand --- qapi/machine.json | 90 ++++++++++++++++++++++++++++++++++++++ qapi/misc.json | 90 -------------------------------------- include/sysemu/balloon.h | 2 +- balloon.c | 2 +- hw/virtio/virtio-balloon.c | 2 +- monitor/hmp-cmds.c | 1 + 6 files changed, 94 insertions(+), 93 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json index ca7d58f0c9..ae42d69495 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -921,3 +921,93 @@ 'data': 'NumaOptions', 'allow-preconfig': true } + +## +# @balloon: +# +# Request the balloon driver to change its balloon size. +# +# @value: the target logical size of the VM in bytes +# We can deduce the size of the balloon using this formula: +# logical_vm_size =3D vm_ram_size - balloon_size +# From it we have: balloon_size =3D vm_ram_size - @value +# +# Returns: - Nothing on success +# - If the balloon driver is enabled but not functional because t= he KVM +# kernel module cannot support it, KvmMissingCap +# - If no balloon device is present, DeviceNotActive +# +# Notes: This command just issues a request to the guest. When it returns, +# the balloon size may not have changed. A guest can change the ba= lloon +# size independent of this command. +# +# Since: 0.14.0 +# +# Example: +# +# -> { "execute": "balloon", "arguments": { "value": 536870912 } } +# <- { "return": {} } +# +# With a 2.5GiB guest this command inflated the ballon to 3GiB. +# +## +{ 'command': 'balloon', 'data': {'value': 'int'} } + +## +# @BalloonInfo: +# +# Information about the guest balloon device. +# +# @actual: the logical size of the VM in bytes +# Formula used: logical_vm_size =3D vm_ram_size - balloon_size +# +# Since: 0.14.0 +# +## +{ 'struct': 'BalloonInfo', 'data': {'actual': 'int' } } + +## +# @query-balloon: +# +# Return information about the balloon device. +# +# Returns: - @BalloonInfo on success +# - If the balloon driver is enabled but not functional because t= he KVM +# kernel module cannot support it, KvmMissingCap +# - If no balloon device is present, DeviceNotActive +# +# Since: 0.14.0 +# +# Example: +# +# -> { "execute": "query-balloon" } +# <- { "return": { +# "actual": 1073741824, +# } +# } +# +## +{ 'command': 'query-balloon', 'returns': 'BalloonInfo' } + +## +# @BALLOON_CHANGE: +# +# Emitted when the guest changes the actual BALLOON level. This value is +# equivalent to the @actual field return by the 'query-balloon' command +# +# @actual: the logical size of the VM in bytes +# Formula used: logical_vm_size =3D vm_ram_size - balloon_size +# +# Note: this event is rate-limited. +# +# Since: 1.2 +# +# Example: +# +# <- { "event": "BALLOON_CHANGE", +# "data": { "actual": 944766976 }, +# "timestamp": { "seconds": 1267020223, "microseconds": 435656 } } +# +## +{ 'event': 'BALLOON_CHANGE', + 'data': { 'actual': 'int' } } diff --git a/qapi/misc.json b/qapi/misc.json index 446fc8ff83..26b5115638 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -186,65 +186,6 @@ { 'command': 'query-iothreads', 'returns': ['IOThreadInfo'], 'allow-preconfig': true } =20 -## -# @BalloonInfo: -# -# Information about the guest balloon device. -# -# @actual: the logical size of the VM in bytes -# Formula used: logical_vm_size =3D vm_ram_size - balloon_size -# -# Since: 0.14.0 -# -## -{ 'struct': 'BalloonInfo', 'data': {'actual': 'int' } } - -## -# @query-balloon: -# -# Return information about the balloon device. -# -# Returns: - @BalloonInfo on success -# - If the balloon driver is enabled but not functional because t= he KVM -# kernel module cannot support it, KvmMissingCap -# - If no balloon device is present, DeviceNotActive -# -# Since: 0.14.0 -# -# Example: -# -# -> { "execute": "query-balloon" } -# <- { "return": { -# "actual": 1073741824, -# } -# } -# -## -{ 'command': 'query-balloon', 'returns': 'BalloonInfo' } - -## -# @BALLOON_CHANGE: -# -# Emitted when the guest changes the actual BALLOON level. This value is -# equivalent to the @actual field return by the 'query-balloon' command -# -# @actual: the logical size of the VM in bytes -# Formula used: logical_vm_size =3D vm_ram_size - balloon_size -# -# Note: this event is rate-limited. -# -# Since: 1.2 -# -# Example: -# -# <- { "event": "BALLOON_CHANGE", -# "data": { "actual": 944766976 }, -# "timestamp": { "seconds": 1267020223, "microseconds": 435656 } } -# -## -{ 'event': 'BALLOON_CHANGE', - 'data': { 'actual': 'int' } } - ## # @PciMemoryRange: # @@ -753,37 +694,6 @@ ## { 'command': 'inject-nmi' } =20 -## -# @balloon: -# -# Request the balloon driver to change its balloon size. -# -# @value: the target logical size of the VM in bytes -# We can deduce the size of the balloon using this formula: -# logical_vm_size =3D vm_ram_size - balloon_size -# From it we have: balloon_size =3D vm_ram_size - @value -# -# Returns: - Nothing on success -# - If the balloon driver is enabled but not functional because t= he KVM -# kernel module cannot support it, KvmMissingCap -# - If no balloon device is present, DeviceNotActive -# -# Notes: This command just issues a request to the guest. When it returns, -# the balloon size may not have changed. A guest can change the ba= lloon -# size independent of this command. -# -# Since: 0.14.0 -# -# Example: -# -# -> { "execute": "balloon", "arguments": { "value": 536870912 } } -# <- { "return": {} } -# -# With a 2.5GiB guest this command inflated the ballon to 3GiB. -# -## -{ 'command': 'balloon', 'data': {'value': 'int'} } - ## # @human-monitor-command: # diff --git a/include/sysemu/balloon.h b/include/sysemu/balloon.h index aea0c44985..b3de4b92b9 100644 --- a/include/sysemu/balloon.h +++ b/include/sysemu/balloon.h @@ -15,7 +15,7 @@ #define QEMU_BALLOON_H =20 #include "exec/cpu-common.h" -#include "qapi/qapi-types-misc.h" +#include "qapi/qapi-types-machine.h" =20 typedef void (QEMUBalloonEvent)(void *opaque, ram_addr_t target); typedef void (QEMUBalloonStatus)(void *opaque, BalloonInfo *info); diff --git a/balloon.c b/balloon.c index f104b42961..ee9c59252d 100644 --- a/balloon.c +++ b/balloon.c @@ -30,7 +30,7 @@ #include "sysemu/balloon.h" #include "trace-root.h" #include "qapi/error.h" -#include "qapi/qapi-commands-misc.h" +#include "qapi/qapi-commands-machine.h" #include "qapi/qmp/qerror.h" =20 static QEMUBalloonEvent *balloon_event_fn; diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 065cd450f1..ec3aac1e80 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -24,7 +24,7 @@ #include "hw/virtio/virtio-balloon.h" #include "exec/address-spaces.h" #include "qapi/error.h" -#include "qapi/qapi-events-misc.h" +#include "qapi/qapi-events-machine.h" #include "qapi/visitor.h" #include "trace.h" #include "qemu/error-report.h" diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index 9c61e769ca..376590c073 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -32,6 +32,7 @@ #include "qapi/qapi-commands-block.h" #include "qapi/qapi-commands-char.h" #include "qapi/qapi-commands-control.h" +#include "qapi/qapi-commands-machine.h" #include "qapi/qapi-commands-migration.h" #include "qapi/qapi-commands-misc.h" #include "qapi/qapi-commands-net.h" --=20 2.21.3 From nobody Sat May 4 14:46:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590419445; cv=none; d=zohomail.com; s=zohoarc; b=kQ7NDY5DQSYM5B+FaYG6cnLTS8Zn7JA21GV6b1cHK5gVEQEtRzhlaqu/9HNlPG9sKZuI0KJQxMkr/9rnYRXJatlRnIJ9XD+dl3DWPDBGfDZXySpi707U9rv4LRWszh1d2JSENX/3xSeO5KIuoeNvza1KUqtK6rbZvVTlujTx5RE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590419445; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=xXt/e940KwQ6c6w6CifCzHczNy+4pbZbPt9Qx0gk/SI=; b=dXT2CD3SRO2bapqd8v3uXpqT6UtGtaGkAh2rvPgEh4N1VGPHWuV7zqfghxU9dkbCNj8W7st0VP2fxrKgjZd0vHkNimPbNxsiVbuHpc7aUpCgTTNpnz0F/YdxaSe/wCzP3WF+lhDC54WZvRUs4hOMpwU/MM1BZJ7tqGdAzj23QFc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590419445604957.4605181778436; Mon, 25 May 2020 08:10:45 -0700 (PDT) Received: from localhost ([::1]:35508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdEkW-0001ND-9U for importer@patchew.org; Mon, 25 May 2020 11:10:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54180) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdEhC-0005j4-QS for qemu-devel@nongnu.org; Mon, 25 May 2020 11:07:18 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:23486 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jdEhC-0006kP-0q for qemu-devel@nongnu.org; Mon, 25 May 2020 11:07:18 -0400 Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-321-Bff5hubuOL6SqKWPZ1yn6Q-1; Mon, 25 May 2020 11:07:16 -0400 Received: by mail-ej1-f72.google.com with SMTP id g9so5685208ejs.20 for ; Mon, 25 May 2020 08:07:15 -0700 (PDT) Received: from x1w.redhat.com (71.red-88-21-204.staticip.rima-tde.net. [88.21.204.71]) by smtp.gmail.com with ESMTPSA id u17sm6696494ejr.44.2020.05.25.08.07.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 May 2020 08:07:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590419237; 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=xXt/e940KwQ6c6w6CifCzHczNy+4pbZbPt9Qx0gk/SI=; b=VXOjxdxwMe6K37nMF0LPawEYjyuxo6Hzr0Q4WCBOQL7V0wrepAVLJHwlVH9r17W8JU3u4+ S6oEjfavU3f2a71nRn951s9UjAb7UZhdRT+QFvKfZUZ95fv5MjH0sc9Y5eqpAVHfZAYf4l /QmAmKB61RZz6bYdmHtCyWTxyjoofj8= X-MC-Unique: Bff5hubuOL6SqKWPZ1yn6Q-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=xXt/e940KwQ6c6w6CifCzHczNy+4pbZbPt9Qx0gk/SI=; b=BL70TmCi83PYMLMYFxssHqduoJr2eejpbGU9HcblaLaKn/dzOuIcYoLlu8/qM0izNy /XB9zHltKfaKd7liBb+jnnaV8GLYRQL4QN9huz04HpgYj3+3wFcuNBBoe7/g1z4H5RVh s4TVNpqbCxxNf96lpYsJ/3SKTWLiD2HGluwEYkbxUWnf6cundsebEmU5XiD1kFywqRsm H8hzp2V1+H1trLKhPNOV43Ydd9lYE9kZkz/30bNzJEVDQKiv53eaucsyJy2v/+Nl6kRm Nx45g5Z70guSBMTkUtUDyqIRPDQSKyd7c1TkB0tO4rdS6KqfSCljhGsFJtIwv+epfnUH XcIA== X-Gm-Message-State: AOAM531BV5SHp2O8IGCD79gQpoL4Y+hf4LugQKaY69Gi6mJ0svGQMVGG cLsQIH3HL19kKnfqaR5I2P47oPBqodKPEGZl7dzcQ9Fa3rrHA4ZpdO+MSKGyGBfm16KyHRP5pQX 2Ze0VffW+M1XF9fg= X-Received: by 2002:a17:906:eda3:: with SMTP id sa3mr20114332ejb.253.1590419234481; Mon, 25 May 2020 08:07:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyR6LUhcd2XfqLF3HQVcuZ0/RkFmoE0jg4G8feEeQRKeyoKJLqbAZEXBP3TgEeNE03L6u9V2A== X-Received: by 2002:a17:906:eda3:: with SMTP id sa3mr20114307ejb.253.1590419234225; Mon, 25 May 2020 08:07:14 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v3 5/9] qapi/misc: Restrict query-vm-generation-id command to machine code Date: Mon, 25 May 2020 17:06:36 +0200 Message-Id: <20200525150640.30879-6-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200525150640.30879-1-philmd@redhat.com> References: <20200525150640.30879-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.120; envelope-from=philmd@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/25 08:28:26 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Ben Warren , David Hildenbrand , Markus Armbruster , "Michael S. Tsirkin" , Peter Lieven , "Dr. David Alan Gilbert" , Eduardo Habkost , Max Reitz , Ronnie Sahlberg , Igor Mammedov , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Acked-by: Igor Mammedov Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Markus Armbruster --- qapi/machine.json | 20 ++++++++++++++++++++ qapi/misc.json | 21 --------------------- hw/acpi/vmgenid.c | 2 +- stubs/vmgenid.c | 2 +- 4 files changed, 22 insertions(+), 23 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json index ae42d69495..545ecb9a55 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -421,6 +421,26 @@ ## { 'command': 'query-target', 'returns': 'TargetInfo' } =20 +## +# @GuidInfo: +# +# GUID information. +# +# @guid: the globally unique identifier +# +# Since: 2.9 +## +{ 'struct': 'GuidInfo', 'data': {'guid': 'str'} } + +## +# @query-vm-generation-id: +# +# Show Virtual Machine Generation ID +# +# Since: 2.9 +## +{ 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' } + ## # @LostTickPolicy: # diff --git a/qapi/misc.json b/qapi/misc.json index 26b5115638..b43fe7c602 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -1414,24 +1414,3 @@ # ## { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} } - -## -# @GuidInfo: -# -# GUID information. -# -# @guid: the globally unique identifier -# -# Since: 2.9 -## -{ 'struct': 'GuidInfo', 'data': {'guid': 'str'} } - -## -# @query-vm-generation-id: -# -# Show Virtual Machine Generation ID -# -# Since: 2.9 -## -{ 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' } - diff --git a/hw/acpi/vmgenid.c b/hw/acpi/vmgenid.c index 2df7623d74..2b26bacaf8 100644 --- a/hw/acpi/vmgenid.c +++ b/hw/acpi/vmgenid.c @@ -12,7 +12,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" -#include "qapi/qapi-commands-misc.h" +#include "qapi/qapi-commands-machine.h" #include "qemu/module.h" #include "hw/acpi/acpi.h" #include "hw/acpi/aml-build.h" diff --git a/stubs/vmgenid.c b/stubs/vmgenid.c index 568e42b064..bfad656c6c 100644 --- a/stubs/vmgenid.c +++ b/stubs/vmgenid.c @@ -1,6 +1,6 @@ #include "qemu/osdep.h" #include "qapi/error.h" -#include "qapi/qapi-commands-misc.h" +#include "qapi/qapi-commands-machine.h" #include "qapi/qmp/qerror.h" =20 GuidInfo *qmp_query_vm_generation_id(Error **errp) --=20 2.21.3 From nobody Sat May 4 14:46:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590419598; cv=none; d=zohomail.com; s=zohoarc; b=PkVCBDfuFT88rli4w2nh8P7C1GdRsuuUyxgdmYcJbWccVvTM4m4VNiKE5WIgMFlnOHpaxgpwyelm2adZy6kWQeENa357PO23WZknupuM/9LN2VLd2OZ6z6bcBIXOV910A79HpOLiN6RfZ7+4ptOCX81miaB1cmlUAykkBObl0zo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590419598; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=n688Ug1E8U30t03slUDUg6yxWEE8HYKLjx2cTAsTob0=; b=WMC1Oap6giKpWXH+E8uuYkvvdAYNrPTxT1/SlSqbWeP/zLwDAddHViexp4/Ol1rnA5+tBijxXNvaVLKpiV7puyv1Nd9XZu5c1TuhkjBybqjgGp1n2MMZrDV8tYwQVvT99kmPHsjMGO7UEDEWpEKBcIkyqmN4kek1udcz+ohGnJI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590419598300176.6949073930823; Mon, 25 May 2020 08:13:18 -0700 (PDT) Received: from localhost ([::1]:42720 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdEmy-0004Ul-Sz for importer@patchew.org; Mon, 25 May 2020 11:13:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54200) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdEhN-0005zY-0I for qemu-devel@nongnu.org; Mon, 25 May 2020 11:07:29 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:23350 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jdEhK-0006kp-Ly for qemu-devel@nongnu.org; Mon, 25 May 2020 11:07:27 -0400 Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-251-cw1wLKcjOSiOmJFj3fFdTA-1; Mon, 25 May 2020 11:07:21 -0400 Received: by mail-ed1-f72.google.com with SMTP id dk23so7610239edb.15 for ; Mon, 25 May 2020 08:07:21 -0700 (PDT) Received: from x1w.redhat.com (71.red-88-21-204.staticip.rima-tde.net. [88.21.204.71]) by smtp.gmail.com with ESMTPSA id 32sm14950014edf.43.2020.05.25.08.07.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 May 2020 08:07:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590419245; 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=n688Ug1E8U30t03slUDUg6yxWEE8HYKLjx2cTAsTob0=; b=g007vQu0BZql8fgrUT6ghYEfJs6G5Hv0559k7YcRuHnHbt9Ad02vt/IDxTud/vibZnMN0v FOG9Hemh2uOXf+yW/4IOWLBTrTBh2xfOlNBhrVz39iyY8zvVq4HQWZIQP4DJvr0rd070Ij Xl9wIcB/n1FA2ZyGHWv9yeJ8do+vRSk= X-MC-Unique: cw1wLKcjOSiOmJFj3fFdTA-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=n688Ug1E8U30t03slUDUg6yxWEE8HYKLjx2cTAsTob0=; b=ktz5emDnglm6jAhxL/3t73O2drw5Lw/KqQcVxjfhRx31zHq1XxWKQmZJTKkUIbU0xr Me4G0eUNq7lP+EPEq+h2QdNZoOqfSEXhyzQSf3dhdiQuzVJigsafPLt8WXGDM2IjeLCK sinSVxzjD/NMH5VmEB+eE/1KzIaSJGsUv+/aIlpgRxpEw5RYOt/f3WeCiPxB8Yb9E3f9 I5WSsBtXqDqheo9+3SbtsotUQNuxZiUFxRVwWXrrKM3PfpgUWcLeLCDIAXjtBnMRN20q pFqIJ9jdD0S7YwpQQ/LYQwpbGBR2rHAUMeSZGCbOuowT8tOhd3ferYRXsVpFY6ugAnmt 1XnQ== X-Gm-Message-State: AOAM5301lqGU8HmvpJoFb8X1jg6LdtH8/44ubbJ6+C5Jc7by2bsznYw2 TjLsvMdsCT5LpgHmn4tDUkFr8wmFbqDrKJ91J9urRXo7YAkTxsu71u/yPbYWDKcObFEHdhkJb7S cnAzWtdvZ7tBxkFQ= X-Received: by 2002:aa7:cf08:: with SMTP id a8mr16348985edy.354.1590419240546; Mon, 25 May 2020 08:07:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKoxs/SJXYi/TLCv0wflQV/CK5x/44Yia7Jst0UMdeq6YgpiiqiwLEKojAiD1/lUaXeOrW0Q== X-Received: by 2002:aa7:cf08:: with SMTP id a8mr16348949edy.354.1590419240312; Mon, 25 May 2020 08:07:20 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v3 6/9] qapi/misc: Move query-uuid command to machine code Date: Mon, 25 May 2020 17:06:37 +0200 Message-Id: <20200525150640.30879-7-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200525150640.30879-1-philmd@redhat.com> References: <20200525150640.30879-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.120; envelope-from=philmd@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/25 08:28:26 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Ben Warren , David Hildenbrand , Markus Armbruster , "Michael S. Tsirkin" , Peter Lieven , "Dr. David Alan Gilbert" , Eduardo Habkost , Max Reitz , Ronnie Sahlberg , Igor Mammedov , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Markus Armbruster --- qapi/machine.json | 30 ++++++++++++++++++++++++++++++ qapi/misc.json | 30 ------------------------------ block/iscsi.c | 2 +- stubs/uuid.c | 2 +- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json index 545ecb9a55..7420c4f5ee 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -421,6 +421,36 @@ ## { 'command': 'query-target', 'returns': 'TargetInfo' } =20 +## +# @UuidInfo: +# +# Guest UUID information (Universally Unique Identifier). +# +# @UUID: the UUID of the guest +# +# Since: 0.14.0 +# +# Notes: If no UUID was specified for the guest, a null UUID is returned. +## +{ 'struct': 'UuidInfo', 'data': {'UUID': 'str'} } + +## +# @query-uuid: +# +# Query the guest UUID information. +# +# Returns: The @UuidInfo for the guest +# +# Since: 0.14.0 +# +# Example: +# +# -> { "execute": "query-uuid" } +# <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } } +# +## +{ 'command': 'query-uuid', 'returns': 'UuidInfo', 'allow-preconfig': true } + ## # @GuidInfo: # diff --git a/qapi/misc.json b/qapi/misc.json index b43fe7c602..49ca97f712 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -97,36 +97,6 @@ ## { 'command': 'query-kvm', 'returns': 'KvmInfo' } =20 -## -# @UuidInfo: -# -# Guest UUID information (Universally Unique Identifier). -# -# @UUID: the UUID of the guest -# -# Since: 0.14.0 -# -# Notes: If no UUID was specified for the guest, a null UUID is returned. -## -{ 'struct': 'UuidInfo', 'data': {'UUID': 'str'} } - -## -# @query-uuid: -# -# Query the guest UUID information. -# -# Returns: The @UuidInfo for the guest -# -# Since: 0.14.0 -# -# Example: -# -# -> { "execute": "query-uuid" } -# <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } } -# -## -{ 'command': 'query-uuid', 'returns': 'UuidInfo', 'allow-preconfig': true } - ## # @IOThreadInfo: # diff --git a/block/iscsi.c b/block/iscsi.c index a8b76979d8..efec25f7ed 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -42,7 +42,7 @@ #include "qemu/uuid.h" #include "sysemu/replay.h" #include "qapi/error.h" -#include "qapi/qapi-commands-misc.h" +#include "qapi/qapi-commands-machine.h" #include "qapi/qmp/qdict.h" #include "qapi/qmp/qstring.h" #include "crypto/secret.h" diff --git a/stubs/uuid.c b/stubs/uuid.c index 67f182fa3a..e5112eb3f6 100644 --- a/stubs/uuid.c +++ b/stubs/uuid.c @@ -1,5 +1,5 @@ #include "qemu/osdep.h" -#include "qapi/qapi-commands-misc.h" +#include "qapi/qapi-commands-machine.h" #include "qemu/uuid.h" =20 UuidInfo *qmp_query_uuid(Error **errp) --=20 2.21.3 From nobody Sat May 4 14:46:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590419745; cv=none; d=zohomail.com; s=zohoarc; b=DSIxAl/QaT/q4cTbMLLBJ3kvA7p8I1SmI8OZv+9u+RG5iPjQkJMEjqNfT3Z1bwzyhHUvzqBJDUHkrOj7Ka3S2UkNBPq3dCQxiFX8kxK4dOGB4xJL38kMHN1pbM/WTR7PG8lb9yqyv/Bhas9ws3lKquJlJnBZf39ETRJAA2p9TZ8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590419745; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=jzY0Zi9W4LdLuqEd5SDPILPIqLHrl6uTPzfQWotzWik=; b=dctn/FJM8KbssqSq4IFYtcW62eWpWfvutiwfkfHrxpq3CFUicgCmcMBCiPRNTS/F73oHRx+khvmS10PGdr31rtidnEZabVilAnA8Z9f/6bbnXGFipuV4MDq5g0OY+JVl/VY/qi9ePE/L7N96eQPNLEDhP34ddzXyaJiw+vDjjPI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590419745443279.6786039935639; Mon, 25 May 2020 08:15:45 -0700 (PDT) Received: from localhost ([::1]:49198 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdEpL-0007SK-TS for importer@patchew.org; Mon, 25 May 2020 11:15:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdEhR-00060h-Kc for qemu-devel@nongnu.org; Mon, 25 May 2020 11:07:34 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:55474 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jdEhQ-0006lT-1h for qemu-devel@nongnu.org; Mon, 25 May 2020 11:07:32 -0400 Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-232-Am5Ly--lP8CYL8y4Yx4V9g-1; Mon, 25 May 2020 11:07:29 -0400 Received: by mail-ej1-f72.google.com with SMTP id bo19so2894503ejb.0 for ; Mon, 25 May 2020 08:07:28 -0700 (PDT) Received: from x1w.redhat.com (71.red-88-21-204.staticip.rima-tde.net. [88.21.204.71]) by smtp.gmail.com with ESMTPSA id i6sm14394964ejh.4.2020.05.25.08.07.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 May 2020 08:07:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590419250; 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=jzY0Zi9W4LdLuqEd5SDPILPIqLHrl6uTPzfQWotzWik=; b=LScRIRrkjK67npQmwyPGIRgtEuhl5DVkAYSHUewX7PI915dz4IvJyXuOnlP8Yi8TQNG/yZ YZHihpyoXRwEKzAgsLNM/j6uM3jhqjVKNJFq2HkvHMlCmvjVvIvJKcCq1rhshiM87AcRYe G7sYltGN6X2OnSmeKdCkMNPFQNG2mKI= X-MC-Unique: Am5Ly--lP8CYL8y4Yx4V9g-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=jzY0Zi9W4LdLuqEd5SDPILPIqLHrl6uTPzfQWotzWik=; b=hshXrpqx2qxJq7zUTqEYqyTC6q930y0KuYMXZqVVf17RGtJlg3hfEQq3She0UcIY/J 0k5axF3mLE+5HiUH/i8zAt0rw4W/P2jJd8rwMDXaFbIvLgLe19Xz1CUuJ3Dp2P+u5tAm fN8HeY6atBZ0V7xn01xR4s69qEcxLKDzfx98nnHWi/YcJmqn9MaCZWQShmq7snkbZeBr rGFSm2gROZdsjTpEUxX4rr8W+dH5HxE3yPXYLLtP99abQ0WjKKK09STrr7m4tuTNLjL/ U3Vl9qOgiHsFOPiaZ6OZHWGTj+u2a6sTxOZTWZ/R4SXMgq83I3tO3fCcx2RmNQUJ0vqU CxjA== X-Gm-Message-State: AOAM530T28e3/22CMFEe5+5kLbiiqp6u8ThndAxJAVccxdCtT/lblr0J wzLFo4nLefHzC9iGh9KEUS8nyXq16xGsgJrQF6XmvRm4lcPw7uXNwBb94NiNDY2xLvWFkmK7eXs 3QjnTqyzc5qjLAuw= X-Received: by 2002:aa7:db4a:: with SMTP id n10mr15872719edt.11.1590419246900; Mon, 25 May 2020 08:07:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7Y5ycO7FJSq/p+tdTdtlrMuLAnL8w5xb1miKZz3vITdkhWsGqffRKPud3DAqxaubOmrR2oA== X-Received: by 2002:aa7:db4a:: with SMTP id n10mr15872661edt.11.1590419246412; Mon, 25 May 2020 08:07:26 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v3 7/9] qapi/misc: Restrict ACPI commands to machine code Date: Mon, 25 May 2020 17:06:38 +0200 Message-Id: <20200525150640.30879-8-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200525150640.30879-1-philmd@redhat.com> References: <20200525150640.30879-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.120; envelope-from=philmd@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/25 01:44:10 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Ben Warren , David Hildenbrand , Markus Armbruster , "Michael S. Tsirkin" , Peter Lieven , "Dr. David Alan Gilbert" , Eduardo Habkost , Max Reitz , Ronnie Sahlberg , Igor Mammedov , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Acked-by: Igor Mammedov Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Markus Armbruster --- qapi/machine.json | 154 +++++++++++++++++++++++++++ qapi/misc.json | 154 --------------------------- include/hw/acpi/acpi_dev_interface.h | 2 +- hw/acpi/core.c | 2 +- hw/acpi/cpu.c | 2 +- hw/acpi/memory_hotplug.c | 2 +- 6 files changed, 158 insertions(+), 158 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json index 7420c4f5ee..04b124be67 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -1061,3 +1061,157 @@ ## { 'event': 'BALLOON_CHANGE', 'data': { 'actual': 'int' } } + +## +# @AcpiTableOptions: +# +# Specify an ACPI table on the command line to load. +# +# At most one of @file and @data can be specified. The list of files speci= fied +# by any one of them is loaded and concatenated in order. If both are omit= ted, +# @data is implied. +# +# Other fields / optargs can be used to override fields of the generic ACPI +# table header; refer to the ACPI specification 5.0, section 5.2.6 System +# Description Table Header. If a header field is not overridden, then the +# corresponding value from the concatenated blob is used (in case of @file= ), or +# it is filled in with a hard-coded value (in case of @data). +# +# String fields are copied into the matching ACPI member from lowest addre= ss +# upwards, and silently truncated / NUL-padded to length. +# +# @sig: table signature / identifier (4 bytes) +# +# @rev: table revision number (dependent on signature, 1 byte) +# +# @oem_id: OEM identifier (6 bytes) +# +# @oem_table_id: OEM table identifier (8 bytes) +# +# @oem_rev: OEM-supplied revision number (4 bytes) +# +# @asl_compiler_id: identifier of the utility that created the table +# (4 bytes) +# +# @asl_compiler_rev: revision number of the utility that created the +# table (4 bytes) +# +# @file: colon (:) separated list of pathnames to load and +# concatenate as table data. The resultant binary blob is expected = to +# have an ACPI table header. At least one file is required. This fi= eld +# excludes @data. +# +# @data: colon (:) separated list of pathnames to load and +# concatenate as table data. The resultant binary blob must not hav= e an +# ACPI table header. At least one file is required. This field excl= udes +# @file. +# +# Since: 1.5 +## +{ 'struct': 'AcpiTableOptions', + 'data': { + '*sig': 'str', + '*rev': 'uint8', + '*oem_id': 'str', + '*oem_table_id': 'str', + '*oem_rev': 'uint32', + '*asl_compiler_id': 'str', + '*asl_compiler_rev': 'uint32', + '*file': 'str', + '*data': 'str' }} + +## +# @MEM_UNPLUG_ERROR: +# +# Emitted when memory hot unplug error occurs. +# +# @device: device name +# +# @msg: Informative message +# +# Since: 2.4 +# +# Example: +# +# <- { "event": "MEM_UNPLUG_ERROR" +# "data": { "device": "dimm1", +# "msg": "acpi: device unplug for unsupported device" +# }, +# "timestamp": { "seconds": 1265044230, "microseconds": 450486 } } +# +## +{ 'event': 'MEM_UNPLUG_ERROR', + 'data': { 'device': 'str', 'msg': 'str' } } + +## +# @ACPISlotType: +# +# @DIMM: memory slot +# @CPU: logical CPU slot (since 2.7) +## +{ 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] } + +## +# @ACPIOSTInfo: +# +# OSPM Status Indication for a device +# For description of possible values of @source and @status fields +# see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec. +# +# @device: device ID associated with slot +# +# @slot: slot ID, unique per slot of a given @slot-type +# +# @slot-type: type of the slot +# +# @source: an integer containing the source event +# +# @status: an integer containing the status code +# +# Since: 2.1 +## +{ 'struct': 'ACPIOSTInfo', + 'data' : { '*device': 'str', + 'slot': 'str', + 'slot-type': 'ACPISlotType', + 'source': 'int', + 'status': 'int' } } + +## +# @query-acpi-ospm-status: +# +# Return a list of ACPIOSTInfo for devices that support status +# reporting via ACPI _OST method. +# +# Since: 2.1 +# +# Example: +# +# -> { "execute": "query-acpi-ospm-status" } +# <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "so= urce": 1, "status": 0}, +# { "slot": "1", "slot-type": "DIMM", "source": 0, "statu= s": 0}, +# { "slot": "2", "slot-type": "DIMM", "source": 0, "statu= s": 0}, +# { "slot": "3", "slot-type": "DIMM", "source": 0, "statu= s": 0} +# ]} +# +## +{ 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] } + +## +# @ACPI_DEVICE_OST: +# +# Emitted when guest executes ACPI _OST method. +# +# @info: OSPM Status Indication +# +# Since: 2.1 +# +# Example: +# +# <- { "event": "ACPI_DEVICE_OST", +# "data": { "device": "d1", "slot": "0", +# "slot-type": "DIMM", "source": 1, "status": 0 } } +# +## +{ 'event': 'ACPI_DEVICE_OST', + 'data': { 'info': 'ACPIOSTInfo' } } diff --git a/qapi/misc.json b/qapi/misc.json index 49ca97f712..ecceba9d32 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -1000,64 +1000,6 @@ ## { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] } =20 -## -# @AcpiTableOptions: -# -# Specify an ACPI table on the command line to load. -# -# At most one of @file and @data can be specified. The list of files speci= fied -# by any one of them is loaded and concatenated in order. If both are omit= ted, -# @data is implied. -# -# Other fields / optargs can be used to override fields of the generic ACPI -# table header; refer to the ACPI specification 5.0, section 5.2.6 System -# Description Table Header. If a header field is not overridden, then the -# corresponding value from the concatenated blob is used (in case of @file= ), or -# it is filled in with a hard-coded value (in case of @data). -# -# String fields are copied into the matching ACPI member from lowest addre= ss -# upwards, and silently truncated / NUL-padded to length. -# -# @sig: table signature / identifier (4 bytes) -# -# @rev: table revision number (dependent on signature, 1 byte) -# -# @oem_id: OEM identifier (6 bytes) -# -# @oem_table_id: OEM table identifier (8 bytes) -# -# @oem_rev: OEM-supplied revision number (4 bytes) -# -# @asl_compiler_id: identifier of the utility that created the table -# (4 bytes) -# -# @asl_compiler_rev: revision number of the utility that created the -# table (4 bytes) -# -# @file: colon (:) separated list of pathnames to load and -# concatenate as table data. The resultant binary blob is expected = to -# have an ACPI table header. At least one file is required. This fi= eld -# excludes @data. -# -# @data: colon (:) separated list of pathnames to load and -# concatenate as table data. The resultant binary blob must not hav= e an -# ACPI table header. At least one file is required. This field excl= udes -# @file. -# -# Since: 1.5 -## -{ 'struct': 'AcpiTableOptions', - 'data': { - '*sig': 'str', - '*rev': 'uint8', - '*oem_id': 'str', - '*oem_table_id': 'str', - '*oem_rev': 'uint32', - '*asl_compiler_id': 'str', - '*asl_compiler_rev': 'uint32', - '*file': 'str', - '*data': 'str' }} - ## # @CommandLineParameterType: # @@ -1250,102 +1192,6 @@ ## { 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] } =20 -## -# @MEM_UNPLUG_ERROR: -# -# Emitted when memory hot unplug error occurs. -# -# @device: device name -# -# @msg: Informative message -# -# Since: 2.4 -# -# Example: -# -# <- { "event": "MEM_UNPLUG_ERROR" -# "data": { "device": "dimm1", -# "msg": "acpi: device unplug for unsupported device" -# }, -# "timestamp": { "seconds": 1265044230, "microseconds": 450486 } } -# -## -{ 'event': 'MEM_UNPLUG_ERROR', - 'data': { 'device': 'str', 'msg': 'str' } } - -## -# @ACPISlotType: -# -# @DIMM: memory slot -# @CPU: logical CPU slot (since 2.7) -## -{ 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] } - -## -# @ACPIOSTInfo: -# -# OSPM Status Indication for a device -# For description of possible values of @source and @status fields -# see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec. -# -# @device: device ID associated with slot -# -# @slot: slot ID, unique per slot of a given @slot-type -# -# @slot-type: type of the slot -# -# @source: an integer containing the source event -# -# @status: an integer containing the status code -# -# Since: 2.1 -## -{ 'struct': 'ACPIOSTInfo', - 'data' : { '*device': 'str', - 'slot': 'str', - 'slot-type': 'ACPISlotType', - 'source': 'int', - 'status': 'int' } } - -## -# @query-acpi-ospm-status: -# -# Return a list of ACPIOSTInfo for devices that support status -# reporting via ACPI _OST method. -# -# Since: 2.1 -# -# Example: -# -# -> { "execute": "query-acpi-ospm-status" } -# <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "so= urce": 1, "status": 0}, -# { "slot": "1", "slot-type": "DIMM", "source": 0, "statu= s": 0}, -# { "slot": "2", "slot-type": "DIMM", "source": 0, "statu= s": 0}, -# { "slot": "3", "slot-type": "DIMM", "source": 0, "statu= s": 0} -# ]} -# -## -{ 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] } - -## -# @ACPI_DEVICE_OST: -# -# Emitted when guest executes ACPI _OST method. -# -# @info: OSPM Status Indication -# -# Since: 2.1 -# -# Example: -# -# <- { "event": "ACPI_DEVICE_OST", -# "data": { "device": "d1", "slot": "0", -# "slot-type": "DIMM", "source": 1, "status": 0 } } -# -## -{ 'event': 'ACPI_DEVICE_OST', - 'data': { 'info': 'ACPIOSTInfo' } } - ## # @ReplayMode: # diff --git a/include/hw/acpi/acpi_dev_interface.h b/include/hw/acpi/acpi_de= v_interface.h index a2a12af9b9..a1b63d51db 100644 --- a/include/hw/acpi/acpi_dev_interface.h +++ b/include/hw/acpi/acpi_dev_interface.h @@ -1,7 +1,7 @@ #ifndef ACPI_DEV_INTERFACE_H #define ACPI_DEV_INTERFACE_H =20 -#include "qapi/qapi-types-misc.h" +#include "qapi/qapi-types-machine.h" #include "qom/object.h" #include "hw/boards.h" #include "hw/qdev-core.h" diff --git a/hw/acpi/core.c b/hw/acpi/core.c index 45cbed49ab..4f8d90f50b 100644 --- a/hw/acpi/core.c +++ b/hw/acpi/core.c @@ -27,7 +27,7 @@ #include "qapi/error.h" #include "qapi/opts-visitor.h" #include "qapi/qapi-events-run-state.h" -#include "qapi/qapi-visit-misc.h" +#include "qapi/qapi-visit-machine.h" #include "qemu/error-report.h" #include "qemu/module.h" #include "qemu/option.h" diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c index 3d6a500fb7..532d8a6e4b 100644 --- a/hw/acpi/cpu.c +++ b/hw/acpi/cpu.c @@ -3,7 +3,7 @@ #include "migration/vmstate.h" #include "hw/acpi/cpu.h" #include "qapi/error.h" -#include "qapi/qapi-events-misc.h" +#include "qapi/qapi-events-machine.h" #include "trace.h" #include "sysemu/numa.h" =20 diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c index 8d2e82240f..aa454f5cb2 100644 --- a/hw/acpi/memory_hotplug.c +++ b/hw/acpi/memory_hotplug.c @@ -7,7 +7,7 @@ #include "migration/vmstate.h" #include "trace.h" #include "qapi/error.h" -#include "qapi/qapi-events-misc.h" +#include "qapi/qapi-events-machine.h" =20 #define MEMORY_SLOTS_NUMBER "MDNR" #define MEMORY_HOTPLUG_IO_REGION "HPMR" --=20 2.21.3 From nobody Sat May 4 14:46:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590419841; cv=none; d=zohomail.com; s=zohoarc; b=VM1+4/phrq+Xkz79RjfoABBR175OkfAW+iwK6k3Xc1RW2+F1/MAqjPORM+A9UCjCpLx7u/TBBRDHAHguVBAEYOjZGFs6UnoTId1FYKkeLfhwcfvG2Dds0b3NXYavZ9SH48IA0V4MH5AcdcUyR9o32e71DDCgd9aBA+h3ACXMslQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590419841; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DO/BvadkUCoefg0yYzYKVQLnmXpv83dYTuuAYZRTCz0=; b=l38F86MDId15PVwwSUsTeqVPmDimxFiuGixeiSFTuLBxQvR3Xgxlf0VqUC+Gb1HbwIVhxXVpEIE065EZo0VrWgOWhNW5n6B/+uOwvCVG33Er6mO2szENpTvZtqv+iPGLtACJkGRgHB7AxMTwSXR11dJ8bMy8emiOX0aSUn+9MY8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 159041984112482.80703740117838; Mon, 25 May 2020 08:17:21 -0700 (PDT) Received: from localhost ([::1]:53280 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdEqr-0000su-P9 for importer@patchew.org; Mon, 25 May 2020 11:17:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54228) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdEhY-000692-6V for qemu-devel@nongnu.org; Mon, 25 May 2020 11:07:40 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:58257 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jdEhW-0006ly-94 for qemu-devel@nongnu.org; Mon, 25 May 2020 11:07:39 -0400 Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-200-jnnKIBg1PTC-ldUiYBxicQ-1; Mon, 25 May 2020 11:07:36 -0400 Received: by mail-ej1-f71.google.com with SMTP id t26so6424682ejs.19 for ; Mon, 25 May 2020 08:07:35 -0700 (PDT) Received: from x1w.redhat.com (71.red-88-21-204.staticip.rima-tde.net. [88.21.204.71]) by smtp.gmail.com with ESMTPSA id df21sm16145181edb.27.2020.05.25.08.07.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 May 2020 08:07:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590419257; 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=DO/BvadkUCoefg0yYzYKVQLnmXpv83dYTuuAYZRTCz0=; b=Ly8Ho+u1itVHS+BLG9BXHjOLoYOTd5zSnPMghMYu7+b8edkBGKFQ/o/INFD1vV/2hY/M7o yco7pcCGyhWSVW+qTBGQT1jJAknf2ougg+GWzB3HxnS5SzD7i/6QMph/4Kl5aoi1K1NS1E yiGjGh4TUE1nJuoSPWpDO/J5/AHZmns= X-MC-Unique: jnnKIBg1PTC-ldUiYBxicQ-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=DO/BvadkUCoefg0yYzYKVQLnmXpv83dYTuuAYZRTCz0=; b=Pti4Tb8yDAX6xa8+X6d7rEFRfjE/yaLqDXI0n5Sha1cdOIe9xui2rt62LxCmFNfb3Y yo1tF8+KQ2gYX69kj9k8tqlux1PgZzguNr0uN6NrsyHVV0U8jEVdljKK0JCm9O3IOTS1 VpLfJvfxhxJBfqIIwJh53XvDsOy7q4hoG0vj/aV91oWRh6o23/DbktmOlJuo8lCKifTR NxSj8b2fcNwdCdp6MOgor21yCEG4AUq0bgTsOwfy9PpaMgaRfcAPL3pbEoyqvYTZ9/il k31jo/6jZOBhTl3iBEba4vC69YS474tPKp+5bpafbr8W3sxcz9sMCH0NnCCaji4rWJ63 DHJQ== X-Gm-Message-State: AOAM533d4bJy2hSEhOnNDj1xqQIxR5wws4p/v8HT29LISFf6av3d5Vy3 G9UPBAmR1xmXUbfORP7d7PFVEQxt5xPKp5GOFiB+pPwIb2FaMBsOfr/uBvGJzh7XtlkbPdmHPdQ gvZz3+t6Am7FP1pA= X-Received: by 2002:a05:6402:c0e:: with SMTP id co14mr15468548edb.177.1590419252910; Mon, 25 May 2020 08:07:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzw7SsvlnPpjU/3yaSTAhtXmTPl1MhrdZWipZKU/I0EgM2TahrnYNSW5BzKSlTejjUrhmtXLg== X-Received: by 2002:a05:6402:c0e:: with SMTP id co14mr15468523edb.177.1590419252578; Mon, 25 May 2020 08:07:32 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v3 8/9] qapi/misc: Restrict PCI commands to machine code Date: Mon, 25 May 2020 17:06:39 +0200 Message-Id: <20200525150640.30879-9-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200525150640.30879-1-philmd@redhat.com> References: <20200525150640.30879-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.120; envelope-from=philmd@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/25 01:44:10 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Ben Warren , David Hildenbrand , Markus Armbruster , "Michael S. Tsirkin" , Peter Lieven , "Dr. David Alan Gilbert" , Eduardo Habkost , Max Reitz , Ronnie Sahlberg , Igor Mammedov , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Markus Armbruster --- qapi/machine.json | 304 ++++++++++++++++++++++++++++++++++++++++++++++ qapi/misc.json | 304 ---------------------------------------------- hw/pci/pci-stub.c | 2 +- hw/pci/pci.c | 2 +- 4 files changed, 306 insertions(+), 306 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json index 04b124be67..3ab1089a44 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -1215,3 +1215,307 @@ ## { 'event': 'ACPI_DEVICE_OST', 'data': { 'info': 'ACPIOSTInfo' } } + +## +# @PciMemoryRange: +# +# A PCI device memory region +# +# @base: the starting address (guest physical) +# +# @limit: the ending address (guest physical) +# +# Since: 0.14.0 +## +{ 'struct': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} } + +## +# @PciMemoryRegion: +# +# Information about a PCI device I/O region. +# +# @bar: the index of the Base Address Register for this region +# +# @type: - 'io' if the region is a PIO region +# - 'memory' if the region is a MMIO region +# +# @size: memory size +# +# @prefetch: if @type is 'memory', true if the memory is prefetchable +# +# @mem_type_64: if @type is 'memory', true if the BAR is 64-bit +# +# Since: 0.14.0 +## +{ 'struct': 'PciMemoryRegion', + 'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int', + '*prefetch': 'bool', '*mem_type_64': 'bool' } } + +## +# @PciBusInfo: +# +# Information about a bus of a PCI Bridge device +# +# @number: primary bus interface number. This should be the number of the +# bus the device resides on. +# +# @secondary: secondary bus interface number. This is the number of the +# main bus for the bridge +# +# @subordinate: This is the highest number bus that resides below the +# bridge. +# +# @io_range: The PIO range for all devices on this bridge +# +# @memory_range: The MMIO range for all devices on this bridge +# +# @prefetchable_range: The range of prefetchable MMIO for all devices on +# this bridge +# +# Since: 2.4 +## +{ 'struct': 'PciBusInfo', + 'data': {'number': 'int', 'secondary': 'int', 'subordinate': 'int', + 'io_range': 'PciMemoryRange', + 'memory_range': 'PciMemoryRange', + 'prefetchable_range': 'PciMemoryRange' } } + +## +# @PciBridgeInfo: +# +# Information about a PCI Bridge device +# +# @bus: information about the bus the device resides on +# +# @devices: a list of @PciDeviceInfo for each device on this bridge +# +# Since: 0.14.0 +## +{ 'struct': 'PciBridgeInfo', + 'data': {'bus': 'PciBusInfo', '*devices': ['PciDeviceInfo']} } + +## +# @PciDeviceClass: +# +# Information about the Class of a PCI device +# +# @desc: a string description of the device's class +# +# @class: the class code of the device +# +# Since: 2.4 +## +{ 'struct': 'PciDeviceClass', + 'data': {'*desc': 'str', 'class': 'int'} } + +## +# @PciDeviceId: +# +# Information about the Id of a PCI device +# +# @device: the PCI device id +# +# @vendor: the PCI vendor id +# +# @subsystem: the PCI subsystem id (since 3.1) +# +# @subsystem-vendor: the PCI subsystem vendor id (since 3.1) +# +# Since: 2.4 +## +{ 'struct': 'PciDeviceId', + 'data': {'device': 'int', 'vendor': 'int', '*subsystem': 'int', + '*subsystem-vendor': 'int'} } + +## +# @PciDeviceInfo: +# +# Information about a PCI device +# +# @bus: the bus number of the device +# +# @slot: the slot the device is located in +# +# @function: the function of the slot used by the device +# +# @class_info: the class of the device +# +# @id: the PCI device id +# +# @irq: if an IRQ is assigned to the device, the IRQ number +# +# @qdev_id: the device name of the PCI device +# +# @pci_bridge: if the device is a PCI bridge, the bridge information +# +# @regions: a list of the PCI I/O regions associated with the device +# +# Notes: the contents of @class_info.desc are not stable and should only be +# treated as informational. +# +# Since: 0.14.0 +## +{ 'struct': 'PciDeviceInfo', + 'data': {'bus': 'int', 'slot': 'int', 'function': 'int', + 'class_info': 'PciDeviceClass', 'id': 'PciDeviceId', + '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo', + 'regions': ['PciMemoryRegion']} } + +## +# @PciInfo: +# +# Information about a PCI bus +# +# @bus: the bus index +# +# @devices: a list of devices on this bus +# +# Since: 0.14.0 +## +{ 'struct': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']= } } + +## +# @query-pci: +# +# Return information about the PCI bus topology of the guest. +# +# Returns: a list of @PciInfo for each PCI bus. Each bus is +# represented by a json-object, which has a key with a json-array= of +# all PCI devices attached to it. Each device is represented by a +# json-object. +# +# Since: 0.14.0 +# +# Example: +# +# -> { "execute": "query-pci" } +# <- { "return": [ +# { +# "bus": 0, +# "devices": [ +# { +# "bus": 0, +# "qdev_id": "", +# "slot": 0, +# "class_info": { +# "class": 1536, +# "desc": "Host bridge" +# }, +# "id": { +# "device": 32902, +# "vendor": 4663 +# }, +# "function": 0, +# "regions": [ +# ] +# }, +# { +# "bus": 0, +# "qdev_id": "", +# "slot": 1, +# "class_info": { +# "class": 1537, +# "desc": "ISA bridge" +# }, +# "id": { +# "device": 32902, +# "vendor": 28672 +# }, +# "function": 0, +# "regions": [ +# ] +# }, +# { +# "bus": 0, +# "qdev_id": "", +# "slot": 1, +# "class_info": { +# "class": 257, +# "desc": "IDE controller" +# }, +# "id": { +# "device": 32902, +# "vendor": 28688 +# }, +# "function": 1, +# "regions": [ +# { +# "bar": 4, +# "size": 16, +# "address": 49152, +# "type": "io" +# } +# ] +# }, +# { +# "bus": 0, +# "qdev_id": "", +# "slot": 2, +# "class_info": { +# "class": 768, +# "desc": "VGA controller" +# }, +# "id": { +# "device": 4115, +# "vendor": 184 +# }, +# "function": 0, +# "regions": [ +# { +# "prefetch": true, +# "mem_type_64": false, +# "bar": 0, +# "size": 33554432, +# "address": 4026531840, +# "type": "memory" +# }, +# { +# "prefetch": false, +# "mem_type_64": false, +# "bar": 1, +# "size": 4096, +# "address": 4060086272, +# "type": "memory" +# }, +# { +# "prefetch": false, +# "mem_type_64": false, +# "bar": 6, +# "size": 65536, +# "address": -1, +# "type": "memory" +# } +# ] +# }, +# { +# "bus": 0, +# "qdev_id": "", +# "irq": 11, +# "slot": 4, +# "class_info": { +# "class": 1280, +# "desc": "RAM controller" +# }, +# "id": { +# "device": 6900, +# "vendor": 4098 +# }, +# "function": 0, +# "regions": [ +# { +# "bar": 0, +# "size": 32, +# "address": 49280, +# "type": "io" +# } +# ] +# } +# ] +# } +# ] +# } +# +# Note: This example has been shortened as the real response is too long. +# +## +{ 'command': 'query-pci', 'returns': ['PciInfo'] } diff --git a/qapi/misc.json b/qapi/misc.json index ecceba9d32..3f4add1c2e 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -156,310 +156,6 @@ { 'command': 'query-iothreads', 'returns': ['IOThreadInfo'], 'allow-preconfig': true } =20 -## -# @PciMemoryRange: -# -# A PCI device memory region -# -# @base: the starting address (guest physical) -# -# @limit: the ending address (guest physical) -# -# Since: 0.14.0 -## -{ 'struct': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} } - -## -# @PciMemoryRegion: -# -# Information about a PCI device I/O region. -# -# @bar: the index of the Base Address Register for this region -# -# @type: - 'io' if the region is a PIO region -# - 'memory' if the region is a MMIO region -# -# @size: memory size -# -# @prefetch: if @type is 'memory', true if the memory is prefetchable -# -# @mem_type_64: if @type is 'memory', true if the BAR is 64-bit -# -# Since: 0.14.0 -## -{ 'struct': 'PciMemoryRegion', - 'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int', - '*prefetch': 'bool', '*mem_type_64': 'bool' } } - -## -# @PciBusInfo: -# -# Information about a bus of a PCI Bridge device -# -# @number: primary bus interface number. This should be the number of the -# bus the device resides on. -# -# @secondary: secondary bus interface number. This is the number of the -# main bus for the bridge -# -# @subordinate: This is the highest number bus that resides below the -# bridge. -# -# @io_range: The PIO range for all devices on this bridge -# -# @memory_range: The MMIO range for all devices on this bridge -# -# @prefetchable_range: The range of prefetchable MMIO for all devices on -# this bridge -# -# Since: 2.4 -## -{ 'struct': 'PciBusInfo', - 'data': {'number': 'int', 'secondary': 'int', 'subordinate': 'int', - 'io_range': 'PciMemoryRange', - 'memory_range': 'PciMemoryRange', - 'prefetchable_range': 'PciMemoryRange' } } - -## -# @PciBridgeInfo: -# -# Information about a PCI Bridge device -# -# @bus: information about the bus the device resides on -# -# @devices: a list of @PciDeviceInfo for each device on this bridge -# -# Since: 0.14.0 -## -{ 'struct': 'PciBridgeInfo', - 'data': {'bus': 'PciBusInfo', '*devices': ['PciDeviceInfo']} } - -## -# @PciDeviceClass: -# -# Information about the Class of a PCI device -# -# @desc: a string description of the device's class -# -# @class: the class code of the device -# -# Since: 2.4 -## -{ 'struct': 'PciDeviceClass', - 'data': {'*desc': 'str', 'class': 'int'} } - -## -# @PciDeviceId: -# -# Information about the Id of a PCI device -# -# @device: the PCI device id -# -# @vendor: the PCI vendor id -# -# @subsystem: the PCI subsystem id (since 3.1) -# -# @subsystem-vendor: the PCI subsystem vendor id (since 3.1) -# -# Since: 2.4 -## -{ 'struct': 'PciDeviceId', - 'data': {'device': 'int', 'vendor': 'int', '*subsystem': 'int', - '*subsystem-vendor': 'int'} } - -## -# @PciDeviceInfo: -# -# Information about a PCI device -# -# @bus: the bus number of the device -# -# @slot: the slot the device is located in -# -# @function: the function of the slot used by the device -# -# @class_info: the class of the device -# -# @id: the PCI device id -# -# @irq: if an IRQ is assigned to the device, the IRQ number -# -# @qdev_id: the device name of the PCI device -# -# @pci_bridge: if the device is a PCI bridge, the bridge information -# -# @regions: a list of the PCI I/O regions associated with the device -# -# Notes: the contents of @class_info.desc are not stable and should only be -# treated as informational. -# -# Since: 0.14.0 -## -{ 'struct': 'PciDeviceInfo', - 'data': {'bus': 'int', 'slot': 'int', 'function': 'int', - 'class_info': 'PciDeviceClass', 'id': 'PciDeviceId', - '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo', - 'regions': ['PciMemoryRegion']} } - -## -# @PciInfo: -# -# Information about a PCI bus -# -# @bus: the bus index -# -# @devices: a list of devices on this bus -# -# Since: 0.14.0 -## -{ 'struct': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']= } } - -## -# @query-pci: -# -# Return information about the PCI bus topology of the guest. -# -# Returns: a list of @PciInfo for each PCI bus. Each bus is -# represented by a json-object, which has a key with a json-array= of -# all PCI devices attached to it. Each device is represented by a -# json-object. -# -# Since: 0.14.0 -# -# Example: -# -# -> { "execute": "query-pci" } -# <- { "return": [ -# { -# "bus": 0, -# "devices": [ -# { -# "bus": 0, -# "qdev_id": "", -# "slot": 0, -# "class_info": { -# "class": 1536, -# "desc": "Host bridge" -# }, -# "id": { -# "device": 32902, -# "vendor": 4663 -# }, -# "function": 0, -# "regions": [ -# ] -# }, -# { -# "bus": 0, -# "qdev_id": "", -# "slot": 1, -# "class_info": { -# "class": 1537, -# "desc": "ISA bridge" -# }, -# "id": { -# "device": 32902, -# "vendor": 28672 -# }, -# "function": 0, -# "regions": [ -# ] -# }, -# { -# "bus": 0, -# "qdev_id": "", -# "slot": 1, -# "class_info": { -# "class": 257, -# "desc": "IDE controller" -# }, -# "id": { -# "device": 32902, -# "vendor": 28688 -# }, -# "function": 1, -# "regions": [ -# { -# "bar": 4, -# "size": 16, -# "address": 49152, -# "type": "io" -# } -# ] -# }, -# { -# "bus": 0, -# "qdev_id": "", -# "slot": 2, -# "class_info": { -# "class": 768, -# "desc": "VGA controller" -# }, -# "id": { -# "device": 4115, -# "vendor": 184 -# }, -# "function": 0, -# "regions": [ -# { -# "prefetch": true, -# "mem_type_64": false, -# "bar": 0, -# "size": 33554432, -# "address": 4026531840, -# "type": "memory" -# }, -# { -# "prefetch": false, -# "mem_type_64": false, -# "bar": 1, -# "size": 4096, -# "address": 4060086272, -# "type": "memory" -# }, -# { -# "prefetch": false, -# "mem_type_64": false, -# "bar": 6, -# "size": 65536, -# "address": -1, -# "type": "memory" -# } -# ] -# }, -# { -# "bus": 0, -# "qdev_id": "", -# "irq": 11, -# "slot": 4, -# "class_info": { -# "class": 1280, -# "desc": "RAM controller" -# }, -# "id": { -# "device": 6900, -# "vendor": 4098 -# }, -# "function": 0, -# "regions": [ -# { -# "bar": 0, -# "size": 32, -# "address": 49280, -# "type": "io" -# } -# ] -# } -# ] -# } -# ] -# } -# -# Note: This example has been shortened as the real response is too long. -# -## -{ 'command': 'query-pci', 'returns': ['PciInfo'] } - ## # @stop: # diff --git a/hw/pci/pci-stub.c b/hw/pci/pci-stub.c index cc2a2e1f73..b50c7ca590 100644 --- a/hw/pci/pci-stub.c +++ b/hw/pci/pci-stub.c @@ -22,7 +22,7 @@ #include "sysemu/sysemu.h" #include "monitor/monitor.h" #include "qapi/error.h" -#include "qapi/qapi-commands-misc.h" +#include "qapi/qapi-commands-machine.h" #include "qapi/qmp/qerror.h" #include "hw/pci/pci.h" #include "hw/pci/msi.h" diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 70c66965f5..a8aa2aaa2f 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -46,7 +46,7 @@ #include "hw/hotplug.h" #include "hw/boards.h" #include "qapi/error.h" -#include "qapi/qapi-commands-misc.h" +#include "qapi/qapi-commands-machine.h" #include "qemu/cutils.h" =20 //#define DEBUG_PCI --=20 2.21.3 From nobody Sat May 4 14:46:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590419504; cv=none; d=zohomail.com; s=zohoarc; b=eitRjirjHdFmqt6KeET4GsixlCDevHIkj1fdMDfh6JnXHH3u0gwWsiWpE72B+fA2c30Kb/Fn5Rj39LcWX6dveuJ+bYyu1H01OG7gvUly22AjMdjstPL4qfEfIQ6i3wjra+5ACXEMiQESlhOjpI1cUfBsaURUH9kg9gfFq/OetsM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590419504; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=weWxNPbVdQ3MTKccN/ZjEjAT/VhUoUmdY4b4staYdWU=; b=GM9aswdkt3zXTBY9a5e3zm32jbuJcB5cBB25DEjywsf9cEtAhO4ksGuGSTqUGAtFK/qSKlx+1eEbj0y7w5obQcybg6eIVSJBL9NGiYrdXDHoISYHCTBQqJC9G/YxWHYHt7f7Sz4xIujQb7+raHHXi4A2LZMoL2iysIjlUDhX3I8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590419504467897.2167796716338; Mon, 25 May 2020 08:11:44 -0700 (PDT) Received: from localhost ([::1]:39024 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdElT-0002sP-65 for importer@patchew.org; Mon, 25 May 2020 11:11:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdEhc-0006Aw-T6 for qemu-devel@nongnu.org; Mon, 25 May 2020 11:07:44 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:47931 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jdEhb-0006pc-1i for qemu-devel@nongnu.org; Mon, 25 May 2020 11:07:44 -0400 Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-281-qLZOQ1suPd20S0OHY3Icmg-1; Mon, 25 May 2020 11:07:40 -0400 Received: by mail-ed1-f69.google.com with SMTP id g10so7610230edt.3 for ; Mon, 25 May 2020 08:07:40 -0700 (PDT) Received: from x1w.redhat.com (71.red-88-21-204.staticip.rima-tde.net. [88.21.204.71]) by smtp.gmail.com with ESMTPSA id cf7sm10835128edb.17.2020.05.25.08.07.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 May 2020 08:07:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590419262; 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=weWxNPbVdQ3MTKccN/ZjEjAT/VhUoUmdY4b4staYdWU=; b=D3+FBUrJDNzmfHlJRAErPMh+zM7SOLFo14n4MKWBuwOjC0zUcj3jH7TqanPf1vr4jZyhPD yIqKW+HZJt28+e8P2NuI92LIU+v5tiHnI4AZUjPBh8IGP1+hKa2IqPa/I76MDr3X+dGAme fgUGOeTB9SjAABX5U2LT8jN8h+4Rc6A= X-MC-Unique: qLZOQ1suPd20S0OHY3Icmg-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=weWxNPbVdQ3MTKccN/ZjEjAT/VhUoUmdY4b4staYdWU=; b=bWK4WKQrrfTOK7EYtDbUB0EaTaPDTfyAj9StPOr1X1/+dTZ7eF+wEZB9Wzanh8fAIZ YXh36OXtfniJG1GD6Uj2JQMMexajCTQPT5AgkaKZeD8zMDr2dT+OvPaiFle/B4XllPBd +xY+tqPKdWjzoITaZYmesj6FcZwuhutyv8FdsrE7scaDDUpyodmm0bH83k7Og1NAI8Qc H9vspMviKIa6JxKuXKTW2a21P6WhvpqA0TkzhKYshTMl+wDBrQgpcvePEfqSuog54I1D FUGVzsoWItjEcL1rg3o+s9I9x4BSgxuu+Xmri3BtE0Yn6jPlzu2uYQq5AWViV+QgPdMA FRAA== X-Gm-Message-State: AOAM533URog0TumwxVUsIfaYkTQoksOIKmHzInSC6OYXlOStFS/sYcke dmWCIGnFXfxWh8SpecVuMirIx3ADS04PyWIT1WKsuf979ud4kHb4g6HO8pUbzzyJoHSPIZN+coB t1FM7BbQ2ex4kWIE= X-Received: by 2002:a17:906:9617:: with SMTP id s23mr18859487ejx.505.1590419258992; Mon, 25 May 2020 08:07:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0IE+K4zLC2So3qXa3HkVhXPWoEg7qeP6z8H7ybzsEbyGgjySeeGCTQh4ahitlXrbpOdGy+g== X-Received: by 2002:a17:906:9617:: with SMTP id s23mr18859460ejx.505.1590419258633; Mon, 25 May 2020 08:07:38 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v3 9/9] qapi/misc: Restrict device memory commands to machine code Date: Mon, 25 May 2020 17:06:40 +0200 Message-Id: <20200525150640.30879-10-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200525150640.30879-1-philmd@redhat.com> References: <20200525150640.30879-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.120; envelope-from=philmd@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/25 08:28:26 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Ben Warren , David Hildenbrand , Markus Armbruster , "Michael S. Tsirkin" , Peter Lieven , "Dr. David Alan Gilbert" , Eduardo Habkost , Max Reitz , Ronnie Sahlberg , Igor Mammedov , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Acked-by: Igor Mammedov Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Markus Armbruster --- qapi/machine.json | 131 +++++++++++++++++++++++++++++++ qapi/misc.json | 132 -------------------------------- include/hw/mem/memory-device.h | 1 + include/hw/virtio/virtio-pmem.h | 2 +- 4 files changed, 133 insertions(+), 133 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json index 3ab1089a44..d1490edeb1 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -1519,3 +1519,134 @@ # ## { 'command': 'query-pci', 'returns': ['PciInfo'] } + +## +# @MemoryInfo: +# +# Actual memory information in bytes. +# +# @base-memory: size of "base" memory specified with command line +# option -m. +# +# @plugged-memory: size of memory that can be hot-unplugged. This field +# is omitted if target doesn't support memory hotplug +# (i.e. CONFIG_MEM_DEVICE not defined at build time). +# +# Since: 2.11.0 +## +{ 'struct': 'MemoryInfo', + 'data' : { 'base-memory': 'size', '*plugged-memory': 'size' } } + +## +# @query-memory-size-summary: +# +# Return the amount of initially allocated and present hotpluggable (if +# enabled) memory in bytes. +# +# Example: +# +# -> { "execute": "query-memory-size-summary" } +# <- { "return": { "base-memory": 4294967296, "plugged-memory": 0 } } +# +# Since: 2.11.0 +## +{ 'command': 'query-memory-size-summary', 'returns': 'MemoryInfo' } + +## +# @PCDIMMDeviceInfo: +# +# PCDIMMDevice state information +# +# @id: device's ID +# +# @addr: physical address, where device is mapped +# +# @size: size of memory that the device provides +# +# @slot: slot number at which device is plugged in +# +# @node: NUMA node number where device is plugged in +# +# @memdev: memory backend linked with device +# +# @hotplugged: true if device was hotplugged +# +# @hotpluggable: true if device if could be added/removed while machine is= running +# +# Since: 2.1 +## +{ 'struct': 'PCDIMMDeviceInfo', + 'data': { '*id': 'str', + 'addr': 'int', + 'size': 'int', + 'slot': 'int', + 'node': 'int', + 'memdev': 'str', + 'hotplugged': 'bool', + 'hotpluggable': 'bool' + } +} + +## +# @VirtioPMEMDeviceInfo: +# +# VirtioPMEM state information +# +# @id: device's ID +# +# @memaddr: physical address in memory, where device is mapped +# +# @size: size of memory that the device provides +# +# @memdev: memory backend linked with device +# +# Since: 4.1 +## +{ 'struct': 'VirtioPMEMDeviceInfo', + 'data': { '*id': 'str', + 'memaddr': 'size', + 'size': 'size', + 'memdev': 'str' + } +} + +## +# @MemoryDeviceInfo: +# +# Union containing information about a memory device +# +# nvdimm is included since 2.12. virtio-pmem is included since 4.1. +# +# Since: 2.1 +## +{ 'union': 'MemoryDeviceInfo', + 'data': { 'dimm': 'PCDIMMDeviceInfo', + 'nvdimm': 'PCDIMMDeviceInfo', + 'virtio-pmem': 'VirtioPMEMDeviceInfo' + } +} + +## +# @query-memory-devices: +# +# Lists available memory devices and their state +# +# Since: 2.1 +# +# Example: +# +# -> { "execute": "query-memory-devices" } +# <- { "return": [ { "data": +# { "addr": 5368709120, +# "hotpluggable": true, +# "hotplugged": true, +# "id": "d1", +# "memdev": "/objects/memX", +# "node": 0, +# "size": 1073741824, +# "slot": 0}, +# "type": "dimm" +# } ] } +# +## +{ 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] } diff --git a/qapi/misc.json b/qapi/misc.json index 3f4add1c2e..d241f67bad 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -519,39 +519,6 @@ ## { 'command': 'closefd', 'data': {'fdname': 'str'} } =20 -## -# @MemoryInfo: -# -# Actual memory information in bytes. -# -# @base-memory: size of "base" memory specified with command line -# option -m. -# -# @plugged-memory: size of memory that can be hot-unplugged. This field -# is omitted if target doesn't support memory hotplug -# (i.e. CONFIG_MEM_DEVICE not defined at build time). -# -# Since: 2.11.0 -## -{ 'struct': 'MemoryInfo', - 'data' : { 'base-memory': 'size', '*plugged-memory': 'size' } } - -## -# @query-memory-size-summary: -# -# Return the amount of initially allocated and present hotpluggable (if -# enabled) memory in bytes. -# -# Example: -# -# -> { "execute": "query-memory-size-summary" } -# <- { "return": { "base-memory": 4294967296, "plugged-memory": 0 } } -# -# Since: 2.11.0 -## -{ 'command': 'query-memory-size-summary', 'returns': 'MemoryInfo' } - - ## # @AddfdInfo: # @@ -789,105 +756,6 @@ 'returns': ['CommandLineOptionInfo'], 'allow-preconfig': true } =20 -## -# @PCDIMMDeviceInfo: -# -# PCDIMMDevice state information -# -# @id: device's ID -# -# @addr: physical address, where device is mapped -# -# @size: size of memory that the device provides -# -# @slot: slot number at which device is plugged in -# -# @node: NUMA node number where device is plugged in -# -# @memdev: memory backend linked with device -# -# @hotplugged: true if device was hotplugged -# -# @hotpluggable: true if device if could be added/removed while machine is= running -# -# Since: 2.1 -## -{ 'struct': 'PCDIMMDeviceInfo', - 'data': { '*id': 'str', - 'addr': 'int', - 'size': 'int', - 'slot': 'int', - 'node': 'int', - 'memdev': 'str', - 'hotplugged': 'bool', - 'hotpluggable': 'bool' - } -} - -## -# @VirtioPMEMDeviceInfo: -# -# VirtioPMEM state information -# -# @id: device's ID -# -# @memaddr: physical address in memory, where device is mapped -# -# @size: size of memory that the device provides -# -# @memdev: memory backend linked with device -# -# Since: 4.1 -## -{ 'struct': 'VirtioPMEMDeviceInfo', - 'data': { '*id': 'str', - 'memaddr': 'size', - 'size': 'size', - 'memdev': 'str' - } -} - -## -# @MemoryDeviceInfo: -# -# Union containing information about a memory device -# -# nvdimm is included since 2.12. virtio-pmem is included since 4.1. -# -# Since: 2.1 -## -{ 'union': 'MemoryDeviceInfo', - 'data': { 'dimm': 'PCDIMMDeviceInfo', - 'nvdimm': 'PCDIMMDeviceInfo', - 'virtio-pmem': 'VirtioPMEMDeviceInfo' - } -} - -## -# @query-memory-devices: -# -# Lists available memory devices and their state -# -# Since: 2.1 -# -# Example: -# -# -> { "execute": "query-memory-devices" } -# <- { "return": [ { "data": -# { "addr": 5368709120, -# "hotpluggable": true, -# "hotplugged": true, -# "id": "d1", -# "memdev": "/objects/memX", -# "node": 0, -# "size": 1073741824, -# "slot": 0}, -# "type": "dimm" -# } ] } -# -## -{ 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] } - ## # @ReplayMode: # diff --git a/include/hw/mem/memory-device.h b/include/hw/mem/memory-device.h index 04476acb8f..76f3de0f7e 100644 --- a/include/hw/mem/memory-device.h +++ b/include/hw/mem/memory-device.h @@ -14,6 +14,7 @@ #define MEMORY_DEVICE_H =20 #include "hw/qdev-core.h" +#include "qapi/qapi-types-machine.h" #include "qapi/qapi-types-misc.h" #include "qom/object.h" =20 diff --git a/include/hw/virtio/virtio-pmem.h b/include/hw/virtio/virtio-pme= m.h index 33f1999320..72863412b2 100644 --- a/include/hw/virtio/virtio-pmem.h +++ b/include/hw/virtio/virtio-pmem.h @@ -15,7 +15,7 @@ #define HW_VIRTIO_PMEM_H =20 #include "hw/virtio/virtio.h" -#include "qapi/qapi-types-misc.h" +#include "qapi/qapi-types-machine.h" =20 #define TYPE_VIRTIO_PMEM "virtio-pmem" =20 --=20 2.21.3