From patchwork Mon Aug 19 14:43:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 820270 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c8:0:b0:367:895a:4699 with SMTP id m8csp1470716wrb; Mon, 19 Aug 2024 07:44:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVU/9P4E6EovVF43AEWllC4KEPnAptsRYIWQbRWeru6js3kXHNWSlwlMLTBdBqToI8P3oKaQrW0FmHg5XIHroLq X-Google-Smtp-Source: AGHT+IEAoofszrmF6TLJmMCbYZMGValNLlRc+S+T+BOIYQaejbCx/wGZnegoBwJ4CWxR3XTqrH8L X-Received: by 2002:a05:6214:3b8a:b0:6bd:69a1:7667 with SMTP id 6a1803df08f44-6bf7ce65a65mr104979566d6.39.1724078666128; Mon, 19 Aug 2024 07:44:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1724078666; cv=none; d=google.com; s=arc-20160816; b=evDG+lqUvIJDDBknzCy8h+LWTJfOVxpytJHRbKiXrLX5gtDEUYWdFGv8MtVTq0n5zg aL2v6LUIwabnvsSQtgTsofqhYL9v92eZV867ZyG8UTkhFY7c0ik9PMCs3PFMHE1fxwDs 6Vb7TM4yHjS6a6FWUbK4bhX0EdcwmzDDhWJ3bHBESkXdH2Z6JawxQqMuXCbKhtOGjrie 8BEdqy18qUEeamHLEeuFghLrPMIUCiEgXglDmqsRy9R5CkoAEroiFwQDlaCDyLg8gioD qnsi4FRecpZmbbET6Cszh5m2PqoJvhHRPE06/g8QX4tdVZ60Hw1kuJj15XRyrWBal8K3 BDSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature; bh=LK0G25CZG013C1Vbj0ZuFTV6wmWQVTRhUl87xQWJTe4=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=wWCgrfwvE0dmTupIK9C3ufeFqV2TNDK+CSXz4SoF85zUU2pOLx2wEE+6m3WubGIJqy PNls6Qbh2MROUweBHA9vqWmEjtFzCO/YYK9RJi+/drZaxXbyTBQQvvms7LmWbZJr+Hwk yY4gtLxLI4fjRhpA8MvkpORc0HcQlNryrFgzFGBMYcZtgKDXmv4TF4h+H4SZZYlYSi2N JhJnjlBwcxPbsu9GMQ4hlArcyWENpQ2wOA4bnu9Ut9Ba5O6op3qZpSQmitmyXgWQ2zqs drqG/eB5taYRMbZVW+BOjj518EmpNtly404KqybgyoZKC7jRHJgDuTDDGgeYT+5WQ9Jq vdRA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aLRMrQLK; 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 6a1803df08f44-6bf6ff3189esi118961196d6.590.2024.08.19.07.44.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Aug 2024 07:44:26 -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=aLRMrQLK; 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 1sg3bD-0000Bu-O0; Mon, 19 Aug 2024 10:43:11 -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 1sg3bC-0000Av-Bb for qemu-devel@nongnu.org; Mon, 19 Aug 2024 10:43:10 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sg3bA-0004GE-EY for qemu-devel@nongnu.org; Mon, 19 Aug 2024 10:43:10 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-428178fc07eso33222305e9.3 for ; Mon, 19 Aug 2024 07:43:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1724078586; x=1724683386; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=LK0G25CZG013C1Vbj0ZuFTV6wmWQVTRhUl87xQWJTe4=; b=aLRMrQLKuSRH/C/+H5HlH6iqo106xe4Z9BhjvLlrrkSXp5ADec0rMMRcS4UP6i4Jv4 NKWoCYMgEYOaaI6358KDOHcbsZ41jXoY/xZqij/nlyFQAM/1lE567UdZ2gpZ852blPZr +tT0WoVEUbEsX5zA16/OmzZ1bmPaQXcW6gPNPv0u8aDiaf1tJEl35AfVNnCT+MpL3YMd wSDH+LtqJyCg+ZSU1FryZcQi/+u7mh1Bq5vuzKg9dlLQjNJu3RGDRX38K8DbBcpQs56s Gu3hAggVE+gTLpR9DMtvYwEGBbYXjJEH/qjjvK6yHATbQFIvBzyP5PTpMmdDfA0xtLt7 lzrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724078586; x=1724683386; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=LK0G25CZG013C1Vbj0ZuFTV6wmWQVTRhUl87xQWJTe4=; b=m3OjZtNVBMhMkPkVk779yeIk68Wsu/JxY3l3d5oIyopwSO9GeDJFqP5XTPAgLHUKHj y4qWpJTq/sVhl69xlIDh0mAIbxuK7Zi3H812SBBEcOpawXWY0KDkWL+eqYjHTPcb0bqb JRWY1/KzylrmRHmO0XCRNq8VcFHR/AgSa5qpHzymHXWiKTLOWoz3ipCdy3w78UXVr4yR KfHikFux5PHQSGspADstwoq9blT4N3QbBopH7kAOcj+WT0/qmYB+RyAgs82TXxX5EdRS nByU5j92bCx6ijC50ENsVuaZzqXTMiPX5SExqXN9zEjtqRjPmkXxp4tJwHgLk7z4Idv9 nsRw== X-Gm-Message-State: AOJu0YwCTlOQvp2tSL+nGUOx1cXRF/1NS83a547NHHCVIgLBn+PV9/+W 2K2uGYOqgwGeFIziRG23eFue61ahqVuPgKpT4W3ttmWciE0nRPr2bYlrrcq+f0EvCfWWCLCyxIN h X-Received: by 2002:a05:600c:35c1:b0:426:6320:226a with SMTP id 5b1f17b1804b1-429ed7baab6mr65607975e9.15.1724078586033; Mon, 19 Aug 2024 07:43:06 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-429ded7cfc6sm168262695e9.42.2024.08.19.07.43.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2024 07:43:05 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH] docs/system/cpu-hotplug: Update example's socket-id/core-id Date: Mon, 19 Aug 2024 15:43:03 +0100 Message-Id: <20240819144303.37852-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::334; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=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 At some point the way we allocate socket-id and core-id to CPUs by default changed; update the example of how to do CPU hotplug and unplug so the example commands work again. The differences in the sample input and output are: * the second CPU is now socket-id=0 core-id=1, not socket-id=1 core-id=0 * the order of fields from the qmp_shell is different (it seems to now always be in alphabetical order) Signed-off-by: Peter Maydell Signed-off-by: Peter Maydell Acked-by: Igor Mammedov --- I noticed this while I was playing around with vcpu hotplug trying to demonstrate a memory leak I want to fix... docs/system/cpu-hotplug.rst | 54 ++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/docs/system/cpu-hotplug.rst b/docs/system/cpu-hotplug.rst index 015ce2b6ec3..443ff226b90 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 { "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": {}