From patchwork Tue Apr 25 16:14:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre Morel X-Patchwork-Id: 13223493 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6BC5FC77B73 for ; Tue, 25 Apr 2023 16:17:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234545AbjDYQRp (ORCPT ); Tue, 25 Apr 2023 12:17:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234206AbjDYQRm (ORCPT ); Tue, 25 Apr 2023 12:17:42 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40873161B4 for ; Tue, 25 Apr 2023 09:17:17 -0700 (PDT) Received: from pps.filterd (m0353722.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33PGAGcw025689; Tue, 25 Apr 2023 16:16:21 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=WWatGwBrlbk06R5jOgFAWoF2DiSq3GQRKerECBryXow=; b=nyhwEtF8jecw0nR//bQu5IRhAgnEwfveuY1d/Libt5bVjGYGl8QGhySFLJnsOu/BebSQ R8Fbzm+rFlnZfekCS5+YgL/mpDJteGjs7yxYRxHtBSUTDbhgC2AUBc/hZpBLP/mEVSGL sOvJHlrHLRwZHFDv3fDOdzETooIiMMxoXT8X2JkNX52bgGXTXUxFvQe02PdJXPaRE1z+ oLm96z7xZn1BumuqMtYucl8CyWDFROBb9hYwt/QAm0z0NZtN3wbENmkOOt3PD03mrCMw p02krOS7Jpxsmk7z3qCGKqEvWzFT1sz0oxiuplBQvgJkplDWf5xig1BbTpQA08NmMjh4 TA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3q6htbs1de-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Apr 2023 16:16:21 +0000 Received: from m0353722.ppops.net (m0353722.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 33PGCZA7012997; Tue, 25 Apr 2023 16:16:20 GMT Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3q6htbs1aw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Apr 2023 16:16:20 +0000 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 33P4dF7Q012831; Tue, 25 Apr 2023 16:15:14 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma06ams.nl.ibm.com (PPS) with ESMTPS id 3q46ug1uw2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Apr 2023 16:15:14 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 33PGF8mU47382950 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 16:15:08 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A50C020071; Tue, 25 Apr 2023 16:15:08 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F08EB20079; Tue, 25 Apr 2023 16:15:07 +0000 (GMT) Received: from li-c6ac47cc-293c-11b2-a85c-d421c8e4747b.ibm.com (unknown [9.152.222.242]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 25 Apr 2023 16:15:07 +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 v20 15/21] tests/avocado: s390x cpu topology polarisation Date: Tue, 25 Apr 2023 18:14:50 +0200 Message-Id: <20230425161456.21031-16-pmorel@linux.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230425161456.21031-1-pmorel@linux.ibm.com> References: <20230425161456.21031-1-pmorel@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: _jBO48-oUQmaf58yttkKNrdQUXg7wdmM X-Proofpoint-ORIG-GUID: T-2M1X6egEw-bBXMH37GPX_5r_DoprpF 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-25_07,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 phishscore=0 suspectscore=0 mlxscore=0 adultscore=0 lowpriorityscore=0 spamscore=0 impostorscore=0 mlxlogscore=999 clxscore=1015 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250144 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Polarization is changed on a request from the guest. Let's verify the polarization is accordingly set by QEMU. Signed-off-by: Pierre Morel --- tests/avocado/s390_topology.py | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/tests/avocado/s390_topology.py b/tests/avocado/s390_topology.py index ce119a095e..30d3c0d0cb 100644 --- a/tests/avocado/s390_topology.py +++ b/tests/avocado/s390_topology.py @@ -104,6 +104,15 @@ def kernel_init(self): '-initrd', initrd_path, '-append', kernel_command_line) + def system_init(self): + self.log.info("System init") + exec_command(self, 'mount proc -t proc /proc') + time.sleep(0.2) + exec_command(self, 'mount sys -t sysfs /sys') + time.sleep(0.2) + exec_command_and_wait_for_pattern(self, + '/bin/cat /sys/devices/system/cpu/dispatching', '0') + def test_single(self): self.kernel_init() self.vm.launch() @@ -206,3 +215,32 @@ def test_hotplug_full(self): self.check_topology(3, 1, 1, 1, 'high', False) self.check_topology(4, 1, 1, 1, 'medium', False) self.check_topology(5, 2, 1, 1, 'high', True) + + def test_polarisation(self): + """ + This test verifies that QEMU modifies the entitlement change 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() + self.check_topology(0, 0, 0, 0, 'medium', False) + + 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, 'medium', False) + + 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, 'medium', False)