From nobody Fri Dec 19 17:34:22 2025 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=1663610075; cv=none; d=zohomail.com; s=zohoarc; b=QZyCeD2MByeYXkLK5WaLPhrASN83WAqgY68BTDjCeQAYqZywSQYQuckuceaiwG/tNJoOX2N3rkRyJV6Bx5sNRC0qkgFEvgmepqtwiHwOvvI4ytQH9AnsMzNGzb2GiYgV5g+h6oQ0/rjv0KpnY9cE9tqNA+svmN2kiXzXZrPaW54= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663610075; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=uxema3O4f4dvX8H4/IkVvmNNqQSpOhMQeCzrlQfPNrU=; b=W6oNdvI6sNkdNqkTgG7Gc9s60xjqN/+WIqpHHi30DM1gg8s50Rfmm/Wm7du8mcCP5Hj6RQ+nSmnlwpCL3zEwwvNbJQ0OHdCpJ1Z3W2YAsnFHvmw3C2vrLrD8qrAwJ26TCiuNssdsh1MYz1s7jiSzO0nRuetNh38OyuCAxC42uXU= 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 1663610075197720.9674208059874; Mon, 19 Sep 2022 10:54:35 -0700 (PDT) Received: from localhost ([::1]:37650 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaKyY-0006sJ-6A for importer@patchew.org; Mon, 19 Sep 2022 13:54:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37558) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKfc-0002t5-Ol for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:25391) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKfb-0002qA-2Q for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:00 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-225-eHLJx3S_Ow-MJRI-vQJ4uA-1; Mon, 19 Sep 2022 13:34:57 -0400 Received: by mail-wm1-f69.google.com with SMTP id v190-20020a1cacc7000000b003b4ab30188fso4964907wme.2 for ; Mon, 19 Sep 2022 10:34:56 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id e4-20020a05600c4e4400b003a6a3595edasm15011979wmq.27.2022.09.19.10.34.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 10:34:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663608898; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uxema3O4f4dvX8H4/IkVvmNNqQSpOhMQeCzrlQfPNrU=; b=E8UY+LmXq6oMO+eyIRSS7dICe/p7efilc28HHXZHO/6TPSuQYETiymRsi40tbg3EfXiUpc QVixjrZv3XIgWxWzAs74QkCqLFUKjROnnsaV1vx3Qd8WzfoNIakkq+6wSEMgNyo8IgeyCp NJdZTZ1hmtE1cg9kHJ+2wYCExXlNklo= X-MC-Unique: eHLJx3S_Ow-MJRI-vQJ4uA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=uxema3O4f4dvX8H4/IkVvmNNqQSpOhMQeCzrlQfPNrU=; b=DfzVtZtPxFugvHmXtpEPhlEcABu/AtD3WtgENvqIsV8cLSZaBCtwuWujrXRZqDHOX6 Sv4tLQswdUfppvZjmGkVWVWSGj+jd2U9lVI14xq2dP0dJwcZvZimXrPBMAFOFtAuN1H+ rD+2bIOGMVCAepyQ9tPaprUGEvLr5K52RDvCFnknk24ao5J7f2o0JO7dPwRXBYxvowcr Q2C4AY55i06d4lMNnWahBbXqLZ5kztvC7nLdrHz95sK0sSAQ/A2ZrDu2skrlQbj6xlnR 1ET8iq4QOnWDQaAsHFtmw5IKHDzw67IL3mCdxOYDQzr4LueiMK2ioZcBqmcW9UmlXsvw BRCg== X-Gm-Message-State: ACrzQf1ZSRXxbAq4TjAXS/J1+x7OwIdRVVqgNpI04tbEfarL+DsKUS8G 3oDYCptSvk7eFZOj537QorF5na4byp12+ODX1LYoTNneIFZuYLH/CD1BzofGIkQKy+C2iDZA8Bn JDUrHgCOpjibSMiwW9yoE8b0blsIqGGezcEavfyaoAs1K5qtU+U5XnTJoQjfNhWZrz+w= X-Received: by 2002:a5d:5289:0:b0:225:4852:4248 with SMTP id c9-20020a5d5289000000b0022548524248mr10853259wrv.228.1663608895569; Mon, 19 Sep 2022 10:34:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7NOXTSdox5kEauVmNzs54dIO8kMtMqJmciFcj2yNCGxgqHlqdJagBIxgV6tvJKF4O7B+ZylA== X-Received: by 2002:a5d:5289:0:b0:225:4852:4248 with SMTP id c9-20020a5d5289000000b0022548524248mr10853245wrv.228.1663608895268; Mon, 19 Sep 2022 10:34:55 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Gavin Shan , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 01/21] KVM: use store-release to mark dirty pages as harvested Date: Mon, 19 Sep 2022 19:34:29 +0200 Message-Id: <20220919173449.5864-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220919173449.5864-1-pbonzini@redhat.com> References: <20220919173449.5864-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain Content-Transfer-Encoding: quoted-printable 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=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PP_MIME_FAKE_ASCII_TEXT=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1663610076679100003 The following scenario can happen if QEMU sets more RESET flags while the KVM_RESET_DIRTY_RINGS ioctl is ongoing on another host CPU: CPU0 CPU1 CPU2 ------------------------ ------------------ ------------------------ fill gfn0 store-rel flags for gfn0 fill gfn1 store-rel flags for gfn1 load-acq flags for gfn0 set RESET for gfn0 load-acq flags for gfn1 set RESET for gfn1 do ioctl! -----------> ioctl(RESET_RINGS) fill gfn2 store-rel flags for gfn2 load-acq flags for gfn2 set RESET for gfn2 process gfn0 process gfn1 process gfn2 do ioctl! etc. The three load-acquire in CPU0 synchronize with the three store-release in CPU2, but CPU0 and CPU1 are only synchronized up to gfn1 and CPU1 may miss gfn2's fields other than flags. The kernel must be able to cope with invalid values of the fields, and userspace *will* invoke the ioctl once more. However, once the RESET flag is cleared on gfn2, it is lost forever, therefore in the above scenario CPU1 must read the correct value of gfn2's fields. Therefore RESET must be set with a store-release, that will synchronize with KVM's load-acquire in CPU1. Cc: Gavin Shan Reviewed-by: Peter Xu Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Paolo Bonzini --- accel/kvm/kvm-all.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 136c8eaed3..7c8ce18bdd 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -728,7 +728,23 @@ static bool dirty_gfn_is_dirtied(struct kvm_dirty_gfn = *gfn) =20 static void dirty_gfn_set_collected(struct kvm_dirty_gfn *gfn) { - gfn->flags =3D KVM_DIRTY_GFN_F_RESET; + /* + * Use a store-release so that the CPU that executes KVM_RESET_DIRTY_R= INGS + * sees the full content of the ring: + * + * CPU0 CPU1 CPU2 + * -------------------------------------------------------------------= ----------- + * fill gfn0 + * store-rel fla= gs for gfn0 + * load-acq flags for gfn0 + * store-rel RESET for gfn0 + * ioctl(RESET_RINGS) + * load-acq flags for gfn0 + * check if flags have RESET + * + * The synchronization goes from CPU2 to CPU0 to CPU1. + */ + qatomic_store_release(&gfn->flags, KVM_DIRTY_GFN_F_RESET); } =20 /* --=20 2.37.2 From nobody Fri Dec 19 17:34:22 2025 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=1663609496; cv=none; d=zohomail.com; s=zohoarc; b=XwJmtvmhcQa7JE7lV8H8IDw2GuVYS4LXV9Y9VLWqUvNjbZtDkSDf/BICvHqvl+RCcl3qsfq3W5ME7adKEKKIX7He87WhZFBmWxxmljq7odWIfVzRc/HLZ74bM8PoikKZ5fGaHfi+vnl4Cb9vNmAHiHYMfJoiLKA2f8gVyoTWE1I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663609496; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=FgtnSMB+tpzz67Jmag+UQ/1Hghww1UvzFsji5Vkt7R0=; b=DLDk5UIpG9Yadj6/BU9cFNLrkXSlN1cJhFTXMyQJnslW6k5Ozlnszg+e+S6M0Is3lEACmwCqWD5EvmH+NcRlZ0o2vTTGaARNIW7Ntj/Sesssz0Uvew+mr6knQvutZG2u7i1X6yWuVe77LHJ1Ptf2w/swIjiYT8u56ruPNhaiUdg= 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 1663609496399719.1346234038652; Mon, 19 Sep 2022 10:44:56 -0700 (PDT) Received: from localhost ([::1]:42694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaKpC-0004nT-LD for importer@patchew.org; Mon, 19 Sep 2022 13:44:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37564) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKfg-0002uP-6P for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:48479) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKfd-0002qq-Oy for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:03 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-484-9DrTM8x6P0aWYHX2CzUJCg-1; Mon, 19 Sep 2022 13:34:59 -0400 Received: by mail-wm1-f72.google.com with SMTP id i129-20020a1c3b87000000b003b33e6160bdso4948267wma.7 for ; Mon, 19 Sep 2022 10:34:59 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id r10-20020a5d694a000000b0021e51c039c5sm14420094wrw.80.2022.09.19.10.34.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 10:34:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663608900; 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=FgtnSMB+tpzz67Jmag+UQ/1Hghww1UvzFsji5Vkt7R0=; b=XIP1UcAthn9SwHonkJke8MK68O5yAnToWEXWsFOOFedyBKCP3c7tahNpU5SZKv0/ohwHbr 8OTkwHiHASIML/bUTJtBO129a/U2DxwQo+z3wy4UGx2blZ7vyROFn6AvPgbBIWeoJCq/a+ IN9X0GkH5ETWp+AHoQuoP3n6UFHLjsM= X-MC-Unique: 9DrTM8x6P0aWYHX2CzUJCg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=FgtnSMB+tpzz67Jmag+UQ/1Hghww1UvzFsji5Vkt7R0=; b=W3yTPBaAENGr2wmi61D6AFeXkCs4Cnwq7BpDP/d6Frai54Pc8eYqWjSl9hTtR61Luu f9jNli+Co7t+juV4iG48K0DETZUV8ScVeAFGIwi1uRmdxupaiU3ZjbMX20q63R0WBT9J YiFqPzMXGMBrxsfT6rHLx6j7mW2sGaQz+N2i+uKjB9WrmUAcU46MdNpyG9wXqZv0Ksp6 YVXysAaV2frWYl8VMMkrl2C9guR3qPcvSvvxFR3EPG/CKXCOUBGtr/yVrJHeR193cGUS DagDgCyo1qiZ2aaGc0IYzj/3kLDWqu0ieMtZftZBZV891lv5UA7RQzs/TopHzzEfiE77 B2/w== X-Gm-Message-State: ACrzQf1dta65O2BRvrQ7lNFtWfHvJlZn5vGxvFLWhTAhxzWERJIPlwxl P5jm/CvC7YaOOoLse5/12WI1dDCf+E1vUVcRxMseEQbRvakKbMDxhSYGX9ZtHGJi57qVNEdSu1A D7CiX/3Abks/+zssHlIv+W41n8hkScRx493N5Ztb7QJ8EPH+6lOqgy7Kc3s6WOowVSLg= X-Received: by 2002:a05:600c:511b:b0:3b4:b3d7:c429 with SMTP id o27-20020a05600c511b00b003b4b3d7c429mr14500918wms.80.1663608897847; Mon, 19 Sep 2022 10:34:57 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4MgRkLASyosm4Jiac/o4RTO5DlwHzzd69/3+lMJiPPGfDrG8B9HYMyaiY6mVXef5q+BqIs8A== X-Received: by 2002:a05:600c:511b:b0:3b4:b3d7:c429 with SMTP id o27-20020a05600c511b00b003b4b3d7c429mr14500896wms.80.1663608897395; Mon, 19 Sep 2022 10:34:57 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson , Ricky Zhou Subject: [PULL 02/21] target/i386: Raise #GP on unaligned m128 accesses when required. Date: Mon, 19 Sep 2022 19:34:30 +0200 Message-Id: <20220919173449.5864-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220919173449.5864-1-pbonzini@redhat.com> References: <20220919173449.5864-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1663609497286100001 Content-Type: text/plain; charset="utf-8" Many instructions which load/store 128-bit values are supposed to raise #GP when the memory operand isn't 16-byte aligned. This includes: - Instructions explicitly requiring memory alignment (Exceptions Type 1 in the "AVX and SSE Instruction Exception Specification" section of the SDM) - Legacy SSE instructions that load/store 128-bit values (Exceptions Types 2 and 4). This change sets MO_ALIGN_16 on 128-bit memory accesses that require 16-byte alignment. It adds cpu_record_sigbus and cpu_do_unaligned_access hooks that simulate a #GP exception in qemu-user and qemu-system, respectively. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/217 Reviewed-by: Richard Henderson Signed-off-by: Ricky Zhou Message-Id: <20220830034816.57091-2-ricky@rzhou.org> [Do not bother checking PREFIX_VEX, since AVX is not supported. - Paolo] Signed-off-by: Paolo Bonzini --- target/i386/tcg/excp_helper.c | 13 +++++++++ target/i386/tcg/helper-tcg.h | 28 +++++++++++------- target/i386/tcg/sysemu/excp_helper.c | 8 ++++++ target/i386/tcg/tcg-cpu.c | 2 ++ target/i386/tcg/translate.c | 43 ++++++++++++++++------------ target/i386/tcg/user/excp_helper.c | 7 +++++ 6 files changed, 72 insertions(+), 29 deletions(-) diff --git a/target/i386/tcg/excp_helper.c b/target/i386/tcg/excp_helper.c index c1ffa1c0ef..7c3c8dc7fe 100644 --- a/target/i386/tcg/excp_helper.c +++ b/target/i386/tcg/excp_helper.c @@ -140,3 +140,16 @@ G_NORETURN void raise_exception_ra(CPUX86State *env, i= nt exception_index, { raise_interrupt2(env, exception_index, 0, 0, 0, retaddr); } + +G_NORETURN void handle_unaligned_access(CPUX86State *env, vaddr vaddr, + MMUAccessType access_type, + uintptr_t retaddr) +{ + /* + * Unaligned accesses are currently only triggered by SSE/AVX + * instructions that impose alignment requirements on memory + * operands. These instructions raise #GP(0) upon accessing an + * unaligned address. + */ + raise_exception_ra(env, EXCP0D_GPF, retaddr); +} diff --git a/target/i386/tcg/helper-tcg.h b/target/i386/tcg/helper-tcg.h index 34167e2e29..cd1723389a 100644 --- a/target/i386/tcg/helper-tcg.h +++ b/target/i386/tcg/helper-tcg.h @@ -42,17 +42,6 @@ void x86_cpu_do_interrupt(CPUState *cpu); bool x86_cpu_exec_interrupt(CPUState *cpu, int int_req); #endif =20 -/* helper.c */ -#ifdef CONFIG_USER_ONLY -void x86_cpu_record_sigsegv(CPUState *cs, vaddr addr, - MMUAccessType access_type, - bool maperr, uintptr_t ra); -#else -bool x86_cpu_tlb_fill(CPUState *cs, vaddr address, int size, - MMUAccessType access_type, int mmu_idx, - bool probe, uintptr_t retaddr); -#endif - void breakpoint_handler(CPUState *cs); =20 /* n must be a constant to be efficient */ @@ -78,6 +67,23 @@ G_NORETURN void raise_exception_err_ra(CPUX86State *env,= int exception_index, int error_code, uintptr_t retaddr); G_NORETURN void raise_interrupt(CPUX86State *nenv, int intno, int is_int, int error_code, int next_eip_addend); +G_NORETURN void handle_unaligned_access(CPUX86State *env, vaddr vaddr, + MMUAccessType access_type, + uintptr_t retaddr); +#ifdef CONFIG_USER_ONLY +void x86_cpu_record_sigsegv(CPUState *cs, vaddr addr, + MMUAccessType access_type, + bool maperr, uintptr_t ra); +void x86_cpu_record_sigbus(CPUState *cs, vaddr addr, + MMUAccessType access_type, uintptr_t ra); +#else +bool x86_cpu_tlb_fill(CPUState *cs, vaddr address, int size, + MMUAccessType access_type, int mmu_idx, + bool probe, uintptr_t retaddr); +G_NORETURN void x86_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr, + MMUAccessType access_type, + int mmu_idx, uintptr_t retaddr= ); +#endif =20 /* cc_helper.c */ extern const uint8_t parity_table[256]; diff --git a/target/i386/tcg/sysemu/excp_helper.c b/target/i386/tcg/sysemu/= excp_helper.c index 48feba7e75..796dc2a1f3 100644 --- a/target/i386/tcg/sysemu/excp_helper.c +++ b/target/i386/tcg/sysemu/excp_helper.c @@ -439,3 +439,11 @@ bool x86_cpu_tlb_fill(CPUState *cs, vaddr addr, int si= ze, } return true; } + +G_NORETURN void x86_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr, + MMUAccessType access_type, + int mmu_idx, uintptr_t retaddr) +{ + X86CPU *cpu =3D X86_CPU(cs); + handle_unaligned_access(&cpu->env, vaddr, access_type, retaddr); +} diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c index 6fdfdf9598..d3c2b8fb49 100644 --- a/target/i386/tcg/tcg-cpu.c +++ b/target/i386/tcg/tcg-cpu.c @@ -75,10 +75,12 @@ static const struct TCGCPUOps x86_tcg_ops =3D { #ifdef CONFIG_USER_ONLY .fake_user_interrupt =3D x86_cpu_do_interrupt, .record_sigsegv =3D x86_cpu_record_sigsegv, + .record_sigbus =3D x86_cpu_record_sigbus, #else .tlb_fill =3D x86_cpu_tlb_fill, .do_interrupt =3D x86_cpu_do_interrupt, .cpu_exec_interrupt =3D x86_cpu_exec_interrupt, + .do_unaligned_access =3D x86_cpu_do_unaligned_access, .debug_excp_handler =3D breakpoint_handler, .debug_check_breakpoint =3D x86_debug_check_breakpoint, #endif /* !CONFIG_USER_ONLY */ diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index d6420df31d..8ec91d17af 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -2738,21 +2738,23 @@ static inline void gen_stq_env_A0(DisasContext *s, = int offset) tcg_gen_qemu_st_i64(s->tmp1_i64, s->A0, s->mem_index, MO_LEUQ); } =20 -static inline void gen_ldo_env_A0(DisasContext *s, int offset) +static inline void gen_ldo_env_A0(DisasContext *s, int offset, bool align) { int mem_index =3D s->mem_index; - tcg_gen_qemu_ld_i64(s->tmp1_i64, s->A0, mem_index, MO_LEUQ); + tcg_gen_qemu_ld_i64(s->tmp1_i64, s->A0, mem_index, + MO_LEUQ | (align ? MO_ALIGN_16 : 0)); tcg_gen_st_i64(s->tmp1_i64, cpu_env, offset + offsetof(ZMMReg, ZMM_Q(0= ))); tcg_gen_addi_tl(s->tmp0, s->A0, 8); tcg_gen_qemu_ld_i64(s->tmp1_i64, s->tmp0, mem_index, MO_LEUQ); tcg_gen_st_i64(s->tmp1_i64, cpu_env, offset + offsetof(ZMMReg, ZMM_Q(1= ))); } =20 -static inline void gen_sto_env_A0(DisasContext *s, int offset) +static inline void gen_sto_env_A0(DisasContext *s, int offset, bool align) { int mem_index =3D s->mem_index; tcg_gen_ld_i64(s->tmp1_i64, cpu_env, offset + offsetof(ZMMReg, ZMM_Q(0= ))); - tcg_gen_qemu_st_i64(s->tmp1_i64, s->A0, mem_index, MO_LEUQ); + tcg_gen_qemu_st_i64(s->tmp1_i64, s->A0, mem_index, + MO_LEUQ | (align ? MO_ALIGN_16 : 0)); tcg_gen_addi_tl(s->tmp0, s->A0, 8); tcg_gen_ld_i64(s->tmp1_i64, cpu_env, offset + offsetof(ZMMReg, ZMM_Q(1= ))); tcg_gen_qemu_st_i64(s->tmp1_i64, s->tmp0, mem_index, MO_LEUQ); @@ -3131,7 +3133,7 @@ static const struct SSEOpHelper_table6 sse_op_table6[= 256] =3D { [0x25] =3D UNARY_OP(pmovsxdq, SSE41, SSE_OPF_MMX), [0x28] =3D BINARY_OP(pmuldq, SSE41, SSE_OPF_MMX), [0x29] =3D BINARY_OP(pcmpeqq, SSE41, SSE_OPF_MMX), - [0x2a] =3D SPECIAL_OP(SSE41), /* movntqda */ + [0x2a] =3D SPECIAL_OP(SSE41), /* movntdqa */ [0x2b] =3D BINARY_OP(packusdw, SSE41, SSE_OPF_MMX), [0x30] =3D UNARY_OP(pmovzxbw, SSE41, SSE_OPF_MMX), [0x31] =3D UNARY_OP(pmovzxbd, SSE41, SSE_OPF_MMX), @@ -3294,17 +3296,17 @@ static void gen_sse(CPUX86State *env, DisasContext = *s, int b, break; case 0x1e7: /* movntdq */ case 0x02b: /* movntps */ - case 0x12b: /* movntps */ + case 0x12b: /* movntpd */ if (mod =3D=3D 3) goto illegal_op; gen_lea_modrm(env, s, modrm); - gen_sto_env_A0(s, ZMM_OFFSET(reg)); + gen_sto_env_A0(s, ZMM_OFFSET(reg), true); break; case 0x3f0: /* lddqu */ if (mod =3D=3D 3) goto illegal_op; gen_lea_modrm(env, s, modrm); - gen_ldo_env_A0(s, ZMM_OFFSET(reg)); + gen_ldo_env_A0(s, ZMM_OFFSET(reg), false); break; case 0x22b: /* movntss */ case 0x32b: /* movntsd */ @@ -3373,7 +3375,9 @@ static void gen_sse(CPUX86State *env, DisasContext *s= , int b, case 0x26f: /* movdqu xmm, ea */ if (mod !=3D 3) { gen_lea_modrm(env, s, modrm); - gen_ldo_env_A0(s, ZMM_OFFSET(reg)); + gen_ldo_env_A0(s, ZMM_OFFSET(reg), + /* movaps, movapd, movdqa */ + b =3D=3D 0x028 || b =3D=3D 0x128 || b =3D= =3D 0x16f); } else { rm =3D (modrm & 7) | REX_B(s); gen_op_movo(s, ZMM_OFFSET(reg), ZMM_OFFSET(rm)); @@ -3432,7 +3436,7 @@ static void gen_sse(CPUX86State *env, DisasContext *s= , int b, case 0x212: /* movsldup */ if (mod !=3D 3) { gen_lea_modrm(env, s, modrm); - gen_ldo_env_A0(s, ZMM_OFFSET(reg)); + gen_ldo_env_A0(s, ZMM_OFFSET(reg), true); } else { rm =3D (modrm & 7) | REX_B(s); gen_op_movl(s, offsetof(CPUX86State, xmm_regs[reg].ZMM_L(0= )), @@ -3474,7 +3478,7 @@ static void gen_sse(CPUX86State *env, DisasContext *s= , int b, case 0x216: /* movshdup */ if (mod !=3D 3) { gen_lea_modrm(env, s, modrm); - gen_ldo_env_A0(s, ZMM_OFFSET(reg)); + gen_ldo_env_A0(s, ZMM_OFFSET(reg), true); } else { rm =3D (modrm & 7) | REX_B(s); gen_op_movl(s, offsetof(CPUX86State, xmm_regs[reg].ZMM_L(1= )), @@ -3568,7 +3572,9 @@ static void gen_sse(CPUX86State *env, DisasContext *s= , int b, case 0x27f: /* movdqu ea, xmm */ if (mod !=3D 3) { gen_lea_modrm(env, s, modrm); - gen_sto_env_A0(s, ZMM_OFFSET(reg)); + gen_sto_env_A0(s, ZMM_OFFSET(reg), + /* movaps, movapd, movdqa */ + b =3D=3D 0x029 || b =3D=3D 0x129 || b =3D= =3D 0x17f); } else { rm =3D (modrm & 7) | REX_B(s); gen_op_movo(s, ZMM_OFFSET(rm), ZMM_OFFSET(reg)); @@ -3724,7 +3730,8 @@ static void gen_sse(CPUX86State *env, DisasContext *s= , int b, if (mod !=3D 3) { gen_lea_modrm(env, s, modrm); op2_offset =3D offsetof(CPUX86State,xmm_t0); - gen_ldo_env_A0(s, op2_offset); + /* FIXME: should be 64-bit access if b1 =3D=3D 0. */ + gen_ldo_env_A0(s, op2_offset, !!b1); } else { rm =3D (modrm & 7) | REX_B(s); op2_offset =3D ZMM_OFFSET(rm); @@ -3913,11 +3920,11 @@ static void gen_sse(CPUX86State *env, DisasContext = *s, int b, tcg_gen_st16_tl(s->tmp0, cpu_env, op2_offset + offsetof(ZMMReg, ZMM_W(0))); break; - case 0x2a: /* movntqda */ - gen_ldo_env_A0(s, op1_offset); + case 0x2a: /* movntdqa */ + gen_ldo_env_A0(s, op1_offset, true); return; default: - gen_ldo_env_A0(s, op2_offset); + gen_ldo_env_A0(s, op2_offset, true); } } if (!op6->fn[b1].op1) { @@ -4499,7 +4506,7 @@ static void gen_sse(CPUX86State *env, DisasContext *s= , int b, } else { op2_offset =3D offsetof(CPUX86State, xmm_t0); gen_lea_modrm(env, s, modrm); - gen_ldo_env_A0(s, op2_offset); + gen_ldo_env_A0(s, op2_offset, true); } =20 val =3D x86_ldub_code(env, s); @@ -4606,7 +4613,7 @@ static void gen_sse(CPUX86State *env, DisasContext *s= , int b, break; default: /* 128 bit access */ - gen_ldo_env_A0(s, op2_offset); + gen_ldo_env_A0(s, op2_offset, true); break; } } else { diff --git a/target/i386/tcg/user/excp_helper.c b/target/i386/tcg/user/excp= _helper.c index cd507e2a1b..b3bdb7831a 100644 --- a/target/i386/tcg/user/excp_helper.c +++ b/target/i386/tcg/user/excp_helper.c @@ -48,3 +48,10 @@ void x86_cpu_record_sigsegv(CPUState *cs, vaddr addr, =20 cpu_loop_exit_restore(cs, ra); } + +void x86_cpu_record_sigbus(CPUState *cs, vaddr addr, + MMUAccessType access_type, uintptr_t ra) +{ + X86CPU *cpu =3D X86_CPU(cs); + handle_unaligned_access(&cpu->env, addr, access_type, ra); +} --=20 2.37.2 From nobody Fri Dec 19 17:34:22 2025 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=1663610614; cv=none; d=zohomail.com; s=zohoarc; b=fudQ9OAnUSK+fwa9YKZKW9x/gO9FO7TV38hCJ28NiJKLQP1R1EyWI0r5UgYFfFtSoo6iuhlSPwkXjXvGTgSJwxD9GzRDPd336GaXh1sRVmm8a+Vku/O0rbNJ/LwBKVinXmR3DXT/D4ixh+3xeifIHlmDhNs6sbZnfdX7hgED+U4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663610614; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=i45tsI7V00zL4kxDnjzOy3ARohfOCqpKiJ2V7Iz6pSI=; b=bY9NnhRRiILqdmv92X8v/3td3HGNJuhwDuLxBHiRRTPhjrYVHpfc09DvA6SYDW549WU4qqz+fhMGmd5CE6j93JA/5qEloIb1aTG8nIaPuMazEdxtt4EYG5jOCprLetYDfw9n43kEYPHXTPILdojsORoGg01QbrgS0BexCl1FjDI= 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 1663610614376287.6366193012552; Mon, 19 Sep 2022 11:03:34 -0700 (PDT) Received: from localhost ([::1]:42510 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaL7F-0002BN-Co for importer@patchew.org; Mon, 19 Sep 2022 14:03:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37562) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKfi-0002uK-4v for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:26910) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKfe-0002s7-25 for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:03 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-641-Rm3lWJWbORKUKnqZQyQ1uA-1; Mon, 19 Sep 2022 13:35:00 -0400 Received: by mail-wm1-f71.google.com with SMTP id p24-20020a05600c1d9800b003b4b226903dso4958554wms.4 for ; Mon, 19 Sep 2022 10:34:59 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id v5-20020adff685000000b0021e4829d359sm9402708wrp.39.2022.09.19.10.34.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 10:34:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663608901; 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=i45tsI7V00zL4kxDnjzOy3ARohfOCqpKiJ2V7Iz6pSI=; b=QzcB1zJQltJLdRZ9nuz4RxBcX9jy3p1zZPi/DNMUqX+xl8xMJ+9M0qUMwtO7T5puu5dP/J MxdL5hdwmS0OovLrXfPe1d4ahYOyxzc7vE9GR2lvq+ryoArH31WwbkDCEucoi4t9IT21fV z7xVr5AO6z7YoP7g5J//MZMTcbOCKL8= X-MC-Unique: Rm3lWJWbORKUKnqZQyQ1uA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=i45tsI7V00zL4kxDnjzOy3ARohfOCqpKiJ2V7Iz6pSI=; b=I+ywDsNFZUsPrlI1YGbC6GM/V+pS8K1MOhMO2LL+viKD9YdyLevgI876P0lTR4W/VF QppNOyKQz/s7z62XJIlkhgVmrlJKhxNqe0fwK5vL/VrgZwM5080TscZOKg5bYlmj2KKV vcu0KvGBG6DqnxaVWeZBet4y0xCwZh7q6c8mKwQg6FUMjitRoThLtmeqByEglCqgudDI JpUnEJ16NJqiUVkYUkHn+nj3pW+sG09K5sW2Z/45HgHFt0fK9T7cfGYsoaSuK1CgC1L2 kyjrL0LAPa/h7/hHlAiUxvkuA69qjHZTmaaxhBEW1wVyF1WS7rLdOfYow5LJ9BZBmpDH 0iTw== X-Gm-Message-State: ACrzQf2bg+Rt3rWQRam/nO6zzLn27GAIv7i4RfLKBqx831hhyeyxk1km 6SjGE4XWcerLecgHK8d2O/POfJMxVe8F3IH4jEeo4iiiZBbT3SIePrpiXnyPICFPrZdpeuP47Y5 tlP61nATsa8VsZPcFe/9nRmE8GrsPOStpL58+3HN0iwmTPL3WZY2e1eKI+/1iRQDhmLU= X-Received: by 2002:a05:600c:3d13:b0:3b4:be25:9236 with SMTP id bh19-20020a05600c3d1300b003b4be259236mr11646911wmb.65.1663608898788; Mon, 19 Sep 2022 10:34:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5gGrGPvRAg9dOsPQBmzNguZPJOHutZx3YNaZAWM7XYjNM+qOOGb6SGx3sKqEN7dcWsSljKEw== X-Received: by 2002:a05:600c:3d13:b0:3b4:be25:9236 with SMTP id bh19-20020a05600c3d1300b003b4be259236mr11646895wmb.65.1663608898511; Mon, 19 Sep 2022 10:34:58 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 03/21] kvm: fix memory leak on failure to read stats descriptors Date: Mon, 19 Sep 2022 19:34:31 +0200 Message-Id: <20220919173449.5864-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220919173449.5864-1-pbonzini@redhat.com> References: <20220919173449.5864-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1663610614709100001 Content-Type: text/plain; charset="utf-8" Reported by Coverity as CID 1490142. Since the size is constant and the lifetime is the same as the StatsDescriptors struct, embed the struct directly instead of using a separate allocation. Suggested-by: Richard Henderson Signed-off-by: Paolo Bonzini --- accel/kvm/kvm-all.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 7c8ce18bdd..5acab1767f 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -3908,7 +3908,7 @@ exit: typedef struct StatsDescriptors { const char *ident; /* cache key, currently the StatsTarget */ struct kvm_stats_desc *kvm_stats_desc; - struct kvm_stats_header *kvm_stats_header; + struct kvm_stats_header kvm_stats_header; QTAILQ_ENTRY(StatsDescriptors) next; } StatsDescriptors; =20 @@ -3939,7 +3939,7 @@ static StatsDescriptors *find_stats_descriptors(Stats= Target target, int stats_fd descriptors =3D g_new0(StatsDescriptors, 1); =20 /* Read stats header */ - kvm_stats_header =3D g_malloc(sizeof(*kvm_stats_header)); + kvm_stats_header =3D &descriptors->kvm_stats_header; ret =3D read(stats_fd, kvm_stats_header, sizeof(*kvm_stats_header)); if (ret !=3D sizeof(*kvm_stats_header)) { error_setg(errp, "KVM stats: failed to read stats header: " @@ -3964,7 +3964,6 @@ static StatsDescriptors *find_stats_descriptors(Stats= Target target, int stats_fd g_free(kvm_stats_desc); return NULL; } - descriptors->kvm_stats_header =3D kvm_stats_header; descriptors->kvm_stats_desc =3D kvm_stats_desc; descriptors->ident =3D ident; QTAILQ_INSERT_TAIL(&stats_descriptors, descriptors, next); @@ -3989,7 +3988,7 @@ static void query_stats(StatsResultList **result, Sta= tsTarget target, return; } =20 - kvm_stats_header =3D descriptors->kvm_stats_header; + kvm_stats_header =3D &descriptors->kvm_stats_header; kvm_stats_desc =3D descriptors->kvm_stats_desc; size_desc =3D sizeof(*kvm_stats_desc) + kvm_stats_header->name_size; =20 @@ -4054,7 +4053,7 @@ static void query_stats_schema(StatsSchemaList **resu= lt, StatsTarget target, return; } =20 - kvm_stats_header =3D descriptors->kvm_stats_header; + kvm_stats_header =3D &descriptors->kvm_stats_header; kvm_stats_desc =3D descriptors->kvm_stats_desc; size_desc =3D sizeof(*kvm_stats_desc) + kvm_stats_header->name_size; =20 --=20 2.37.2 From nobody Fri Dec 19 17:34:22 2025 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=1663610264; cv=none; d=zohomail.com; s=zohoarc; b=j4jBCw0/RwT1SXCO3nYh8UWPtQKTSnosekVrHLkrUQKOxyT8WGja1OSPmsFdikW0oaA39nMKzBCvz4v6ufVfzK05PZGtayKWJRowuSefu1MJ1S15r3ETVRPmndYvS0GKcdg7ttg//u8pVmjkioc3n9hBGc3OQRQA46jOy0OAlFc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663610264; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+/XZpaWOatQvZlf69VdQZSO4CQFd856M9KwjqSmktZ0=; b=U0avFfss19tnjANEf+kYAoBeM+RquyFwLC3FL+Yil6AbRoD0kEnWoL77vB0QOYcIKNavf+arnRfki4qsrhphIIfHB8oNFFNbUp+QTiandqjQJVK+4Es0wRSkjhvSeStZE+SNbaT9KkWeWtA8qNQvOOKOApqk3kQu1tprKqgCsc8= 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 1663610264984995.9605292083993; Mon, 19 Sep 2022 10:57:44 -0700 (PDT) Received: from localhost ([::1]:49780 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaL1c-0004Xy-01 for importer@patchew.org; Mon, 19 Sep 2022 13:57:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37566) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKfh-0002uk-GU for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:33225) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKfg-0002sj-1W for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:05 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-568-a88EOQ9xPr6EwBqnR_Gj1Q-1; Mon, 19 Sep 2022 13:35:01 -0400 Received: by mail-wm1-f69.google.com with SMTP id l15-20020a05600c4f0f00b003b4bec80edbso5079614wmq.9 for ; Mon, 19 Sep 2022 10:35:01 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id m37-20020a05600c3b2500b003a2e92edeccsm15444547wms.46.2022.09.19.10.34.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 10:34:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663608903; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+/XZpaWOatQvZlf69VdQZSO4CQFd856M9KwjqSmktZ0=; b=LFAb5mRel0W1qIxIxpIYmuMMZA9p2e8q0x9rCwYeKwfKKAZd2Cfw0XEToAT6qXhDiInrq8 3QOnP47K4fg+oJuvUi9sG0CcjlMkaGpnprHVBnrz4etWepS98ZP1GHG2n9k0TuQaMLd5Fi Fd0MRdkoO+lPUZJ4JDYM1KUzj0XIA1g= X-MC-Unique: a88EOQ9xPr6EwBqnR_Gj1Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date; bh=+/XZpaWOatQvZlf69VdQZSO4CQFd856M9KwjqSmktZ0=; b=S/4waQWyWbVXbw8UtXF0V5klhIdZIbCD43j997maEEhL9cJeWEATWneHyGeMQYYV5i J045u9dYM63H/DU81Jb/e2DIwS7+3mvFwP/9yd/hK3cav/IkGYzFWPFlyB9oiDp9Wda8 3OguY36CMAZ0+15UC/3rgEFcvMiyWPBeHO2lfJLcYSax8YwVQmtGA3onV8Wn4KLm4zpY Kyu4zTYDqxeeMxMlkWc1yprWkL/SXQ3Y9sv9g7pWrDrfAQw74Vd+1+UUsR4GKEkgLJTN dezTVcpgqjp7OjfCTdwHn86ygwFtm+r4mrKFSGt7Ml5GFwHoN0IWBbpTfA2bgtc09EyZ 7GwA== X-Gm-Message-State: ACrzQf2l0AmiElK7IRiTrTMyNXJV/OZhT17x2F85LqmWF5NCkTmpXypC MW/ATx2lGYoEAGbXj8XTqUzJ095vy31fwJZZwIYml1H5XNHWR94y87p8d2KOHqQgt3RHid3yVeN OG3RZJbbS1ylIvQrFzP1hu8KiawkU+chb/p9FBAai55ROxXvZ2GbpHN2/EdEJBoD1U/I= X-Received: by 2002:a05:600c:4841:b0:3b4:76f0:99f with SMTP id j1-20020a05600c484100b003b476f0099fmr13783964wmo.85.1663608900337; Mon, 19 Sep 2022 10:35:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6EslKwADUxi6v5j6RDoY/M9OCiyzOlOOPWqYjfcyiIxGH3/9AJ12t3/HZKTwMK+5iJZm/rQg== X-Received: by 2002:a05:600c:4841:b0:3b4:76f0:99f with SMTP id j1-20020a05600c484100b003b476f0099fmr13783941wmo.85.1663608900013; Mon, 19 Sep 2022 10:35:00 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 04/21] spapr_pci: fix leak in spapr_phb_vfio_get_loc_code Date: Mon, 19 Sep 2022 19:34:32 +0200 Message-Id: <20220919173449.5864-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220919173449.5864-1-pbonzini@redhat.com> References: <20220919173449.5864-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1663610266382100001 Content-Type: text/plain; charset="utf-8" Overwriting "path" in the second call to g_strdup_printf() causes a memory = leak, even if the variable itself is g_autofree. Reported by Coverity as CID 1460454. Signed-off-by: Paolo Bonzini --- hw/ppc/spapr_pci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index 67e9d468aa..57c8a4f085 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -800,6 +800,7 @@ static char *spapr_phb_vfio_get_loc_code(SpaprPhbState = *sphb, PCIDevice *pdev) } =20 /* Construct and read from host device tree the loc-code */ + g_free(path); path =3D g_strdup_printf("/proc/device-tree%s/ibm,loc-code", devspec); if (!g_file_get_contents(path, &buf, NULL, NULL)) { return NULL; --=20 2.37.2 From nobody Fri Dec 19 17:34:22 2025 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=1663609898; cv=none; d=zohomail.com; s=zohoarc; b=GjXqvLaY8imrJjk0zaYlxqP4kra0fnpBQAHva6ehMiZ33vvTiUgV1jUxq1v31BN+HS1GtzwkuFZXx1+n/WXep4jMoTzFTO/nkLwMTVDGVfPzblREo8RenoMz3kOjCaZWrDZnhxFL3tCoYpxNiTDgci0CHJpdIjkkLMf9PL6Y0Ps= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663609898; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=MDFZcwFMH4xdJ9FVOKoS6hEuuWGsFS559glx7wMdOzE=; b=iX6GpC6vbrXVqOJQdaysCSa5/zBhDp3qAawZbXAlKfO7OA9kQYKgEsU3Ni6P9FiGQa5kNHw8vLHI2MjMWyuYndXg0t5FK4g86ZBlV4IolSTKQaul9+vHkOhA/tSKKUQ8BWeRJUHzPv+OcoHjDxTWZ8IGXuZoIiki+YWSpFsRUUE= 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 1663609898319324.88388884747803; Mon, 19 Sep 2022 10:51:38 -0700 (PDT) Received: from localhost ([::1]:42300 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaKvh-0002CV-97 for importer@patchew.org; Mon, 19 Sep 2022 13:51:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47844) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKfi-0002vE-Gj for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:33012) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKfg-0002zd-Uf for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:06 -0400 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-534-y62iqrc9NO2xvP94InED2A-1; Mon, 19 Sep 2022 13:35:02 -0400 Received: by mail-wr1-f70.google.com with SMTP id d25-20020adf9b99000000b0022adb03aee6so49166wrc.6 for ; Mon, 19 Sep 2022 10:35:02 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id c9-20020a5d4f09000000b0022ae96d7d3asm10434014wru.0.2022.09.19.10.35.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 10:35:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663608904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MDFZcwFMH4xdJ9FVOKoS6hEuuWGsFS559glx7wMdOzE=; b=Ne7/BraGqsFY/YfrfCNbD4GOkVqcBwz5OVGAsXuihroi2Bu/fk6//HA47rXB5IDlV6FHkz lWemJ0hixsyuUcka6+fzPOZcGm2xawiiXyfn6p6g5yBvXMIENR4rkkzVCV5NrL08PNUZjz LjW5ZHj2UTf/Ywv7d/HygkMAardrq2E= X-MC-Unique: y62iqrc9NO2xvP94InED2A-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date; bh=MDFZcwFMH4xdJ9FVOKoS6hEuuWGsFS559glx7wMdOzE=; b=mPtcbX0kE/Ht9AM+WVNY4tmnFVCGAZ0v7mW9IsI+MOYf21Aaft5/5Q46oZCeLs5/Ji NVHt6H4MymTIeDgupH1grgszrM+YJzDgm/niJUepaiWjkoIT7vXCUHx0IoeZmuKhUxwT PpJIIS3cxaMXRX4H8Cb9W8Y05i5A399aGI1DsXX1ZRwMpOZHyUkXRzgb+DtJ+hGqUODw aokS1j+YbVOPvB/nqxA/g30lngwjL62MxfNYIWBl0RQISFxSiAfVfojefX8UQAMcUWKv B3RRuZcAwN5qiTZx5jPGu5OLJ53RMPTashUbsmMLL696nJfXw05Y2VM2Sh4ADrS0pQu+ MWMA== X-Gm-Message-State: ACrzQf0zrS5t51cU5Cpc6T0RHMwYc2pfZnmegkYMj9CrLu+beK53NB1M bB2CkYdRWsTJl/Rm6gjSyeK8NgAcVjevasMnMVeZj7XYZrpaE/TvpJU5/j2mAErsohHFO9Wwesr 5sn1Sb0B+ILmqypFeM406I0AAHVPo0e3w+LWp3zDnOZDRziDnJj9oRFZ7tnKzvxAlgW4= X-Received: by 2002:a05:6000:1846:b0:22b:66d:12bd with SMTP id c6-20020a056000184600b0022b066d12bdmr2483106wri.572.1663608901550; Mon, 19 Sep 2022 10:35:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4+8q6wYJlnwN0IhV5b8epb69GWZmLyNxnUNqpJRRTFGUhibIeIkARNUJvHPSBkuRCUEryYrA== X-Received: by 2002:a05:6000:1846:b0:22b:66d:12bd with SMTP id c6-20020a056000184600b0022b066d12bdmr2483083wri.572.1663608901109; Mon, 19 Sep 2022 10:35:01 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 05/21] coverity: add new RISC-V component Date: Mon, 19 Sep 2022 19:34:33 +0200 Message-Id: <20220919173449.5864-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220919173449.5864-1-pbonzini@redhat.com> References: <20220919173449.5864-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1663609900082100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- scripts/coverity-scan/COMPONENTS.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/coverity-scan/COMPONENTS.md b/scripts/coverity-scan/CO= MPONENTS.md index 3aad9cdfaf..fc1608932e 100644 --- a/scripts/coverity-scan/COMPONENTS.md +++ b/scripts/coverity-scan/COMPONENTS.md @@ -146,3 +146,6 @@ tests =20 loongarch ~ (/qemu)?((/include)?/hw/(loongarch/.*|.*/loongarch.*)|/target/loongarc= h/.*) + +riscv + ~ (/qemu)?((/include)?/hw/riscv/.*|/target/riscv/.*|/hw/.*/(riscv_|ibex_= |sifive_).*) --=20 2.37.2 From nobody Fri Dec 19 17:34:22 2025 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=1663609440; cv=none; d=zohomail.com; s=zohoarc; b=jvXv9pGq+0GOllSF4XfWAjDaLfrh0iikkD9zE9cJz3JM0gElABnlK2EiGOTKRvG3bEElCFyTpFdbcxP4hdeV+YeTGbGO1uHJjVNxZpRI2NJpP225PtjeOM+8JaK0CrdzmLSKvtbdwXbmk8EbB10Hxhtx+y7mA7RhKUnugDouUEk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663609440; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=dNgKFC+0LeVv80K7QBVzhgcaEfabY+PLvf1MTEKFduI=; b=dKLLyw6oscNQ3t2VuezHjIr8jNDpLMB+15nLPNwKebmqWlns6ZC3XNrvgxgc9KQOJY4pdxvVHjA8TAlbsZs4M4IZ2H0Df3OytIreqxbdyThgBXd1xo7uI5JsDuyvNPNNrlPMK3ZhCWNTJhbrIWmuT3M29e4FTqWmHo1rh7EKYVg= 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 1663609440370908.9154119398761; Mon, 19 Sep 2022 10:44:00 -0700 (PDT) Received: from localhost ([::1]:36682 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaKoH-0003TB-8Q for importer@patchew.org; Mon, 19 Sep 2022 13:43:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47846) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKfl-0002wD-Bs for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:09 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:28352) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKfj-000341-Vb for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:09 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-301-rtYXrE7TOiS0nojfjSEc3g-1; Mon, 19 Sep 2022 13:35:05 -0400 Received: by mail-wm1-f71.google.com with SMTP id 5-20020a05600c028500b003b4d2247d3eso1416432wmk.0 for ; Mon, 19 Sep 2022 10:35:05 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id a18-20020a05600c349200b003b48dac344esm14727526wmq.43.2022.09.19.10.35.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 10:35:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663608907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dNgKFC+0LeVv80K7QBVzhgcaEfabY+PLvf1MTEKFduI=; b=Q+GBDc6s5+IAKNt7r+UshlOAZZKgEbt+PcwbEYEKSgjfl0IBjLlh1+62vIVN2kra1/X71g JGe4SBnzSVFO81e0PUXiMXCSyjBhqo8ljiy67IDBA2eHIJpe+9SiJL90vEEYd3TivMV6Is tk2vILz3/JdMT9p6vBRL55YLEW8i6I0= X-MC-Unique: rtYXrE7TOiS0nojfjSEc3g-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date; bh=dNgKFC+0LeVv80K7QBVzhgcaEfabY+PLvf1MTEKFduI=; b=heRdeN3+wjzxdaettXjdjDDvYxrg7iv1f8+CUnNnSbKdF+c60RYr+RKvIWciDI05Xr lG9+gMTZDhKI7z1Hia7AG6yB81dKwfDc+85S0EW3i98UQuBfi06i19NxmLXk5Ip89Pcs uvNAyqaUEIqSX1vxEaSEdosCidqzBQZb+/lrBNuRattWsGlwmfI0+KIwruC8sxqQbfaB 9mLzbsNQSBX4vdiDc3dDLeliBAHiU4rZnMoI6lpEHKE+L6KXqR5jJBu6aCjPUri4fkvO 9Zu5esnm85eB86Grp4nKhkhNy+ODA2Ci4pZfxurysNmZoPr0K3PSgqZytWMW7eZQgPvq 8emw== X-Gm-Message-State: ACrzQf1I5vxlUl8oXU0hMZswuYHs9ePVr1gaPo/0XRg/Lky0n+dpo+LZ WHQSoIy8gjEDQXr3LSwiSMMZbppCtlxnI57D9iRCT0kKgEef3PZHy9XHj6z1Bc7d/mnfmrLbOms ebp1DpDAoldiFtzTsInf91KsNbtpqC2I1RbXoO7bXVCoRHlI+psYpOn9obBlcAc6H2MQ= X-Received: by 2002:a05:600c:4ed2:b0:3b4:c8ce:be82 with SMTP id g18-20020a05600c4ed200b003b4c8cebe82mr8044010wmq.118.1663608903879; Mon, 19 Sep 2022 10:35:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7AeEsL5O5ds5MAkeyD5gBEfnectmCa2x32EeOoT0sxoCb/32l4oeHsyYEfdiW2oiHaosj3KQ== X-Received: by 2002:a05:600c:4ed2:b0:3b4:c8ce:be82 with SMTP id g18-20020a05600c4ed200b003b4c8cebe82mr8043992wmq.118.1663608903505; Mon, 19 Sep 2022 10:35:03 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 06/21] coverity: put NUBus under m68k component Date: Mon, 19 Sep 2022 19:34:34 +0200 Message-Id: <20220919173449.5864-7-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220919173449.5864-1-pbonzini@redhat.com> References: <20220919173449.5864-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1663609440850100001 Content-Type: text/plain; charset="utf-8" It is only used by the Q800 emulation, so put it under that architecture. Signed-off-by: Paolo Bonzini --- scripts/coverity-scan/COMPONENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/coverity-scan/COMPONENTS.md b/scripts/coverity-scan/CO= MPONENTS.md index fc1608932e..0e6ab4936e 100644 --- a/scripts/coverity-scan/COMPONENTS.md +++ b/scripts/coverity-scan/COMPONENTS.md @@ -22,7 +22,7 @@ i386 ~ (/qemu)?((/include)?/hw/i386/.*|/target/i386/.*|/hw/intc/[^/]*apic[^/]= *\.c) =20 m68k - ~ (/qemu)?((/include)?/hw/m68k/.*|/target/m68k/.*|(/include)?/hw(/.*)?/m= cf.*) + ~ (/qemu)?((/include)?/hw/m68k/.*|/target/m68k/.*|(/include)?/hw(/.*)?/m= cf.*|(/include)?/hw/nubus/.*) =20 microblaze ~ (/qemu)?((/include)?/hw/microblaze/.*|/target/microblaze/.*) --=20 2.37.2 From nobody Fri Dec 19 17:34:22 2025 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=1663609803; cv=none; d=zohomail.com; s=zohoarc; b=O+5K5GqaW+UQACGuyS5TLrXhNdnQufY4Habe2z9KK9WN5z+Noj3PCPTo++8fgBeUOYTvT2Qevm1NTdfVqaL/yk5OTDgOQ+C8KKXE8bzkT5EeV9W5+vbpTAYBu36uA7ab8Cij6tJJSQzV0YbqOV1qJxPZokfRJOEeYTZ5TFEN9cU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663609803; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7fpYBjqvol9brkWwCpmEHRs0UL23HHBLAFtYFzWhwIU=; b=LPmkvFFnw4l1tMXKx8/IyCKxy4gYtSCDr8RggRRaD2zb3CiCz5A47FHJoz1Wybtt++51EWuxfDhxYbDvlpj+tJZKLHO7UeFfoLg9DBMFpMtJJxf72BHqRbXr00MlJVh93+Yy+oV0GPUT5SRyqF8F6K9NHwyqp/iatNxZd2uNJKc= 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 1663609803813332.82056837029427; Mon, 19 Sep 2022 10:50:03 -0700 (PDT) Received: from localhost ([::1]:40886 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaKuA-0000wh-JV for importer@patchew.org; Mon, 19 Sep 2022 13:50:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47848) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKfm-0002xS-L5 for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:28286) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKfl-00034C-0R for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:10 -0400 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-601-42QQCsFEO9eGu1yc3sZ30A-1; Mon, 19 Sep 2022 13:35:06 -0400 Received: by mail-wr1-f69.google.com with SMTP id i27-20020adfaadb000000b0022a48b6436dso26372wrc.23 for ; Mon, 19 Sep 2022 10:35:06 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id q17-20020adff951000000b00228dff8d975sm14414592wrr.109.2022.09.19.10.35.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 10:35:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663608908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7fpYBjqvol9brkWwCpmEHRs0UL23HHBLAFtYFzWhwIU=; b=BKcPdo8Da+hjX9IrIIy2k5ZPhWC8IgnhNg9tSG2P7VeNyVOXZKsTTF+SULOeujf7sZB5+y 190FFUrSL3xsXsce0BQfUrIq4ZSL9rX49WnjCgJZWIw0UW1pRnSYHYDCybwIIoi8Ed8uHz 59kOYqjEeUK8gLE4QMqg8ACBtAdrouI= X-MC-Unique: 42QQCsFEO9eGu1yc3sZ30A-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date; bh=7fpYBjqvol9brkWwCpmEHRs0UL23HHBLAFtYFzWhwIU=; b=CW74wzCEIOR9BqZ2vemjjTjhKKwJj/fzW0jc/QsP3Vk+syIyFrKpRqMbKnuPVpZKsA ALTlrRvkLdw+gSdVRXMmxu0t8wL/yRdZ9aGomJPeyPSZ2CV0Qz7IRzi5nToOn/BNK8w8 OsKniBqrQGdFXbDVXrbZS2M48EATPsjtrN1gsD2JyMjVF/6wlGFqGRbNIatdiEANit5M 5eoM7R4CVtpxAcBuboajTcZ/VzUFjEyY64aGdnhbCMmwNPfz/RXLxkHfZn2CXXXG8/8a cdkvCwNtJKZxPDo1ozXRStYnlKesBYI20COgkUNDBttws7WlXGodcDlptTSiarOGUQTl w88w== X-Gm-Message-State: ACrzQf23qtbe2HG+O1XUyCw0h7gJmsNQSYAJnXKJzmdOcRyalpPE7wu1 XvUhw8N9o+yk80jlxnZhIanDbs4e9Qvmtvi5ovmufUoTTCprRDu4QjHAobAgwWLOowRmO7ll1II RBMUJsFYvSSgbQbfNYIBmko1CUlJrO/8WVmY4gLASj8x9df8gXpfjNwi1QYsDQZw47pc= X-Received: by 2002:a05:600c:4f11:b0:3b4:bf6c:4566 with SMTP id l17-20020a05600c4f1100b003b4bf6c4566mr10945367wmq.34.1663608905436; Mon, 19 Sep 2022 10:35:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5V2Gv4EBPUWJXWTiHqoGEid7AQNvsK5zsgOLJ7qKgniHueC+xtazw+vg3aFZg3drmXOai8XA== X-Received: by 2002:a05:600c:4f11:b0:3b4:bf6c:4566 with SMTP id l17-20020a05600c4f1100b003b4bf6c4566mr10945357wmq.34.1663608905148; Mon, 19 Sep 2022 10:35:05 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 07/21] smbios: sanitize type from external type before checking have_fields_bitmap Date: Mon, 19 Sep 2022 19:34:35 +0200 Message-Id: <20220919173449.5864-8-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220919173449.5864-1-pbonzini@redhat.com> References: <20220919173449.5864-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1663609805357100001 Content-Type: text/plain; charset="utf-8" test_bit uses header->type as an offset; if the file incorrectly specifies a type greater than 127, smbios_entry_add will read and write garbage. To fix this, just pass the smbios data through, assuming the user knows what to do. Reported by Coverity as CID 1487255. Signed-off-by: Paolo Bonzini --- hw/smbios/smbios.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c index 60349ee402..4c9f664830 100644 --- a/hw/smbios/smbios.c +++ b/hw/smbios/smbios.c @@ -1205,13 +1205,15 @@ void smbios_entry_add(QemuOpts *opts, Error **errp) return; } =20 - if (test_bit(header->type, have_fields_bitmap)) { - error_setg(errp, - "can't load type %d struct, fields already specifie= d!", - header->type); - return; + if (header->type <=3D SMBIOS_MAX_TYPE) { + if (test_bit(header->type, have_fields_bitmap)) { + error_setg(errp, + "can't load type %d struct, fields already spec= ified!", + header->type); + return; + } + set_bit(header->type, have_binfile_bitmap); } - set_bit(header->type, have_binfile_bitmap); =20 if (header->type =3D=3D 4) { smbios_type4_count++; --=20 2.37.2 From nobody Fri Dec 19 17:34:22 2025 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=1663609611; cv=none; d=zohomail.com; s=zohoarc; b=aCMTc97RSxL1JiVDLpYEebe+U+EJFMfcl8Kaf5NxjT8uhqf4SMrLuwZKAtw5wYKrhYYSHOTmZDxI9uOBon2cJY488L/OEbDJefUNQWgVvbz2pOX07wkGjGj+dFRR/6mCSPBMyYqTfevwgll3Z6Elgq306dDS8pAbkUxzyOeodFA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663609611; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=h4sOfPYdJOgX/UoVLZiCeuB7rB3LlGkb4x+fHLyYXsA=; b=bT8UtQ59Xw1AlGisWryEIbmepVUmC48OG5TJhbPdRUeFq2FpDf3PxjRRb05F7CTdq853BSSCg9BoTlknB9BCHe2Df75ngKFG5Vlp6RwsQyQBM2cwJUl7HDfraCVjxLi3f2M5wVjeTxpT4DwAFrOqRLtKgtR+8luI9wlDT5bUKVM= 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 1663609611931851.883245189161; Mon, 19 Sep 2022 10:46:51 -0700 (PDT) Received: from localhost ([::1]:44922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaKr4-0005a0-Qy for importer@patchew.org; Mon, 19 Sep 2022 13:46:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47850) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKfo-0002yE-FQ for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:59586) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKfm-00034e-Kb for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:12 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-551-ZvYvw1K7PMWr8LTVWDRwDQ-1; Mon, 19 Sep 2022 13:35:08 -0400 Received: by mail-wm1-f71.google.com with SMTP id 185-20020a1c02c2000000b003b4be28d7e3so4333728wmc.0 for ; Mon, 19 Sep 2022 10:35:08 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id s4-20020adff804000000b0022ac61ebb14sm14082977wrp.22.2022.09.19.10.35.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 10:35:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663608910; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h4sOfPYdJOgX/UoVLZiCeuB7rB3LlGkb4x+fHLyYXsA=; b=IsZkSzgiAPLvB/eQ+Jwq4OQqzIENUsJNJGoozLkV4FbD/BByPJ8V1uaSWNR10WfOQtjSl+ tnlxtyfLhPkziwIVNBD1UyfPEth3EeICfoCWBnOPvePqqX+pHEIn2PSDKcak+wtETbyAqa KkKbt/xToLoev038VLYwaqpQnUKBZuE= X-MC-Unique: ZvYvw1K7PMWr8LTVWDRwDQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date; bh=h4sOfPYdJOgX/UoVLZiCeuB7rB3LlGkb4x+fHLyYXsA=; b=6Dd8RpU+peju1pq89wRlbE627n+kPeYZkKsAfmsEaPwxnAkSZAg/gFX5WSUGfVqEfR mtIgyM2eZp/fx28hf0BVmq48V7B+lS39tn0jqcl0du4npVeF1YD+5SidBD/7hodU9nnM viGm13287l3DTQ1zLLxmqPZg9+3j2K7pttLFsqo7eoztXtYsRFQ4Q/HLI6dJ6zq3VmWy eyj9QCf7C2/An1vYzxWQkrnYEPBp3VbWkqNx/Wb9J3FXv45jTK66ybTjQ5CWzCGaVDZV phCu9geCfLRDmTJC2z2nSnwX/YUdfoknHi7TiGLcrrWduI9P3n0jIDYchPnqOYPMgraL qQWw== X-Gm-Message-State: ACgBeo15+gECnfthiogHtZcWzAs+SPk7yTxya+k1YEt6wWgvIDPJnRgz tmo4kdh6CmJzFNo3cB+nfJDf552Y6EO8ShW7njO3ZFWKy+o5L07cS7aGurw31Gph1r9EKawNLYj ZaHMLfqfgqRX3+AoCyKCrmRwfUIJXgDnVLuDfGzRSMfBEIGsaIbYKIHYstHKJ1TZ/HeI= X-Received: by 2002:a05:600c:548b:b0:3b4:61f4:804e with SMTP id iv11-20020a05600c548b00b003b461f4804emr19040494wmb.188.1663608906813; Mon, 19 Sep 2022 10:35:06 -0700 (PDT) X-Google-Smtp-Source: AA6agR63VvYDPD5zpzmG0cER++bPzcBmYrahmcv5y3eMK6mgWKQjYz9uT9xUJn7rWiEaw09zFrgnqQ== X-Received: by 2002:a05:600c:548b:b0:3b4:61f4:804e with SMTP id iv11-20020a05600c548b00b003b461f4804emr19040466wmb.188.1663608906297; Mon, 19 Sep 2022 10:35:06 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 08/21] tests: unit: simplify test-visitor-serialization list tests Date: Mon, 19 Sep 2022 19:34:36 +0200 Message-Id: <20220919173449.5864-9-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220919173449.5864-1-pbonzini@redhat.com> References: <20220919173449.5864-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1663609612197100001 Content-Type: text/plain; charset="utf-8" test-visitor-serialization list tests is using an "if" to pick either the f= irst element of the list or the next one. This was done presumably to mimic the code that creates the list, which has to fill in either the head pointer or the next pointer of the last element. However, the code in the insert phase is a pretty standard singly-linked list insertion, while the one in the visit phase looks weird and even looks at the first item twice: this is confusing because the test puts in 32 items and finishes with an assertion that i =3D=3D 33. So, move the "else" step in a separate switch statement, and change the do...while loop to a while, because cur_head has already been initialized beforehand. Signed-off-by: Paolo Bonzini --- tests/unit/test-visitor-serialization.c | 157 +++++++++++------------- 1 file changed, 69 insertions(+), 88 deletions(-) diff --git a/tests/unit/test-visitor-serialization.c b/tests/unit/test-visi= tor-serialization.c index 907263d030..667e8fed82 100644 --- a/tests/unit/test-visitor-serialization.c +++ b/tests/unit/test-visitor-serialization.c @@ -427,131 +427,117 @@ static void test_primitive_lists(gconstpointer opaq= ue) ops->deserialize((void **)&pl_copy_ptr, serialize_data, visit_primitive_list, &error_abort); =20 - i =3D 0; + + switch (pl_copy.type) { + case PTYPE_STRING: + cur_head =3D pl_copy.value.strings; + break; + case PTYPE_INTEGER: + cur_head =3D pl_copy.value.integers; + break; + case PTYPE_S8: + cur_head =3D pl_copy.value.s8_integers; + break; + case PTYPE_S16: + cur_head =3D pl_copy.value.s16_integers; + break; + case PTYPE_S32: + cur_head =3D pl_copy.value.s32_integers; + break; + case PTYPE_S64: + cur_head =3D pl_copy.value.s64_integers; + break; + case PTYPE_U8: + cur_head =3D pl_copy.value.u8_integers; + break; + case PTYPE_U16: + cur_head =3D pl_copy.value.u16_integers; + break; + case PTYPE_U32: + cur_head =3D pl_copy.value.u32_integers; + break; + case PTYPE_U64: + cur_head =3D pl_copy.value.u64_integers; + break; + case PTYPE_NUMBER: + cur_head =3D pl_copy.value.numbers; + break; + case PTYPE_BOOLEAN: + cur_head =3D pl_copy.value.booleans; + break; + default: + g_assert_not_reached(); + } =20 /* compare our deserialized list of primitives to the original */ - do { + i =3D 0; + while (cur_head) { switch (pl_copy.type) { case PTYPE_STRING: { - strList *ptr; - if (cur_head) { - ptr =3D cur_head; - cur_head =3D ptr->next; - } else { - cur_head =3D ptr =3D pl_copy.value.strings; - } + strList *ptr =3D cur_head; + cur_head =3D ptr->next; g_assert_cmpstr(pt->value.string, =3D=3D, ptr->value); break; } case PTYPE_INTEGER: { - intList *ptr; - if (cur_head) { - ptr =3D cur_head; - cur_head =3D ptr->next; - } else { - cur_head =3D ptr =3D pl_copy.value.integers; - } + intList *ptr =3D cur_head; + cur_head =3D ptr->next; g_assert_cmpint(pt->value.integer, =3D=3D, ptr->value); break; } case PTYPE_S8: { - int8List *ptr; - if (cur_head) { - ptr =3D cur_head; - cur_head =3D ptr->next; - } else { - cur_head =3D ptr =3D pl_copy.value.s8_integers; - } + int8List *ptr =3D cur_head; + cur_head =3D ptr->next; g_assert_cmpint(pt->value.s8, =3D=3D, ptr->value); break; } case PTYPE_S16: { - int16List *ptr; - if (cur_head) { - ptr =3D cur_head; - cur_head =3D ptr->next; - } else { - cur_head =3D ptr =3D pl_copy.value.s16_integers; - } + int16List *ptr =3D cur_head; + cur_head =3D ptr->next; g_assert_cmpint(pt->value.s16, =3D=3D, ptr->value); break; } case PTYPE_S32: { - int32List *ptr; - if (cur_head) { - ptr =3D cur_head; - cur_head =3D ptr->next; - } else { - cur_head =3D ptr =3D pl_copy.value.s32_integers; - } + int32List *ptr =3D cur_head; + cur_head =3D ptr->next; g_assert_cmpint(pt->value.s32, =3D=3D, ptr->value); break; } case PTYPE_S64: { - int64List *ptr; - if (cur_head) { - ptr =3D cur_head; - cur_head =3D ptr->next; - } else { - cur_head =3D ptr =3D pl_copy.value.s64_integers; - } + int64List *ptr =3D cur_head; + cur_head =3D ptr->next; g_assert_cmpint(pt->value.s64, =3D=3D, ptr->value); break; } case PTYPE_U8: { - uint8List *ptr; - if (cur_head) { - ptr =3D cur_head; - cur_head =3D ptr->next; - } else { - cur_head =3D ptr =3D pl_copy.value.u8_integers; - } + uint8List *ptr =3D cur_head; + cur_head =3D ptr->next; g_assert_cmpint(pt->value.u8, =3D=3D, ptr->value); break; } case PTYPE_U16: { - uint16List *ptr; - if (cur_head) { - ptr =3D cur_head; - cur_head =3D ptr->next; - } else { - cur_head =3D ptr =3D pl_copy.value.u16_integers; - } + uint16List *ptr =3D cur_head; + cur_head =3D ptr->next; g_assert_cmpint(pt->value.u16, =3D=3D, ptr->value); break; } case PTYPE_U32: { - uint32List *ptr; - if (cur_head) { - ptr =3D cur_head; - cur_head =3D ptr->next; - } else { - cur_head =3D ptr =3D pl_copy.value.u32_integers; - } + uint32List *ptr =3D cur_head; + cur_head =3D ptr->next; g_assert_cmpint(pt->value.u32, =3D=3D, ptr->value); break; } case PTYPE_U64: { - uint64List *ptr; - if (cur_head) { - ptr =3D cur_head; - cur_head =3D ptr->next; - } else { - cur_head =3D ptr =3D pl_copy.value.u64_integers; - } + uint64List *ptr =3D cur_head; + cur_head =3D ptr->next; g_assert_cmpint(pt->value.u64, =3D=3D, ptr->value); break; } case PTYPE_NUMBER: { - numberList *ptr; GString *double_expected =3D g_string_new(""); GString *double_actual =3D g_string_new(""); - if (cur_head) { - ptr =3D cur_head; - cur_head =3D ptr->next; - } else { - cur_head =3D ptr =3D pl_copy.value.numbers; - } + numberList *ptr =3D cur_head; + cur_head =3D ptr->next; /* we serialize with %f for our reference visitors, so rather = than * fuzzy floating math to test "equality", just compare the * formatted values @@ -564,13 +550,8 @@ static void test_primitive_lists(gconstpointer opaque) break; } case PTYPE_BOOLEAN: { - boolList *ptr; - if (cur_head) { - ptr =3D cur_head; - cur_head =3D ptr->next; - } else { - cur_head =3D ptr =3D pl_copy.value.booleans; - } + boolList *ptr =3D cur_head; + cur_head =3D ptr->next; g_assert_cmpint(!!pt->value.boolean, =3D=3D, !!ptr->value); break; } @@ -578,9 +559,9 @@ static void test_primitive_lists(gconstpointer opaque) g_assert_not_reached(); } i++; - } while (cur_head); + } =20 - g_assert_cmpint(i, =3D=3D, 33); + g_assert_cmpint(i, =3D=3D, 32); =20 ops->cleanup(serialize_data); dealloc_helper(&pl, visit_primitive_list, &error_abort); --=20 2.37.2 From nobody Fri Dec 19 17:34:22 2025 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=1663609917; cv=none; d=zohomail.com; s=zohoarc; b=GqaGq5cFSIacG6jbtmPUjM0EgIyC9pGnGYRq5ePnOHuEBsRjd7tgZsgOWj4S30phUy0LCLXOtpShsUzMWDCL9rXBRxlnbyuIrgykfQDLYKJT9/NSHeSGwHBDo4xsmAA1RFj+qrBt9m1Ey4Xy5Yb3+673yQGi+56eZZjHmux/ATw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663609917; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/a8Z/fd6v4qVrfdXABaUXuskf6QxOskpZwRQIxIWPYQ=; b=IHm6qVWzoueO/JKtsuDFM4uInZ5Stps+sUFl7dezsdLKq7i8fVQa5yGFhut5zCPdU/dRW4l1e0BeFqEwOYxDWisXswzxdYAehs1nFg03EsnOJzjQUogEcw1UqrbP08txoiMaGF0fItBXoAhVJzfOVmawDNq1Y5odbsH3s6XbA5c= 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 1663609917972901.74300749308; Mon, 19 Sep 2022 10:51:57 -0700 (PDT) Received: from localhost ([::1]:47508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaKvz-00037N-Uo for importer@patchew.org; Mon, 19 Sep 2022 13:51:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47852) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKfp-0002yj-Nd for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:58746) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKfo-000352-8k for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:13 -0400 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-154-HM-ai2ppNKeGJd0y7CDncw-1; Mon, 19 Sep 2022 13:35:09 -0400 Received: by mail-wr1-f72.google.com with SMTP id e18-20020adfa452000000b00228a420c389so34872wra.16 for ; Mon, 19 Sep 2022 10:35:09 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id a5-20020adffb85000000b0022a2f4fa042sm14304760wrr.103.2022.09.19.10.35.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 10:35:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663608911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/a8Z/fd6v4qVrfdXABaUXuskf6QxOskpZwRQIxIWPYQ=; b=cQmyW7RDs+WViYDDP1eyKYJLsnxLkdtd53LwX1EyP//FeubVU2cVGMoqUsIvPb8YXh+sWI 6xXzwt1NQI70AkU8XU30y86Z5TYdjdPFUXfDvrYi5JEvxNiOjQiitXGro/OWfLmhBgXXwj j61ingdLPlz80XarVB5rfA0tQfljzqY= X-MC-Unique: HM-ai2ppNKeGJd0y7CDncw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date; bh=/a8Z/fd6v4qVrfdXABaUXuskf6QxOskpZwRQIxIWPYQ=; b=WSOfyyAeCCjMjzJO69SJS2LMJuRke1sGKnwGGqxQnKsRtdIuJkjP4TBpZwgPqghA5G jApI+8yBsw5Ss9eaI4iNalfT35pJRW784PMPT6qFZg4TKpRJsZcx/5VJXjyUtQ4iZ7n5 IPGkgdHclyWU8wX0VbGoTJv0fCEmM2BQd0xOlisvryj1OSI1kAJ3k19TRpQxgLYu5MNx h+VFwcHpaVY0eQE/QBO1w/bkvqpJVRiVIKjic/mRmPd6C/Evtu0TfvlJm4zdnVPiN/hJ +jtgHkMFVQRoE5R641Na1IW8ay7Ct+Aq4BTie/aUXY7uQUCrxkVI9GorvwGr8xmC+/lr X9eQ== X-Gm-Message-State: ACrzQf1yMj0kurHiDSZfhNVfp8+YlTj01280qSKtdrKbxnYUG+xTn/jM KK5ovwPgAcyAKCkDVxnHA6iCD1mvvWELar+5XrMXV29zjVkN4fr7zfXhuxFpgDu1RhMFPlT0WNe HdcaHGhgKT1jQZN+h2X+iQd7uyz8fs8DjfLDkHMN3uKwYct9tSZVvqDjdzXaS9GPTQdQ= X-Received: by 2002:a5d:6d03:0:b0:22a:4509:2143 with SMTP id e3-20020a5d6d03000000b0022a45092143mr11297641wrq.185.1663608907765; Mon, 19 Sep 2022 10:35:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4g9qY4exKaNaXQHCLS0TJT55z7WHXXTxBmsJmv047hvRun/t8AQF59SSVlRP8Gz7X7B6qN4w== X-Received: by 2002:a5d:6d03:0:b0:22a:4509:2143 with SMTP id e3-20020a5d6d03000000b0022a45092143mr11297624wrq.185.1663608907350; Mon, 19 Sep 2022 10:35:07 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 09/21] tests: test-qga: close socket on failure to connect Date: Mon, 19 Sep 2022 19:34:37 +0200 Message-Id: <20220919173449.5864-10-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220919173449.5864-1-pbonzini@redhat.com> References: <20220919173449.5864-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1663609920274100001 Content-Type: text/plain; charset="utf-8" Reported by Coverity as CID 1432543. Signed-off-by: Paolo Bonzini --- tests/unit/test-qga.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit/test-qga.c b/tests/unit/test-qga.c index a05a4628ed..d27ff94d13 100644 --- a/tests/unit/test-qga.c +++ b/tests/unit/test-qga.c @@ -32,6 +32,7 @@ static int connect_qga(char *path) g_usleep(G_USEC_PER_SEC); } if (i++ =3D=3D 10) { + close(s); return -1; } } while (ret =3D=3D -1); --=20 2.37.2 From nobody Fri Dec 19 17:34:22 2025 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=1663610854; cv=none; d=zohomail.com; s=zohoarc; b=Byg/ys6Y3azbrgIWkl15KSh5OwtCHb12DyC/AqVm42MlvihdMAcy/9rgWornChAwe230VOiHf6hgpbHgw9NRylRl20UR/a3O4imYmjVj6LUZdXK8CcD7KYCQsTViY8A5K9Oa9/jsjyCacowzcYT5uwIkmXs5IvMHV7KBuOJd55s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663610854; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=uvn0kmiceqd2oyNCXiSyFlEG1+Z3hg5qC/XijQrII0Y=; b=KzQhbwZTir2HMCMCD/eGDEPNIB3iVH0vroDuFMchcY/wpQfFL1K78n0ZQcTkQphsZMPJeQbS1ferNMKJq66MiarDOURGIQJxHFwmO7GwKvZQSQPXD9SO+k9NEUpVU/Jf0oAeLW8n7kAwIWcyiLft1WkhteMV3q5GK81NWdbIIvY= 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 1663610854729202.0687656966113; Mon, 19 Sep 2022 11:07:34 -0700 (PDT) Received: from localhost ([::1]:53880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaLB6-0008SB-Mx for importer@patchew.org; Mon, 19 Sep 2022 14:07:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47854) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKfq-0002ym-N2 for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:41300) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKfo-000356-LT for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:14 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-617-Jq31EFYzMsCP1yDb4BMSRQ-1; Mon, 19 Sep 2022 13:35:10 -0400 Received: by mail-wm1-f69.google.com with SMTP id p24-20020a05600c1d9800b003b4b226903dso4958769wms.4 for ; Mon, 19 Sep 2022 10:35:10 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id t1-20020adfe441000000b0022a2bacabbasm14108601wrm.31.2022.09.19.10.35.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 10:35:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663608911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uvn0kmiceqd2oyNCXiSyFlEG1+Z3hg5qC/XijQrII0Y=; b=MEL/gLt7us5/+PTRPckXNXH6IvqlVtfXbIQH9nlgGYjEESHgTSLCeC93yIR8HeqtsRUzFr o38/sJX38ygxR4yBrhMHtCa2UsWu1/fgfKKxzvJE33Rxkh4N78oPh4OmOKcPigY7dZ9kQC /HO9blRkyW++pHtHbZhuFmHdG1B9OX0= X-MC-Unique: Jq31EFYzMsCP1yDb4BMSRQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date; bh=uvn0kmiceqd2oyNCXiSyFlEG1+Z3hg5qC/XijQrII0Y=; b=XLNhnSS+VeVAX13VdOrYG1EzpeF5KNcqezTf8QpJQzIosYdu9Yj1BC589/YltWe/6g 95Yu+VWqVzxO+MmXK/C/qim0HsNnjea/8IMzdWrc9DlUo0WufKOkCd2eZaShzDZJj/7b eJpRAMra7dHGAMtH9DB7vTLjx5PsHeVN3oMlpxor7faDfk5PdJVkjxq8xvmHsSpL000E l9CcGNCokiMCcPXDYBXQ8Sn3FB+d0qjm4GwGT3AgF1ccuCsITWJAxz4VNYbmiwLUMR34 lZsXCDZs1PC2idVf/SpZHPd9PQ7l5/w2ThdEqWHKSN01NHCSxpr5EMM7J8xrTL1hjdiR QGZw== X-Gm-Message-State: ACgBeo2vcjFnmgeRxJKKWYBWKrt3WOj8jWbDxaBfhZ8cQABQ4z3P88YM dRLrZFWn08Xr3f104DzJY8T1kEizSx9CYd2GbDVAS/8buC3AW0UmWK+PYfeLPST+eZIF8U0sc6D xDPfURij3vcw+vo1tHGkYKyQHkCYlq8g8AV4B/7CnQz6AknFhkKdfGsKIAyeR3dcnZPQ= X-Received: by 2002:a05:600c:2c4d:b0:3b4:867f:1e6f with SMTP id r13-20020a05600c2c4d00b003b4867f1e6fmr20394667wmg.75.1663608909099; Mon, 19 Sep 2022 10:35:09 -0700 (PDT) X-Google-Smtp-Source: AA6agR61ZrI0SMdna6IzGJV+74UIRCP2VvUbKNAyUlcGEQfRHNZYw/XgNPqEzn5WNIxf/DGh/Jr+sQ== X-Received: by 2002:a05:600c:2c4d:b0:3b4:867f:1e6f with SMTP id r13-20020a05600c2c4d00b003b4867f1e6fmr20394645wmg.75.1663608908695; Mon, 19 Sep 2022 10:35:08 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 10/21] tests: unit: add NULL-pointer check Date: Mon, 19 Sep 2022 19:34:38 +0200 Message-Id: <20220919173449.5864-11-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220919173449.5864-1-pbonzini@redhat.com> References: <20220919173449.5864-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1663610855399100001 Content-Type: text/plain; charset="utf-8" In CID 1432593, Coverity complains that the result of qdict_crumple() might leak if it is not a dictionary. This is not a practical concern since the test would fail immediately with a NULL pointer dereference in qdict_size(). However, it is not nice to depend on qdict_size() crashing, so add an explicit assertion that that the crumpled object was indeed a dictionary. Signed-off-by: Paolo Bonzini --- tests/unit/check-block-qdict.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/check-block-qdict.c b/tests/unit/check-block-qdict.c index 5a25825093..751c58e737 100644 --- a/tests/unit/check-block-qdict.c +++ b/tests/unit/check-block-qdict.c @@ -504,7 +504,7 @@ static void qdict_crumple_test_empty(void) src =3D qdict_new(); =20 dst =3D qobject_to(QDict, qdict_crumple(src, &error_abort)); - + g_assert(dst); g_assert_cmpint(qdict_size(dst), =3D=3D, 0); =20 qobject_unref(src); --=20 2.37.2 From nobody Fri Dec 19 17:34:22 2025 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=1663611129; cv=none; d=zohomail.com; s=zohoarc; b=nkA7IHarhdGcFZNYqE9vv/H6RfFyY4kNR/25ttEYK0RdXG30yhvn+XgC7AC8iDj0o41iIWB85KAuca2yfuyFpz/tRUptDf9Qpc+7xVK4sHYr2GCa6252j28heS3HS7+/ZHYBOOJmREmdfjUT0NZWQHy7aqQDOkPQs8DLleKcgaM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663611129; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=QDX1UMHUn3xQ6hIBz5bc12HygCihV0paTI0fj1irANs=; b=UmYzYie3mfBJ00zNbuzOMyK/8r1Dryw/0xLTirKKKNv2aqB1ErRsUFbRs3VvpqTuRgHy+KM+b6MScFRdH4JxnLNnIS910ZKfk2P9NfuIvT0Wnba0cGNuGdBJCB5cckaaCBLCZGgR16kHGpZL9g/pvsrztXXVcfbQc4fXCQ71+Rs= 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 1663611129923997.4649504346716; Mon, 19 Sep 2022 11:12:09 -0700 (PDT) Received: from localhost ([::1]:49288 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaLFY-0005nv-Rp for importer@patchew.org; Mon, 19 Sep 2022 14:12:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39364) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKg6-0003Ib-CR for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:48031) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKfq-00035Y-VX for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:30 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-376-o2lw-1PIPvm_gidJWcJTmg-1; Mon, 19 Sep 2022 13:35:13 -0400 Received: by mail-wm1-f70.google.com with SMTP id r128-20020a1c4486000000b003b3f017f259so8410wma.3 for ; Mon, 19 Sep 2022 10:35:12 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id e1-20020adfef01000000b00226dedf1ab7sm14425979wro.76.2022.09.19.10.35.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 10:35:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663608914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QDX1UMHUn3xQ6hIBz5bc12HygCihV0paTI0fj1irANs=; b=MW0zVmsvnOMedyoWMQzjPAFBJMGks2TGGNcsX3yVTWJvbmC/u4/UT/M8opIDW4PkuKLHZG RrtlVEuL5z1TyZDxyv8oOp9ozgzJP9esa4AnOVozZcvRXUj9MuwppG5j+9okvEcZABhW1/ o5+rtVpz9hSvHzrGnYkU+o5QOPlcUKI= X-MC-Unique: o2lw-1PIPvm_gidJWcJTmg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date; bh=QDX1UMHUn3xQ6hIBz5bc12HygCihV0paTI0fj1irANs=; b=qp93dPfEQqCmUSz3DR5oUAyRRi7AGdKsBkP0ejeHADfvOHsrUuJC9Apy/RnlGeMaN8 bO5HnTS5wHNejMXeHP1Z4vPS0es8LKJgyyg/wFY3F+E7PmHu8ZpdwpWZSsH9Ho2YxR3t JGZ9KjzFBbhW4igEKvcOx1kC9kizocmFQaFg2cqhT0Zl+AlZYbZIRi+bWB+fLPq+cYaD eNOV3FYAGPbd1nV7elAw9H/YSTfBGL0+ntrc4c2LFkdoIlrecwPiAa2aV9Y9GW0H8Unp uXpJBtK+tMVhreUgtP1ImC3giNBEWWHfWw1KDkePy4GL4khmr/F7/EQoaHAkXRzTdu47 Jdlg== X-Gm-Message-State: ACrzQf0qFAUNZiMAfqTLY2zfdS8rimkKreVBFFqkN0CFO3gyECkfjb8W RTU9Vqva/MGfR6DpdSoLQIfv6hifKLZYwp9uksm/VTl6KlldatJjGz9wYsFcoy2LBN0rjjWomIY 4UbCKSraoWDq5vvj3bFwdWW8RJXTgD6BVtHc/H3yZOx0oRCpVwMEerfLBtT3lUd5lqLs= X-Received: by 2002:adf:f2c9:0:b0:228:63f6:73c2 with SMTP id d9-20020adff2c9000000b0022863f673c2mr11309917wrp.554.1663608910262; Mon, 19 Sep 2022 10:35:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6YWKTJqOsNJ1tIMu2mFrogNkf+kCWS2lwlA0mPB3aEsK1POaXeeGTbLZFLvxAIf+rdOqal+w== X-Received: by 2002:adf:f2c9:0:b0:228:63f6:73c2 with SMTP id d9-20020adff2c9000000b0022863f673c2mr11309901wrp.554.1663608909916; Mon, 19 Sep 2022 10:35:09 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 11/21] tests/tcg: i386: fix typos in 3DNow! instructions Date: Mon, 19 Sep 2022 19:34:39 +0200 Message-Id: <20220919173449.5864-12-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220919173449.5864-1-pbonzini@redhat.com> References: <20220919173449.5864-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, WEIRD_QUOTING=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1663611130247100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- tests/tcg/i386/x86.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/tcg/i386/x86.csv b/tests/tcg/i386/x86.csv index d5d0c17f1b..c43bf42dd3 100644 --- a/tests/tcg/i386/x86.csv +++ b/tests/tcg/i386/x86.csv @@ -1469,16 +1469,16 @@ "PFCMPEQ mm1, mm2/m64","PFCMPEQ mm2/m64, mm1","pfcmpeq mm2/m64, mm1","0F 0= F B0 /r","V","V","3DNOW","amd","rw,r","","" "PFCMPGE mm1, mm2/m64","PFCMPGE mm2/m64, mm1","pfcmpge mm2/m64, mm1","0F 0= F 90 /r","V","V","3DNOW","amd","rw,r","","" "PFCMPGT mm1, mm2/m64","PFCMPGT mm2/m64, mm1","pfcmpgt mm2/m64, mm1","0F 0= F A0 /r","V","V","3DNOW","amd","rw,r","","" -"PFCPIT1 mm1, mm2/m64","PFCPIT1 mm2/m64, mm1","pfcpit1 mm2/m64, mm1","0F 0= F A6 /r","V","V","3DNOW","amd","rw,r","","" "PFMAX mm1, mm2/m64","PFMAX mm2/m64, mm1","pfmax mm2/m64, mm1","0F 0F A4 /= r","V","V","3DNOW","amd","rw,r","","" "PFMIN mm1, mm2/m64","PFMIN mm2/m64, mm1","pfmin mm2/m64, mm1","0F 0F 94 /= r","V","V","3DNOW","amd","rw,r","","" "PFMUL mm1, mm2/m64","PFMUL mm2/m64, mm1","pfmul mm2/m64, mm1","0F 0F B4 /= r","V","V","3DNOW","amd","rw,r","","" "PFNACC mm1, mm2/m64","PFNACC mm2/m64, mm1","pfnacc mm2/m64, mm1","0F 0F 8= A /r","V","V","3DNOW","amd","rw,r","","" "PFPNACC mm1, mm2/m64","PFPNACC mm2/m64, mm1","pfpnacc mm2/m64, mm1","0F 0= F 8E /r","V","V","3DNOW","amd","rw,r","","" "PFRCP mm1, mm2/m64","PFRCP mm2/m64, mm1","pfrcp mm2/m64, mm1","0F 0F 96 /= r","V","V","3DNOW","amd","rw,r","","" +"PFRCPIT1 mm1, mm2/m64","PFRCPIT1 mm2/m64, mm1","pfrcpit1 mm2/m64, mm1","0= F 0F A6 /r","V","V","3DNOW","amd","rw,r","","" "PFRCPIT2 mm1, mm2/m64","PFRCPIT2 mm2/m64, mm1","pfrcpit2 mm2/m64, mm1","0= F 0F B6 /r","V","V","3DNOW","amd","rw,r","","" "PFRSQIT1 mm1, mm2/m64","PFRSQIT1 mm2/m64, mm1","pfrsqit1 mm2/m64, mm1","0= F 0F A7 /r","V","V","3DNOW","amd","rw,r","","" -"PFSQRT mm1, mm2/m64","PFSQRT mm2/m64, mm1","pfsqrt mm2/m64, mm1","0F 0F 9= 7 /r","V","V","3DNOW","amd","rw,r","","" +"PFRSQRT mm1, mm2/m64","PFRSQRT mm2/m64, mm1","pfrsqrt mm2/m64, mm1","0F 0= F 97 /r","V","V","3DNOW","amd","rw,r","","" "PFSUB mm1, mm2/m64","PFSUB mm2/m64, mm1","pfsub mm2/m64, mm1","0F 0F 9A /= r","V","V","3DNOW","amd","rw,r","","" "PFSUBR mm1, mm2/m64","PFSUBR mm2/m64, mm1","pfsubr mm2/m64, mm1","0F 0F A= A /r","V","V","3DNOW","amd","rw,r","","" "PHADDD mm1, mm2/m64","PHADDD mm2/m64, mm1","phaddd mm2/m64, mm1","0F 38 0= 2 /r","V","V","SSSE3","","rw,r","","" --=20 2.37.2 From nobody Fri Dec 19 17:34:22 2025 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=1663610128; cv=none; d=zohomail.com; s=zohoarc; b=BTJI6Gdhq59nX36Lf31TzXBSByv5oqFIHr/F3DcBlNBl4H/OGKPd0NzzIXtwRWN/uNMqucko08M7jeJy0y0j+wTVI3QThlCQyzSNrw4IsNI25kOUK8IL6ych75CqzGRkF0/K902EKfUna9SKPI1efM1zxyv63dENjOK87vU7eVA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663610128; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7Zg0/wUJgmeAlnCbEWzJB2F+TwlN5XgXFA/9/SQm7bs=; b=KdwZ0bitlOa5Gse/ztdNOAsbmmk5JshcLLyI4i6YGSS9koB97gihed30GI/VgPyjgZBXSa5C/yxesu5AC4EorWKGt1BW9SB7LqHVBjhgM5GOWAzvWr+pWpFT3kThqweDz1uzLa1gwE56ksvbLNXD/08sV8n4+M/ISU9EuyuWZDw= 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 1663610128370113.22131360154015; Mon, 19 Sep 2022 10:55:28 -0700 (PDT) Received: from localhost ([::1]:46534 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaKzP-0008CN-2W for importer@patchew.org; Mon, 19 Sep 2022 13:55:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39372) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKg8-0003K2-JC for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:24861) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKfs-000369-M5 for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:32 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-374-FUD1sJASP1uIsVhv6J_A6Q-1; Mon, 19 Sep 2022 13:35:13 -0400 Received: by mail-wm1-f70.google.com with SMTP id r128-20020a1c4486000000b003b3f017f259so8444wma.3 for ; Mon, 19 Sep 2022 10:35:13 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id g15-20020a5d488f000000b002205a5de337sm14020824wrq.102.2022.09.19.10.35.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 10:35:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663608916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7Zg0/wUJgmeAlnCbEWzJB2F+TwlN5XgXFA/9/SQm7bs=; b=BBmyR8wtuU23/vnuX0qYIJf9BvnRJJg+ZGPzMkHmZZIoQjH17sdoK3EbkTLKYAkEgVhpcw fhpl+GvcyJLlxqSqcrfrOETKDOvfFlKtjU9foUS2/yObGnAV7fZu+dB3hu88ZjXCsBCN9M PoE2xUsxk3DDpp1dKavlgSyi5+kgEI0= X-MC-Unique: FUD1sJASP1uIsVhv6J_A6Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date; bh=7Zg0/wUJgmeAlnCbEWzJB2F+TwlN5XgXFA/9/SQm7bs=; b=lF2y2d7iTxccL+K0nUR2pTT8jrF3P8qYII9yEU29O5sCa1Lt4nPKNh3X6hqX4rqV5x mxqADh74f8eDIVHEY6/0FTlUhwfuWjgKC0tmARZk/TfmDfSBX5pJV9fGvxR0MWnbWi9h QdAIXkQced/WYeCH9qvlMAnOwJxWRDRQkRDtYzBgO9SDiB58QZ+hlEK4Rz3FTzWS0Qil Jnxn0kiKDhRllbi0MnpOzRkeisBGq3JSoO+BFNLJzzpBbQfDs1kbZWqznoV+SzvZ436i m5BDFkipAENlTvJtZRtVEvZxezXBD6c2MWMCdCvyyN4GS9+LseyjgIytu+oErrOnwn8z i8eA== X-Gm-Message-State: ACrzQf0UG7R63yAxwGXU9k7e2I/th+XuGX2IZw9uPaIGYw2Z+fqYO+fz +KIrUj2pQUYV0OdQYcGEB+lqymp2pz207dPw2doF+dWCNzhdgKXfxcHkmxAGgiULoHgvzDqSA9d NWIaJs8J4IMqSxfBcweZLv9+uL15Afuwd3D0hjCmxoQhSV70OWVB2muECMWcWOWEZ4tU= X-Received: by 2002:a05:600c:19ce:b0:3b4:c709:4307 with SMTP id u14-20020a05600c19ce00b003b4c7094307mr8046254wmq.182.1663608911961; Mon, 19 Sep 2022 10:35:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5inHE503aX2GmA2gkt8U3BR8PC09qk+afhicpdWM5cekvPOS82xVY1v2bi6B22GBxAj2iJwA== X-Received: by 2002:a05:600c:19ce:b0:3b4:c709:4307 with SMTP id u14-20020a05600c19ce00b003b4c7094307mr8046226wmq.182.1663608911284; Mon, 19 Sep 2022 10:35:11 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 12/21] tests/tcg: i386: add MMX and 3DNow! tests Date: Mon, 19 Sep 2022 19:34:40 +0200 Message-Id: <20220919173449.5864-13-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220919173449.5864-1-pbonzini@redhat.com> References: <20220919173449.5864-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1663610129107100001 Content-Type: text/plain; charset="utf-8" Adjust the test-avx.py generator to produce tests specifically for MMX and 3DNow. Using a separate generator introduces some code duplication, but is a simpler approach because of test-avx's extra complexity to support 3- and 4-operand AVX instructions. If needed, a common library can be introduced later. While at it, for consistency move all the -cpu max rules to the same place. Signed-off-by: Paolo Bonzini --- tests/tcg/i386/Makefile.target | 24 ++- tests/tcg/i386/test-3dnow.c | 3 + tests/tcg/i386/test-avx.py | 1 - tests/tcg/i386/test-mmx.c | 315 +++++++++++++++++++++++++++++++ tests/tcg/i386/test-mmx.py | 244 ++++++++++++++++++++++++ tests/tcg/x86_64/Makefile.target | 1 - 6 files changed, 583 insertions(+), 5 deletions(-) create mode 100644 tests/tcg/i386/test-3dnow.c create mode 100644 tests/tcg/i386/test-mmx.c create mode 100755 tests/tcg/i386/test-mmx.py diff --git a/tests/tcg/i386/Makefile.target b/tests/tcg/i386/Makefile.target index be21b81b96..599f192529 100644 --- a/tests/tcg/i386/Makefile.target +++ b/tests/tcg/i386/Makefile.target @@ -7,8 +7,8 @@ VPATH +=3D $(I386_SRC) =20 I386_SRCS=3D$(notdir $(wildcard $(I386_SRC)/*.c)) ALL_X86_TESTS=3D$(I386_SRCS:.c=3D) -SKIP_I386_TESTS=3Dtest-i386-ssse3 test-avx -X86_64_TESTS:=3D$(filter test-i386-bmi2 test-i386-ssse3 test-avx, $(ALL_X8= 6_TESTS)) +SKIP_I386_TESTS=3Dtest-i386-ssse3 test-avx test-3dnow test-mmx +X86_64_TESTS:=3D$(filter test-i386-bmi2 $(SKIP_I386_TESTS), $(ALL_X86_TEST= S)) =20 test-i386-sse-exceptions: CFLAGS +=3D -msse4.1 -mfpmath=3Dsse run-test-i386-sse-exceptions: QEMU_OPTS +=3D -cpu max @@ -82,9 +82,27 @@ run-plugin-sha512-sse-with-%: QEMU_OPTS+=3D-cpu max =20 TESTS+=3Dsha512-sse =20 -CLEANFILES +=3D test-avx.h +CLEANFILES +=3D test-avx.h test-mmx.h test-3dnow.h +test-3dnow.h: test-mmx.py x86.csv + $(PYTHON) $(I386_SRC)/test-mmx.py $(I386_SRC)/x86.csv $@ 3DNOW + +test-mmx.h: test-mmx.py x86.csv + $(PYTHON) $(I386_SRC)/test-mmx.py $(I386_SRC)/x86.csv $@ MMX SSE SSE2 SSE= 3 SSSE3 + test-avx.h: test-avx.py x86.csv $(PYTHON) $(I386_SRC)/test-avx.py $(I386_SRC)/x86.csv $@ =20 +test-3dnow: CFLAGS +=3D -masm=3Dintel -O -I. +run-test-3dnow: QEMU_OPTS +=3D -cpu max +run-plugin-test-3dnow: QEMU_OPTS +=3D -cpu max +test-3dnow: test-3dnow.h + +test-mmx: CFLAGS +=3D -masm=3Dintel -O -I. +run-test-mmx: QEMU_OPTS +=3D -cpu max +run-plugin-test-mmx: QEMU_OPTS +=3D -cpu max +test-mmx: test-mmx.h + test-avx: CFLAGS +=3D -masm=3Dintel -O -I. +run-test-avx: QEMU_OPTS +=3D -cpu max +run-plugin-test-avx: QEMU_OPTS +=3D -cpu max test-avx: test-avx.h diff --git a/tests/tcg/i386/test-3dnow.c b/tests/tcg/i386/test-3dnow.c new file mode 100644 index 0000000000..67abc68677 --- /dev/null +++ b/tests/tcg/i386/test-3dnow.c @@ -0,0 +1,3 @@ +#define EMMS "femms" +#define TEST_FILE "test-3dnow.h" +#include "test-mmx.c" diff --git a/tests/tcg/i386/test-avx.py b/tests/tcg/i386/test-avx.py index 6eb455a8b4..2516c66445 100755 --- a/tests/tcg/i386/test-avx.py +++ b/tests/tcg/i386/test-avx.py @@ -7,7 +7,6 @@ from fnmatch import fnmatch =20 archs =3D [ - # TODO: MMX? "SSE", "SSE2", "SSE3", "SSSE3", "SSE4_1", "SSE4_2", ] =20 diff --git a/tests/tcg/i386/test-mmx.c b/tests/tcg/i386/test-mmx.c new file mode 100644 index 0000000000..60802067d4 --- /dev/null +++ b/tests/tcg/i386/test-mmx.c @@ -0,0 +1,315 @@ +#include +#include +#include +#include + +#ifndef TEST_FILE +#define TEST_FILE "test-mmx.h" +#endif +#ifndef EMMS +#define EMMS "emms" +#endif + +typedef void (*testfn)(void); + +typedef struct { + uint64_t q0, q1; +} __attribute__((aligned(16))) v2di; + +typedef struct { + uint64_t mm[8]; + v2di xmm[8]; + uint64_t r[16]; + uint64_t flags; + uint32_t ff; + uint64_t pad; + v2di mem[4]; + v2di mem0[4]; +} reg_state; + +typedef struct { + int n; + testfn fn; + const char *s; + reg_state *init; +} TestDef; + +reg_state initI; +reg_state initF32; +reg_state initF64; + +static void dump_mmx(int n, const uint64_t *r, int ff) +{ + if (ff =3D=3D 32) { + float v[2]; + memcpy(v, r, sizeof(v)); + printf("MM%d =3D %016lx %8g %8g\n", n, *r, v[1], v[0]); + } else { + printf("MM%d =3D %016lx\n", n, *r); + } +} + +static void dump_xmm(const char *name, int n, const v2di *r, int ff) +{ + printf("%s%d =3D %016lx %016lx\n", + name, n, r->q1, r->q0); + if (ff =3D=3D 32) { + float v[4]; + memcpy(v, r, sizeof(v)); + printf(" %8g %8g %8g %8g\n", + v[3], v[2], v[1], v[0]); + } +} + +static void dump_regs(reg_state *s, int ff) +{ + int i; + + for (i =3D 0; i < 8; i++) { + dump_mmx(i, &s->mm[i], ff); + } + for (i =3D 0; i < 4; i++) { + dump_xmm("mem", i, &s->mem0[i], 0); + } +} + +static void compare_state(const reg_state *a, const reg_state *b) +{ + int i; + for (i =3D 0; i < 8; i++) { + if (a->mm[i] !=3D b->mm[i]) { + printf("MM%d =3D %016lx\n", i, b->mm[i]); + } + } + for (i =3D 0; i < 16; i++) { + if (a->r[i] !=3D b->r[i]) { + printf("r%d =3D %016lx\n", i, b->r[i]); + } + } + for (i =3D 0; i < 8; i++) { + if (memcmp(&a->xmm[i], &b->xmm[i], 8)) { + dump_xmm("xmm", i, &b->xmm[i], a->ff); + } + } + for (i =3D 0; i < 4; i++) { + if (memcmp(&a->mem0[i], &a->mem[i], 16)) { + dump_xmm("mem", i, &a->mem[i], a->ff); + } + } + if (a->flags !=3D b->flags) { + printf("FLAGS =3D %016lx\n", b->flags); + } +} + +#define LOADMM(r, o) "movq " #r ", " #o "[%0]\n\t" +#define LOADXMM(r, o) "movdqa " #r ", " #o "[%0]\n\t" +#define STOREMM(r, o) "movq " #o "[%1], " #r "\n\t" +#define STOREXMM(r, o) "movdqa " #o "[%1], " #r "\n\t" +#define MMREG(F) \ + F(mm0, 0x00) \ + F(mm1, 0x08) \ + F(mm2, 0x10) \ + F(mm3, 0x18) \ + F(mm4, 0x20) \ + F(mm5, 0x28) \ + F(mm6, 0x30) \ + F(mm7, 0x38) +#define XMMREG(F) \ + F(xmm0, 0x040) \ + F(xmm1, 0x050) \ + F(xmm2, 0x060) \ + F(xmm3, 0x070) \ + F(xmm4, 0x080) \ + F(xmm5, 0x090) \ + F(xmm6, 0x0a0) \ + F(xmm7, 0x0b0) +#define LOADREG(r, o) "mov " #r ", " #o "[rax]\n\t" +#define STOREREG(r, o) "mov " #o "[rax], " #r "\n\t" +#define REG(F) \ + F(rbx, 0xc8) \ + F(rcx, 0xd0) \ + F(rdx, 0xd8) \ + F(rsi, 0xe0) \ + F(rdi, 0xe8) \ + F(r8, 0x100) \ + F(r9, 0x108) \ + F(r10, 0x110) \ + F(r11, 0x118) \ + F(r12, 0x120) \ + F(r13, 0x128) \ + F(r14, 0x130) \ + F(r15, 0x138) \ + +static void run_test(const TestDef *t) +{ + reg_state result; + reg_state *init =3D t->init; + memcpy(init->mem, init->mem0, sizeof(init->mem)); + printf("%5d %s\n", t->n, t->s); + asm volatile( + MMREG(LOADMM) + XMMREG(LOADXMM) + "sub rsp, 128\n\t" + "push rax\n\t" + "push rbx\n\t" + "push rcx\n\t" + "push rdx\n\t" + "push %1\n\t" + "push %2\n\t" + "mov rax, %0\n\t" + "pushf\n\t" + "pop rbx\n\t" + "shr rbx, 8\n\t" + "shl rbx, 8\n\t" + "mov rcx, 0x140[rax]\n\t" + "and rcx, 0xff\n\t" + "or rbx, rcx\n\t" + "push rbx\n\t" + "popf\n\t" + REG(LOADREG) + "mov rax, 0xc0[rax]\n\t" + "call [rsp]\n\t" + "mov [rsp], rax\n\t" + "mov rax, 8[rsp]\n\t" + REG(STOREREG) + "mov rbx, [rsp]\n\t" + "mov 0xc0[rax], rbx\n\t" + "mov rbx, 0\n\t" + "mov 0xf0[rax], rbx\n\t" + "mov 0xf8[rax], rbx\n\t" + "pushf\n\t" + "pop rbx\n\t" + "and rbx, 0xff\n\t" + "mov 0x140[rax], rbx\n\t" + "add rsp, 16\n\t" + "pop rdx\n\t" + "pop rcx\n\t" + "pop rbx\n\t" + "pop rax\n\t" + "add rsp, 128\n\t" + MMREG(STOREMM) + EMMS "\n\t" + XMMREG(STOREXMM) + : : "r"(init), "r"(&result), "r"(t->fn) + : "memory", "cc", + "rsi", "rdi", + "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", + "mm0", "mm1", "mm2", "mm3", "mm4", "mm5", "mm6", "mm7", + "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", + "xmm6", "xmm7", "xmm8", "xmm9", "xmm10", "xmm11", + "xmm12", "xmm13", "xmm14", "xmm15" + ); + compare_state(init, &result); +} + +#define TEST(n, cmd, type) \ +static void __attribute__((naked)) test_##n(void) \ +{ \ + asm volatile(cmd); \ + asm volatile("ret"); \ +} +#include TEST_FILE + + +static const TestDef test_table[] =3D { +#define TEST(n, cmd, type) {n, test_##n, cmd, &init##type}, +#include TEST_FILE + {-1, NULL, "", NULL} +}; + +static void run_all(void) +{ + const TestDef *t; + for (t =3D test_table; t->fn; t++) { + run_test(t); + } +} + +#define ARRAY_LEN(x) (sizeof(x) / sizeof(x[0])) + +float val_f32[] =3D {2.0, -1.0, 4.8, 0.8, 3, -42.0, 5e6, 7.5, 8.3}; +uint64_t val_i64[] =3D { + 0x3d6b3b6a9e4118f2lu, 0x355ae76d2774d78clu, + 0xd851c54a56bf1f29lu, 0x4a84d1d50bf4c4fflu, + 0x5826475e2c5fd799lu, 0xfd32edc01243f5e9lu, +}; + +v2di deadbeef =3D {0xa5a5a5a5deadbeefull, 0xa5a5a5a5deadbeefull}; + +void init_f32reg(uint64_t *r) +{ + static int n; + float v[2]; + int i; + for (i =3D 0; i < 2; i++) { + v[i] =3D val_f32[n++]; + if (n =3D=3D ARRAY_LEN(val_f32)) { + n =3D 0; + } + } + memcpy(r, v, sizeof(*r)); +} + +void init_intreg(uint64_t *r) +{ + static uint64_t mask; + static int n; + + *r =3D val_i64[n] ^ mask; + n++; + if (n =3D=3D ARRAY_LEN(val_i64)) { + n =3D 0; + mask *=3D 0x104C11DB7; + } +} + +static void init_all(reg_state *s) +{ + int i; + + for (i =3D 0; i < 16; i++) { + init_intreg(&s->r[i]); + } + s->r[3] =3D (uint64_t)&s->mem[0]; /* rdx */ + s->r[5] =3D (uint64_t)&s->mem[2]; /* rdi */ + s->r[6] =3D 0; + s->r[7] =3D 0; + s->flags =3D 2; + for (i =3D 0; i < 8; i++) { + s->xmm[i] =3D deadbeef; + memcpy(&s->mm[i], &s->xmm[i], sizeof(s->mm[i])); + } + for (i =3D 0; i < 2; i++) { + s->mem0[i] =3D deadbeef; + } +} + +int main(int argc, char *argv[]) +{ + init_all(&initI); + init_intreg(&initI.mm[5]); + init_intreg(&initI.mm[6]); + init_intreg(&initI.mm[7]); + init_intreg(&initI.mem0[1].q0); + init_intreg(&initI.mem0[1].q1); + printf("Int:\n"); + dump_regs(&initI, 0); + + init_all(&initF32); + init_f32reg(&initF32.mm[5]); + init_f32reg(&initF32.mm[6]); + init_f32reg(&initF32.mm[7]); + init_f32reg(&initF32.mem0[1].q0); + init_f32reg(&initF32.mem0[1].q1); + initF32.ff =3D 32; + printf("F32:\n"); + dump_regs(&initF32, 32); + + if (argc > 1) { + int n =3D atoi(argv[1]); + run_test(&test_table[n]); + } else { + run_all(); + } + return 0; +} diff --git a/tests/tcg/i386/test-mmx.py b/tests/tcg/i386/test-mmx.py new file mode 100755 index 0000000000..392315e176 --- /dev/null +++ b/tests/tcg/i386/test-mmx.py @@ -0,0 +1,244 @@ +#! /usr/bin/env python3 + +# Generate test-avx.h from x86.csv + +import csv +import sys +from fnmatch import fnmatch + +ignore =3D set(["EMMS", "FEMMS", "FISTTP", + "LDMXCSR", "VLDMXCSR", "STMXCSR", "VSTMXCSR"]) + +imask =3D { + 'PALIGNR': 0x3f, + 'PEXTRB': 0x0f, + 'PEXTRW': 0x07, + 'PEXTRD': 0x03, + 'PEXTRQ': 0x01, + 'PINSRB': 0x0f, + 'PINSRW': 0x07, + 'PINSRD': 0x03, + 'PINSRQ': 0x01, + 'PSHUF[DW]': 0xff, + 'PSHUF[LH]W': 0xff, + 'PS[LR][AL][WDQ]': 0x3f, +} + +def strip_comments(x): + for l in x: + if l !=3D '' and l[0] !=3D '#': + yield l + +def reg_w(w): + if w =3D=3D 8: + return 'al' + elif w =3D=3D 16: + return 'ax' + elif w =3D=3D 32: + return 'eax' + elif w =3D=3D 64: + return 'rax' + raise Exception("bad reg_w %d" % w) + +def mem_w(w): + if w =3D=3D 8: + t =3D "BYTE" + elif w =3D=3D 16: + t =3D "WORD" + elif w =3D=3D 32: + t =3D "DWORD" + elif w =3D=3D 64: + t =3D "QWORD" + else: + raise Exception() + + return t + " PTR 32[rdx]" + +class MMArg(): + isxmm =3D True + + def __init__(self, mw): + if mw not in [0, 32, 64]: + raise Exception("Bad /m width: %s" % w) + self.mw =3D mw + self.ismem =3D mw !=3D 0 + def regstr(self, n): + if n < 0: + return mem_w(self.mw) + else: + return "mm%d" % (n, ) + +def match(op, pattern): + return fnmatch(op, pattern) + +class ArgImm8u(): + isxmm =3D False + ismem =3D False + def __init__(self, op): + for k, v in imask.items(): + if match(op, k): + self.mask =3D imask[k]; + return + raise Exception("Unknown immediate") + def vals(self): + mask =3D self.mask + yield 0 + n =3D 0 + while n !=3D mask: + n +=3D 1 + while (n & ~mask) !=3D 0: + n +=3D (n & ~mask) + yield n + +class ArgRM(): + isxmm =3D False + def __init__(self, rw, mw): + if rw not in [8, 16, 32, 64]: + raise Exception("Bad r/w width: %s" % w) + if mw not in [0, 8, 16, 32, 64]: + raise Exception("Bad r/w width: %s" % w) + self.rw =3D rw + self.mw =3D mw + self.ismem =3D mw !=3D 0 + def regstr(self, n): + if n < 0: + return mem_w(self.mw) + else: + return reg_w(self.rw) + +class ArgMem(): + isxmm =3D False + ismem =3D True + def __init__(self, w): + if w not in [8, 16, 32, 64, 128, 256]: + raise Exception("Bad mem width: %s" % w) + self.w =3D w + def regstr(self, n): + return mem_w(self.w) + +class SkipInstruction(Exception): + pass + +def ArgGenerator(arg, op): + if arg[:2] =3D=3D 'mm': + if "/" in arg: + r, m =3D arg.split('/') + if (m[0] !=3D 'm'): + raise Exception("Expected /m: %s", arg) + return MMArg(int(m[1:])); + else: + return MMArg(0); + elif arg[:4] =3D=3D 'imm8': + return ArgImm8u(op); + elif arg[0] =3D=3D 'r': + if '/m' in arg: + r, m =3D arg.split('/') + if (m[0] !=3D 'm'): + raise Exception("Expected /m: %s", arg) + mw =3D int(m[1:]) + if r =3D=3D 'r': + rw =3D mw + else: + rw =3D int(r[1:]) + return ArgRM(rw, mw) + + return ArgRM(int(arg[1:]), 0); + elif arg[0] =3D=3D 'm': + return ArgMem(int(arg[1:])) + else: + raise SkipInstruction + +class InsnGenerator: + def __init__(self, op, args): + self.op =3D op + if op[0:2] =3D=3D "PF": + self.optype =3D 'F32' + else: + self.optype =3D 'I' + + try: + self.args =3D list(ArgGenerator(a, op) for a in args) + if len(self.args) > 0 and self.args[-1] is None: + self.args =3D self.args[:-1] + except SkipInstruction: + raise + except Exception as e: + raise Exception("Bad arg %s: %s" % (op, e)) + + def gen(self): + regs =3D (5, 6, 7) + dest =3D 4 + + nreg =3D len(self.args) + if nreg =3D=3D 0: + yield self.op + return + if isinstance(self.args[-1], ArgImm8u): + nreg -=3D 1 + immarg =3D self.args[-1] + else: + immarg =3D None + memarg =3D -1 + for n, arg in enumerate(self.args): + if arg.ismem: + memarg =3D n + + if nreg =3D=3D 1: + regset =3D [(regs[0],)] + if memarg =3D=3D 0: + regset +=3D [(-1,)] + elif nreg =3D=3D 2: + regset =3D [ + (regs[0], regs[1]), + (regs[0], regs[0]), + ] + if memarg =3D=3D 0: + regset +=3D [(-1, regs[0])] + elif memarg =3D=3D 1: + regset +=3D [(dest, -1)] + else: + raise Exception("Too many regs: %s(%d)" % (self.op, nreg)) + + for regv in regset: + argstr =3D [] + for i in range(nreg): + arg =3D self.args[i] + argstr.append(arg.regstr(regv[i])) + if immarg is None: + yield self.op + ' ' + ','.join(argstr) + else: + for immval in immarg.vals(): + yield self.op + ' ' + ','.join(argstr) + ',' + str(imm= val) + +def split0(s): + if s =3D=3D '': + return [] + return s.split(',') + +def main(): + n =3D 0 + if len(sys.argv) <=3D 3: + print("Usage: test-mmx.py x86.csv test-mmx.h CPUID...") + exit(1) + csvfile =3D open(sys.argv[1], 'r', newline=3D'') + archs =3D sys.argv[3:] + with open(sys.argv[2], "w") as outf: + outf.write("// Generated by test-mmx.py. Do not edit.\n") + for row in csv.reader(strip_comments(csvfile)): + insn =3D row[0].replace(',', '').split() + if insn[0] in ignore: + continue + cpuid =3D row[6] + if cpuid in archs: + try: + g =3D InsnGenerator(insn[0], insn[1:]) + for insn in g.gen(): + outf.write('TEST(%d, "%s", %s)\n' % (n, insn, g.op= type)) + n +=3D 1 + except SkipInstruction: + pass + outf.write("#undef TEST\n") + csvfile.close() + +if __name__ =3D=3D "__main__": + main() diff --git a/tests/tcg/x86_64/Makefile.target b/tests/tcg/x86_64/Makefile.t= arget index 861a0966f4..6895db1c43 100644 --- a/tests/tcg/x86_64/Makefile.target +++ b/tests/tcg/x86_64/Makefile.target @@ -17,7 +17,6 @@ TESTS=3D$(MULTIARCH_TESTS) endif =20 run-test-i386-ssse3: QEMU_OPTS +=3D -cpu max -run-test-avx: QEMU_OPTS +=3D -cpu max run-plugin-test-i386-ssse3-%: QEMU_OPTS +=3D -cpu max =20 test-x86_64: LDFLAGS+=3D-lm -lc --=20 2.37.2 From nobody Fri Dec 19 17:34:22 2025 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=1663610073; cv=none; d=zohomail.com; s=zohoarc; b=K4/N9x1HMPmKROPPfTCSaeoKsWDHxykiEznfUDye7zV6bpBb2a9DAOebI5v+vfHZErRtMJzCds30tfkHbKld+v2nBoq3pFne49+USQeSaMc+bbWFITBp9WzUGObJP/SQi1rTvXb2mP0NuLHS6Bn8GtPEE1nY+pkFhqCHhvNHgCg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663610073; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=60ZCEpPNxCwMjWmNStrObBA/6q5Os6NikAkMLpEdLr4=; b=E3Zxs3srbM5kc2qE/hGu/K/noQde6m206hOEzF/tEJy4oOkuQPNJdA5xe877S5fnt8QrUni1IZcKIUK2eSUi1ylFtUSiJdzrPpPk6dxM94BmKBVgY/ItPWyr0dPwwcAuYIXeEx5PodYy+3joytaJuI1sHOoA8S13ew5GInwu/LI= 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 1663610073727405.39436305066386; Mon, 19 Sep 2022 10:54:33 -0700 (PDT) Received: from localhost ([::1]:37652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaKyV-0006t1-QK for importer@patchew.org; Mon, 19 Sep 2022 13:54:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39362) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKg6-0003IW-85 for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:33190) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKfs-00035u-8c for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:29 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-147-rL_fqVsMMqOtI9KQa1Gk_Q-1; Mon, 19 Sep 2022 13:35:14 -0400 Received: by mail-wm1-f71.google.com with SMTP id 5-20020a05600c028500b003b4d2247d3eso1416506wmk.0 for ; Mon, 19 Sep 2022 10:35:14 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id u5-20020a5d4345000000b002287d99b455sm13988169wrr.15.2022.09.19.10.35.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 10:35:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663608915; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=60ZCEpPNxCwMjWmNStrObBA/6q5Os6NikAkMLpEdLr4=; b=EdQ/vjo3gYjPNCNSrYg8oJqt/ewHb18JaWLG0/SNI3nQdbXJhVDTLtqJsoVEURwi05rqav E/EEXTPlPIbQCFHJlSWD9CDAQoFI5e9KJHJe6WwkFHTc/dx5+y/gDJ4UXu5S/RZYLmmupj tv3nhOjfYFvtstB33kR3LS5ml1WQOos= X-MC-Unique: rL_fqVsMMqOtI9KQa1Gk_Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date; bh=60ZCEpPNxCwMjWmNStrObBA/6q5Os6NikAkMLpEdLr4=; b=fXhYrCNKGMmLDm8FzGSDtJyZHWvff/txWKMyiwMPnbR6RRfAXOXNCTns8shzl2ZYW3 32clXxmD1R9F5k9ylEk/AKj4tESGoK1gLRd24CASZ1FuH04UC3dWCuBfN+CTrvwrGU/1 Bo3Z5GupsId/ZZxjwg0of02gBgFDR3dIw1e+ZPxwyWwkHcrna2U8dV8WM2Z2UPGCp9xh IGzLrhdf0M/g5n401INyRY1eS9wUO0yu8dcCwV0mi++N5NLjqCPGRYhSNyQ753d26eYb IK/W17IvFqp+nSWPvycDjtcHmx7TkULW5SmPNi1NE/1Q/ZO6PIayWYujckzlsuuDgrEJ kWvg== X-Gm-Message-State: ACgBeo05VJZkr5n8ME6VoEk/llQjEefRk3k1r3oJdPGODgeKzQlf3LhH 9r5laF03wG7DcBPbJqUlTC8ZtIjITNyAuS6klJsf7L2WjZYzRRAh4Rv77nNvuTJMCfh1gjy9M6z Y+UgX2jq/4gMehHeGJIGleC+vLGnaz4/aSFUpjAoZ1VznEgbMNPXUCAJZEn4/8EJjnz4= X-Received: by 2002:a05:600c:2747:b0:3b4:708a:f66a with SMTP id 7-20020a05600c274700b003b4708af66amr19095651wmw.146.1663608912876; Mon, 19 Sep 2022 10:35:12 -0700 (PDT) X-Google-Smtp-Source: AA6agR5fPA2CNizkR9uiE8UVQseJuQs0nbtBxt1CT8aCxENN2h2XIxpeueiwtg4OLnHhGNaHbZ0foA== X-Received: by 2002:a05:600c:2747:b0:3b4:708a:f66a with SMTP id 7-20020a05600c274700b003b4708af66amr19095633wmw.146.1663608912492; Mon, 19 Sep 2022 10:35:12 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 13/21] tests/tcg: refine MMX support in SSE tests Date: Mon, 19 Sep 2022 19:34:41 +0200 Message-Id: <20220919173449.5864-14-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220919173449.5864-1-pbonzini@redhat.com> References: <20220919173449.5864-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1663610074726100001 Content-Type: text/plain; charset="utf-8" Extend the support to memory operands, and skip MMX instructions that were introduced in SSE times, because they are now covered in test-mmx. Signed-off-by: Paolo Bonzini --- tests/tcg/i386/test-avx.py | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/tests/tcg/i386/test-avx.py b/tests/tcg/i386/test-avx.py index 2516c66445..e16a3d8bee 100755 --- a/tests/tcg/i386/test-avx.py +++ b/tests/tcg/i386/test-avx.py @@ -103,7 +103,11 @@ def regstr(self, n): =20 class MMArg(): isxmm =3D True - ismem =3D False # TODO + def __init__(self, mw): + if mw not in [0, 32, 64]: + raise Exception("Bad mem width: %s" % mw) + self.mw =3D mw + self.ismem =3D mw !=3D 0 def regstr(self, n): return "mm%d" % (n & 7) =20 @@ -169,6 +173,9 @@ def __init__(self, w): def regstr(self, n): return mem_w(self.w) =20 +class SkipInstruction(Exception): + pass + def ArgGenerator(arg, op): if arg[:3] =3D=3D 'xmm' or arg[:3] =3D=3D "ymm": if "/" in arg: @@ -179,7 +186,13 @@ def ArgGenerator(arg, op): else: return XMMArg(arg[0], 0); elif arg[:2] =3D=3D 'mm': - return MMArg(); + if "/" in arg: + r, m =3D arg.split('/') + if (m[0] !=3D 'm'): + raise Exception("Expected /m: %s", arg) + return MMArg(int(m[1:])); + else: + return MMArg(0); elif arg[:4] =3D=3D 'imm8': return ArgImm8u(op); elif arg =3D=3D '': @@ -217,8 +230,12 @@ def __init__(self, op, args): =20 try: self.args =3D list(ArgGenerator(a, op) for a in args) + if not any((x.isxmm for x in self.args)): + raise SkipInstruction if len(self.args) > 0 and self.args[-1] is None: self.args =3D self.args[:-1] + except SkipInstruction: + raise except Exception as e: raise Exception("Bad arg %s: %s" % (op, e)) =20 @@ -339,10 +356,13 @@ def main(): continue cpuid =3D row[6] if cpuid in archs: - g =3D InsnGenerator(insn[0], insn[1:]) - for insn in g.gen(): - outf.write('TEST(%d, "%s", %s)\n' % (n, insn, g.optype= )) - n +=3D 1 + try: + g =3D InsnGenerator(insn[0], insn[1:]) + for insn in g.gen(): + outf.write('TEST(%d, "%s", %s)\n' % (n, insn, g.op= type)) + n +=3D 1 + except SkipInstruction: + pass outf.write("#undef TEST\n") csvfile.close() =20 --=20 2.37.2 From nobody Fri Dec 19 17:34:22 2025 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=1663610249; cv=none; d=zohomail.com; s=zohoarc; b=BztPXCVQaPLhlmv/oPAPhOOAUtB7V20rQM9yDw4jUyMOKaq3kiVTAQOMsBiKY+XgV/fSaoWEY57IlSm26hZPjzlp7qp8SeHfazcnLmvuIpPp/yKofk0dhGF/+7M/61lyEyYPwYuei2wykYf3cmujNDyby/jXtspRlAPVQW11lDg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663610249; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=0QutVkQWh3O0i0W03jJrxQ1aHn2WdaciPl0ofdtkKFo=; b=TOIHa5L9wKCed8vmcrCr7H9S6rSMZldtVyQQg9tRqik6k3/Vb6nXLBYe/FqPl16r9rO8UKL7ZQ1rwHuizZk/wolyTah2RB+DRqM6G+Ybn7fJAeVYNZPx/h09yTrjLCnQ831iF5QhXI8QV947GkBV1RmpvRIp+uzZeEd7R7QEWxk= 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 1663610249010644.6641065629736; Mon, 19 Sep 2022 10:57:29 -0700 (PDT) Received: from localhost ([::1]:55262 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaL1K-0004Fx-N8 for importer@patchew.org; Mon, 19 Sep 2022 13:57:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39370) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKg8-0003Jx-BL for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:43155) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKfu-000370-05 for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:31 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-201-DiNN3uTRPTSsSIb-3OqeWQ-1; Mon, 19 Sep 2022 13:35:16 -0400 Received: by mail-wm1-f71.google.com with SMTP id o25-20020a05600c339900b003b2973dab88so15447598wmp.6 for ; Mon, 19 Sep 2022 10:35:15 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id x12-20020a05600c2d0c00b003b47575d304sm17613610wmf.32.2022.09.19.10.35.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 10:35:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663608917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0QutVkQWh3O0i0W03jJrxQ1aHn2WdaciPl0ofdtkKFo=; b=Ua441j8Ij5CtG0n1V6+GQEG0ZPJb8KN0sfhRkBvt+QCS2IQHJkxVvBWvrtWGLxhhor+nT0 Nc1CvtBjmZXegAyrqD+mPyGJ7wl81bfgN+jadEoLtJuIqILmD2M37ddwQ/jbIlLu1rSNxe 8/kH9m12bKxSPwVs8N0uNlnNoP+MuLg= X-MC-Unique: DiNN3uTRPTSsSIb-3OqeWQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date; bh=0QutVkQWh3O0i0W03jJrxQ1aHn2WdaciPl0ofdtkKFo=; b=P+5xD2Q2ZNGvCVxFQRvQ5634AXT8W4ZWAp6FtvLePpLfPy/k8Zq2NwqI088Q2Q15s2 FuY5K7AyLRSC6Bn3rKD49BSxEEXDZu875Tf52Lok+D425HCm/whwCVZdrMKqD0LK+Ydz MrqnjXkLFPEMR3lvVyDwIJpmSkdxx7hUfP1f7bdBSEi8ZMyANRPvlITNhbHELWH1/ZaE NpzhDhVkU6A1NNEVoAFcB7FnTwhgHWfhmei9uL3+dR7Jl6/nxam0R13ZjNzrL5WEYE5J 2V5qYP8+KcQwqXUqlv6Pr0Pu6geffcPV8WdasGZwaVhuEgy6pFyqINpC/CuXkFENJMcb w7lQ== X-Gm-Message-State: ACrzQf0zD8w1EFesUdlJU1lA5cXkrqrNG7ym8YLXTtUGdstMnMZmledW IJ9KTcNzf2FC9wOKaudM8gFoT1xywGmg/EEg/LI2N7cTJ58/S1TZhlLSeFXg3FjMTRXx71uro9X aUK5hMTiv/2OUHewzFFGkiejWcgCNLT1S289PX/18AUfdueaMeByfFLbYtypdByc2sAs= X-Received: by 2002:a5d:4ecd:0:b0:22a:42ec:8d74 with SMTP id s13-20020a5d4ecd000000b0022a42ec8d74mr11959309wrv.359.1663608914206; Mon, 19 Sep 2022 10:35:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5/uXyC/FmZrJTzNfOl61gRX7EwXiKf7K4sOrsLZaTMVKLssEWbXJDBMuzWhAfFlg8zCqKvFw== X-Received: by 2002:a5d:4ecd:0:b0:22a:42ec:8d74 with SMTP id s13-20020a5d4ecd000000b0022a42ec8d74mr11959282wrv.359.1663608913630; Mon, 19 Sep 2022 10:35:13 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 14/21] tests/tcg: remove old SSE tests Date: Mon, 19 Sep 2022 19:34:42 +0200 Message-Id: <20220919173449.5864-15-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220919173449.5864-1-pbonzini@redhat.com> References: <20220919173449.5864-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1663610250006100001 Content-Type: text/plain; charset="utf-8" The new testsuite is much more comprehensive, so remove the old one; it is also buggy (the pinsrw test uses incorrect constraints, with =3D instead of +, and the golden output for the fxsave tests differs depending on how the C library uses SSE and AVX instructions). Signed-off-by: Paolo Bonzini --- tests/tcg/i386/test-i386.c | 573 ------------------------------------- 1 file changed, 573 deletions(-) diff --git a/tests/tcg/i386/test-i386.c b/tests/tcg/i386/test-i386.c index e6b308a2c0..864c4e620d 100644 --- a/tests/tcg/i386/test-i386.c +++ b/tests/tcg/i386/test-i386.c @@ -34,15 +34,8 @@ #endif //#define LINUX_VM86_IOPL_FIX //#define TEST_P4_FLAGS -#ifdef __SSE__ -#define TEST_SSE #define TEST_CMOV 1 #define TEST_FCOMI 1 -#else -#undef TEST_SSE -#define TEST_CMOV 1 -#define TEST_FCOMI 1 -#endif =20 #if defined(__x86_64__) #define FMT64X "%016lx" @@ -2104,568 +2097,6 @@ static void test_enter(void) TEST_ENTER("w", uint16_t, 31); } =20 -#ifdef TEST_SSE - -typedef int __m64 __attribute__ ((vector_size(8))); -typedef float __m128 __attribute__ ((vector_size(16))); - -typedef union { - double d[2]; - float s[4]; - uint32_t l[4]; - uint64_t q[2]; - __m128 dq; -} XMMReg; - -static uint64_t __attribute__((aligned(16))) test_values[4][2] =3D { - { 0x456723c698694873, 0xdc515cff944a58ec }, - { 0x1f297ccd58bad7ab, 0x41f21efba9e3e146 }, - { 0x007c62c2085427f8, 0x231be9e8cde7438d }, - { 0x0f76255a085427f8, 0xc233e9e8c4c9439a }, -}; - -#define SSE_OP(op)\ -{\ - asm volatile (#op " %2, %0" : "=3Dx" (r.dq) : "0" (a.dq), "x" (b.dq));\ - printf("%-9s: a=3D" FMT64X "" FMT64X " b=3D" FMT64X "" FMT64X " r=3D" = FMT64X "" FMT64X "\n",\ - #op,\ - a.q[1], a.q[0],\ - b.q[1], b.q[0],\ - r.q[1], r.q[0]);\ -} - -#define SSE_OP2(op)\ -{\ - int i;\ - for(i=3D0;i<2;i++) {\ - a.q[0] =3D test_values[2*i][0];\ - a.q[1] =3D test_values[2*i][1];\ - b.q[0] =3D test_values[2*i+1][0];\ - b.q[1] =3D test_values[2*i+1][1];\ - SSE_OP(op);\ - }\ -} - -#define MMX_OP2(op)\ -{\ - int i;\ - for(i=3D0;i<2;i++) {\ - a.q[0] =3D test_values[2*i][0];\ - b.q[0] =3D test_values[2*i+1][0];\ - asm volatile (#op " %2, %0" : "=3Dy" (r.q[0]) : "0" (a.q[0]), "y" (b.q= [0]));\ - printf("%-9s: a=3D" FMT64X " b=3D" FMT64X " r=3D" FMT64X "\n",\ - #op,\ - a.q[0],\ - b.q[0],\ - r.q[0]);\ - }\ - SSE_OP2(op);\ -} - -#define SHUF_OP(op, ib)\ -{\ - a.q[0] =3D test_values[0][0];\ - a.q[1] =3D test_values[0][1];\ - b.q[0] =3D test_values[1][0];\ - b.q[1] =3D test_values[1][1];\ - asm volatile (#op " $" #ib ", %2, %0" : "=3Dx" (r.dq) : "0" (a.dq), "x= " (b.dq));\ - printf("%-9s: a=3D" FMT64X "" FMT64X " b=3D" FMT64X "" FMT64X " ib=3D%= 02x r=3D" FMT64X "" FMT64X "\n",\ - #op,\ - a.q[1], a.q[0],\ - b.q[1], b.q[0],\ - ib,\ - r.q[1], r.q[0]);\ -} - -#define PSHUF_OP(op, ib)\ -{\ - int i;\ - for(i=3D0;i<2;i++) {\ - a.q[0] =3D test_values[2*i][0];\ - a.q[1] =3D test_values[2*i][1];\ - asm volatile (#op " $" #ib ", %1, %0" : "=3Dx" (r.dq) : "x" (a.dq));\ - printf("%-9s: a=3D" FMT64X "" FMT64X " ib=3D%02x r=3D" FMT64X "" FMT64= X "\n",\ - #op,\ - a.q[1], a.q[0],\ - ib,\ - r.q[1], r.q[0]);\ - }\ -} - -#define SHIFT_IM(op, ib)\ -{\ - int i;\ - for(i=3D0;i<2;i++) {\ - a.q[0] =3D test_values[2*i][0];\ - a.q[1] =3D test_values[2*i][1];\ - asm volatile (#op " $" #ib ", %0" : "=3Dx" (r.dq) : "0" (a.dq));\ - printf("%-9s: a=3D" FMT64X "" FMT64X " ib=3D%02x r=3D" FMT64X "" FMT64= X "\n",\ - #op,\ - a.q[1], a.q[0],\ - ib,\ - r.q[1], r.q[0]);\ - }\ -} - -#define SHIFT_OP(op, ib)\ -{\ - int i;\ - SHIFT_IM(op, ib);\ - for(i=3D0;i<2;i++) {\ - a.q[0] =3D test_values[2*i][0];\ - a.q[1] =3D test_values[2*i][1];\ - b.q[0] =3D ib;\ - b.q[1] =3D 0;\ - asm volatile (#op " %2, %0" : "=3Dx" (r.dq) : "0" (a.dq), "x" (b.dq));\ - printf("%-9s: a=3D" FMT64X "" FMT64X " b=3D" FMT64X "" FMT64X " r=3D" = FMT64X "" FMT64X "\n",\ - #op,\ - a.q[1], a.q[0],\ - b.q[1], b.q[0],\ - r.q[1], r.q[0]);\ - }\ -} - -#define MOVMSK(op)\ -{\ - int i, reg;\ - for(i=3D0;i<2;i++) {\ - a.q[0] =3D test_values[2*i][0];\ - a.q[1] =3D test_values[2*i][1];\ - asm volatile (#op " %1, %0" : "=3Dr" (reg) : "x" (a.dq));\ - printf("%-9s: a=3D" FMT64X "" FMT64X " r=3D%08x\n",\ - #op,\ - a.q[1], a.q[0],\ - reg);\ - }\ -} - -#define SSE_OPS(a) \ -SSE_OP(a ## ps);\ -SSE_OP(a ## ss); - -#define SSE_OPD(a) \ -SSE_OP(a ## pd);\ -SSE_OP(a ## sd); - -#define SSE_COMI(op, field)\ -{\ - unsigned long eflags;\ - XMMReg a, b;\ - a.field[0] =3D a1;\ - b.field[0] =3D b1;\ - asm volatile (#op " %2, %1\n"\ - "pushf\n"\ - "pop %0\n"\ - : "=3Drm" (eflags)\ - : "x" (a.dq), "x" (b.dq));\ - printf("%-9s: a=3D%f b=3D%f cc=3D%04lx\n",\ - #op, a1, b1,\ - eflags & (CC_C | CC_P | CC_Z | CC_S | CC_O | CC_A));\ -} - -void test_sse_comi(double a1, double b1) -{ - SSE_COMI(ucomiss, s); - SSE_COMI(ucomisd, d); - SSE_COMI(comiss, s); - SSE_COMI(comisd, d); -} - -#define CVT_OP_XMM(op)\ -{\ - asm volatile (#op " %1, %0" : "=3Dx" (r.dq) : "x" (a.dq));\ - printf("%-9s: a=3D" FMT64X "" FMT64X " r=3D" FMT64X "" FMT64X "\n",\ - #op,\ - a.q[1], a.q[0],\ - r.q[1], r.q[0]);\ -} - -/* Force %xmm0 usage to avoid the case where both register index are 0 - to test instruction decoding more extensively */ -#define CVT_OP_XMM2MMX(op)\ -{\ - asm volatile (#op " %1, %0" : "=3Dy" (r.q[0]) : "x" (a.dq) \ - : "%xmm0"); \ - asm volatile("emms\n"); \ - printf("%-9s: a=3D" FMT64X "" FMT64X " r=3D" FMT64X "\n",\ - #op,\ - a.q[1], a.q[0],\ - r.q[0]);\ -} - -#define CVT_OP_MMX2XMM(op)\ -{\ - asm volatile (#op " %1, %0" : "=3Dx" (r.dq) : "y" (a.q[0]));\ - asm volatile("emms\n"); \ - printf("%-9s: a=3D" FMT64X " r=3D" FMT64X "" FMT64X "\n",\ - #op,\ - a.q[0],\ - r.q[1], r.q[0]);\ -} - -#define CVT_OP_REG2XMM(op)\ -{\ - asm volatile (#op " %1, %0" : "=3Dx" (r.dq) : "r" (a.l[0]));\ - printf("%-9s: a=3D%08x r=3D" FMT64X "" FMT64X "\n",\ - #op,\ - a.l[0],\ - r.q[1], r.q[0]);\ -} - -#define CVT_OP_XMM2REG(op)\ -{\ - asm volatile (#op " %1, %0" : "=3Dr" (r.l[0]) : "x" (a.dq));\ - printf("%-9s: a=3D" FMT64X "" FMT64X " r=3D%08x\n",\ - #op,\ - a.q[1], a.q[0],\ - r.l[0]);\ -} - -struct fpxstate { - uint16_t fpuc; - uint16_t fpus; - uint16_t fptag; - uint16_t fop; - uint32_t fpuip; - uint16_t cs_sel; - uint16_t dummy0; - uint32_t fpudp; - uint16_t ds_sel; - uint16_t dummy1; - uint32_t mxcsr; - uint32_t mxcsr_mask; - uint8_t fpregs1[8 * 16]; - uint8_t xmm_regs[8 * 16]; - uint8_t dummy2[224]; -}; - -static struct fpxstate fpx_state __attribute__((aligned(16))); -static struct fpxstate fpx_state2 __attribute__((aligned(16))); - -void test_fxsave(void) -{ - struct fpxstate *fp =3D &fpx_state; - struct fpxstate *fp2 =3D &fpx_state2; - int i, nb_xmm; - XMMReg a, b; - a.q[0] =3D test_values[0][0]; - a.q[1] =3D test_values[0][1]; - b.q[0] =3D test_values[1][0]; - b.q[1] =3D test_values[1][1]; - - asm("movdqa %2, %%xmm0\n" - "movdqa %3, %%xmm7\n" -#if defined(__x86_64__) - "movdqa %2, %%xmm15\n" -#endif - " fld1\n" - " fldpi\n" - " fldln2\n" - " fxsave %0\n" - " fxrstor %0\n" - " fxsave %1\n" - " fninit\n" - : "=3Dm" (*(uint32_t *)fp2), "=3Dm" (*(uint32_t *)fp) - : "m" (a), "m" (b)); - printf("fpuc=3D%04x\n", fp->fpuc); - printf("fpus=3D%04x\n", fp->fpus); - printf("fptag=3D%04x\n", fp->fptag); - for(i =3D 0; i < 3; i++) { - printf("ST%d: " FMT64X " %04x\n", - i, - *(uint64_t *)&fp->fpregs1[i * 16], - *(uint16_t *)&fp->fpregs1[i * 16 + 8]); - } - printf("mxcsr=3D%08x\n", fp->mxcsr & 0x1f80); -#if defined(__x86_64__) - nb_xmm =3D 16; -#else - nb_xmm =3D 8; -#endif - for(i =3D 0; i < nb_xmm; i++) { - printf("xmm%d: " FMT64X "" FMT64X "\n", - i, - *(uint64_t *)&fp->xmm_regs[i * 16], - *(uint64_t *)&fp->xmm_regs[i * 16 + 8]); - } -} - -void test_sse(void) -{ - XMMReg r, a, b; - int i; - - MMX_OP2(punpcklbw); - MMX_OP2(punpcklwd); - MMX_OP2(punpckldq); - MMX_OP2(packsswb); - MMX_OP2(pcmpgtb); - MMX_OP2(pcmpgtw); - MMX_OP2(pcmpgtd); - MMX_OP2(packuswb); - MMX_OP2(punpckhbw); - MMX_OP2(punpckhwd); - MMX_OP2(punpckhdq); - MMX_OP2(packssdw); - MMX_OP2(pcmpeqb); - MMX_OP2(pcmpeqw); - MMX_OP2(pcmpeqd); - - MMX_OP2(paddq); - MMX_OP2(pmullw); - MMX_OP2(psubusb); - MMX_OP2(psubusw); - MMX_OP2(pminub); - MMX_OP2(pand); - MMX_OP2(paddusb); - MMX_OP2(paddusw); - MMX_OP2(pmaxub); - MMX_OP2(pandn); - - MMX_OP2(pmulhuw); - MMX_OP2(pmulhw); - - MMX_OP2(psubsb); - MMX_OP2(psubsw); - MMX_OP2(pminsw); - MMX_OP2(por); - MMX_OP2(paddsb); - MMX_OP2(paddsw); - MMX_OP2(pmaxsw); - MMX_OP2(pxor); - MMX_OP2(pmuludq); - MMX_OP2(pmaddwd); - MMX_OP2(psadbw); - MMX_OP2(psubb); - MMX_OP2(psubw); - MMX_OP2(psubd); - MMX_OP2(psubq); - MMX_OP2(paddb); - MMX_OP2(paddw); - MMX_OP2(paddd); - - MMX_OP2(pavgb); - MMX_OP2(pavgw); - - asm volatile ("pinsrw $1, %1, %0" : "=3Dy" (r.q[0]) : "r" (0x12345678)= ); - printf("%-9s: r=3D" FMT64X "\n", "pinsrw", r.q[0]); - - asm volatile ("pinsrw $5, %1, %0" : "=3Dx" (r.dq) : "r" (0x12345678)); - printf("%-9s: r=3D" FMT64X "" FMT64X "\n", "pinsrw", r.q[1], r.q[0]); - - a.q[0] =3D test_values[0][0]; - a.q[1] =3D test_values[0][1]; - asm volatile ("pextrw $1, %1, %0" : "=3Dr" (r.l[0]) : "y" (a.q[0])); - printf("%-9s: r=3D%08x\n", "pextrw", r.l[0]); - - asm volatile ("pextrw $5, %1, %0" : "=3Dr" (r.l[0]) : "x" (a.dq)); - printf("%-9s: r=3D%08x\n", "pextrw", r.l[0]); - - asm volatile ("pmovmskb %1, %0" : "=3Dr" (r.l[0]) : "y" (a.q[0])); - printf("%-9s: r=3D%08x\n", "pmovmskb", r.l[0]); - - asm volatile ("pmovmskb %1, %0" : "=3Dr" (r.l[0]) : "x" (a.dq)); - printf("%-9s: r=3D%08x\n", "pmovmskb", r.l[0]); - - { - r.q[0] =3D -1; - r.q[1] =3D -1; - - a.q[0] =3D test_values[0][0]; - a.q[1] =3D test_values[0][1]; - b.q[0] =3D test_values[1][0]; - b.q[1] =3D test_values[1][1]; - asm volatile("maskmovq %1, %0" : - : "y" (a.q[0]), "y" (b.q[0]), "D" (&r) - : "memory"); - printf("%-9s: r=3D" FMT64X " a=3D" FMT64X " b=3D" FMT64X "\n", - "maskmov", - r.q[0], - a.q[0], - b.q[0]); - asm volatile("maskmovdqu %1, %0" : - : "x" (a.dq), "x" (b.dq), "D" (&r) - : "memory"); - printf("%-9s: r=3D" FMT64X "" FMT64X " a=3D" FMT64X "" FMT64X " b= =3D" FMT64X "" FMT64X "\n", - "maskmov", - r.q[1], r.q[0], - a.q[1], a.q[0], - b.q[1], b.q[0]); - } - - asm volatile ("emms"); - - SSE_OP2(punpcklqdq); - SSE_OP2(punpckhqdq); - SSE_OP2(andps); - SSE_OP2(andpd); - SSE_OP2(andnps); - SSE_OP2(andnpd); - SSE_OP2(orps); - SSE_OP2(orpd); - SSE_OP2(xorps); - SSE_OP2(xorpd); - - SSE_OP2(unpcklps); - SSE_OP2(unpcklpd); - SSE_OP2(unpckhps); - SSE_OP2(unpckhpd); - - SHUF_OP(shufps, 0x78); - SHUF_OP(shufpd, 0x02); - - PSHUF_OP(pshufd, 0x78); - PSHUF_OP(pshuflw, 0x78); - PSHUF_OP(pshufhw, 0x78); - - SHIFT_OP(psrlw, 7); - SHIFT_OP(psrlw, 16); - SHIFT_OP(psraw, 7); - SHIFT_OP(psraw, 16); - SHIFT_OP(psllw, 7); - SHIFT_OP(psllw, 16); - - SHIFT_OP(psrld, 7); - SHIFT_OP(psrld, 32); - SHIFT_OP(psrad, 7); - SHIFT_OP(psrad, 32); - SHIFT_OP(pslld, 7); - SHIFT_OP(pslld, 32); - - SHIFT_OP(psrlq, 7); - SHIFT_OP(psrlq, 32); - SHIFT_OP(psllq, 7); - SHIFT_OP(psllq, 32); - - SHIFT_IM(psrldq, 16); - SHIFT_IM(psrldq, 7); - SHIFT_IM(pslldq, 16); - SHIFT_IM(pslldq, 7); - - MOVMSK(movmskps); - MOVMSK(movmskpd); - - /* FPU specific ops */ - - { - uint32_t mxcsr; - asm volatile("stmxcsr %0" : "=3Dm" (mxcsr)); - printf("mxcsr=3D%08x\n", mxcsr & 0x1f80); - asm volatile("ldmxcsr %0" : : "m" (mxcsr)); - } - - test_sse_comi(2, -1); - test_sse_comi(2, 2); - test_sse_comi(2, 3); - test_sse_comi(2, q_nan.d); - test_sse_comi(q_nan.d, -1); - - for(i =3D 0; i < 2; i++) { - a.s[0] =3D 2.7; - a.s[1] =3D 3.4; - a.s[2] =3D 4; - a.s[3] =3D -6.3; - b.s[0] =3D 45.7; - b.s[1] =3D 353.4; - b.s[2] =3D 4; - b.s[3] =3D 56.3; - if (i =3D=3D 1) { - a.s[0] =3D q_nan.d; - b.s[3] =3D q_nan.d; - } - - SSE_OPS(add); - SSE_OPS(mul); - SSE_OPS(sub); - SSE_OPS(min); - SSE_OPS(div); - SSE_OPS(max); - SSE_OPS(sqrt); - SSE_OPS(cmpeq); - SSE_OPS(cmplt); - SSE_OPS(cmple); - SSE_OPS(cmpunord); - SSE_OPS(cmpneq); - SSE_OPS(cmpnlt); - SSE_OPS(cmpnle); - SSE_OPS(cmpord); - - - a.d[0] =3D 2.7; - a.d[1] =3D -3.4; - b.d[0] =3D 45.7; - b.d[1] =3D -53.4; - if (i =3D=3D 1) { - a.d[0] =3D q_nan.d; - b.d[1] =3D q_nan.d; - } - SSE_OPD(add); - SSE_OPD(mul); - SSE_OPD(sub); - SSE_OPD(min); - SSE_OPD(div); - SSE_OPD(max); - SSE_OPD(sqrt); - SSE_OPD(cmpeq); - SSE_OPD(cmplt); - SSE_OPD(cmple); - SSE_OPD(cmpunord); - SSE_OPD(cmpneq); - SSE_OPD(cmpnlt); - SSE_OPD(cmpnle); - SSE_OPD(cmpord); - } - - /* float to float/int */ - a.s[0] =3D 2.7; - a.s[1] =3D 3.4; - a.s[2] =3D 4; - a.s[3] =3D -6.3; - CVT_OP_XMM(cvtps2pd); - CVT_OP_XMM(cvtss2sd); - CVT_OP_XMM2MMX(cvtps2pi); - CVT_OP_XMM2MMX(cvttps2pi); - CVT_OP_XMM2REG(cvtss2si); - CVT_OP_XMM2REG(cvttss2si); - CVT_OP_XMM(cvtps2dq); - CVT_OP_XMM(cvttps2dq); - - a.d[0] =3D 2.6; - a.d[1] =3D -3.4; - CVT_OP_XMM(cvtpd2ps); - CVT_OP_XMM(cvtsd2ss); - CVT_OP_XMM2MMX(cvtpd2pi); - CVT_OP_XMM2MMX(cvttpd2pi); - CVT_OP_XMM2REG(cvtsd2si); - CVT_OP_XMM2REG(cvttsd2si); - CVT_OP_XMM(cvtpd2dq); - CVT_OP_XMM(cvttpd2dq); - - /* sse/mmx moves */ - CVT_OP_XMM2MMX(movdq2q); - CVT_OP_MMX2XMM(movq2dq); - - /* int to float */ - a.l[0] =3D -6; - a.l[1] =3D 2; - a.l[2] =3D 100; - a.l[3] =3D -60000; - CVT_OP_MMX2XMM(cvtpi2ps); - CVT_OP_MMX2XMM(cvtpi2pd); - CVT_OP_REG2XMM(cvtsi2ss); - CVT_OP_REG2XMM(cvtsi2sd); - CVT_OP_XMM(cvtdq2ps); - CVT_OP_XMM(cvtdq2pd); - - /* XXX: test PNI insns */ -#if 0 - SSE_OP2(movshdup); -#endif - asm volatile ("emms"); -} - -#endif - #define TEST_CONV_RAX(op)\ {\ unsigned long a, r;\ @@ -2756,9 +2187,5 @@ int main(int argc, char **argv) #endif test_enter(); test_conv(); -#ifdef TEST_SSE - test_sse(); - test_fxsave(); -#endif return 0; } --=20 2.37.2 From nobody Fri Dec 19 17:34:22 2025 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=1663611312; cv=none; d=zohomail.com; s=zohoarc; b=P47hi65VxzCLGMC6LakzzX1u9XSvj7c9yYdkfLIzu2XSZWUZF+fDI0UVBmK9UdW/+bfRaazYzzoSAyJXnOdVcazvrxkfBhA46f2oujjLIp3TmGFz/J61uO15giiIOEYy1NPM6Zci+dfXz3EK5mBC3jVRX5BUQ2KYIzT6Pffj0Rc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663611312; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YBFJC4GsVk5U+mTF4QZd85zy3mdtZbBJHBFi0S5+/GY=; b=BnIE+psHe1vs0vd0z62K7XkhLWBfNrue0FmzyXQgJ0FHVtz7Pp0/IwLPj+vHJQzPzbJrPf52pOlySR53tTUAmNJGFPFXpCzopEGS1LokTneBJRqUU7EXI2KM5bIwgr6aXi7gDsAmqKR0I+EGYpmVsNFx/z0jGGFNHTrVjtWY/qk= 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 1663611312729761.8505085572483; Mon, 19 Sep 2022 11:15:12 -0700 (PDT) Received: from localhost ([::1]:37392 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaLIU-0003Jo-Ju for importer@patchew.org; Mon, 19 Sep 2022 14:15:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39368) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKg7-0003Ip-PJ for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:32 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:50469) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKfu-00037J-Lp for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:31 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-121-l8sjgnoLMpes2wzdkebgYg-1; Mon, 19 Sep 2022 13:35:16 -0400 Received: by mail-wm1-f72.google.com with SMTP id h4-20020a1c2104000000b003b334af7d50so4964508wmh.3 for ; Mon, 19 Sep 2022 10:35:16 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id e7-20020adfa747000000b0022878c0cc5esm14170554wrd.69.2022.09.19.10.35.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 10:35:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663608918; 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=YBFJC4GsVk5U+mTF4QZd85zy3mdtZbBJHBFi0S5+/GY=; b=eRqaBpXjAVx5Dh4pv2SN/H4VlpCEmcqdCt5LmyOsyJuWTpg5F7T2999jkY+iMoZpkpm6Pj QjVphAStMbYMhsl6Mt2e44zjXimldu29AAeGqmI+kQDvatqQnqs8LOp85pq+qc3iZbEm+w sBlpeItTfkjpx/oaTecz4w59qhC0fL8= X-MC-Unique: l8sjgnoLMpes2wzdkebgYg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=YBFJC4GsVk5U+mTF4QZd85zy3mdtZbBJHBFi0S5+/GY=; b=LnBXfSJoSFgvdAenrH7qJOXA/JhHZ9d+DOg+NQM7m8DCvMI03GdMc33vAe/W4hf0MZ aNDDjyCkEPqzDvW5Vxsuih5klRJDbu+/LHMKZE27eVie/L9q9IXcs/AJLtOeMFaD0INh +6+WDOXnYkI0hAL1eW2HtGHKE+lQUGv78IAteHIBKzf5dzCKvyOUAK6yk5EPdU6Xt14X L+puAnmzGcH98HqN67v4xoERVoSlo6P74ooxEUNvE0p0SgyI3T5dm+aBr+H8GNJhEPHC wJTnbAw1SZfdXF1X0EbIyeJtE2eNJKuP1VGaF092CdmPCLTUaut6IkaMA1tmrXg9DaYG FmBQ== X-Gm-Message-State: ACrzQf1lprzEbmZoYcKurZO+eR5gbDEjTX4A8r/XX9N96n1VwkIG59ul 0ytM9IwABly9Tok8U9O2E00yyXCVCOtwBIYq51T5MDdPojVbQYsPhvQpzg81M3O44F4cEsARxZO EopZhfk8gBj3zWCjKbOfmciCBSKTVl6Hgr8kTn7TexvyBR15kLmSJj8vTG8rJGAXTT9A= X-Received: by 2002:adf:fa81:0:b0:224:f260:2523 with SMTP id h1-20020adffa81000000b00224f2602523mr11306269wrr.26.1663608915126; Mon, 19 Sep 2022 10:35:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4gjJ/xGHFbDh/CrnlqPl3ShjYoh06fmrc1jbBbycGSXz1leXbu9BHIhqXf+k+v+WRtwyGTHg== X-Received: by 2002:adf:fa81:0:b0:224:f260:2523 with SMTP id h1-20020adffa81000000b00224f2602523mr11306254wrr.26.1663608914741; Mon, 19 Sep 2022 10:35:14 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Claudio Fontana Subject: [PULL 15/21] audio: add help option for -audio and -audiodev Date: Mon, 19 Sep 2022 19:34:43 +0200 Message-Id: <20220919173449.5864-16-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220919173449.5864-1-pbonzini@redhat.com> References: <20220919173449.5864-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1663611313773100001 Content-Type: text/plain; charset="utf-8" From: Claudio Fontana add a simple help option for -audio and -audiodev to show the list of available drivers, and document them. Signed-off-by: Claudio Fontana Message-Id: <20220908081441.7111-1-cfontana@suse.de> Signed-off-by: Paolo Bonzini --- audio/audio.c | 19 +++++++++++++++++++ audio/audio.h | 1 + qemu-options.hx | 10 ++++++---- softmmu/vl.c | 9 +++++++-- 4 files changed, 33 insertions(+), 6 deletions(-) diff --git a/audio/audio.c b/audio/audio.c index 76b8735b44..cfa4119c05 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -32,6 +32,7 @@ #include "qapi/qapi-visit-audio.h" #include "qemu/cutils.h" #include "qemu/module.h" +#include "qemu/help_option.h" #include "sysemu/sysemu.h" #include "sysemu/replay.h" #include "sysemu/runstate.h" @@ -2101,10 +2102,28 @@ static void audio_validate_opts(Audiodev *dev, Erro= r **errp) } } =20 +void audio_help(void) +{ + int i; + + printf("Available audio drivers:\n"); + + for (i =3D 0; i < AUDIODEV_DRIVER__MAX; i++) { + audio_driver *driver =3D audio_driver_lookup(AudiodevDriver_str(i)= ); + if (driver) { + printf("%s\n", driver->name); + } + } +} + void audio_parse_option(const char *opt) { Audiodev *dev =3D NULL; =20 + if (is_help_option(opt)) { + audio_help(); + exit(EXIT_SUCCESS); + } Visitor *v =3D qobject_input_visitor_new_str(opt, "driver", &error_fat= al); visit_type_Audiodev(v, NULL, &dev, &error_fatal); visit_free(v); diff --git a/audio/audio.h b/audio/audio.h index 27e67079a0..01bdc567fb 100644 --- a/audio/audio.h +++ b/audio/audio.h @@ -171,6 +171,7 @@ void audio_sample_from_uint64(void *samples, int pos, void audio_define(Audiodev *audio); void audio_parse_option(const char *opt); bool audio_init_audiodevs(void); +void audio_help(void); void audio_legacy_help(void); =20 AudioState *audio_state_by_name(const char *name); diff --git a/qemu-options.hx b/qemu-options.hx index 1bb02363ab..d8b5ce5b43 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -704,10 +704,11 @@ SRST ``-audio [driver=3D]driver,model=3Dvalue[,prop[=3Dvalue][,...]]`` This option is a shortcut for configuring both the guest audio hardware and the host audio backend in one go. - The host backend options are the same as with the corresponding - ``-audiodev`` options below. The guest hardware model can be set with - ``model=3Dmodelname``. Use ``model=3Dhelp`` to list the available devi= ce - types. + The driver option is the same as with the corresponding ``-audiodev`` = option below. + The guest hardware model can be set with ``model=3Dmodelname``. + + Use ``driver=3Dhelp`` to list the available drivers, + and ``model=3Dhelp`` to list the available device types. =20 The following two example do exactly the same, to show how ``-audio`` can be used to shorten the command line length: @@ -721,6 +722,7 @@ ERST DEF("audiodev", HAS_ARG, QEMU_OPTION_audiodev, "-audiodev [driver=3D]driver,id=3Did[,prop[=3Dvalue][,...]]\n" " specifies the audio backend to use\n" + " Use ``-audiodev help`` to list the available drivers\= n" " id=3D identifier of the backend\n" " timer-period=3D timer period in microseconds\n" " in|out.mixing-engine=3D use mixing engine to mix stre= ams inside QEMU\n" diff --git a/softmmu/vl.c b/softmmu/vl.c index 263f029a8e..e62b9cc35d 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -2842,11 +2842,16 @@ void qemu_init(int argc, char **argv, char **envp) audio_parse_option(optarg); break; case QEMU_OPTION_audio: { - QDict *dict =3D keyval_parse(optarg, "driver", NULL, &erro= r_fatal); + bool help; char *model; Audiodev *dev =3D NULL; Visitor *v; - + QDict *dict =3D keyval_parse(optarg, "driver", &help, &err= or_fatal); + if (help || (qdict_haskey(dict, "driver") && + is_help_option(qdict_get_str(dict, "driver"))= )) { + audio_help(); + exit(EXIT_SUCCESS); + } if (!qdict_haskey(dict, "id")) { qdict_put_str(dict, "id", "audiodev0"); } --=20 2.37.2 From nobody Fri Dec 19 17:34:22 2025 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=1663610144; cv=none; d=zohomail.com; s=zohoarc; b=C+IcgsmFoP1XJM+SeVf5SI9bv59DCmsajSOG6OV2SLy6FGzfzX7/SaFiMPflbeOc8V5jPVPx6b8boQQJnfBAA3ci6+7vphk0fEiqUnzEY1A8UU7OtoZNTCv9uEyBO4lTBw39kJ12v5vdasUOt2+FqojGnSZd4G8wwaAHU6ZDptQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663610144; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DCfeDcg7stRxSdw0AePAnW4YvAKF+QFscneJiFL2iUo=; b=dNL9RJnOdpZwWej6ROmwCtW8tJWmyRGDJWJVHUrBGZp3XWiAAMcA4rf22GoekbxmaM9158JDUPbn9QOIzaKfpHCZNFGoPAqaEPVRQoDfwRlf7HevBfXLdIya5MdL0SE87Zn1CvtAPYDrzBQBceFRdO28lmT0tv85Ty2WPXie23o= 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 1663610144638181.31430863735193; Mon, 19 Sep 2022 10:55:44 -0700 (PDT) Received: from localhost ([::1]:40828 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaKzf-0000c5-IZ for importer@patchew.org; Mon, 19 Sep 2022 13:55:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39366) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKg7-0003Id-L6 for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:27762) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKfv-000387-QC for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:31 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-206-bu0NVx5sPw-QAA80gqJ49w-1; Mon, 19 Sep 2022 13:35:17 -0400 Received: by mail-wm1-f70.google.com with SMTP id 62-20020a1c0241000000b003b4922046e5so13280wmc.1 for ; Mon, 19 Sep 2022 10:35:17 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id n13-20020a05600c4f8d00b003a5537bb2besm15069381wmq.25.2022.09.19.10.35.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 10:35:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663608919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DCfeDcg7stRxSdw0AePAnW4YvAKF+QFscneJiFL2iUo=; b=NjRJc/1rZNNz3xdatFGw3h+pulzFbtVOMV4FdHhzHZKXhAEfYTTlQyIivbu+eoUfc51F3T IeaeUoWmmzdRHfJlCgXAj3xS3bln2i1g/qUqBiQb2mJKX78ErP2Bm/QXV9Q3zF9JPJygWf 2wun07UXrR5+DjoTciKfWj/W2szLtuY= X-MC-Unique: bu0NVx5sPw-QAA80gqJ49w-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date; bh=DCfeDcg7stRxSdw0AePAnW4YvAKF+QFscneJiFL2iUo=; b=e3RUtee3AWatfS85f6YTz8UHnwCSYXCmN4IdGNgncsMjRaDFKgRiKAVpFnd2pf0Oe0 d0Ko0sm07A7YgW47jMM7oWEKfGKhpyBUlJclqrrZionCmV8ni+H3MP753pd1w+Z65OO2 sw/UM7zLfNgJRvYw6Vfangu4arJGTiKlZ+XcV4SpI+nloXx+kWlx0jFCNZ9u6TL6qMNL yz76QTSoTmAvn7kXUJrLpBTOQaMyXHBFT4tZvMsOVPluZ24QpG4g390n8nPiIxHOJndy Xl4/kyD7Sbdon1dr4NaIYH8mkjqzvG/sXFA2/8Es5wdAPtkRpKSkIxPALUFdVGKUMjfo ZPxw== X-Gm-Message-State: ACgBeo2Px9VEV2csamM5I/20WAOIb4ol/VTlmCARlFle3tPGRYo1gjI6 FR5RkdLnvsCDkaOeMZyi0IwYETjr9X7EyYIDPASMRg7veeRudzyK6BKmLgO5U+jXBeMXezdpVTf PMJxbcxt1cE6ZATE+WtTmIg6WCiGaEGkbmaXyMEh2u2p74pJXmflqyebvGnkjwOsp6XA= X-Received: by 2002:a05:600c:1d8f:b0:3b4:90c1:e23a with SMTP id p15-20020a05600c1d8f00b003b490c1e23amr19895357wms.122.1663608916390; Mon, 19 Sep 2022 10:35:16 -0700 (PDT) X-Google-Smtp-Source: AA6agR6iT9t6JzRfk36BuomlF5vSLbkEmSCeO3/2G17YSf2mlW0k6hhgFAG9AMgAo+iDmr8uR9Aaiw== X-Received: by 2002:a05:600c:1d8f:b0:3b4:90c1:e23a with SMTP id p15-20020a05600c1d8f00b003b490c1e23amr19895343wms.122.1663608916112; Mon, 19 Sep 2022 10:35:16 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 16/21] target/i386: correctly mask SSE4a bit indices in register operands Date: Mon, 19 Sep 2022 19:34:44 +0200 Message-Id: <20220919173449.5864-17-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220919173449.5864-1-pbonzini@redhat.com> References: <20220919173449.5864-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1663610145153100001 Content-Type: text/plain; charset="utf-8" SSE4a instructions EXTRQ and INSERTQ have two bit index operands, that can = be immediates or taken from an XMM register. In both cases, the fields are 6-bit wide and the top two bits in the byte are ignored. translate.c is doing that correctly for the immediate case, but not for the XMM case, so fix it. Signed-off-by: Paolo Bonzini --- target/i386/ops_sse.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386/ops_sse.h b/target/i386/ops_sse.h index c0766de18d..3504bca36a 100644 --- a/target/i386/ops_sse.h +++ b/target/i386/ops_sse.h @@ -926,7 +926,7 @@ static inline uint64_t helper_extrq(uint64_t src, int s= hift, int len) =20 void helper_extrq_r(CPUX86State *env, ZMMReg *d, ZMMReg *s) { - d->ZMM_Q(0) =3D helper_extrq(d->ZMM_Q(0), s->ZMM_B(1), s->ZMM_B(0)); + d->ZMM_Q(0) =3D helper_extrq(d->ZMM_Q(0), s->ZMM_B(1) & 63, s->ZMM_B(0= ) & 63); } =20 void helper_extrq_i(CPUX86State *env, ZMMReg *d, int index, int length) @@ -948,7 +948,7 @@ static inline uint64_t helper_insertq(uint64_t src, int= shift, int len) =20 void helper_insertq_r(CPUX86State *env, ZMMReg *d, ZMMReg *s) { - d->ZMM_Q(0) =3D helper_insertq(s->ZMM_Q(0), s->ZMM_B(9), s->ZMM_B(8)); + d->ZMM_Q(0) =3D helper_insertq(s->ZMM_Q(0), s->ZMM_B(9) & 63, s->ZMM_B= (8) & 63); } =20 void helper_insertq_i(CPUX86State *env, ZMMReg *d, int index, int length) --=20 2.37.2 From nobody Fri Dec 19 17:34:22 2025 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=1663610295; cv=none; d=zohomail.com; s=zohoarc; b=OzLQ+5JfGnd0yJQe/2Z4Reke0Xpf3V7w3s/T/OjStwuZBDvWTqGmF8fHaRkS980EVpXAdMesYYLuDBws5vMjm5VZJH9bEFwGvaNpMIrbRDwbecrzYAj/MIf3k1EtUUHOWx4ImNgFv5GUDBqehYxF4TBbp5oijQjx20/2mqPLa+U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663610295; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=GHA4iB+vWgQgvrjq6bsYLAWGMi0ifafcuMJ1u5P5lbc=; b=Cd6Kb0u/JAij67a+4/MYSw2tYIJ2vfYJCAd24cOwf/U2q07K7jkPSSHeQ8bpfjQj0azgbHWrbqEl6mIAMncHkF5r5EOhATBkZ8GNeTBnL0qAwVfuW5UK7yja5bRc8/9Y6eBNUqdrnPKgy8IAHqleQiCsUNzXsanAqfbgEkCuZSQ= 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 1663610295546968.8223667157288; Mon, 19 Sep 2022 10:58:15 -0700 (PDT) Received: from localhost ([::1]:45350 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaL25-0005h8-5D for importer@patchew.org; Mon, 19 Sep 2022 13:58:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39374) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKg9-0003K6-27 for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:23080) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKfx-00039u-IS for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:32 -0400 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-18-5KCtpuAqPgu4plulixSV2g-1; Mon, 19 Sep 2022 13:35:19 -0400 Received: by mail-wr1-f71.google.com with SMTP id d30-20020adfa41e000000b00228c0e80c49so29185wra.21 for ; Mon, 19 Sep 2022 10:35:19 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id y9-20020a05600c20c900b003a541d893desm13980863wmm.38.2022.09.19.10.35.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 10:35:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663608921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GHA4iB+vWgQgvrjq6bsYLAWGMi0ifafcuMJ1u5P5lbc=; b=d+eC8sBx9t0Eyo6bz+7HnJTk8M3o3GGtbMlquExvlAjhmGjWR2UHtzkYNIXdQNudHmovk/ lTHNh/yI7lFrMeRg8Xe5B8SXmBB0y3Lh8tZPupdz2vmmEROKIq8ALP9fIqt4hhDjrij4z0 ca6sM0HaGoajxFOml1Bx2s+0tiPFvng= X-MC-Unique: 5KCtpuAqPgu4plulixSV2g-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date; bh=GHA4iB+vWgQgvrjq6bsYLAWGMi0ifafcuMJ1u5P5lbc=; b=ozciYD5Tm7nk1CnRSc+09mbYoUC4Yr87LatBIFnchoi0NxQ8SjuXlnPG35zCTOZEWs Jou6w5zo1V6MqV0NFYd+R9hgwTzrJ6QO6hciFhXv/pR9Lhdkf1IbADfJ1l3WpFcJHxGw P8vVQsmKy1g3xt18NbkJj9wjnQDm45sjGGBaeWi1fh1slsVPfzBTFSnfuVgakDJHUpXy BVLTfpSfcRmq9viKmt4l2n0CPPLXRzFm+q/b2jSQDk4ztxoEJXUbJ7U5mBsxOiNRAL05 RYONl+tpYlYhGEkqnuZsWopzq89gRH1ZYEtz9ybmGY0YCEMnvkbFEID+eDu+da9IrhJb iYTg== X-Gm-Message-State: ACgBeo3Cc46IvjwnJir2GNBILO5fB6ZBKsjTpwNBnC3/Td0U+6LkaqnT rlsi1+ODotMYX/QX95aheAK0O75HE2/2P1XCx1o2/CJtr5aanvFKnjrYyNa41z2OM3hSJdy55ol jmJBKzDLGbI7a7gofXPAPtQuJgRpkOKnbopq535OGDYcfEhGdisCoyL0zQN4DpKZO2uw= X-Received: by 2002:a05:600c:2646:b0:3b4:7640:3c1a with SMTP id 6-20020a05600c264600b003b476403c1amr20521817wmy.2.1663608917886; Mon, 19 Sep 2022 10:35:17 -0700 (PDT) X-Google-Smtp-Source: AA6agR5oZLXy7SpmN7t6SDDdy+JKEJIRGLfMhdQH4gwz/+QQaan4bIU5ZKPXjn7BP5QNavIxwPtbzg== X-Received: by 2002:a05:600c:2646:b0:3b4:7640:3c1a with SMTP id 6-20020a05600c264600b003b476403c1amr20521799wmy.2.1663608917456; Mon, 19 Sep 2022 10:35:17 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 17/21] target/i386: fix INSERTQ implementation Date: Mon, 19 Sep 2022 19:34:45 +0200 Message-Id: <20220919173449.5864-18-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220919173449.5864-1-pbonzini@redhat.com> References: <20220919173449.5864-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1663610296468100001 Content-Type: text/plain; charset="utf-8" INSERTQ is defined to not modify any bits in the lower 64 bits of the destination, other than the ones being replaced with bits from the source operand. QEMU instead is using unshifted bits from the source for those bits. Signed-off-by: Paolo Bonzini --- target/i386/ops_sse.h | 10 +++++----- target/i386/ops_sse_header.h | 2 +- target/i386/tcg/translate.c | 14 ++++++++++++-- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/target/i386/ops_sse.h b/target/i386/ops_sse.h index 3504bca36a..7bf8bb967d 100644 --- a/target/i386/ops_sse.h +++ b/target/i386/ops_sse.h @@ -934,7 +934,7 @@ void helper_extrq_i(CPUX86State *env, ZMMReg *d, int in= dex, int length) d->ZMM_Q(0) =3D helper_extrq(d->ZMM_Q(0), index, length); } =20 -static inline uint64_t helper_insertq(uint64_t src, int shift, int len) +static inline uint64_t helper_insertq(uint64_t dest, uint64_t src, int shi= ft, int len) { uint64_t mask; =20 @@ -943,17 +943,17 @@ static inline uint64_t helper_insertq(uint64_t src, i= nt shift, int len) } else { mask =3D (1ULL << len) - 1; } - return (src & ~(mask << shift)) | ((src & mask) << shift); + return (dest & ~(mask << shift)) | ((src & mask) << shift); } =20 void helper_insertq_r(CPUX86State *env, ZMMReg *d, ZMMReg *s) { - d->ZMM_Q(0) =3D helper_insertq(s->ZMM_Q(0), s->ZMM_B(9) & 63, s->ZMM_B= (8) & 63); + d->ZMM_Q(0) =3D helper_insertq(d->ZMM_Q(0), s->ZMM_Q(0), s->ZMM_B(9) &= 63, s->ZMM_B(8) & 63); } =20 -void helper_insertq_i(CPUX86State *env, ZMMReg *d, int index, int length) +void helper_insertq_i(CPUX86State *env, ZMMReg *d, ZMMReg *s, int index, i= nt length) { - d->ZMM_Q(0) =3D helper_insertq(d->ZMM_Q(0), index, length); + d->ZMM_Q(0) =3D helper_insertq(d->ZMM_Q(0), s->ZMM_Q(0), index, length= ); } #endif =20 diff --git a/target/i386/ops_sse_header.h b/target/i386/ops_sse_header.h index d99464afb0..400b24c091 100644 --- a/target/i386/ops_sse_header.h +++ b/target/i386/ops_sse_header.h @@ -193,7 +193,7 @@ DEF_HELPER_3(rcpss, void, env, ZMMReg, ZMMReg) DEF_HELPER_3(extrq_r, void, env, ZMMReg, ZMMReg) DEF_HELPER_4(extrq_i, void, env, ZMMReg, int, int) DEF_HELPER_3(insertq_r, void, env, ZMMReg, ZMMReg) -DEF_HELPER_4(insertq_i, void, env, ZMMReg, int, int) +DEF_HELPER_5(insertq_i, void, env, ZMMReg, ZMMReg, int, int) DEF_HELPER_3(glue(haddps, SUFFIX), void, env, ZMMReg, ZMMReg) DEF_HELPER_3(glue(haddpd, SUFFIX), void, env, ZMMReg, ZMMReg) DEF_HELPER_3(glue(hsubps, SUFFIX), void, env, ZMMReg, ZMMReg) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 8ec91d17af..5f31a59fb8 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -3506,10 +3506,20 @@ static void gen_sse(CPUX86State *env, DisasContext = *s, int b, gen_helper_extrq_i(cpu_env, s->ptr0, tcg_const_i32(bit_index), tcg_const_i32(field_length)); - else - gen_helper_insertq_i(cpu_env, s->ptr0, + else { + if (mod !=3D 3) { + gen_lea_modrm(env, s, modrm); + op2_offset =3D offsetof(CPUX86State, xmm_t0); + gen_ldq_env_A0(s, offsetof(CPUX86State, xmm_t0.ZMM= _D(0))); + } else { + rm =3D (modrm & 7) | REX_B(s); + op2_offset =3D ZMM_OFFSET(rm); + } + tcg_gen_addi_ptr(s->ptr1, cpu_env, op2_offset); + gen_helper_insertq_i(cpu_env, s->ptr0, s->ptr1, tcg_const_i32(bit_index), tcg_const_i32(field_length)); + } } break; case 0x7e: /* movd ea, mm */ --=20 2.37.2 From nobody Fri Dec 19 17:34:22 2025 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=1663610869; cv=none; d=zohomail.com; s=zohoarc; b=kZNLZEWQGQgI7WyoEfgtLPPOi1OHi+7UDagE0i+BnuF4baS3jdKy7JfbGIRPyldeVa6ThiUODrEmARLH5rNYmfNj/yj3hnupzuRyBz/VFhTUDyeDCFiMtLq1EnY66Ds9sQJfcPy1oApzni5hGWlqFIFtM0X5Jt7800sDeCQpYW8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663610869; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2juENqXZ9tAn1nL0v4LoFaAo4E6Rk3IU7RmOIiZ5244=; b=Rz+fwdMWPfiWj6CtHLzdVwbwZKGl2FIGKjeqp9CmeX6nm7GW5ayNwoAiwH1eGifavz9UrdSbfemLyxMh77xaSYleY2rVKiYhQqkb5YX2RoAOeTWta7NmIIqU0sKvv155SgNQIj5+wdF9noPoVnTb0ZhPznr/jCJMzHLCKBTOah4= 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 1663610869417523.9706218789346; Mon, 19 Sep 2022 11:07:49 -0700 (PDT) Received: from localhost ([::1]:57414 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaLBL-0000k6-U7 for importer@patchew.org; Mon, 19 Sep 2022 14:07:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48210) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKgI-0003UQ-2X for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:37596) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKgE-0003Dw-Lv for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:40 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-606-a9UErLVBPgG7XTR1Dvnc0w-1; Mon, 19 Sep 2022 13:35:20 -0400 Received: by mail-wm1-f70.google.com with SMTP id o25-20020a05600c339900b003b2973dab88so15447651wmp.6 for ; Mon, 19 Sep 2022 10:35:20 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id x1-20020adfdd81000000b002205cbc1c74sm10278239wrl.101.2022.09.19.10.35.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 10:35:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663608937; 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=2juENqXZ9tAn1nL0v4LoFaAo4E6Rk3IU7RmOIiZ5244=; b=Db5hH1YV8SJsDELHLe+0Vw3ANL4wvPj3HWxD/ri9RTlmZe7OFUv6yMqocAmNDWPQHQ5WRS z/Jru7Hf4M+2ZgZ7w2q3Hb3m3LX6urISfJhre9fbKKYWpdw8maDY4hG4yvQUmEyofwYvA7 5nF368cOLN/8c5eMmVIGVk965WoHPiM= X-MC-Unique: a9UErLVBPgG7XTR1Dvnc0w-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=2juENqXZ9tAn1nL0v4LoFaAo4E6Rk3IU7RmOIiZ5244=; b=bV0jeW6gqDg1gHFutIuE9htKjG+Q35NsVr9MqbOC8KtoRUpKpaZ5/ezAVyFwwtfhYh Io4mYncodae72Ry2PpXfChwHvsh6wXLJidrMGcCPoQ/dnSbYBmDGHJLTrsxrNx27fpse yqSWTqAfGyNJoGyzwEHNk8i0klmHS4VFANdohFJbt18vjCf+x08QD6fnMNl95fK/b3X4 30w6SyFxqn94NYM85lsQCWP3dXBquLEQbEFatxVbN8ojInEUZ7wny7LYZl4muWlovXsP PF+k+K5x7PqO6U6beenQkWaAvE373TnGzEENLPopGsQbU9Qao0Q9afd6buvrrHTldY6H XfJg== X-Gm-Message-State: ACgBeo1OWya081B6Q8SOpr/hXWvRmW6bdF92YUYK9A6IO2RXXw0moiIA YuqnEQWe0uIn2/pgfyog9g7BIxAQL5jPFuWOMPEnfIwEqTK431D2q+bue3SwKpHGQZsU3HtvXYf iu8Vh1VE1a0qs4ZMxAFNcvKxC9RXFDEvU8eXxtB14TbOG2GrNzc1xOtxed21HQ0fAGlE= X-Received: by 2002:a05:600c:898:b0:3b4:8110:7fab with SMTP id l24-20020a05600c089800b003b481107fabmr19027357wmp.19.1663608919036; Mon, 19 Sep 2022 10:35:19 -0700 (PDT) X-Google-Smtp-Source: AA6agR4ly6GQjod3Et5wV9FV9doJ8dq695/vPMPV6mtvElAdRMaWsf3XPmvW4PnVNUTT9EJaRiIj+g== X-Received: by 2002:a05:600c:898:b0:3b4:8110:7fab with SMTP id l24-20020a05600c089800b003b481107fabmr19027343wmp.19.1663608918683; Mon, 19 Sep 2022 10:35:18 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 18/21] target/i386: REPZ and REPNZ are mutually exclusive Date: Mon, 19 Sep 2022 19:34:46 +0200 Message-Id: <20220919173449.5864-19-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220919173449.5864-1-pbonzini@redhat.com> References: <20220919173449.5864-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1663610871482100001 Content-Type: text/plain; charset="utf-8" The later prefix wins if both are present, make it show in s->prefix too. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 5f31a59fb8..eaa56b0f48 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -4733,9 +4733,11 @@ static target_ulong disas_insn(DisasContext *s, CPUS= tate *cpu) switch (b) { case 0xf3: prefixes |=3D PREFIX_REPZ; + prefixes &=3D ~PREFIX_REPNZ; goto next_byte; case 0xf2: prefixes |=3D PREFIX_REPNZ; + prefixes &=3D ~PREFIX_REPZ; goto next_byte; case 0xf0: prefixes |=3D PREFIX_LOCK; --=20 2.37.2 From nobody Fri Dec 19 17:34:22 2025 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=1663610606; cv=none; d=zohomail.com; s=zohoarc; b=NKmUpF/ICO56GTQkS+9SpSp1Mp4K4TaNM9NA5MDBEnF5ksfiWbXPd8jOaBGo/iDGIrpQ95XenvoFA+e4tLZCVWtSXvvrdX0zUz2ZNNFPs87sZ/Z11SB6XR2GOK/gU/ZuHL9PsvQzWuYZBph924NVWlfUpNrMMEQKzM6NT8s09ZU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663610606; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=k4C0VUgdBwQ6L57zBQtY/ZfQFEkt7lIRQ5EO43Tbgjc=; b=mnWh5tp2nSi92rRIDzT2WoozHfHO6w62O4/oDOpWFosXV06eE1ri5b1eR6DGoHsId+5rIRQpx3ofWKcjlsjEHlycwMuaxqpW4ttestAJ/YfT4itYzLXqZQ65vlopZNgiSRXDm14hDhNmHmgOLynJdH1/07njuG16dSvEZXfH1Ng= 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 166361060686630.449930184918117; Mon, 19 Sep 2022 11:03:26 -0700 (PDT) Received: from localhost ([::1]:37934 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaL77-0001me-4t for importer@patchew.org; Mon, 19 Sep 2022 14:03:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48202) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKgB-0003Kw-Qn for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:20564) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKg0-0003By-UL for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:33 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-526-9t5nxkJ_OIK32G7pDR4jhA-1; Mon, 19 Sep 2022 13:35:23 -0400 Received: by mail-wm1-f71.google.com with SMTP id c128-20020a1c3586000000b003b324bb08c5so4945389wma.9 for ; Mon, 19 Sep 2022 10:35:23 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id m9-20020a056000008900b00228cbac7a25sm14137814wrx.64.2022.09.19.10.35.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 10:35:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663608924; 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=k4C0VUgdBwQ6L57zBQtY/ZfQFEkt7lIRQ5EO43Tbgjc=; b=CBKkWbox2AI7wF2HInnFbQSoPc4yaFzqrTAeSKOni+/6PPIfyrHBeLt0+3TsIFo4VvQPJU mL7E2OqYOk6Xpo++0zzvkDm0TZrpYr2etqpSl5U+xopLHbWOfk4P3l9rMw2DPOzgngcMJd oEYQ8c0ggPUicmEUiKzPYVHPgvB+r7k= X-MC-Unique: 9t5nxkJ_OIK32G7pDR4jhA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=k4C0VUgdBwQ6L57zBQtY/ZfQFEkt7lIRQ5EO43Tbgjc=; b=d4lHUzWbFy9mpvPxOvf4VseIP4iTbqxDtIK3Ny7Y/L8ZBI2JTdoPNA7MdnD3y+OBg0 WyAwcsHDUKcKZChauzKFjtM7Cd1Php8i13IiR4LGMql4/YwE0BXWDtk/zm6grbcSgDFO IljFPia0PCYlMjKq3lM9MOoRZns9WaVrKzsAbtYjOrHM3AhkSmFA6y7PrXzIs9S4eXZq KLwc2vfKP1qh/D6U+Km7DqCcdeOCnW7USLSpruSmVbjyGyld2YDIRXHZ8wHfJWX1ycad MXKH9xUEMVQ5kXb/txf+u7NJZ+VXqPMqqC2r/RBLL3DX0iBUKdZMoaK1E6YfP67A0gV5 pxOw== X-Gm-Message-State: ACrzQf1ylpd7cWKKowg8Hrqbr/C88WA0vpvThjsiLDPVmjsKX9llV7Kt DuezDPT1jKLilepsNaaC1GT+ZH3WRofO8r8mjE0j3NxkuWsfOb+gQbGlcP1zAOuNmJHAOhW7Aka 4sdYBcIWInxzqZBLgZ5ycmEvFPC2iPClKKePb6+E1nan5RZc9LlVRqcApqX/s1U6avp4= X-Received: by 2002:a05:600c:2050:b0:3b4:a51a:a1f5 with SMTP id p16-20020a05600c205000b003b4a51aa1f5mr12526224wmg.177.1663608920431; Mon, 19 Sep 2022 10:35:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4InAA0/H2U9hf30K9I0RjPWSUtlDR5J+YZCnPOTXTbUBJBYCNnBPcmBnASmydt13buST85BQ== X-Received: by 2002:a05:600c:2050:b0:3b4:a51a:a1f5 with SMTP id p16-20020a05600c205000b003b4a51aa1f5mr12526211wmg.177.1663608920174; Mon, 19 Sep 2022 10:35:20 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 19/21] target/i386: introduce insn_get_addr Date: Mon, 19 Sep 2022 19:34:47 +0200 Message-Id: <20220919173449.5864-20-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220919173449.5864-1-pbonzini@redhat.com> References: <20220919173449.5864-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1663610608774100001 Content-Type: text/plain; charset="utf-8" The "O" operand type in the Intel SDM needs to load an 8- to 64-bit unsigned value, while insn_get is limited to 32 bits. Extract the code out of disas_insn and into a separate function. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index eaa56b0f48..44af8c107f 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -2289,6 +2289,31 @@ static void gen_ldst_modrm(CPUX86State *env, DisasCo= ntext *s, int modrm, } } =20 +static target_ulong insn_get_addr(CPUX86State *env, DisasContext *s, MemOp= ot) +{ + target_ulong ret; + + switch (ot) { + case MO_8: + ret =3D x86_ldub_code(env, s); + break; + case MO_16: + ret =3D x86_lduw_code(env, s); + break; + case MO_32: + ret =3D x86_ldl_code(env, s); + break; +#ifdef TARGET_X86_64 + case MO_64: + ret =3D x86_ldq_code(env, s); + break; +#endif + default: + g_assert_not_reached(); + } + return ret; +} + static inline uint32_t insn_get(CPUX86State *env, DisasContext *s, MemOp o= t) { uint32_t ret; @@ -5851,16 +5876,7 @@ static target_ulong disas_insn(DisasContext *s, CPUS= tate *cpu) target_ulong offset_addr; =20 ot =3D mo_b_d(b, dflag); - switch (s->aflag) { -#ifdef TARGET_X86_64 - case MO_64: - offset_addr =3D x86_ldq_code(env, s); - break; -#endif - default: - offset_addr =3D insn_get(env, s, s->aflag); - break; - } + offset_addr =3D insn_get_addr(env, s, s->aflag); tcg_gen_movi_tl(s->A0, offset_addr); gen_add_A0_ds_seg(s); if ((b & 2) =3D=3D 0) { --=20 2.37.2 From nobody Fri Dec 19 17:34:22 2025 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=1663610683; cv=none; d=zohomail.com; s=zohoarc; b=GbLRxObSG+0s5RBkhK1uNIJLnxohRFa5+25SSfAgqFyXL2WnSJZt8BatcqpMU2cMDiUE9AT6PaQh+n3lwVCBDb8ARCZ744qNmGMx5BnyIX2lnlqOAXNr5xyblEi910IEikwksOsOE5y0V8lZ3rccKBfzlybqV98GZmu6ptJeOGQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663610683; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+qG6qdgR8Jto65cTPgnYEY9MvMDpxeVZ+fynp1vP//c=; b=dvBlpCFGScdPAuAs7UrhK/q/aKakE4VYAUwNuznKiiwu5ZVNhuy/zi78adVO8uMCf9b83OQ/yLvYEqpZGCIT4iIGdDoDAMiw+ru8yvLs6FTz+2/Tfs+rNrYm5oxuGUMTcUEJw45hxC5HbkCqqX17Br3rqPpD8/dtxN71Sl8K9XQ= 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 1663610683811118.36645537853985; Mon, 19 Sep 2022 11:04:43 -0700 (PDT) Received: from localhost ([::1]:50422 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaL8J-0003Do-UC for importer@patchew.org; Mon, 19 Sep 2022 14:04:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48206) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKgB-0003LD-Ts for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:34502) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKg1-0003CD-JT for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:34 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-638-IgcyNbP2NN69B6KRv224DQ-1; Mon, 19 Sep 2022 13:35:23 -0400 Received: by mail-wm1-f71.google.com with SMTP id i132-20020a1c3b8a000000b003b339a8556eso2854wma.4 for ; Mon, 19 Sep 2022 10:35:23 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id p8-20020a1c5448000000b003b486027c8asm14221441wmi.20.2022.09.19.10.35.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 10:35:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663608925; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+qG6qdgR8Jto65cTPgnYEY9MvMDpxeVZ+fynp1vP//c=; b=IOZWC4l5gYPkPPk7GyYtY3kOcbPqJu+Z3sJyFg6rTlzU9CfP4SgI083MM4h4JGbDGmxX0G NiGku4hRmErWpzEjCQI5M67GhmZ03+Hrh3J3/2HOkhu7AiBDr9B+3mT7jOdNZK34bVDXVr a2+ITrYuEYmJ4omM7iZ7qIBdD+VhxW4= X-MC-Unique: IgcyNbP2NN69B6KRv224DQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date; bh=+qG6qdgR8Jto65cTPgnYEY9MvMDpxeVZ+fynp1vP//c=; b=VljHfnSGV4iXp/0YdHp4zUMqkpzZgNTMCedAAb48VHhCB/+S30yw6sBU7ETAkXScRe fEWRREgokJwNSkdiK8VfD04THiU708Z9+Dz26ijyHQQyynHK9BHQRHPWvW1sLlzTy14f 1lP/vLJ4vz4tNnWzIBq13X9TwrWwDpsHigOwl8eePShcuRcrhyWXnKYVqQ1CyiBEKwJ7 TGVVaUGcRkc2SW8sH+5LT+JVdRP+wbGL6LsXjug9v/kaAATKt5kUL1LLZQ27R9Qw8JUc IBrxS/76GMozt+hnPXBZmnWCZ0tljUIxXDAaqDJ9Mul7yHYKHDK5+HXAydhcroW3qX1Q dFvA== X-Gm-Message-State: ACrzQf2z6xoStixqpy0InCLltvrdqi6qcbEq2UfXM85/RIhJJqOrN2jY xjESttjSeSCExOZVKCTTzyWzwg70+PfWv8gAvX4Zv7z0Yuf2By2mqucy+q3AjXjcEdDdzXtGrL/ h09B0oGlArOVAG94Kz8KEkkkXu+Ih293z27KnV1rZ3Nb+4FxhKmJ2enoiIbe5g1Vi6W8= X-Received: by 2002:a05:600c:4e44:b0:3b4:bed2:4f5e with SMTP id e4-20020a05600c4e4400b003b4bed24f5emr11651331wmq.193.1663608921966; Mon, 19 Sep 2022 10:35:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7PBVp2V8xXAr9Km1zDKYhmda/HUrhIa5R/ttM3dCnPrNuM6ZOx6X3cBW8nBRvfuk35nBJY8A== X-Received: by 2002:a05:600c:4e44:b0:3b4:bed2:4f5e with SMTP id e4-20020a05600c4e4400b003b4bed24f5emr11651312wmq.193.1663608921618; Mon, 19 Sep 2022 10:35:21 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 20/21] build: remove extra parentheses causing missing rebuilds Date: Mon, 19 Sep 2022 19:34:48 +0200 Message-Id: <20220919173449.5864-21-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220919173449.5864-1-pbonzini@redhat.com> References: <20220919173449.5864-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1663610685449100001 Content-Type: text/plain; charset="utf-8" Because of two stray parentheses at the end of the definition of ninja-cmd-goals, the test that is last in the .check-TESTSUITENAME.deps variable will not be rebuilt. Fix that. Signed-off-by: Paolo Bonzini --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 13234f2aa4..b576cba5a8 100644 --- a/Makefile +++ b/Makefile @@ -145,7 +145,7 @@ NINJAFLAGS =3D $(if $V,-v) $(if $(MAKE.n), -n) $(if $(M= AKE.k), -k0) \ $(filter-out -j, $(lastword -j1 $(filter -l% -j%, $(MAKEFLAGS)))) \ -d keepdepfile ninja-cmd-goals =3D $(or $(MAKECMDGOALS), all) -ninja-cmd-goals +=3D $(foreach g, $(MAKECMDGOALS), $(.ninja-goals.$g)))) +ninja-cmd-goals +=3D $(foreach g, $(MAKECMDGOALS), $(.ninja-goals.$g)) =20 makefile-targets :=3D build.ninja ctags TAGS cscope dist clean uninstall # "ninja -t targets" also lists all prerequisites. If build system --=20 2.37.2 From nobody Fri Dec 19 17:34:22 2025 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=1663610320; cv=none; d=zohomail.com; s=zohoarc; b=H58XUFqJqwfoHUMRfhRW1feiiKNtNYVFpL3JhW84NAN0zcLLM4mxy11hXcUmCAnwLHoCf6DLkrnWdU0wUIIHI+pQASLVafJvceLfEQyAjdQx/Z+utnaZKd7xGo/oai2bEnxxuVD8Ja+mBKF2gsEf0sWpMUJG/4T7c11pzNJgX6Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663610320; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Pj4YI1EbEjLq11Ta/hqOEQN7kn7r7RkoCyk4aYS+xIw=; b=nqe/dFwh7QqGU1ddT+T4YNOdxkMp6fDXUPlRx+9gB0ySIMvtJTXXuSLNKtnTgQnWlPR/ZM9zdvmKLgx3kYFEra+PpS5GyE02xV6IzQJTZnzKZzE3ZAYtqt8OxzPsEYJwe/txanff89vD7VX05sSL3d7LSDmhFYXDCzzZ4EupM7Y= 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 1663610320536931.6539703010604; Mon, 19 Sep 2022 10:58:40 -0700 (PDT) Received: from localhost ([::1]:41088 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaL2V-0006IF-HQ for importer@patchew.org; Mon, 19 Sep 2022 13:58:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48200) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKgB-0003Ko-PH for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:29392) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKg5-0003CS-LN for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:34 -0400 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-489-k0S-C065M1eO4wXkk79ROA-1; Mon, 19 Sep 2022 13:35:27 -0400 Received: by mail-wr1-f70.google.com with SMTP id d30-20020adfa41e000000b00228c0e80c49so29328wra.21 for ; Mon, 19 Sep 2022 10:35:27 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id a3-20020a056000100300b00228b3ff1f5dsm16593778wrx.117.2022.09.19.10.35.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 10:35:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663608929; 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=Pj4YI1EbEjLq11Ta/hqOEQN7kn7r7RkoCyk4aYS+xIw=; b=OdbIeAKLWrziv+2oJFCvSEXUXI4dIU+kg+JbygxlSPsewaa9NOzasS2zTWt4xQ6PPbqFoQ DwcpM3CFQc8zTKQzfoHoq6iQcaAWvOovMY85Gry80HaxL3rUVIBIDlEoyEuq4ZIHooAGvR 2A9xuj8wqb8QEEkZV8LB/l+KO7GZcYg= X-MC-Unique: k0S-C065M1eO4wXkk79ROA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=Pj4YI1EbEjLq11Ta/hqOEQN7kn7r7RkoCyk4aYS+xIw=; b=APM2WoytMobY5QuSN0IBo/lh21u5kdP4npu3XclRSNWulgc5zg+EudEazsBC1hvGbA A+uGahSFpkFbo0va3YlrPkz9reZGV+HGMhGN+FClM9nBJ2oOJGO0L2nBZcMYZJxZdYKg TFL3OuBD1IwtjeGf7IpeOd8C+kgRLjnfP1jHRzsiHC576PlNiWtDQTfgwQ+Skf1F0jjv sJu8ykeW1ft9nkXBeU309yTJDEpNfxsTGkEv4d07qp+zYxRutuRmn+poVrnSaZVA5Gsr rSLkHyLi310axpvDysMO/5pb/hHxpQD5rxC0PlZhB1Ha2D+x671+cmt8nCOUeVbLNmmT Loew== X-Gm-Message-State: ACrzQf2fGMUkcuVy67ubAuwEq+6V9t2KVxMRvJhBxipSxNZN2Rjxl2OS Y1E15m/pLLILcsd9PWdGnxxoIsrEImXJ0QfooTHbLgdVU7h7R8R15HT3/H08NzHJZ1zJWrPYSuu WbePGs0ALWwaCrfoEM8SW8B/daA5McFujCmvLXvaru0FrN/pbuOFnXHJUjpD+wbSN6Ns= X-Received: by 2002:a05:600c:34c6:b0:3b4:9643:e46d with SMTP id d6-20020a05600c34c600b003b49643e46dmr13445349wmq.9.1663608926480; Mon, 19 Sep 2022 10:35:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7+2U49tGC1lVZQ9BuOXQo+MmRJMyl+0IPuRrqkoAvM5/PGatb9+XTMvxIE3XXsM575bFW1kg== X-Received: by 2002:a05:600c:34c6:b0:3b4:9643:e46d with SMTP id d6-20020a05600c34c600b003b49643e46dmr13445330wmq.9.1663608926090; Mon, 19 Sep 2022 10:35:26 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: "Jason A . Donenfeld" Subject: [PULL 21/21] qboot: update to latest submodule Date: Mon, 19 Sep 2022 19:34:49 +0200 Message-Id: <20220919173449.5864-22-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220919173449.5864-1-pbonzini@redhat.com> References: <20220919173449.5864-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1663610322703100001 Content-Type: text/plain; charset="utf-8" Include patch "Place setup_data at location specified by host" from Jason A. Donenfeld. Cc: Jason A. Donenfeld Signed-off-by: Paolo Bonzini --- roms/qboot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roms/qboot b/roms/qboot index a5300c4949..8ca302e86d 160000 --- a/roms/qboot +++ b/roms/qboot @@ -1 +1 @@ -Subproject commit a5300c4949b8d4de2d34bedfaed66793f48ec948 +Subproject commit 8ca302e86d685fa05b16e2b208888243da319941 --=20 2.37.2