From patchwork Mon Apr 3 16:29:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre Morel X-Patchwork-Id: 1764535 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=Pay4U+re; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PqxL71m1Mz1yZT for ; Tue, 4 Apr 2023 02:34:07 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pjN45-0000Vq-T6; Mon, 03 Apr 2023 12:29:53 -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 1pjN43-0000UQ-N1; Mon, 03 Apr 2023 12:29:51 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pjN41-0007ml-7l; Mon, 03 Apr 2023 12:29:51 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 333G8POb030453; Mon, 3 Apr 2023 16:29:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=goQp7Mq83A8PTdRpJQmcUORyKCMxPBD4dCvsOZb3f7c=; b=Pay4U+re4QMErwjotoJOXORYchyt2eGvd1+pt/9lRdDx2bCLpcTLCgHJ/z35ICRk+OrJ bLmU0LDGkp9eDdjLkMpaFZUtbEMHvelcifvjMOYCxusqJNg2LXJm66s6i/xNgvV+9b4o LYgTNkmQUPuEcJRrTEqh3sqWMYjIVQUWq946jxPGXDZbsanUIYjEPblNKJGEyCSplFbe B3rItQYILm42gHfHlAUz8tniFTum99Ob7gdntUnfbdP9Pb5RfhebhhqIQPaSNHw9UZ+B c6RyJBOhp6Ttvbhx2AThs6Oc7LLj1k5ObVZBzSRpQOCWMZ9S+hvP3VjZlB71+y2K+XGo Eg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ppxerm06r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Apr 2023 16:29:44 +0000 Received: from m0098396.ppops.net (m0098396.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 333G83vK029518; Mon, 3 Apr 2023 16:29:44 GMT Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ppxerm060-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Apr 2023 16:29:43 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3333h5PI030727; Mon, 3 Apr 2023 16:29:41 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma03ams.nl.ibm.com (PPS) with ESMTPS id 3ppc871ut5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Apr 2023 16:29:41 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 333GTbe326084078 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 3 Apr 2023 16:29:37 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B1C1D20040; Mon, 3 Apr 2023 16:29:37 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 96C0620043; Mon, 3 Apr 2023 16:29:36 +0000 (GMT) Received: from li-c6ac47cc-293c-11b2-a85c-d421c8e4747b.ibm.com.com (unknown [9.179.22.128]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 3 Apr 2023 16:29:36 +0000 (GMT) From: Pierre Morel To: qemu-s390x@nongnu.org Cc: qemu-devel@nongnu.org, borntraeger@de.ibm.com, pasic@linux.ibm.com, richard.henderson@linaro.org, david@redhat.com, thuth@redhat.com, cohuck@redhat.com, mst@redhat.com, pbonzini@redhat.com, kvm@vger.kernel.org, ehabkost@redhat.com, marcel.apfelbaum@gmail.com, eblake@redhat.com, armbru@redhat.com, seiden@linux.ibm.com, nrb@linux.ibm.com, nsg@linux.ibm.com, frankja@linux.ibm.com, berrange@redhat.com, clg@kaod.org Subject: [PATCH v19 17/21] tests/avocado: s390x cpu topology test dedicated CPU Date: Mon, 3 Apr 2023 18:29:01 +0200 Message-Id: <20230403162905.17703-18-pmorel@linux.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230403162905.17703-1-pmorel@linux.ibm.com> References: <20230403162905.17703-1-pmorel@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: Kxq0T2HeZZpmvWfgqGb_Ey3TE7scSsyC X-Proofpoint-GUID: kGBOy05Yq6zYqqJw1DbzvOfWGbVrbOBx X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-03_13,2023-04-03_03,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 phishscore=0 clxscore=1015 suspectscore=0 bulkscore=0 malwarescore=0 impostorscore=0 mlxscore=0 adultscore=0 priorityscore=1501 spamscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304030118 Received-SPF: pass client-ip=148.163.156.1; envelope-from=pmorel@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org A dedicated CPU in vertical polarization can only have a high entitlement. Let's check this. Signed-off-by: Pierre Morel --- tests/avocado/s390_topology.py | 43 +++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/tests/avocado/s390_topology.py b/tests/avocado/s390_topology.py index f12f0ae148..6a41f08897 100644 --- a/tests/avocado/s390_topology.py +++ b/tests/avocado/s390_topology.py @@ -52,6 +52,7 @@ class S390CPUTopology(LinuxKernelTest): The polarization is changed on a request from the guest. """ timeout = 90 + skip_basis = False def check_topology(self, c, s, b, d, e, t): @@ -116,12 +117,14 @@ def system_init(self): exec_command_and_wait_for_pattern(self, '/bin/cat /sys/devices/system/cpu/dispatching', '0') + @skipIf(skip_basis, 'skipping basis tests') def test_single(self): self.kernel_init() self.vm.launch() self.wait_for_console_pattern('no job control') self.check_topology(0, 0, 0, 0, 'medium', False) + @skipIf(skip_basis, 'skipping basis tests') def test_default(self): """ This test checks the implicite topology. @@ -147,6 +150,7 @@ def test_default(self): self.check_topology(11, 2, 1, 0, 'medium', False) self.check_topology(12, 0, 0, 1, 'medium', False) + @skipIf(skip_basis, 'skipping basis tests') def test_move(self): """ This test checks the topology modification by moving a CPU @@ -167,6 +171,7 @@ def test_move(self): self.assertEqual(res['return'], {}) self.check_topology(0, 2, 0, 0, 'low', False) + @skipIf(skip_basis, 'skipping basis tests') def test_hotplug(self): """ This test verifies that a CPU defined with '-device' command line @@ -184,6 +189,7 @@ def test_hotplug(self): self.check_topology(10, 2, 1, 0, 'medium', False) + @skipIf(skip_basis, 'skipping basis tests') def test_hotplug_full(self): """ This test verifies that a hotplugged fully defined with '-device' @@ -202,6 +208,7 @@ def test_hotplug_full(self): self.wait_for_console_pattern('no job control') self.check_topology(1, 1, 1, 1, 'medium', False) + @skipIf(skip_basis, 'skipping basis tests') def test_polarisation(self): """ This test verifies that QEMU modifies the entitlement change after @@ -231,7 +238,7 @@ def test_polarisation(self): self.check_topology(0, 0, 0, 0, 'medium', False) - def test_set_cpu_topology_entitlement(self): + def test_entitlement(self): """ This test verifies that QEMU modifies the polarization after a guest request. @@ -286,3 +293,37 @@ def test_set_cpu_topology_entitlement(self): self.check_topology(1, 0, 0, 0, 'medium', False) self.check_topology(2, 1, 0, 0, 'high', False) self.check_topology(3, 1, 0, 0, 'high', False) + + def test_dedicated(self): + """ + This test verifies that QEMU modifies the entitlement change correctly + for a dedicated CPU after several guest polarization change requests. + + :avocado: tags=arch:s390x + :avocado: tags=machine:s390-ccw-virtio + """ + self.kernel_init() + self.vm.launch() + self.wait_for_console_pattern('no job control') + + self.system_init() + + res = self.vm.qmp('set-cpu-topology', + {'core-id': 0, 'dedicated': True}) + self.assertEqual(res['return'], {}) + + self.check_topology(0, 0, 0, 0, 'high', True) + + exec_command(self, 'echo 1 > /sys/devices/system/cpu/dispatching') + time.sleep(0.2) + exec_command_and_wait_for_pattern(self, + '/bin/cat /sys/devices/system/cpu/dispatching', '1') + + self.check_topology(0, 0, 0, 0, 'high', True) + + exec_command(self, 'echo 0 > /sys/devices/system/cpu/dispatching') + time.sleep(0.2) + exec_command_and_wait_for_pattern(self, + '/bin/cat /sys/devices/system/cpu/dispatching', '0') + + self.check_topology(0, 0, 0, 0, 'high', True)