From nobody Fri May 3 00:17:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1614854939; cv=none; d=zohomail.com; s=zohoarc; b=niL8JWXu6iC0Cwl16zHQK7CGC17nR8MYdSJlMrQxN5WAaNk4LrZ7oe6evQjM9wDNCqyc7bBTyQZjKSFQQ9q9o1MiToPT83CMgAarDFjYkjP+5jvRFDt0S4edQk9Sts62Wyvqnde2+YzLlJpctwoNX8C81tS2jq2JEcXFaAX/QZg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614854939; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=XBM1jAyATmiogEsrTHFjxdGpWgH9agWn1FqojUlbUPs=; b=luHO4D1KJbYsPAnCNIQZZsT7jWxskgqhmZXpQidgbEC8n+yBc0x5U8Ww3TV710OQzdO9YWei0ESHCjx+OzTdlRivSMkOiEB/pgE3sCKriNQmOenrmZybpO7ReZThfnSTtVOBc03Wv9cFsnntGCL+zdtVmPA61JLZweYJAoe8Irk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 16148549392731.6448869888004083; Thu, 4 Mar 2021 02:48:59 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.93148.175793 (Exim 4.92) (envelope-from ) id 1lHlWv-0007WM-J7; Thu, 04 Mar 2021 10:48:29 +0000 Received: by outflank-mailman (output) from mailman id 93148.175793; Thu, 04 Mar 2021 10:48:29 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lHlWv-0007WF-Ft; Thu, 04 Mar 2021 10:48:29 +0000 Received: by outflank-mailman (input) for mailman id 93148; Thu, 04 Mar 2021 10:48:28 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lHlWt-0007WA-UT for xen-devel@lists.xenproject.org; Thu, 04 Mar 2021 10:48:28 +0000 Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id fbb662c5-27b3-4e1c-bf79-ef50688e3df4; Thu, 04 Mar 2021 10:48:23 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: fbb662c5-27b3-4e1c-bf79-ef50688e3df4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1614854903; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=VytRFVs1Z/CjA5kL238k+P7x0SlBNPkobG/zuRvSCII=; b=U4oPRomGYsudgTbor7tt+mliJaREXu24wYn8w+yz3SSEkAE1Lym+dQGK Z12kKRW/clAzx29qxBd3Od9dCVmUdoOnre9y9jK3CdEYphAQAncCoQ5qC C2VyHf6ciYGUZw++o0wcX2e2tj6b/PHYlJ+Ji6qTPvws8Ubgs0++UjvQX U=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: e7CstDsFVPQpa3pxM8s6Ow3MM1ir998+dSYiaZe2AlsHrsfGXbZeeK9i0ZD0SkMAV89Uqk+vDB PichbhNyzIfCoBW1NLlxiKPPz1VOVusiy82p9XP+KXVWs8WNLlCB1R2M+EnncqoC044DCs0pQi AQhw9EBQTfYVY5XvBoqq7jKddrb3ou3yxJUr4jltElILRp79xBTQsxWW8v9kAJF0epaX+gkLQ5 +ycPzx5g0YMuaXbqXkUlAI4X7mR754aSRcqfcDXMSi7wajZkXcC9ecXPm0NcIn+0HD4x9abQHw gTo= X-SBRS: 5.1 X-MesageID: 38437466 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.81,222,1610427600"; d="scan'208";a="38437466" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu , Stefano Stabellini , Julien Grall , Volodymyr Babchuk , Ian Jackson Subject: [PATCH for-4.15] xen/dmop: Fix XEN_DMOP_nr_vcpus to actually return data Date: Thu, 4 Mar 2021 10:48:05 +0000 Message-ID: <20210304104805.27601-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) The const_op boolean needs clobbering to cause data to be written back to t= he caller. Fixes: c4441ab1f1 ("dmop: Add XEN_DMOP_nr_vcpus") Signed-off-by: Andrew Cooper Reviewed-by: Roger Pau Monn=C3=A9 --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 CC: Wei Liu CC: Stefano Stabellini CC: Julien Grall CC: Volodymyr Babchuk CC: Ian Jackson If we weren't in a release freeze, I'd rewrite large chunks of this. 'const_op' is what we call 'copyback' everywhere else, but with inverted sense. I'll guess this gets added to the pile of other unbreakage work whi= ch might happen in 4.16 My ad-hoc unit test appears to have had a false positive for the success ca= se, which I've fixed. However, the chances of the full test landing in 4.15 is getting slimmer, not to mention the fact that it curretly takes out Xen with reference counting error... As for 4.15, this is a bug in a brand-newly introduced hypercall, and is of= 0 risk for other areas of the release. If this bugfix is not taken, we should revert c4441ab1f1 to take the hypercall out, but this would be a bad move. --- xen/arch/arm/dm.c | 1 + xen/arch/x86/hvm/dm.c | 1 + 2 files changed, 2 insertions(+) diff --git a/xen/arch/arm/dm.c b/xen/arch/arm/dm.c index d689e336fd..1b3fd6bc7d 100644 --- a/xen/arch/arm/dm.c +++ b/xen/arch/arm/dm.c @@ -128,6 +128,7 @@ int dm_op(const struct dmop_args *op_args) struct xen_dm_op_nr_vcpus *data =3D &op.u.nr_vcpus; =20 data->vcpus =3D d->max_vcpus; + const_op =3D false; rc =3D 0; break; } diff --git a/xen/arch/x86/hvm/dm.c b/xen/arch/x86/hvm/dm.c index f4f0910463..b60b9f3364 100644 --- a/xen/arch/x86/hvm/dm.c +++ b/xen/arch/x86/hvm/dm.c @@ -612,6 +612,7 @@ int dm_op(const struct dmop_args *op_args) struct xen_dm_op_nr_vcpus *data =3D &op.u.nr_vcpus; =20 data->vcpus =3D d->max_vcpus; + const_op =3D false; rc =3D 0; break; } --=20 2.11.0