From patchwork Fri Oct 27 03:21:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ani Sinha X-Patchwork-Id: 1856021 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=QrePnA1C; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 4SGnzM6bHmz23jx for ; Fri, 27 Oct 2023 14:22:38 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qwDQ9-0008AO-13; Thu, 26 Oct 2023 23:22:01 -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 1qwDQ7-0008A8-Lo for qemu-devel@nongnu.org; Thu, 26 Oct 2023 23:21:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qwDQ6-0001JS-9l for qemu-devel@nongnu.org; Thu, 26 Oct 2023 23:21:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698376917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XR+7cxp9kRhmFZSGDPM/Q/js16jwVnbpxH/cRH+4IKA=; b=QrePnA1CG71CCtuGZXNyVr37q9g77Id6/oJ+71tNNasssZ5rU8/t0Xya0mTMvAdqZEbFmC KqMcnx6I48uQFc1a5X7vfSBxus2IxN9jLTLRDLNdJ2a1MRqWE3J0+Xzos7SiHWyJzrz84i 2Qo6Z5vY6/Pg3wueqnvhSqleEyHIU4w= Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-468-Fn25cyBZPcaicEEU7aN5tw-1; Thu, 26 Oct 2023 23:21:45 -0400 X-MC-Unique: Fn25cyBZPcaicEEU7aN5tw-1 Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-1ca28f36249so15749405ad.3 for ; Thu, 26 Oct 2023 20:21:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698376904; x=1698981704; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XR+7cxp9kRhmFZSGDPM/Q/js16jwVnbpxH/cRH+4IKA=; b=F5vRFPEmwvPA+bRUrILCGT/xQDeH4zRREiZk2CcsrHj1JyAhN6L3iUc/URpSnX1o+s g21+gSLIwYun+XM4Oc5UBjMqFUBv99EMMPgUcMJV4wa8aCCN2AXxZpAO82wt6dFOPWG3 KCC8nQMDt7QR/mH3NA0/c8N0OBF8QmrhFcXYyl7toB20l9P0pHfpwFpeHoVpOE3uGz2d 6ErepJ39MUbOqNsvhQNlYBpOpl0qIcOpox1uwWpU5l40DOhJvK+5Ln3BDyRs7FFuW+E3 fuBA9klKnpxiPG7hZmdzGW/czspXJg/a5Ed+dWigVwwezFJjaLBEz1oK6F0eTdfKBRsw YlTw== X-Gm-Message-State: AOJu0Ywei1K6Lb7OVck34ct2VmAYe0fCBBNmRneWQ6AR4ltX03aBFBGX YqrRBnpJumt6LYAIorvcjcj/U4B5kThCCcVoZ3AcWFiXS2mcXNPlZBl9FuA2XVnKRE8zeBcgW8o YDpJgx0Q1PQYs4KI= X-Received: by 2002:a17:903:2382:b0:1cc:23e7:d522 with SMTP id v2-20020a170903238200b001cc23e7d522mr123532plh.29.1698376904393; Thu, 26 Oct 2023 20:21:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHKMfoRB+iRk1jpsvYAsWfBlUTLYGg4HTUAhEq884pvnvAvcLBn9BRfRYyESmszSD9iUuHwDQ== X-Received: by 2002:a17:903:2382:b0:1cc:23e7:d522 with SMTP id v2-20020a170903238200b001cc23e7d522mr123516plh.29.1698376904075; Thu, 26 Oct 2023 20:21:44 -0700 (PDT) Received: from localhost.localdomain ([115.96.30.106]) by smtp.googlemail.com with ESMTPSA id j6-20020a170902da8600b001cc131c65besm418431plx.168.2023.10.26.20.21.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 20:21:43 -0700 (PDT) From: Ani Sinha To: Ani Sinha , "Michael S. Tsirkin" , Cleber Rosa , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal Cc: jusual@redhat.com, imammedo@redhat.com, qemu-devel@nongnu.org Subject: [PATCH 1/2] acpi/tests/avocado/bits: enforce 32-bit SMBIOS entry point Date: Fri, 27 Oct 2023 08:51:18 +0530 Message-ID: <20231027032120.6012-2-anisinha@redhat.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231027032120.6012-1-anisinha@redhat.com> References: <20231027032120.6012-1-anisinha@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=anisinha@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 QEMU defaults to 64-bit entry point since the following commit bf376f3020 ("hw/i386/pc: Default to use SMBIOS 3.0 for newer machine models") The above change is applicable for all newer machine versions from version 8.1 and newer. i440fx and q35 machine versions 8.0 and older still use 32-bit entry points. Unfortunately, bits currently does not recognize 64-bit entry points and hence is not able to parse SMBIOS tables. Therefore, we need to enforce 32-bit SMBIOS entry point in QEMU command line so that bits is able to parse the SMBIOS tables. Once we implement the support in bits to parse 64-bit entry points, we can remove the extra command line that is passed to enforce a 32-bit entry point. The support can be added to the following smbios test script: tests/avocado/acpi-bits/bits-tests/smbios.py2 in QEMU repository. CC: jusual@redhat.com CC: imammedo@redhat.com Signed-off-by: Ani Sinha --- tests/avocado/acpi-bits.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/avocado/acpi-bits.py b/tests/avocado/acpi-bits.py index eca13dc518..042007b0b8 100644 --- a/tests/avocado/acpi-bits.py +++ b/tests/avocado/acpi-bits.py @@ -380,6 +380,11 @@ def test_acpi_smbios_bits(self): # consistent in terms of timing. smilatency tests have consistent # timing requirements. self._vm.add_args('-icount', 'auto') + # currently there is no support in bits for recognizing 64-bit SMBIOS + # entry points. QEMU defaults to 64-bit entry points since the + # upstream commit bf376f3020 ("hw/i386/pc: Default to use SMBIOS 3.0 + # for newer machine models"). Therefore, enforce 32-bit entry point. + self._vm.add_args('-machine', 'smbios-entry-point-type=32') args = " ".join(str(arg) for arg in self._vm.base_args()) + \ " " + " ".join(str(arg) for arg in self._vm.args) From patchwork Fri Oct 27 03:21:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ani Sinha X-Patchwork-Id: 1856022 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=jIhTWw1S; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 4SGnzM5gyFz1ypX for ; Fri, 27 Oct 2023 14:22:38 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qwDQ4-00089d-GZ; Thu, 26 Oct 2023 23:21:56 -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 1qwDQ3-00089O-87 for qemu-devel@nongnu.org; Thu, 26 Oct 2023 23:21:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qwDQ1-0001JD-Ec for qemu-devel@nongnu.org; Thu, 26 Oct 2023 23:21:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698376911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=simh88NQ8JXz8AjVZeNXJQud8G+aRTJe35SVm9ACyQs=; b=jIhTWw1Sm1nyCeCtTQpqp72HMivNdjzzRJRimSBRQJofusqINCLVO4ijuw+5Qt7RLMGdAH RzixtGGLTzBrCnaxHJc4rG5UejT0c7SNKM2VOr7RrJutkjPEu44T3Zuqui3ua6fucwAszX Co5f5+LEvOEfTTpY1zB63WPzK6ER8Ew= Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-274-7md5G9zyP1W1_u-YMWQZuw-1; Thu, 26 Oct 2023 23:21:50 -0400 X-MC-Unique: 7md5G9zyP1W1_u-YMWQZuw-1 Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-1c9d140fb3eso15163675ad.3 for ; Thu, 26 Oct 2023 20:21:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698376909; x=1698981709; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=simh88NQ8JXz8AjVZeNXJQud8G+aRTJe35SVm9ACyQs=; b=MLyHSCjbxCIPl9iBzjcjbj8CYIwLlKOVWXc2llPk6glpV3SsZABplx+BIaEhTlrIbt qnCbp+MyLXpBXwf9TIG0rsrtl1cUh260HtMyxAQl/L47hFa79OwusG8YDR4+psalcuMJ U/d3mcNLEyrDA8K+2tiPWwCG/4k7o0QctSg7mt/tNxIx03mFRACIPb+DQYUt87VfS2ED VQ2zuCEpdr7amJEYRF9v9qjVNyU9p6kdgC4mbvUNRlVgRoBd4GQNYU3P81UAPPBXtWPk wNMsV6SR5w3eOwKZIakyorxIDKqMp2LMBYQT/UmQxzFkNWxrRgjaNsQfni6HHBv1euri j9bA== X-Gm-Message-State: AOJu0YwtUNOol7ZpOXqxnBwBNHCXUbDlwRN9lreh7SRWREM5tQj1d1Hh 9/fwE5/S+Uyc6ykwRll/Z5NeZJDoRkvdCKJo8IhGpKCLU/aZ/BDOIPmy4XgtZNt6zk5Cw+YlLGc JZ4l/UK55ArcjGyE= X-Received: by 2002:a17:902:c146:b0:1c6:3157:29f3 with SMTP id 6-20020a170902c14600b001c6315729f3mr1475318plj.36.1698376908894; Thu, 26 Oct 2023 20:21:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHquaDsWc+oVlPzPd4kPA1RU95KcL2SPRCfEAhJaIUPfdM0lm5zM71HOLhiixDaTxcoocuHRg== X-Received: by 2002:a17:902:c146:b0:1c6:3157:29f3 with SMTP id 6-20020a170902c14600b001c6315729f3mr1475305plj.36.1698376908565; Thu, 26 Oct 2023 20:21:48 -0700 (PDT) Received: from localhost.localdomain ([115.96.30.106]) by smtp.googlemail.com with ESMTPSA id j6-20020a170902da8600b001cc131c65besm418431plx.168.2023.10.26.20.21.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 20:21:48 -0700 (PDT) From: Ani Sinha To: Ani Sinha , "Michael S. Tsirkin" , Cleber Rosa , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal Cc: jsnow@redhat.com, qemu-devel@nongnu.org Subject: [PATCH 2/2] acpi/tests/avocado/bits: enable console logging from bits VM Date: Fri, 27 Oct 2023 08:51:19 +0530 Message-ID: <20231027032120.6012-3-anisinha@redhat.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231027032120.6012-1-anisinha@redhat.com> References: <20231027032120.6012-1-anisinha@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=anisinha@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 Console logs from the VM can be useful for debugging when things go wrong. Other avocado tests enables them. This change enables console logging with the following changes: - point to the newer bios bits image that actually enabled VM console. - change the bits test to drain the console logs from the VM and write the logs. - wait for SHUTDOWN event from QEMU so that console logs can be drained out of the socket before it is closed as a part of vm.wait(). Additionally, following two cosmetic changes have been made: - Removed VM QEMU command line logging as avocado framework already logs it. This is a minor cleanup along the way. - Update my email to my work email in the avocado acpi bios bits test. CC: jsnow@redhat.com Signed-off-by: Ani Sinha --- tests/avocado/acpi-bits.py | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/tests/avocado/acpi-bits.py b/tests/avocado/acpi-bits.py index 042007b0b8..68b9e98d4e 100644 --- a/tests/avocado/acpi-bits.py +++ b/tests/avocado/acpi-bits.py @@ -18,7 +18,7 @@ # # # Author: -# Ani Sinha +# Ani Sinha # pylint: disable=invalid-name # pylint: disable=consider-using-f-string @@ -48,6 +48,7 @@ ) from qemu.machine import QEMUMachine from avocado import skipIf +from avocado.utils import datadrainer as drainer from avocado_qemu import QemuBaseTest deps = ["xorriso", "mformat"] # dependent tools needed in the test setup/box. @@ -141,12 +142,12 @@ def __init__(self, *args, **kwargs): self._baseDir = None # following are some standard configuration constants - self._bitsInternalVer = 2020 - self._bitsCommitHash = 'b48b88ff' # commit hash must match + self._bitsInternalVer = 2020 # gitlab CI does shallow clones of depth 20 + self._bitsCommitHash = 'c7920d2b' # commit hash must match # the artifact tag below - self._bitsTag = "qemu-bits-10182022" # this is the latest bits + self._bitsTag = "qemu-bits-10262023" # this is the latest bits # release as of today. - self._bitsArtSHA1Hash = 'b04790ac9b99b5662d0416392c73b97580641fe5' + self._bitsArtSHA1Hash = 'b22cdfcfc7453875297d06d626f5474ee36a343f' self._bitsArtURL = ("https://gitlab.com/qemu-project/" "biosbits-bits/-/jobs/artifacts/%s/" "download?job=qemu-bits-build" %self._bitsTag) @@ -386,15 +387,20 @@ def test_acpi_smbios_bits(self): # for newer machine models"). Therefore, enforce 32-bit entry point. self._vm.add_args('-machine', 'smbios-entry-point-type=32') - args = " ".join(str(arg) for arg in self._vm.base_args()) + \ - " " + " ".join(str(arg) for arg in self._vm.args) + # enable console logging + self._vm.set_console() + self._vm.launch() - self.logger.info("launching QEMU vm with the following arguments: %s", - args) + self.logger.debug("Console output from bits VM follows ...") + c_drainer = drainer.LineLogger(self._vm.console_socket.fileno(), + logger=self.logger.getChild("console"), + stop_check=(lambda : + not self._vm.is_running())) + c_drainer.start() - self._vm.launch() # biosbits has been configured to run all the specified test suites # in batch mode and then automatically initiate a vm shutdown. # Rely on avocado's unit test timeout. + self._vm.event_wait('SHUTDOWN') self._vm.wait(timeout=None) self.parse_log()