From nobody Tue Nov 26 13:19:59 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=1707216368; cv=none; d=zohomail.com; s=zohoarc; b=mplhQOkoNPyZbG8OXxKEIP6owytzAyJe5ozrmVVLVGbMM0OxtP+4IzvPLAIcbR7o5Z92AyTrnjPUoqsSTg8UjiuQwS8bN2nebJlIf33t9A+CVokLwXGAmRVR97hc3cf7dqcpSHx1OHzKnEBUzJl2eid8X0tZnRhWBIIf8fwlAHg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707216368; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=x+uzC8Z4gSLL8Q72zuWcwUQ+UBRU55ra9QewclI0m2c=; b=S/fZJFwMrTQSOkt5xFo4gzfHGiouIhjS6i91w3ToFeBTOw6eDjMDAdkU+U2kh0JuHhj+P6npJtyOxRn3J8FXQT2fuL3GMi8LXL85lerM8GzypObUiwMLuvZo0V2TgMVq2sMQLTv4Dp+jCqnVz/ETIM4NJWihRqg7JOrxsK0FLuo= 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 1707216368553832.9723416257087; Tue, 6 Feb 2024 02:46:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rXIvu-0006tP-4I; Tue, 06 Feb 2024 05:44:06 -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 1rXIvl-0006sJ-P7 for qemu-devel@nongnu.org; Tue, 06 Feb 2024 05:43:59 -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 1rXIvj-00039B-8H for qemu-devel@nongnu.org; Tue, 06 Feb 2024 05:43:56 -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.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-638-MMOe4FHBPdiGnpUHFO_f2A-1; Tue, 06 Feb 2024 05:43:51 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8F20785A589; Tue, 6 Feb 2024 10:43:51 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.195.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id AA6BA492BF0; Tue, 6 Feb 2024 10:43:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707216233; 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=x+uzC8Z4gSLL8Q72zuWcwUQ+UBRU55ra9QewclI0m2c=; b=VmT+cnpBu5VpABTwyD84HjHOIug7atBTOy+ddiUXMZneIr+v6iCEks2sQ8MkD1f4O1+0bc UcvdYn6RfMqLTYw5NsrN8zWLjNOAvGKuEZwLZgjuo86tUpTdrZvsIwFZPQ/9W8PyyVjo0X UFNABzoQQW0u28u2ieJQPvOTL6p5vVI= X-MC-Unique: MMOe4FHBPdiGnpUHFO_f2A-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Sven Schnelle , Helge Deller Subject: [PULL 01/12] hw/scsi/lsi53c895a: add missing decrement of reentrancy counter Date: Tue, 6 Feb 2024 11:43:36 +0100 Message-ID: <20240206104347.238825-2-thuth@redhat.com> In-Reply-To: <20240206104347.238825-1-thuth@redhat.com> References: <20240206104347.238825-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 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: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.285, 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1707216369165100001 Content-Type: text/plain; charset="utf-8" From: Sven Schnelle When the maximum count of SCRIPTS instructions is reached, the code stops execution and returns, but fails to decrement the reentrancy counter. This effectively renders the SCSI controller unusable because on next entry the reentrancy counter is still above the limit. This bug was seen on HP-UX 10.20 which seems to trigger SCRIPTS loops. Fixes: b987718bbb ("hw/scsi/lsi53c895a: Fix reentrancy issues in the LSI co= ntroller (CVE-2023-0330)") Signed-off-by: Sven Schnelle Message-ID: <20240128202214.2644768-1-svens@stackframe.org> Reviewed-by: Thomas Huth Tested-by: Helge Deller Signed-off-by: Thomas Huth --- hw/scsi/lsi53c895a.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index 34e3b89287..d607a5f9fb 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -1159,6 +1159,7 @@ again: lsi_script_scsi_interrupt(s, LSI_SIST0_UDC, 0); lsi_disconnect(s); trace_lsi_execute_script_stop(); + reentrancy_level--; return; } insn =3D read_dword(s, s->dsp); --=20 2.43.0 From nobody Tue Nov 26 13:19:59 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=1707216340; cv=none; d=zohomail.com; s=zohoarc; b=eGbSfUXxowVTPS9LdvBXd0Ak9V+jOQAth71AwE3sHX0X4NZyK9XD8H4s3bzEhbOnU3YKkWL3EGPM4MbdxA2zMU9INm5Ija66b+R77HWXWn95XEkoCsJYOcuXTMJRcvIIGE2+T36k7j/N+COU9eh5ra6h8yuna/y1NS8QFEneCIw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707216340; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=lui+zfEHwTa84G7gBv3rrXHn+tSC14NgRm7xXAbQH2A=; b=M4QdaZrPb4s7c3bJKA3qcWK5PXkG5emKA/WxTrIKSI+O6d0jn6atVqd8XmfaqdzKwZv9LWM4TSsCshfWPB/FRIssXaZukFlpivzdF/7X5QH2tKQ1bauoZfEOSIiMTNfmUJITZOm8lR2ih/QfFLxknotCxJVzoZ307EKiaKZ4kEM= 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 1707216340618769.8519697871842; Tue, 6 Feb 2024 02:45:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rXIvv-0006uB-Hn; Tue, 06 Feb 2024 05:44:07 -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 1rXIvn-0006sU-HH for qemu-devel@nongnu.org; Tue, 06 Feb 2024 05:44:00 -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 1rXIvl-0003AK-Ny for qemu-devel@nongnu.org; Tue, 06 Feb 2024 05:43:59 -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.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-626-msHKBc3cPTGQcRCRodFFPA-1; Tue, 06 Feb 2024 05:43:53 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 181B4185A781; Tue, 6 Feb 2024 10:43:53 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.195.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id 84278492BFA; Tue, 6 Feb 2024 10:43:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707216237; 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=lui+zfEHwTa84G7gBv3rrXHn+tSC14NgRm7xXAbQH2A=; b=dlGSfRGXfE9cD+q4dSsWK4PnlBw1+OG6pwtPf7vo0YCX68qQfjGujrP5m9hu0jfuX8EqOt VLLtRF2hFiSADHhiIz4X484JOCIOBh7sAl7HUNW4yBM/fLUOAgxwTMrZqocdm2CCQsE+BP H7wXPUzDjtDSVzsoTmJcnx4gpy2cxd4= X-MC-Unique: msHKBc3cPTGQcRCRodFFPA-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Harsh Prateek Bora Subject: [PULL 02/12] target/ppc/cpu-models: Rename power5+ and power7+ for new QOM naming rules Date: Tue, 6 Feb 2024 11:43:37 +0100 Message-ID: <20240206104347.238825-3-thuth@redhat.com> In-Reply-To: <20240206104347.238825-1-thuth@redhat.com> References: <20240206104347.238825-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.4.1 on 10.11.54.10 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: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.285, 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1707216341142100001 The character "+" is now forbidden in QOM device names (see commit b447378e1217 - "Limit type names to alphanumerical and some few special characters"). For the "power5+" and "power7+" CPU names, there is currently a hack in type_name_is_valid() to still allow them for compatibility reasons. However, there is a much nicer solution for this: Simply use aliases! This way we can still support the old names without the need for the ugly hack in type_name_is_valid(). Message-ID: <20240117141054.73841-2-thuth@redhat.com> Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Harsh Prateek Bora Signed-off-by: Thomas Huth --- hw/ppc/spapr_cpu_core.c | 4 ++-- qom/object.c | 4 ---- target/ppc/cpu-models.c | 10 ++++++---- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c index 5aa1ed474a..0c0fb3f1b0 100644 --- a/hw/ppc/spapr_cpu_core.c +++ b/hw/ppc/spapr_cpu_core.c @@ -389,9 +389,9 @@ static const TypeInfo spapr_cpu_core_type_infos[] =3D { DEFINE_SPAPR_CPU_CORE_TYPE("970_v2.2"), DEFINE_SPAPR_CPU_CORE_TYPE("970mp_v1.0"), DEFINE_SPAPR_CPU_CORE_TYPE("970mp_v1.1"), - DEFINE_SPAPR_CPU_CORE_TYPE("power5+_v2.1"), + DEFINE_SPAPR_CPU_CORE_TYPE("power5p_v2.1"), DEFINE_SPAPR_CPU_CORE_TYPE("power7_v2.3"), - DEFINE_SPAPR_CPU_CORE_TYPE("power7+_v2.1"), + DEFINE_SPAPR_CPU_CORE_TYPE("power7p_v2.1"), DEFINE_SPAPR_CPU_CORE_TYPE("power8_v2.0"), DEFINE_SPAPR_CPU_CORE_TYPE("power8e_v2.1"), DEFINE_SPAPR_CPU_CORE_TYPE("power8nvl_v1.0"), diff --git a/qom/object.c b/qom/object.c index 654e1afaf2..2c4c64d2b6 100644 --- a/qom/object.c +++ b/qom/object.c @@ -160,10 +160,6 @@ static bool type_name_is_valid(const char *name) =20 /* Allow some legacy names with '+' in it for compatibility reasons */ if (name[plen] =3D=3D '+') { - if (plen =3D=3D 6 && g_str_has_prefix(name, "power")) { - /* Allow "power5+" and "power7+" CPU names*/ - return true; - } if (plen >=3D 17 && g_str_has_prefix(name, "Sun-UltraSparc-I")) { /* Allow "Sun-UltraSparc-IV+" and "Sun-UltraSparc-IIIi+" */ return true; diff --git a/target/ppc/cpu-models.c b/target/ppc/cpu-models.c index 7dbb47de64..36e465b390 100644 --- a/target/ppc/cpu-models.c +++ b/target/ppc/cpu-models.c @@ -716,11 +716,11 @@ "PowerPC 970MP v1.0") POWERPC_DEF("970mp_v1.1", CPU_POWERPC_970MP_v11, 970, "PowerPC 970MP v1.1") - POWERPC_DEF("power5+_v2.1", CPU_POWERPC_POWER5P_v21, POWER= 5P, + POWERPC_DEF("power5p_v2.1", CPU_POWERPC_POWER5P_v21, POWER= 5P, "POWER5+ v2.1") POWERPC_DEF("power7_v2.3", CPU_POWERPC_POWER7_v23, POWER= 7, "POWER7 v2.3") - POWERPC_DEF("power7+_v2.1", CPU_POWERPC_POWER7P_v21, POWER= 7, + POWERPC_DEF("power7p_v2.1", CPU_POWERPC_POWER7P_v21, POWER= 7, "POWER7+ v2.1") POWERPC_DEF("power8e_v2.1", CPU_POWERPC_POWER8E_v21, POWER= 8, "POWER8E v2.1") @@ -902,10 +902,12 @@ PowerPCCPUAlias ppc_cpu_aliases[] =3D { { "970", "970_v2.2" }, { "970fx", "970fx_v3.1" }, { "970mp", "970mp_v1.1" }, - { "power5+", "power5+_v2.1" }, + { "power5+", "power5p_v2.1" }, + { "power5+_v2.1", "power5p_v2.1" }, { "power5gs", "power5+_v2.1" }, { "power7", "power7_v2.3" }, - { "power7+", "power7+_v2.1" }, + { "power7+", "power7p_v2.1" }, + { "power7+_v2.1", "power7p_v2.1" }, { "power8e", "power8e_v2.1" }, { "power8", "power8_v2.0" }, { "power8nvl", "power8nvl_v1.0" }, --=20 2.43.0 From nobody Tue Nov 26 13:19:59 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=1707216359; cv=none; d=zohomail.com; s=zohoarc; b=PH4UcX3QE9y49wvmExfb8fGZziumiDowtbQwFaBiVXm/kksHlrY9t3mSPizCdOi2s5MqB3epzR6u3SiaBiWcQBExHnWsp92yN7CST3im3cNici5bILWAtXt3kAqi5yFToRNBhqxcUKB+2GDWpzUcyhlNgPEUfQPU5rXqKn4nFro= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707216359; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=EyhjOZmgZgyEhhaz4Na/AULA2Wqwu5sfka0GqXMlb4I=; b=Ej3A03RG9gM6RS9RIrm1at4nQsILGloP0xyK7ZafxP4NNtcDBXWNqjMSDtUKuIoP54LCz+Z4dVrmB/ufQkdRhS/1iB96GAWXh3KDDajWaUJ4sIN27eGRhlrs0qEKEAhR3ISet3s11dFNM7S02rMk+5lXvXIU6qbVNwoskk+W7Fw= 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 1707216359553534.9717204175537; Tue, 6 Feb 2024 02:45:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rXIvx-0006uk-Mz; Tue, 06 Feb 2024 05:44:09 -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 1rXIvp-0006tN-JQ for qemu-devel@nongnu.org; Tue, 06 Feb 2024 05:44:05 -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 1rXIvo-0003CQ-6R for qemu-devel@nongnu.org; Tue, 06 Feb 2024 05:44:01 -0500 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-642-3MdTHuYLPZqg-J7046bz7g-1; Tue, 06 Feb 2024 05:43:55 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 60CBA2820B7B; Tue, 6 Feb 2024 10:43:55 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.195.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8E7B9492BF0; Tue, 6 Feb 2024 10:43:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707216239; 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=EyhjOZmgZgyEhhaz4Na/AULA2Wqwu5sfka0GqXMlb4I=; b=T9hf1kuJg4FoNqos3y8B+5zgMFvt078sOGIubH1Nq/AkkfyRkQYJryF9Mw3CEh2MYM/30O DV47P+Kq0mWjl0WyMlV7vGEjQUiecIQ0VoznxkdTM+t1ZS/YwnGhAzFrIG1g7u4FrpWVfM Lba3LCpC0uWKTO7i5qxQvh/zb2y3IEU= X-MC-Unique: 3MdTHuYLPZqg-J7046bz7g-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Harsh Prateek Bora Subject: [PULL 03/12] docs/about: Deprecate the old "power5+" and "power7+" CPU names Date: Tue, 6 Feb 2024 11:43:38 +0100 Message-ID: <20240206104347.238825-4-thuth@redhat.com> In-Reply-To: <20240206104347.238825-1-thuth@redhat.com> References: <20240206104347.238825-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.4.1 on 10.11.54.10 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: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.285, 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1707216361213100003 For consistency we should drop the names with a "+" in it in the long run. Message-ID: <20240117141054.73841-3-thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Harsh Prateek Bora Signed-off-by: Thomas Huth --- docs/about/deprecated.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index d4492b9460..c7b95e6068 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -183,6 +183,15 @@ Nios II CPU (since 8.2) The Nios II architecture is orphan. The ``nios2`` guest CPU support is deprecated and will be removed in a future version of QEMU. =20 +``power5+`` and ``power7+`` CPU names (since 9.0) +''''''''''''''''''''''''''''''''''''''''''''''''' + +The character "+" in device (and thus also CPU) names is not allowed +in the QEMU object model anymore. ``power5+``, ``power5+_v2.1``, +``power7+`` and ``power7+_v2.1`` are currently still supported via +an alias, but for consistency these will get removed in a future +release, too. Use ``power5p_v2.1`` and ``power7p_v2.1`` instead. + =20 System emulator machines ------------------------ --=20 2.43.0 From nobody Tue Nov 26 13:19:59 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=1707216315; cv=none; d=zohomail.com; s=zohoarc; b=j5VRbBifqY/uD1asx7M+W1FFztjwXEysAHEsJhkCvKNp3/2AyV8PeGVK9EWRu0TKsxIKRt6PFH6gVjHgImQe6f2LEwQSakqu5FNoVoJMYeJQzYjlNFYEcd5guxJ/hlgK21JqhL//+uNDXv9ezqcsQ/8dsYlwuAX3JpDgzExWgQ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707216315; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=NPo68t13ooltvkSaVKjwUp1792HwvnqwUr9ZXG3B82o=; b=g8Uv4HrPZ75N7ZcgMnZ6AC/sb1IJ/fWSrmI5zvfdZFtPuyRi5tlCI7p/9ayZxEgAzzpjiPF076IxnG8PjR+IH+ywe9psyEkJwJnJMrRGVsEOH8JH6kD9aXih7sC7qz6vnnC8MIw3dIiSTGthHQKfXocWg7DhuzMaMpRmwihaRQg= 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 1707216315564494.1713926810729; Tue, 6 Feb 2024 02:45:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rXIw0-0006vv-8D; Tue, 06 Feb 2024 05:44:12 -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 1rXIvy-0006uz-E5 for qemu-devel@nongnu.org; Tue, 06 Feb 2024 05:44:10 -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 1rXIvp-0003DI-IU for qemu-devel@nongnu.org; Tue, 06 Feb 2024 05:44:03 -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.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-630-JjiHxyLuMm21-hUjahsJpw-1; Tue, 06 Feb 2024 05:43:57 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3C328185A780; Tue, 6 Feb 2024 10:43:57 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.195.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id D7B33492BFA; Tue, 6 Feb 2024 10:43:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707216241; 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=NPo68t13ooltvkSaVKjwUp1792HwvnqwUr9ZXG3B82o=; b=ht+cWbw1AHIidU1IjruM+oukAXx8f51FW+zGIldAztbmJHXN44r40/ckQmZpgI+A1xo82n 4xbTqEcy0S9mG1uwmrivMSmSWDkl2kt9PCRQe1lxLTt+qQRIP6DIVBL7EWVCd1FyrtB04i tqFTaXyaapp68rqFs5NuumqmRTts3pI= X-MC-Unique: JjiHxyLuMm21-hUjahsJpw-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Ilya Leoshkevich , Ido Plat , Richard Henderson Subject: [PULL 04/12] target/s390x: Emulate CVDG Date: Tue, 6 Feb 2024 11:43:39 +0100 Message-ID: <20240206104347.238825-5-thuth@redhat.com> In-Reply-To: <20240206104347.238825-1-thuth@redhat.com> References: <20240206104347.238825-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 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: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.285, 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1707216316844100011 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich CVDG is the same as CVD, except that it converts 64 bits into 128, rather than 32 into 64. Create a new helper, which uses Int128 wrappers. Reported-by: Ido Plat Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich Message-ID: <20240205205830.6425-2-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- target/s390x/helper.h | 1 + target/s390x/tcg/insn-data.h.inc | 1 + target/s390x/tcg/int_helper.c | 21 +++++++++++++++++++++ target/s390x/tcg/translate.c | 8 ++++++++ 4 files changed, 31 insertions(+) diff --git a/target/s390x/helper.h b/target/s390x/helper.h index 05102578fc..332a9a9c63 100644 --- a/target/s390x/helper.h +++ b/target/s390x/helper.h @@ -89,6 +89,7 @@ DEF_HELPER_FLAGS_2(sqeb, TCG_CALL_NO_WG, i64, env, i64) DEF_HELPER_FLAGS_2(sqdb, TCG_CALL_NO_WG, i64, env, i64) DEF_HELPER_FLAGS_2(sqxb, TCG_CALL_NO_WG, i128, env, i128) DEF_HELPER_FLAGS_1(cvd, TCG_CALL_NO_RWG_SE, i64, s32) +DEF_HELPER_FLAGS_1(cvdg, TCG_CALL_NO_RWG_SE, i128, s64) DEF_HELPER_FLAGS_4(pack, TCG_CALL_NO_WG, void, env, i32, i64, i64) DEF_HELPER_FLAGS_4(pka, TCG_CALL_NO_WG, void, env, i64, i64, i32) DEF_HELPER_FLAGS_4(pku, TCG_CALL_NO_WG, void, env, i64, i64, i32) diff --git a/target/s390x/tcg/insn-data.h.inc b/target/s390x/tcg/insn-data.= h.inc index 2f07f39d9c..388dcb8dbb 100644 --- a/target/s390x/tcg/insn-data.h.inc +++ b/target/s390x/tcg/insn-data.h.inc @@ -296,6 +296,7 @@ /* CONVERT TO DECIMAL */ C(0x4e00, CVD, RX_a, Z, r1_o, a2, 0, 0, cvd, 0) C(0xe326, CVDY, RXY_a, LD, r1_o, a2, 0, 0, cvd, 0) + C(0xe32e, CVDG, RXY_a, Z, r1_o, a2, 0, 0, cvdg, 0) /* CONVERT TO FIXED */ F(0xb398, CFEBR, RRF_e, Z, 0, e2, new, r1_32, cfeb, 0, IF_BFP) F(0xb399, CFDBR, RRF_e, Z, 0, f2, new, r1_32, cfdb, 0, IF_BFP) diff --git a/target/s390x/tcg/int_helper.c b/target/s390x/tcg/int_helper.c index eb8e6dd1b5..121e3006a6 100644 --- a/target/s390x/tcg/int_helper.c +++ b/target/s390x/tcg/int_helper.c @@ -118,6 +118,27 @@ uint64_t HELPER(cvd)(int32_t reg) return dec; } =20 +Int128 HELPER(cvdg)(int64_t reg) +{ + /* positive 0 */ + Int128 dec =3D int128_make64(0x0c); + Int128 bin =3D int128_makes64(reg); + Int128 base =3D int128_make64(10); + int shift; + + if (!int128_nonneg(bin)) { + bin =3D int128_neg(bin); + dec =3D int128_make64(0x0d); + } + + for (shift =3D 4; (shift < 128) && int128_nz(bin); shift +=3D 4) { + dec =3D int128_or(dec, int128_lshift(int128_remu(bin, base), shift= )); + bin =3D int128_divu(bin, base); + } + + return dec; +} + uint64_t HELPER(popcnt)(uint64_t val) { /* Note that we don't fold past bytes. */ diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index a5fd9cccaa..c2fdc920a5 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -2233,6 +2233,14 @@ static DisasJumpType op_cvd(DisasContext *s, DisasOp= s *o) return DISAS_NEXT; } =20 +static DisasJumpType op_cvdg(DisasContext *s, DisasOps *o) +{ + TCGv_i128 t =3D tcg_temp_new_i128(); + gen_helper_cvdg(t, o->in1); + tcg_gen_qemu_st_i128(t, o->in2, get_mem_index(s), MO_TE | MO_128); + return DISAS_NEXT; +} + static DisasJumpType op_ct(DisasContext *s, DisasOps *o) { int m3 =3D get_field(s, m3); --=20 2.43.0 From nobody Tue Nov 26 13:19:59 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=1707216312; cv=none; d=zohomail.com; s=zohoarc; b=K0+XnS+/B80TmMitEvDW4AX5+k9FDSi7a2KbhZlWDZOVdOcl7GIqMPBJvQdFIKJeZlYAklyeVNCWsBqMlbyZhcW93eHhmT/UU8jMuPdgh7XYzU61z2V/ZPZiAGZJsoUDdwS9HFLzuhK2h1CejSMnXSkugmD+7YHiserVseqE/uo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707216312; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=LEW/TtszoO0nHfwcNqAzABmv9qoplOiNeag/V+k8BeE=; b=l98c82jwAT3WAjAfle/SHqTy7nYKCQFQh5q1fP+0Wx1jDQepoZUew6CZlihclAbzNaqPy7db744lsE9qa7kvVc4iOrRQuEZcviHX4Tp2+eDGwjQLkqL/GpkClMVw5jZAO0xLwZnPuvK9s1TbFo8Yk2Q73QnlwAZgKuOhXo9Xjp8= 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 1707216312302960.3839225974648; Tue, 6 Feb 2024 02:45:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rXIw1-0006wl-PO; Tue, 06 Feb 2024 05:44:13 -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 1rXIvz-0006vg-SV for qemu-devel@nongnu.org; Tue, 06 Feb 2024 05:44:11 -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 1rXIvx-0003DW-Gf for qemu-devel@nongnu.org; Tue, 06 Feb 2024 05:44:11 -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.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-692-tUG88vZlOdSiexLqLjLUvg-1; Tue, 06 Feb 2024 05:43:59 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F421F10193AE; Tue, 6 Feb 2024 10:43:58 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.195.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id A913C492BF0; Tue, 6 Feb 2024 10:43:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707216241; 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=LEW/TtszoO0nHfwcNqAzABmv9qoplOiNeag/V+k8BeE=; b=GA25EbVw1cm1Dlenm+2Z4rVEHx2u4+r6RUTCP9EwYEZg9eZCeunaRCRYvVsgDotjlp771/ ugARJTl3jq/UsiGqQ4tpUN5+WzuCcAfQxlRQzs4dxERNxmgipoLQpQYUgyi7b5C//4ZNI3 9hZGJmoVvQYAewGunAN5j88DDlJiMxI= X-MC-Unique: tUG88vZlOdSiexLqLjLUvg-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Ilya Leoshkevich , Pavel Zbitskiy Subject: [PULL 05/12] target/s390x: Emulate CVB, CVBY and CVBG Date: Tue, 6 Feb 2024 11:43:40 +0100 Message-ID: <20240206104347.238825-6-thuth@redhat.com> In-Reply-To: <20240206104347.238825-1-thuth@redhat.com> References: <20240206104347.238825-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 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: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.285, 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1707216313120100003 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich Convert to Binary - counterparts of the already implemented Convert to Decimal (CVD*) instructions. Example from the Principles of Operation: 25594C becomes 63FA. Co-developed-by: Pavel Zbitskiy Signed-off-by: Ilya Leoshkevich Reviewed-by: Thomas Huth Message-ID: <20240205205830.6425-3-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- target/s390x/helper.h | 2 + target/s390x/tcg/insn-data.h.inc | 4 ++ target/s390x/tcg/int_helper.c | 76 ++++++++++++++++++++++++++++++++ target/s390x/tcg/translate.c | 16 +++++++ 4 files changed, 98 insertions(+) diff --git a/target/s390x/helper.h b/target/s390x/helper.h index 332a9a9c63..cc1c20e9e3 100644 --- a/target/s390x/helper.h +++ b/target/s390x/helper.h @@ -88,6 +88,8 @@ DEF_HELPER_FLAGS_3(tcxb, TCG_CALL_NO_RWG_SE, i32, env, i1= 28, i64) DEF_HELPER_FLAGS_2(sqeb, TCG_CALL_NO_WG, i64, env, i64) DEF_HELPER_FLAGS_2(sqdb, TCG_CALL_NO_WG, i64, env, i64) DEF_HELPER_FLAGS_2(sqxb, TCG_CALL_NO_WG, i128, env, i128) +DEF_HELPER_3(cvb, void, env, i32, i64) +DEF_HELPER_FLAGS_2(cvbg, TCG_CALL_NO_WG, i64, env, i128) DEF_HELPER_FLAGS_1(cvd, TCG_CALL_NO_RWG_SE, i64, s32) DEF_HELPER_FLAGS_1(cvdg, TCG_CALL_NO_RWG_SE, i128, s64) DEF_HELPER_FLAGS_4(pack, TCG_CALL_NO_WG, void, env, i32, i64, i64) diff --git a/target/s390x/tcg/insn-data.h.inc b/target/s390x/tcg/insn-data.= h.inc index 388dcb8dbb..e7d61cdec2 100644 --- a/target/s390x/tcg/insn-data.h.inc +++ b/target/s390x/tcg/insn-data.h.inc @@ -293,6 +293,10 @@ D(0xec73, CLFIT, RIE_a, GIE, r1_32u, i2_16u, 0, 0, ct, 0, 1) D(0xec71, CLGIT, RIE_a, GIE, r1_o, i2_16u, 0, 0, ct, 0, 1) =20 +/* CONVERT TO BINARY */ + C(0x4f00, CVB, RX_a, Z, la2, 0, 0, 0, cvb, 0) + C(0xe306, CVBY, RXY_a, LD, la2, 0, 0, 0, cvb, 0) + C(0xe30e, CVBG, RXY_a, Z, la2, 0, r1, 0, cvbg, 0) /* CONVERT TO DECIMAL */ C(0x4e00, CVD, RX_a, Z, r1_o, a2, 0, 0, cvd, 0) C(0xe326, CVDY, RXY_a, LD, r1_o, a2, 0, 0, cvd, 0) diff --git a/target/s390x/tcg/int_helper.c b/target/s390x/tcg/int_helper.c index 121e3006a6..2af970f2c8 100644 --- a/target/s390x/tcg/int_helper.c +++ b/target/s390x/tcg/int_helper.c @@ -25,6 +25,7 @@ #include "exec/exec-all.h" #include "qemu/host-utils.h" #include "exec/helper-proto.h" +#include "exec/cpu_ldst.h" =20 /* #define DEBUG_HELPER */ #ifdef DEBUG_HELPER @@ -98,6 +99,81 @@ Int128 HELPER(divu64)(CPUS390XState *env, uint64_t ah, u= int64_t al, uint64_t b) tcg_s390_program_interrupt(env, PGM_FIXPT_DIVIDE, GETPC()); } =20 +void HELPER(cvb)(CPUS390XState *env, uint32_t r1, uint64_t dec) +{ + int64_t pow10 =3D 1, bin =3D 0; + int digit, sign; + + sign =3D dec & 0xf; + if (sign < 0xa) { + tcg_s390_data_exception(env, 0, GETPC()); + } + dec >>=3D 4; + + while (dec) { + digit =3D dec & 0xf; + if (digit > 0x9) { + tcg_s390_data_exception(env, 0, GETPC()); + } + dec >>=3D 4; + bin +=3D digit * pow10; + pow10 *=3D 10; + } + + if (sign =3D=3D 0xb || sign =3D=3D 0xd) { + bin =3D -bin; + } + + /* R1 is updated even on fixed-point-divide exception. */ + env->regs[r1] =3D (env->regs[r1] & 0xffffffff00000000ULL) | (uint32_t)= bin; + if (bin !=3D (int32_t)bin) { + tcg_s390_program_interrupt(env, PGM_FIXPT_DIVIDE, GETPC()); + } +} + +uint64_t HELPER(cvbg)(CPUS390XState *env, Int128 dec) +{ + uint64_t dec64[] =3D {int128_getlo(dec), int128_gethi(dec)}; + int64_t bin =3D 0, pow10, tmp; + int digit, i, sign; + + sign =3D dec64[0] & 0xf; + if (sign < 0xa) { + tcg_s390_data_exception(env, 0, GETPC()); + } + dec64[0] >>=3D 4; + pow10 =3D (sign =3D=3D 0xb || sign =3D=3D 0xd) ? -1 : 1; + + for (i =3D 1; i < 20; i++) { + digit =3D dec64[i >> 4] & 0xf; + if (digit > 0x9) { + tcg_s390_data_exception(env, 0, GETPC()); + } + dec64[i >> 4] >>=3D 4; + /* + * Prepend the next digit and check for overflow. The multiplicati= on + * cannot overflow, since, conveniently, the int64_t limits are + * approximately +-9.2E+18. If bin is zero, the addition cannot + * overflow. Otherwise bin is known to have the same sign as the r= hs + * addend, in which case overflow happens if and only if the result + * has a different sign. + */ + tmp =3D bin + pow10 * digit; + if (bin && ((tmp ^ bin) < 0)) { + tcg_s390_program_interrupt(env, PGM_FIXPT_DIVIDE, GETPC()); + } + bin =3D tmp; + pow10 *=3D 10; + } + + g_assert(!dec64[0]); + if (dec64[1]) { + tcg_s390_program_interrupt(env, PGM_FIXPT_DIVIDE, GETPC()); + } + + return bin; +} + uint64_t HELPER(cvd)(int32_t reg) { /* positive 0 */ diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index c2fdc920a5..325b25959d 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -2223,6 +2223,22 @@ static DisasJumpType op_csp(DisasContext *s, DisasOp= s *o) } #endif =20 +static DisasJumpType op_cvb(DisasContext *s, DisasOps *o) +{ + TCGv_i64 t =3D tcg_temp_new_i64(); + tcg_gen_qemu_ld_i64(t, o->addr1, get_mem_index(s), MO_TEUQ); + gen_helper_cvb(tcg_env, tcg_constant_i32(get_field(s, r1)), t); + return DISAS_NEXT; +} + +static DisasJumpType op_cvbg(DisasContext *s, DisasOps *o) +{ + TCGv_i128 t =3D tcg_temp_new_i128(); + tcg_gen_qemu_ld_i128(t, o->addr1, get_mem_index(s), MO_TE | MO_128); + gen_helper_cvbg(o->out, tcg_env, t); + return DISAS_NEXT; +} + static DisasJumpType op_cvd(DisasContext *s, DisasOps *o) { TCGv_i64 t1 =3D tcg_temp_new_i64(); --=20 2.43.0 From nobody Tue Nov 26 13:19:59 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=1707216372; cv=none; d=zohomail.com; s=zohoarc; b=MbGjggaqnYc/cN/+BzyeRYh9dUkz2ZS6yXiA9OgNgxmBgcjsmhApt0pL8p6Rz2kTi5mI+3RP+2HjPFgX01zBEph12B+Fz8DMV5E9o7e+upw87+yjjpuFqEpnvi6KYZfV9vULDmzVlV5tRVFaeDynXPcp9/O/HgZT3DGURZfzSdc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707216372; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=LGZZO9ES01M1eLb8cjBZeC4p/SbElxMoWsEHPrWTT40=; b=Xd0VWFzyFfmXYeIEAggWrPiW2ZdaohYkndvpixd7Q5/53juD6fGJL+B+NIIxYAAXUBhTmI3GeV3HVyVVsR+WYZ5K7FXuWma1p6smna+7hyXmljqrDQbcknINVSMGgA+Z2WfB6tPT7su88T0dkiZMdp6n/3tDQduDfLJLoam+IuA= 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 1707216372256741.9405867499662; Tue, 6 Feb 2024 02:46:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rXIw1-0006vy-1N; Tue, 06 Feb 2024 05:44:13 -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 1rXIvz-0006vd-OC for qemu-devel@nongnu.org; Tue, 06 Feb 2024 05:44:11 -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 1rXIvy-0003Dy-5t for qemu-devel@nongnu.org; Tue, 06 Feb 2024 05:44:11 -0500 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-187-mySQl5q0NCurK_4ZKgm4jQ-1; Tue, 06 Feb 2024 05:44:00 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 885B938143AA; Tue, 6 Feb 2024 10:44:00 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.195.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id 731D5492BF0; Tue, 6 Feb 2024 10:43:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707216244; 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=LGZZO9ES01M1eLb8cjBZeC4p/SbElxMoWsEHPrWTT40=; b=EWTZ8zFY3pNlCN7pfKlI9QlawTB95JNbrFgqU/9BdXhHZEcxqERwIYU+XO7avYjwwYPIWW 9LaEKe7x0V9Ya8iTIhY2AgenCDWpbB/0TNsyMvYQxXwxk3LHI359D3I3HUIQY3WctIhdZX gCbS2vGeZWWjAjglQtK6o5CuqPHgEZ4= X-MC-Unique: mySQl5q0NCurK_4ZKgm4jQ-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Ilya Leoshkevich Subject: [PULL 06/12] tests/tcg/s390x: Test CONVERT TO DECIMAL Date: Tue, 6 Feb 2024 11:43:41 +0100 Message-ID: <20240206104347.238825-7-thuth@redhat.com> In-Reply-To: <20240206104347.238825-1-thuth@redhat.com> References: <20240206104347.238825-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 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: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.285, 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, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1707216373145100007 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich Check the CVD's, CVDY's, and CVDG's corner cases. Reviewed-by: Thomas Huth Signed-off-by: Ilya Leoshkevich Message-ID: <20240205205830.6425-4-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- tests/tcg/s390x/cvd.c | 63 +++++++++++++++++++++++++++++++++ tests/tcg/s390x/Makefile.target | 1 + 2 files changed, 64 insertions(+) create mode 100644 tests/tcg/s390x/cvd.c diff --git a/tests/tcg/s390x/cvd.c b/tests/tcg/s390x/cvd.c new file mode 100644 index 0000000000..d776688985 --- /dev/null +++ b/tests/tcg/s390x/cvd.c @@ -0,0 +1,63 @@ +/* + * Test the CONVERT TO DECIMAL instruction. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#include +#include +#include + +static uint64_t cvd(int32_t x) +{ + uint64_t ret; + + asm("cvd %[x],%[ret]" : [ret] "=3DR" (ret) : [x] "r" (x)); + + return ret; +} + +static uint64_t cvdy(int32_t x) +{ + uint64_t ret; + + asm("cvdy %[x],%[ret]" : [ret] "=3DT" (ret) : [x] "r" (x)); + + return ret; +} + +static __uint128_t cvdg(int64_t x) +{ + __uint128_t ret; + + asm("cvdg %[x],%[ret]" : [ret] "=3DT" (ret) : [x] "r" (x)); + + return ret; +} + +int main(void) +{ + __uint128_t m =3D (((__uint128_t)0x9223372036854775) << 16) | 0x8070; + + assert(cvd(0) =3D=3D 0xc); + assert(cvd(1) =3D=3D 0x1c); + assert(cvd(25594) =3D=3D 0x25594c); + assert(cvd(-1) =3D=3D 0x1d); + assert(cvd(0x7fffffff) =3D=3D 0x2147483647c); + assert(cvd(-0x80000000) =3D=3D 0x2147483648d); + + assert(cvdy(0) =3D=3D 0xc); + assert(cvdy(1) =3D=3D 0x1c); + assert(cvdy(25594) =3D=3D 0x25594c); + assert(cvdy(-1) =3D=3D 0x1d); + assert(cvdy(0x7fffffff) =3D=3D 0x2147483647c); + assert(cvdy(-0x80000000) =3D=3D 0x2147483648d); + + assert(cvdg(0) =3D=3D 0xc); + assert(cvdg(1) =3D=3D 0x1c); + assert(cvdg(25594) =3D=3D 0x25594c); + assert(cvdg(-1) =3D=3D 0x1d); + assert(cvdg(0x7fffffffffffffff) =3D=3D (m + 0xc)); + assert(cvdg(-0x8000000000000000) =3D=3D (m + 0x1d)); + + return EXIT_SUCCESS; +} diff --git a/tests/tcg/s390x/Makefile.target b/tests/tcg/s390x/Makefile.tar= get index 30994dcf9c..04e4bddd83 100644 --- a/tests/tcg/s390x/Makefile.target +++ b/tests/tcg/s390x/Makefile.target @@ -45,6 +45,7 @@ TESTS+=3Dclc TESTS+=3Dlaalg TESTS+=3Dadd-logical-with-carry TESTS+=3Dlae +TESTS+=3Dcvd =20 cdsg: CFLAGS+=3D-pthread cdsg: LDFLAGS+=3D-pthread --=20 2.43.0 From nobody Tue Nov 26 13:19:59 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=1707216388; cv=none; d=zohomail.com; s=zohoarc; b=SPnTMjjti5v0V08a6NdTA+Eb0egWPkVxUxeDE3Jg+QlnhczIV3SrM37DEuFUYVXo4YLRauP0urhSNT5Ege/PG9hCwuRL6z4cfdp1BpbdopZ4QcPQBiW104Do2TLBEdfTtZuFTp9oKzPzZRQ+TQTF8TTmQkn7DxACdNhjZkRhP+s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707216388; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Gw1GdGhiSZCRfVvN19txv0e6ILB4Z/YReWhCQVwyc4s=; b=LB2Zga6YsGW115VeA2RPIcxPB2PTdG3R1mdCMGaHHxtyC8w1R3IE+BJ1FLeUka6+Z2Igs3+cLIrUkv/aOIY4Jo5EHjHwaA4rA8pXH1Z9YGR11jCiqbL+xOFPWkdBwPn2973AL3rehztzGxIFIcpk2NBO4JfkMtowNyH6rN+nby0= 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 1707216388681326.4225308760289; Tue, 6 Feb 2024 02:46:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rXIw3-0006y2-DQ; Tue, 06 Feb 2024 05:44: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 1rXIw1-0006wF-9t for qemu-devel@nongnu.org; Tue, 06 Feb 2024 05:44:13 -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 1rXIvy-0003EO-62 for qemu-devel@nongnu.org; Tue, 06 Feb 2024 05:44: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.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-383-6JdNDj7DMYaWHDqGEuN_Yw-1; Tue, 06 Feb 2024 05:44:02 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4B25284AC68; Tue, 6 Feb 2024 10:44:02 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.195.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id C9E0C492BF0; Tue, 6 Feb 2024 10:44:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707216246; 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=Gw1GdGhiSZCRfVvN19txv0e6ILB4Z/YReWhCQVwyc4s=; b=OAypWjVytg7c1IW/CIPHtTzi/B360UDhndM1RW37B4ZQsYBv0TFc0VMRrx4jV8GARR1psn zSVdYv7eIuVnooAuxNy4mcD/hk+t6JQpb1g8WE9fhKHQ9OB4VWk+9wjRgjwJnF2+fE7Hat esaCRHry/QSTE8FxD1MI0cTRUb5Tids= X-MC-Unique: 6JdNDj7DMYaWHDqGEuN_Yw-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Ilya Leoshkevich , Pavel Zbitskiy Subject: [PULL 07/12] tests/tcg/s390x: Test CONVERT TO BINARY Date: Tue, 6 Feb 2024 11:43:42 +0100 Message-ID: <20240206104347.238825-8-thuth@redhat.com> In-Reply-To: <20240206104347.238825-1-thuth@redhat.com> References: <20240206104347.238825-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 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: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.285, 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, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1707216389292100004 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich Check the CVB's, CVBY's, and CVBG's corner cases. Co-developed-by: Pavel Zbitskiy Reviewed-by: Thomas Huth Tested-by: Thomas Huth Signed-off-by: Ilya Leoshkevich Message-ID: <20240205205830.6425-5-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- tests/tcg/s390x/cvb.c | 102 ++++++++++++++++++++++++++++++++ tests/tcg/s390x/Makefile.target | 1 + 2 files changed, 103 insertions(+) create mode 100644 tests/tcg/s390x/cvb.c diff --git a/tests/tcg/s390x/cvb.c b/tests/tcg/s390x/cvb.c new file mode 100644 index 0000000000..e1735f6b81 --- /dev/null +++ b/tests/tcg/s390x/cvb.c @@ -0,0 +1,102 @@ +/* + * Test the CONVERT TO BINARY instruction. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#include +#include +#include +#include +#include + +static int signum; + +static void signal_handler(int n) +{ + signum =3D n; +} + +#define FAIL 0x1234567887654321 +#define OK32(x) (0x1234567800000000 | (uint32_t)(x)) + +static int64_t cvb(uint64_t x) +{ + int64_t ret =3D FAIL; + + signum =3D -1; + asm("cvb %[ret],%[x]" : [ret] "+r" (ret) : [x] "R" (x)); + + return ret; +} + +static int64_t cvby(uint64_t x) +{ + int64_t ret =3D FAIL; + + signum =3D -1; + asm("cvby %[ret],%[x]" : [ret] "+r" (ret) : [x] "T" (x)); + + return ret; +} + +static int64_t cvbg(__uint128_t x) +{ + int64_t ret =3D FAIL; + + signum =3D -1; + asm("cvbg %[ret],%[x]" : [ret] "+r" (ret) : [x] "T" (x)); + + return ret; +} + +int main(void) +{ + __uint128_t m =3D (((__uint128_t)0x9223372036854775) << 16) | 0x8070; + struct sigaction act; + int err; + + memset(&act, 0, sizeof(act)); + act.sa_handler =3D signal_handler; + err =3D sigaction(SIGFPE, &act, NULL); + assert(err =3D=3D 0); + err =3D sigaction(SIGILL, &act, NULL); + assert(err =3D=3D 0); + + assert(cvb(0xc) =3D=3D OK32(0) && signum =3D=3D -1); + assert(cvb(0x1c) =3D=3D OK32(1) && signum =3D=3D -1); + assert(cvb(0x25594c) =3D=3D OK32(25594) && signum =3D=3D -1); + assert(cvb(0x1d) =3D=3D OK32(-1) && signum =3D=3D -1); + assert(cvb(0x2147483647c) =3D=3D OK32(0x7fffffff) && signum =3D=3D -1); + assert(cvb(0x2147483648d) =3D=3D OK32(-0x80000000) && signum =3D=3D -1= ); + assert(cvb(0x7) =3D=3D FAIL && signum =3D=3D SIGILL); + assert(cvb(0x2147483648c) =3D=3D OK32(0x80000000) && signum =3D=3D SIG= FPE); + assert(cvb(0x3000000000c) =3D=3D OK32(0xb2d05e00) && signum =3D=3D SIG= FPE); + assert(cvb(0x2147483649d) =3D=3D OK32(0x7fffffff) && signum =3D=3D SIG= FPE); + assert(cvb(0x3000000000d) =3D=3D OK32(0x4d2fa200) && signum =3D=3D SIG= FPE); + + assert(cvby(0xc) =3D=3D OK32(0)); + assert(cvby(0x1c) =3D=3D OK32(1)); + assert(cvby(0x25594c) =3D=3D OK32(25594)); + assert(cvby(0x1d) =3D=3D OK32(-1)); + assert(cvby(0x2147483647c) =3D=3D OK32(0x7fffffff)); + assert(cvby(0x2147483648d) =3D=3D OK32(-0x80000000)); + assert(cvby(0x7) =3D=3D FAIL && signum =3D=3D SIGILL); + assert(cvby(0x2147483648c) =3D=3D OK32(0x80000000) && signum =3D=3D SI= GFPE); + assert(cvby(0x3000000000c) =3D=3D OK32(0xb2d05e00) && signum =3D=3D SI= GFPE); + assert(cvby(0x2147483649d) =3D=3D OK32(0x7fffffff) && signum =3D=3D SI= GFPE); + assert(cvby(0x3000000000d) =3D=3D OK32(0x4d2fa200) && signum =3D=3D SI= GFPE); + + assert(cvbg(0xc) =3D=3D 0); + assert(cvbg(0x1c) =3D=3D 1); + assert(cvbg(0x25594c) =3D=3D 25594); + assert(cvbg(0x1d) =3D=3D -1); + assert(cvbg(m + 0xc) =3D=3D 0x7fffffffffffffff); + assert(cvbg(m + 0x1d) =3D=3D -0x8000000000000000); + assert(cvbg(0x7) =3D=3D FAIL && signum =3D=3D SIGILL); + assert(cvbg(m + 0x1c) =3D=3D FAIL && signum =3D=3D SIGFPE); + assert(cvbg(m + 0x2d) =3D=3D FAIL && signum =3D=3D SIGFPE); + assert(cvbg(((__uint128_t)1 << 80) + 0xc) =3D=3D FAIL && signum =3D=3D= SIGFPE); + assert(cvbg(((__uint128_t)1 << 80) + 0xd) =3D=3D FAIL && signum =3D=3D= SIGFPE); + + return EXIT_SUCCESS; +} diff --git a/tests/tcg/s390x/Makefile.target b/tests/tcg/s390x/Makefile.tar= get index 04e4bddd83..e2aba2ec27 100644 --- a/tests/tcg/s390x/Makefile.target +++ b/tests/tcg/s390x/Makefile.target @@ -46,6 +46,7 @@ TESTS+=3Dlaalg TESTS+=3Dadd-logical-with-carry TESTS+=3Dlae TESTS+=3Dcvd +TESTS+=3Dcvb =20 cdsg: CFLAGS+=3D-pthread cdsg: LDFLAGS+=3D-pthread --=20 2.43.0 From nobody Tue Nov 26 13:19:59 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=1707216388; cv=none; d=zohomail.com; s=zohoarc; b=WB5nAGurqC6vBuoqSnPlrOwg87dulY1k0GjMGbTZCyOoveAiZHWRON5CDCLUU2S2MSj8QLpvuGZld+O+7sOYPpIm5SiL5HkEGJrMZfWSYKWp8DHpxZ1gj7YW7IKqIewjewLYeDlQAcjR1zOCSFGesYHMFE1KSVEDwX2v3hpo2Cc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707216388; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=eimhRtsjWV2MoRpixaE183OLBcT4XGVxpmZ6MvDaw1A=; b=NW14oOszWcrbOPGfwCwdrqzmGzMrDBLnnvXRP8nQZjH3AKE7Xm6hgdyoASThuxE0eyhaSK9avN5X2f2huUYY9Ip1GiZY5Y94+SV5vLTx/RQfltyTO0LT2vyA8ZVAStjzxcWXNvgnlVLubwGI3qQoINZwFQwvqJgD3UYAxAj83RM= 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 1707216388646547.3868701217385; Tue, 6 Feb 2024 02:46:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rXIw4-0006y6-0d; Tue, 06 Feb 2024 05:44:16 -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 1rXIw1-0006wH-BJ for qemu-devel@nongnu.org; Tue, 06 Feb 2024 05:44:13 -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 1rXIvy-0003F9-Rl for qemu-devel@nongnu.org; Tue, 06 Feb 2024 05:44: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.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-408-o5wO_89CPhqGUbrfMWXGPw-1; Tue, 06 Feb 2024 05:44:04 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1868D862DC0; Tue, 6 Feb 2024 10:44:04 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.195.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id C52A2492BF0; Tue, 6 Feb 2024 10:44:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707216250; 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=eimhRtsjWV2MoRpixaE183OLBcT4XGVxpmZ6MvDaw1A=; b=PoQx5RgxkiYVe9j53IyUUGx1nXSPKCZa3KOoNxCQkW5Qs12VZCYZ4XM3rQXKl/6aeW8OOX iqyTlz4K4uTtxHk8ac1FBEiIQHsUGp99LhP/NJqm3LGD3PdV5spl1iVwmer8vApQ4ks0pz fBezgYq/hwr0y5646EAbtg4ao0Xaze8= X-MC-Unique: o5wO_89CPhqGUbrfMWXGPw-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 08/12] target/s390x: Prefer fast cpu_env() over slower CPU QOM cast macro Date: Tue, 6 Feb 2024 11:43:43 +0100 Message-ID: <20240206104347.238825-9-thuth@redhat.com> In-Reply-To: <20240206104347.238825-1-thuth@redhat.com> References: <20240206104347.238825-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.4.1 on 10.11.54.10 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: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.285, 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1707216389274100003 From: Philippe Mathieu-Daud=C3=A9 Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Message-ID: <20240129164514.73104-25-philmd@linaro.org> Signed-off-by: Thomas Huth --- target/s390x/cpu-dump.c | 3 +-- target/s390x/gdbstub.c | 6 ++---- target/s390x/helper.c | 3 +-- target/s390x/kvm/kvm.c | 6 ++---- target/s390x/tcg/excp_helper.c | 11 +++-------- target/s390x/tcg/misc_helper.c | 4 +--- target/s390x/tcg/translate.c | 3 +-- 7 files changed, 11 insertions(+), 25 deletions(-) diff --git a/target/s390x/cpu-dump.c b/target/s390x/cpu-dump.c index ffa9e94d84..69cc9f7746 100644 --- a/target/s390x/cpu-dump.c +++ b/target/s390x/cpu-dump.c @@ -27,8 +27,7 @@ =20 void s390_cpu_dump_state(CPUState *cs, FILE *f, int flags) { - S390CPU *cpu =3D S390_CPU(cs); - CPUS390XState *env =3D &cpu->env; + CPUS390XState *env =3D cpu_env(cs); int i; =20 qemu_fprintf(f, "PSW=3Dmask %016" PRIx64 " addr %016" PRIx64, diff --git a/target/s390x/gdbstub.c b/target/s390x/gdbstub.c index 6fbfd41bc8..f02fa316e5 100644 --- a/target/s390x/gdbstub.c +++ b/target/s390x/gdbstub.c @@ -30,8 +30,7 @@ =20 int s390_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n) { - S390CPU *cpu =3D S390_CPU(cs); - CPUS390XState *env =3D &cpu->env; + CPUS390XState *env =3D cpu_env(cs); =20 switch (n) { case S390_PSWM_REGNUM: @@ -46,8 +45,7 @@ int s390_cpu_gdb_read_register(CPUState *cs, GByteArray *= mem_buf, int n) =20 int s390_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) { - S390CPU *cpu =3D S390_CPU(cs); - CPUS390XState *env =3D &cpu->env; + CPUS390XState *env =3D cpu_env(cs); target_ulong tmpl =3D ldtul_p(mem_buf); =20 switch (n) { diff --git a/target/s390x/helper.c b/target/s390x/helper.c index d76c06381b..00d5d403f3 100644 --- a/target/s390x/helper.c +++ b/target/s390x/helper.c @@ -139,8 +139,7 @@ void do_restart_interrupt(CPUS390XState *env) void s390_cpu_recompute_watchpoints(CPUState *cs) { const int wp_flags =3D BP_CPU | BP_MEM_WRITE | BP_STOP_BEFORE_ACCESS; - S390CPU *cpu =3D S390_CPU(cs); - CPUS390XState *env =3D &cpu->env; + CPUS390XState *env =3D cpu_env(cs); =20 /* We are called when the watchpoints have changed. First remove them all. */ diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c index 888d6c1a1c..4ce809c5d4 100644 --- a/target/s390x/kvm/kvm.c +++ b/target/s390x/kvm/kvm.c @@ -474,8 +474,7 @@ static int can_sync_regs(CPUState *cs, int regs) =20 int kvm_arch_put_registers(CPUState *cs, int level) { - S390CPU *cpu =3D S390_CPU(cs); - CPUS390XState *env =3D &cpu->env; + CPUS390XState *env =3D cpu_env(cs); struct kvm_fpu fpu =3D {}; int r; int i; @@ -601,8 +600,7 @@ int kvm_arch_put_registers(CPUState *cs, int level) =20 int kvm_arch_get_registers(CPUState *cs) { - S390CPU *cpu =3D S390_CPU(cs); - CPUS390XState *env =3D &cpu->env; + CPUS390XState *env =3D cpu_env(cs); struct kvm_fpu fpu; int i, r; =20 diff --git a/target/s390x/tcg/excp_helper.c b/target/s390x/tcg/excp_helper.c index b875bf14e5..f1c33f7967 100644 --- a/target/s390x/tcg/excp_helper.c +++ b/target/s390x/tcg/excp_helper.c @@ -90,10 +90,7 @@ void HELPER(data_exception)(CPUS390XState *env, uint32_t= dxc) static G_NORETURN void do_unaligned_access(CPUState *cs, uintptr_t retaddr) { - S390CPU *cpu =3D S390_CPU(cs); - CPUS390XState *env =3D &cpu->env; - - tcg_s390_program_interrupt(env, PGM_SPECIFICATION, retaddr); + tcg_s390_program_interrupt(cpu_env(cs), PGM_SPECIFICATION, retaddr); } =20 #if defined(CONFIG_USER_ONLY) @@ -146,8 +143,7 @@ bool s390_cpu_tlb_fill(CPUState *cs, vaddr address, int= size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr) { - S390CPU *cpu =3D S390_CPU(cs); - CPUS390XState *env =3D &cpu->env; + CPUS390XState *env =3D cpu_env(cs); target_ulong vaddr, raddr; uint64_t asc, tec; int prot, excp; @@ -600,8 +596,7 @@ bool s390_cpu_exec_interrupt(CPUState *cs, int interrup= t_request) =20 void s390x_cpu_debug_excp_handler(CPUState *cs) { - S390CPU *cpu =3D S390_CPU(cs); - CPUS390XState *env =3D &cpu->env; + CPUS390XState *env =3D cpu_env(cs); CPUWatchpoint *wp_hit =3D cs->watchpoint_hit; =20 if (wp_hit && wp_hit->flags & BP_CPU) { diff --git a/target/s390x/tcg/misc_helper.c b/target/s390x/tcg/misc_helper.c index 89b5268fd4..8764846ce8 100644 --- a/target/s390x/tcg/misc_helper.c +++ b/target/s390x/tcg/misc_helper.c @@ -214,9 +214,7 @@ void HELPER(sckc)(CPUS390XState *env, uint64_t ckc) =20 void tcg_s390_tod_updated(CPUState *cs, run_on_cpu_data opaque) { - S390CPU *cpu =3D S390_CPU(cs); - - update_ckc_timer(&cpu->env); + update_ckc_timer(cpu_env(cs)); } =20 /* Set Clock */ diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 325b25959d..6e4e1f2082 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -6582,8 +6582,7 @@ void s390x_restore_state_to_opc(CPUState *cs, const TranslationBlock *tb, const uint64_t *data) { - S390CPU *cpu =3D S390_CPU(cs); - CPUS390XState *env =3D &cpu->env; + CPUS390XState *env =3D cpu_env(cs); int cc_op =3D data[1]; =20 env->psw.addr =3D data[0]; --=20 2.43.0 From nobody Tue Nov 26 13:19:59 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=1707216325; cv=none; d=zohomail.com; s=zohoarc; b=YGhxaE2600LpTZJOwkk2JFXrqcJfCRAMuvMpVgkIh2sF2dI1nlbQu3lebk8bFP4pjG/qXw3bzk299NwWErwtbNe9UG8I8ozLk5zL0Sv1N6rvBrZZiAaSJf/bxLeZ3AnChODoqvME1bX0joy94cVDtK5jDcsf0s5OdkwM0N9hGfE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707216325; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=YmWZzs/rQnAiToVTHfV0BRlpDmEgrJ+WRDl06zUpskQ=; b=ngM6dMOb9WbZEHEJel5GdS3xUImYKB3MfCuG18SSigut67aIIiAMIUj88er+RlHRsJiR2bncL8Lo3Sc5LtEcwdcz04N72M9QZ3j/Rq2IiUSppkKHn8w71R6VuAZFTb4Ku0mL2Xb1d3bvxmmFNa+zPhE6s4U2XGSAmMIu3ViEazs= 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 1707216325468613.7935033287495; Tue, 6 Feb 2024 02:45:25 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rXIw2-0006xT-R4; Tue, 06 Feb 2024 05:44:14 -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 1rXIw1-0006w5-3D for qemu-devel@nongnu.org; Tue, 06 Feb 2024 05:44:13 -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 1rXIvy-0003Ei-6m for qemu-devel@nongnu.org; Tue, 06 Feb 2024 05:44: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.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-155-lmA0JYzfOjWWlP7hKPxuSA-1; Tue, 06 Feb 2024 05:44:06 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DFF0D84AC61; Tue, 6 Feb 2024 10:44:05 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.195.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8F40B492BF0; Tue, 6 Feb 2024 10:44:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707216247; 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=YmWZzs/rQnAiToVTHfV0BRlpDmEgrJ+WRDl06zUpskQ=; b=Ulj+Sm42QWuJ2RpMKKoeYQ7TG0fkFB0edZlNe311c4jrnIYpxxrTbLWBpLDaFyiKA5pwPg zWzZyi6td6e15Q0A+Js8b9/OmYZMh+hoOUM13gAuOb0vGxAPgiOuE9Th01gnCXmHP4mCRO af9BCvTOs843UddVAU8IkKyPiRaJ4+8= X-MC-Unique: lmA0JYzfOjWWlP7hKPxuSA-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Ilya Leoshkevich Subject: [PULL 09/12] tests/vm: Set UseDNS=no in the sshd configuration Date: Tue, 6 Feb 2024 11:43:44 +0100 Message-ID: <20240206104347.238825-10-thuth@redhat.com> In-Reply-To: <20240206104347.238825-1-thuth@redhat.com> References: <20240206104347.238825-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 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: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.285, 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, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1707216326869100003 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich make vm-build-freebsd sometimes fails with "Connection timed out during banner exchange". The client strace shows: 13:59:30 write(3, "SSH-2.0-OpenSSH_9.3\r\n", 21) =3D 21 13:59:30 getpid() =3D 252655 13:59:30 poll([{fd=3D3, events=3DPOLLIN}], 1, 5000) =3D 1 ([{fd=3D3, re= vents=3DPOLLIN}]) 13:59:32 read(3, "S", 1) =3D 1 13:59:32 poll([{fd=3D3, events=3DPOLLIN}], 1, 3625) =3D 1 ([{fd=3D3, re= vents=3DPOLLIN}]) 13:59:32 read(3, "S", 1) =3D 1 13:59:32 poll([{fd=3D3, events=3DPOLLIN}], 1, 3625) =3D 1 ([{fd=3D3, re= vents=3DPOLLIN}]) 13:59:32 read(3, "H", 1) =3D 1 There is a 2s delay during connection, and ConnectTimeout is set to 1. Raising it makes the issue go away, but we can do better. The server truss shows: 888: 27.811414714 socket(PF_INET,SOCK_DGRAM|SOCK_CLOEXEC,0) =3D 5 (0x5) 888: 27.811765030 connect(5,{ AF_INET 10.0.2.3:53 },16) =3D 0 (0x0) 888: 27.812166941 sendto(5,"\^Z/\^A\0\0\^A\0\0\0\0\0\0\^A2"...,39,0,NUL= L,0) =3D 39 (0x27) 888: 29.363970743 poll({ 5/POLLRDNORM },1,5000) =3D 1 (0x1) So the delay is due to a DNS query. Disable DNS queries in the server config. Reviewed-by: Thomas Huth Signed-off-by: Ilya Leoshkevich Message-ID: <20240206002344.12372-2-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- tests/vm/basevm.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 61725b8325..c0d62c0803 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -423,6 +423,8 @@ def console_ssh_init(self, prompt, user, pw): def console_sshd_config(self, prompt): self.console_wait(prompt) self.console_send("echo 'PermitRootLogin yes' >> /etc/ssh/sshd_con= fig\n") + self.console_wait(prompt) + self.console_send("echo 'UseDNS no' >> /etc/ssh/sshd_config\n") for var in self.envvars: self.console_wait(prompt) self.console_send("echo 'AcceptEnv %s' >> /etc/ssh/sshd_config= \n" % var) --=20 2.43.0 From nobody Tue Nov 26 13:19:59 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=1707216356; cv=none; d=zohomail.com; s=zohoarc; b=mtNcrWggYYOYtbANyu+1UMHF/yDceV6/+poJ/7dBEsk1+uWTHhjK5BClr+07XOiJ2Q3Jc0M66f/nrTXGDk1/64w2oRfOomLECFSxnuny2MH6DwMK9sG+M1X3RgkiLhLBXEKptpXVMmhAZAKtu0KSXDq2WNvlUyEvqiUAQ7qnmyc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707216356; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=RfQYURFrI4iuL99hnnFo/uP7RDaDGmB5jkJpCrKd84s=; b=OyIc0AexjElSO0BwrRoZCkg9uYueMxTuZXoHqOu2VTJGIx/bzaqwLqooOPvgfd4hYFc381UYixrKBlY2YNK3o2V9oin9sGVFvhVWhJIIY3u/CGQSi+OqjpnUw6/42p92/wlWl5wzc2q7//SgV/RgfakQo9SNmCvMd6zOwFOgM2o= 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 1707216356791614.7180203057802; Tue, 6 Feb 2024 02:45:56 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rXIw3-0006y1-CQ; Tue, 06 Feb 2024 05:44: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 1rXIw2-0006wz-8J for qemu-devel@nongnu.org; Tue, 06 Feb 2024 05:44:14 -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 1rXIvz-0003FX-Gj for qemu-devel@nongnu.org; Tue, 06 Feb 2024 05:44:14 -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.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-688-bWdsy1ukN5-qQeaP1WHqVg-1; Tue, 06 Feb 2024 05:44:07 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 71B9B862DC1; Tue, 6 Feb 2024 10:44:07 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.195.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id 43077492BF0; Tue, 6 Feb 2024 10:44:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707216251; 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=RfQYURFrI4iuL99hnnFo/uP7RDaDGmB5jkJpCrKd84s=; b=XKcbErifvPUIF09tr1ZS5mQL1IoY/Nx6OvQ11+btri9uNhX09I4+Zj9VlmF+h4ZGz9L9Ds W5eX9Nmevzj2+vlI3+OWnIvvTeYMqy8RwqQq+q7i2LG4GR7DWFSTKddbgVp406tqee9Nte cJLWzL8LvWJ8FCSjthxKywTUesanQBA= X-MC-Unique: bWdsy1ukN5-qQeaP1WHqVg-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Ilya Leoshkevich Subject: [PULL 10/12] tests/vm/freebsd: Reload the sshd configuration Date: Tue, 6 Feb 2024 11:43:45 +0100 Message-ID: <20240206104347.238825-11-thuth@redhat.com> In-Reply-To: <20240206104347.238825-1-thuth@redhat.com> References: <20240206104347.238825-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 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: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.285, 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1707216357063100001 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich After console_sshd_config(), the SSH server needs to be nudged to pick up the new configs. The scripts for the other BSD flavors already do this with a reboot, but a simple reload is sufficient. Reviewed-by: Thomas Huth Signed-off-by: Ilya Leoshkevich Message-ID: <20240206002344.12372-3-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- tests/vm/freebsd | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/vm/freebsd b/tests/vm/freebsd index b581bd17fb..1247f40a38 100755 --- a/tests/vm/freebsd +++ b/tests/vm/freebsd @@ -108,6 +108,7 @@ class FreeBSDVM(basevm.BaseVM): prompt =3D "root@freebsd:~ #" self.console_ssh_init(prompt, "root", self._config["root_pass"]) self.console_sshd_config(prompt) + self.console_wait_send(prompt, "service sshd reload\n") =20 # setup virtio-blk #1 (tarfile) self.console_wait(prompt) --=20 2.43.0 From nobody Tue Nov 26 13:19:59 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=1707216312; cv=none; d=zohomail.com; s=zohoarc; b=Ky8e1eZ35ycXj9RTKU0vlRm7F7jZONkX0nNyPH+XsEB7X2UEAtmUvUihp4ftbKEXfeyUbA/oz8mkRlUm6rrK+2cgVdkmL0SOTPGQ3JfSuqwoWaNAxWQVJpVd0MVtnfGTPbe1qWg70bPSIUjAkqO2xiURnvgx+XCdf166VLXIi4M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707216312; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=tJVmAonGNTSVGIy7u0m0ZPlemNSVL75zsfgOMwld7hw=; b=PE9ESxWqpHs8I8XW2rzmuHoFUTWJUr4BHf7QyWdiLOCjtwB7B6ZT5VI12Pwf1f+lHV676mDka3/jIRFPGHCJL8PeoqvjcC1kSRiFXztANvJqHS5BzsgR3RTMP2f1uMn3agBfg8xi06fBK2fVmyUNiz1FwaNN7EcHP+q9Mpz16x4= 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 1707216312370154.87468730580645; Tue, 6 Feb 2024 02:45:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rXIw4-0006y5-0A; Tue, 06 Feb 2024 05:44:16 -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 1rXIw2-0006x0-Ad for qemu-devel@nongnu.org; Tue, 06 Feb 2024 05:44:14 -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 1rXIvz-0003Fc-Qf for qemu-devel@nongnu.org; Tue, 06 Feb 2024 05:44:14 -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.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-694-MalwzsJFPX6IB5GqZkSe-Q-1; Tue, 06 Feb 2024 05:44:09 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5B9EE811E81; Tue, 6 Feb 2024 10:44:09 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.195.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id BFBB7492BF0; Tue, 6 Feb 2024 10:44:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707216251; 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=tJVmAonGNTSVGIy7u0m0ZPlemNSVL75zsfgOMwld7hw=; b=cjzqLU9KMIc3lOxpaSEaNL3EwzvUAX2GBaip07dj6CxJUJUYaXukJBV+t/qtWRkVk1e5tw RV4ijP5FwmLx+jrr2kzsdLii6qAFwkKUfvX9HUCNCpP3gW0SECkoMrO0EeIyCy4AsJcsNG sdvXrt4qR0mg60EtP9F+1Ev4rbuNQcg= X-MC-Unique: MalwzsJFPX6IB5GqZkSe-Q-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Ilya Leoshkevich , "Daniel P. Berrange" Subject: [PULL 11/12] test-util-filemonitor: Adapt to the FreeBSD inotify rename semantics Date: Tue, 6 Feb 2024 11:43:46 +0100 Message-ID: <20240206104347.238825-12-thuth@redhat.com> In-Reply-To: <20240206104347.238825-1-thuth@redhat.com> References: <20240206104347.238825-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 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: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.285, 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1707216313092100001 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich Unlike on Linux, on FreeBSD renaming a file when the destination already exists results in an IN_DELETE event for that existing file: $ FILEMONITOR_DEBUG=3D1 build/tests/unit/test-util-filemonitor Rename /tmp/test-util-filemonitor-K13LI2/fish/one.txt -> /tmp/test-util= -filemonitor-K13LI2/two.txt Event id=3D200000000 event=3D2 file=3Done.txt Queue event id 200000000 event 2 file one.txt Queue event id 100000000 event 2 file two.txt Queue event id 100000002 event 2 file two.txt Queue event id 100000000 event 0 file two.txt Queue event id 100000002 event 0 file two.txt Event id=3D100000000 event=3D0 file=3Dtwo.txt Expected event 0 but got 2 This difference in behavior is not expected to break the real users, so teach the test to accept it. Suggested-by: "Daniel P. Berrange" Signed-off-by: Ilya Leoshkevich Message-ID: <20240206002344.12372-4-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- tests/unit/test-util-filemonitor.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/unit/test-util-filemonitor.c b/tests/unit/test-util-file= monitor.c index a22de27595..02e67fc96a 100644 --- a/tests/unit/test-util-filemonitor.c +++ b/tests/unit/test-util-filemonitor.c @@ -360,6 +360,14 @@ test_file_monitor_events(void) { .type =3D QFILE_MONITOR_TEST_OP_EVENT, .filesrc =3D "one.txt", .watchid =3D &watch4, .eventid =3D QFILE_MONITOR_EVENT_DELETED }, +#ifdef __FreeBSD__ + { .type =3D QFILE_MONITOR_TEST_OP_EVENT, + .filesrc =3D "two.txt", .watchid =3D &watch0, + .eventid =3D QFILE_MONITOR_EVENT_DELETED }, + { .type =3D QFILE_MONITOR_TEST_OP_EVENT, + .filesrc =3D "two.txt", .watchid =3D &watch2, + .eventid =3D QFILE_MONITOR_EVENT_DELETED }, +#endif { .type =3D QFILE_MONITOR_TEST_OP_EVENT, .filesrc =3D "two.txt", .watchid =3D &watch0, .eventid =3D QFILE_MONITOR_EVENT_CREATED }, --=20 2.43.0 From nobody Tue Nov 26 13:19:59 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=1707216400; cv=none; d=zohomail.com; s=zohoarc; b=DHRbCyQ+6wYcP0IYClR9DLnqnHmORR+sqlzRulk6cwEw0YxR7HQQ3TXELoYvIX/YblGoZYVdTz3voNHUcDKaO/GfivhBcRdCs6PJIUUDREF4+4MmM421VUcVL706Q0xjNEwlV1GDca/JkfpJg5DKJjt802ndlJxljMZdGzUSmYs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707216400; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=pYJ3aaiSLgzPt2lN2pk4fFmaJwdxRaFlbrLsXg2o9BQ=; b=lw51yBZjHEdaglGtRtVYKp0GOirJFWrymVVzuBPpue1h1OikyFMepOd3vo2zLn1WgzXXQcnC0c6BRGBRVhWNBOigOARIP1rcBbvrqM+bJNKbmjFxfZ8f5PVifAwPNGKOJrMajjS/ToqAHbfMshwVde4BMSdcvTRtLy9b9WZWtNE= 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 1707216400413711.4785664965942; Tue, 6 Feb 2024 02:46:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rXIw4-0006yc-LI; Tue, 06 Feb 2024 05:44:16 -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 1rXIw3-0006xt-3Q for qemu-devel@nongnu.org; Tue, 06 Feb 2024 05:44: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 1rXIw1-0003GP-Fu for qemu-devel@nongnu.org; Tue, 06 Feb 2024 05:44:14 -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.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-22-sPvofmW8OkC9tk_PbtxGbg-1; Tue, 06 Feb 2024 05:44:11 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C044E862DC0; Tue, 6 Feb 2024 10:44:10 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.195.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id AD96B492BF0; Tue, 6 Feb 2024 10:44:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707216252; 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=pYJ3aaiSLgzPt2lN2pk4fFmaJwdxRaFlbrLsXg2o9BQ=; b=R/xgE3SbmlcOzgub3zU5zX3zgkk3MlDCd0VTfUpGWoPyV10ggyph7QfH9x/4p17WceCGfT Qp2s3nTLBr4bR/w7dVdJWv3nV8SQ/zJffc/B9BFTRhSIP8v5afTVd+abp8OVmuusQbzHed Sz163Hc32esJETLEHUVWdDcP4srV7Qo= X-MC-Unique: sPvofmW8OkC9tk_PbtxGbg-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Ilya Leoshkevich Subject: [PULL 12/12] meson: Link with libinotify on FreeBSD Date: Tue, 6 Feb 2024 11:43:47 +0100 Message-ID: <20240206104347.238825-13-thuth@redhat.com> In-Reply-To: <20240206104347.238825-1-thuth@redhat.com> References: <20240206104347.238825-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 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: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.285, 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1707216401275100003 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich make vm-build-freebsd fails with: ld: error: undefined symbol: inotify_init1 >>> referenced by filemonitor-inotify.c:183 (../src/util/filemonitor-in= otify.c:183) >>> util_filemonitor-inotify.c.o:(qemu_file_monitor_new) = in archive libqemuutil.a On FreeBSD the inotify functions are defined in libinotify.so. Add it to the dependencies. Signed-off-by: Ilya Leoshkevich Reviewed-by: Thomas Huth Message-ID: <20240206002344.12372-5-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- meson.build | 23 +++++++++++++++++++---- util/meson.build | 6 +++++- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index b5d6dc94a8..e5d6f2d057 100644 --- a/meson.build +++ b/meson.build @@ -2384,6 +2384,22 @@ else endif config_host_data.set('CONFIG_ASAN_IFACE_FIBER', have_asan_fiber) =20 +have_inotify_init =3D cc.has_header_symbol('sys/inotify.h', 'inotify_init') +have_inotify_init1 =3D cc.has_header_symbol('sys/inotify.h', 'inotify_init= 1') +inotify =3D not_found +if (have_inotify_init or have_inotify_init1) and host_os =3D=3D 'freebsd' + # libinotify-kqueue + inotify =3D cc.find_library('inotify') + if have_inotify_init + have_inotify_init =3D inotify.found() + endif + if have_inotify_init1 + have_inotify_init1 =3D inotify.found() + endif +endif +config_host_data.set('CONFIG_INOTIFY', have_inotify_init) +config_host_data.set('CONFIG_INOTIFY1', have_inotify_init1) + # has_header_symbol config_host_data.set('CONFIG_BLKZONED', cc.has_header_symbol('linux/blkzoned.h', 'BLKOPENZONE= ')) @@ -2400,10 +2416,6 @@ config_host_data.set('CONFIG_FIEMAP', config_host_data.set('CONFIG_GETRANDOM', cc.has_function('getrandom') and cc.has_header_symbol('sys/random.h', 'GRND_NONBLOCK')) -config_host_data.set('CONFIG_INOTIFY', - cc.has_header_symbol('sys/inotify.h', 'inotify_init')) -config_host_data.set('CONFIG_INOTIFY1', - cc.has_header_symbol('sys/inotify.h', 'inotify_init1'= )) config_host_data.set('CONFIG_PRCTL_PR_SET_TIMERSLACK', cc.has_header_symbol('sys/prctl.h', 'PR_SET_TIMERSLAC= K')) config_host_data.set('CONFIG_RTNETLINK', @@ -4407,6 +4419,9 @@ summary_info +=3D {'libudev': libudev} summary_info +=3D {'FUSE lseek': fuse_lseek.found()} summary_info +=3D {'selinux': selinux} summary_info +=3D {'libdw': libdw} +if host_os =3D=3D 'freebsd' + summary_info +=3D {'libinotify-kqueue': inotify} +endif summary(summary_info, bool_yn: true, section: 'Dependencies') =20 if host_arch =3D=3D 'unknown' diff --git a/util/meson.build b/util/meson.build index af3bf5692d..0ef9886be0 100644 --- a/util/meson.build +++ b/util/meson.build @@ -104,7 +104,11 @@ if have_block util_ss.add(files('throttle.c')) util_ss.add(files('timed-average.c')) if config_host_data.get('CONFIG_INOTIFY1') - util_ss.add(files('filemonitor-inotify.c')) + freebsd_dep =3D [] + if host_os =3D=3D 'freebsd' + freebsd_dep =3D inotify + endif + util_ss.add(files('filemonitor-inotify.c'), freebsd_dep) else util_ss.add(files('filemonitor-stub.c')) endif --=20 2.43.0