From nobody Fri Oct 24 09:58:55 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1518782984450425.4327619805165; Fri, 16 Feb 2018 04:09:44 -0800 (PST) Received: from localhost ([::1]:41670 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emepj-0006rQ-Ik for importer@patchew.org; Fri, 16 Feb 2018 07:09:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38620) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emelH-0002D0-47 for qemu-devel@nongnu.org; Fri, 16 Feb 2018 07:05:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emelB-0002vU-Sa for qemu-devel@nongnu.org; Fri, 16 Feb 2018 07:05:07 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:42120 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1emelB-0002uz-Ll for qemu-devel@nongnu.org; Fri, 16 Feb 2018 07:05:01 -0500 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w1GBsYno145204 for ; Fri, 16 Feb 2018 07:04:59 -0500 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0b-001b2d01.pphosted.com with ESMTP id 2g5t55u1hj-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 16 Feb 2018 07:04:59 -0500 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 16 Feb 2018 12:04:57 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 16 Feb 2018 12:04:54 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w1GC4rDa47382682; Fri, 16 Feb 2018 12:04:53 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7EDB711C054; Fri, 16 Feb 2018 11:58:03 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 26B3011C052; Fri, 16 Feb 2018 11:58:03 +0000 (GMT) Received: from bradbury.ibm.com (unknown [9.152.222.92]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 16 Feb 2018 11:58:03 +0000 (GMT) From: Viktor Mihajlovski To: qemu-devel@nongnu.org Date: Fri, 16 Feb 2018 13:04:48 +0100 X-Mailer: git-send-email 1.9.1 In-Reply-To: <1518782691-1232-1-git-send-email-mihajlov@linux.vnet.ibm.com> References: <1518782691-1232-1-git-send-email-mihajlov@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18021612-0012-0000-0000-000005B16DAD X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18021612-0013-0000-0000-0000192D7190 Message-Id: <1518782691-1232-2-git-send-email-mihajlov@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-02-16_04:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1802160144 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCHv4 1/4] qmp: expose s390-specific CPU info X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, david@redhat.com, cohuck@redhat.com, armbru@redhat.com, agraf@suse.de, borntraeger@de.ibm.com, qemu-s390x@nongnu.org, pbonzini@redhat.com, dgilbert@redhat.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Presently s390x is the only architecture not exposing specific CPU information via QMP query-cpus. Upstream discussion has shown that it could make sense to report the architecture specific CPU state, e.g. to detect that a CPU has been stopped. With this change the output of query-cpus will look like this on s390: [ {"arch": "s390", "current": true, "props": {"core-id": 0}, "cpu-state": "operating", "CPU": 0, "qom_path": "/machine/unattached/device[0]", "halted": false, "thread_id": 63115}, {"arch": "s390", "current": false, "props": {"core-id": 1}, "cpu-state": "stopped", "CPU": 1, "qom_path": "/machine/unattached/device[1]", "halted": true, "thread_id": 63116} ] Signed-off-by: Viktor Mihajlovski Acked-by: Eric Blake Reviewed-by: David Hildenbrand Reviewed-by: Christian Borntraeger Acked-by into Reviewed-by: Eric Blake --- cpus.c | 6 ++++++ hw/intc/s390_flic.c | 4 ++-- hw/s390x/s390-virtio-ccw.c | 2 +- qapi-schema.json | 28 +++++++++++++++++++++++++++- target/s390x/cpu.c | 24 ++++++++++++------------ target/s390x/cpu.h | 7 ++----- target/s390x/kvm.c | 8 ++++---- target/s390x/sigp.c | 38 +++++++++++++++++++------------------- 8 files changed, 73 insertions(+), 44 deletions(-) diff --git a/cpus.c b/cpus.c index f298b65..6006931 100644 --- a/cpus.c +++ b/cpus.c @@ -2100,6 +2100,9 @@ CpuInfoList *qmp_query_cpus(Error **errp) #elif defined(TARGET_TRICORE) TriCoreCPU *tricore_cpu =3D TRICORE_CPU(cpu); CPUTriCoreState *env =3D &tricore_cpu->env; +#elif defined(TARGET_S390X) + S390CPU *s390_cpu =3D S390_CPU(cpu); + CPUS390XState *env =3D &s390_cpu->env; #endif =20 cpu_synchronize_state(cpu); @@ -2127,6 +2130,9 @@ CpuInfoList *qmp_query_cpus(Error **errp) #elif defined(TARGET_TRICORE) info->value->arch =3D CPU_INFO_ARCH_TRICORE; info->value->u.tricore.PC =3D env->PC; +#elif defined(TARGET_S390X) + info->value->arch =3D CPU_INFO_ARCH_S390; + info->value->u.s390.cpu_state =3D env->cpu_state; #else info->value->arch =3D CPU_INFO_ARCH_OTHER; #endif diff --git a/hw/intc/s390_flic.c b/hw/intc/s390_flic.c index a85a149..5f8168f 100644 --- a/hw/intc/s390_flic.c +++ b/hw/intc/s390_flic.c @@ -192,8 +192,8 @@ static void qemu_s390_flic_notify(uint32_t type) cs->interrupt_request |=3D CPU_INTERRUPT_HARD; =20 /* ignore CPUs that are not sleeping */ - if (s390_cpu_get_state(cpu) !=3D CPU_STATE_OPERATING && - s390_cpu_get_state(cpu) !=3D CPU_STATE_LOAD) { + if (s390_cpu_get_state(cpu) !=3D S390_CPU_STATE_OPERATING && + s390_cpu_get_state(cpu) !=3D S390_CPU_STATE_LOAD) { continue; } =20 diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 4abbe89..4d0c3de 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -368,7 +368,7 @@ static void s390_machine_reset(void) =20 /* all cpus are stopped - configure and start the ipl cpu only */ s390_ipl_prepare_cpu(ipl_cpu); - s390_cpu_set_state(CPU_STATE_OPERATING, ipl_cpu); + s390_cpu_set_state(S390_CPU_STATE_OPERATING, ipl_cpu); } =20 static void s390_machine_device_plug(HotplugHandler *hotplug_dev, diff --git a/qapi-schema.json b/qapi-schema.json index 0262b9f..94d560e 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -410,10 +410,12 @@ # An enumeration of cpu types that enable additional information during # @query-cpus. # +# @s390: since 2.12 +# # Since: 2.6 ## { 'enum': 'CpuInfoArch', - 'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 'other' ] } + 'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 's390', 'other' ] } =20 ## # @CpuInfo: @@ -452,6 +454,7 @@ 'ppc': 'CpuInfoPPC', 'mips': 'CpuInfoMIPS', 'tricore': 'CpuInfoTricore', + 's390': 'CpuInfoS390', 'other': 'CpuInfoOther' } } =20 ## @@ -522,6 +525,29 @@ { 'struct': 'CpuInfoOther', 'data': { } } =20 ## +# @CpuS390State: +# +# An enumeration of cpu states that can be assumed by a virtual +# S390 CPU +# +# Since: 2.12 +## +{ 'enum': 'CpuS390State', + 'prefix': 'S390_CPU_STATE', + 'data': [ 'uninitialized', 'stopped', 'check-stop', 'operating', 'load' = ] } + +## +# @CpuInfoS390: +# +# Additional information about a virtual S390 CPU +# +# @cpu-state: the virtual CPU's state +# +# Since: 2.12 +## +{ 'struct': 'CpuInfoS390', 'data': { 'cpu-state': 'CpuS390State' } } + +## # @query-cpus: # # Returns a list of information about each virtual CPU. diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index da7cb9c..52b74ed 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -58,8 +58,8 @@ static bool s390_cpu_has_work(CPUState *cs) S390CPU *cpu =3D S390_CPU(cs); =20 /* STOPPED cpus can never wake up */ - if (s390_cpu_get_state(cpu) !=3D CPU_STATE_LOAD && - s390_cpu_get_state(cpu) !=3D CPU_STATE_OPERATING) { + if (s390_cpu_get_state(cpu) !=3D S390_CPU_STATE_LOAD && + s390_cpu_get_state(cpu) !=3D S390_CPU_STATE_OPERATING) { return false; } =20 @@ -77,7 +77,7 @@ static void s390_cpu_load_normal(CPUState *s) S390CPU *cpu =3D S390_CPU(s); cpu->env.psw.addr =3D ldl_phys(s->as, 4) & PSW_MASK_ESA_ADDR; cpu->env.psw.mask =3D PSW_MASK_32 | PSW_MASK_64; - s390_cpu_set_state(CPU_STATE_OPERATING, cpu); + s390_cpu_set_state(S390_CPU_STATE_OPERATING, cpu); } #endif =20 @@ -92,7 +92,7 @@ static void s390_cpu_reset(CPUState *s) env->bpbc =3D false; scc->parent_reset(s); cpu->env.sigp_order =3D 0; - s390_cpu_set_state(CPU_STATE_STOPPED, cpu); + s390_cpu_set_state(S390_CPU_STATE_STOPPED, cpu); } =20 /* S390CPUClass::initial_reset() */ @@ -135,7 +135,7 @@ static void s390_cpu_full_reset(CPUState *s) =20 scc->parent_reset(s); cpu->env.sigp_order =3D 0; - s390_cpu_set_state(CPU_STATE_STOPPED, cpu); + s390_cpu_set_state(S390_CPU_STATE_STOPPED, cpu); =20 memset(env, 0, offsetof(CPUS390XState, end_reset_fields)); =20 @@ -247,7 +247,7 @@ static void s390_cpu_initfn(Object *obj) env->tod_basetime =3D 0; env->tod_timer =3D timer_new_ns(QEMU_CLOCK_VIRTUAL, s390x_tod_timer, c= pu); env->cpu_timer =3D timer_new_ns(QEMU_CLOCK_VIRTUAL, s390x_cpu_timer, c= pu); - s390_cpu_set_state(CPU_STATE_STOPPED, cpu); + s390_cpu_set_state(S390_CPU_STATE_STOPPED, cpu); #endif } =20 @@ -275,8 +275,8 @@ static unsigned s390_count_running_cpus(void) =20 CPU_FOREACH(cpu) { uint8_t state =3D S390_CPU(cpu)->env.cpu_state; - if (state =3D=3D CPU_STATE_OPERATING || - state =3D=3D CPU_STATE_LOAD) { + if (state =3D=3D S390_CPU_STATE_OPERATING || + state =3D=3D S390_CPU_STATE_LOAD) { if (!disabled_wait(cpu)) { nr_running++; } @@ -315,13 +315,13 @@ unsigned int s390_cpu_set_state(uint8_t cpu_state, S3= 90CPU *cpu) trace_cpu_set_state(CPU(cpu)->cpu_index, cpu_state); =20 switch (cpu_state) { - case CPU_STATE_STOPPED: - case CPU_STATE_CHECK_STOP: + case S390_CPU_STATE_STOPPED: + case S390_CPU_STATE_CHECK_STOP: /* halt the cpu for common infrastructure */ s390_cpu_halt(cpu); break; - case CPU_STATE_OPERATING: - case CPU_STATE_LOAD: + case S390_CPU_STATE_OPERATING: + case S390_CPU_STATE_LOAD: /* * Starting a CPU with a PSW WAIT bit set: * KVM: handles this internally and triggers another WAIT exit. diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 21ce40d..66baa7a 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -141,12 +141,9 @@ struct CPUS390XState { * architectures, there is a difference between a halt and a stop on s= 390. * If all cpus are either stopped (including check stop) or in the dis= abled * wait state, the vm can be shut down. + * The acceptable cpu_state values are defined in the CpuInfoS390State + * enum. */ -#define CPU_STATE_UNINITIALIZED 0x00 -#define CPU_STATE_STOPPED 0x01 -#define CPU_STATE_CHECK_STOP 0x02 -#define CPU_STATE_OPERATING 0x03 -#define CPU_STATE_LOAD 0x04 uint8_t cpu_state; =20 /* currently processed sigp order */ diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index 0301e9d..45dd1c5 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -1881,16 +1881,16 @@ int kvm_s390_set_cpu_state(S390CPU *cpu, uint8_t cp= u_state) } =20 switch (cpu_state) { - case CPU_STATE_STOPPED: + case S390_CPU_STATE_STOPPED: mp_state.mp_state =3D KVM_MP_STATE_STOPPED; break; - case CPU_STATE_CHECK_STOP: + case S390_CPU_STATE_CHECK_STOP: mp_state.mp_state =3D KVM_MP_STATE_CHECK_STOP; break; - case CPU_STATE_OPERATING: + case S390_CPU_STATE_OPERATING: mp_state.mp_state =3D KVM_MP_STATE_OPERATING; break; - case CPU_STATE_LOAD: + case S390_CPU_STATE_LOAD: mp_state.mp_state =3D KVM_MP_STATE_LOAD; break; default: diff --git a/target/s390x/sigp.c b/target/s390x/sigp.c index ac3f8e7..5a7a9c4 100644 --- a/target/s390x/sigp.c +++ b/target/s390x/sigp.c @@ -46,13 +46,13 @@ static void sigp_sense(S390CPU *dst_cpu, SigpInfo *si) } =20 /* sensing without locks is racy, but it's the same for real hw */ - if (state !=3D CPU_STATE_STOPPED && !ext_call) { + if (state !=3D S390_CPU_STATE_STOPPED && !ext_call) { si->cc =3D SIGP_CC_ORDER_CODE_ACCEPTED; } else { if (ext_call) { status |=3D SIGP_STAT_EXT_CALL_PENDING; } - if (state =3D=3D CPU_STATE_STOPPED) { + if (state =3D=3D S390_CPU_STATE_STOPPED) { status |=3D SIGP_STAT_STOPPED; } set_sigp_status(si, status); @@ -94,12 +94,12 @@ static void sigp_start(CPUState *cs, run_on_cpu_data ar= g) S390CPU *cpu =3D S390_CPU(cs); SigpInfo *si =3D arg.host_ptr; =20 - if (s390_cpu_get_state(cpu) !=3D CPU_STATE_STOPPED) { + if (s390_cpu_get_state(cpu) !=3D S390_CPU_STATE_STOPPED) { si->cc =3D SIGP_CC_ORDER_CODE_ACCEPTED; return; } =20 - s390_cpu_set_state(CPU_STATE_OPERATING, cpu); + s390_cpu_set_state(S390_CPU_STATE_OPERATING, cpu); si->cc =3D SIGP_CC_ORDER_CODE_ACCEPTED; } =20 @@ -108,14 +108,14 @@ static void sigp_stop(CPUState *cs, run_on_cpu_data a= rg) S390CPU *cpu =3D S390_CPU(cs); SigpInfo *si =3D arg.host_ptr; =20 - if (s390_cpu_get_state(cpu) !=3D CPU_STATE_OPERATING) { + if (s390_cpu_get_state(cpu) !=3D S390_CPU_STATE_OPERATING) { si->cc =3D SIGP_CC_ORDER_CODE_ACCEPTED; return; } =20 /* disabled wait - sleeping in user space */ if (cs->halted) { - s390_cpu_set_state(CPU_STATE_STOPPED, cpu); + s390_cpu_set_state(S390_CPU_STATE_STOPPED, cpu); } else { /* execute the stop function */ cpu->env.sigp_order =3D SIGP_STOP; @@ -130,17 +130,17 @@ static void sigp_stop_and_store_status(CPUState *cs, = run_on_cpu_data arg) SigpInfo *si =3D arg.host_ptr; =20 /* disabled wait - sleeping in user space */ - if (s390_cpu_get_state(cpu) =3D=3D CPU_STATE_OPERATING && cs->halted) { - s390_cpu_set_state(CPU_STATE_STOPPED, cpu); + if (s390_cpu_get_state(cpu) =3D=3D S390_CPU_STATE_OPERATING && cs->hal= ted) { + s390_cpu_set_state(S390_CPU_STATE_STOPPED, cpu); } =20 switch (s390_cpu_get_state(cpu)) { - case CPU_STATE_OPERATING: + case S390_CPU_STATE_OPERATING: cpu->env.sigp_order =3D SIGP_STOP_STORE_STATUS; cpu_inject_stop(cpu); /* store will be performed in do_stop_interrup() */ break; - case CPU_STATE_STOPPED: + case S390_CPU_STATE_STOPPED: /* already stopped, just store the status */ cpu_synchronize_state(cs); s390_store_status(cpu, S390_STORE_STATUS_DEF_ADDR, true); @@ -156,7 +156,7 @@ static void sigp_store_status_at_address(CPUState *cs, = run_on_cpu_data arg) uint32_t address =3D si->param & 0x7ffffe00u; =20 /* cpu has to be stopped */ - if (s390_cpu_get_state(cpu) !=3D CPU_STATE_STOPPED) { + if (s390_cpu_get_state(cpu) !=3D S390_CPU_STATE_STOPPED) { set_sigp_status(si, SIGP_STAT_INCORRECT_STATE); return; } @@ -186,7 +186,7 @@ static void sigp_store_adtl_status(CPUState *cs, run_on= _cpu_data arg) } =20 /* cpu has to be stopped */ - if (s390_cpu_get_state(cpu) !=3D CPU_STATE_STOPPED) { + if (s390_cpu_get_state(cpu) !=3D S390_CPU_STATE_STOPPED) { set_sigp_status(si, SIGP_STAT_INCORRECT_STATE); return; } @@ -229,17 +229,17 @@ static void sigp_restart(CPUState *cs, run_on_cpu_dat= a arg) SigpInfo *si =3D arg.host_ptr; =20 switch (s390_cpu_get_state(cpu)) { - case CPU_STATE_STOPPED: + case S390_CPU_STATE_STOPPED: /* the restart irq has to be delivered prior to any other pending = irq */ cpu_synchronize_state(cs); /* * Set OPERATING (and unhalting) before loading the restart PSW. * load_psw() will then properly halt the CPU again if necessary (= TCG). */ - s390_cpu_set_state(CPU_STATE_OPERATING, cpu); + s390_cpu_set_state(S390_CPU_STATE_OPERATING, cpu); do_restart_interrupt(&cpu->env); break; - case CPU_STATE_OPERATING: + case S390_CPU_STATE_OPERATING: cpu_inject_restart(cpu); break; } @@ -285,7 +285,7 @@ static void sigp_set_prefix(CPUState *cs, run_on_cpu_da= ta arg) } =20 /* cpu has to be stopped */ - if (s390_cpu_get_state(cpu) !=3D CPU_STATE_STOPPED) { + if (s390_cpu_get_state(cpu) !=3D S390_CPU_STATE_STOPPED) { set_sigp_status(si, SIGP_STAT_INCORRECT_STATE); return; } @@ -318,7 +318,7 @@ static void sigp_cond_emergency(S390CPU *src_cpu, S390C= PU *dst_cpu, p_asn =3D dst_cpu->env.cregs[4] & 0xffff; /* Primary ASN */ s_asn =3D dst_cpu->env.cregs[3] & 0xffff; /* Secondary ASN */ =20 - if (s390_cpu_get_state(dst_cpu) !=3D CPU_STATE_STOPPED || + if (s390_cpu_get_state(dst_cpu) !=3D S390_CPU_STATE_STOPPED || (psw_mask & psw_int_mask) !=3D psw_int_mask || (idle && psw_addr !=3D 0) || (!idle && (asn =3D=3D p_asn || asn =3D=3D s_asn))) { @@ -435,7 +435,7 @@ static int sigp_set_architecture(S390CPU *cpu, uint32_t= param, if (cur_cpu =3D=3D cpu) { continue; } - if (s390_cpu_get_state(cur_cpu) !=3D CPU_STATE_STOPPED) { + if (s390_cpu_get_state(cur_cpu) !=3D S390_CPU_STATE_STOPPED) { all_stopped =3D false; } } @@ -492,7 +492,7 @@ void do_stop_interrupt(CPUS390XState *env) { S390CPU *cpu =3D s390_env_get_cpu(env); =20 - if (s390_cpu_set_state(CPU_STATE_STOPPED, cpu) =3D=3D 0) { + if (s390_cpu_set_state(S390_CPU_STATE_STOPPED, cpu) =3D=3D 0) { qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); } if (cpu->env.sigp_order =3D=3D SIGP_STOP_STORE_STATUS) { --=20 1.9.1 From nobody Fri Oct 24 09:58:55 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1518782829216138.2858098757523; Fri, 16 Feb 2018 04:07:09 -0800 (PST) Received: from localhost ([::1]:41326 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emenE-0003Yy-9H for importer@patchew.org; Fri, 16 Feb 2018 07:07:08 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38627) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emelH-0002DO-KF for qemu-devel@nongnu.org; Fri, 16 Feb 2018 07:05:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emelD-0002wT-DY for qemu-devel@nongnu.org; Fri, 16 Feb 2018 07:05:07 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:38992 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1emelD-0002w4-8W for qemu-devel@nongnu.org; Fri, 16 Feb 2018 07:05:03 -0500 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w1GBuJNx101853 for ; Fri, 16 Feb 2018 07:05:00 -0500 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0b-001b2d01.pphosted.com with ESMTP id 2g5u9x0rr5-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 16 Feb 2018 07:05:00 -0500 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 16 Feb 2018 12:04:58 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 16 Feb 2018 12:04:55 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w1GC4toN38797558; Fri, 16 Feb 2018 12:04:55 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E26FA11C04C; Fri, 16 Feb 2018 11:58:04 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8A51411C052; Fri, 16 Feb 2018 11:58:04 +0000 (GMT) Received: from bradbury.ibm.com (unknown [9.152.222.92]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 16 Feb 2018 11:58:04 +0000 (GMT) From: Viktor Mihajlovski To: qemu-devel@nongnu.org Date: Fri, 16 Feb 2018 13:04:49 +0100 X-Mailer: git-send-email 1.9.1 In-Reply-To: <1518782691-1232-1-git-send-email-mihajlov@linux.vnet.ibm.com> References: <1518782691-1232-1-git-send-email-mihajlov@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18021612-0020-0000-0000-000003F86F51 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18021612-0021-0000-0000-0000428C72BC Message-Id: <1518782691-1232-3-git-send-email-mihajlov@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-02-16_04:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=3 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1802160144 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCHv4 2/4] qmp: add query-cpus-fast X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, david@redhat.com, cohuck@redhat.com, armbru@redhat.com, agraf@suse.de, borntraeger@de.ibm.com, qemu-s390x@nongnu.org, pbonzini@redhat.com, dgilbert@redhat.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Luiz Capitulino The query-cpus command has an extremely serious side effect: it always interrupts all running vCPUs so that they can run ioctl calls. This can cause a huge performance degradation for some workloads. And most of the information retrieved by the ioctl calls are not even used by query-cpus. This commit introduces a replacement for query-cpus called query-cpus-fast, which has the following features: o Never interrupt vCPUs threads. query-cpus-fast only returns vCPU information maintained by QEMU itself, which should be sufficient for most management software needs o Drop "halted" field as it can not be retrieved in a fast way on most architectures o Drop irrelevant fields such as "current", "pc" and "arch" o Rename some fields for better clarification & proper naming standard Further, the HMP "info cpus" implementation is changed to use the new QMP interface to avoid the side effects caused by query-cpus. This means that only a reduced subset of cpu information will be reported, which is acceptable as the content of "info cpus" is not documented or guaranteed to be stable. Signed-off-by: Luiz Capitulino Signed-off-by: Viktor Mihajlovski Reviewed-by: Cornelia Huck Acked-by: Eric Blake Acked-by. But I do think this means we need a v5. --- cpus.c | 38 ++++++++++++++++++++++++++++++ hmp.c | 46 +++++-------------------------------- qapi-schema.json | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++= ++++ 3 files changed, 114 insertions(+), 40 deletions(-) diff --git a/cpus.c b/cpus.c index 6006931..6df6660 100644 --- a/cpus.c +++ b/cpus.c @@ -2156,6 +2156,44 @@ CpuInfoList *qmp_query_cpus(Error **errp) return head; } =20 +/* + * fast means: we NEVER interrupt vCPU threads to retrieve + * information from KVM. + */ +CpuInfoFastList *qmp_query_cpus_fast(Error **errp) +{ + MachineState *ms =3D MACHINE(qdev_get_machine()); + MachineClass *mc =3D MACHINE_GET_CLASS(ms); + CpuInfoFastList *head =3D NULL, *cur_item =3D NULL; + CPUState *cpu; + + CPU_FOREACH(cpu) { + CpuInfoFastList *info =3D g_malloc0(sizeof(*info)); + info->value =3D g_malloc0(sizeof(*info->value)); + + info->value->cpu_index =3D cpu->cpu_index; + info->value->qom_path =3D object_get_canonical_path(OBJECT(cpu)); + info->value->thread_id =3D cpu->thread_id; + + info->value->has_props =3D !!mc->cpu_index_to_instance_props; + if (info->value->has_props) { + CpuInstanceProperties *props; + props =3D g_malloc0(sizeof(*props)); + *props =3D mc->cpu_index_to_instance_props(ms, cpu->cpu_index); + info->value->props =3D props; + } + + if (!cur_item) { + head =3D cur_item =3D info; + } else { + cur_item->next =3D info; + cur_item =3D info; + } + } + + return head; +} + void qmp_memsave(int64_t addr, int64_t size, const char *filename, bool has_cpu, int64_t cpu_index, Error **errp) { diff --git a/hmp.c b/hmp.c index 7870d6a..28b1070 100644 --- a/hmp.c +++ b/hmp.c @@ -360,50 +360,16 @@ void hmp_info_migrate_cache_size(Monitor *mon, const = QDict *qdict) =20 void hmp_info_cpus(Monitor *mon, const QDict *qdict) { - CpuInfoList *cpu_list, *cpu; + CpuInfoFastList *head, *cpu; =20 - cpu_list =3D qmp_query_cpus(NULL); + head =3D qmp_query_cpus_fast(NULL); =20 - for (cpu =3D cpu_list; cpu; cpu =3D cpu->next) { - int active =3D ' '; - - if (cpu->value->CPU =3D=3D monitor_get_cpu_index()) { - active =3D '*'; - } - - monitor_printf(mon, "%c CPU #%" PRId64 ":", active, cpu->value->CP= U); - - switch (cpu->value->arch) { - case CPU_INFO_ARCH_X86: - monitor_printf(mon, " pc=3D0x%016" PRIx64, cpu->value->u.x86.p= c); - break; - case CPU_INFO_ARCH_PPC: - monitor_printf(mon, " nip=3D0x%016" PRIx64, cpu->value->u.ppc.= nip); - break; - case CPU_INFO_ARCH_SPARC: - monitor_printf(mon, " pc=3D0x%016" PRIx64, - cpu->value->u.q_sparc.pc); - monitor_printf(mon, " npc=3D0x%016" PRIx64, - cpu->value->u.q_sparc.npc); - break; - case CPU_INFO_ARCH_MIPS: - monitor_printf(mon, " PC=3D0x%016" PRIx64, cpu->value->u.q_mip= s.PC); - break; - case CPU_INFO_ARCH_TRICORE: - monitor_printf(mon, " PC=3D0x%016" PRIx64, cpu->value->u.trico= re.PC); - break; - default: - break; - } - - if (cpu->value->halted) { - monitor_printf(mon, " (halted)"); - } - - monitor_printf(mon, " thread_id=3D%" PRId64 "\n", cpu->value->thre= ad_id); + for (cpu =3D head; cpu; cpu =3D cpu->next) { + monitor_printf(mon, " CPU #%" PRId64 ":", cpu->value->cpu_index); + monitor_printf(mon, " thread-id=3D%" PRId64 "\n", cpu->value->thre= ad_id); } =20 - qapi_free_CpuInfoList(cpu_list); + qapi_free_CpuInfoFastList(head); } =20 static void print_block_info(Monitor *mon, BlockInfo *info, diff --git a/qapi-schema.json b/qapi-schema.json index 94d560e..815f072 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -552,6 +552,12 @@ # # Returns a list of information about each virtual CPU. # +# This command causes vCPU threads to exit to userspace, which causes +# a small interruption to guest CPU execution. This will have a negative +# impact on realtime guests and other latency sensitive guest workloads. +# It is recommended to use @query-cpus-fast instead of this command to +# avoid the vCPU interruption. +# # Returns: a list of @CpuInfo for each virtual CPU # # Since: 0.14.0 @@ -585,6 +591,70 @@ { 'command': 'query-cpus', 'returns': ['CpuInfo'] } =20 ## +# @CpuInfoFast: +# +# Information about a virtual CPU +# +# @cpu-index: index of the virtual CPU +# +# @qom-path: path to the CPU object in the QOM tree +# +# @thread-id: ID of the underlying host thread +# +# @props: properties describing to which node/socket/core/thread +# virtual CPU belongs to, provided if supported by board +# +# Since: 2.12 +# +## +{ 'struct': 'CpuInfoFast', + 'data': {'cpu-index': 'int', 'qom-path': 'str', + 'thread-id': 'int', '*props': 'CpuInstanceProperties' } } + +## +# @query-cpus-fast: +# +# Returns information about all virtual CPUs. This command does not +# incur a performance penalty and should be used in production +# instead of query-cpus. +# +# Returns: list of @CpuInfoFast +# +# Notes: The CPU architecture name is not returned by query-cpus-fast. +# Use query-target to retrieve that information. +# +# Since: 2.12 +# +# Example: +# +# -> { "execute": "query-cpus-fast" } +# <- { "return": [ +# { +# "thread-id": 25627, +# "props": { +# "core-id": 0, +# "thread-id": 0, +# "socket-id": 0 +# }, +# "qom-path": "/machine/unattached/device[0]", +# "cpu-index": 0 +# }, +# { +# "thread-id": 25628, +# "props": { +# "core-id": 0, +# "thread-id": 0, +# "socket-id": 1 +# }, +# "qom-path": "/machine/unattached/device[2]", +# "cpu-index": 1 +# } +# ] +# } +## +{ 'command': 'query-cpus-fast', 'returns': [ 'CpuInfoFast' ] } + +## # @IOThreadInfo: # # Information about an iothread --=20 1.9.1 From nobody Fri Oct 24 09:58:55 2025 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1518783158879790.5347615602581; Fri, 16 Feb 2018 04:12:38 -0800 (PST) Received: from localhost ([::1]:41938 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emesT-0000Oe-3F for importer@patchew.org; Fri, 16 Feb 2018 07:12:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38634) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emelI-0002Dy-94 for qemu-devel@nongnu.org; Fri, 16 Feb 2018 07:05:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emelE-0002y3-Fa for qemu-devel@nongnu.org; Fri, 16 Feb 2018 07:05:08 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:53080) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1emelE-0002wX-6W for qemu-devel@nongnu.org; Fri, 16 Feb 2018 07:05:04 -0500 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w1GC3AYG082551 for ; Fri, 16 Feb 2018 07:05:03 -0500 Received: from e06smtp12.uk.ibm.com (e06smtp12.uk.ibm.com [195.75.94.108]) by mx0a-001b2d01.pphosted.com with ESMTP id 2g5wa1bx6c-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 16 Feb 2018 07:05:02 -0500 Received: from localhost by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 16 Feb 2018 12:04:59 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 16 Feb 2018 12:04:56 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w1GC4uGo000284; Fri, 16 Feb 2018 12:04:56 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4D0ED11C04A; Fri, 16 Feb 2018 11:58:06 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EDB0111C05B; Fri, 16 Feb 2018 11:58:05 +0000 (GMT) Received: from bradbury.ibm.com (unknown [9.152.222.92]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 16 Feb 2018 11:58:05 +0000 (GMT) From: Viktor Mihajlovski To: qemu-devel@nongnu.org Date: Fri, 16 Feb 2018 13:04:50 +0100 X-Mailer: git-send-email 1.9.1 In-Reply-To: <1518782691-1232-1-git-send-email-mihajlov@linux.vnet.ibm.com> References: <1518782691-1232-1-git-send-email-mihajlov@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18021612-0008-0000-0000-000004D06E29 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18021612-0009-0000-0000-00001E637235 Message-Id: <1518782691-1232-4-git-send-email-mihajlov@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-02-16_04:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1802160144 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCHv4 3/4] qmp: add architecture specific cpu data for query-cpus-fast X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, david@redhat.com, cohuck@redhat.com, armbru@redhat.com, agraf@suse.de, borntraeger@de.ibm.com, qemu-s390x@nongnu.org, pbonzini@redhat.com, dgilbert@redhat.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The s390 CPU state can be retrieved without interrupting the VM execution. Extendend the CpuInfoFast union with architecture specific data and an implementation for s390. Return data looks like this: [ {"thread-id":64301,"props":{"core-id":0}, "arch":"s390","cpu-state":"operating", "qom-path":"/machine/unattached/device[0]","cpu-index":0}, {"thread-id":64302,"props":{"core-id":1}, "arch":"s390","cpu-state":"operating", "qom-path":"/machine/unattached/device[1]","cpu-index":1} ] Signed-off-by: Viktor Mihajlovski Reviewed-by: Cornelia Huck Acked-by: Eric Blake Reviewed-by: Eric Blake --- cpus.c | 10 ++++++++++ qapi-schema.json | 25 ++++++++++++++++++------- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/cpus.c b/cpus.c index 6df6660..af67826 100644 --- a/cpus.c +++ b/cpus.c @@ -2166,6 +2166,10 @@ CpuInfoFastList *qmp_query_cpus_fast(Error **errp) MachineClass *mc =3D MACHINE_GET_CLASS(ms); CpuInfoFastList *head =3D NULL, *cur_item =3D NULL; CPUState *cpu; +#if defined(TARGET_S390X) + S390CPU *s390_cpu; + CPUS390XState *env; +#endif =20 CPU_FOREACH(cpu) { CpuInfoFastList *info =3D g_malloc0(sizeof(*info)); @@ -2183,6 +2187,12 @@ CpuInfoFastList *qmp_query_cpus_fast(Error **errp) info->value->props =3D props; } =20 +#if defined(TARGET_S390X) + s390_cpu =3D S390_CPU(cpu); + env =3D &s390_cpu->env; + info->value->arch =3D CPU_INFO_ARCH_S390; + info->value->u.s390.cpu_state =3D env->cpu_state; +#endif if (!cur_item) { head =3D cur_item =3D info; } else { diff --git a/qapi-schema.json b/qapi-schema.json index 815f072..e6ca63f 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -408,7 +408,7 @@ # @CpuInfoArch: # # An enumeration of cpu types that enable additional information during -# @query-cpus. +# @query-cpus and @query-cpus-fast. # # @s390: since 2.12 # @@ -604,12 +604,24 @@ # @props: properties describing to which node/socket/core/thread # virtual CPU belongs to, provided if supported by board # +# @arch: architecture of the cpu, which determines which additional fields +# will be listed +# # Since: 2.12 # ## -{ 'struct': 'CpuInfoFast', - 'data': {'cpu-index': 'int', 'qom-path': 'str', - 'thread-id': 'int', '*props': 'CpuInstanceProperties' } } +{ 'union': 'CpuInfoFast', + 'base': {'cpu-index': 'int', 'qom-path': 'str', + 'thread-id': 'int', '*props': 'CpuInstanceProperties', + 'arch': 'CpuInfoArch' }, + 'discriminator': 'arch', + 'data': { 'x86': 'CpuInfoOther', + 'sparc': 'CpuInfoOther', + 'ppc': 'CpuInfoOther', + 'mips': 'CpuInfoOther', + 'tricore': 'CpuInfoOther', + 's390': 'CpuInfoS390', + 'other': 'CpuInfoOther' } } =20 ## # @query-cpus-fast: @@ -620,9 +632,6 @@ # # Returns: list of @CpuInfoFast # -# Notes: The CPU architecture name is not returned by query-cpus-fast. -# Use query-target to retrieve that information. -# # Since: 2.12 # # Example: @@ -637,6 +646,7 @@ # "socket-id": 0 # }, # "qom-path": "/machine/unattached/device[0]", +# "arch":"x86", # "cpu-index": 0 # }, # { @@ -647,6 +657,7 @@ # "socket-id": 1 # }, # "qom-path": "/machine/unattached/device[2]", +# "arch":"x86", # "cpu-index": 1 # } # ] --=20 1.9.1 From nobody Fri Oct 24 09:58:55 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1518783245559345.28641377703616; Fri, 16 Feb 2018 04:14:05 -0800 (PST) Received: from localhost ([::1]:42040 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emetu-0001Hd-Qy for importer@patchew.org; Fri, 16 Feb 2018 07:14:02 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38674) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emelK-0002I4-Dy for qemu-devel@nongnu.org; Fri, 16 Feb 2018 07:05:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emelF-00031r-Sv for qemu-devel@nongnu.org; Fri, 16 Feb 2018 07:05:10 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:33418) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1emelF-000300-KE for qemu-devel@nongnu.org; Fri, 16 Feb 2018 07:05:05 -0500 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w1GBuUc8034552 for ; Fri, 16 Feb 2018 07:05:04 -0500 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 2g5tvk9ty6-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 16 Feb 2018 07:05:04 -0500 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 16 Feb 2018 12:05:01 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 16 Feb 2018 12:04:58 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w1GC4vts46792940; Fri, 16 Feb 2018 12:04:57 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id ACED311C04C; Fri, 16 Feb 2018 11:58:07 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5936811C04A; Fri, 16 Feb 2018 11:58:07 +0000 (GMT) Received: from bradbury.ibm.com (unknown [9.152.222.92]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 16 Feb 2018 11:58:07 +0000 (GMT) From: Viktor Mihajlovski To: qemu-devel@nongnu.org Date: Fri, 16 Feb 2018 13:04:51 +0100 X-Mailer: git-send-email 1.9.1 In-Reply-To: <1518782691-1232-1-git-send-email-mihajlov@linux.vnet.ibm.com> References: <1518782691-1232-1-git-send-email-mihajlov@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18021612-0040-0000-0000-0000041361C4 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18021612-0041-0000-0000-00002616651B Message-Id: <1518782691-1232-5-git-send-email-mihajlov@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-02-16_04:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1802160144 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCHv4 4/4] qemu-doc: deprecate query-cpus X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, david@redhat.com, cohuck@redhat.com, armbru@redhat.com, agraf@suse.de, borntraeger@de.ibm.com, qemu-s390x@nongnu.org, pbonzini@redhat.com, dgilbert@redhat.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Start the deprecation period for QAPI query-cpus (replaced by query-cpus-fast) beginning with 2.12.0. Signed-off-by: Viktor Mihajlovski Reviewed-by: Eric Blake --- qapi-schema.json | 4 ++++ qemu-doc.texi | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/qapi-schema.json b/qapi-schema.json index e6ca63f..cd98a94 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -587,6 +587,10 @@ # ] # } # +# Notes: This interface is deprecated (since 2.12.0), and it is strongly +# recommended that you avoid using it. Use @query-cpus-fast to +# obtain information about virtual CPUs. +# ## { 'command': 'query-cpus', 'returns': ['CpuInfo'] } =20 diff --git a/qemu-doc.texi b/qemu-doc.texi index 137f581..221f565 100644 --- a/qemu-doc.texi +++ b/qemu-doc.texi @@ -2764,6 +2764,10 @@ by the ``convert -l snapshot_param'' argument instea= d. "autoload" parameter is now ignored. All bitmaps are automatically loaded from qcow2 images. =20 +@subsection query-cpus (since 2.12.0) + +The ``query-cpus'' command is replaced by the ``query-cpus-fast'' command. + @section System emulator human monitor commands =20 @subsection host_net_add (since 2.10.0) --=20 1.9.1