From nobody Sun May 5 05:46:49 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1667748783; cv=none; d=zohomail.com; s=zohoarc; b=ZqIsq75G9AypxC6y6T57p/wDZzXGsVmRXhCOgfJP1x3Kd7CELT+ryOmxykPFv49PpTVva2S3Kt8LDE0vr4y0b61CpEaaftmMATFqSNMBfLnlUFUZU5RdNefwi6HZbEZsvp750LCI3vDwxwaXm+MgXHKMJpp6QvrEFaEIRukVGQw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667748783; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3aFA2oFEliJWjwgT5nw8G/oPxfaMmOlT7gifPSY9+Nc=; b=ICZzpl3WhND+MZ4iESkRSGaOcgm61+UQ3YRZ9971N1yNEMq4inF/kTlC/Bx2ThRIwpKOfZBlmdqWrLSUKWLx2fjkFFoUnLBeP4yWQdXmQBEeIBEIFvgCajZK4vzwwja4p2luWIfCTsZcRxpQjSQs5fwpiTAzgs9uobQKlkUu1ec= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1667748783534262.0169388307088; Sun, 6 Nov 2022 07:33:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1orhd1-0005pj-Vq; Sun, 06 Nov 2022 10:32:08 -0500 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 1orhcz-0005pJ-VK for qemu-devel@nongnu.org; Sun, 06 Nov 2022 10:32:06 -0500 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 1orhcy-0000uz-LU for qemu-devel@nongnu.org; Sun, 06 Nov 2022 10:32:05 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-564-SbRnO87PMlmx1RE4mUM0Cw-1; Sun, 06 Nov 2022 10:32:02 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 88A7E801231; Sun, 6 Nov 2022 15:32:01 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0301740C6EC4; Sun, 6 Nov 2022 15:31:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667748724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3aFA2oFEliJWjwgT5nw8G/oPxfaMmOlT7gifPSY9+Nc=; b=K4Ele+gyUiwj+TDDO7tiAgFeI+Yw4D0JLt91T927U5m0tKhRqpp+Zx0zLSzrknl59NIESk 8HZXe497Sc/0HqBF/7fuXB5Z1nt8/aMG2pet1pTGnqIE18IsU0LJs2900WDXit0tNxxAPg PBgylajLRXtxc1yEbxvmoRHgkOml7fk= X-MC-Unique: SbRnO87PMlmx1RE4mUM0Cw-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Akihiko Odaki , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 01/12] tests/qtest/libqos/e1000e: Refer common PCI ID definitions Date: Sun, 6 Nov 2022 16:31:45 +0100 Message-Id: <20221106153156.620150-2-thuth@redhat.com> In-Reply-To: <20221106153156.620150-1-thuth@redhat.com> References: <20221106153156.620150-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@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_H2=-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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1667748783762100009 From: Akihiko Odaki This is yet another minor cleanup to ease understanding and future refactoring of the tests. Signed-off-by: Akihiko Odaki Message-Id: <20221103015017.19947-1-akihiko.odaki@daynix.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Thomas Huth --- tests/qtest/libqos/e1000e.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/qtest/libqos/e1000e.c b/tests/qtest/libqos/e1000e.c index ed47e34044..5f80035859 100644 --- a/tests/qtest/libqos/e1000e.c +++ b/tests/qtest/libqos/e1000e.c @@ -18,6 +18,7 @@ =20 #include "qemu/osdep.h" #include "hw/net/e1000_regs.h" +#include "hw/pci/pci_ids.h" #include "../libqtest.h" #include "pci-pc.h" #include "qemu/sockets.h" @@ -217,8 +218,8 @@ static void *e1000e_pci_create(void *pci_bus, QGuestAll= ocator *alloc, static void e1000e_register_nodes(void) { QPCIAddress addr =3D { - .vendor_id =3D 0x8086, - .device_id =3D 0x10D3, + .vendor_id =3D PCI_VENDOR_ID_INTEL, + .device_id =3D E1000_DEV_ID_82574L, }; =20 /* FIXME: every test using this node needs to setup a -netdev socket,i= d=3Dhs0 --=20 2.31.1 From nobody Sun May 5 05:46:49 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1667748906; cv=none; d=zohomail.com; s=zohoarc; b=HEDmfX98eMvlpTbeAQTLAJEJDjJpKq8FEgiWvYWrptkW84EzTzzbQlliuBt2xmu6jvmPYjeDKURyR+5W7mM25365iMH0A1TkPFZ8JzjX/5QV8i2pJx87HYPwsep+2EDgV6cku6V6ZQpE2+XshGB5LqqwiUMlhFjznQSTDBKo4fg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667748906; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Xzyq2Kx05hugDOQwoPId7hfiICPvimiAHi/rFT5+bcM=; b=W6NpaPb8Zk+F1LGz1vbcxXlgUp1MtXcDjcUocwUFNPTgld5MelMea4LXoEDVEcA01Tb4a6JIcArXT+ka8WWxG7NNelI6lypqdD2EA2/05p2tQvmDkqRuCSLKNpIZyQVled49ANy3acLB/zPQsvuKzko+8rCUSI3XQ6J58dw1KJ8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1667748906628210.60298069422197; Sun, 6 Nov 2022 07:35:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1orhd5-0005qN-GQ; Sun, 06 Nov 2022 10:32:11 -0500 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 1orhd2-0005py-L7 for qemu-devel@nongnu.org; Sun, 06 Nov 2022 10:32:08 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1orhd0-0000v5-1l for qemu-devel@nongnu.org; Sun, 06 Nov 2022 10:32:07 -0500 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-107-FoQjdMHHMXueTbXIYDjm4A-1; Sun, 06 Nov 2022 10:32:03 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3572D1C06EC6; Sun, 6 Nov 2022 15:32:03 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id F29DC40C6EC4; Sun, 6 Nov 2022 15:32:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667748725; 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=Xzyq2Kx05hugDOQwoPId7hfiICPvimiAHi/rFT5+bcM=; b=RY0d0d+iKTNCBIFbLCklgQJzlbEdn9Renz+9SxFBKIW1FNVYXbAjtjBPphcikR9h+We332 QBUJGlK62G0z0EqBwr97WJn3wHlCKPHCdrTytTiWB2Av+tNFkuRBB6Gju82fBnYr72daFO aDumlOPVVOjuWNHH6SHUseWwZf/M8m4= X-MC-Unique: FoQjdMHHMXueTbXIYDjm4A-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Akihiko Odaki Subject: [PULL 02/12] tests/qtest/libqos/e1000e: Set E1000_CTRL_SLU Date: Sun, 6 Nov 2022 16:31:46 +0100 Message-Id: <20221106153156.620150-3-thuth@redhat.com> In-Reply-To: <20221106153156.620150-1-thuth@redhat.com> References: <20221106153156.620150-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H2=-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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1667748908463100002 Content-Type: text/plain; charset="utf-8" From: Akihiko Odaki The later device status check depends on E1000_STATUS_LU, which is enabled by E1000_CTRL_SLU. Though E1000_STATUS_LU is not implemented and E1000_STATUS_LU is always available in the current implementation, be a bit nicer and set E1000_CTRL_SLU just in case the bit is implemented in the future. Signed-off-by: Akihiko Odaki Message-Id: <20221103025451.27446-1-akihiko.odaki@daynix.com> Signed-off-by: Thomas Huth --- tests/qtest/libqos/e1000e.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qtest/libqos/e1000e.c b/tests/qtest/libqos/e1000e.c index 5f80035859..4fd0bd5311 100644 --- a/tests/qtest/libqos/e1000e.c +++ b/tests/qtest/libqos/e1000e.c @@ -122,7 +122,7 @@ static void e1000e_pci_start_hw(QOSGraphObject *obj) =20 /* Reset the device */ val =3D e1000e_macreg_read(&d->e1000e, E1000_CTRL); - e1000e_macreg_write(&d->e1000e, E1000_CTRL, val | E1000_CTRL_RST); + e1000e_macreg_write(&d->e1000e, E1000_CTRL, val | E1000_CTRL_RST | E10= 00_CTRL_SLU); =20 /* Enable and configure MSI-X */ qpci_msix_enable(&d->pci_dev); --=20 2.31.1 From nobody Sun May 5 05:46:49 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1667748780; cv=none; d=zohomail.com; s=zohoarc; b=kxZADjhGy+QRiHF0pU5i/zAQlQDEFzBDd/adVjx1Ih4CNu4nsv6Nw77wyziv4Ho5ir4tx9WoI3CKnDXWhxg1GXSsZlaY5tQ4kdyvDv3r1fk8Cq/g3nPtX00mitJj8JH5Kc7B3tKfnwyCUGz0qP/L8Mjt7NGOkQutqtq+OGYeRKA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667748780; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=1lIhzbe+EEQd2vZvZtwTt9hLhJr+rCc7od1ytqep54Y=; b=ZnlrfGGfDxedCiqsBOtq8F8h2aYuaoNcx2nolS8pt0YL1rZOm4rBEQ74ylmZqvEg+9bQ1Fwr+JMRVUef0Nkrzn+lySbyES4xHO4kDrSPsbsoaTslRVEZ5CnmRyFNU3n3v+vIMwZJxiq1EtVwGFnxSvndWn9C3OCm+mtQPcelw5U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1667748780491163.56790357296063; Sun, 6 Nov 2022 07:33:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1orhd9-0005rd-JF; Sun, 06 Nov 2022 10:32:15 -0500 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 1orhd7-0005r5-VK for qemu-devel@nongnu.org; Sun, 06 Nov 2022 10:32:14 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1orhd5-0000vZ-Kq for qemu-devel@nongnu.org; Sun, 06 Nov 2022 10:32:13 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-193-yvNzx9t_OoC0SKiAHr3vmg-1; Sun, 06 Nov 2022 10:32:05 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2994F101A52A; Sun, 6 Nov 2022 15:32:05 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id A45B440C6EC4; Sun, 6 Nov 2022 15:32:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667748730; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1lIhzbe+EEQd2vZvZtwTt9hLhJr+rCc7od1ytqep54Y=; b=eYeMsQQkB8+ZtOhSf1qn0hyf/CrMvCWKKX00CHDKpUW9j6kHlL18mCoeG3wIsijxVv/tGV bx1YYo7hdizr5jRF1QDxiqFnx8XCZo0bmgsJP2j62gGPH+597T/6/qq7yY5h1WMuj4kVN0 l2hRQkJ9gyw9w9PLms20iFnh+FVtsuw= X-MC-Unique: yvNzx9t_OoC0SKiAHr3vmg-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Akihiko Odaki , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 03/12] tests/qtest/e1000e-test: Use e1000_regs.h Date: Sun, 6 Nov 2022 16:31:47 +0100 Message-Id: <20221106153156.620150-4-thuth@redhat.com> In-Reply-To: <20221106153156.620150-1-thuth@redhat.com> References: <20221106153156.620150-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H2=-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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1667748781883100001 From: Akihiko Odaki The register definitions in tests/qtest/e1000e-test.c had names different from hw/net/e1000_regs.h, which made it hard to understand what test codes corresponds to the implementation. Use hw/net/e1000_regs.h from tests/qtest/libqos/e1000e.c to remove these duplications. Signed-off-by: Akihiko Odaki Message-Id: <20221103095416.110162-1-akihiko.odaki@daynix.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Thomas Huth --- tests/qtest/e1000e-test.c | 66 ++++++--------------------------------- 1 file changed, 10 insertions(+), 56 deletions(-) diff --git a/tests/qtest/e1000e-test.c b/tests/qtest/e1000e-test.c index 4cdd8238f2..08adc5226d 100644 --- a/tests/qtest/e1000e-test.c +++ b/tests/qtest/e1000e-test.c @@ -33,34 +33,11 @@ #include "qemu/bitops.h" #include "libqos/libqos-malloc.h" #include "libqos/e1000e.h" +#include "hw/net/e1000_regs.h" =20 static void e1000e_send_verify(QE1000E *d, int *test_sockets, QGuestAlloca= tor *alloc) { - struct { - uint64_t buffer_addr; - union { - uint32_t data; - struct { - uint16_t length; - uint8_t cso; - uint8_t cmd; - } flags; - } lower; - union { - uint32_t data; - struct { - uint8_t status; - uint8_t css; - uint16_t special; - } fields; - } upper; - } descr; - - static const uint32_t dtyp_data =3D BIT(20); - static const uint32_t dtyp_ext =3D BIT(29); - static const uint32_t dcmd_rs =3D BIT(27); - static const uint32_t dcmd_eop =3D BIT(24); - static const uint32_t dsta_dd =3D BIT(0); + struct e1000_tx_desc descr; static const int data_len =3D 64; char buffer[64]; int ret; @@ -73,10 +50,10 @@ static void e1000e_send_verify(QE1000E *d, int *test_so= ckets, QGuestAllocator *a /* Prepare TX descriptor */ memset(&descr, 0, sizeof(descr)); descr.buffer_addr =3D cpu_to_le64(data); - descr.lower.data =3D cpu_to_le32(dcmd_rs | - dcmd_eop | - dtyp_ext | - dtyp_data | + descr.lower.data =3D cpu_to_le32(E1000_TXD_CMD_RS | + E1000_TXD_CMD_EOP | + E1000_TXD_CMD_DEXT | + E1000_TXD_DTYP_D | data_len); =20 /* Put descriptor to the ring */ @@ -86,7 +63,8 @@ static void e1000e_send_verify(QE1000E *d, int *test_sock= ets, QGuestAllocator *a e1000e_wait_isr(d, E1000E_TX0_MSG_ID); =20 /* Check DD bit */ - g_assert_cmphex(le32_to_cpu(descr.upper.data) & dsta_dd, =3D=3D, dsta_= dd); + g_assert_cmphex(le32_to_cpu(descr.upper.data) & E1000_TXD_STAT_DD, =3D= =3D, + E1000_TXD_STAT_DD); =20 /* Check data sent to the backend */ ret =3D recv(test_sockets[0], &recv_len, sizeof(recv_len), 0); @@ -101,31 +79,7 @@ static void e1000e_send_verify(QE1000E *d, int *test_so= ckets, QGuestAllocator *a =20 static void e1000e_receive_verify(QE1000E *d, int *test_sockets, QGuestAll= ocator *alloc) { - union { - struct { - uint64_t buffer_addr; - uint64_t reserved; - } read; - struct { - struct { - uint32_t mrq; - union { - uint32_t rss; - struct { - uint16_t ip_id; - uint16_t csum; - } csum_ip; - } hi_dword; - } lower; - struct { - uint32_t status_error; - uint16_t length; - uint16_t vlan; - } upper; - } wb; - } descr; - - static const uint32_t esta_dd =3D BIT(0); + union e1000_rx_desc_extended descr; =20 char test[] =3D "TEST"; int len =3D htonl(sizeof(test)); @@ -162,7 +116,7 @@ static void e1000e_receive_verify(QE1000E *d, int *test= _sockets, QGuestAllocator =20 /* Check DD bit */ g_assert_cmphex(le32_to_cpu(descr.wb.upper.status_error) & - esta_dd, =3D=3D, esta_dd); + E1000_RXD_STAT_DD, =3D=3D, E1000_RXD_STAT_DD); =20 /* Check data sent to the backend */ memread(data, buffer, sizeof(buffer)); --=20 2.31.1 From nobody Sun May 5 05:46:49 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1667748780; cv=none; d=zohomail.com; s=zohoarc; b=Rq7LJzbXl5N/Evaw/mp/4mGLS+vw4bZ+sBcd1BPc+ernLhageR37x7ZKAEDbA2ERUmGtj9WN0276eqPsDVopc88u9BJ/iuUr8sNEyehmmzaHcb06KtkB05Ib0iy0d/Anj1clAkxMr8CFBwC8LSek3aiY5LEU19j8PIOFsWOL2iQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667748780; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ekTTpU+CJBjm1Kk01EmKvdGua+kpsXPd2YRwCKrr4/s=; b=ItzFruIMakAAIdFyA3ARGebiK9dbuR+48/rMsIU4uhPGYtPwC+o58bJnjdDEdgkO187WgrI8HS9BOhEC5STggcI8RTB5XWbKAhLbiCBO0etuLNB5WdnUnrNr4wcLGXFooVcj9PnLQPTBT+BUGAy5eZjM4O2B9yguDsHG7BLIPRc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1667748780605715.0357531382641; Sun, 6 Nov 2022 07:33:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1orhdB-0005sX-Vr; Sun, 06 Nov 2022 10:32:18 -0500 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 1orhd6-0005qe-Lv for qemu-devel@nongnu.org; Sun, 06 Nov 2022 10:32:12 -0500 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 1orhd5-0000vV-9v for qemu-devel@nongnu.org; Sun, 06 Nov 2022 10:32:12 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-606-gSPe7dYbP--0RgVYl7V2Ow-1; Sun, 06 Nov 2022 10:32:07 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E300F8339B4; Sun, 6 Nov 2022 15:32:06 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id BCDA840C6EC4; Sun, 6 Nov 2022 15:32:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667748730; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ekTTpU+CJBjm1Kk01EmKvdGua+kpsXPd2YRwCKrr4/s=; b=Wjxua91rKeZUeFf9R/NY2TRviiThraBPqaVMJ33EpQaGmKa95eEQe4CuTufR3AcOqVeC4y EH9u1bXuyPCv5LY9y8oS7eaHutYk6fJ+mfJqWUvYbML8vP09EBz382FZtMsalUT6yNVaqO w5byr0LkhKzBTJyFlQwJWzwGI8PnyN4= X-MC-Unique: gSPe7dYbP--0RgVYl7V2Ow-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Akihiko Odaki , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 04/12] tests/qtest/libqos/e1000e: Use E1000_STATUS_ASDV_1000 Date: Sun, 6 Nov 2022 16:31:48 +0100 Message-Id: <20221106153156.620150-5-thuth@redhat.com> In-Reply-To: <20221106153156.620150-1-thuth@redhat.com> References: <20221106153156.620150-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@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_H2=-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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1667748781884100002 From: Akihiko Odaki Nemonics E1000_STATUS_LAN_INIT_DONE and E1000_STATUS_ASDV_1000 have the same value, and E1000_STATUS_ASDV_1000 should be used here because E1000_STATUS_ASDV_1000 represents the auto-detected speed tested here while E1000_STATUS_LAN_INIT_DONE is a value used for a different purpose with a variant of e1000e family different from the one implemented in QEMU. Signed-off-by: Akihiko Odaki Message-Id: <20221103083425.100590-1-akihiko.odaki@daynix.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Thomas Huth --- tests/qtest/libqos/e1000e.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qtest/libqos/e1000e.c b/tests/qtest/libqos/e1000e.c index 4fd0bd5311..05af6f2118 100644 --- a/tests/qtest/libqos/e1000e.c +++ b/tests/qtest/libqos/e1000e.c @@ -130,8 +130,8 @@ static void e1000e_pci_start_hw(QOSGraphObject *obj) =20 /* Check the device status - link and speed */ val =3D e1000e_macreg_read(&d->e1000e, E1000_STATUS); - g_assert_cmphex(val & (E1000_STATUS_LU | E1000_STATUS_LAN_INIT_DONE), - =3D=3D, E1000_STATUS_LU | E1000_STATUS_LAN_INIT_DONE); + g_assert_cmphex(val & (E1000_STATUS_LU | E1000_STATUS_ASDV_1000), + =3D=3D, E1000_STATUS_LU | E1000_STATUS_ASDV_1000); =20 /* Initialize TX/RX logic */ e1000e_macreg_write(&d->e1000e, E1000_RCTL, 0); --=20 2.31.1 From nobody Sun May 5 05:46:49 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1667748800; cv=none; d=zohomail.com; s=zohoarc; b=Mim64GSIl1TYubhtq/ad0N06KDIIz6bu6kmtPZUqZJE+TrvR343ekXPjHUhx2DxYaxBaehzK+FGcmaDNF1lc6G//tOjM+Yxx+Eq4EWYNuI430n+HRycqz7DFnSGkbXuo38jIdnmbr6b85A4Y8qH6h9ibvFXwzcG50u+VeWFFbc0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667748800; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Jgc2Fjem7BpwgiPTCbsRBwjBJpx0JqRMMK+WlDC9Di4=; b=nud69PAaqW7HNmDL9SuIYpeOVofA6fzOJPwM0d9GAcPkXuMX+V5ZEvK7NUiXAxrvBSPs6c7KgWC0H8+XPcy64q6sS7ioX954Vn+EphFWn0Wl3ea6bCeogf/6GEcktrxgRopuWzUD+s4H5ZBdLgK22oPYYslSjgOSlt9m4Ov5e5M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1667748800627276.1815269284235; Sun, 6 Nov 2022 07:33:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1orhd9-0005rT-2v; Sun, 06 Nov 2022 10:32:15 -0500 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 1orhd6-0005qg-O9 for qemu-devel@nongnu.org; Sun, 06 Nov 2022 10:32:12 -0500 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 1orhd5-0000vW-9m for qemu-devel@nongnu.org; Sun, 06 Nov 2022 10:32:12 -0500 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-652-1vAdh6quNsumX92LMuWYyg-1; Sun, 06 Nov 2022 10:32:09 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0C2C31C06EC5; Sun, 6 Nov 2022 15:32:09 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 64C3540C6EC4; Sun, 6 Nov 2022 15:32:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667748730; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Jgc2Fjem7BpwgiPTCbsRBwjBJpx0JqRMMK+WlDC9Di4=; b=QEoOCfe5YiYBhX4QRmQ6F+qf1Cas/97VhAvDqBzglPiHZUBrp/CddqjTmfLVj9WRDvKCKw 172QhStxLTZDtxkCQck6R2IqjRYN/Txj+/HkW0eReNRQKm3h5BXKg5XrmDToaNiL7W8upF vaWfgLwd8A/g/fHE5j2rI3eihoMo3iE= X-MC-Unique: 1vAdh6quNsumX92LMuWYyg-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Akihiko Odaki , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 05/12] tests/qtest/libqos/e1000e: Use IVAR shift definitions Date: Sun, 6 Nov 2022 16:31:49 +0100 Message-Id: <20221106153156.620150-6-thuth@redhat.com> In-Reply-To: <20221106153156.620150-1-thuth@redhat.com> References: <20221106153156.620150-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@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_H2=-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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1667748801924100001 From: Akihiko Odaki There were still some constants defined in e1000_regs.h. Signed-off-by: Akihiko Odaki Message-Id: <20221105053010.38037-1-akihiko.odaki@daynix.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Thomas Huth --- tests/qtest/libqos/e1000e.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/qtest/libqos/e1000e.c b/tests/qtest/libqos/e1000e.c index 05af6f2118..80b3e3db90 100644 --- a/tests/qtest/libqos/e1000e.c +++ b/tests/qtest/libqos/e1000e.c @@ -30,9 +30,9 @@ #include "e1000e.h" =20 #define E1000E_IVAR_TEST_CFG \ - (E1000E_RX0_MSG_ID | E1000_IVAR_INT_ALLOC_VALID | \ - ((E1000E_TX0_MSG_ID | E1000_IVAR_INT_ALLOC_VALID) << 8) | \ - ((E1000E_OTHER_MSG_ID | E1000_IVAR_INT_ALLOC_VALID) << 16) | \ + (((E1000E_RX0_MSG_ID | E1000_IVAR_INT_ALLOC_VALID) << E1000_IVAR_RXQ0_= SHIFT) | \ + ((E1000E_TX0_MSG_ID | E1000_IVAR_INT_ALLOC_VALID) << E1000_IVAR_TXQ0_= SHIFT) | \ + ((E1000E_OTHER_MSG_ID | E1000_IVAR_INT_ALLOC_VALID) << E1000_IVAR_OTH= ER_SHIFT) | \ E1000_IVAR_TX_INT_EVERY_WB) =20 #define E1000E_RING_LEN (0x1000) --=20 2.31.1 From nobody Sun May 5 05:46:49 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1667748836; cv=none; d=zohomail.com; s=zohoarc; b=n2oo/kskY6bgPcK1A98Dz0ZzkceNJ4GBIQGyMQtCMM9qrnKHemYZiT8EFfpQr/RwkEfQ3kW8G6Z+Lt0b3Fw+0GLLAdtZeB8ykz5PVO6jg2nIebk4w+dBUhbejKQDNjPrP3NRbsF8Vq6bIM0ULRsVuZFNJBXpwDYYQS10JnvU4Mw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667748836; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Ytmr1Edaon7a63ByJjxpI7OJQzzEgSsUwdihfNxT29M=; b=hGT3R4KfEVTOC2fdyKI/kFJmhoBHGHgaVZ+0QKTR+WK0s/JJeXeEEcEdU+07ZxwbzhkSfZiZBzaBntIUsSS0gK5TT/8o3A9PniL/K1+qLSOvCxEgua0Ro9I9vaA3IVGejjW1jkprf4t320VI80s6wbrK4Jvdq8D6bMqxtyoGzcI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16677488366179.310572147220569; Sun, 6 Nov 2022 07:33:56 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1orhdD-0005tB-QZ; Sun, 06 Nov 2022 10:32:19 -0500 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 1orhd9-0005rf-M0 for qemu-devel@nongnu.org; Sun, 06 Nov 2022 10:32:15 -0500 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 1orhd8-0000vz-Cg for qemu-devel@nongnu.org; Sun, 06 Nov 2022 10:32:15 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-158-EFu8zuDcPISVKU4cQIzCLg-1; Sun, 06 Nov 2022 10:32:12 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1D395185A78F; Sun, 6 Nov 2022 15:32:12 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id A6C9540C6EC4; Sun, 6 Nov 2022 15:32:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667748733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ytmr1Edaon7a63ByJjxpI7OJQzzEgSsUwdihfNxT29M=; b=Mr9tc9y4hADrjtJjSZI4fNPSJg7jHFs9o6UVOo8ftoLRKCNXrCDC/UmJdLgqfQ6LfTan2n c5MU9nl48Oq94xG7mDRn0+mJ97cS3rtOjocLfxdbUSJZXP1dz2nmnJS7dONWjgNup2StDI s2Yjw4A6Vs6Vs29OAz2IjVD7iCjr09U= X-MC-Unique: EFu8zuDcPISVKU4cQIzCLg-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Stefan Weil , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 06/12] tests/qtest: Fix two format strings Date: Sun, 6 Nov 2022 16:31:50 +0100 Message-Id: <20221106153156.620150-7-thuth@redhat.com> In-Reply-To: <20221106153156.620150-1-thuth@redhat.com> References: <20221106153156.620150-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@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_H2=-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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1667748838131100003 From: Stefan Weil Signed-off-by: Stefan Weil Message-Id: <20221105115525.623059-1-sw@weilnetz.de> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Thomas Huth --- tests/qtest/migration-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index d2eb107f0c..f574331b7b 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -2188,7 +2188,7 @@ static void calc_dirty_rate(QTestState *who, uint64_t= calc_time) qobject_unref(qmp_command(who, "{ 'execute': 'calc-dirty-rate'," "'arguments': { " - "'calc-time': %ld," + "'calc-time': %" PRIu64 "," "'mode': 'dirty-ring' }}", calc_time)); } @@ -2203,7 +2203,7 @@ static void dirtylimit_set_all(QTestState *who, uint6= 4_t dirtyrate) qobject_unref(qmp_command(who, "{ 'execute': 'set-vcpu-dirty-limit'," "'arguments': { " - "'dirty-rate': %ld } }", + "'dirty-rate': %" PRIu64 " } }", dirtyrate)); } =20 --=20 2.31.1 From nobody Sun May 5 05:46:49 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1667748843; cv=none; d=zohomail.com; s=zohoarc; b=f/FL3H33DTObQ/ABu4WPlYIq0gcutJfOOvkIu77/sJ2WoEWHBQTUk8gIVCt1ANCMZkWGNZUNAKR3iqkQVGpv/v2/Hperj1seLlynKL+Gomqcye+bgMbs5SMF/40+RXZZ2eydf2bqBrxXcSUothFjeSICsP2vBP7W7g6Ua54aRac= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667748843; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4Bo3cIjdTsQ530ZGM3xL7A7C0HtvuB6dNSHa7MS8vgk=; b=I8Z7UFJyTFChUn75BpOrIwr8O95L2A2HYuZYw6HD9iEK1Duuph50/qYTHWDcjOam2j1PGJM91kCHFsdsTt3Nle8LDtREclOmL19EKec6tTfjFHf3Qf3Qbwjrl71Bpz9lVpDtliiLSgbRkP0B/EmTBGxtKpGjUTPxgfya1krv9bs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 166774884344864.36497441128529; Sun, 6 Nov 2022 07:34:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1orhdF-0005tf-Hc; Sun, 06 Nov 2022 10:32:21 -0500 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 1orhdD-0005sy-3X for qemu-devel@nongnu.org; Sun, 06 Nov 2022 10:32:19 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1orhdB-0000wE-69 for qemu-devel@nongnu.org; Sun, 06 Nov 2022 10:32:18 -0500 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-591-fbTMLZqoNNC95q05sA7HOg-1; Sun, 06 Nov 2022 10:32:14 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2E7243C02B86; Sun, 6 Nov 2022 15:32:14 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id B308340C6EC4; Sun, 6 Nov 2022 15:32:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667748736; 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=4Bo3cIjdTsQ530ZGM3xL7A7C0HtvuB6dNSHa7MS8vgk=; b=NwSk+DW7VJJQNwW+tlgwTvUuPjxw8fbBOYxr5gT0ls7cO3C0M2N1iWsaYeEShHiY0/eWw2 DBtUSimaa9Q5oKmjA0aQ1RUiRSSWYByzpeg4hBt12sYEPDd7lYQRRYeBv/7QGNUqXy3MzG jHCZZ53QGOBv7RMN4QsV8ywltRwqdNI= X-MC-Unique: fbTMLZqoNNC95q05sA7HOg-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng Subject: [PULL 07/12] tests/qtest: migration-test: Enable TLS PSK tests for win32 Date: Sun, 6 Nov 2022 16:31:51 +0100 Message-Id: <20221106153156.620150-8-thuth@redhat.com> In-Reply-To: <20221106153156.620150-1-thuth@redhat.com> References: <20221106153156.620150-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H2=-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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1667748844268100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng Since commit f1018ea0a30f ("tests: avoid DOS line endings in PSK file"), the bug of the helper test_tls_psk_init_common() that caused TLS PSK tests to fail on Windows was fixed. Let's enable these tests on win32. Signed-off-by: Bin Meng Message-Id: <20221101035021.729669-1-bin.meng@windriver.com> Signed-off-by: Thomas Huth --- tests/qtest/migration-test.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index f574331b7b..442998d9eb 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -1402,7 +1402,6 @@ static void test_precopy_unix_dirty_ring(void) } =20 #ifdef CONFIG_GNUTLS -#ifndef _WIN32 static void test_precopy_unix_tls_psk(void) { g_autofree char *uri =3D g_strdup_printf("unix:%s/migsocket", tmpfs); @@ -1415,7 +1414,6 @@ static void test_precopy_unix_tls_psk(void) =20 test_precopy_common(&args); } -#endif /* _WIN32 */ =20 #ifdef CONFIG_TASN1 static void test_precopy_unix_tls_x509_default_host(void) @@ -1524,7 +1522,6 @@ static void test_precopy_tcp_plain(void) } =20 #ifdef CONFIG_GNUTLS -#ifndef _WIN32 static void test_precopy_tcp_tls_psk_match(void) { MigrateCommon args =3D { @@ -1535,7 +1532,6 @@ static void test_precopy_tcp_tls_psk_match(void) =20 test_precopy_common(&args); } -#endif /* _WIN32 */ =20 static void test_precopy_tcp_tls_psk_mismatch(void) { @@ -1933,7 +1929,6 @@ static void test_multifd_tcp_zstd(void) #endif =20 #ifdef CONFIG_GNUTLS -#ifndef _WIN32 static void * test_migrate_multifd_tcp_tls_psk_start_match(QTestState *from, QTestState *to) @@ -1941,7 +1936,6 @@ test_migrate_multifd_tcp_tls_psk_start_match(QTestSta= te *from, test_migrate_precopy_tcp_multifd_start_common(from, to, "none"); return test_migrate_tls_psk_start_match(from, to); } -#endif /* _WIN32 */ =20 static void * test_migrate_multifd_tcp_tls_psk_start_mismatch(QTestState *from, @@ -1993,7 +1987,6 @@ test_migrate_multifd_tls_x509_start_reject_anon_clien= t(QTestState *from, } #endif /* CONFIG_TASN1 */ =20 -#ifndef _WIN32 static void test_multifd_tcp_tls_psk_match(void) { MigrateCommon args =3D { @@ -2003,7 +1996,6 @@ static void test_multifd_tcp_tls_psk_match(void) }; test_precopy_common(&args); } -#endif /* _WIN32 */ =20 static void test_multifd_tcp_tls_psk_mismatch(void) { @@ -2505,10 +2497,8 @@ int main(int argc, char **argv) qtest_add_func("/migration/precopy/unix/plain", test_precopy_unix_plai= n); qtest_add_func("/migration/precopy/unix/xbzrle", test_precopy_unix_xbz= rle); #ifdef CONFIG_GNUTLS -#ifndef _WIN32 qtest_add_func("/migration/precopy/unix/tls/psk", test_precopy_unix_tls_psk); -#endif =20 if (has_uffd) { /* @@ -2534,10 +2524,8 @@ int main(int argc, char **argv) =20 qtest_add_func("/migration/precopy/tcp/plain", test_precopy_tcp_plain); #ifdef CONFIG_GNUTLS -#ifndef _WIN32 qtest_add_func("/migration/precopy/tcp/tls/psk/match", test_precopy_tcp_tls_psk_match); -#endif qtest_add_func("/migration/precopy/tcp/tls/psk/mismatch", test_precopy_tcp_tls_psk_mismatch); #ifdef CONFIG_TASN1 @@ -2581,10 +2569,8 @@ int main(int argc, char **argv) test_multifd_tcp_zstd); #endif #ifdef CONFIG_GNUTLS -#ifndef _WIN32 qtest_add_func("/migration/multifd/tcp/tls/psk/match", test_multifd_tcp_tls_psk_match); -#endif qtest_add_func("/migration/multifd/tcp/tls/psk/mismatch", test_multifd_tcp_tls_psk_mismatch); #ifdef CONFIG_TASN1 --=20 2.31.1 From nobody Sun May 5 05:46:49 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1667748907; cv=none; d=zohomail.com; s=zohoarc; b=PXitN/kwWY6dyXgxtC8yoRCoZAoOHG8ht5p0bobdwjRsSN3YL6lZ5P4/FKuImmgnBZQzsN2A7TlYMHYFWMx0SwF5n8d80DSCHM0Ow55jGwo8KSQbQaSHmUqFpddw009KYe4zY3XonOSixdFb2Cx5KdxWeTXAJd+NsCzsgWs8vbA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667748907; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/jI1QYuN8WmVqRKlTg0NONBEWHLvUyqXOmIoH5Qej6g=; b=aVdrjjITEiE0fBt6LmPtZRzwE6+AfZl54BrYifrKH5AVINCvLZZIEf4bUdf03btKu+fjo/syLPZhsnT9R7OWs2Fyt8kP3WJZvZCJedTjtze2zWpGB4AUDgTT8BHosF3BSKcKXsew6uZ4ye2LN5/zBSC0d9raqgozgItRu3xRAhI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1667748907037557.6530320304688; Sun, 6 Nov 2022 07:35:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1orhdE-0005tc-C3; Sun, 06 Nov 2022 10:32:20 -0500 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 1orhdD-0005sz-4w for qemu-devel@nongnu.org; Sun, 06 Nov 2022 10:32:19 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1orhdB-0000wI-LZ for qemu-devel@nongnu.org; Sun, 06 Nov 2022 10:32:18 -0500 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-613-mnHvjSUSN4uopX3vALzK2Q-1; Sun, 06 Nov 2022 10:32:15 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 969E23814580 for ; Sun, 6 Nov 2022 15:32:15 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id AA38740C6EC4; Sun, 6 Nov 2022 15:32:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667748737; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/jI1QYuN8WmVqRKlTg0NONBEWHLvUyqXOmIoH5Qej6g=; b=U3HE1/Irdoe/+1aBSsdz2XFPMFgz+8CpjuzcKTKz3F17KkFk7A0DnhAsfHx7iKiIF0PTs0 Wx0qc4gLv+pb/KpmneJSnFgwoj35ryEctuBiHCRHLc8x69PHHd3sGGSNd1OJyC4w/8KYco 3GPkGmH5FboCJ7IhjFRNdY04B09kLCU= X-MC-Unique: mnHvjSUSN4uopX3vALzK2Q-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 08/12] gitlab-ci: increase clang-user timeout Date: Sun, 6 Nov 2022 16:31:52 +0100 Message-Id: <20221106153156.620150-9-thuth@redhat.com> In-Reply-To: <20221106153156.620150-1-thuth@redhat.com> References: <20221106153156.620150-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H2=-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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1667748908458100001 From: Stefan Hajnoczi The clang-user test exceeds the 1 hour timeout occassionally. Philippe Mathieu-Daud=C3=A9 has pointed out that the number of tcg tests has increased since QEMU 7.1. The execution time therefore probably reflects a legitimate increase in tests rather than a performance regression. Bump the timeout to prevent CI failures. Suggested-by: Thomas Huth Signed-off-by: Stefan Hajnoczi Reviewed-by: Thomas Huth Message-Id: <20221104113659.427690-1-stefanha@redhat.com> Signed-off-by: Thomas Huth --- .gitlab-ci.d/buildtest.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index 6c05c46397..7173749c52 100644 --- a/.gitlab-ci.d/buildtest.yml +++ b/.gitlab-ci.d/buildtest.yml @@ -327,6 +327,7 @@ clang-user: extends: .native_build_job_template needs: job: amd64-debian-user-cross-container + timeout: 70m variables: IMAGE: debian-all-test-cross CONFIGURE_ARGS: --cc=3Dclang --cxx=3Dclang++ --disable-system --=20 2.31.1 From nobody Sun May 5 05:46:49 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1667748899; cv=none; d=zohomail.com; s=zohoarc; b=c3tvuu5F/qA3lwifVggtoxmSZX3ucWKxdk8trZnQD2cfPlOLg3w82pm4wVvtjemBKQsl8rDwqd3yD5tx9dTXYCIyvQ22x1yDWfG4I0bsPZ2NsUfbD8wyZY9D2/40JfCC4IyUOEgXCks2097vzqOe/Q4afOr/2f0DBVedVX9U8qA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667748899; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6hui+x56VCFnzeo+xXoNx7wtQIXmlXYo5/6lVYqmwUo=; b=OMHHIO7c7mmrhF5VQVaFnHbzryU9Tl27qOmpz59crsohyZuDCEsKkpIEejy1uDuaCv+98U3vRG9dq79/KptkKW+MZbjd12d4l3epLpuKYuq2rkUnJVYJDr8u2wpmfBtA2eOYNLTK2WN5XOyBnJt1kr//LTjVGpGaz/R5DCs/CvY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 166774889936535.92810322575099; Sun, 6 Nov 2022 07:34:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1orhdK-0005uO-4h; Sun, 06 Nov 2022 10:32:26 -0500 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 1orhdI-0005uG-9V for qemu-devel@nongnu.org; Sun, 06 Nov 2022 10:32:24 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1orhdG-0000wc-IO for qemu-devel@nongnu.org; Sun, 06 Nov 2022 10:32:24 -0500 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-529-3UtDXoEZPdSTe_AZjN4kyg-1; Sun, 06 Nov 2022 10:32:18 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1FC433814582; Sun, 6 Nov 2022 15:32:18 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 38DF640C6EC5; Sun, 6 Nov 2022 15:32:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667748742; 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=6hui+x56VCFnzeo+xXoNx7wtQIXmlXYo5/6lVYqmwUo=; b=ZwAR1wvCU9gHi6gdhsTvA+7fC0ZL0AJ5btJNdGd8LskuOa3WMufHfpRoSeJtOVUjenrXcF 2yWDumbLGr+h6+0I837flGIHD4jMv0J9ZD9jvX9U1aybaLagUBBbiWpP8n1ajVKUiASHoO cnbSRmRXX90A0UiO/fO1sjC8M+u26k4= X-MC-Unique: 3UtDXoEZPdSTe_AZjN4kyg-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Peter Jin , Eric Farman , Matthew Rosato Subject: [PULL 09/12] s390x/css: revert SCSW ctrl/flag bits on error Date: Sun, 6 Nov 2022 16:31:53 +0100 Message-Id: <20221106153156.620150-10-thuth@redhat.com> In-Reply-To: <20221106153156.620150-1-thuth@redhat.com> References: <20221106153156.620150-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H2=-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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1667748900456100001 Content-Type: text/plain; charset="utf-8" From: Peter Jin Revert the control and flag bits in the subchannel status word in case the SSCH operation fails with non-zero CC (ditto for CSCH and HSCH). According to POPS, the control and flag bits are only changed if SSCH, CSCH, and HSCH return CC 0, and no other action should be taken otherwise. In order to simulate that after the fact, the bits need to be reverted on non-zero CC. While the do_subchannel_work logic for virtual (virtio) devices will return condition code 0, passthrough (vfio) devices may encounter errors from either the host kernel or real hardware that need to be accounted for after this point. This includes restoring the state of the Subchannel Status Word to reflect the subchannel, as these bits would not be set in the event of a non-zero condition code from the affected instructions. Experimentation has shown that a failure on a START SUBCHANNEL (SSCH) to a passthrough device would leave the subchannel with the START PENDING activity control bit set, thus blocking subsequent SSCH operations in css_do_ssch() until some form of error recovery was undertaken since no interrupt would be expected. Signed-off-by: Peter Jin Message-Id: <20221027212341.2904795-1-pjin@linux.ibm.com> Reviewed-by: Eric Farman Reviewed-by: Matthew Rosato [thuth: Updated the commit description to Eric's suggestion] Signed-off-by: Thomas Huth --- hw/s390x/css.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 3 deletions(-) diff --git a/hw/s390x/css.c b/hw/s390x/css.c index 7d9523f811..95d1b3a3ce 100644 --- a/hw/s390x/css.c +++ b/hw/s390x/css.c @@ -1522,21 +1522,37 @@ IOInstEnding css_do_xsch(SubchDev *sch) IOInstEnding css_do_csch(SubchDev *sch) { SCHIB *schib =3D &sch->curr_status; + uint16_t old_scsw_ctrl; + IOInstEnding ccode; =20 if (~(schib->pmcw.flags) & (PMCW_FLAGS_MASK_DNV | PMCW_FLAGS_MASK_ENA)= ) { return IOINST_CC_NOT_OPERATIONAL; } =20 + /* + * Save the current scsw.ctrl in case CSCH fails and we need + * to revert the scsw to the status quo ante. + */ + old_scsw_ctrl =3D schib->scsw.ctrl; + /* Trigger the clear function. */ schib->scsw.ctrl &=3D ~(SCSW_CTRL_MASK_FCTL | SCSW_CTRL_MASK_ACTL); schib->scsw.ctrl |=3D SCSW_FCTL_CLEAR_FUNC | SCSW_ACTL_CLEAR_PEND; =20 - return do_subchannel_work(sch); + ccode =3D do_subchannel_work(sch); + + if (ccode !=3D IOINST_CC_EXPECTED) { + schib->scsw.ctrl =3D old_scsw_ctrl; + } + + return ccode; } =20 IOInstEnding css_do_hsch(SubchDev *sch) { SCHIB *schib =3D &sch->curr_status; + uint16_t old_scsw_ctrl; + IOInstEnding ccode; =20 if (~(schib->pmcw.flags) & (PMCW_FLAGS_MASK_DNV | PMCW_FLAGS_MASK_ENA)= ) { return IOINST_CC_NOT_OPERATIONAL; @@ -1553,6 +1569,12 @@ IOInstEnding css_do_hsch(SubchDev *sch) return IOINST_CC_BUSY; } =20 + /* + * Save the current scsw.ctrl in case HSCH fails and we need + * to revert the scsw to the status quo ante. + */ + old_scsw_ctrl =3D schib->scsw.ctrl; + /* Trigger the halt function. */ schib->scsw.ctrl |=3D SCSW_FCTL_HALT_FUNC; schib->scsw.ctrl &=3D ~SCSW_FCTL_START_FUNC; @@ -1564,7 +1586,13 @@ IOInstEnding css_do_hsch(SubchDev *sch) } schib->scsw.ctrl |=3D SCSW_ACTL_HALT_PEND; =20 - return do_subchannel_work(sch); + ccode =3D do_subchannel_work(sch); + + if (ccode !=3D IOINST_CC_EXPECTED) { + schib->scsw.ctrl =3D old_scsw_ctrl; + } + + return ccode; } =20 static void css_update_chnmon(SubchDev *sch) @@ -1605,6 +1633,8 @@ static void css_update_chnmon(SubchDev *sch) IOInstEnding css_do_ssch(SubchDev *sch, ORB *orb) { SCHIB *schib =3D &sch->curr_status; + uint16_t old_scsw_ctrl, old_scsw_flags; + IOInstEnding ccode; =20 if (~(schib->pmcw.flags) & (PMCW_FLAGS_MASK_DNV | PMCW_FLAGS_MASK_ENA)= ) { return IOINST_CC_NOT_OPERATIONAL; @@ -1626,11 +1656,26 @@ IOInstEnding css_do_ssch(SubchDev *sch, ORB *orb) } sch->orb =3D *orb; sch->channel_prog =3D orb->cpa; + + /* + * Save the current scsw.ctrl and scsw.flags in case SSCH fails and we= need + * to revert the scsw to the status quo ante. + */ + old_scsw_ctrl =3D schib->scsw.ctrl; + old_scsw_flags =3D schib->scsw.flags; + /* Trigger the start function. */ schib->scsw.ctrl |=3D (SCSW_FCTL_START_FUNC | SCSW_ACTL_START_PEND); schib->scsw.flags &=3D ~SCSW_FLAGS_MASK_PNO; =20 - return do_subchannel_work(sch); + ccode =3D do_subchannel_work(sch); + + if (ccode !=3D IOINST_CC_EXPECTED) { + schib->scsw.ctrl =3D old_scsw_ctrl; + schib->scsw.flags =3D old_scsw_flags; + } + + return ccode; } =20 static void copy_irb_to_guest(IRB *dest, const IRB *src, const PMCW *pmcw, --=20 2.31.1 From nobody Sun May 5 05:46:49 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1667748808; cv=none; d=zohomail.com; s=zohoarc; b=WBVX9OOVAKziJ6YcAJtTAHEl+acG8Q4+CGEfKB7raT6pjmU5HxkbK3dmPPwmxj0PbLbusH4WjsMFcaLLa7Q+EVf1MRqrpeHLcKBrpvvzDofgbRbLUf9pMKzLwpSnpZIeM5SK0e/BJJokphhxqng64bKyWiYZfH4QPNGc8xrgeoU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667748808; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=XVjB/U2WspMJZBRYHArHBEfP1lalAn0AwwelXFXYKSk=; b=ba2AvYcHB5Ubg6cqBLvIcNFsEkEepOr7G5+UJvUyE0OJuBGAp2Nl9PyiUrmvC5OR7wPSUxxH1+/4vqzQnh+UjiAt8T/rNbjncxmrUeXyqiSmVwG42J0JVyZM+0F5Qb9LvPeN0Gc78Y/5e3KnpuKVGtWsIoF57aPdSEcd2Spk8cc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1667748808597864.4072644497986; Sun, 6 Nov 2022 07:33:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1orhdL-0005v0-Ot; Sun, 06 Nov 2022 10:32:27 -0500 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 1orhdK-0005uh-HX for qemu-devel@nongnu.org; Sun, 06 Nov 2022 10:32:26 -0500 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 1orhdH-0000x4-QL for qemu-devel@nongnu.org; Sun, 06 Nov 2022 10:32:26 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-358-WUGuD4lWM6WHzLa101tf7w-1; Sun, 06 Nov 2022 10:32:20 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CF380101A528; Sun, 6 Nov 2022 15:32:19 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 64EBE40C6EC4; Sun, 6 Nov 2022 15:32:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667748743; 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=XVjB/U2WspMJZBRYHArHBEfP1lalAn0AwwelXFXYKSk=; b=gkcDVsYWRQUoUVTpdBSRbhUgESb5FYsq+lmQTtN0cr4JUpXS+jCEjzkVY8XRtoKS8KcwIB J+Bpl4MkQ9uuT7SXN7r8sN9vkmUO5hVQ06pWKzcJDXRk4AU7/0/2hfEergwGIgfxx9Xf89 UNCb8XrK76ayPpbc+qQjy+x4fjhqTwQ= X-MC-Unique: WUGuD4lWM6WHzLa101tf7w-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Matthew Rosato , Niklas Schnelle , Eric Farman Subject: [PULL 10/12] s390x/pci: RPCIT second pass when mappings exhausted Date: Sun, 6 Nov 2022 16:31:54 +0100 Message-Id: <20221106153156.620150-11-thuth@redhat.com> In-Reply-To: <20221106153156.620150-1-thuth@redhat.com> References: <20221106153156.620150-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@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_H2=-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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1667748810037100003 Content-Type: text/plain; charset="utf-8" From: Matthew Rosato If we encounter a new mapping while the number of available DMA entries in vfio is 0, we are currently skipping that mapping which is a problem if we manage to free up DMA space after that within the same RPCIT -- we will return to the guest with CC0 and have not mapped everything within the specified range. This issue was uncovered while testing changes to the s390 linux kernel iommu/dma code, where a different usage pattern was employed (new mappings start at the end of the aperture and work back towards the front, making us far more likely to encounter new mappings before invalidated mappings during a global refresh). Fix this by tracking whether any mappings were skipped due to vfio DMA limit hitting 0; when this occurs, we still continue the range and unmap/map anything we can - then we must re-run the range again to pickup anything that was missed. This must occur in a loop until all requests are satisfied (success) or we detect that we are still unable to complete all mappings (return ZPCI_RPCIT_ST_INSUFF_RES). Link: https://lore.kernel.org/linux-s390/20221019144435.369902-1-schnelle@l= inux.ibm.com/ Fixes: 37fa32de70 ("s390x/pci: Honor DMA limits set by vfio") Reported-by: Niklas Schnelle Signed-off-by: Matthew Rosato Message-Id: <20221028194758.204007-2-mjrosato@linux.ibm.com> Reviewed-by: Eric Farman Signed-off-by: Thomas Huth --- hw/s390x/s390-pci-inst.c | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c index 20a9bcc7af..7cc4bcf850 100644 --- a/hw/s390x/s390-pci-inst.c +++ b/hw/s390x/s390-pci-inst.c @@ -677,8 +677,9 @@ int rpcit_service_call(S390CPU *cpu, uint8_t r1, uint8_= t r2, uintptr_t ra) S390PCIBusDevice *pbdev; S390PCIIOMMU *iommu; S390IOTLBEntry entry; - hwaddr start, end; + hwaddr start, end, sstart; uint32_t dma_avail; + bool again; =20 if (env->psw.mask & PSW_MASK_PSTATE) { s390_program_interrupt(env, PGM_PRIVILEGED, ra); @@ -691,7 +692,7 @@ int rpcit_service_call(S390CPU *cpu, uint8_t r1, uint8_= t r2, uintptr_t ra) } =20 fh =3D env->regs[r1] >> 32; - start =3D env->regs[r2]; + sstart =3D start =3D env->regs[r2]; end =3D start + env->regs[r2 + 1]; =20 pbdev =3D s390_pci_find_dev_by_fh(s390_get_phb(), fh); @@ -732,6 +733,9 @@ int rpcit_service_call(S390CPU *cpu, uint8_t r1, uint8_= t r2, uintptr_t ra) goto err; } =20 + retry: + start =3D sstart; + again =3D false; while (start < end) { error =3D s390_guest_io_table_walk(iommu->g_iota, start, &entry); if (error) { @@ -739,13 +743,24 @@ int rpcit_service_call(S390CPU *cpu, uint8_t r1, uint= 8_t r2, uintptr_t ra) } =20 start +=3D entry.len; - while (entry.iova < start && entry.iova < end && - (dma_avail > 0 || entry.perm =3D=3D IOMMU_NONE)) { - dma_avail =3D s390_pci_update_iotlb(iommu, &entry); - entry.iova +=3D TARGET_PAGE_SIZE; - entry.translated_addr +=3D TARGET_PAGE_SIZE; + while (entry.iova < start && entry.iova < end) { + if (dma_avail > 0 || entry.perm =3D=3D IOMMU_NONE) { + dma_avail =3D s390_pci_update_iotlb(iommu, &entry); + entry.iova +=3D TARGET_PAGE_SIZE; + entry.translated_addr +=3D TARGET_PAGE_SIZE; + } else { + /* + * We are unable to make a new mapping at this time, conti= nue + * on and hopefully free up more space. Then attempt anot= her + * pass. + */ + again =3D true; + break; + } } } + if (again && dma_avail > 0) + goto retry; err: if (error) { pbdev->state =3D ZPCI_FS_ERROR; --=20 2.31.1 From nobody Sun May 5 05:46:49 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1667748815; cv=none; d=zohomail.com; s=zohoarc; b=K2WRHqfEmCOCrEcG6umRigldY/GW5EnbtjmKbEaPzk2EX0w3dZkNTkghX63nD3rDsu7jh+eTL2snTDYEH1vcAQSUD0/ik0XgmdxDpcW9pVq/csBOhWJh63re9FJSKpj3mbai3Xn4OHBAlZrGk+GXq3LgnIgedWA3gvWiEIEwRLg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667748815; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=z2HNe7tob13Oi20jhUrK/TxOsUMNDUIP/y6/791f2fY=; b=Od5V9ngf2iy6EYP2ecPdTAXiLOHS92cVkyrxtL3G0OscMRrKwhP7b01sRDfictH/bqOfVmtMsF14zAbTEID7hOBpsA1/Lk3FWOzwxgTUT8ItSyta1C85g0jkmlQs+RXlEtpU8voEZhbIpjfAsiEsbt6RsWBe3ZIdyEJgVLt/Ed4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1667748815245919.6418388963986; Sun, 6 Nov 2022 07:33:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1orhdN-0005w0-BU; Sun, 06 Nov 2022 10:32:29 -0500 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 1orhdL-0005up-2L for qemu-devel@nongnu.org; Sun, 06 Nov 2022 10:32:27 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1orhdH-0000x2-Rz for qemu-devel@nongnu.org; Sun, 06 Nov 2022 10:32:26 -0500 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-587-WEtfF_akPryHCJE2mSjWKA-1; Sun, 06 Nov 2022 10:32:21 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8780629A9CCB; Sun, 6 Nov 2022 15:32:21 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 58AFC40C6EC4; Sun, 6 Nov 2022 15:32:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667748743; 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=z2HNe7tob13Oi20jhUrK/TxOsUMNDUIP/y6/791f2fY=; b=NF37IF/iSz1kSWdro8EySQwhBobHRj1LsFG0OdzcwWYlJoTcXKCdJ8pb8tKLKtnEJvgN8/ 7QKd2KEhWKHpwEcl3yVPcPIJ/naHg6kegCMIJ2shNL+N5y3RJPSQmmixIssYIA55TWlmU+ 0yeMLE5qoY5UKoEXL+HjMZA0EeCnzGs= X-MC-Unique: WEtfF_akPryHCJE2mSjWKA-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Pierre Morel Subject: [PULL 11/12] s390x: Register TYPE_S390_CCW_MACHINE properties as class properties Date: Sun, 6 Nov 2022 16:31:55 +0100 Message-Id: <20221106153156.620150-12-thuth@redhat.com> In-Reply-To: <20221106153156.620150-1-thuth@redhat.com> References: <20221106153156.620150-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H2=-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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1667748816073100001 Content-Type: text/plain; charset="utf-8" From: Pierre Morel Currently, when running 'qemu-system-s390x -M s390-ccw-virtio,help' the s390x-specific properties are not listed anymore. This happens because since commit d8fb7d0969 ("vl: switch -M parsing to keyval") the properties have to be defined at the class level and not at the instance level anymore. Fix it on s390x now, too, by moving the registration of the properties to the class level" Fixes: d8fb7d0969 ("vl: switch -M parsing to keyval") Signed-off-by: Pierre Morel Message-Id: <20221103170150.20789-2-pmorel@linux.ibm.com> [thuth: Add patch description] Signed-off-by: Thomas Huth --- hw/s390x/s390-virtio-ccw.c | 127 +++++++++++++++++++++---------------- 1 file changed, 72 insertions(+), 55 deletions(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 806de32034..196773c833 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -43,6 +43,7 @@ #include "sysemu/sysemu.h" #include "hw/s390x/pv.h" #include "migration/blocker.h" +#include "qapi/visitor.h" =20 static Error *pv_mig_blocker; =20 @@ -589,38 +590,6 @@ static ram_addr_t s390_fixup_ram_size(ram_addr_t sz) return newsz; } =20 -static void ccw_machine_class_init(ObjectClass *oc, void *data) -{ - MachineClass *mc =3D MACHINE_CLASS(oc); - NMIClass *nc =3D NMI_CLASS(oc); - HotplugHandlerClass *hc =3D HOTPLUG_HANDLER_CLASS(oc); - S390CcwMachineClass *s390mc =3D S390_CCW_MACHINE_CLASS(mc); - - s390mc->ri_allowed =3D true; - s390mc->cpu_model_allowed =3D true; - s390mc->css_migration_enabled =3D true; - s390mc->hpage_1m_allowed =3D true; - mc->init =3D ccw_init; - mc->reset =3D s390_machine_reset; - mc->block_default_type =3D IF_VIRTIO; - mc->no_cdrom =3D 1; - mc->no_floppy =3D 1; - mc->no_parallel =3D 1; - mc->no_sdcard =3D 1; - mc->max_cpus =3D S390_MAX_CPUS; - mc->has_hotpluggable_cpus =3D true; - assert(!mc->get_hotplug_handler); - mc->get_hotplug_handler =3D s390_get_hotplug_handler; - mc->cpu_index_to_instance_props =3D s390_cpu_index_to_props; - mc->possible_cpu_arch_ids =3D s390_possible_cpu_arch_ids; - /* it is overridden with 'host' cpu *in kvm_arch_init* */ - mc->default_cpu_type =3D S390_CPU_TYPE_NAME("qemu"); - hc->plug =3D s390_machine_device_plug; - hc->unplug_request =3D s390_machine_device_unplug_request; - nc->nmi_monitor_handler =3D s390_nmi; - mc->default_ram_id =3D "s390.ram"; -} - static inline bool machine_get_aes_key_wrap(Object *obj, Error **errp) { S390CcwMachineState *ms =3D S390_CCW_MACHINE(obj); @@ -710,19 +679,29 @@ bool hpage_1m_allowed(void) return get_machine_class()->hpage_1m_allowed; } =20 -static char *machine_get_loadparm(Object *obj, Error **errp) +static void machine_get_loadparm(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) { S390CcwMachineState *ms =3D S390_CCW_MACHINE(obj); + char *str =3D g_strndup((char *) ms->loadparm, sizeof(ms->loadparm)); =20 - /* make a NUL-terminated string */ - return g_strndup((char *) ms->loadparm, sizeof(ms->loadparm)); + visit_type_str(v, name, &str, errp); + g_free(str); } =20 -static void machine_set_loadparm(Object *obj, const char *val, Error **err= p) +static void machine_set_loadparm(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) { S390CcwMachineState *ms =3D S390_CCW_MACHINE(obj); + char *val; int i; =20 + if (!visit_type_str(v, name, &val, errp)) { + return; + } + for (i =3D 0; i < sizeof(ms->loadparm) && val[i]; i++) { uint8_t c =3D qemu_toupper(val[i]); /* mimic HMC */ =20 @@ -740,34 +719,72 @@ static void machine_set_loadparm(Object *obj, const c= har *val, Error **errp) ms->loadparm[i] =3D ' '; /* pad right with spaces */ } } -static inline void s390_machine_initfn(Object *obj) + +static void ccw_machine_class_init(ObjectClass *oc, void *data) { - object_property_add_bool(obj, "aes-key-wrap", - machine_get_aes_key_wrap, - machine_set_aes_key_wrap); - object_property_set_description(obj, "aes-key-wrap", + MachineClass *mc =3D MACHINE_CLASS(oc); + NMIClass *nc =3D NMI_CLASS(oc); + HotplugHandlerClass *hc =3D HOTPLUG_HANDLER_CLASS(oc); + S390CcwMachineClass *s390mc =3D S390_CCW_MACHINE_CLASS(mc); + + s390mc->ri_allowed =3D true; + s390mc->cpu_model_allowed =3D true; + s390mc->css_migration_enabled =3D true; + s390mc->hpage_1m_allowed =3D true; + mc->init =3D ccw_init; + mc->reset =3D s390_machine_reset; + mc->block_default_type =3D IF_VIRTIO; + mc->no_cdrom =3D 1; + mc->no_floppy =3D 1; + mc->no_parallel =3D 1; + mc->no_sdcard =3D 1; + mc->max_cpus =3D S390_MAX_CPUS; + mc->has_hotpluggable_cpus =3D true; + assert(!mc->get_hotplug_handler); + mc->get_hotplug_handler =3D s390_get_hotplug_handler; + mc->cpu_index_to_instance_props =3D s390_cpu_index_to_props; + mc->possible_cpu_arch_ids =3D s390_possible_cpu_arch_ids; + /* it is overridden with 'host' cpu *in kvm_arch_init* */ + mc->default_cpu_type =3D S390_CPU_TYPE_NAME("qemu"); + hc->plug =3D s390_machine_device_plug; + hc->unplug_request =3D s390_machine_device_unplug_request; + nc->nmi_monitor_handler =3D s390_nmi; + mc->default_ram_id =3D "s390.ram"; + + object_class_property_add_bool(oc, "aes-key-wrap", + machine_get_aes_key_wrap, + machine_set_aes_key_wrap); + object_class_property_set_description(oc, "aes-key-wrap", "enable/disable AES key wrapping using the CPACF wrapping key"= ); - object_property_set_bool(obj, "aes-key-wrap", true, NULL); =20 - object_property_add_bool(obj, "dea-key-wrap", - machine_get_dea_key_wrap, - machine_set_dea_key_wrap); - object_property_set_description(obj, "dea-key-wrap", + object_class_property_add_bool(oc, "dea-key-wrap", + machine_get_dea_key_wrap, + machine_set_dea_key_wrap); + object_class_property_set_description(oc, "dea-key-wrap", "enable/disable DEA key wrapping using the CPACF wrapping key"= ); - object_property_set_bool(obj, "dea-key-wrap", true, NULL); - object_property_add_str(obj, "loadparm", - machine_get_loadparm, machine_set_loadparm); - object_property_set_description(obj, "loadparm", + + object_class_property_add(oc, "loadparm", "loadparm", + machine_get_loadparm, machine_set_loadparm, + NULL, NULL); + object_class_property_set_description(oc, "loadparm", "Up to 8 chars in set of [A-Za-z0-9. ] (lower case chars conve= rted" " to upper case) to pass to machine loader, boot manager," " and guest kernel"); =20 - object_property_add_bool(obj, "zpcii-disable", - machine_get_zpcii_disable, - machine_set_zpcii_disable); - object_property_set_description(obj, "zpcii-disable", + object_class_property_add_bool(oc, "zpcii-disable", + machine_get_zpcii_disable, + machine_set_zpcii_disable); + object_class_property_set_description(oc, "zpcii-disable", "disable zPCI interpretation facilties"); - object_property_set_bool(obj, "zpcii-disable", false, NULL); +} + +static inline void s390_machine_initfn(Object *obj) +{ + S390CcwMachineState *ms =3D S390_CCW_MACHINE(obj); + + ms->aes_key_wrap =3D true; + ms->dea_key_wrap =3D true; + ms->zpcii_disable =3D false; } =20 static const TypeInfo ccw_machine_info =3D { --=20 2.31.1 From nobody Sun May 5 05:46:49 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1667748871; cv=none; d=zohomail.com; s=zohoarc; b=ebYaDEfaMvFauxSQXyK6lTazy3KpVtj7Ek+eIIz923TqL8ODgiqBW9rtNyQKCtL2jTuGvjO0V+drgA1BExN3Fph6tWz/QURnytKlthJU/71eSgZfys72nb5/EkXJoYI4F9tIMMowbrxthuoQktUGf0KuqNxOa6zo/f+QYqD/MNs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667748871; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=FSc7kASAompedP/qqWg7JHmuf7auHcR0TUlKhC+u7yw=; b=PJI26lrU4pWO+l9XjjRBGOAzqcmvDcl2zIChyB0V8UVbFzs1po1gL6vF/WNi9pwXmxVTAxivJ/QmWWSLxzt6x3bOELnsvqbUr2lzJn9sH7GQz8AUcZXxpDuslr/Tr/L4WHAurKr6MCY4oEBAg9cxDh4y5Q2d69iaXYDCuZDPwIk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16677488718631016.9071992764527; Sun, 6 Nov 2022 07:34:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1orhdO-0005wM-Rt; Sun, 06 Nov 2022 10:32:30 -0500 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 1orhdL-0005v1-PM for qemu-devel@nongnu.org; Sun, 06 Nov 2022 10:32:27 -0500 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 1orhdK-0000y4-DB for qemu-devel@nongnu.org; Sun, 06 Nov 2022 10:32:27 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-290-1aHLLA8UOgWtPCvLjN4MMQ-1; Sun, 06 Nov 2022 10:32:23 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2EC0E185A792; Sun, 6 Nov 2022 15:32:23 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id F2D3640C6EC4; Sun, 6 Nov 2022 15:32:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667748745; 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=FSc7kASAompedP/qqWg7JHmuf7auHcR0TUlKhC+u7yw=; b=Q+cbbahzuazwlKX4gWlNnFwkmv4NsNzzZn3N6FBUoaFzZmlv1Hgtya6mHAG8upOg2YfIK2 hU/+vM8mTRDBzcm1nB36XVH1TwAo9VuZrsjSxM/o4e43XsCCEun5iFZ48MEnG5yUqyvrj/ UwHrMHsYyxN/2nfx/WTjPcN1dS9te6g= X-MC-Unique: 1aHLLA8UOgWtPCvLjN4MMQ-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Pierre Morel Subject: [PULL 12/12] s390x/cpu topology: add max_threads machine class attribute Date: Sun, 6 Nov 2022 16:31:56 +0100 Message-Id: <20221106153156.620150-13-thuth@redhat.com> In-Reply-To: <20221106153156.620150-1-thuth@redhat.com> References: <20221106153156.620150-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@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_H2=-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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1667748872279100001 Content-Type: text/plain; charset="utf-8" From: Pierre Morel The S390 CPU topology accepts the smp.threads argument while in reality it does not effectively allow multthreading. Let's keep this behavior for machines older than 7.2 and refuse to use threads in newer machines until multithreading is really exposed to the guest by the machine. Signed-off-by: Pierre Morel Message-Id: <20221103170150.20789-3-pmorel@linux.ibm.com> [thuth: Small fixes to the commit description] Signed-off-by: Thomas Huth --- include/hw/s390x/s390-virtio-ccw.h | 1 + hw/s390x/s390-virtio-ccw.c | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/include/hw/s390x/s390-virtio-ccw.h b/include/hw/s390x/s390-vir= tio-ccw.h index 8a0090a071..4f8a39abda 100644 --- a/include/hw/s390x/s390-virtio-ccw.h +++ b/include/hw/s390x/s390-virtio-ccw.h @@ -40,6 +40,7 @@ struct S390CcwMachineClass { bool cpu_model_allowed; bool css_migration_enabled; bool hpage_1m_allowed; + int max_threads; }; =20 /* runtime-instrumentation allowed by the machine */ diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 196773c833..560ddbb6fb 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -85,8 +85,15 @@ out: static void s390_init_cpus(MachineState *machine) { MachineClass *mc =3D MACHINE_GET_CLASS(machine); + S390CcwMachineClass *s390mc =3D S390_CCW_MACHINE_CLASS(mc); int i; =20 + if (machine->smp.threads > s390mc->max_threads) { + error_report("S390 does not support more than %d threads.", + s390mc->max_threads); + exit(1); + } + /* initialize possible_cpus */ mc->possible_cpu_arch_ids(machine); =20 @@ -731,6 +738,7 @@ static void ccw_machine_class_init(ObjectClass *oc, voi= d *data) s390mc->cpu_model_allowed =3D true; s390mc->css_migration_enabled =3D true; s390mc->hpage_1m_allowed =3D true; + s390mc->max_threads =3D 1; mc->init =3D ccw_init; mc->reset =3D s390_machine_reset; mc->block_default_type =3D IF_VIRTIO; @@ -859,8 +867,11 @@ static void ccw_machine_7_1_instance_options(MachineSt= ate *machine) =20 static void ccw_machine_7_1_class_options(MachineClass *mc) { + S390CcwMachineClass *s390mc =3D S390_CCW_MACHINE_CLASS(mc); + ccw_machine_7_2_class_options(mc); compat_props_add(mc->compat_props, hw_compat_7_1, hw_compat_7_1_len); + s390mc->max_threads =3D S390_MAX_CPUS; } DEFINE_CCW_MACHINE(7_1, "7.1", false); =20 --=20 2.31.1