From patchwork Thu Oct 10 13:18:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 834164 Delivered-To: patch@linaro.org Received: by 2002:adf:b352:0:b0:37d:45d0:187 with SMTP id k18csp281674wrd; Thu, 10 Oct 2024 06:18:34 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXZsxZb2yH3CEMyYZEobBDmFDW2Rui0XfCNydUPYAQQURP0s9CfFscigC4wV9t/+LciRatLEg==@linaro.org X-Google-Smtp-Source: AGHT+IEN8cyIKEUwwzIX2kCy3F/jLh+IU+Vyzx1Glnv6izwQPcUvoE8b+P48eOm659U4PsBiJTuW X-Received: by 2002:a05:690c:3301:b0:6db:d7c9:c97b with SMTP id 00721157ae682-6e3221f84a0mr48642097b3.40.1728566314739; Thu, 10 Oct 2024 06:18:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728566314; cv=none; d=google.com; s=arc-20240605; b=BCv4AWVD5hkeSVOJFs5143bMroXvIMO6wIownmdJiOoip4FWTNjMhGM/Oo1YWFi5km AUg+vEZP3BP/z/IjJMDSDVcv0h7QYGGu9qAxax20jUPc+MmROtdrDI4+z/+YK7V1SI3y C6F8cu/LNJxeS6qdH/EEfMPT/V8qshTxmb6cEEP71Cm3v2e2aCZKlw4YQLMZG+Bik+xm 9dTYhB2J2BcAVkiC/8J8RAp3NyPzE5NGNA3i6Mi9wjI7eVZRyrFAcym8JkdwEIsO1Frz PyPmm5//mIpwJz6B5svxTRQVjBaBruv5jOQWmGDql2OKGSvl/eaqdzbcKvfaXTbMvZtB +78A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=ylbu5jo0GWWpRbcIXJid3gmoRXQZOn8CJVhgXWT4S28=; fh=2sRysE99tueddR/O9hlDNvexHpxMeuyHrBKIIfmiyb8=; b=M1gSc4YTHvdfQ9WGofsvfYo8rNrI1KEbqvuGIU4/PZH+GM9TQglH8nwCQVD2wxtNWA bh1NjrieQDzfJNnWt2F4/LU1B6/J8VFy9HS0pcaePieyoBX6fBSbjKCWXcGQDHylrf3h MNPxsKs7HqckLIRG9BKDl7/AuoHDMGyhvCgzFvs2C7kzxh6lifR1i2yH9VbNGi3XQI2f i1u0wth+d2+BNJUeG/3LLsDY7OYnYG4Y2jd0fTCxbQ07JgzLbSWxTsYNv9yltKklvwXX 8N8trJYLCDOGokYpXiY8Po08iJVtHN651GB2kyMmaCmjqB62K+eAAWGxVU6ryxZtCACY OcYw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ZL/3XUIG"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-460428c64cfsi13511581cf.558.2024.10.10.06.18.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 Oct 2024 06:18:34 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ZL/3XUIG"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syt3b-0007qx-AS; Thu, 10 Oct 2024 09:18:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1syt3O-0007jQ-RN for qemu-devel@nongnu.org; Thu, 10 Oct 2024 09:18:07 -0400 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1syt3M-0008P3-Ej for qemu-devel@nongnu.org; Thu, 10 Oct 2024 09:18:06 -0400 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-5398fb1a871so992982e87.3 for ; Thu, 10 Oct 2024 06:18:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728566282; x=1729171082; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ylbu5jo0GWWpRbcIXJid3gmoRXQZOn8CJVhgXWT4S28=; b=ZL/3XUIGlhGBnQ252Jwu+LaWpBMl8ED2j6CkNwwnBWQtZA0p4zNgfTFdeukOsImI1M AXq1+9U26a88OcsfiIi7yyf0qdZkNry9JkmxvshlM8D32QOhtkCPXMC1dwQEDedYSNhk /h9OxGiAgbYDuURrshl+TavFSutkIXNx4LDG3ojoAKAz0tPhYxU6DiSt0IUnkgjdyJ/6 jTWxVBT6Ech7nApZeL0QJN2YiGv+G8X807tZ0PhYmfemmesUbpOAnisCKO/J119yv1eT OPRkiihLZLMWyJTjnJf6na79up/zboUiiAK9e63lgdKkw5+KKORuQ1La3N4lUJuD15gY 0JhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728566282; x=1729171082; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ylbu5jo0GWWpRbcIXJid3gmoRXQZOn8CJVhgXWT4S28=; b=sqffFpJxhpjwvQNakriKw3usSi5ZaZ5kIiITlPR74C7g0kYnhTt695IU8/nMljqb7U OKm+YZ5BK4ZW1NeHvKj6ZkYHiJzaU0yeSsRPP7nLh3NxiqjcxveHS7vaXj7oTSlkCL2j z1EYdiiuR3ZdSnjNFzptW9/QTNfjaQGK++GMJbHiL0e9C9WNpss9byqcKX4bNKBRB4Dr 4h8k5QkTMxzJiu4nNGk5TcTMwp7X0eeMi86SFMn/wjWFtR+bYxy0pEdngpBBNOanCfN+ lP3Tg4gHe5tay/KmJYHkF5YMqNxNzoG5vuWLv/5c5U5vkSXHy5SI8+g48r79Dc6icjOp svDQ== X-Gm-Message-State: AOJu0YwYJWEDTCFoPG/r3eyzNwTNnsflUF0na5TcDEXtxtlvKK9y91jq f38/5PqDwhDDNmLlxoNrhgz9doKryNlqVG9fCiyDGtzjobLkRzQvtOb9E0uH3zISVVP+58eg2HA W X-Received: by 2002:ac2:4c45:0:b0:52c:fd46:bf07 with SMTP id 2adb3069b0e04-539c4970facmr3925972e87.49.1728566282069; Thu, 10 Oct 2024 06:18:02 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d4b79fa0asm1538544f8f.83.2024.10.10.06.18.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2024 06:18:01 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Igor Mammedov Subject: [PATCH v2] docs/system/cpu-hotplug: Update example's socket-id/core-id Date: Thu, 10 Oct 2024 14:18:00 +0100 Message-Id: <20241010131800.3210161-1-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12b; envelope-from=peter.maydell@linaro.org; helo=mail-lf1-x12b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The example of how to do vCPU hotplug and hot-unlpug in the cpu-hotplug documentation no longer works, because the way we allocate socket-id and core-id to CPUs by default has changed at some point. The output also no longer matches what current QEMU produces in some more cosmetic ways. Update the example to match current QEMU. The differences are: * the second CPU is now socket-id=0 core-id=1, not socket-id=1 core-id=0 * the order of fields in QMP responses is now in alphabetical order * the "arch" member is no longer present in the query-cpus-fast output (it was removed in QEMU 6.0) Signed-off-by: Peter Maydell Acked-by: Igor Mammedov Message-id: 20240819144303.37852-1-peter.maydell@linaro.org --- v1->v2: * update device_add command line to use right socket-id/core-id * expand commit message to mention that "arch" field has gone --- docs/system/cpu-hotplug.rst | 56 ++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/docs/system/cpu-hotplug.rst b/docs/system/cpu-hotplug.rst index 015ce2b6ec3..cc50937c36c 100644 --- a/docs/system/cpu-hotplug.rst +++ b/docs/system/cpu-hotplug.rst @@ -33,23 +33,23 @@ vCPU hotplug { "return": [ { - "type": "IvyBridge-IBRS-x86_64-cpu", - "vcpus-count": 1, "props": { - "socket-id": 1, - "core-id": 0, + "core-id": 1, + "socket-id": 0, "thread-id": 0 - } + }, + "type": "IvyBridge-IBRS-x86_64-cpu", + "vcpus-count": 1 }, { + "props": { + "core-id": 0, + "socket-id": 0, + "thread-id": 0 + }, "qom-path": "/machine/unattached/device[0]", "type": "IvyBridge-IBRS-x86_64-cpu", - "vcpus-count": 1, - "props": { - "socket-id": 0, - "core-id": 0, - "thread-id": 0 - } + "vcpus-count": 1 } ] } @@ -58,18 +58,18 @@ vCPU hotplug (4) The ``query-hotpluggable-cpus`` command returns an object for CPUs that are present (containing a "qom-path" member) or which may be hot-plugged (no "qom-path" member). From its output in step (3), we - can see that ``IvyBridge-IBRS-x86_64-cpu`` is present in socket 0, - while hot-plugging a CPU into socket 1 requires passing the listed + can see that ``IvyBridge-IBRS-x86_64-cpu`` is present in socket 0 core 0, + while hot-plugging a CPU into socket 0 core 1 requires passing the listed properties to QMP ``device_add``:: - (QEMU) device_add id=cpu-2 driver=IvyBridge-IBRS-x86_64-cpu socket-id=1 core-id=0 thread-id=0 + (QEMU) device_add id=cpu-2 driver=IvyBridge-IBRS-x86_64-cpu socket-id=0 core-id=1 thread-id=0 { "execute": "device_add", "arguments": { - "socket-id": 1, + "core-id": 1, "driver": "IvyBridge-IBRS-x86_64-cpu", "id": "cpu-2", - "core-id": 0, + "socket-id": 0, "thread-id": 0 } } @@ -83,34 +83,32 @@ vCPU hotplug (QEMU) query-cpus-fast { - "execute": "query-cpus-fast", "arguments": {} + "execute": "query-cpus-fast", } { "return": [ { - "qom-path": "/machine/unattached/device[0]", - "target": "x86_64", - "thread-id": 11534, "cpu-index": 0, "props": { - "socket-id": 0, "core-id": 0, + "socket-id": 0, "thread-id": 0 }, - "arch": "x86" + "qom-path": "/machine/unattached/device[0]", + "target": "x86_64", + "thread-id": 28957 }, { - "qom-path": "/machine/peripheral/cpu-2", - "target": "x86_64", - "thread-id": 12106, "cpu-index": 1, "props": { - "socket-id": 1, - "core-id": 0, + "core-id": 1, + "socket-id": 0, "thread-id": 0 }, - "arch": "x86" + "qom-path": "/machine/peripheral/cpu-2", + "target": "x86_64", + "thread-id": 29095 } ] } @@ -123,10 +121,10 @@ From the 'qmp-shell', invoke the QMP ``device_del`` command:: (QEMU) device_del id=cpu-2 { - "execute": "device_del", "arguments": { "id": "cpu-2" } + "execute": "device_del", } { "return": {}