From nobody Mon Nov 25 00:16:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719037049; cv=none; d=zohomail.com; s=zohoarc; b=E5VyMlovIqBsj4tDk6a+pFegZMPAtb4T/P5TI41ju0HSsnOMXdbyHLuxDBFSQVORGAQbLgT3lB1Zeo0glREpLZNLMpXfRAAFBgxpW2KN0Isx3Ejr9fzHQsT2imKKQ0DawwN7IuhHLQJpngTT2HTJJ434Md/Fe4icVhQ+vTbCApA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719037049; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=INLXKQAnxyLlbt49tJcziQ4qLBnfUf83esez+1sBRI0=; b=DdIQHUVfQGulKBN48lddAK7TSL2+XaG2OX41BZCYbtYB4y7SEMNtEjLv4YPCI3+W+1SCX/NDbgoHad8x33fbltsrXiEpg5Da9qsVQOkm9Y1gIyGVTYzXT7bQkakxvpu4woDkYm92MKEa4LhFgGuo0Iqr7mOT38MvDgBC+Cvfo5w= 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 171903704980461.835670906406904; Fri, 21 Jun 2024 23:17:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKu2p-0008M9-Vh; Sat, 22 Jun 2024 02:16:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu2n-0008L3-TF for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu2m-0006NW-D9 for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:13 -0400 Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-418-AICYOFVCOVqM91qjriU-qw-1; Sat, 22 Jun 2024 02:16:05 -0400 Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-57d3d594107so290192a12.3 for ; Fri, 21 Jun 2024 23:16:05 -0700 (PDT) Received: from avogadro.local ([151.62.196.71]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57d3042d509sm1924241a12.43.2024.06.21.23.16.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 23:16:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719036970; 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=INLXKQAnxyLlbt49tJcziQ4qLBnfUf83esez+1sBRI0=; b=BCakeXIB+tk4/AK6zrksoYIzUxK/YnM45SK/xRX5UNNWAUOtBdW62EkKihqimaHnF0PYmv P90yY8J8d1I+3mhNHJPIQRoJTZekjdIRmG5sClPs2NluL+CjK1XWjlJokIT9ehmkK/ZPnm Ngl0QcFuHO/KEv4uRSMjekZh0SwFdE4= X-MC-Unique: AICYOFVCOVqM91qjriU-qw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719036963; x=1719641763; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=INLXKQAnxyLlbt49tJcziQ4qLBnfUf83esez+1sBRI0=; b=sera8gBAHJK8F3zE9wfYqjkeRddDb0SG3lPnh+Sjzod0dfSZYYfkkpRZk0Owz0aSrp 6P7rJczf1ARl9rV9DTWdc/3ka/CYaxAcUWiV011z2bRXcxOBbm/5jj4JXD/q78xWPKSZ LTdo+1Y4nuJYjyJz7QBNIS9vpKzhsSTUSSMohZAo1r/y6QBOKNat1edy1ClljMG9M2Vz GpDJ2PEXYkrVnWmi25uQoTB+u7BZQP6WiVord3Qr3pkhJS6BkO9KlFLcDUJBBMGSJv6I xqXIgG+2fdG23GcglK0Cj8hZJ+CpSgEnER2K7VJSj3a4zxDogb8n86z6kCm585yTyCy2 nZ8A== X-Gm-Message-State: AOJu0YzhunF8yuGy65VRTbB/3PUH2EauiSr6lwea6+BfRl/u9cgOVoDY kwS+cWHclmnOtcK59dxAdtX8f9oT67eRT6rzG7EqdWU1yQrcmnwj+pwQPTSmT2PJy29tqowl1XK wSODyMOQYTahKkFU3/6dTIHjQUmLNaZXfAmOHEHEGGCwGL3FJn8qZ01ZldhXTgAps5T6QQgKZJh KfuJqDOSNsmUr6lZ+HvnzMPl0+bhIXS14FIQR4 X-Received: by 2002:a05:6402:3414:b0:57c:a7dc:b0de with SMTP id 4fb4d7f45d1cf-57d07ee7906mr6298000a12.39.1719036963138; Fri, 21 Jun 2024 23:16:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF2G9v2ZubQK1ejU9FzinfQaoHLrZcGHxLd1CquQiKPYAfYT3Eg7IeWX8gx84fL5r2osgjo9A== X-Received: by 2002:a05:6402:3414:b0:57c:a7dc:b0de with SMTP id 4fb4d7f45d1cf-57d07ee7906mr6297984a12.39.1719036962576; Fri, 21 Jun 2024 23:16:02 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth Subject: [PULL 01/23] configure: detect --cpu=mipsisa64r6 Date: Sat, 22 Jun 2024 08:15:35 +0200 Message-ID: <20240622061558.530543-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240622061558.530543-1-pbonzini@redhat.com> References: <20240622061558.530543-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset=UTF-8 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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719037051313100003 Treat it as a MIPS64 machine. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth Signed-off-by: Paolo Bonzini --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 5ad1674ca5f..8b6a2f16ceb 100755 --- a/configure +++ b/configure @@ -450,7 +450,7 @@ case "$cpu" in linux_arch=3Dloongarch ;; =20 - mips64*) + mips64*|mipsisa64*) cpu=3Dmips64 host_arch=3Dmips linux_arch=3Dmips --=20 2.45.2 From nobody Mon Nov 25 00:16:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719037173; cv=none; d=zohomail.com; s=zohoarc; b=gGknwGLn0fm4odEm/mSYHPhQyH4SzuNS/BT+B9QpM7wTh1CMgdZGSf4cBzUh44dR+muJU+b/OXhQ8H8Q7GZlonmc5t6UY00h7TEzRutMEEmOJRAG68ATW2e15uHjWAkjVLaMGWlBZcbmFL5L8hOKoAtTSEIjGnfLrs+MH0TFkBo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719037173; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=UpEB8RKh0nHTTV4SYs2ZNSxWI14Dka7ndAM1DOHLcLk=; b=nq15tu6VzUJZ9ieZ+oG4yMZtcGtV57mRozy2wzb1mqsA05E95iaIwRLt/TsXKfojauSLryZca5feQf0feqzuqHHl6BsnM44TmVD1za3w3m3T9/C4EehtcNouMlPOXUMLHvloW5an50is4G6Ln7hhs3jmGwNwFirk6JYqOjaPXFw= 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 1719037172992286.98545967854363; Fri, 21 Jun 2024 23:19:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKu2q-0008Mf-SI; Sat, 22 Jun 2024 02:16:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu2m-0008KA-C8 for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu2k-0006NQ-S4 for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:12 -0400 Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-538-BTbVEsR5PXeofSSRdZu8Og-1; Sat, 22 Jun 2024 02:16:06 -0400 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a706f279c56so4969566b.3 for ; Fri, 21 Jun 2024 23:16:06 -0700 (PDT) Received: from avogadro.local ([151.62.196.71]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6fcf428c67sm157489766b.2.2024.06.21.23.16.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 23:16:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719036970; 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=UpEB8RKh0nHTTV4SYs2ZNSxWI14Dka7ndAM1DOHLcLk=; b=S4eYNUpXdbpinc1CPymRENEpMAUIRY8G0AtzgJcCms26/L+LMbzf6KsDxLF86a24qHF87T UuW24q8ENEdmXCJa8t0BLbjkLTN9Tq7wU13oy7PkSOIFJ5z5LZEtp+kn1alH0qBEX3JAXs nwHNiqkLdiVzuNiA3LNTGdhMGXG7iw0= X-MC-Unique: BTbVEsR5PXeofSSRdZu8Og-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719036964; x=1719641764; 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:message-id:reply-to; bh=UpEB8RKh0nHTTV4SYs2ZNSxWI14Dka7ndAM1DOHLcLk=; b=nyolh35fqKGAk4Rh2TcYeoSH0oIl05wuLZQEI0WnJ1ymWSiVgt5gRl2g18Pv57JCz2 B7F48BRXqi+U1VIaMU9aux3MBqLlHaWbJZbGO4XzAKxlo+za8a+n9W4gcJHjOnuPCVXr KiuUcj0Ib12ElsmwONy9BByk2sjN9qVgALIere0JOSQ23ZksoeMZh4GIJosaWIzqVZfz 7jFKgYiyM6Rv8IzNEu3Pf0jYOI+HvCumPpVAywBr7ftP+KpoR6YKJx0OVbtmjO+MpV23 5Y8+FP47Cki/6eFxKX14KRUptwEBr3B9LfUS5Y5vYxYHrWQJcA3KEIE5GMr5yJU7yyb8 TMqQ== X-Gm-Message-State: AOJu0Yy8LVYKu/Jd4SvZMTZlDgY/OfB4XyqgbcCns5TnT9bm0Q57+a+r Xeme8zRij53klgayS/ti0X/10eIFrpoDFVgD8zn4pnzGDddUnw3MnYC1j1DxkJ6Ir4h5W2YJjwc /FP7HApJSZ6Nzy3AyjGoV+s2IonYn4WAsGAlYbgxhV7nXNF3Sx+3QRLS0eMmMkiZT4P5oLC6bJD D+RdylS0aIohTytkj9roY4j48vzetjUbtpdJNU X-Received: by 2002:a17:907:c5c7:b0:a6f:e5f2:e67c with SMTP id a640c23a62f3a-a6fe5f2e746mr45574666b.38.1719036964374; Fri, 21 Jun 2024 23:16:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEuGmYTA+qyNNitAFYGppTdJRHvB3tWpfLyyOXSt20kGS2uQAI6gDsrZnE64aVNOEHRlwsSTw== X-Received: by 2002:a17:907:c5c7:b0:a6f:e5f2:e67c with SMTP id a640c23a62f3a-a6fe5f2e746mr45573166b.38.1719036963750; Fri, 21 Jun 2024 23:16:03 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 02/23] target/i386: fix CC_OP dump Date: Sat, 22 Jun 2024 08:15:36 +0200 Message-ID: <20240622061558.530543-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240622061558.530543-1-pbonzini@redhat.com> References: <20240622061558.530543-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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, UPPERCASE_50_75=0.008 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719037173779100002 Content-Type: text/plain; charset="utf-8" POPCNT was missing, and the entries were all out of order after ADCX/ADOX/ADCOX were moved close to EFLAGS. Just use designated initializers. Fixes: 4885c3c4953 ("target-i386: Use ctpop helper", 2017-01-10) Fixes: cc155f19717 ("target/i386: rewrite flags writeback for ADCX/ADOX", 2= 024-06-11) Signed-off-by: Paolo Bonzini --- target/i386/cpu-dump.c | 101 +++++++++++++++++++++-------------------- 1 file changed, 51 insertions(+), 50 deletions(-) diff --git a/target/i386/cpu-dump.c b/target/i386/cpu-dump.c index 40697064d92..3bb8e440916 100644 --- a/target/i386/cpu-dump.c +++ b/target/i386/cpu-dump.c @@ -28,69 +28,70 @@ /* x86 debug */ =20 static const char *cc_op_str[CC_OP_NB] =3D { - "DYNAMIC", - "EFLAGS", + [CC_OP_DYNAMIC] =3D "DYNAMIC", =20 - "MULB", - "MULW", - "MULL", - "MULQ", + [CC_OP_EFLAGS] =3D "EFLAGS", + [CC_OP_ADCX] =3D "ADCX", + [CC_OP_ADOX] =3D "ADOX", + [CC_OP_ADCOX] =3D "ADCOX", =20 - "ADDB", - "ADDW", - "ADDL", - "ADDQ", + [CC_OP_MULB] =3D "MULB", + [CC_OP_MULW] =3D "MULW", + [CC_OP_MULL] =3D "MULL", + [CC_OP_MULQ] =3D "MULQ", =20 - "ADCB", - "ADCW", - "ADCL", - "ADCQ", + [CC_OP_ADDB] =3D "ADDB", + [CC_OP_ADDW] =3D "ADDW", + [CC_OP_ADDL] =3D "ADDL", + [CC_OP_ADDQ] =3D "ADDQ", =20 - "SUBB", - "SUBW", - "SUBL", - "SUBQ", + [CC_OP_ADCB] =3D "ADCB", + [CC_OP_ADCW] =3D "ADCW", + [CC_OP_ADCL] =3D "ADCL", + [CC_OP_ADCQ] =3D "ADCQ", =20 - "SBBB", - "SBBW", - "SBBL", - "SBBQ", + [CC_OP_SUBB] =3D "SUBB", + [CC_OP_SUBW] =3D "SUBW", + [CC_OP_SUBL] =3D "SUBL", + [CC_OP_SUBQ] =3D "SUBQ", =20 - "LOGICB", - "LOGICW", - "LOGICL", - "LOGICQ", + [CC_OP_SBBB] =3D "SBBB", + [CC_OP_SBBW] =3D "SBBW", + [CC_OP_SBBL] =3D "SBBL", + [CC_OP_SBBQ] =3D "SBBQ", =20 - "INCB", - "INCW", - "INCL", - "INCQ", + [CC_OP_LOGICB] =3D "LOGICB", + [CC_OP_LOGICW] =3D "LOGICW", + [CC_OP_LOGICL] =3D "LOGICL", + [CC_OP_LOGICQ] =3D "LOGICQ", =20 - "DECB", - "DECW", - "DECL", - "DECQ", + [CC_OP_INCB] =3D "INCB", + [CC_OP_INCW] =3D "INCW", + [CC_OP_INCL] =3D "INCL", + [CC_OP_INCQ] =3D "INCQ", =20 - "SHLB", - "SHLW", - "SHLL", - "SHLQ", + [CC_OP_DECB] =3D "DECB", + [CC_OP_DECW] =3D "DECW", + [CC_OP_DECL] =3D "DECL", + [CC_OP_DECQ] =3D "DECQ", =20 - "SARB", - "SARW", - "SARL", - "SARQ", + [CC_OP_SHLB] =3D "SHLB", + [CC_OP_SHLW] =3D "SHLW", + [CC_OP_SHLL] =3D "SHLL", + [CC_OP_SHLQ] =3D "SHLQ", =20 - "BMILGB", - "BMILGW", - "BMILGL", - "BMILGQ", + [CC_OP_SARB] =3D "SARB", + [CC_OP_SARW] =3D "SARW", + [CC_OP_SARL] =3D "SARL", + [CC_OP_SARQ] =3D "SARQ", =20 - "ADCX", - "ADOX", - "ADCOX", + [CC_OP_BMILGB] =3D "BMILGB", + [CC_OP_BMILGW] =3D "BMILGW", + [CC_OP_BMILGL] =3D "BMILGL", + [CC_OP_BMILGQ] =3D "BMILGQ", =20 - "CLR", + [CC_OP_POPCNT] =3D "POPCNT", + [CC_OP_CLR] =3D "CLR", }; =20 static void --=20 2.45.2 From nobody Mon Nov 25 00:16:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719037029; cv=none; d=zohomail.com; s=zohoarc; b=WQG5oySL1E41QoMYNWfxMIxJNdr6v23wX3pgyPJLt7ABINPOAijQI3mLfnrcuyXhOQeRT3EDh6LWZEQTcgYF2BCH/dR00BmqK1Pvjzmoq38BSoqFMVuHVMhCCO+PE70GN8pbnB+YBPmhlMkU9PX68+5kW8aHcQGMpM2/IRe9QIs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719037029; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=BxjCAp37ACaCDuTWQ1sr5np/1pD6k22WJCg4E5pz3xA=; b=OJVueJU+pXnvwhBwxYvyHohZ0uXyIoWsTK+sh8YYzeEteFUuUe99SoOb5rpwg42BdjJcTGPUh+Kzd3j6RiCSDNru/IoywUcdqqZkQs+9ntYlkISUAg2KduYwDmkirnLlAezL5AzmrdHrSZqVHVB9j87a+bzelrF0oMOLTK/Yd8c= 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 1719037029663746.6992253925213; Fri, 21 Jun 2024 23:17:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKu2u-0008UY-Un; Sat, 22 Jun 2024 02:16:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu2s-0008Nl-Nz for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu2r-0006Nu-0N for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:18 -0400 Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-688-EW5UL2RpNXCn4k_hHMG_TA-1; Sat, 22 Jun 2024 02:16:10 -0400 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a71e1625bdbso1951166b.2 for ; Fri, 21 Jun 2024 23:16:09 -0700 (PDT) Received: from avogadro.local ([151.62.196.71]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6fcf4bb22dsm157272266b.94.2024.06.21.23.16.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 23:16:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719036974; 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=BxjCAp37ACaCDuTWQ1sr5np/1pD6k22WJCg4E5pz3xA=; b=D1upOqMKcf0ld+Q0nDHxKnU8+KYjKgvGXsCT3wo84c7s1kZFMEYBNdnRjo1r2jWNvTBpad mFUhCrppJYF8hw0EZGs9xk79Z9RUP48GBDyoVZNWda9OWam0bQ9jQDRtFTGgPCRcdjYHPw w2ZnNbVmiwARz0A8IK2hLQ1kBnhoeFY= X-MC-Unique: EW5UL2RpNXCn4k_hHMG_TA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719036967; x=1719641767; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BxjCAp37ACaCDuTWQ1sr5np/1pD6k22WJCg4E5pz3xA=; b=xSaeAlr3o0zEH/ca3ro6YZpHsBbCDTgwHp5Zqz9lySzKFL+yO6wbHoo+XMkfBunUfR GJjqcxgNX+odaqLqQ2NNBTxS96k6NJTn0V/fH7jnO2QRxonUxSmHetCMpAl6qWAcYvs0 LZKcarP7JOrd+KsqGBiN23a5CIlKf2A+GL9USeb5hpiUCHlnp+sLN75K5jexaROO7YMu T4coTKaHvOoSmEqkuALr7v76VCEmvqvyClY6ZJES6uJ9RJ+lJ4Jw2eRUmexDYoxFllnv lXTzA0vw7EMChHgywnHntD63hvpqXyHRTEqw/ehzj8y7H9VSb00IPGeanxbRZPmmMPhe lZzQ== X-Gm-Message-State: AOJu0Yzglaop/TFlmzSRU0jM7obWm0EtFeaBYhnpaXoMrSGYev0+pbjq 9oo0ywf8ezupLUbj8kPEo99clVUvqJHFNnteuV49sDgBoR85dath3n+onhQYrVUWjn74M0q+Eu9 F7M0UovRxSsnUOc73GTH49YUyG19zJ4+9M70gBv6DTca+jim2IuIaw1Zx8+D8kM62DR5DDC8wsN dl/eQp5TF31hDcS8pWBb3wRdqQRmeYHcTxKRff X-Received: by 2002:a17:907:cc94:b0:a6f:6126:18aa with SMTP id a640c23a62f3a-a7165477dc4mr12694066b.67.1719036967500; Fri, 21 Jun 2024 23:16:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFzzPeqBHhZfqSLvWcXZXGT7wSmkocFDZR2sQ0OUZ8vmruIOMHwbRslKTSThcWe4zlts6AmZw== X-Received: by 2002:a17:907:cc94:b0:a6f:6126:18aa with SMTP id a640c23a62f3a-a7165477dc4mr12692966b.67.1719036966611; Fri, 21 Jun 2024 23:16:06 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 03/23] target/i386: use cpu_cc_dst for CC_OP_POPCNT Date: Sat, 22 Jun 2024 08:15:37 +0200 Message-ID: <20240622061558.530543-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240622061558.530543-1-pbonzini@redhat.com> References: <20240622061558.530543-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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719037031366100011 Content-Type: text/plain; charset="utf-8" It is the only CCOp, among those that compute ZF from one of the cc_op_* registers, that uses cpu_cc_src. Do not make it the odd one off, instead use cpu_cc_dst like the others. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 2 +- target/i386/tcg/cc_helper.c | 2 +- target/i386/tcg/translate.c | 4 ++-- target/i386/tcg/emit.c.inc | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 7e2a9b56aea..f54cd93b3f9 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1332,7 +1332,7 @@ typedef enum { CC_OP_BMILGQ, =20 CC_OP_CLR, /* Z set, all other flags clear. */ - CC_OP_POPCNT, /* Z via CC_SRC, all other flags clear. */ + CC_OP_POPCNT, /* Z via CC_DST, all other flags clear. */ =20 CC_OP_NB, } CCOp; diff --git a/target/i386/tcg/cc_helper.c b/target/i386/tcg/cc_helper.c index f76e9cb8cfb..301ed954064 100644 --- a/target/i386/tcg/cc_helper.c +++ b/target/i386/tcg/cc_helper.c @@ -107,7 +107,7 @@ target_ulong helper_cc_compute_all(target_ulong dst, ta= rget_ulong src1, case CC_OP_CLR: return CC_Z | CC_P; case CC_OP_POPCNT: - return src1 ? 0 : CC_Z; + return dst ? 0 : CC_Z; =20 case CC_OP_MULB: return compute_all_mulb(dst, src1); diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index ad1819815ab..eb353dc3c9f 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -324,7 +324,7 @@ static const uint8_t cc_op_live[CC_OP_NB] =3D { [CC_OP_ADOX] =3D USES_CC_SRC | USES_CC_SRC2, [CC_OP_ADCOX] =3D USES_CC_DST | USES_CC_SRC | USES_CC_SRC2, [CC_OP_CLR] =3D 0, - [CC_OP_POPCNT] =3D USES_CC_SRC, + [CC_OP_POPCNT] =3D USES_CC_DST, }; =20 static void set_cc_op_1(DisasContext *s, CCOp op, bool dirty) @@ -1020,7 +1020,7 @@ static CCPrepare gen_prepare_eflags_z(DisasContext *s= , TCGv reg) case CC_OP_CLR: return (CCPrepare) { .cond =3D TCG_COND_ALWAYS }; case CC_OP_POPCNT: - return (CCPrepare) { .cond =3D TCG_COND_EQ, .reg =3D cpu_cc_src }; + return (CCPrepare) { .cond =3D TCG_COND_EQ, .reg =3D cpu_cc_dst }; default: { MemOp size =3D (s->cc_op - CC_OP_ADDB) & 3; diff --git a/target/i386/tcg/emit.c.inc b/target/i386/tcg/emit.c.inc index 11faa70b5e2..fc7477833bc 100644 --- a/target/i386/tcg/emit.c.inc +++ b/target/i386/tcg/emit.c.inc @@ -2804,10 +2804,10 @@ static void gen_POPA(DisasContext *s, X86DecodedIns= n *decode) =20 static void gen_POPCNT(DisasContext *s, X86DecodedInsn *decode) { - decode->cc_src =3D tcg_temp_new(); + decode->cc_dst =3D tcg_temp_new(); decode->cc_op =3D CC_OP_POPCNT; =20 - tcg_gen_mov_tl(decode->cc_src, s->T0); + tcg_gen_mov_tl(decode->cc_dst, s->T0); tcg_gen_ctpop_tl(s->T0, s->T0); } =20 --=20 2.45.2 From nobody Mon Nov 25 00:16:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719037029; cv=none; d=zohomail.com; s=zohoarc; b=DcRQx9Xzz/r7A1VZ7b8rHs/bB9u0qUONTXoWEMe6Mjx/X14WdNJI/bhcAN3iIjkOgtO75dTqsfMV6t3VBzZnAiqigLVyV3eErJTb3Q0mZKyblLMkVQPMMGGGDZDndlOkScNFh1TRRs7lKQZgnWfByT8qAAp8+eG6OAk2tNIw9b0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719037029; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZOCjIk5c0We/pHCIFj/HpCCrJicCDsoUAxu+ZvaTrjU=; b=FFnojRaKX92HjoG29jHEP/eP30QhuA3NJXLVofMHoyT+vF+XgUVJ7pV4S8We/kDy7uULQxdxN+fg98PNMs3q8jW12yzYTbYPe1Rgl+dKXZVmoHTTqfQMatEbDnykUmEBMOUfJ+yNxO8+ZDirciGikMHs5OoB9+DjBdj52UE9+BM= 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 1719037029509372.7161382725592; Fri, 21 Jun 2024 23:17:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKu2t-0008R0-OP; Sat, 22 Jun 2024 02:16:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu2q-0008Mk-VT for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu2p-0006Ns-Bs for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:16 -0400 Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-663-ogEhLpiiMrqvj75MpzjytA-1; Sat, 22 Jun 2024 02:16:10 -0400 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-a6f4a6537f7so115068766b.3 for ; Fri, 21 Jun 2024 23:16:10 -0700 (PDT) Received: from avogadro.local ([151.62.196.71]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6fcf5492f5sm157016666b.125.2024.06.21.23.16.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 23:16:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719036973; 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=ZOCjIk5c0We/pHCIFj/HpCCrJicCDsoUAxu+ZvaTrjU=; b=au97MkwtejyEPLcgqfw6Irv1whA9nalydAzM2SK5dkUtWyTsR4M+rJqWSEwpxAy2TQfkmA 3trBa6LtoM3/uvrbuC5EgZe2EZbqkZ9438G4HF+0LCir38V2D+EPsCpnf/oOU4myA8rpxO x50M5Wi4A7WJ7Pma7tHFsFnwX8A3iqQ= X-MC-Unique: ogEhLpiiMrqvj75MpzjytA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719036968; x=1719641768; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZOCjIk5c0We/pHCIFj/HpCCrJicCDsoUAxu+ZvaTrjU=; b=og1e5SEeHP7qkV/0Y0oo95SK6eQJI+R/z6Wzbuiq3FQNGghRcFjYJ6PdDiS0EtTCHf imoiTDc7yKW6lyZB5CkqosxwpcbhXUcCPBOsTPBWHAQytWdc/7VMV9V8QJWHvMsrgXAR Ht9t4fBQCjZ0StO939+EMz8RijlP37cc5vVBmB2v+WU0jlzak++P9RLvE40GyK5cpzKw 05jZ67WQkMSTmi/3/VK3xiK1bk/Qc+kRgZd/m7t7tWGKp3Aessw66ekpM2FMEUrbxHFA qm9QSwWJP7Uz8pYLPkZFk0rrHU4eHC19ogD//ttwGWuLOzaWHGOyw6TDC/T3tiNr0vAL lXCw== X-Gm-Message-State: AOJu0Yx8J0e06/yug8J6jRUu48cfHdybHLhuv1v+nrLVfC3LfxBpwIhN CFTtvOAfhx8Yqsk6RbdfexkkMf5GgAvyXhwG69dUhMAKVsxs/xLsytWZGxSge8nUw0mehUCdCsw y4wVutK0yi9R/EDJjaxddDZK/3UVhP8mp3YlmXuDJ537aWiIjeCn9y4d9Wma3qENV+0CBOi80jM SjJPag7zE5Fu5gyIz1bbbcUX7F3iJZG5hlEZTs X-Received: by 2002:a17:907:cb81:b0:a6f:af8e:b76d with SMTP id a640c23a62f3a-a6faf8ec937mr557398666b.49.1719036968291; Fri, 21 Jun 2024 23:16:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGQV3VAbMGw8m1V3uVhhlQ3XW5FthTqIvvImgcg3zHXtASeVm2eGZV+RpL7mwQifglv9GrrpA== X-Received: by 2002:a17:907:cb81:b0:a6f:af8e:b76d with SMTP id a640c23a62f3a-a6faf8ec937mr557398066b.49.1719036967969; Fri, 21 Jun 2024 23:16:07 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 04/23] target/i386: give CC_OP_POPCNT low bits corresponding to MO_TL Date: Sat, 22 Jun 2024 08:15:38 +0200 Message-ID: <20240622061558.530543-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240622061558.530543-1-pbonzini@redhat.com> References: <20240622061558.530543-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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719037031364100009 Content-Type: text/plain; charset="utf-8" Handle it like the other arithmetic cc_ops. This simplifies a bit the implementation of bit test instructions. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 13 +++++++++++-- target/i386/tcg/translate.c | 3 +-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index f54cd93b3f9..8504a7998fd 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1275,6 +1275,7 @@ typedef enum { CC_OP_ADCX, /* CC_DST =3D C, CC_SRC =3D rest. */ CC_OP_ADOX, /* CC_SRC2 =3D O, CC_SRC =3D rest. */ CC_OP_ADCOX, /* CC_DST =3D C, CC_SRC2 =3D O, CC_SRC =3D rest. */ + CC_OP_CLR, /* Z and P set, all other flags clear. */ =20 CC_OP_MULB, /* modify all flags, C, O =3D (CC_SRC !=3D 0) */ CC_OP_MULW, @@ -1331,8 +1332,16 @@ typedef enum { CC_OP_BMILGL, CC_OP_BMILGQ, =20 - CC_OP_CLR, /* Z set, all other flags clear. */ - CC_OP_POPCNT, /* Z via CC_DST, all other flags clear. */ + /* + * Note that only CC_OP_POPCNT (i.e. the one with MO_TL size) + * is used or implemented, because the translation needs + * to zero-extend CC_DST anyway. + */ + CC_OP_POPCNTB__, /* Z via CC_DST, all other flags clear. */ + CC_OP_POPCNTW__, + CC_OP_POPCNTL__, + CC_OP_POPCNTQ__, + CC_OP_POPCNT =3D sizeof(target_ulong) =3D=3D 8 ? CC_OP_POPCNTQ__ : CC_= OP_POPCNTL__, =20 CC_OP_NB, } CCOp; diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index eb353dc3c9f..934c514e64f 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -1019,8 +1019,6 @@ static CCPrepare gen_prepare_eflags_z(DisasContext *s= , TCGv reg) .imm =3D CC_Z }; case CC_OP_CLR: return (CCPrepare) { .cond =3D TCG_COND_ALWAYS }; - case CC_OP_POPCNT: - return (CCPrepare) { .cond =3D TCG_COND_EQ, .reg =3D cpu_cc_dst }; default: { MemOp size =3D (s->cc_op - CC_OP_ADDB) & 3; @@ -3177,6 +3175,7 @@ static void disas_insn_old(DisasContext *s, CPUState = *cpu, int b) case CC_OP_SHLB ... CC_OP_SHLQ: case CC_OP_SARB ... CC_OP_SARQ: case CC_OP_BMILGB ... CC_OP_BMILGQ: + case CC_OP_POPCNT: /* Z was going to be computed from the non-zero status of CC_D= ST. We can get that same Z value (and the new C value) by leavi= ng CC_DST alone, setting CC_SRC, and using a CC_OP_SAR of the --=20 2.45.2 From nobody Mon Nov 25 00:16:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719037055; cv=none; d=zohomail.com; s=zohoarc; b=mc711KTH0JSg5GvL2NRqUijs5WcHLgZo/ohelbF0njbjyaK5e6UJVGlwFWqdnIGZBMc67aB3wEyh8Vx6dpQWWLm4/nKfJ+UKz3ZPCEbtMx1KAS6EuubDGAzWR0McBZy9EuBplReDD2P8WxXcppqys55W/Dv2YRkxBwfdqfjttoQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719037055; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=a21jRpbZ6uLFXei7m2mIb1JchhLz3QGPG9pcKkyftnc=; b=M08Us82JZsfEZGqMqcz4cwEEMQ0+HP3K6O93Wuo/KeFxwrsKkjdM673ta6C9Muv61InFbzkouRn1dzh+dCyffYnW0MZr1POtg7vj6IEbNdd9TKRztTIksARDK0zmQUcfEaCaHJxt3daRwphiK7AYOoZlC4ThuEkF/6MZdyZpyt0= 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 1719037055314542.4077584376013; Fri, 21 Jun 2024 23:17:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKu30-0000AR-U4; Sat, 22 Jun 2024 02:16:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu2w-00004u-3x for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu2t-0006OV-HF for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:21 -0400 Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-615-yh7BFSVIM3ejyfqwxxjy1g-1; Sat, 22 Jun 2024 02:16:13 -0400 Received: by mail-ed1-f69.google.com with SMTP id 4fb4d7f45d1cf-57cb86ffb3eso1114306a12.0 for ; Fri, 21 Jun 2024 23:16:13 -0700 (PDT) Received: from avogadro.local ([151.62.196.71]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57d3042e407sm1893599a12.46.2024.06.21.23.16.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 23:16:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719036978; 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=a21jRpbZ6uLFXei7m2mIb1JchhLz3QGPG9pcKkyftnc=; b=H9vtEfxBIz9BGakxc94bD47nRZ5F/1sPBv9HIw+BYRrE19EvPS2/se+0Yiqiuwbk/cjLzl HwbLgLSvYRTxPeGhLQ8RZE2CdUH+kSK8rpEH4/uWnBdtrbKDdntwJ0IuR4uaHhdPlcKLJ8 tghTCrblhXOn4xH85vzP5KIPCi9h7LU= X-MC-Unique: yh7BFSVIM3ejyfqwxxjy1g-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719036971; x=1719641771; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=a21jRpbZ6uLFXei7m2mIb1JchhLz3QGPG9pcKkyftnc=; b=MazbFW+BM+mw7yCAsHakW4ub69JRo5cxREFLt+cV54lMBeSMcqngM/n3olSkrByx7b Q4+lJJWDAMrm+JFp1YvAU6F2k6L2Mx9RfoOUNs+DyofgOz1S5TyUZd7TM6aD31SRsrR5 zXbOixClTLiX5TuOaqB3LPSqo1s5dv7rSO0bELdBqybF7lKQPDGMxWIZY404VG72NygF /F4v/l0veb1SQ+uzYWeO7TNtnVybJqRpJkdlFncnDJ2OX9FWs3ShrIEV18l87QNHYSGo WhtNm13bbVAYW6NkbeZGS9XEsLAOJDexbN8w6nzqYRFRffswI2EpYpIGAm7G+uP/3fpb 7Vwg== X-Gm-Message-State: AOJu0YwD2fb/rXhKzkENpSoB03ej1k6D4y1lxPI5GS1HrfOk1G+L4laf ziWFB4tlhFB5KllcuzbXfJBIlf78dbQKoLWdzg+L5OUco9GEuY+BAPwhVpV76g9DCLJcp0E6C3Z s+Vz5IwwgUndmg9QmR6EsAoGnJFPbEq6hwdjmPYCZkb8D56vjPCuYrZYe43bBHyw/oMd9Kxgarw HTXo2ZfuyRjlUMuzYzE6VYwIyKP6XvmsZpL+1p X-Received: by 2002:aa7:d0d1:0:b0:57d:2db9:15e7 with SMTP id 4fb4d7f45d1cf-57d2db91688mr3795746a12.12.1719036971409; Fri, 21 Jun 2024 23:16:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH2LtvMKwVvX2ZkBK3MgK6kcWAa9tDywax20hREFUU99kw3PXolhQxfdD3QC8ilzglg3FLCwg== X-Received: by 2002:aa7:d0d1:0:b0:57d:2db9:15e7 with SMTP id 4fb4d7f45d1cf-57d2db91688mr3795728a12.12.1719036970842; Fri, 21 Jun 2024 23:16:10 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 05/23] target/i386: convert bit test instructions to new decoder Date: Sat, 22 Jun 2024 08:15:39 +0200 Message-ID: <20240622061558.530543-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240622061558.530543-1-pbonzini@redhat.com> References: <20240622061558.530543-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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719037057380100007 Content-Type: text/plain; charset="utf-8" Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.h | 3 + target/i386/tcg/translate.c | 147 +----------------------------- target/i386/tcg/decode-new.c.inc | 40 ++++++--- target/i386/tcg/emit.c.inc | 149 ++++++++++++++++++++++++++++++- 4 files changed, 181 insertions(+), 158 deletions(-) diff --git a/target/i386/tcg/decode-new.h b/target/i386/tcg/decode-new.h index f9bf9a60411..e4cdf5e3c4f 100644 --- a/target/i386/tcg/decode-new.h +++ b/target/i386/tcg/decode-new.h @@ -190,6 +190,9 @@ typedef enum X86InsnSpecial { /* Always locked if it has a memory operand (XCHG) */ X86_SPECIAL_Locked, =20 + /* Like HasLock, but also operand 2 provides bit displacement into mem= ory. */ + X86_SPECIAL_BitTest, + /* Do not load effective address in s->A0 */ X86_SPECIAL_NoLoadEA, =20 diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 934c514e64f..257110ac703 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -708,11 +708,6 @@ static TCGv gen_ext_tl(TCGv dst, TCGv src, MemOp size,= bool sign) return dst; } =20 -static void gen_exts(MemOp ot, TCGv reg) -{ - gen_ext_tl(reg, reg, ot, true); -} - static void gen_op_j_ecx(DisasContext *s, TCGCond cond, TCGLabel *label1) { TCGv tmp =3D gen_ext_tl(NULL, cpu_regs[R_ECX], s->aflag, false); @@ -2985,7 +2980,7 @@ static void disas_insn_old(DisasContext *s, CPUState = *cpu, int b) int prefixes =3D s->prefix; MemOp dflag =3D s->dflag; MemOp ot; - int modrm, reg, rm, mod, op, val; + int modrm, reg, rm, mod, op; =20 /* now check op code */ switch (b) { @@ -3051,146 +3046,6 @@ static void disas_insn_old(DisasContext *s, CPUStat= e *cpu, int b) } break; =20 - /************************/ - /* bit operations */ - case 0x1ba: /* bt/bts/btr/btc Gv, im */ - ot =3D dflag; - modrm =3D x86_ldub_code(env, s); - op =3D (modrm >> 3) & 7; - mod =3D (modrm >> 6) & 3; - rm =3D (modrm & 7) | REX_B(s); - if (mod !=3D 3) { - s->rip_offset =3D 1; - gen_lea_modrm(env, s, modrm); - if (!(s->prefix & PREFIX_LOCK)) { - gen_op_ld_v(s, ot, s->T0, s->A0); - } - } else { - gen_op_mov_v_reg(s, ot, s->T0, rm); - } - /* load shift */ - val =3D x86_ldub_code(env, s); - tcg_gen_movi_tl(s->T1, val); - if (op < 4) - goto unknown_op; - op -=3D 4; - goto bt_op; - case 0x1a3: /* bt Gv, Ev */ - op =3D 0; - goto do_btx; - case 0x1ab: /* bts */ - op =3D 1; - goto do_btx; - case 0x1b3: /* btr */ - op =3D 2; - goto do_btx; - case 0x1bb: /* btc */ - op =3D 3; - do_btx: - ot =3D dflag; - modrm =3D x86_ldub_code(env, s); - reg =3D ((modrm >> 3) & 7) | REX_R(s); - mod =3D (modrm >> 6) & 3; - rm =3D (modrm & 7) | REX_B(s); - gen_op_mov_v_reg(s, MO_32, s->T1, reg); - if (mod !=3D 3) { - AddressParts a =3D gen_lea_modrm_0(env, s, modrm); - /* specific case: we need to add a displacement */ - gen_exts(ot, s->T1); - tcg_gen_sari_tl(s->tmp0, s->T1, 3 + ot); - tcg_gen_shli_tl(s->tmp0, s->tmp0, ot); - tcg_gen_add_tl(s->A0, gen_lea_modrm_1(s, a, false), s->tmp0); - gen_lea_v_seg(s, s->A0, a.def_seg, s->override); - if (!(s->prefix & PREFIX_LOCK)) { - gen_op_ld_v(s, ot, s->T0, s->A0); - } - } else { - gen_op_mov_v_reg(s, ot, s->T0, rm); - } - bt_op: - tcg_gen_andi_tl(s->T1, s->T1, (1 << (3 + ot)) - 1); - tcg_gen_movi_tl(s->tmp0, 1); - tcg_gen_shl_tl(s->tmp0, s->tmp0, s->T1); - if (s->prefix & PREFIX_LOCK) { - switch (op) { - case 0: /* bt */ - /* Needs no atomic ops; we suppressed the normal - memory load for LOCK above so do it now. */ - gen_op_ld_v(s, ot, s->T0, s->A0); - break; - case 1: /* bts */ - tcg_gen_atomic_fetch_or_tl(s->T0, s->A0, s->tmp0, - s->mem_index, ot | MO_LE); - break; - case 2: /* btr */ - tcg_gen_not_tl(s->tmp0, s->tmp0); - tcg_gen_atomic_fetch_and_tl(s->T0, s->A0, s->tmp0, - s->mem_index, ot | MO_LE); - break; - default: - case 3: /* btc */ - tcg_gen_atomic_fetch_xor_tl(s->T0, s->A0, s->tmp0, - s->mem_index, ot | MO_LE); - break; - } - tcg_gen_shr_tl(s->tmp4, s->T0, s->T1); - } else { - tcg_gen_shr_tl(s->tmp4, s->T0, s->T1); - switch (op) { - case 0: /* bt */ - /* Data already loaded; nothing to do. */ - break; - case 1: /* bts */ - tcg_gen_or_tl(s->T0, s->T0, s->tmp0); - break; - case 2: /* btr */ - tcg_gen_andc_tl(s->T0, s->T0, s->tmp0); - break; - default: - case 3: /* btc */ - tcg_gen_xor_tl(s->T0, s->T0, s->tmp0); - break; - } - if (op !=3D 0) { - if (mod !=3D 3) { - gen_op_st_v(s, ot, s->T0, s->A0); - } else { - gen_op_mov_reg_v(s, ot, rm, s->T0); - } - } - } - - /* Delay all CC updates until after the store above. Note that - C is the result of the test, Z is unchanged, and the others - are all undefined. */ - switch (s->cc_op) { - case CC_OP_MULB ... CC_OP_MULQ: - case CC_OP_ADDB ... CC_OP_ADDQ: - case CC_OP_ADCB ... CC_OP_ADCQ: - case CC_OP_SUBB ... CC_OP_SUBQ: - case CC_OP_SBBB ... CC_OP_SBBQ: - case CC_OP_LOGICB ... CC_OP_LOGICQ: - case CC_OP_INCB ... CC_OP_INCQ: - case CC_OP_DECB ... CC_OP_DECQ: - case CC_OP_SHLB ... CC_OP_SHLQ: - case CC_OP_SARB ... CC_OP_SARQ: - case CC_OP_BMILGB ... CC_OP_BMILGQ: - case CC_OP_POPCNT: - /* Z was going to be computed from the non-zero status of CC_D= ST. - We can get that same Z value (and the new C value) by leavi= ng - CC_DST alone, setting CC_SRC, and using a CC_OP_SAR of the - same width. */ - tcg_gen_mov_tl(cpu_cc_src, s->tmp4); - set_cc_op(s, ((s->cc_op - CC_OP_MULB) & 3) + CC_OP_SARB); - break; - default: - /* Otherwise, generate EFLAGS and replace the C bit. */ - gen_compute_eflags(s); - tcg_gen_deposit_tl(cpu_cc_src, cpu_cc_src, s->tmp4, - ctz32(CC_C), 1); - break; - } - break; case 0x100: modrm =3D x86_ldub_code(env, s); mod =3D (modrm >> 6) & 3; diff --git a/target/i386/tcg/decode-new.c.inc b/target/i386/tcg/decode-new.= c.inc index 0d846c32c22..33ffcf092ec 100644 --- a/target/i386/tcg/decode-new.c.inc +++ b/target/i386/tcg/decode-new.c.inc @@ -205,6 +205,7 @@ #define sextT0 .special =3D X86_SPECIAL_SExtT0, #define zextT0 .special =3D X86_SPECIAL_ZExtT0, #define op0_Mw .special =3D X86_SPECIAL_Op0_Mw, +#define btEvGv .special =3D X86_SPECIAL_BitTest, =20 #define vex1 .vex_class =3D 1, #define vex1_rep3 .vex_class =3D 1, .vex_special =3D X86_VEX_REPScalar, @@ -269,6 +270,24 @@ static inline const X86OpEntry *decode_by_prefix(Disas= Context *s, const X86OpEnt } } =20 +static void decode_group8(DisasContext *s, CPUX86State *env, X86OpEntry *e= ntry, uint8_t *b) +{ + static const X86GenFunc group8_gen[8] =3D { + NULL, NULL, NULL, NULL, + gen_BT, gen_BTS, gen_BTR, gen_BTC, + }; + int op =3D (get_modrm(s, env) >> 3) & 7; + entry->gen =3D group8_gen[op]; + if (op =3D=3D 4) { + /* prevent writeback and LOCK for BT */ + entry->op1 =3D entry->op0; + entry->op0 =3D X86_TYPE_None; + entry->s0 =3D X86_SIZE_None; + } else { + entry->special =3D X86_SPECIAL_HasLock; + } +} + static void decode_group15(DisasContext *s, CPUX86State *env, X86OpEntry *= entry, uint8_t *b) { static const X86OpEntry group15_reg[8] =3D { @@ -1162,12 +1181,14 @@ static const X86OpEntry opcodes_0F[256] =3D { [0xa0] =3D X86_OP_ENTRYr(PUSH, FS, w), [0xa1] =3D X86_OP_ENTRYw(POP, FS, w), [0xa2] =3D X86_OP_ENTRY0(CPUID), + [0xa3] =3D X86_OP_ENTRYrr(BT, E,v, G,v, btEvGv), [0xa4] =3D X86_OP_ENTRY4(SHLD, E,v, 2op,v, G,v), [0xa5] =3D X86_OP_ENTRY3(SHLD, E,v, 2op,v, G,v), =20 [0xb0] =3D X86_OP_ENTRY2(CMPXCHG,E,b, G,b, lock), [0xb1] =3D X86_OP_ENTRY2(CMPXCHG,E,v, G,v, lock), [0xb2] =3D X86_OP_ENTRY3(LSS, G,v, EM,p, None, None), + [0xb3] =3D X86_OP_ENTRY2(BTR, E,v, G,v, btEvGv), [0xb4] =3D X86_OP_ENTRY3(LFS, G,v, EM,p, None, None), [0xb5] =3D X86_OP_ENTRY3(LGS, G,v, EM,p, None, None), [0xb6] =3D X86_OP_ENTRY3(MOV, G,v, E,b, None, None, zextT0), /* MOV= ZX */ @@ -1294,6 +1315,7 @@ static const X86OpEntry opcodes_0F[256] =3D { [0xa8] =3D X86_OP_ENTRYr(PUSH, GS, w), [0xa9] =3D X86_OP_ENTRYw(POP, GS, w), [0xaa] =3D X86_OP_ENTRY0(RSM, chk(smm) svm(RSM)), + [0xab] =3D X86_OP_ENTRY2(BTS, E,v, G,v, btEvGv), [0xac] =3D X86_OP_ENTRY4(SHRD, E,v, 2op,v, G,v), [0xad] =3D X86_OP_ENTRY3(SHRD, E,v, 2op,v, G,v), [0xae] =3D X86_OP_GROUP0(group15), @@ -1306,6 +1328,8 @@ static const X86OpEntry opcodes_0F[256] =3D { [0xb8] =3D X86_OP_GROUP0(0FB8), /* decoded as modrm, which is visible as a difference between page fau= lt and #UD */ [0xb9] =3D X86_OP_ENTRYr(UD, nop,v), /* UD1= */ + [0xba] =3D X86_OP_GROUP2(group8, E,v, I,b), + [0xbb] =3D X86_OP_ENTRY2(BTC, E,v, G,v, btEvGv), [0xbc] =3D X86_OP_GROUP0(0FBC), [0xbd] =3D X86_OP_GROUP0(0FBD), [0xbe] =3D X86_OP_ENTRY3(MOV, G,v, E,b, None, None, sextT0), /* MOV= SX */ @@ -2424,6 +2448,7 @@ static void disas_insn(DisasContext *s, CPUState *cpu) CPUX86State *env =3D cpu_env(cpu); X86DecodedInsn decode; X86DecodeFunc decode_func =3D decode_root; + bool accept_lock =3D false; uint8_t cc_live, b; =20 s->pc =3D s->base.pc_next; @@ -2597,10 +2622,6 @@ static void disas_insn(DisasContext *s, CPUState *cp= u) switch (b) { case 0x00 ... 0x01: /* mostly privileged instructions */ case 0x1a ... 0x1b: /* MPX */ - case 0xa3: /* bt */ - case 0xab: /* bts */ - case 0xb3: /* btr */ - case 0xba ... 0xbb: /* grp8, btc */ case 0xc7: /* grp9 */ disas_insn_old(s, cpu, b + 0x100); return; @@ -2662,9 +2683,10 @@ static void disas_insn(DisasContext *s, CPUState *cp= u) if (decode.op[0].has_ea) { s->prefix |=3D PREFIX_LOCK; } - decode.e.special =3D X86_SPECIAL_HasLock; /* fallthrough */ case X86_SPECIAL_HasLock: + case X86_SPECIAL_BitTest: + accept_lock =3D decode.op[0].has_ea; break; =20 case X86_SPECIAL_Op0_Rd: @@ -2706,10 +2728,8 @@ static void disas_insn(DisasContext *s, CPUState *cp= u) break; } =20 - if (s->prefix & PREFIX_LOCK) { - if (decode.e.special !=3D X86_SPECIAL_HasLock || !decode.op[0].has= _ea) { - goto illegal_op; - } + if ((s->prefix & PREFIX_LOCK) && !accept_lock) { + goto illegal_op; } =20 if (!validate_vex(s, &decode)) { @@ -2755,7 +2775,7 @@ static void disas_insn(DisasContext *s, CPUState *cpu) =20 if (decode.e.special !=3D X86_SPECIAL_NoLoadEA && (decode.op[0].has_ea || decode.op[1].has_ea || decode.op[2].has_ea= )) { - gen_load_ea(s, &decode.mem, decode.e.vex_class =3D=3D 12); + gen_load_ea(s, &decode); } if (s->prefix & PREFIX_LOCK) { gen_load(s, &decode, 2, s->T1); diff --git a/target/i386/tcg/emit.c.inc b/target/i386/tcg/emit.c.inc index fc7477833bc..a25dff0570c 100644 --- a/target/i386/tcg/emit.c.inc +++ b/target/i386/tcg/emit.c.inc @@ -73,9 +73,25 @@ static void gen_NM_exception(DisasContext *s) gen_exception(s, EXCP07_PREX); } =20 -static void gen_load_ea(DisasContext *s, AddressParts *mem, bool is_vsib) +static void gen_load_ea(DisasContext *s, X86DecodedInsn *decode) { - TCGv ea =3D gen_lea_modrm_1(s, *mem, is_vsib); + AddressParts *mem =3D &decode->mem; + TCGv ea; + + ea =3D gen_lea_modrm_1(s, *mem, decode->e.vex_class =3D=3D 12); + if (decode->e.special =3D=3D X86_SPECIAL_BitTest) { + MemOp ot =3D decode->op[1].ot; + int poslen =3D 8 << ot; + TCGv ofs =3D tcg_temp_new(); + + /* Extract memory displacement from T1. */ + assert(decode->op[2].unit =3D=3D X86_OP_INT); + tcg_gen_sextract_tl(ofs, s->T1, 3, poslen - 3); + tcg_gen_andi_tl(ofs, ofs, -1 << ot); + tcg_gen_add_tl(s->A0, ea, ofs); + ea =3D s->A0; + } + gen_lea_v_seg(s, ea, mem->def_seg, s->override); } =20 @@ -407,6 +423,32 @@ static void prepare_update3_cc(X86DecodedInsn *decode,= DisasContext *s, CCOp op, decode->cc_op =3D op; } =20 +/* Set up decode->cc_* to modify CF while keeping other flags unchanged. = */ +static void prepare_update_cf(X86DecodedInsn *decode, DisasContext *s, TCG= v cf) +{ + switch (s->cc_op) { + case CC_OP_ADOX: + case CC_OP_ADCOX: + decode->cc_src2 =3D cpu_cc_src2; + decode->cc_src =3D cpu_cc_src; + decode->cc_op =3D CC_OP_ADCOX; + break; + + case CC_OP_EFLAGS: + case CC_OP_ADCX: + decode->cc_src =3D cpu_cc_src; + decode->cc_op =3D CC_OP_ADCX; + break; + + default: + decode->cc_src =3D tcg_temp_new(); + gen_mov_eflags(s, decode->cc_src); + decode->cc_op =3D CC_OP_ADCX; + break; + } + decode->cc_dst =3D cf; +} + static void gen_store_sse(DisasContext *s, X86DecodedInsn *decode, int src= _ofs) { MemOp ot =3D decode->op[0].ot; @@ -1385,6 +1427,109 @@ static void gen_BSWAP(DisasContext *s, X86DecodedIn= sn *decode) tcg_gen_bswap32_tl(s->T0, s->T0, TCG_BSWAP_OZ); } =20 +static TCGv gen_bt_mask(DisasContext *s, X86DecodedInsn *decode) +{ + MemOp ot =3D decode->op[1].ot; + TCGv mask =3D tcg_temp_new(); + + tcg_gen_andi_tl(s->T1, s->T1, (8 << ot) - 1); + tcg_gen_shl_tl(mask, tcg_constant_tl(1), s->T1); + return mask; +} + +/* Expects truncated bit index in s->T1, 1 << s->T1 in MASK. */ +static void gen_bt_flags(DisasContext *s, X86DecodedInsn *decode, TCGv src= , TCGv mask) +{ + TCGv cf; + + /* + * C is the result of the test, Z is unchanged, and the others + * are all undefined. + */ + switch (s->cc_op) { + case CC_OP_DYNAMIC: + case CC_OP_CLR: + case CC_OP_EFLAGS: + case CC_OP_ADCX: + case CC_OP_ADOX: + case CC_OP_ADCOX: + /* Generate EFLAGS and replace the C bit. */ + cf =3D tcg_temp_new(); + tcg_gen_setcond_tl(TCG_COND_TSTNE, cf, src, mask); + prepare_update_cf(decode, s, cf); + break; + default: + /* + * Z was going to be computed from the non-zero status of CC_DST. + * We can get that same Z value (and the new C value) by leaving + * CC_DST alone, setting CC_SRC, and using a CC_OP_SAR of the + * same width. + */ + decode->cc_src =3D tcg_temp_new(); + decode->cc_dst =3D cpu_cc_dst; + decode->cc_op =3D ((s->cc_op - CC_OP_MULB) & 3) + CC_OP_SARB; + tcg_gen_shr_tl(decode->cc_src, src, s->T1); + break; + } +} + +static void gen_BT(DisasContext *s, X86DecodedInsn *decode) +{ + TCGv mask =3D gen_bt_mask(s, decode); + + gen_bt_flags(s, decode, s->T0, mask); +} + +static void gen_BTC(DisasContext *s, X86DecodedInsn *decode) +{ + MemOp ot =3D decode->op[0].ot; + TCGv old =3D tcg_temp_new(); + TCGv mask =3D gen_bt_mask(s, decode); + + if (s->prefix & PREFIX_LOCK) { + tcg_gen_atomic_fetch_xor_tl(old, s->A0, mask, s->mem_index, ot | M= O_LE); + } else { + tcg_gen_mov_tl(old, s->T0); + tcg_gen_xor_tl(s->T0, s->T0, mask); + } + + gen_bt_flags(s, decode, old, mask); +} + +static void gen_BTR(DisasContext *s, X86DecodedInsn *decode) +{ + MemOp ot =3D decode->op[0].ot; + TCGv old =3D tcg_temp_new(); + TCGv mask =3D gen_bt_mask(s, decode); + + if (s->prefix & PREFIX_LOCK) { + TCGv maskc =3D tcg_temp_new(); + tcg_gen_not_tl(maskc, mask); + tcg_gen_atomic_fetch_and_tl(old, s->A0, maskc, s->mem_index, ot | = MO_LE); + } else { + tcg_gen_mov_tl(old, s->T0); + tcg_gen_andc_tl(s->T0, s->T0, mask); + } + + gen_bt_flags(s, decode, old, mask); +} + +static void gen_BTS(DisasContext *s, X86DecodedInsn *decode) +{ + MemOp ot =3D decode->op[0].ot; + TCGv old =3D tcg_temp_new(); + TCGv mask =3D gen_bt_mask(s, decode); + + if (s->prefix & PREFIX_LOCK) { + tcg_gen_atomic_fetch_or_tl(old, s->A0, mask, s->mem_index, ot | MO= _LE); + } else { + tcg_gen_mov_tl(old, s->T0); + tcg_gen_or_tl(s->T0, s->T0, mask); + } + + gen_bt_flags(s, decode, old, mask); +} + static void gen_BZHI(DisasContext *s, X86DecodedInsn *decode) { MemOp ot =3D decode->op[0].ot; --=20 2.45.2 From nobody Mon Nov 25 00:16:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719037069; cv=none; d=zohomail.com; s=zohoarc; b=abprZcaBU2UB57dIuX88bssZEGd7sSyc8R2ivvuu/M561YpCD6iCM2yo0jadF/xCock191BWCwf4NFu/0Qk2hLPfwYa9jNJIZ0ujAREAj/nQF8XcnGWD0nzTb4JLby9nqSmRZMNRDl3vIYnrBtoTc1+YsAqLA49FMMKq+Gyomvc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719037069; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0F40cqKCPHJRg9Bf8XAVVDWTEv30OQa6Reu6MXFFvnU=; b=WwbcafljV3IxyIOokOKMqwfQ8JRsBsRfj+mhJequYsXbwHyGOoqcF8DaBmn9B8JXHRdeqaZT19IR40Po7UPsoIjfXcYIWqIFFWdTIh7IfjUrCTnpZVzMg8aPY2AOFw2OR9lkJiwlX8VyXchCrmP9D24QufcUQWF3s/Qi2qDRchk= 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 1719037069773932.1449425869192; Fri, 21 Jun 2024 23:17:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKu2x-00005l-Kn; Sat, 22 Jun 2024 02:16:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu2v-0008WT-Tr for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu2u-0006OX-CY for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:21 -0400 Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-562-JqOsH3VqNA2b281slafHLw-1; Sat, 22 Jun 2024 02:16:16 -0400 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-a6fe8b2bcc4so6651266b.0 for ; Fri, 21 Jun 2024 23:16:16 -0700 (PDT) Received: from avogadro.local ([151.62.196.71]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6fcf560746sm155618266b.156.2024.06.21.23.16.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 23:16:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719036978; 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=0F40cqKCPHJRg9Bf8XAVVDWTEv30OQa6Reu6MXFFvnU=; b=CbQalDq9XBLxGpvEjQqMmkAXcFd5uplwUQrCJjYHRc8qeFoi/RNoPrLufzPMkggQBOd3+2 4j8RindenXlKhbb+fifMgkMs8PXLFVYw6G3S6BX0VOiXKNJyiy/Zc5LoO9ygY1cc6zeoMI S8Wy4nqcgGu84cFXKVsv33P00A0YZwA= X-MC-Unique: JqOsH3VqNA2b281slafHLw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719036974; x=1719641774; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0F40cqKCPHJRg9Bf8XAVVDWTEv30OQa6Reu6MXFFvnU=; b=e8FJW4W8GmaghAHg95A1N49TepBob1KTEw0oF1PQxMmPgOEuNB6JeFKyIWWYca25m/ xpZsbMuqg5tefwwDf2vLzhxm/Z8HyUA4qjNB4y0zT6gb75OHWf+jN+IVGfN5hjljARkp nqI6iaxU7VJqP3cT54QrhjX/DwJcuHt1Uirq6GDRkPAqJKFZE0FNDGX1v4Jw0JOpryQl /slfd2YPz51v8sqaHxiE6WqJ0No0ppsupRBmuA4U08RFhdT2IRiX9nYgXqddyFGy8eaf QG2yaRJjvjLSsY6xs1Zi70+yZiRnXrYR/fMWdLLYu/YQD/QpCH8WWbuV3tfanIfesYqO kicA== X-Gm-Message-State: AOJu0Yz15LX+OPKUxAT+Ugy2S22Q7/5pVc7eP/D+l/a319s7AaX/3OXw 1q/XTbfDUmLhGsabaV6BAKtvbrYqMSVgduupjTr3VkIjzrXyXFn5KwAY0PzEOv4kLMNx4Djz5Ww fKx64MQAXa5LV2MfaZXAv/A0fyidaDMm5EUYtmnz080rFiumv7rc6b4L55a+QIvBqVH23vNK1Ck jvsxzmi5+kKBL+weVZOMAqgpPleZ4asr3Os56r X-Received: by 2002:a17:907:c249:b0:a6f:b67d:95aa with SMTP id a640c23a62f3a-a714d72bd9fmr16227366b.2.1719036974308; Fri, 21 Jun 2024 23:16:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHYqXklko0zhHBsxWlMphzJMtieTUJ9nAbSKQo2KaaZMQCHb4RUEzudr59F0WZyXAUPUM9wZg== X-Received: by 2002:a17:907:c249:b0:a6f:b67d:95aa with SMTP id a640c23a62f3a-a714d72bd9fmr16225866b.2.1719036973955; Fri, 21 Jun 2024 23:16:13 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 06/23] target/i386: try not to force EFLAGS computation for CC_OP_ADOX/ADCX Date: Sat, 22 Jun 2024 08:15:40 +0200 Message-ID: <20240622061558.530543-7-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240622061558.530543-1-pbonzini@redhat.com> References: <20240622061558.530543-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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719037071417100003 Content-Type: text/plain; charset="utf-8" When computing the "other" flag (CF for CC_OP_ADOX, OF for CC_OP_ADCX), take into account that it is already in the right position of cpu_cc_src, just like for CC_OP_EFLAGS. There is no need to call gen_compute_eflags(). Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 257110ac703..08db40681fa 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -928,6 +928,7 @@ static CCPrepare gen_prepare_eflags_c(DisasContext *s, = TCGv reg) .no_setcond =3D true }; =20 case CC_OP_EFLAGS: + case CC_OP_ADOX: case CC_OP_SARB ... CC_OP_SARQ: /* CC_SRC & 1 */ return (CCPrepare) { .cond =3D TCG_COND_TSTNE, @@ -994,6 +995,9 @@ static CCPrepare gen_prepare_eflags_o(DisasContext *s, = TCGv reg) return (CCPrepare) { .cond =3D TCG_COND_NE, .reg =3D cpu_cc_src }; default: gen_compute_eflags(s); + /* fallthrough */ + case CC_OP_EFLAGS: + case CC_OP_ADCX: return (CCPrepare) { .cond =3D TCG_COND_TSTNE, .reg =3D cpu_cc_src, .imm =3D CC_O }; } --=20 2.45.2 From nobody Mon Nov 25 00:16:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719037029; cv=none; d=zohomail.com; s=zohoarc; b=ZFBSvhvK/tDXbOV37+ve0omD4g720P7RMuPXubXRq/pCvrsqtyzcAuGrBMC+wPshON1nBYKEGcdgXCGwP5vSpH5IjWLgWwT+KKn9PuLhiqzOvmH09+S33ofcijzC94fNkUVX7r/cDrfX1SOVpNmXr17smIslSQVrnWjuKW1G4t4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719037029; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=OtBqhhd2Tl8yeJJhVmC0tA4DyBk4avu2gh8sHJfHAKM=; b=i+mvLG5rUR/IdliauuZbco9aSXS7oQYdRUWOhQUmw+5xqPgZLodCmALPCfuSBnX0JQ60WDFSf9lTbNWLMKq5H0c51nEQacvYvYs3jKG/vsv2cKCb36s+xvAZkTb+whzG+gYLYAKkrrzPk00t2RJUWnZJW7wTcKRxTysrBB5LwPU= 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 1719037029822330.0741438527159; Fri, 21 Jun 2024 23:17:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKu35-0000DM-9y; Sat, 22 Jun 2024 02:16:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu2z-0000AS-W5 for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu2x-0006Q7-18 for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:25 -0400 Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-219-8SgLZ8cHOX2X3QjQlEqNsA-1; Sat, 22 Jun 2024 02:16:19 -0400 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a7169b4cfcfso3433066b.0 for ; Fri, 21 Jun 2024 23:16:19 -0700 (PDT) Received: from avogadro.local ([151.62.196.71]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6fcf560885sm156075266b.166.2024.06.21.23.16.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 23:16:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719036981; 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=OtBqhhd2Tl8yeJJhVmC0tA4DyBk4avu2gh8sHJfHAKM=; b=JnhG6LEOqtZyq+aGaW8+ZuoAFUqKO6bxYR4WBPwNDiX4F/A2mxnBmw/wwnACZTMiYtcVzC QpOoAwXtnx4/rBdgHkAUps8JwHfw7CQDQDyZgI98xPr9W3cFYJRd53yb2aDoF6HxjqWwTC jFRotbC1b7GKjYgOi1D6h98vi5jZze0= X-MC-Unique: 8SgLZ8cHOX2X3QjQlEqNsA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719036977; x=1719641777; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OtBqhhd2Tl8yeJJhVmC0tA4DyBk4avu2gh8sHJfHAKM=; b=RzOMgoNub8JOC0SfL7FXFvrM/EZ8FeX/cZBKUv7r4f5Ofjji/k5R7jfXcsdXsWdoZs yZ5irvrs5fVs17JRZY70A3ghEgTj2cZE3Gmg4EO3QVpZR+O0h4Qw8zjkM9tG47JL+HYU Q3ptxXm7nz6Fr/vgJFhbF5XzykX5HNCwEEp6uDnK5KeCn0FPR/Ed+Euo6TXUw6JDehZM 4OqeE/KH43y2XyYG35LJOQR9ruk1DiKJEjKYGAyliI6v66lXwkEM91ycxbHZAwsmD50A KBZ0jzz/BJi0jDv3Cp5tJ0NEqk2FztkEQlPBpYpxDzRFIHqpTCD9o9sYWxU0VNAwP6Se EZNg== X-Gm-Message-State: AOJu0YzVGSoZNiWZFKPMeMy2GZ1jJbGPtVg+3vbrtZTu1IPwSyqY4wOJ k24PFL71bUhijSMNLVjVoHnYjELJ5F8pFcklrdT80PgpuJtG7+uwGo77BosKTN3H4yMrsmiKyYR EModwO0fPWZHTgPG8rm8q1dl9cSyIiKGVInYEH3upCY942yeTR8kFnmYz5S9KdQN64xo8Il0dF8 jWme/HVH/Ms8WA6vqPYRpzKCaKVDXIS0lu0wGH X-Received: by 2002:a17:907:8e8d:b0:a6f:49bc:e857 with SMTP id a640c23a62f3a-a6fab60bb88mr702393866b.6.1719036977263; Fri, 21 Jun 2024 23:16:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE6EiopQaI9OQKO2YL+ABGvCrPYLgmfuJ6rYpsQE5pZduO1dEiQT4boC/x+3nc7gWrCzRlDrg== X-Received: by 2002:a17:907:8e8d:b0:a6f:49bc:e857 with SMTP id a640c23a62f3a-a6fab60bb88mr702392166b.6.1719036976697; Fri, 21 Jun 2024 23:16:16 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 07/23] target/i386: decode address before going back to translate.c Date: Sat, 22 Jun 2024 08:15:41 +0200 Message-ID: <20240622061558.530543-8-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240622061558.530543-1-pbonzini@redhat.com> References: <20240622061558.530543-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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719037031413100012 Content-Type: text/plain; charset="utf-8" There are now relatively few unconverted opcodes in translate.c (there are 13 of them including 8 for x87), and all of them have the same format with a mod/rm byte and no immediate. A good next step is to remove the early bail out to disas_insn_x87/disas_insn_old, instead giving these legacy translator functions the same prototype as the other gen_* functions. To do this, the X86DecodeInsn can be passed down to the places that used to fetch address bytes from the instruction stream. To make sure that everything is done cleanly, the CPUX86State* argument is removed. As part of the unification, the gen_lea_modrm() name is now free, so rename gen_load_ea() to gen_lea_modrm(). This is as good a name and it makes the changes to translate.c easier to review. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.h | 14 ++- target/i386/tcg/translate.c | 152 +++++++++++++------------------ target/i386/tcg/decode-new.c.inc | 53 ++++++----- target/i386/tcg/emit.c.inc | 2 +- 4 files changed, 103 insertions(+), 118 deletions(-) diff --git a/target/i386/tcg/decode-new.h b/target/i386/tcg/decode-new.h index e4cdf5e3c4f..bebc77bd54b 100644 --- a/target/i386/tcg/decode-new.h +++ b/target/i386/tcg/decode-new.h @@ -264,12 +264,13 @@ typedef enum X86VEXSpecial { =20 typedef struct X86OpEntry X86OpEntry; typedef struct X86DecodedInsn X86DecodedInsn; +struct DisasContext; =20 /* Decode function for multibyte opcodes. */ -typedef void (*X86DecodeFunc)(DisasContext *s, CPUX86State *env, X86OpEntr= y *entry, uint8_t *b); +typedef void (*X86DecodeFunc)(struct DisasContext *s, CPUX86State *env, X8= 6OpEntry *entry, uint8_t *b); =20 /* Code generation function. */ -typedef void (*X86GenFunc)(DisasContext *s, X86DecodedInsn *decode); +typedef void (*X86GenFunc)(struct DisasContext *s, X86DecodedInsn *decode); =20 struct X86OpEntry { /* Based on the is_decode flags. */ @@ -316,6 +317,14 @@ typedef struct X86DecodedOp { }; } X86DecodedOp; =20 +typedef struct AddressParts { + int def_seg; + int base; + int index; + int scale; + target_long disp; +} AddressParts; + struct X86DecodedInsn { X86OpEntry e; X86DecodedOp op[3]; @@ -333,3 +342,4 @@ struct X86DecodedInsn { uint8_t b; }; =20 +static void gen_lea_modrm(struct DisasContext *s, X86DecodedInsn *decode); diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 08db40681fa..1d845ff66bb 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -29,6 +29,7 @@ #include "exec/helper-proto.h" #include "exec/helper-gen.h" #include "helper-tcg.h" +#include "decode-new.h" =20 #include "exec/log.h" =20 @@ -1529,14 +1530,6 @@ static inline uint64_t x86_ldq_code(CPUX86State *env= , DisasContext *s) =20 /* Decompose an address. */ =20 -typedef struct AddressParts { - int def_seg; - int base; - int index; - int scale; - target_long disp; -} AddressParts; - static AddressParts gen_lea_modrm_0(CPUX86State *env, DisasContext *s, int modrm) { @@ -1695,24 +1688,11 @@ static TCGv gen_lea_modrm_1(DisasContext *s, Addres= sParts a, bool is_vsib) return ea; } =20 -static void gen_lea_modrm(CPUX86State *env, DisasContext *s, int modrm) -{ - AddressParts a =3D gen_lea_modrm_0(env, s, modrm); - TCGv ea =3D gen_lea_modrm_1(s, a, false); - gen_lea_v_seg(s, ea, a.def_seg, s->override); -} - -static void gen_nop_modrm(CPUX86State *env, DisasContext *s, int modrm) -{ - (void)gen_lea_modrm_0(env, s, modrm); -} - /* Used for BNDCL, BNDCU, BNDCN. */ -static void gen_bndck(CPUX86State *env, DisasContext *s, int modrm, +static void gen_bndck(DisasContext *s, X86DecodedInsn *decode, TCGCond cond, TCGv_i64 bndv) { - AddressParts a =3D gen_lea_modrm_0(env, s, modrm); - TCGv ea =3D gen_lea_modrm_1(s, a, false); + TCGv ea =3D gen_lea_modrm_1(s, decode->mem, false); =20 tcg_gen_extu_tl_i64(s->tmp1_i64, ea); if (!CODE64(s)) { @@ -1724,8 +1704,9 @@ static void gen_bndck(CPUX86State *env, DisasContext = *s, int modrm, } =20 /* generate modrm load of memory or register. */ -static void gen_ld_modrm(CPUX86State *env, DisasContext *s, int modrm, Mem= Op ot) +static void gen_ld_modrm(DisasContext *s, X86DecodedInsn *decode, MemOp ot) { + int modrm =3D s->modrm; int mod, rm; =20 mod =3D (modrm >> 6) & 3; @@ -1733,14 +1714,15 @@ static void gen_ld_modrm(CPUX86State *env, DisasCon= text *s, int modrm, MemOp ot) if (mod =3D=3D 3) { gen_op_mov_v_reg(s, ot, s->T0, rm); } else { - gen_lea_modrm(env, s, modrm); + gen_lea_modrm(s, decode); gen_op_ld_v(s, ot, s->T0, s->A0); } } =20 /* generate modrm store of memory or register. */ -static void gen_st_modrm(CPUX86State *env, DisasContext *s, int modrm, Mem= Op ot) +static void gen_st_modrm(DisasContext *s, X86DecodedInsn *decode, MemOp ot) { + int modrm =3D s->modrm; int mod, rm; =20 mod =3D (modrm >> 6) & 3; @@ -1748,7 +1730,7 @@ static void gen_st_modrm(CPUX86State *env, DisasConte= xt *s, int modrm, MemOp ot) if (mod =3D=3D 3) { gen_op_mov_reg_v(s, ot, rm, s->T0); } else { - gen_lea_modrm(env, s, modrm); + gen_lea_modrm(s, decode); gen_op_st_v(s, ot, s->T0, s->A0); } } @@ -2316,12 +2298,12 @@ static void gen_sty_env_A0(DisasContext *s, int off= set, bool align) tcg_gen_qemu_st_i128(t, s->tmp0, mem_index, mop); } =20 -static void gen_cmpxchg8b(DisasContext *s, CPUX86State *env, int modrm) +static void gen_cmpxchg8b(DisasContext *s, X86DecodedInsn *decode) { TCGv_i64 cmp, val, old; TCGv Z; =20 - gen_lea_modrm(env, s, modrm); + gen_lea_modrm(s, decode); =20 cmp =3D tcg_temp_new_i64(); val =3D tcg_temp_new_i64(); @@ -2370,13 +2352,13 @@ static void gen_cmpxchg8b(DisasContext *s, CPUX86St= ate *env, int modrm) } =20 #ifdef TARGET_X86_64 -static void gen_cmpxchg16b(DisasContext *s, CPUX86State *env, int modrm) +static void gen_cmpxchg16b(DisasContext *s, X86DecodedInsn *decode) { MemOp mop =3D MO_TE | MO_128 | MO_ALIGN; TCGv_i64 t0, t1; TCGv_i128 cmp, val; =20 - gen_lea_modrm(env, s, modrm); + gen_lea_modrm(s, decode); =20 cmp =3D tcg_temp_new_i128(); val =3D tcg_temp_new_i128(); @@ -2414,31 +2396,32 @@ static void gen_cmpxchg16b(DisasContext *s, CPUX86S= tate *env, int modrm) } #endif =20 -static bool disas_insn_x87(DisasContext *s, CPUState *cpu, int b) +#include "emit.c.inc" + +static void gen_x87(DisasContext *s, X86DecodedInsn *decode) { - CPUX86State *env =3D cpu_env(cpu); bool update_fip =3D true; - int modrm, mod, rm, op; + int b =3D decode->b; + int modrm =3D s->modrm; + int mod, rm, op; =20 if (s->flags & (HF_EM_MASK | HF_TS_MASK)) { /* if CR0.EM or CR0.TS are set, generate an FPU exception */ /* XXX: what to do if illegal op ? */ gen_exception(s, EXCP07_PREX); - return true; + return; } - modrm =3D x86_ldub_code(env, s); mod =3D (modrm >> 6) & 3; rm =3D modrm & 7; op =3D ((b & 7) << 3) | ((modrm >> 3) & 7); if (mod !=3D 3) { /* memory op */ - AddressParts a =3D gen_lea_modrm_0(env, s, modrm); - TCGv ea =3D gen_lea_modrm_1(s, a, false); + TCGv ea =3D gen_lea_modrm_1(s, decode->mem, false); TCGv last_addr =3D tcg_temp_new(); bool update_fdp =3D true; =20 tcg_gen_mov_tl(last_addr, ea); - gen_lea_v_seg(s, ea, a.def_seg, s->override); + gen_lea_v_seg(s, ea, decode->mem.def_seg, s->override); =20 switch (op) { case 0x00 ... 0x07: /* fxxxs */ @@ -2628,11 +2611,11 @@ static bool disas_insn_x87(DisasContext *s, CPUStat= e *cpu, int b) gen_helper_fpop(tcg_env); break; default: - return false; + goto illegal_op; } =20 if (update_fdp) { - int last_seg =3D s->override >=3D 0 ? s->override : a.def_seg; + int last_seg =3D s->override >=3D 0 ? s->override : decode->me= m.def_seg; =20 tcg_gen_ld_i32(s->tmp2_i32, tcg_env, offsetof(CPUX86State, @@ -2669,7 +2652,7 @@ static bool disas_insn_x87(DisasContext *s, CPUState = *cpu, int b) update_fip =3D false; break; default: - return false; + goto illegal_op; } break; case 0x0c: /* grp d9/4 */ @@ -2688,7 +2671,7 @@ static bool disas_insn_x87(DisasContext *s, CPUState = *cpu, int b) gen_helper_fxam_ST0(tcg_env); break; default: - return false; + goto illegal_op; } break; case 0x0d: /* grp d9/5 */ @@ -2723,7 +2706,7 @@ static bool disas_insn_x87(DisasContext *s, CPUState = *cpu, int b) gen_helper_fldz_ST0(tcg_env); break; default: - return false; + goto illegal_op; } } break; @@ -2825,7 +2808,7 @@ static bool disas_insn_x87(DisasContext *s, CPUState = *cpu, int b) gen_helper_fpop(tcg_env); break; default: - return false; + goto illegal_op; } break; case 0x1c: @@ -2845,7 +2828,7 @@ static bool disas_insn_x87(DisasContext *s, CPUState = *cpu, int b) case 4: /* fsetpm (287 only, just do nop here) */ break; default: - return false; + goto illegal_op; } break; case 0x1d: /* fucomi */ @@ -2897,7 +2880,7 @@ static bool disas_insn_x87(DisasContext *s, CPUState = *cpu, int b) gen_helper_fpop(tcg_env); break; default: - return false; + goto illegal_op; } break; case 0x38: /* ffreep sti, undocumented op */ @@ -2912,7 +2895,7 @@ static bool disas_insn_x87(DisasContext *s, CPUState = *cpu, int b) gen_op_mov_reg_v(s, MO_16, R_EAX, s->T0); break; default: - return false; + goto illegal_op; } break; case 0x3d: /* fucomip */ @@ -2959,7 +2942,7 @@ static bool disas_insn_x87(DisasContext *s, CPUState = *cpu, int b) } break; default: - return false; + goto illegal_op; } } =20 @@ -2971,25 +2954,24 @@ static bool disas_insn_x87(DisasContext *s, CPUStat= e *cpu, int b) tcg_gen_st_tl(eip_cur_tl(s), tcg_env, offsetof(CPUX86State, fpip)); } - return true; + return; =20 illegal_op: gen_illegal_opcode(s); - return true; } =20 -static void disas_insn_old(DisasContext *s, CPUState *cpu, int b) +static void gen_multi0F(DisasContext *s, X86DecodedInsn *decode) { - CPUX86State *env =3D cpu_env(cpu); int prefixes =3D s->prefix; MemOp dflag =3D s->dflag; + int b =3D decode->b + 0x100; + int modrm =3D s->modrm; MemOp ot; - int modrm, reg, rm, mod, op; + int reg, rm, mod, op; =20 /* now check op code */ switch (b) { case 0x1c7: /* cmpxchg8b */ - modrm =3D x86_ldub_code(env, s); mod =3D (modrm >> 6) & 3; switch ((modrm >> 3) & 7) { case 1: /* CMPXCHG8, CMPXCHG16 */ @@ -3001,14 +2983,14 @@ static void disas_insn_old(DisasContext *s, CPUStat= e *cpu, int b) if (!(s->cpuid_ext_features & CPUID_EXT_CX16)) { goto illegal_op; } - gen_cmpxchg16b(s, env, modrm); + gen_cmpxchg16b(s, decode); break; } #endif if (!(s->cpuid_features & CPUID_CX8)) { goto illegal_op; } - gen_cmpxchg8b(s, env, modrm); + gen_cmpxchg8b(s, decode); break; =20 case 7: /* RDSEED, RDPID with f3 prefix */ @@ -3051,7 +3033,6 @@ static void disas_insn_old(DisasContext *s, CPUState = *cpu, int b) break; =20 case 0x100: - modrm =3D x86_ldub_code(env, s); mod =3D (modrm >> 6) & 3; op =3D (modrm >> 3) & 7; switch(op) { @@ -3065,14 +3046,14 @@ static void disas_insn_old(DisasContext *s, CPUStat= e *cpu, int b) tcg_gen_ld32u_tl(s->T0, tcg_env, offsetof(CPUX86State, ldt.selector)); ot =3D mod =3D=3D 3 ? dflag : MO_16; - gen_st_modrm(env, s, modrm, ot); + gen_st_modrm(s, decode, ot); break; case 2: /* lldt */ if (!PE(s) || VM86(s)) goto illegal_op; if (check_cpl0(s)) { gen_svm_check_intercept(s, SVM_EXIT_LDTR_WRITE); - gen_ld_modrm(env, s, modrm, MO_16); + gen_ld_modrm(s, decode, MO_16); tcg_gen_trunc_tl_i32(s->tmp2_i32, s->T0); gen_helper_lldt(tcg_env, s->tmp2_i32); } @@ -3087,14 +3068,14 @@ static void disas_insn_old(DisasContext *s, CPUStat= e *cpu, int b) tcg_gen_ld32u_tl(s->T0, tcg_env, offsetof(CPUX86State, tr.selector)); ot =3D mod =3D=3D 3 ? dflag : MO_16; - gen_st_modrm(env, s, modrm, ot); + gen_st_modrm(s, decode, ot); break; case 3: /* ltr */ if (!PE(s) || VM86(s)) goto illegal_op; if (check_cpl0(s)) { gen_svm_check_intercept(s, SVM_EXIT_TR_WRITE); - gen_ld_modrm(env, s, modrm, MO_16); + gen_ld_modrm(s, decode, MO_16); tcg_gen_trunc_tl_i32(s->tmp2_i32, s->T0); gen_helper_ltr(tcg_env, s->tmp2_i32); } @@ -3103,7 +3084,7 @@ static void disas_insn_old(DisasContext *s, CPUState = *cpu, int b) case 5: /* verw */ if (!PE(s) || VM86(s)) goto illegal_op; - gen_ld_modrm(env, s, modrm, MO_16); + gen_ld_modrm(s, decode, MO_16); gen_update_cc_op(s); if (op =3D=3D 4) { gen_helper_verr(tcg_env, s->T0); @@ -3113,19 +3094,18 @@ static void disas_insn_old(DisasContext *s, CPUStat= e *cpu, int b) assume_cc_op(s, CC_OP_EFLAGS); break; default: - goto unknown_op; + goto illegal_op; } break; =20 case 0x101: - modrm =3D x86_ldub_code(env, s); switch (modrm) { CASE_MODRM_MEM_OP(0): /* sgdt */ if (s->flags & HF_UMIP_MASK && !check_cpl0(s)) { break; } gen_svm_check_intercept(s, SVM_EXIT_GDTR_READ); - gen_lea_modrm(env, s, modrm); + gen_lea_modrm(s, decode); tcg_gen_ld32u_tl(s->T0, tcg_env, offsetof(CPUX86State, gdt.limit)); gen_op_st_v(s, MO_16, s->T0, s->A0); @@ -3181,7 +3161,7 @@ static void disas_insn_old(DisasContext *s, CPUState = *cpu, int b) break; } gen_svm_check_intercept(s, SVM_EXIT_IDTR_READ); - gen_lea_modrm(env, s, modrm); + gen_lea_modrm(s, decode); tcg_gen_ld32u_tl(s->T0, tcg_env, offsetof(CPUX86State, idt.lim= it)); gen_op_st_v(s, MO_16, s->T0, s->A0); gen_add_A0_im(s, 2); @@ -3331,7 +3311,7 @@ static void disas_insn_old(DisasContext *s, CPUState = *cpu, int b) break; } gen_svm_check_intercept(s, SVM_EXIT_GDTR_WRITE); - gen_lea_modrm(env, s, modrm); + gen_lea_modrm(s, decode); gen_op_ld_v(s, MO_16, s->T1, s->A0); gen_add_A0_im(s, 2); gen_op_ld_v(s, CODE64(s) + MO_32, s->T0, s->A0); @@ -3347,7 +3327,7 @@ static void disas_insn_old(DisasContext *s, CPUState = *cpu, int b) break; } gen_svm_check_intercept(s, SVM_EXIT_IDTR_WRITE); - gen_lea_modrm(env, s, modrm); + gen_lea_modrm(s, decode); gen_op_ld_v(s, MO_16, s->T1, s->A0); gen_add_A0_im(s, 2); gen_op_ld_v(s, CODE64(s) + MO_32, s->T0, s->A0); @@ -3371,7 +3351,7 @@ static void disas_insn_old(DisasContext *s, CPUState = *cpu, int b) */ mod =3D (modrm >> 6) & 3; ot =3D (mod !=3D 3 ? MO_16 : s->dflag); - gen_st_modrm(env, s, modrm, ot); + gen_st_modrm(s, decode, ot); break; case 0xee: /* rdpkru */ if (s->prefix & (PREFIX_LOCK | PREFIX_DATA @@ -3398,7 +3378,7 @@ static void disas_insn_old(DisasContext *s, CPUState = *cpu, int b) break; } gen_svm_check_intercept(s, SVM_EXIT_WRITE_CR0); - gen_ld_modrm(env, s, modrm, MO_16); + gen_ld_modrm(s, decode, MO_16); /* * Only the 4 lower bits of CR0 are modified. * PE cannot be set to zero if already set to one. @@ -3416,7 +3396,7 @@ static void disas_insn_old(DisasContext *s, CPUState = *cpu, int b) break; } gen_svm_check_intercept(s, SVM_EXIT_INVLPG); - gen_lea_modrm(env, s, modrm); + gen_lea_modrm(s, decode); gen_helper_flush_page(tcg_env, s->A0); s->base.is_jmp =3D DISAS_EOB_NEXT; break; @@ -3449,12 +3429,11 @@ static void disas_insn_old(DisasContext *s, CPUStat= e *cpu, int b) break; =20 default: - goto unknown_op; + goto illegal_op; } break; =20 case 0x11a: - modrm =3D x86_ldub_code(env, s); if (s->flags & HF_MPX_EN_MASK) { mod =3D (modrm >> 6) & 3; reg =3D ((modrm >> 3) & 7) | REX_R(s); @@ -3465,7 +3444,7 @@ static void disas_insn_old(DisasContext *s, CPUState = *cpu, int b) || s->aflag =3D=3D MO_16) { goto illegal_op; } - gen_bndck(env, s, modrm, TCG_COND_LTU, cpu_bndl[reg]); + gen_bndck(s, decode, TCG_COND_LTU, cpu_bndl[reg]); } else if (prefixes & PREFIX_REPNZ) { /* bndcu */ if (reg >=3D 4 @@ -3475,7 +3454,7 @@ static void disas_insn_old(DisasContext *s, CPUState = *cpu, int b) } TCGv_i64 notu =3D tcg_temp_new_i64(); tcg_gen_not_i64(notu, cpu_bndu[reg]); - gen_bndck(env, s, modrm, TCG_COND_GTU, notu); + gen_bndck(s, decode, TCG_COND_GTU, notu); } else if (prefixes & PREFIX_DATA) { /* bndmov -- from reg/mem */ if (reg >=3D 4 || s->aflag =3D=3D MO_16) { @@ -3491,7 +3470,7 @@ static void disas_insn_old(DisasContext *s, CPUState = *cpu, int b) tcg_gen_mov_i64(cpu_bndu[reg], cpu_bndu[reg2]); } } else { - gen_lea_modrm(env, s, modrm); + gen_lea_modrm(s, decode); if (CODE64(s)) { tcg_gen_qemu_ld_i64(cpu_bndl[reg], s->A0, s->mem_index, MO_LEUQ); @@ -3510,7 +3489,7 @@ static void disas_insn_old(DisasContext *s, CPUState = *cpu, int b) } } else if (mod !=3D 3) { /* bndldx */ - AddressParts a =3D gen_lea_modrm_0(env, s, modrm); + AddressParts a =3D decode->mem; if (reg >=3D 4 || (prefixes & PREFIX_LOCK) || s->aflag =3D=3D MO_16 @@ -3540,10 +3519,8 @@ static void disas_insn_old(DisasContext *s, CPUState= *cpu, int b) gen_set_hflag(s, HF_MPX_IU_MASK); } } - gen_nop_modrm(env, s, modrm); break; case 0x11b: - modrm =3D x86_ldub_code(env, s); if (s->flags & HF_MPX_EN_MASK) { mod =3D (modrm >> 6) & 3; reg =3D ((modrm >> 3) & 7) | REX_R(s); @@ -3554,7 +3531,7 @@ static void disas_insn_old(DisasContext *s, CPUState = *cpu, int b) || s->aflag =3D=3D MO_16) { goto illegal_op; } - AddressParts a =3D gen_lea_modrm_0(env, s, modrm); + AddressParts a =3D decode->mem; if (a.base >=3D 0) { tcg_gen_extu_tl_i64(cpu_bndl[reg], cpu_regs[a.base]); if (!CODE64(s)) { @@ -3567,7 +3544,7 @@ static void disas_insn_old(DisasContext *s, CPUState = *cpu, int b) /* rip-relative generates #ud */ goto illegal_op; } - tcg_gen_not_tl(s->A0, gen_lea_modrm_1(s, a, false)); + tcg_gen_not_tl(s->A0, gen_lea_modrm_1(s, decode->mem, fals= e)); if (!CODE64(s)) { tcg_gen_ext32u_tl(s->A0, s->A0); } @@ -3582,7 +3559,7 @@ static void disas_insn_old(DisasContext *s, CPUState = *cpu, int b) || s->aflag =3D=3D MO_16) { goto illegal_op; } - gen_bndck(env, s, modrm, TCG_COND_GTU, cpu_bndu[reg]); + gen_bndck(s, decode, TCG_COND_GTU, cpu_bndu[reg]); } else if (prefixes & PREFIX_DATA) { /* bndmov -- to reg/mem */ if (reg >=3D 4 || s->aflag =3D=3D MO_16) { @@ -3598,7 +3575,7 @@ static void disas_insn_old(DisasContext *s, CPUState = *cpu, int b) tcg_gen_mov_i64(cpu_bndu[reg2], cpu_bndu[reg]); } } else { - gen_lea_modrm(env, s, modrm); + gen_lea_modrm(s, decode); if (CODE64(s)) { tcg_gen_qemu_st_i64(cpu_bndl[reg], s->A0, s->mem_index, MO_LEUQ); @@ -3615,7 +3592,7 @@ static void disas_insn_old(DisasContext *s, CPUState = *cpu, int b) } } else if (mod !=3D 3) { /* bndstx */ - AddressParts a =3D gen_lea_modrm_0(env, s, modrm); + AddressParts a =3D decode->mem; if (reg >=3D 4 || (prefixes & PREFIX_LOCK) || s->aflag =3D=3D MO_16 @@ -3642,7 +3619,6 @@ static void disas_insn_old(DisasContext *s, CPUState = *cpu, int b) } } } - gen_nop_modrm(env, s, modrm); break; default: g_assert_not_reached(); @@ -3651,12 +3627,8 @@ static void disas_insn_old(DisasContext *s, CPUState= *cpu, int b) illegal_op: gen_illegal_opcode(s); return; - unknown_op: - gen_unknown_opcode(env, s); } =20 -#include "decode-new.h" -#include "emit.c.inc" #include "decode-new.c.inc" =20 void tcg_x86_init(void) diff --git a/target/i386/tcg/decode-new.c.inc b/target/i386/tcg/decode-new.= c.inc index 33ffcf092ec..45f4aed4611 100644 --- a/target/i386/tcg/decode-new.c.inc +++ b/target/i386/tcg/decode-new.c.inc @@ -1092,6 +1092,8 @@ static void decode_MOV_CR_DR(DisasContext *s, CPUX86S= tate *env, X86OpEntry *entr } =20 static const X86OpEntry opcodes_0F[256] =3D { + [0x00] =3D X86_OP_ENTRY1(multi0F, nop,v, nolea), /*= unconverted */ + [0x01] =3D X86_OP_ENTRY1(multi0F, nop,v, nolea), /*= unconverted */ [0x02] =3D X86_OP_ENTRYwr(LAR, G,v, E,w, chk(prot)), [0x03] =3D X86_OP_ENTRYwr(LSL, G,v, E,w, chk(prot)), [0x05] =3D X86_OP_ENTRY0(SYSCALL, chk(o64_in= tel)), @@ -1201,6 +1203,7 @@ static const X86OpEntry opcodes_0F[256] =3D { [0xc4] =3D X86_OP_ENTRY4(PINSRW, V,dq,H,dq,E,w, vex5 mmx p_0= 0_66), [0xc5] =3D X86_OP_ENTRY3(PEXTRW, G,d, U,dq,I,b, vex5 mmx p_0= 0_66), [0xc6] =3D X86_OP_ENTRY4(VSHUF, V,x, H,x, W,x, vex4 p_00_66= ), + [0xc7] =3D X86_OP_ENTRY1(multi0F, nop,v, nolea), /* u= nconverted */ =20 [0xd0] =3D X86_OP_ENTRY3(VADDSUB, V,x, H,x, W,x, vex2 cpuid(S= SE3) p_66_f2), [0xd1] =3D X86_OP_ENTRY3(PSRLW_r, V,x, H,x, W,x, vex4 mmx avx= 2_256 p_00_66), @@ -1243,6 +1246,8 @@ static const X86OpEntry opcodes_0F[256] =3D { =20 [0x18] =3D X86_OP_ENTRY1(NOP, nop,v), /* prefetch/reserved NOP */ [0x19] =3D X86_OP_ENTRY1(NOP, nop,v), /* reserved NOP */ + [0x1a] =3D X86_OP_ENTRY1(multi0F, nop,v, nolea), /* unconverted MPX */ + [0x1b] =3D X86_OP_ENTRY1(multi0F, nop,v, nolea), /* unconverted MPX */ [0x1c] =3D X86_OP_ENTRY1(NOP, nop,v), /* reserved NOP */ [0x1d] =3D X86_OP_ENTRY1(NOP, nop,v), /* reserved NOP */ [0x1e] =3D X86_OP_ENTRY1(NOP, nop,v), /* reserved NOP */ @@ -1780,6 +1785,19 @@ static const X86OpEntry opcodes_root[256] =3D { [0xCE] =3D X86_OP_ENTRY0(INTO), [0xCF] =3D X86_OP_ENTRY0(IRET, chk(vm86_iopl) svm(IRET)), =20 + /* + * x87 is nolea because it needs the address without segment base, + * in order to store it in fdp. + */ + [0xD8] =3D X86_OP_ENTRY1(x87, nop,v, nolea), + [0xD9] =3D X86_OP_ENTRY1(x87, nop,v, nolea), + [0xDA] =3D X86_OP_ENTRY1(x87, nop,v, nolea), + [0xDB] =3D X86_OP_ENTRY1(x87, nop,v, nolea), + [0xDC] =3D X86_OP_ENTRY1(x87, nop,v, nolea), + [0xDD] =3D X86_OP_ENTRY1(x87, nop,v, nolea), + [0xDE] =3D X86_OP_ENTRY1(x87, nop,v, nolea), + [0xDF] =3D X86_OP_ENTRY1(x87, nop,v, nolea), + [0xE8] =3D X86_OP_ENTRYr(CALL, J,z_f64), [0xE9] =3D X86_OP_ENTRYr(JMP, J,z_f64), [0xEA] =3D X86_OP_ENTRYrr(JMPF, I_unsigned,p, I_unsigned,w, chk(i64)), @@ -2608,30 +2626,6 @@ static void disas_insn(DisasContext *s, CPUState *cp= u) } } =20 - /* Go back to old decoder for unconverted opcodes. */ - if (!(s->prefix & PREFIX_VEX)) { - if ((b & ~7) =3D=3D 0xd8) { - if (!disas_insn_x87(s, cpu, b)) { - goto unknown_op; - } - return; - } - - if (b =3D=3D 0x0f) { - b =3D x86_ldub_code(env, s); - switch (b) { - case 0x00 ... 0x01: /* mostly privileged instructions */ - case 0x1a ... 0x1b: /* MPX */ - case 0xc7: /* grp9 */ - disas_insn_old(s, cpu, b + 0x100); - return; - default: - decode_func =3D do_decode_0F; - break; - } - } - } - memset(&decode, 0, sizeof(decode)); decode.cc_op =3D -1; decode.b =3D b; @@ -2728,6 +2722,15 @@ static void disas_insn(DisasContext *s, CPUState *cp= u) break; } =20 + /* + * hack for old decoder: 0F C7 has both instructions that accept LOCK + * and instructions that don't, but also needs X86_SPECIAL_NoLoadEA. + * Keep this here until CMPXCHG8B/CMPXCHG16B is separated from the + * other unconverted opcodes. + */ + if (decode.e.gen =3D=3D gen_multi0F) { + accept_lock =3D true; + } if ((s->prefix & PREFIX_LOCK) && !accept_lock) { goto illegal_op; } @@ -2775,7 +2778,7 @@ static void disas_insn(DisasContext *s, CPUState *cpu) =20 if (decode.e.special !=3D X86_SPECIAL_NoLoadEA && (decode.op[0].has_ea || decode.op[1].has_ea || decode.op[2].has_ea= )) { - gen_load_ea(s, &decode); + gen_lea_modrm(s, &decode); } if (s->prefix & PREFIX_LOCK) { gen_load(s, &decode, 2, s->T1); diff --git a/target/i386/tcg/emit.c.inc b/target/i386/tcg/emit.c.inc index a25dff0570c..edadb51ae89 100644 --- a/target/i386/tcg/emit.c.inc +++ b/target/i386/tcg/emit.c.inc @@ -73,7 +73,7 @@ static void gen_NM_exception(DisasContext *s) gen_exception(s, EXCP07_PREX); } =20 -static void gen_load_ea(DisasContext *s, X86DecodedInsn *decode) +static void gen_lea_modrm(DisasContext *s, X86DecodedInsn *decode) { AddressParts *mem =3D &decode->mem; TCGv ea; --=20 2.45.2 From nobody Mon Nov 25 00:16:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719037190; cv=none; d=zohomail.com; s=zohoarc; b=ndS6x+PyJTsQCd2zmYLPU3wrga05TERg1pDAFgt9O0W6XmuwaI7WfDPw31m+zLH4eq6pNcYClCtMyQ6gV4hziP6HAjoXdPCKTJVSKMbAe7Cbzzqb18MYJwQdeXI5S+FOV/Bqz5nee7JMlo6QKGHTBfqbjQC/ky4CGnEdxTQM0xA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719037190; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=8fM1jbKshUWdGnBBWyD6aAkpWD0IxNWpBR+laG2/iKM=; b=JjBiT2O69PktYo517ZOWQstudY0kWSJ6yZnSS6qcXcqm/RalYFeuO2BsiL4klYAwkoJPBMMe8vG8qQabFeH1NYBQL6AW5Rzd9sNtomaDHQPei4M1XVSWi4U19XaWe42k2212uzoP1qEUf8BeYCTstrq8YEYOOF9OFOnPCK0+vVU= 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 1719037190957748.8887044913474; Fri, 21 Jun 2024 23:19:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKu36-0000Gm-AX; Sat, 22 Jun 2024 02:16:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu30-0000Ab-99 for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu2y-0006QN-4T for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:26 -0400 Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-99-On9HGLvcMj6N3E5V-X4Wug-1; Sat, 22 Jun 2024 02:16:21 -0400 Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-57cad3fa0a1so1874819a12.1 for ; Fri, 21 Jun 2024 23:16:21 -0700 (PDT) Received: from avogadro.local ([151.62.196.71]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57d3042d2d0sm1885490a12.41.2024.06.21.23.16.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 23:16:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719036983; 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=8fM1jbKshUWdGnBBWyD6aAkpWD0IxNWpBR+laG2/iKM=; b=Z1JRWCtZsyPZKwCU7VJ3pnEV5S3aZEcOsAPryWcMVshcC9Ge+6lvUVAfYRe338kOcuF/GP qWaytIVQj8dmD8sgR+5CHt2BKpqb0sWcGf9q3iPlg8YvFvmPx+08BP9cEEHZx05Hldj7A1 zYzv0/WU5LnfMG3icBhFiPIF9I8R8Ls= X-MC-Unique: On9HGLvcMj6N3E5V-X4Wug-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719036978; x=1719641778; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8fM1jbKshUWdGnBBWyD6aAkpWD0IxNWpBR+laG2/iKM=; b=RHrKNBWV556Plf8qb0MwuJdZPYnR+796OBifkiEgGIvzEN6BDcZfDth2lMSO7i57Cz ZG7K0x2c/J1b/B52xzZNXbm/HwHMUOcrpxABvPUYAzVhRwDUN6CgC3sC5mgVAO5wcHhO E9c2ErPba+8y2sIzUkfHRZTwv2xicqTxV1WdmLd5Nb0Btfr4duiVvPTQv2bjBgpENRR5 Q/d8fhIL6VrykZcG30IU3xnxjKAdrnEBxkU+TD3S6M+w0Kx22hmXXMyncUgdd3KPqMrB UKsfrBCslT/OT0J88dL94qLD31THHGOLr9qFIkfhiimQ701T/iARILvjSJaTGHJGjBvs TSGA== X-Gm-Message-State: AOJu0YxMIZR+/4xrBNBtZWp7Qt9bnywJLgKnnJQ8xEue4E6rCQ953vTK MeTmWpRYnFHIBk8yyNNjZgOuomRiyWWwqzCK3idimSINXjg1CeJzvtZzkYfDmzb/JKGeQypSM5C gNljl2fFfCwBNqWafQg+1Y3lwxNI5O6FRnzBvqo5oOhGyk4PBmkWjf7DrhHB+/3lLziYoaEx230 ZNui6X+8JeSLPE/bXsudRyBwmM8NEbxW4xV/jG X-Received: by 2002:a50:aadc:0:b0:57d:5c0:9dc0 with SMTP id 4fb4d7f45d1cf-57d4580b023mr168503a12.38.1719036978358; Fri, 21 Jun 2024 23:16:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFbagMPmjmDbkUR6QUD1jiB5NZOa8tblWa0e9Y0TMLDQOvAUTRicGTkYw4te8xZ2VV8b1qn/w== X-Received: by 2002:a50:aadc:0:b0:57d:5c0:9dc0 with SMTP id 4fb4d7f45d1cf-57d4580b023mr168496a12.38.1719036977881; Fri, 21 Jun 2024 23:16:17 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 08/23] target/i386: convert CMPXCHG8B/CMPXCHG16B to new decoder Date: Sat, 22 Jun 2024 08:15:42 +0200 Message-ID: <20240622061558.530543-9-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240622061558.530543-1-pbonzini@redhat.com> References: <20240622061558.530543-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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719037191860100005 Content-Type: text/plain; charset="utf-8" This moves the last LOCK-enabled instructions to the new decoder. It is now possible to assume that PREFIX_LOCK gen_multi0F is called only after checki= ng that LOCK was not specified. The gen_cmpxchg8b and gen_cmpxchg16b functions even have the correct prototype already; the only thing that needs to be done is removing the gen_lea_modrm() call. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.h | 2 + target/i386/tcg/translate.c | 121 +------------------------------ target/i386/tcg/decode-new.c.inc | 34 ++++++--- target/i386/tcg/emit.c.inc | 96 ++++++++++++++++++++++++ 4 files changed, 124 insertions(+), 129 deletions(-) diff --git a/target/i386/tcg/decode-new.h b/target/i386/tcg/decode-new.h index bebc77bd54b..7f23d373ea7 100644 --- a/target/i386/tcg/decode-new.h +++ b/target/i386/tcg/decode-new.h @@ -114,6 +114,8 @@ typedef enum X86CPUIDFeature { X86_FEAT_CLWB, X86_FEAT_CMOV, X86_FEAT_CMPCCXADD, + X86_FEAT_CX8, + X86_FEAT_CX16, X86_FEAT_F16C, X86_FEAT_FMA, X86_FEAT_FSGSBASE, diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 1d845ff66bb..c60f18c7482 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -2298,104 +2298,6 @@ static void gen_sty_env_A0(DisasContext *s, int off= set, bool align) tcg_gen_qemu_st_i128(t, s->tmp0, mem_index, mop); } =20 -static void gen_cmpxchg8b(DisasContext *s, X86DecodedInsn *decode) -{ - TCGv_i64 cmp, val, old; - TCGv Z; - - gen_lea_modrm(s, decode); - - cmp =3D tcg_temp_new_i64(); - val =3D tcg_temp_new_i64(); - old =3D tcg_temp_new_i64(); - - /* Construct the comparison values from the register pair. */ - tcg_gen_concat_tl_i64(cmp, cpu_regs[R_EAX], cpu_regs[R_EDX]); - tcg_gen_concat_tl_i64(val, cpu_regs[R_EBX], cpu_regs[R_ECX]); - - /* Only require atomic with LOCK; non-parallel handled in generator. */ - if (s->prefix & PREFIX_LOCK) { - tcg_gen_atomic_cmpxchg_i64(old, s->A0, cmp, val, s->mem_index, MO_= TEUQ); - } else { - tcg_gen_nonatomic_cmpxchg_i64(old, s->A0, cmp, val, - s->mem_index, MO_TEUQ); - } - - /* Set tmp0 to match the required value of Z. */ - tcg_gen_setcond_i64(TCG_COND_EQ, cmp, old, cmp); - Z =3D tcg_temp_new(); - tcg_gen_trunc_i64_tl(Z, cmp); - - /* - * Extract the result values for the register pair. - * For 32-bit, we may do this unconditionally, because on success (Z= =3D1), - * the old value matches the previous value in EDX:EAX. For x86_64, - * the store must be conditional, because we must leave the source - * registers unchanged on success, and zero-extend the writeback - * on failure (Z=3D0). - */ - if (TARGET_LONG_BITS =3D=3D 32) { - tcg_gen_extr_i64_tl(cpu_regs[R_EAX], cpu_regs[R_EDX], old); - } else { - TCGv zero =3D tcg_constant_tl(0); - - tcg_gen_extr_i64_tl(s->T0, s->T1, old); - tcg_gen_movcond_tl(TCG_COND_EQ, cpu_regs[R_EAX], Z, zero, - s->T0, cpu_regs[R_EAX]); - tcg_gen_movcond_tl(TCG_COND_EQ, cpu_regs[R_EDX], Z, zero, - s->T1, cpu_regs[R_EDX]); - } - - /* Update Z. */ - gen_compute_eflags(s); - tcg_gen_deposit_tl(cpu_cc_src, cpu_cc_src, Z, ctz32(CC_Z), 1); -} - -#ifdef TARGET_X86_64 -static void gen_cmpxchg16b(DisasContext *s, X86DecodedInsn *decode) -{ - MemOp mop =3D MO_TE | MO_128 | MO_ALIGN; - TCGv_i64 t0, t1; - TCGv_i128 cmp, val; - - gen_lea_modrm(s, decode); - - cmp =3D tcg_temp_new_i128(); - val =3D tcg_temp_new_i128(); - tcg_gen_concat_i64_i128(cmp, cpu_regs[R_EAX], cpu_regs[R_EDX]); - tcg_gen_concat_i64_i128(val, cpu_regs[R_EBX], cpu_regs[R_ECX]); - - /* Only require atomic with LOCK; non-parallel handled in generator. */ - if (s->prefix & PREFIX_LOCK) { - tcg_gen_atomic_cmpxchg_i128(val, s->A0, cmp, val, s->mem_index, mo= p); - } else { - tcg_gen_nonatomic_cmpxchg_i128(val, s->A0, cmp, val, s->mem_index,= mop); - } - - tcg_gen_extr_i128_i64(s->T0, s->T1, val); - - /* Determine success after the fact. */ - t0 =3D tcg_temp_new_i64(); - t1 =3D tcg_temp_new_i64(); - tcg_gen_xor_i64(t0, s->T0, cpu_regs[R_EAX]); - tcg_gen_xor_i64(t1, s->T1, cpu_regs[R_EDX]); - tcg_gen_or_i64(t0, t0, t1); - - /* Update Z. */ - gen_compute_eflags(s); - tcg_gen_setcondi_i64(TCG_COND_EQ, t0, t0, 0); - tcg_gen_deposit_tl(cpu_cc_src, cpu_cc_src, t0, ctz32(CC_Z), 1); - - /* - * Extract the result values for the register pair. We may do this - * unconditionally, because on success (Z=3D1), the old value matches - * the previous value in RDX:RAX. - */ - tcg_gen_mov_i64(cpu_regs[R_EAX], s->T0); - tcg_gen_mov_i64(cpu_regs[R_EDX], s->T1); -} -#endif - #include "emit.c.inc" =20 static void gen_x87(DisasContext *s, X86DecodedInsn *decode) @@ -2971,29 +2873,10 @@ static void gen_multi0F(DisasContext *s, X86Decoded= Insn *decode) =20 /* now check op code */ switch (b) { - case 0x1c7: /* cmpxchg8b */ + case 0x1c7: /* RDSEED, RDPID with f3 prefix */ mod =3D (modrm >> 6) & 3; switch ((modrm >> 3) & 7) { - case 1: /* CMPXCHG8, CMPXCHG16 */ - if (mod =3D=3D 3) { - goto illegal_op; - } -#ifdef TARGET_X86_64 - if (dflag =3D=3D MO_64) { - if (!(s->cpuid_ext_features & CPUID_EXT_CX16)) { - goto illegal_op; - } - gen_cmpxchg16b(s, decode); - break; - } -#endif - if (!(s->cpuid_features & CPUID_CX8)) { - goto illegal_op; - } - gen_cmpxchg8b(s, decode); - break; - - case 7: /* RDSEED, RDPID with f3 prefix */ + case 7: if (mod !=3D 3 || (s->prefix & (PREFIX_LOCK | PREFIX_REPNZ))) { goto illegal_op; diff --git a/target/i386/tcg/decode-new.c.inc b/target/i386/tcg/decode-new.= c.inc index 45f4aed4611..fa51aadfcf2 100644 --- a/target/i386/tcg/decode-new.c.inc +++ b/target/i386/tcg/decode-new.c.inc @@ -288,6 +288,25 @@ static void decode_group8(DisasContext *s, CPUX86State= *env, X86OpEntry *entry, } } =20 +static void decode_group9(DisasContext *s, CPUX86State *env, X86OpEntry *e= ntry, uint8_t *b) +{ + static const X86OpEntry group9_reg =3D + X86_OP_ENTRY0(multi0F); /* unconverted */ + static const X86OpEntry cmpxchg8b =3D + X86_OP_ENTRY1(CMPXCHG8B, M,q, lock p_00 cpuid(CX8)); + static const X86OpEntry cmpxchg16b =3D + X86_OP_ENTRY1(CMPXCHG16B, M,dq, lock p_00 cpuid(CX16)); + + int modrm =3D get_modrm(s, env); + int op =3D (modrm >> 3) & 7; + + if ((modrm >> 6) =3D=3D 3) { + *entry =3D group9_reg; + } else if (op =3D=3D 1) { + *entry =3D REX_W(s) ? cmpxchg16b : cmpxchg8b; + } +} + static void decode_group15(DisasContext *s, CPUX86State *env, X86OpEntry *= entry, uint8_t *b) { static const X86OpEntry group15_reg[8] =3D { @@ -1203,7 +1222,7 @@ static const X86OpEntry opcodes_0F[256] =3D { [0xc4] =3D X86_OP_ENTRY4(PINSRW, V,dq,H,dq,E,w, vex5 mmx p_0= 0_66), [0xc5] =3D X86_OP_ENTRY3(PEXTRW, G,d, U,dq,I,b, vex5 mmx p_0= 0_66), [0xc6] =3D X86_OP_ENTRY4(VSHUF, V,x, H,x, W,x, vex4 p_00_66= ), - [0xc7] =3D X86_OP_ENTRY1(multi0F, nop,v, nolea), /* u= nconverted */ + [0xc7] =3D X86_OP_GROUP0(group9), =20 [0xd0] =3D X86_OP_ENTRY3(VADDSUB, V,x, H,x, W,x, vex2 cpuid(S= SE3) p_66_f2), [0xd1] =3D X86_OP_ENTRY3(PSRLW_r, V,x, H,x, W,x, vex4 mmx avx= 2_256 p_00_66), @@ -2241,8 +2260,12 @@ static bool has_cpuid_feature(DisasContext *s, X86CP= UIDFeature cpuid) return (s->cpuid_features & CPUID_CMOV); case X86_FEAT_CLFLUSH: return (s->cpuid_features & CPUID_CLFLUSH); + case X86_FEAT_CX8: + return (s->cpuid_features & CPUID_CX8); case X86_FEAT_FXSR: return (s->cpuid_features & CPUID_FXSR); + case X86_FEAT_CX16: + return (s->cpuid_ext_features & CPUID_EXT_CX16); case X86_FEAT_F16C: return (s->cpuid_ext_features & CPUID_EXT_F16C); case X86_FEAT_FMA: @@ -2722,15 +2745,6 @@ static void disas_insn(DisasContext *s, CPUState *cp= u) break; } =20 - /* - * hack for old decoder: 0F C7 has both instructions that accept LOCK - * and instructions that don't, but also needs X86_SPECIAL_NoLoadEA. - * Keep this here until CMPXCHG8B/CMPXCHG16B is separated from the - * other unconverted opcodes. - */ - if (decode.e.gen =3D=3D gen_multi0F) { - accept_lock =3D true; - } if ((s->prefix & PREFIX_LOCK) && !accept_lock) { goto illegal_op; } diff --git a/target/i386/tcg/emit.c.inc b/target/i386/tcg/emit.c.inc index edadb51ae89..98f10ad8b4e 100644 --- a/target/i386/tcg/emit.c.inc +++ b/target/i386/tcg/emit.c.inc @@ -1782,6 +1782,102 @@ static void gen_CMPXCHG(DisasContext *s, X86Decoded= Insn *decode) decode->cc_op =3D CC_OP_SUBB + ot; } =20 +static void gen_CMPXCHG16B(DisasContext *s, X86DecodedInsn *decode) +{ +#ifdef TARGET_X86_64 + MemOp mop =3D MO_TE | MO_128 | MO_ALIGN; + TCGv_i64 t0, t1; + TCGv_i128 cmp, val; + + cmp =3D tcg_temp_new_i128(); + val =3D tcg_temp_new_i128(); + tcg_gen_concat_i64_i128(cmp, cpu_regs[R_EAX], cpu_regs[R_EDX]); + tcg_gen_concat_i64_i128(val, cpu_regs[R_EBX], cpu_regs[R_ECX]); + + /* Only require atomic with LOCK; non-parallel handled in generator. */ + if (s->prefix & PREFIX_LOCK) { + tcg_gen_atomic_cmpxchg_i128(val, s->A0, cmp, val, s->mem_index, mo= p); + } else { + tcg_gen_nonatomic_cmpxchg_i128(val, s->A0, cmp, val, s->mem_index,= mop); + } + + tcg_gen_extr_i128_i64(s->T0, s->T1, val); + + /* Determine success after the fact. */ + t0 =3D tcg_temp_new_i64(); + t1 =3D tcg_temp_new_i64(); + tcg_gen_xor_i64(t0, s->T0, cpu_regs[R_EAX]); + tcg_gen_xor_i64(t1, s->T1, cpu_regs[R_EDX]); + tcg_gen_or_i64(t0, t0, t1); + + /* Update Z. */ + gen_compute_eflags(s); + tcg_gen_setcondi_i64(TCG_COND_EQ, t0, t0, 0); + tcg_gen_deposit_tl(cpu_cc_src, cpu_cc_src, t0, ctz32(CC_Z), 1); + + /* + * Extract the result values for the register pair. We may do this + * unconditionally, because on success (Z=3D1), the old value matches + * the previous value in RDX:RAX. + */ + tcg_gen_mov_i64(cpu_regs[R_EAX], s->T0); + tcg_gen_mov_i64(cpu_regs[R_EDX], s->T1); +#else + abort(); +#endif +} + +static void gen_CMPXCHG8B(DisasContext *s, X86DecodedInsn *decode) +{ + TCGv_i64 cmp, val, old; + TCGv Z; + + cmp =3D tcg_temp_new_i64(); + val =3D tcg_temp_new_i64(); + old =3D tcg_temp_new_i64(); + + /* Construct the comparison values from the register pair. */ + tcg_gen_concat_tl_i64(cmp, cpu_regs[R_EAX], cpu_regs[R_EDX]); + tcg_gen_concat_tl_i64(val, cpu_regs[R_EBX], cpu_regs[R_ECX]); + + /* Only require atomic with LOCK; non-parallel handled in generator. */ + if (s->prefix & PREFIX_LOCK) { + tcg_gen_atomic_cmpxchg_i64(old, s->A0, cmp, val, s->mem_index, MO_= TEUQ); + } else { + tcg_gen_nonatomic_cmpxchg_i64(old, s->A0, cmp, val, + s->mem_index, MO_TEUQ); + } + + /* Set tmp0 to match the required value of Z. */ + tcg_gen_setcond_i64(TCG_COND_EQ, cmp, old, cmp); + Z =3D tcg_temp_new(); + tcg_gen_trunc_i64_tl(Z, cmp); + + /* + * Extract the result values for the register pair. + * For 32-bit, we may do this unconditionally, because on success (Z= =3D1), + * the old value matches the previous value in EDX:EAX. For x86_64, + * the store must be conditional, because we must leave the source + * registers unchanged on success, and zero-extend the writeback + * on failure (Z=3D0). + */ + if (TARGET_LONG_BITS =3D=3D 32) { + tcg_gen_extr_i64_tl(cpu_regs[R_EAX], cpu_regs[R_EDX], old); + } else { + TCGv zero =3D tcg_constant_tl(0); + + tcg_gen_extr_i64_tl(s->T0, s->T1, old); + tcg_gen_movcond_tl(TCG_COND_EQ, cpu_regs[R_EAX], Z, zero, + s->T0, cpu_regs[R_EAX]); + tcg_gen_movcond_tl(TCG_COND_EQ, cpu_regs[R_EDX], Z, zero, + s->T1, cpu_regs[R_EDX]); + } + + /* Update Z. */ + gen_compute_eflags(s); + tcg_gen_deposit_tl(cpu_cc_src, cpu_cc_src, Z, ctz32(CC_Z), 1); +} + static void gen_CPUID(DisasContext *s, X86DecodedInsn *decode) { gen_update_cc_op(s); --=20 2.45.2 From nobody Mon Nov 25 00:16:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719037174; cv=none; d=zohomail.com; s=zohoarc; b=ciJxgF+OS4r+zlXq7yyx3tWVsyQzaCkIvm1f/vWWsBEEEiJo/onU3YD3GPLd6PSsVGXYW4Ci7jigujFyPS4aKpzgteAQhbkokiD1UMlBJamRvCokSef24HGuRl2FT4rsokIxn/hnsFonYsUmRUfJ22FMkvnm9gevC075D1mA17Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719037174; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=9XXSgEZfF/mgmRYz0quvK+Q6GbqXkOMqVfYjFVsm7Z8=; b=WCLRazvE/1Cup898rwcrwLr0J0jwxfPuj5Kpe2V1sevhl10T3dNiiX4leno1KJLk8MmtxuQzBqYAMabjjvK5IUm23juVtWbW0ioSBDLTQIuzzRhBFUW2LRalkeCPo93EaFc+XiUOXY7j+2UtDK2jIIpnqHm561ktQThVF7x/uLs= 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 1719037174787881.3128802540374; Fri, 21 Jun 2024 23:19:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKu3R-0000TF-DV; Sat, 22 Jun 2024 02:16:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu31-0000Bs-Ti for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu30-0006QZ-AJ for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:27 -0400 Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-644-rM6oYL3mMFeSt8Vt1zVVPw-1; Sat, 22 Jun 2024 02:16:24 -0400 Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-57d172119a6so1082731a12.2 for ; Fri, 21 Jun 2024 23:16:23 -0700 (PDT) Received: from avogadro.local ([151.62.196.71]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57d30563026sm1862743a12.85.2024.06.21.23.16.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 23:16:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719036985; 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=9XXSgEZfF/mgmRYz0quvK+Q6GbqXkOMqVfYjFVsm7Z8=; b=hdzFnZ9wvj8Kh9i70wKnYNhxG149Wytni5kyL59qy9CBtLjoqhNCngaXF7eooC6wp7P1r0 3pyuK0f0p59V8Vh1NqfI8TBaZWovq/Pw95QPTQL1OJdy89KRiOgJz+mz6pTkPn4+2I0q2U fO/P9b9e6DcrznH4R+hRuH/uKCg3+j8= X-MC-Unique: rM6oYL3mMFeSt8Vt1zVVPw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719036981; x=1719641781; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9XXSgEZfF/mgmRYz0quvK+Q6GbqXkOMqVfYjFVsm7Z8=; b=YsQf7cBRKARN0xmnLhvmepVJLZFDYRAYTIZZOjHcv34SYZZt5ug7Sa1ogtKOs0vBWK EWVn7mOMLkwq+QerWN5Z0uqbUVuoufpghS7AM/u1go3/a3cmHZCRbdSwMwxgQOduGm6y bX7dYrOAM8A/k9Vgfz7evmT7gdCigKYmRTGe8lsSfRZpFQbXj6O64J7WDoM9rMiQ9Rub v/FGzU7b655k8hOqr+e0s20ZYWEw0aZatyWEjK0CKh292EpR9JqxWAcKE2NCFaFbbOcn finAgSRwgDwSglkJj7CNj7o8iZoSOs97tJ/TbO4WZhSa+HfASfUwKrzRyj+leWndklLd 9+Pg== X-Gm-Message-State: AOJu0YyHJIU5HzXy3oYwHfbXBfA94FkCnRNt9qOLBmhM4zljd/Fl0q4L R+VnPZxstzG03KN3XRYmcsnkMQq9/Ot6wgSa3qufRK3vMkodyJqdTKMl90sv5nkFf6kcHa8ngqR YGPYEIfnWDe4ASSbBO+lXKO9EuoFkPkKLuUlXgzVaUnyxcp73kayQZfNeQE5P1XzF75JHiQMIux AfbGxdhTSVR7F7hq0p739IqXYqjTiycXkz1cV8 X-Received: by 2002:a05:6402:1744:b0:57d:105c:c40c with SMTP id 4fb4d7f45d1cf-57d105cc49fmr5008897a12.24.1719036981374; Fri, 21 Jun 2024 23:16:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFwHbT0WoRt1AE863/AT8eK0gyJaEa+Z6La0dbvzJbpN6EMFIkmi7erNKhuVW9nHLZ50Nh/Tw== X-Received: by 2002:a05:6402:1744:b0:57d:105c:c40c with SMTP id 4fb4d7f45d1cf-57d105cc49fmr5008890a12.24.1719036980975; Fri, 21 Jun 2024 23:16:20 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 09/23] target/i386: do not check PREFIX_LOCK in old-style decoder Date: Sat, 22 Jun 2024 08:15:43 +0200 Message-ID: <20240622061558.530543-10-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240622061558.530543-1-pbonzini@redhat.com> References: <20240622061558.530543-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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719037175769100009 Content-Type: text/plain; charset="utf-8" It is already checked before getting there. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index c60f18c7482..501a1ef9313 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -2878,7 +2878,7 @@ static void gen_multi0F(DisasContext *s, X86DecodedIn= sn *decode) switch ((modrm >> 3) & 7) { case 7: if (mod !=3D 3 || - (s->prefix & (PREFIX_LOCK | PREFIX_REPNZ))) { + (s->prefix & PREFIX_REPNZ)) { goto illegal_op; } if (s->prefix & PREFIX_REPZ) { @@ -2898,7 +2898,7 @@ static void gen_multi0F(DisasContext *s, X86DecodedIn= sn *decode) =20 case 6: /* RDRAND */ if (mod !=3D 3 || - (s->prefix & (PREFIX_LOCK | PREFIX_REPZ | PREFIX_REPNZ)) || + (s->prefix & (PREFIX_REPZ | PREFIX_REPNZ)) || !(s->cpuid_ext_features & CPUID_EXT_RDRAND)) { goto illegal_op; } @@ -3058,8 +3058,7 @@ static void gen_multi0F(DisasContext *s, X86DecodedIn= sn *decode) =20 case 0xd0: /* xgetbv */ if ((s->cpuid_ext_features & CPUID_EXT_XSAVE) =3D=3D 0 - || (s->prefix & (PREFIX_LOCK | PREFIX_DATA - | PREFIX_REPZ | PREFIX_REPNZ))) { + || (s->prefix & (PREFIX_DATA | PREFIX_REPZ | PREFIX_REPNZ)= )) { goto illegal_op; } tcg_gen_trunc_tl_i32(s->tmp2_i32, cpu_regs[R_ECX]); @@ -3069,8 +3068,7 @@ static void gen_multi0F(DisasContext *s, X86DecodedIn= sn *decode) =20 case 0xd1: /* xsetbv */ if ((s->cpuid_ext_features & CPUID_EXT_XSAVE) =3D=3D 0 - || (s->prefix & (PREFIX_LOCK | PREFIX_DATA - | PREFIX_REPZ | PREFIX_REPNZ))) { + || (s->prefix & (PREFIX_DATA | PREFIX_REPZ | PREFIX_REPNZ)= )) { goto illegal_op; } gen_svm_check_intercept(s, SVM_EXIT_XSETBV); @@ -3237,8 +3235,7 @@ static void gen_multi0F(DisasContext *s, X86DecodedIn= sn *decode) gen_st_modrm(s, decode, ot); break; case 0xee: /* rdpkru */ - if (s->prefix & (PREFIX_LOCK | PREFIX_DATA - | PREFIX_REPZ | PREFIX_REPNZ)) { + if (s->prefix & (PREFIX_DATA | PREFIX_REPZ | PREFIX_REPNZ)) { goto illegal_op; } tcg_gen_trunc_tl_i32(s->tmp2_i32, cpu_regs[R_ECX]); @@ -3246,8 +3243,7 @@ static void gen_multi0F(DisasContext *s, X86DecodedIn= sn *decode) tcg_gen_extr_i64_tl(cpu_regs[R_EAX], cpu_regs[R_EDX], s->tmp1_= i64); break; case 0xef: /* wrpkru */ - if (s->prefix & (PREFIX_LOCK | PREFIX_DATA - | PREFIX_REPZ | PREFIX_REPNZ)) { + if (s->prefix & (PREFIX_DATA | PREFIX_REPZ | PREFIX_REPNZ)) { goto illegal_op; } tcg_gen_concat_tl_i64(s->tmp1_i64, cpu_regs[R_EAX], @@ -3323,7 +3319,6 @@ static void gen_multi0F(DisasContext *s, X86DecodedIn= sn *decode) if (prefixes & PREFIX_REPZ) { /* bndcl */ if (reg >=3D 4 - || (prefixes & PREFIX_LOCK) || s->aflag =3D=3D MO_16) { goto illegal_op; } @@ -3331,7 +3326,6 @@ static void gen_multi0F(DisasContext *s, X86DecodedIn= sn *decode) } else if (prefixes & PREFIX_REPNZ) { /* bndcu */ if (reg >=3D 4 - || (prefixes & PREFIX_LOCK) || s->aflag =3D=3D MO_16) { goto illegal_op; } @@ -3345,7 +3339,7 @@ static void gen_multi0F(DisasContext *s, X86DecodedIn= sn *decode) } if (mod =3D=3D 3) { int reg2 =3D (modrm & 7) | REX_B(s); - if (reg2 >=3D 4 || (prefixes & PREFIX_LOCK)) { + if (reg2 >=3D 4) { goto illegal_op; } if (s->flags & HF_MPX_IU_MASK) { @@ -3374,7 +3368,6 @@ static void gen_multi0F(DisasContext *s, X86DecodedIn= sn *decode) /* bndldx */ AddressParts a =3D decode->mem; if (reg >=3D 4 - || (prefixes & PREFIX_LOCK) || s->aflag =3D=3D MO_16 || a.base < -1) { goto illegal_op; @@ -3410,7 +3403,6 @@ static void gen_multi0F(DisasContext *s, X86DecodedIn= sn *decode) if (mod !=3D 3 && (prefixes & PREFIX_REPZ)) { /* bndmk */ if (reg >=3D 4 - || (prefixes & PREFIX_LOCK) || s->aflag =3D=3D MO_16) { goto illegal_op; } @@ -3438,7 +3430,6 @@ static void gen_multi0F(DisasContext *s, X86DecodedIn= sn *decode) } else if (prefixes & PREFIX_REPNZ) { /* bndcn */ if (reg >=3D 4 - || (prefixes & PREFIX_LOCK) || s->aflag =3D=3D MO_16) { goto illegal_op; } @@ -3450,7 +3441,7 @@ static void gen_multi0F(DisasContext *s, X86DecodedIn= sn *decode) } if (mod =3D=3D 3) { int reg2 =3D (modrm & 7) | REX_B(s); - if (reg2 >=3D 4 || (prefixes & PREFIX_LOCK)) { + if (reg2 >=3D 4) { goto illegal_op; } if (s->flags & HF_MPX_IU_MASK) { @@ -3477,7 +3468,6 @@ static void gen_multi0F(DisasContext *s, X86DecodedIn= sn *decode) /* bndstx */ AddressParts a =3D decode->mem; if (reg >=3D 4 - || (prefixes & PREFIX_LOCK) || s->aflag =3D=3D MO_16 || a.base < -1) { goto illegal_op; --=20 2.45.2 From nobody Mon Nov 25 00:16:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719037071; cv=none; d=zohomail.com; s=zohoarc; b=K4EVu+E907T4fgLgxfHtiQ5sB0cJa6jfUa7ljaxe6WYdNm8/sQetwvI7p0UcZkaxw3VhARqmj0Yb+FSgfdSD6jxDDh5awy1tVlGgoLkoTtZMCubGXx6xfAvW0pDt+cqjJR04+Yz8YaD4vwy3jY3AS+ykRZYwpH4DlAVBtjt/12o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719037071; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=edfgvS3ELSSOyELG7RxvO1gV2FBychxCHSiOtjvR6gU=; b=gtO/UBTmjadR3OnHqYARR1E6atnbiAUmu0JV0RJen2QclGzPxGtDzD+/Q4ixMdmGDD8Gb89OBBYLTfFXZEvyLiBMMZc3O+HEzFxZgSM6H2o/Lt7yJweoSc5xcBxZkuPKg0WTIrWGfnxP5+Te1wYdiAkS3QONkwMHTQ/+hIQvPXA= 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 1719037071342600.772155239864; Fri, 21 Jun 2024 23:17:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKu3M-0000QR-TO; Sat, 22 Jun 2024 02:16:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu37-0000I8-5H for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:34 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu35-0006SG-HR for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:32 -0400 Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-299-NwuMkWk2NwWy6d0HXVcCWQ-1; Sat, 22 Jun 2024 02:16:27 -0400 Received: by mail-lj1-f199.google.com with SMTP id 38308e7fff4ca-2ec5674b5a4so1282011fa.2 for ; Fri, 21 Jun 2024 23:16:27 -0700 (PDT) Received: from avogadro.local ([151.62.196.71]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57d305616dfsm1886041a12.79.2024.06.21.23.16.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 23:16:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719036990; 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=edfgvS3ELSSOyELG7RxvO1gV2FBychxCHSiOtjvR6gU=; b=cSJUQrMaNhMTv7pE1eBNvaWWnnn1NmQwLZrkiIvhyGKUKc5VAycqhb5fvr148gxJOJNUvL lVhaKyk/x8n2jq7Ra0/Tl5dXBWWY52M3Q6EZWFUL0eRhknyvaphgezQrcT0ihypG4l49c2 oa31o28RTcyiLwvuKaBCGu7NyDM4OLQ= X-MC-Unique: NwuMkWk2NwWy6d0HXVcCWQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719036984; x=1719641784; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=edfgvS3ELSSOyELG7RxvO1gV2FBychxCHSiOtjvR6gU=; b=rqwYkki983kY+l2VoqgTpnrPECh8ngXcfk7mPhunmdQesNi1oZbps3GP3ClbZmJBYX E9oFjZIkRm2zBJX+00gXps0KjLohjzoocG5qA34qspHjIu2lRPqg7gULF4MxbIGthVQy heLuUsoUDBQWEwyLVD39ohJC/rf+nlRu6L1JgMdlqKi9C0bmwYA7IBzFfmvSaeexcJos Oed3b1+0rpRZ7cEQEmf5Ene6567OmdlFzOEUgK92TAjMpay8vj1WaU24ZimueNXBPUkE Qwi/9iY4ULTTVy8cL9TylvhuieQ3EJvtdEtukfy9tg5qFYSpouZjqY2kj7XH+rBKiQfQ KMMw== X-Gm-Message-State: AOJu0Yw7uypLkild7RECHXksmLqTsohqDmpzFG7uUMJl15BvIbKq+Rf5 RTWaoDZOXJDqvlPbFIJ30UoWlRf7hykFz2SSp5gxqK5Dh6jMcwWSoo2DtYAeyitbA3aQudKVxyQ FVOGJEJWYH044Hb4cWPNnWuPHkYEiqAsrpMs2YxjWNtkEIA31FgQhKnq6R/GMEqwGUevUCOvSXO tsVo75zd9Nx8wYe7/9vj1311Tva6b+Gai0WGrW X-Received: by 2002:a2e:828f:0:b0:2ec:49b5:50d5 with SMTP id 38308e7fff4ca-2ec49b551bcmr42101491fa.41.1719036984529; Fri, 21 Jun 2024 23:16:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEIY1dG182lwf/narStAyLF9kFvaTUGxfqDdsxsXN2QLqbVlEureUOuXY+uDiQnEvNcbgXlLQ== X-Received: by 2002:a2e:828f:0:b0:2ec:49b5:50d5 with SMTP id 38308e7fff4ca-2ec49b551bcmr42101331fa.41.1719036984081; Fri, 21 Jun 2024 23:16:24 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 10/23] target/i386: list instructions still in translate.c Date: Sat, 22 Jun 2024 08:15:44 +0200 Message-ID: <20240622061558.530543-11-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240622061558.530543-1-pbonzini@redhat.com> References: <20240622061558.530543-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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719037073425100007 Content-Type: text/plain; charset="utf-8" Group them so that it is easier to figure out which two-byte opcodes to tackle together. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.c.inc | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/target/i386/tcg/decode-new.c.inc b/target/i386/tcg/decode-new.= c.inc index fa51aadfcf2..f01a4f1f1fe 100644 --- a/target/i386/tcg/decode-new.c.inc +++ b/target/i386/tcg/decode-new.c.inc @@ -129,6 +129,37 @@ * * (^) these are the two cases in which Intel and AMD disagree on the * primary exception class + * + * Instructions still in translate.c + * --------------------------------- + * Generation of TCG opcodes for almost all instructions is in emit.c.inc; + * this file interprets the prefixes and opcode bytes down to individual + * instruction mnemonics. There is only a handful of opcodes still using + * a switch statement to decode modrm bits 3-5 and prefixes after decoding + * is complete; these are relics of the older x86 decoder and their code + * generation is performed in translate.c. + * + * These unconverted opcodes also perform their own effective address + * generation using the gen_lea_modrm() function. + * + * There is nothing particularly complicated about them; simply, they don't + * need any nasty hacks in the decoder, and they shouldn't get in the way + * of the implementation of new x86 instructions, so they are left alone + * for the time being. + * + * x87: + * 0xD8 - 0xDF + * + * privileged/system: + * 0x0F 0x00 group 6 (SLDT, STR, LLDT, LTR, VERR, VERW) + * 0x0F 0x01 group 7 (SGDT, SIDT, LGDT, LIDT, SMSW, LMSW, IN= VLPG, + * MONITOR, MWAIT, CLAC, STAC, XGETBV, XS= ETBV, + * SWAPGS, RDTSCP) + * 0x0F 0xC7 (reg operand) group 9 (RDRAND, RDSEED, RDPID) + * + * MPX: + * 0x0F 0x1A BNDLDX, BNDMOV, BNDCL, BNDCU + * 0x0F 0x1B BNDSTX, BNDMOV, BNDMK, BNDCN */ =20 #define X86_OP_NONE { 0 }, --=20 2.45.2 From nobody Mon Nov 25 00:16:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719037054; cv=none; d=zohomail.com; s=zohoarc; b=miKI3gUFGQqgDjREX7BD5cbTtR4WBktsvrAW83UkIOtqnXDJAyxbS5/PL5G1vahqAzKXdrXkpb2gd8aCeLDokFgSZhO5WJoBErcdmuYYtxTpUpvEqnnCzoWEvAIuLt/3ebHYNRhCpQY7zjk/Q2BWHi5lPNUp9qsPKxvyIhQQvSs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719037054; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5vNRpvyeREGd2+Es2hiS7dffvsmxbIt4ClxNcgU2ADU=; b=M1OyyB952tQcyP0wt8jGz0LAM1lNkwskjR8lbsTnolg2t+nb7IZ63rObYo8tSQbSB2a5lHkbP/pcK2XV3qjDiU7xjw9hYmcmx+5CL08ChtAKPlx8xfXKh7qEvgnRBG0nRQDSStNzPr5Y9EogHfCrsYtHuUu7skGbcMMIaM9DkQw= 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 1719037054703622.7401739659293; Fri, 21 Jun 2024 23:17:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKu3W-0000Xk-LO; Sat, 22 Jun 2024 02:16:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu38-0000JE-Aa for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu36-0006Sb-PB for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:34 -0400 Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-483-y7u-Dd76M-qB3uNLrg4fqw-1; Sat, 22 Jun 2024 02:16:29 -0400 Received: by mail-lj1-f200.google.com with SMTP id 38308e7fff4ca-2ec4d8ceaafso12307481fa.1 for ; Fri, 21 Jun 2024 23:16:29 -0700 (PDT) Received: from avogadro.local ([151.62.196.71]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6fcf560ad2sm158976166b.173.2024.06.21.23.16.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 23:16:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719036991; 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=5vNRpvyeREGd2+Es2hiS7dffvsmxbIt4ClxNcgU2ADU=; b=JpnTIyzFzWRVXwgCw2l3MDNeJQf5XwQy9hHBza2DMIGHsQaxTS2TZhO/bvnPxA5GltshEM hXE98Cuf/sQDahktFW5ndgmKR4U1vMUs8xopVLMR/DRqZIZMj7PlcHxwO3eiECymxR0T2U 9kGJKjAsBV1A+Eizl9L8mDlK40lSydw= X-MC-Unique: y7u-Dd76M-qB3uNLrg4fqw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719036987; x=1719641787; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5vNRpvyeREGd2+Es2hiS7dffvsmxbIt4ClxNcgU2ADU=; b=b/sybDdxMvvSYF70A+GpM1y0PBci/AkJcjD/w1BRjDTD+j1U6oN8Qxq3PpTZbHwD3i VKLgtEdFsi013NMfCDatdMXM2pU305jo1JEWvrBFglOayoxGGSkzKKM/zaP5piSmwukG yWV9Ekhb3Q1OclCY7RqbSNYVadIRU1kV6XGuV/dNkFoRmQN8WX8qFwtgXUSNwD4+dfaP pco3jQrj9LuqrWXYxlE0Zcot3jnWcDwn1jPvXLwXYnTzxHyv+QCrVwY3YucuA28kxmIa 4gsWEC88r/4Q7s6O/cdtgiEt1DLHOyAx9HfdD59TRgVpHBkoM4XiKi7AdeVQjto3Ilc0 oueg== X-Gm-Message-State: AOJu0YxZW8Ir0aKteR6GdJWY88Km2jFU/g/TdTO8snqwaQusqZDKny58 nFDU4MzMcU5ocmhRO48CCsvwo5obSROlRoUgXGoy3cNEg0DtLxV546OY02zl3XxjrR1kM+AkCua oAwJaqPoqSfOUT4kzGtC6ENDVowbFGJKg5mvnF/ftzImIsb4uNzElIAzNu+AmSDmU/V2HNknOcK SpyFQ2w8uGPA7TpdAJPkIy6t5OFJrKYhwohdOH X-Received: by 2002:a2e:96cc:0:b0:2ec:557b:f895 with SMTP id 38308e7fff4ca-2ec557bfab4mr5533061fa.31.1719036987589; Fri, 21 Jun 2024 23:16:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF6CNSDGL1xiQLRV3OZNnfNG1Laocq/PtTs6TJd4VMyG71n6LUmQDCTUzPFaFr7uymUUhKIDw== X-Received: by 2002:a2e:96cc:0:b0:2ec:557b:f895 with SMTP id 38308e7fff4ca-2ec557bfab4mr5532921fa.31.1719036987199; Fri, 21 Jun 2024 23:16:27 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 11/23] target/i386: assert that cc_op* and pc_save are preserved Date: Sat, 22 Jun 2024 08:15:45 +0200 Message-ID: <20240622061558.530543-12-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240622061558.530543-1-pbonzini@redhat.com> References: <20240622061558.530543-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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719037055337100001 Content-Type: text/plain; charset="utf-8" Now all decoding has been done before any code generation. There is no need anymore to save and restore cc_op* and pc_save but, for the time being, assert that this is indeed the case. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 501a1ef9313..d11c5e1dc13 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -3709,15 +3709,9 @@ static void i386_tr_translate_insn(DisasContextBase = *dcbase, CPUState *cpu) case 2: /* Restore state that may affect the next instruction. */ dc->pc =3D dc->base.pc_next; - /* - * TODO: These save/restore can be removed after the table-based - * decoder is complete; we will be decoding the insn completely - * before any code generation that might affect these variables. - */ - dc->cc_op_dirty =3D orig_cc_op_dirty; - dc->cc_op =3D orig_cc_op; - dc->pc_save =3D orig_pc_save; - /* END TODO */ + assert(dc->cc_op_dirty =3D=3D orig_cc_op_dirty); + assert(dc->cc_op =3D=3D orig_cc_op); + assert(dc->pc_save =3D=3D orig_pc_save); dc->base.num_insns--; tcg_remove_ops_after(dc->prev_insn_end); dc->base.insn_start =3D dc->prev_insn_start; --=20 2.45.2 From nobody Mon Nov 25 00:16:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719037029; cv=none; d=zohomail.com; s=zohoarc; b=ezz2qhQd3YVBgvhbl89BbDXnPYPPD+csbIxekrH6tyxUEcDJxZED74ZOkBUPnzS48Akfr5fHJO+2Z6KwG5bofYhbuZ5DGdtYVDHc0TQsJ04sOAgdbVBYDERe/vH850Rxz+97hhSVs7tm9o54emfjK3U1bde6k1HYAvuLhoIb2FQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719037029; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=EbIvh5b7KQ5TRyXSWuEts9KNlhisXZ5PWf3o2CP+6Cg=; b=J0YQLa7ZQi5jSEA8XnNCsPAIoEGYUzcrlnGCMkf09TMqbmrFA5pqo0wt1NRK9KfdeS+jRsuqMCj8RUzro7zsjBinwAoH2h+tlflfqv6TIzzMK0kzsYbb97Rc/NPAi/K+YzYuHiWFApF0R4U38/kkSle17vurs9F003wa7G7cSTA= 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 1719037029798855.8712447643444; Fri, 21 Jun 2024 23:17:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKu3O-0000S2-OW; Sat, 22 Jun 2024 02:16:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu3D-0000LY-9T for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu3B-0006TZ-HV for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:38 -0400 Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-435-rbd-Q8ZHPWW6r38t1A__GQ-1; Sat, 22 Jun 2024 02:16:31 -0400 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-a706f279c56so4974766b.3 for ; Fri, 21 Jun 2024 23:16:31 -0700 (PDT) Received: from avogadro.local ([151.62.196.71]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a707a0e4a52sm18620366b.87.2024.06.21.23.16.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 23:16:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719036995; 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=EbIvh5b7KQ5TRyXSWuEts9KNlhisXZ5PWf3o2CP+6Cg=; b=ReBikAabhFNQeU953TyqoixA/+yst0Tx5nVsXf07DD0ckh5zcJ4CbMifkt8g4WHYiLS3nf WbSwu/Iw9wiFW4cXkEZmwhN/T0nOWyMBin4kfyYuCgcaSoO02NIi8CLscryAfVnI5dJpnM ORW6yJjFEn+qWZugUhKCJqpbsCyLTgM= X-MC-Unique: rbd-Q8ZHPWW6r38t1A__GQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719036989; x=1719641789; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EbIvh5b7KQ5TRyXSWuEts9KNlhisXZ5PWf3o2CP+6Cg=; b=R0pOGoeO1vb+TsjbJy1+bMDv4BjWTwzhgy8o8hbvWhRcdPxDSie9aQSRu9vzv6zFq3 8GrVuPiu791h2ZXv7jcbxZqnXlI700gg/euKWDmPJlBjTc+RvkVB5y0GHXxi5XBjGS84 MxYnlFvqz0H67dTvGhqWGUQZ8lalB2iMQIFu7puIX0G1SViBHCSYpJnjBxUIDEAkSyGc +NqZ4dut43p5DTlbKD8e1lLysEKCvUGXYD88Y1Mo4Ybiz5F8nOx6kZOKEGA8rgKiyhME YqmIb6XQw4e6r8qHCgd3ZnZfT3pqhABi0CTlNtBTtDb59KkTsg6eKAdVZaatBa4OGBsc XP7Q== X-Gm-Message-State: AOJu0YwiM2fv983w+yHrXXdkTYmZ5Np/6ksZL385xuaBvS1lxrTkJJKK JazACet2hIRHVGR0lafoXMRxDiEEQPD0tAwkhOlRofRX+NO1y+pkUxtXqaNVB2k6X6aaFqoeYyM EcuzeHj3XUoIEUd9a8Bz+6fsJLP1dIHg5nfv7KdOYwjpDXfdaphq/p7DnH86w6Qd5AicUtpgF8D 25UBDjyxJwok+tvf3oqEDr+Vwjx2zHUxGnaSE7 X-Received: by 2002:a17:907:9693:b0:a6f:8a1b:9964 with SMTP id a640c23a62f3a-a6fab77570dmr722242566b.57.1719036989120; Fri, 21 Jun 2024 23:16:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFnXOPBapSQIZ7BKnYELPDD/fHOrwfdh0+Uj9GEGuQsRnh5wInTqAolDFxvVIQDUR90Gfj6TA== X-Received: by 2002:a17:907:9693:b0:a6f:8a1b:9964 with SMTP id a640c23a62f3a-a6fab77570dmr722241166b.57.1719036988763; Fri, 21 Jun 2024 23:16:28 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 12/23] target/i386: remove gen_ext_tl Date: Sat, 22 Jun 2024 08:15:46 +0200 Message-ID: <20240622061558.530543-13-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240622061558.530543-1-pbonzini@redhat.com> References: <20240622061558.530543-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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719037031366100010 Content-Type: text/plain; charset="utf-8" With the introduction of tcg_gen_ext_tl, most uses can be converted directly because they do not have a NULL destination. tcg_gen_ext_tl is able to drop no-ops like "tcg_gen_ext_tl(tcgv, tcgv, MO_TL)" just fine, and the only thi= ng that gen_ext_tl was adding on top was avoiding the creation of a useless temporary. This can be done in the only place where it matters, which is gen_op_j_ecx. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 41 +++++++++++++++---------------------- 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index d11c5e1dc13..5c9c992400e 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -697,23 +697,16 @@ static inline TCGv gen_compute_Dshift(DisasContext *s= , MemOp ot) return dshift; }; =20 -static TCGv gen_ext_tl(TCGv dst, TCGv src, MemOp size, bool sign) -{ - if (size =3D=3D MO_TL) { - return src; - } - if (!dst) { - dst =3D tcg_temp_new(); - } - tcg_gen_ext_tl(dst, src, size | (sign ? MO_SIGN : 0)); - return dst; -} - static void gen_op_j_ecx(DisasContext *s, TCGCond cond, TCGLabel *label1) { - TCGv tmp =3D gen_ext_tl(NULL, cpu_regs[R_ECX], s->aflag, false); - - tcg_gen_brcondi_tl(cond, tmp, 0, label1); + TCGv lhs; + if (s->aflag =3D=3D MO_TL) { + lhs =3D cpu_regs[R_ECX]; + } else { + lhs =3D tcg_temp_new(); + tcg_gen_ext_tl(lhs, cpu_regs[R_ECX], s->aflag); + } + tcg_gen_brcondi_tl(cond, lhs, 0, label1); } =20 static inline void gen_op_jz_ecx(DisasContext *s, TCGLabel *label1) @@ -886,16 +879,16 @@ static CCPrepare gen_prepare_eflags_c(DisasContext *s= , TCGv reg) case CC_OP_SUBB ... CC_OP_SUBQ: /* (DATA_TYPE)CC_SRCT < (DATA_TYPE)CC_SRC */ size =3D s->cc_op - CC_OP_SUBB; - gen_ext_tl(s->cc_srcT, s->cc_srcT, size, false); - gen_ext_tl(cpu_cc_src, cpu_cc_src, size, false); + tcg_gen_ext_tl(s->cc_srcT, s->cc_srcT, size); + tcg_gen_ext_tl(cpu_cc_src, cpu_cc_src, size); return (CCPrepare) { .cond =3D TCG_COND_LTU, .reg =3D s->cc_srcT, .reg2 =3D cpu_cc_src, .use_reg2 =3D true }; =20 case CC_OP_ADDB ... CC_OP_ADDQ: /* (DATA_TYPE)CC_DST < (DATA_TYPE)CC_SRC */ size =3D s->cc_op - CC_OP_ADDB; - gen_ext_tl(cpu_cc_dst, cpu_cc_dst, size, false); - gen_ext_tl(cpu_cc_src, cpu_cc_src, size, false); + tcg_gen_ext_tl(cpu_cc_dst, cpu_cc_dst, size); + tcg_gen_ext_tl(cpu_cc_src, cpu_cc_src, size); return (CCPrepare) { .cond =3D TCG_COND_LTU, .reg =3D cpu_cc_dst, .reg2 =3D cpu_cc_src, .use_reg2 =3D true }; =20 @@ -920,7 +913,7 @@ static CCPrepare gen_prepare_eflags_c(DisasContext *s, = TCGv reg) =20 case CC_OP_BMILGB ... CC_OP_BMILGQ: size =3D s->cc_op - CC_OP_BMILGB; - gen_ext_tl(cpu_cc_src, cpu_cc_src, size, false); + tcg_gen_ext_tl(cpu_cc_src, cpu_cc_src, size); return (CCPrepare) { .cond =3D TCG_COND_EQ, .reg =3D cpu_cc_src }; =20 case CC_OP_ADCX: @@ -1050,8 +1043,8 @@ static CCPrepare gen_prepare_cc(DisasContext *s, int = b, TCGv reg) size =3D s->cc_op - CC_OP_SUBB; switch (jcc_op) { case JCC_BE: - gen_ext_tl(s->cc_srcT, s->cc_srcT, size, false); - gen_ext_tl(cpu_cc_src, cpu_cc_src, size, false); + tcg_gen_ext_tl(s->cc_srcT, s->cc_srcT, size); + tcg_gen_ext_tl(cpu_cc_src, cpu_cc_src, size); cc =3D (CCPrepare) { .cond =3D TCG_COND_LEU, .reg =3D s->cc_sr= cT, .reg2 =3D cpu_cc_src, .use_reg2 =3D true }; break; @@ -1061,8 +1054,8 @@ static CCPrepare gen_prepare_cc(DisasContext *s, int = b, TCGv reg) case JCC_LE: cond =3D TCG_COND_LE; fast_jcc_l: - gen_ext_tl(s->cc_srcT, s->cc_srcT, size, true); - gen_ext_tl(cpu_cc_src, cpu_cc_src, size, true); + tcg_gen_ext_tl(s->cc_srcT, s->cc_srcT, size | MO_SIGN); + tcg_gen_ext_tl(cpu_cc_src, cpu_cc_src, size | MO_SIGN); cc =3D (CCPrepare) { .cond =3D cond, .reg =3D s->cc_srcT, .reg2 =3D cpu_cc_src, .use_reg2 =3D true }; break; --=20 2.45.2 From nobody Mon Nov 25 00:16:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719037060; cv=none; d=zohomail.com; s=zohoarc; b=DKsm2NNwKLWzlI8KcDKEllEZy6Wfj5yRzcDz0D25D1YLB9qVjEq65ryA5vMoxE5AkJQJAqeuYv9WsnC2L1nPvmCfpm9y8p2zXSdGNQ4wIpbS6sZ4fKNrF2BAG/YmUZ2YWvZcE2cXlMLtqldnpAmuwsuK2bYRpEXrpB9vDtjGPe0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719037060; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=LuxMfRanQpqIe+rAUiRiqqmIxZ2Dd4XmJCnCNtxApfk=; b=UwVgzHnbez4u6a3m01iqzGQJRfQGMGUjPtJ0AukU4VRNIssFFQfQlirElQkqAaOf//rm+IrDsm4ltdOa3TkaFt7H4q2Zj3F9gVU6k6IxKbvSR4MgWd3pF+tc4GRz/48JfKDe6acEgjAc8ppkvCicDsnDmsVI79j3rQN65TH5ME4= 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 1719037060003110.26399746656091; Fri, 21 Jun 2024 23:17:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKu3p-0000xX-UM; Sat, 22 Jun 2024 02:17:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu3D-0000LX-9Y for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu3B-0006Te-JE for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:39 -0400 Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-163-PwskY0Y6NzymRC1upIwOEw-1; Sat, 22 Jun 2024 02:16:33 -0400 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-a6efe7123e0so74526166b.0 for ; Fri, 21 Jun 2024 23:16:33 -0700 (PDT) Received: from avogadro.local ([151.62.196.71]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57d3053558esm1864109a12.64.2024.06.21.23.16.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 23:16:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719036995; 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=LuxMfRanQpqIe+rAUiRiqqmIxZ2Dd4XmJCnCNtxApfk=; b=BDYSLHs9r+oFlTf4GlMReyyFs6j5W/9LzFLjxwYkR2028FBbvg8Nu2L/5jGHa07Dyexdop n95cX6VLUGSWa1LiGU03p+HvMf33bZOyGcQQVkCH+uPJMz3aXbl/QIOezUZE7GzWSFfJE0 C62uaWi3CYfhw7LbiTsw0PbGpH6pKPc= X-MC-Unique: PwskY0Y6NzymRC1upIwOEw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719036992; x=1719641792; 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:message-id:reply-to; bh=LuxMfRanQpqIe+rAUiRiqqmIxZ2Dd4XmJCnCNtxApfk=; b=n0dfGJ26GWcRpu9WmFhE/URieQtOo0tTfdf49VJx1Z/0baCRfim5tkaWCRNTXUHntn 6nML6P3GD+g4bm9UUjvytd58RMekSW0jRRjITsLIUrkaAbhXbIuFsZTdHKCIZzIR6scB 5bfpWKyEV75E0kGYkw580b6YaeK/SNJ1v4JLFzTNxz0r5QjBdjXQplAlfeJNQum+nlGh /T8/LiDXV3uBu3olMuLwD7UpJgZFUKy/y+ICVf0oEJFfNgxTEfeKlH2LoLUGqDaHPLgM mP2vl5AWQYpi0cj6TSa1Bc/XlXPMao0MEmfL7zhWs0q3AQZT443iL1TNIi84BhNkOf2B BMBg== X-Gm-Message-State: AOJu0Yx/GDpZ8//sxaulgd7iO7FPNe0VPWyB5xMNHmn3VLSFIoJXMFDy H/StLtOTG6I+YkeSsCrwF3KKPo1nPqVDByGaVWOt5vpEooQoUw21BVByhJTgOslQ8VwmpmqW4j6 fUQAZ15ibrUiQNBakrGI2L3ay2ZMNxX/EQRqzl04RsSqQWssz3bI6+DB43kNxcp4hj4iJe9RXmV MIpjByOsiFarSOy0DjzUqkbjQJ0CDjXLeaIMaD X-Received: by 2002:a50:f61b:0:b0:578:638e:3683 with SMTP id 4fb4d7f45d1cf-57d07e0d028mr7180914a12.5.1719036992037; Fri, 21 Jun 2024 23:16:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGmD4ginLRsyat+Wf9/9wDqhmYSphrZbNJDOv/7X3FJ7Emt5eYAb0Z4dzvC6rFGs2dOio2Qow== X-Received: by 2002:a50:f61b:0:b0:578:638e:3683 with SMTP id 4fb4d7f45d1cf-57d07e0d028mr7180902a12.5.1719036991670; Fri, 21 Jun 2024 23:16:31 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 13/23] Revert "host/i386: assume presence of POPCNT" Date: Sat, 22 Jun 2024 08:15:47 +0200 Message-ID: <20240622061558.530543-14-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240622061558.530543-1-pbonzini@redhat.com> References: <20240622061558.530543-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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719037061349100017 Content-Type: text/plain; charset="utf-8" This reverts commit 45ccdbcb24baf99667997fac5cf60318e5e7db51. The x86-64 instruction set can now be tuned down to x86-64 v1 or i386 Pentium Pro. Signed-off-by: Paolo Bonzini --- host/include/i386/host/cpuinfo.h | 1 + tcg/i386/tcg-target.h | 5 +++-- util/cpuinfo-i386.c | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/host/include/i386/host/cpuinfo.h b/host/include/i386/host/cpui= nfo.h index c1e94d75ce1..72f6fad61e5 100644 --- a/host/include/i386/host/cpuinfo.h +++ b/host/include/i386/host/cpuinfo.h @@ -11,6 +11,7 @@ #define CPUINFO_ALWAYS (1u << 0) /* so cpuinfo is nonzero */ #define CPUINFO_MOVBE (1u << 2) #define CPUINFO_LZCNT (1u << 3) +#define CPUINFO_POPCNT (1u << 4) #define CPUINFO_BMI1 (1u << 5) #define CPUINFO_BMI2 (1u << 6) #define CPUINFO_AVX1 (1u << 9) diff --git a/tcg/i386/tcg-target.h b/tcg/i386/tcg-target.h index ecc69827287..2f67a97e059 100644 --- a/tcg/i386/tcg-target.h +++ b/tcg/i386/tcg-target.h @@ -111,6 +111,7 @@ typedef enum { #endif =20 #define have_bmi1 (cpuinfo & CPUINFO_BMI1) +#define have_popcnt (cpuinfo & CPUINFO_POPCNT) #define have_avx1 (cpuinfo & CPUINFO_AVX1) #define have_avx2 (cpuinfo & CPUINFO_AVX2) #define have_movbe (cpuinfo & CPUINFO_MOVBE) @@ -142,7 +143,7 @@ typedef enum { #define TCG_TARGET_HAS_nor_i32 0 #define TCG_TARGET_HAS_clz_i32 1 #define TCG_TARGET_HAS_ctz_i32 1 -#define TCG_TARGET_HAS_ctpop_i32 1 +#define TCG_TARGET_HAS_ctpop_i32 have_popcnt #define TCG_TARGET_HAS_deposit_i32 1 #define TCG_TARGET_HAS_extract_i32 1 #define TCG_TARGET_HAS_sextract_i32 1 @@ -177,7 +178,7 @@ typedef enum { #define TCG_TARGET_HAS_nor_i64 0 #define TCG_TARGET_HAS_clz_i64 1 #define TCG_TARGET_HAS_ctz_i64 1 -#define TCG_TARGET_HAS_ctpop_i64 1 +#define TCG_TARGET_HAS_ctpop_i64 have_popcnt #define TCG_TARGET_HAS_deposit_i64 1 #define TCG_TARGET_HAS_extract_i64 1 #define TCG_TARGET_HAS_sextract_i64 0 diff --git a/util/cpuinfo-i386.c b/util/cpuinfo-i386.c index 8f2694d88f2..6d474a6259a 100644 --- a/util/cpuinfo-i386.c +++ b/util/cpuinfo-i386.c @@ -35,6 +35,7 @@ unsigned __attribute__((constructor)) cpuinfo_init(void) __cpuid(1, a, b, c, d); =20 info |=3D (c & bit_MOVBE ? CPUINFO_MOVBE : 0); + info |=3D (c & bit_POPCNT ? CPUINFO_POPCNT : 0); info |=3D (c & bit_PCLMUL ? CPUINFO_PCLMUL : 0); =20 /* NOTE: our AES support requires SSSE3 (PSHUFB) as well. */ --=20 2.45.2 From nobody Mon Nov 25 00:16:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719037057; cv=none; d=zohomail.com; s=zohoarc; b=Fr3uF+eTs8wb6jNZRdY/H5+bH6LbM3twrbZpbpbEEV5OYDErjv2VwkcAqajCo26bdkb02TqpE+nbXAnjE+M/mkT3qKtwloy1J6wvk4EE842jyuper7G47gSte387xn09VjeUOhjG9+Y3XsMMqqxuHrz8iy72XCOnTBrqdlg5E30= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719037057; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=i1Dd/q0yvFV1Rcm+rk+YwoeGVJGUNMen0d4jeqopdXw=; b=WnCyN5uXpAvz0GlBSekPK35PPSk03Rk0YEzy9NGfLUu3j6Sh0xJeC8+V8qdDdNaCqfHXCQTfqE2Ps7lQuAC7ynBSoDIlQB09uLAXgVawezANoQKGqcGkOqrxNjWq1H6IqCnw/EgVrIL28vwQA5525JBC1hwG75p2YY12zzAi8vA= 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 1719037057874520.162646418981; Fri, 21 Jun 2024 23:17:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKu3T-0000Ul-ET; Sat, 22 Jun 2024 02:16:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu3E-0000M9-Vd for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu3D-0006Tq-HZ for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:40 -0400 Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-690-d6DKQ74ANRakPLlSFbS2jA-1; Sat, 22 Jun 2024 02:16:36 -0400 Received: by mail-lf1-f70.google.com with SMTP id 2adb3069b0e04-52c8ddc2ef9so1965648e87.1 for ; Fri, 21 Jun 2024 23:16:35 -0700 (PDT) Received: from avogadro.local ([151.62.196.71]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6fd4f75309sm121604966b.106.2024.06.21.23.16.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 23:16:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719036999; 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=i1Dd/q0yvFV1Rcm+rk+YwoeGVJGUNMen0d4jeqopdXw=; b=JcaLbmYCyCiXi8Jcz5BQMl57l22E8lY/05q9pcb/80aeUxl/YJphg+Kadj2I65h0AfrbIa lsU6ofYNUamJEBUYKCoDdqfxhEKW7X3wEx6boDofP+2OFeddrcj8zzG07tl4dCpvSGrXlU LPJKVvRDLh07Z2s9APWazsDBNW6QQqw= X-MC-Unique: d6DKQ74ANRakPLlSFbS2jA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719036994; x=1719641794; 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:message-id:reply-to; bh=i1Dd/q0yvFV1Rcm+rk+YwoeGVJGUNMen0d4jeqopdXw=; b=WnChdM2O7eEQ/mm9T8pnqNqSmVTU4xY/Rae9EID9GXCl1vdeYuvg8mB9p+5lKzv4iJ /wB+JzTRSGeE5CfsZIegolpi3WWyTwUawKcb342aCCb9rM3v6llBkLo1bnfZshKNOiGT sdktxLuFfE/yApz8Y+MKFtKDXKxOH72R5CHAYykJBDf/UHVY9WmCvlvvFXs7Dn9jfer5 bKPWw6nlhUX+vZRIeah3Ngjwu8T/Io419SbBdgwOLCYWAoCi34M4ve+v4NUlD0WfPQXO 7RISlT7BTorJeBjEbXK3MhuNZwiMNQiLQLAQg/J65y43HrAjVT0AwPKcqsn+0R9F6D7e uOiQ== X-Gm-Message-State: AOJu0Yze0nDMLj2UoKx/OmSPHiVe3HO2rjS9UkvybNJnpyzECKO66kFE +jMsjQtAG8jfznmVQ7eRTJgNlsqneuRD/lm70ISaIItcQURe2vt9nEvHJ1RUBAWySpu4yV1l8sK iyDye0nHM7IfAkrdpqvma/BBb8jYb6qlxnZnsJ9FMbplzZbJJBY3GQBV36STExJ6YewWNBSoiG7 VX61cAesWuebeBVIHGbKVBv47DBCWIXHoxQ9Mc X-Received: by 2002:a05:6512:3f8:b0:52c:804e:e831 with SMTP id 2adb3069b0e04-52ccaa524ffmr6791268e87.47.1719036994369; Fri, 21 Jun 2024 23:16:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF5EA4tWFfgpmubFf5d/xQnTeW8V4nxpZ2RzvCLa+40jFtd7EZgJIclJrNO2cGy2ARbhk9ENA== X-Received: by 2002:a05:6512:3f8:b0:52c:804e:e831 with SMTP id 2adb3069b0e04-52ccaa524ffmr6791258e87.47.1719036994003; Fri, 21 Jun 2024 23:16:34 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 14/23] Revert "host/i386: assume presence of SSSE3" Date: Sat, 22 Jun 2024 08:15:48 +0200 Message-ID: <20240622061558.530543-15-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240622061558.530543-1-pbonzini@redhat.com> References: <20240622061558.530543-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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719037059351100011 Content-Type: text/plain; charset="utf-8" This reverts commit 433cd6d94a8256af70a5200f236dc8047c3c1468. The x86-64 instruction set can now be tuned down to x86-64 v1 or i386 Pentium Pro. Signed-off-by: Paolo Bonzini --- util/cpuinfo-i386.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/cpuinfo-i386.c b/util/cpuinfo-i386.c index 6d474a6259a..ca74ef04f54 100644 --- a/util/cpuinfo-i386.c +++ b/util/cpuinfo-i386.c @@ -38,8 +38,8 @@ unsigned __attribute__((constructor)) cpuinfo_init(void) info |=3D (c & bit_POPCNT ? CPUINFO_POPCNT : 0); info |=3D (c & bit_PCLMUL ? CPUINFO_PCLMUL : 0); =20 - /* NOTE: our AES support requires SSSE3 (PSHUFB) as well. */ - info |=3D (c & bit_AES) ? CPUINFO_AES : 0; + /* Our AES support requires PSHUFB as well. */ + info |=3D ((c & bit_AES) && (c & bit_SSSE3) ? CPUINFO_AES : 0); =20 /* For AVX features, we must check available and usable. */ if ((c & bit_AVX) && (c & bit_OSXSAVE)) { --=20 2.45.2 From nobody Mon Nov 25 00:16:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719037172; cv=none; d=zohomail.com; s=zohoarc; b=X8VF/GtsllmPv7cyGfp/YTfmw7oFxfnw2v+qYwVeOcyEh10eZSVkpAQ7moaT/svmbTozbjWT7dkGEKNFxoEb0A0yqZ0I9947+CPXZ/xNyuNdHoN7QrMnPdsIO2+FoaKCD13ECd19lRQqZvHnIUsaLppYf117ymoUmuw7E0MBuFc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719037172; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=GlW/705FWiMprOSUKjNiwJlL+EDmg1xNJ9taeoREqJs=; b=ia91589tfScZAw9GCskyavHSk3nuIakzv5GVa+n4EaXhJp/4fX3+rG7dzkeBtAAqr/NvyJrmDFyahPLZuB8WkdQiNbvA83Ixp4H/UkuBftV5oal1EkAGGdU5398x/fhX+w8ud8uFhNqxKiBU/6DzQnHqwd3HTKeb+FYf/kwzdLA= 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 1719037172749393.63391271908165; Fri, 21 Jun 2024 23:19:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKu42-0001c4-OA; Sat, 22 Jun 2024 02:17:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu3F-0000Mb-Uh for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:43 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu3E-0006U0-Ce for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:41 -0400 Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-324-h0SgzrNpM5es-2my7kra-A-1; Sat, 22 Jun 2024 02:16:37 -0400 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a6f0fee1f49so127881266b.0 for ; Fri, 21 Jun 2024 23:16:37 -0700 (PDT) Received: from avogadro.local ([151.62.196.71]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6fe4eeb106sm37935166b.167.2024.06.21.23.16.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 23:16:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719036999; 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=GlW/705FWiMprOSUKjNiwJlL+EDmg1xNJ9taeoREqJs=; b=IzXFjZfhu9dkbwmXp7Di6S/LzHUkidghFmzSnQAREtCdLCjyvscrDiNXjOdoT7wQMt1CYb Kvuzz/ohmw1m5QoRkd+z0Mqx1/U4PXADUwlTjIxcPRL+nuaRPx1uWfiIDau3U25wCOi+eZ HEpvZVaJRYcb6u5RPpoiVXJ4p9N2HIM= X-MC-Unique: h0SgzrNpM5es-2my7kra-A-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719036996; x=1719641796; 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:message-id:reply-to; bh=GlW/705FWiMprOSUKjNiwJlL+EDmg1xNJ9taeoREqJs=; b=ppsDze2nPOhTfyuxUh+T1fD/k7hhRESuzNvpv+htgSCdo5VtG8rZOuB2Nuypc0gU72 1X8RCLclEum8vf32yTnTwxRlDBL/7Y7etjzrBHcbHcrBlnO/mDFaLpeXwhNEf2tVl0/l gDv+ZAlFHo2itURQLIUVhIJlooYQv1b02DGPFPzCM3oNln3zc4LmwVpJa5/aDb45FKhY HhQUiJjBeoKDNOKCmtdj36bavL+/Iza3jmmvlJyVUa3md+tBokE585o3bLHxe4Fd3oPY 6GoY0k5SZKmHfMmvhP7uevzKAohzZkYruzWGGYJ/UQ4PyaqxUoT00+GyIwY4c75NiKPX yCvw== X-Gm-Message-State: AOJu0YxCRxXXMitVrhepyLT1jXLaKfF8BJK3awZ49CB3HJQv3IxIsBt3 kQg+GhZSs8Gl0ta9rD7txYe64nyEu2/1yXgHWOBeWodmXqahIuIThnEI+aNqQMlyZ/+FQNFFa4R xVAp4no2OxtgEBrKXCy/GdyxonPFsZHLv4UKBnn9Q2UeTSguO2jp26Ny/P+a4rxpIzXc7ZSgrPc saKy3lKNCnlcmB19xXpbtKYUC7QhNFRBpFgq1T X-Received: by 2002:a17:907:a64a:b0:a6f:ae81:172 with SMTP id a640c23a62f3a-a6fae810724mr680068866b.65.1719036995888; Fri, 21 Jun 2024 23:16:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEe/4fRq3weQ4uM6uwpu0Zp0ZoObqNzisXou7n33vCrCBbVEHX5m4lDXP5qhXISKpKhHbWLaQ== X-Received: by 2002:a17:907:a64a:b0:a6f:ae81:172 with SMTP id a640c23a62f3a-a6fae810724mr680067766b.65.1719036995518; Fri, 21 Jun 2024 23:16:35 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 15/23] Revert "host/i386: assume presence of SSE2" Date: Sat, 22 Jun 2024 08:15:49 +0200 Message-ID: <20240622061558.530543-16-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240622061558.530543-1-pbonzini@redhat.com> References: <20240622061558.530543-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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719037173775100001 Content-Type: text/plain; charset="utf-8" This reverts commit b18236897ca15c3db1506d8edb9a191dfe51429c. The x86-64 instruction set can now be tuned down to x86-64 v1 or i386 Pentium Pro. Signed-off-by: Paolo Bonzini --- host/include/i386/host/cpuinfo.h | 1 + util/bufferiszero.c | 4 ++-- util/cpuinfo-i386.c | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/host/include/i386/host/cpuinfo.h b/host/include/i386/host/cpui= nfo.h index 72f6fad61e5..81771733eaa 100644 --- a/host/include/i386/host/cpuinfo.h +++ b/host/include/i386/host/cpuinfo.h @@ -14,6 +14,7 @@ #define CPUINFO_POPCNT (1u << 4) #define CPUINFO_BMI1 (1u << 5) #define CPUINFO_BMI2 (1u << 6) +#define CPUINFO_SSE2 (1u << 7) #define CPUINFO_AVX1 (1u << 9) #define CPUINFO_AVX2 (1u << 10) #define CPUINFO_AVX512F (1u << 11) diff --git a/util/bufferiszero.c b/util/bufferiszero.c index 11c080e02cf..74864f7b782 100644 --- a/util/bufferiszero.c +++ b/util/bufferiszero.c @@ -188,14 +188,14 @@ static biz_accel_fn const accel_table[] =3D { =20 static unsigned best_accel(void) { -#ifdef CONFIG_AVX2_OPT unsigned info =3D cpuinfo_init(); =20 +#ifdef CONFIG_AVX2_OPT if (info & CPUINFO_AVX2) { return 2; } #endif - return 1; + return info & CPUINFO_SSE2 ? 1 : 0; } =20 #elif defined(__aarch64__) && defined(__ARM_NEON) diff --git a/util/cpuinfo-i386.c b/util/cpuinfo-i386.c index ca74ef04f54..90f92a42dc8 100644 --- a/util/cpuinfo-i386.c +++ b/util/cpuinfo-i386.c @@ -34,6 +34,7 @@ unsigned __attribute__((constructor)) cpuinfo_init(void) if (max >=3D 1) { __cpuid(1, a, b, c, d); =20 + info |=3D (d & bit_SSE2 ? CPUINFO_SSE2 : 0); info |=3D (c & bit_MOVBE ? CPUINFO_MOVBE : 0); info |=3D (c & bit_POPCNT ? CPUINFO_POPCNT : 0); info |=3D (c & bit_PCLMUL ? CPUINFO_PCLMUL : 0); --=20 2.45.2 From nobody Mon Nov 25 00:16:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719037099; cv=none; d=zohomail.com; s=zohoarc; b=NPfXiVR9JI58L9UOrr4R0xvoilhMAQoxab/zLo7ofJZVuMBS/Pw/XpVl8ijE8fd6Lnmpf+S7gP65rXfnAjE0yfw5VFBvzWpBuk5SivXCWkZ9VEKedyO8gicAPWEM3Fi6iw4pMPvXD66sWTgI6uN+TStrgRU/y5Dbs+3yvBwvRO0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719037099; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=EZr6EpxPTnCtfkI/16JpVzSMCa8vz0QSxvxLLnS2Bk8=; b=Wzdjd2U/jwlIpmEC4ZsHxsAoZqLbuASsUZ7sBT1xwSJ+gKUwl9AGpKCM5BAJNMJCPsENGSuiEgoJtCpUOAFbLhmd5hHUS4Kofjx++b2OCvrkAYGKEvMcronFcc6lzCiwpr36GHlj8KZBiWlWI1Kxl+tWRLCMfwTSrAFJTWMgNMg= 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 1719037099464124.11291021734223; Fri, 21 Jun 2024 23:18:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKu3y-0001OL-3k; Sat, 22 Jun 2024 02:17:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu3I-0000ON-8T for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu3G-0006UG-KZ for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:44 -0400 Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-589-jaPIkM8iMHa0Ph3MM2R0Kg-1; Sat, 22 Jun 2024 02:16:39 -0400 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a6ef9e87ef1so130150466b.3 for ; Fri, 21 Jun 2024 23:16:39 -0700 (PDT) Received: from avogadro.local ([151.62.196.71]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a714d0fe0ddsm11151566b.58.2024.06.21.23.16.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 23:16:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719037002; 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=EZr6EpxPTnCtfkI/16JpVzSMCa8vz0QSxvxLLnS2Bk8=; b=bJzhCqeTEOnKsLPnsoJ43J4R+S8SaLppZZ3yooOFmUl4ytSAu+OOpB0H6XLUN3aDJ0nAeH OjtHQLi4PgfMD7gQl9lSRkX7tR/cbV7Q9PnP+wjkSqLigrdov8oze6x6cLbPmnEcTMr/OL C9D6v3XQCefhVbyC42s/pFEJn5216d8= X-MC-Unique: jaPIkM8iMHa0Ph3MM2R0Kg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719036998; x=1719641798; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EZr6EpxPTnCtfkI/16JpVzSMCa8vz0QSxvxLLnS2Bk8=; b=izpoKdMj52aT8V+eDdtepzmlEQgMJdCCXhb5CYhrI69xHUxObz8iKG6kezN6bDh54p DP9lOpxl6VRhJ11ZXpUVdTBpVxHL/mtDZ2SinRjtYN8/bje3ub1Xe9xB4oLb3trclCiW 2vWM181Cy1DuloyjJT9ALwW2RynfVJQSpOMbVMlProfAAyuj12rkorp50ciSF1g8CXZZ 2eiIx4DdcTWhHXLoNQRfukpCZeiEp9s6liVJTdpIQaTONPvWC8aZ9tSlPcIYo8o9XDPm puCtAJvLjG8+sSSLVEBI28pqfBv0zBoGUNuDCuq/371gkKEa1WUowBercryQ48jSxq7l bWHQ== X-Gm-Message-State: AOJu0YyA/kqdF5i7N5SubGzWnq3alXYfTsixOOHy4bmOEFIG4wsIVVZk tR118hC2PC/xSNrhfsnBs1OLuXaQN1k50v9cfVg7juofwUhDGEaz66IjawqFcFsvUajzKe+X53N QjAagIwRosg8+k5L60CyY0rA+c9w4ZGhZNbsQvGmWi7okmTzqyOGseVmnWGII6n1ld7pHtccirz E9CTaH8/wdlW5/rhju6NoYgdBSbw69Rn4V941X X-Received: by 2002:a17:907:a4cc:b0:a6f:e2a3:cd0 with SMTP id a640c23a62f3a-a6fe2a30dcfmr56781766b.9.1719036998036; Fri, 21 Jun 2024 23:16:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEmPtVrEzr5x9l/4ocYRYlt0aqpuWv+ifFtUU7+6SCZfza1hj1lz74x/6kAg4tyOH4LOb1FWw== X-Received: by 2002:a17:907:a4cc:b0:a6f:e2a3:cd0 with SMTP id a640c23a62f3a-a6fe2a30dcfmr56780366b.9.1719036997472; Fri, 21 Jun 2024 23:16:37 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 16/23] meson: allow configuring the x86-64 baseline Date: Sat, 22 Jun 2024 08:15:50 +0200 Message-ID: <20240622061558.530543-17-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240622061558.530543-1-pbonzini@redhat.com> References: <20240622061558.530543-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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719037101551100003 Content-Type: text/plain; charset="utf-8" Add a Meson option to configure which x86-64 instruction set to use. QEMU will now default to x86-64-v1 + cmpxchg16b for 64-bit builds (that corresponds to a Pentium 4 for 32-bit builds). The baseline can be tuned down to Pentium Pro for 32-bit builds (with -Dx86_version=3D0), or up as desired. Acked-by: Richard Henderson Signed-off-by: Paolo Bonzini --- meson.build | 41 ++++++++++++++++++++++++++++------- meson_options.txt | 3 +++ scripts/meson-buildoptions.sh | 3 +++ 3 files changed, 39 insertions(+), 8 deletions(-) diff --git a/meson.build b/meson.build index 97e00d6f59b..6e694ecd9fe 100644 --- a/meson.build +++ b/meson.build @@ -336,15 +336,40 @@ if host_arch =3D=3D 'i386' and not cc.links(''' qemu_common_flags =3D ['-march=3Di486'] + qemu_common_flags endif =20 -# Assume x86-64-v2 (minus CMPXCHG16B for 32-bit code) -if host_arch =3D=3D 'i386' - qemu_common_flags =3D ['-mfpmath=3Dsse'] + qemu_common_flags -endif +# Pick x86-64 baseline version if host_arch in ['i386', 'x86_64'] - qemu_common_flags =3D ['-mpopcnt', '-msse4.2'] + qemu_common_flags -endif -if host_arch =3D=3D 'x86_64' - qemu_common_flags =3D ['-mcx16'] + qemu_common_flags + if get_option('x86_version') =3D=3D '0' and host_arch =3D=3D 'x86_64' + error('x86_64-v1 required for x86-64 hosts') + endif + + # add flags for individual instruction set extensions + if get_option('x86_version') >=3D '1' + if host_arch =3D=3D 'i386' + qemu_common_flags =3D ['-mfpmath=3Dsse'] + qemu_common_flags + else + # present on basically all processors but technically not part of + # x86-64-v1, so only include -mneeded for x86-64 version 2 and above + qemu_common_flags =3D ['-mcx16'] + qemu_common_flags + endif + endif + if get_option('x86_version') >=3D '2' + qemu_common_flags =3D ['-mpopcnt'] + qemu_common_flags + qemu_common_flags =3D cc.get_supported_arguments('-mneeded') + qemu_co= mmon_flags + endif + if get_option('x86_version') >=3D '3' + qemu_common_flags =3D ['-mmovbe', '-mabm', '-mbmi1', '-mbmi2', '-mfma'= , '-mf16c'] + qemu_common_flags + endif + + # add required vector instruction set (each level implies those below) + if get_option('x86_version') =3D=3D '1' + qemu_common_flags =3D ['-msse2'] + qemu_common_flags + elif get_option('x86_version') =3D=3D '2' + qemu_common_flags =3D ['-msse4.2'] + qemu_common_flags + elif get_option('x86_version') =3D=3D '3' + qemu_common_flags =3D ['-mavx2'] + qemu_common_flags + elif get_option('x86_version') =3D=3D '4' + qemu_common_flags =3D ['-mavx512f', '-mavx512bw', '-mavx512cd', '-mavx= 512dq', '-mavx512vl'] + qemu_common_flags + endif endif =20 if get_option('prefer_static') diff --git a/meson_options.txt b/meson_options.txt index 7a79dd89706..6065ed2d352 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -370,3 +370,6 @@ option('qemu_ga_version', type: 'string', value: '', =20 option('hexagon_idef_parser', type : 'boolean', value : true, description: 'use idef-parser to automatically generate TCG code fo= r the Hexagon frontend') + +option('x86_version', type : 'combo', choices : ['0', '1', '2', '3', '4'],= value: '1', + description: 'tweak required x86_64 architecture version beyond com= piler default') diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh index 58d49a447d5..62842d47e88 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -82,6 +82,8 @@ meson_options_help() { printf "%s\n" ' --with-suffix=3DVALUE Suffix for QEMU data/modules= /config directories' printf "%s\n" ' (can be empty) [qemu]' printf "%s\n" ' --with-trace-file=3DVALUE Trace file prefix for simple= backend [trace]' + printf "%s\n" ' --x86-version=3DCHOICE tweak required x86_64 archit= ecture version beyond' + printf "%s\n" ' compiler default [1] (choices:= 0/1/2/3)' printf "%s\n" '' printf "%s\n" 'Optional features, enabled with --enable-FEATURE and' printf "%s\n" 'disabled with --disable-FEATURE, default is enabled if av= ailable' @@ -552,6 +554,7 @@ _meson_option_parse() { --disable-werror) printf "%s" -Dwerror=3Dfalse ;; --enable-whpx) printf "%s" -Dwhpx=3Denabled ;; --disable-whpx) printf "%s" -Dwhpx=3Ddisabled ;; + --x86-version=3D*) quote_sh "-Dx86_version=3D$2" ;; --enable-xen) printf "%s" -Dxen=3Denabled ;; --disable-xen) printf "%s" -Dxen=3Ddisabled ;; --enable-xen-pci-passthrough) printf "%s" -Dxen_pci_passthrough=3Denab= led ;; --=20 2.45.2 From nobody Mon Nov 25 00:16:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719037079; cv=none; d=zohomail.com; s=zohoarc; b=bW3zr6flGMpyw2nCCiDz37L6UPig5ygP9P9GhToBj28ktEPDz43I0aZ1VIgAjUnF5QIYrObjXppGEZzeGZOBYIJa0hf76VEI+4mkSd/m/+C015T+LGyFByGGcQ2/iHQ1u4LM2i8BQB/nO3n9duFr9f0DHkmo2ebYORYJtCkDhmY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719037079; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=2zJrXRaDXBIm9h7tTU28UT9xcD/K/7uFNW/URjbJHRw=; b=YhNuMGdNZJ7FJ4FeOA/4287cTT4/yioqw8T39EglndN+MK4aE/LQPt4MbABpX8YsZQbqcI2xv7GBQQGHukhkxVhs4fCnLh1v2gnyVV3jJnDq8Y1k6w5UInPkvTUJ95ja7vXnVSOwqGS0Ndob5lnsTOWl0oZjB7aLl24g47+G2K4= 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 1719037079625617.397820772447; Fri, 21 Jun 2024 23:17:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKu3U-0000Vy-Qv; Sat, 22 Jun 2024 02:16:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu3L-0000Qr-9g for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu3J-0006UV-Cb for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:46 -0400 Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-621-w03g5oJYMemwQTdB07K3Hw-1; Sat, 22 Jun 2024 02:16:41 -0400 Received: by mail-ed1-f69.google.com with SMTP id 4fb4d7f45d1cf-57d3f1d20adso466509a12.0 for ; Fri, 21 Jun 2024 23:16:41 -0700 (PDT) Received: from avogadro.local ([151.62.196.71]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57d30534b25sm1863380a12.68.2024.06.21.23.16.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 23:16:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719037004; 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=2zJrXRaDXBIm9h7tTU28UT9xcD/K/7uFNW/URjbJHRw=; b=M+IdJz6LvSGIU2sihWZw9kbgZvImBO+lpWOweL4i7IEATaH65eiSdYpdvUijGouF/J57Kt tXW0Z340/9dqo6h7C2pC9DGZlNZTf9YiUsTsIvB26JM+no9y6Exa75Wvc0ljVwcmJca3u9 MTm8pn+SWEJ+S1tCtbFJ5+wLgqS1E0Q= X-MC-Unique: w03g5oJYMemwQTdB07K3Hw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719037000; x=1719641800; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2zJrXRaDXBIm9h7tTU28UT9xcD/K/7uFNW/URjbJHRw=; b=hifVjl30grCH1w0R7uZ3YmdZwQNt4uGWYNWXPP2eeZhenASsIdFyfqmc/K2/q7vjgU 1tKc2CKtRfbZIdkEqyNW9R/bDm/cc2xwG4Uvgeu8/Mt+vWzT30WL7uvq8JGQNJgKQC7V O02JWvdiEYaq2/ty2EeRIK7afznfNZ83LPSXiG4TDDov7XkonnuqXeWklbIsSCr9DeHf DAkX7mlpopi6+9gXqfTLDXN94cWW+unjP7jLBCvx/Ola4cbR8G1gJrYfdusAXwZ9Netn Ys4N7zSc1GBNInWIB0ndXUL/T5gU5owcyZiHvCS2BngPfAJRmYSH0zHpmv0YaFE02yX6 kF0w== X-Gm-Message-State: AOJu0YzFzCez1Sz2aWAFasZEVraZQ4XLVL7vzh3Lk3ehdpsBc9gEx5c1 JcC+yy55paJk7Y3AHj189SKms2pt/ugeylDYtplW6chXkOFEr7Lvw8oNG/Ul+Sztx2KeX5CMZRP 0yVJEWroTx43rqMif85FCjAztzpKeY68CjsSGOwiNiiAzcjYDVh2/CDiwcl2bFVvp+diiCuQLAw ANe0aq/Xs1UFqMzlLzhP7IcpvPU2MGn+LWAnVB X-Received: by 2002:a05:6402:184b:b0:57c:6b49:aef with SMTP id 4fb4d7f45d1cf-57d4483b0ffmr350113a12.11.1719037000063; Fri, 21 Jun 2024 23:16:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFK0wmR8jmoYRTxchYKF3rgI0Gwaz69fLnuEdn7aGZ0+gSYclcQ/Pl/MBtOKJPM3iVieMIkmg== X-Received: by 2002:a05:6402:184b:b0:57c:6b49:aef with SMTP id 4fb4d7f45d1cf-57d4483b0ffmr350109a12.11.1719036999807; Fri, 21 Jun 2024 23:16:39 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 17/23] meson: remove dead optimization option Date: Sat, 22 Jun 2024 08:15:51 +0200 Message-ID: <20240622061558.530543-18-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240622061558.530543-1-pbonzini@redhat.com> References: <20240622061558.530543-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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719037081499100003 Content-Type: text/plain; charset="utf-8" Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- meson.build | 13 ------------- meson_options.txt | 2 -- scripts/meson-buildoptions.sh | 3 --- 3 files changed, 18 deletions(-) diff --git a/meson.build b/meson.build index 6e694ecd9fe..54e6b09f4fb 100644 --- a/meson.build +++ b/meson.build @@ -2874,18 +2874,6 @@ config_host_data.set('CONFIG_AVX2_OPT', get_option('= avx2') \ int main(int argc, char *argv[]) { return bar(argv[argc - 1]); } '''), error_message: 'AVX2 not available').allowed()) =20 -config_host_data.set('CONFIG_AVX512F_OPT', get_option('avx512f') \ - .require(have_cpuid_h, error_message: 'cpuid.h not available, cannot ena= ble AVX512F') \ - .require(cc.links(''' - #include - #include - static int __attribute__((target("avx512f"))) bar(void *a) { - __m512i x =3D *(__m512i *)a; - return _mm512_test_epi64_mask(x, x); - } - int main(int argc, char *argv[]) { return bar(argv[argc - 1]); } - '''), error_message: 'AVX512F not available').allowed()) - config_host_data.set('CONFIG_AVX512BW_OPT', get_option('avx512bw') \ .require(have_cpuid_h, error_message: 'cpuid.h not available, cannot ena= ble AVX512BW') \ .require(cc.links(''' @@ -4283,7 +4271,6 @@ summary_info +=3D {'mutex debugging': get_option('d= ebug_mutex')} summary_info +=3D {'memory allocator': get_option('malloc')} summary_info +=3D {'avx2 optimization': config_host_data.get('CONFIG_AVX2_= OPT')} summary_info +=3D {'avx512bw optimization': config_host_data.get('CONFIG_A= VX512BW_OPT')} -summary_info +=3D {'avx512f optimization': config_host_data.get('CONFIG_AV= X512F_OPT')} summary_info +=3D {'gcov': get_option('b_coverage')} summary_info +=3D {'thread sanitizer': get_option('tsan')} summary_info +=3D {'CFI support': get_option('cfi')} diff --git a/meson_options.txt b/meson_options.txt index 6065ed2d352..0269fa0f16e 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -119,8 +119,6 @@ option('membarrier', type: 'feature', value: 'disabled', =20 option('avx2', type: 'feature', value: 'auto', description: 'AVX2 optimizations') -option('avx512f', type: 'feature', value: 'disabled', - description: 'AVX512F optimizations') option('avx512bw', type: 'feature', value: 'auto', description: 'AVX512BW optimizations') option('keyring', type: 'feature', value: 'auto', diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh index 62842d47e88..cfadb5ea86a 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -95,7 +95,6 @@ meson_options_help() { printf "%s\n" ' auth-pam PAM access control' printf "%s\n" ' avx2 AVX2 optimizations' printf "%s\n" ' avx512bw AVX512BW optimizations' - printf "%s\n" ' avx512f AVX512F optimizations' printf "%s\n" ' blkio libblkio block device driver' printf "%s\n" ' bochs bochs image format support' printf "%s\n" ' bpf eBPF support' @@ -240,8 +239,6 @@ _meson_option_parse() { --disable-avx2) printf "%s" -Davx2=3Ddisabled ;; --enable-avx512bw) printf "%s" -Davx512bw=3Denabled ;; --disable-avx512bw) printf "%s" -Davx512bw=3Ddisabled ;; - --enable-avx512f) printf "%s" -Davx512f=3Denabled ;; - --disable-avx512f) printf "%s" -Davx512f=3Ddisabled ;; --enable-gcov) printf "%s" -Db_coverage=3Dtrue ;; --disable-gcov) printf "%s" -Db_coverage=3Dfalse ;; --enable-lto) printf "%s" -Db_lto=3Dtrue ;; --=20 2.45.2 From nobody Mon Nov 25 00:16:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719037204; cv=none; d=zohomail.com; s=zohoarc; b=gTRCNgG0qdsPdIZwI/2dHmFdNJFo640/f0j5pgyk5jWayQyQblbHJU/TuIBF1ZQrxdZ5MRokNgM5TKDXNX1Bou5tk78GYWVinBSY+z7uNgG7fKoR6YlAc2Kq1p8456JLQU+LaNEO7I/J3QAc0e3eWUQMCITR/LsjqFJw1lcepNE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719037204; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=yrycet3jL1WSrURyl4kYUHh4gIffr2JcIs+cSDvgvbc=; b=lZEgnaNfT+nmzEudJrmeD6Klk9/eYpRYOFdxaqwnYqwHplajqhWRP1/7c+HoZtMSfPpCO8xXZ2E482EfhrepAU7ly293Ff4f46/EPOv34MrdNlMdz5SNzkhkcwtM1abtnnUCu7I0X6uVbhmsrpYmllWGzoQyEe0MIP/8+cozeXI= 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 171903720449539.80069086777905; Fri, 21 Jun 2024 23:20:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKu3d-0000Zz-IX; Sat, 22 Jun 2024 02:17:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu3O-0000Sj-O0 for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu3N-0006Uf-Cr for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:50 -0400 Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-18-BUyPwInlNt2yhZJF7BGTvg-1; Sat, 22 Jun 2024 02:16:44 -0400 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a6fe871a5aeso8412266b.2 for ; Fri, 21 Jun 2024 23:16:44 -0700 (PDT) Received: from avogadro.local ([151.62.196.71]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6fcf560ad2sm158996266b.173.2024.06.21.23.16.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 23:16:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719037008; 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=yrycet3jL1WSrURyl4kYUHh4gIffr2JcIs+cSDvgvbc=; b=I5HbbvpvLtpX52JYXAen92RQhZk0Nb15mL96GpdPzfDIMSRSqX9ihFtUTfHaLSlvUWU91P iv1RaMOsZe/VEu90p6ETPNYREHMY1EUVExhqMkM5+9DtObZW1g0hZwDsMFs4VGHLwLyg4G dCEGsMFbmI/uCX70E8SfxEJhbCeHZhk= X-MC-Unique: BUyPwInlNt2yhZJF7BGTvg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719037002; x=1719641802; 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:message-id:reply-to; bh=yrycet3jL1WSrURyl4kYUHh4gIffr2JcIs+cSDvgvbc=; b=Hc/Cm/TM94l6EfFp9MYhUxpPHxLDLZWOuVk7xKKNpJuycY38krI/B9tgVDddWrSftm FXRhQh6qBOyargP9KsHLIXIKmpaCRjMUK+j5rerqyFI0iN09dgIzNwkjDNNdfxyHqD5x qYaJZaY3zLg2nEa2ScRoAqPQV8knMQCray3NaqiUGiJIe8vfoIAXW7AbCvnkAPf5kMIS dGVdIqYn+vYiMXhEg8KcOs27tjFYz5rmubVgcumIpsS4apb97XnrvVciMrcr0Wnoc0PA KZPHlmer1nTq3k0c+sJ1x8+SYMOladxBHfipm2Uf1K9XoNdl0w0OhBssG3L6Ejf+qksy owJA== X-Gm-Message-State: AOJu0YwM9lWa/NwGURFGyRoNl0vlbxeRBQ2sffW5PlZTp4smtQG1DBUQ hdXAyC+oQ/k4jsC2qSPF9J/JMxGGJ57Q1nx6gvlPn16ctP9+lu2kytsKZxIE36WfWhlE/iuDg/T d/q0/phgBCoLRnWsxYUo5kkEPE8sKayaGbAb+A/YbBYm8cjj15CAD7VnGEMdDpGB+Pf65GhKXgB 3MqmeoUOeCivKqiVdJ2XmkluD7V4gyDl6/ZHNN X-Received: by 2002:a17:906:bf45:b0:a6f:5db5:71a0 with SMTP id a640c23a62f3a-a6fab602c9emr712358666b.14.1719037002612; Fri, 21 Jun 2024 23:16:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG02UMRoMIQfh+0IUhhOOuBtKoryQodMVv5YNLt8O0yU4nfSjN1jAB9D9ZlT/3pTSXFC04Rag== X-Received: by 2002:a17:906:bf45:b0:a6f:5db5:71a0 with SMTP id a640c23a62f3a-a6fab602c9emr712357866b.14.1719037002238; Fri, 21 Jun 2024 23:16:42 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 18/23] block: make assertion more generic Date: Sat, 22 Jun 2024 08:15:52 +0200 Message-ID: <20240622061558.530543-19-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240622061558.530543-1-pbonzini@redhat.com> References: <20240622061558.530543-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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719037205870100001 Content-Type: text/plain; charset="utf-8" .bdrv_needs_filename is only set for drivers that also set bdrv_file_open, i.e. protocol drivers. So we can make the assertion always, it will always pass for those drivers that use bdrv_open. Signed-off-by: Paolo Bonzini --- block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block.c b/block.c index 468cf5e67d7..69a2905178a 100644 --- a/block.c +++ b/block.c @@ -1655,8 +1655,8 @@ bdrv_open_driver(BlockDriverState *bs, BlockDriver *d= rv, const char *node_name, bs->drv =3D drv; bs->opaque =3D g_malloc0(drv->instance_size); =20 + assert(!drv->bdrv_needs_filename || bs->filename[0]); if (drv->bdrv_file_open) { - assert(!drv->bdrv_needs_filename || bs->filename[0]); ret =3D drv->bdrv_file_open(bs, options, open_flags, &local_err); } else if (drv->bdrv_open) { ret =3D drv->bdrv_open(bs, options, open_flags, &local_err); --=20 2.45.2 From nobody Mon Nov 25 00:16:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719037039; cv=none; d=zohomail.com; s=zohoarc; b=aqnAfGMmi4/S1SnAa0DQ9KAJWodeXuS4QiKg3U/gQrHgnOFU78CtlzsvjnueSrF3//tD7qqRWBYmjniWPSku3qcrinXAZ14H/BQC2HIpZiyn8XK/+4wlThCkF0vfuDmSRRhviIueMISCaEjy+GetVvtUxkvq8RwbqI2lNCnSBJs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719037039; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=PyxEzNGqoXJbFXc5PayVB6u8Z/13e83iLysZlGsVNCM=; b=KXfEyLt7j/maOdB6tXSDqNDpNjZcuTGr7rhW2azeE2ebJVJBcHQwMtkrbw+1H+g+w5FdvZKdX1e7pBkYvK/91JAN6QQ2NIZ3IHkxFGPSq9zPksiykOryufGsBMRWnRm5GV+1+CKwSSV31i3cFtJGUP18EdeUCc9iu96VQXbzMXY= 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 1719037039750917.9407426762523; Fri, 21 Jun 2024 23:17:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKu3g-0000iM-AJ; Sat, 22 Jun 2024 02:17:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu3P-0000Tb-Uz for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu3O-0006Ui-D5 for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:51 -0400 Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-461-wx9eeHWoNKWAiKsczlwtuA-1; Sat, 22 Jun 2024 02:16:46 -0400 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-a7194d0fd53so3487066b.0 for ; Fri, 21 Jun 2024 23:16:46 -0700 (PDT) Received: from avogadro.local ([151.62.196.71]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6fcf4ba61asm157646166b.91.2024.06.21.23.16.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 23:16:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719037009; 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=PyxEzNGqoXJbFXc5PayVB6u8Z/13e83iLysZlGsVNCM=; b=BUqRNG2p40UFt0RIA6fbfMaXaoACX3f5KBxzlIMvUUuIRNv6O3ThEKqM/Uky/oAo/j2op4 YjhF5xRuCsvjkuBG065cRk4xhZ1y9ZwtUeUb8Is8nBWh8ogZWmwT+g4w7Q9IDe3ogk2rHO V9k58TsfNgNsCfgW5181QJeLkWp/tzg= X-MC-Unique: wx9eeHWoNKWAiKsczlwtuA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719037005; x=1719641805; 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:message-id:reply-to; bh=PyxEzNGqoXJbFXc5PayVB6u8Z/13e83iLysZlGsVNCM=; b=LP5t4CLAztgskgYAQRjPPMhpAgxh8JGJgd08CEhYtxFl9MhOUgLL7uKNDhQonMJ466 /rGvht2rOia460229tFkJ4q+Q4t4Pf8hTI8B1HBeYYzjEEbL93XY1mks/HgTHcpEoW0N rLmLOenD1lpPpsxTX2jVI9wqaAIx76/KGVPAL6l8zuhuZNT+iKqCTXaZKfc0nbe4h04B Zwxr11p1GvXogYMSfVN9q/e/arEgXDKWs+VihYoH5GJUKKMm/6FOgLjwWIIsCXYLe/nL M3gJatfExWhn+SP3niJM0J/A0oP7Q0lg0fbN2D6YggCq3LVEX1zLLj6k7sgTHISYqltd Bpjg== X-Gm-Message-State: AOJu0YzlrqVn2phcXE47/X1ZWHEzkKpYUrhfe8yhndGyj1F+yJ+mta8s joacBBk6vNq0JSl65pwH+RAwhUGSgSpP3AJASl4Wc+AhfE4pPBRiYfu6zIUcmVAl2A+q2YwNNBr dVcnYxE5BeF4/irMrr7bte/8EMZ9Xl/Ghzht0gkVqOhB5CHN2bC0hgogTZ3zkqX087duBfciCjr DGhROcMPC8xD67IHPVXkusaTfp4/wDiKc2/E7+ X-Received: by 2002:a17:907:8011:b0:a6f:11c9:f349 with SMTP id a640c23a62f3a-a6fab61c1f4mr562543866b.23.1719037004830; Fri, 21 Jun 2024 23:16:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFe9iBnRfv+ZELgaBbFnDqCv5mH6beg7rw3nilMQTrWV+HHH9G72Cwy273p4x/SZSVftn/nxA== X-Received: by 2002:a17:907:8011:b0:a6f:11c9:f349 with SMTP id a640c23a62f3a-a6fab61c1f4mr562543266b.23.1719037004387; Fri, 21 Jun 2024 23:16:44 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 19/23] block: do not check bdrv_file_open Date: Sat, 22 Jun 2024 08:15:53 +0200 Message-ID: <20240622061558.530543-20-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240622061558.530543-1-pbonzini@redhat.com> References: <20240622061558.530543-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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719037041292100001 Content-Type: text/plain; charset="utf-8" The set of BlockDrivers that have .bdrv_file_open coincides with those that have .protocol_name and guess what---checking drv->bdrv_file_open is done to see if the driver is a protocol. So check drv->protocol_name instead. Signed-off-by: Paolo Bonzini --- block.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/block.c b/block.c index 69a2905178a..dd14ba85fc3 100644 --- a/block.c +++ b/block.c @@ -926,7 +926,6 @@ BlockDriver *bdrv_find_protocol(const char *filename, int i; =20 GLOBAL_STATE_CODE(); - /* TODO Drivers without bdrv_file_open must be specified explicitly */ =20 /* * XXX(hch): we really should not let host device detection @@ -1983,7 +1982,7 @@ static int bdrv_open_common(BlockDriverState *bs, Blo= ckBackend *file, open_flags =3D bdrv_open_flags(bs, bs->open_flags); node_name =3D qemu_opt_get(opts, "node-name"); =20 - assert(!drv->bdrv_file_open || file =3D=3D NULL); + assert(!drv->protocol_name || file =3D=3D NULL); ret =3D bdrv_open_driver(bs, drv, node_name, options, open_flags, errp= ); if (ret < 0) { goto fail_opts; @@ -2084,7 +2083,7 @@ static int bdrv_fill_options(QDict **options, const c= har *filename, } /* If the user has explicitly specified the driver, this choice sh= ould * override the BDRV_O_PROTOCOL flag */ - protocol =3D drv->bdrv_file_open; + protocol =3D drv->protocol_name; } =20 if (protocol) { @@ -4123,7 +4122,7 @@ bdrv_open_inherit(const char *filename, const char *r= eference, QDict *options, } =20 /* BDRV_O_PROTOCOL must be set iff a protocol BDS is about to be creat= ed */ - assert(!!(flags & BDRV_O_PROTOCOL) =3D=3D !!drv->bdrv_file_open); + assert(!!(flags & BDRV_O_PROTOCOL) =3D=3D !!drv->protocol_name); /* file must be NULL if a protocol BDS is about to be created * (the inverse results in an error message from bdrv_open_common()) */ assert(!(flags & BDRV_O_PROTOCOL) || !file); @@ -5971,7 +5970,7 @@ int64_t coroutine_fn bdrv_co_get_allocated_file_size(= BlockDriverState *bs) return drv->bdrv_co_get_allocated_file_size(bs); } =20 - if (drv->bdrv_file_open) { + if (drv->protocol_name) { /* * Protocol drivers default to -ENOTSUP (most of their data is * not stored in any of their children (if they even have any), @@ -8030,7 +8029,7 @@ void bdrv_refresh_filename(BlockDriverState *bs) * Both of these conditions are represented by generate_json_fil= ename. */ if (primary_child_bs->exact_filename[0] && - primary_child_bs->drv->bdrv_file_open && + primary_child_bs->drv->protocol_name && !drv->is_filter && !generate_json_filename) { strcpy(bs->exact_filename, primary_child_bs->exact_filename); --=20 2.45.2 From nobody Mon Nov 25 00:16:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719037057; cv=none; d=zohomail.com; s=zohoarc; b=lfDYLcpfX6i0i9Wi/XF6hC+BRczONjGp6QNtj4nPYjEsAPIRtXe/0O1ujWh7Ke1XLFUUhhzBlU2TFI2pPLaqveM7kDWmgk+dS/wrKZamwXXhqWTLtdqEnlAp5NQkfp73pca1UD9iUPXu79ifu39wNz0ycQ9wIuZw2xUXWBKd2tg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719037057; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=26VrXM0DHOiKV7RbRMquU6833DYubbhko1Fn4Gg+sYw=; b=M7KpH00ISN3IIKWmfUYOYjuLIW7O31drKx8AXmRZvzAqHFlFTQrHBUWefTkpdpZ/4RbqRNVjh2M8JNMPKHuOY9N0Nso6yTJ2M6S33b4o0rZvVd+K9RwwBdroiIo0GQ2f/hoqpl3T7spA+ePck+i44/t88TAErDHwqsTu1F6v5Y8= 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 1719037057840104.63982927608038; Fri, 21 Jun 2024 23:17:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKu42-0001Y4-Bu; Sat, 22 Jun 2024 02:17:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu3T-0000W2-Qr for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:56 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu3R-0006V2-KZ for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:55 -0400 Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-609-1UoEU_9bNGSDzM8OlXTHCQ-1; Sat, 22 Jun 2024 02:16:49 -0400 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-a6def6e9ef2so317182966b.0 for ; Fri, 21 Jun 2024 23:16:49 -0700 (PDT) Received: from avogadro.local ([151.62.196.71]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6fcf48b3bdsm155828766b.75.2024.06.21.23.16.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 23:16:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719037013; 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=26VrXM0DHOiKV7RbRMquU6833DYubbhko1Fn4Gg+sYw=; b=IVFTMP4xR4mquExcCglN6GjMOIAhoR7R9I6scCBR+wdX5+HEEjwwpI69/APUumd3Q0VzAO xpVGgejbvWuk8cVhh8N+99q1K1eQwJ9EkMxVmmrOoQNbHgXYsgdf3HOCPS7D5uSFgAmA/h YIEQlhPmiw4QIx59vmD/yiYDMX9PY5w= X-MC-Unique: 1UoEU_9bNGSDzM8OlXTHCQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719037007; x=1719641807; 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:message-id:reply-to; bh=26VrXM0DHOiKV7RbRMquU6833DYubbhko1Fn4Gg+sYw=; b=jPeTLNtp4c9xcVsFpx2kgafjWvH9SVXSW8S/nLgvXjGi09Eikt7VjVi3M1ShG47jks akxYQBgC7c4z7MzY7QSOmeJ/4jzq+r0FaeWobWqY07/DIQjsng8uqSuihESU8AloZegP RhQ9kKf7oEdjEcIG28xkRB5wb6Sf028/8KceKilhBEeL8c9Zc0uNfM84LtsNSY/rlGZy V5JC9yHonE9wQRhxiTHe8IpTXHcY+igygpXuQJeSRWVp8dokc1fVEifn1id3Ecfb3WPj YJTwwlpwZZf02MOJqnhZJhC9s6u3p5e0wnI6eRSq5TeuH6LrUVPA2MuL8xOOrKJUTNjz P8cw== X-Gm-Message-State: AOJu0YzVVFnsT1HwAIjdfsbYWkSDp5MTL02AxcxuOLQCJlYYgrcv6KbV geDEUWOsXHnGxXoTkz+Xp+uAXoNduKEgUVRwGNwBCHNeKVFxb1uIQcFaks8QDF+iiVpk0t5VYdB NGJPN669ANfmo/C3d43Ai0uqKDv/2jP/q/XIqmPZ6JqWNTNHh89NcqVS+Qz7I41EYRuugbZhNe0 LKcx0Wt/72DZciT4yIU3Khfc1++BJKe0o2a4+g X-Received: by 2002:a17:906:339a:b0:a6f:4287:f196 with SMTP id a640c23a62f3a-a6ffe2706a7mr37261066b.2.1719037007369; Fri, 21 Jun 2024 23:16:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEsBeFiVJUegOJ0SGTHzkx0ENXAcHRZaQWUiP6R4Fa649NiHQtH0QtfMsSpMTGnoOPAale4aA== X-Received: by 2002:a17:906:339a:b0:a6f:4287:f196 with SMTP id a640c23a62f3a-a6ffe2706a7mr37259266b.2.1719037006749; Fri, 21 Jun 2024 23:16:46 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 20/23] block: remove separate bdrv_file_open callback Date: Sat, 22 Jun 2024 08:15:54 +0200 Message-ID: <20240622061558.530543-21-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240622061558.530543-1-pbonzini@redhat.com> References: <20240622061558.530543-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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719037059406100013 Content-Type: text/plain; charset="utf-8" bdrv_file_open and bdrv_open are completely equivalent, they are never checked except to see which one to invoke. So merge them into a single one. Signed-off-by: Paolo Bonzini --- include/block/block_int-common.h | 3 --- block.c | 4 +--- block/blkdebug.c | 2 +- block/blkio.c | 2 +- block/blkverify.c | 2 +- block/curl.c | 8 ++++---- block/file-posix.c | 8 ++++---- block/file-win32.c | 4 ++-- block/gluster.c | 6 +++--- block/iscsi.c | 4 ++-- block/nbd.c | 6 +++--- block/nfs.c | 2 +- block/null.c | 4 ++-- block/nvme.c | 2 +- block/rbd.c | 3 ++- block/ssh.c | 2 +- block/vvfat.c | 2 +- 17 files changed, 30 insertions(+), 34 deletions(-) diff --git a/include/block/block_int-common.h b/include/block/block_int-com= mon.h index 761276127ed..ebb4e56a503 100644 --- a/include/block/block_int-common.h +++ b/include/block/block_int-common.h @@ -248,9 +248,6 @@ struct BlockDriver { int GRAPH_UNLOCKED_PTR (*bdrv_open)( BlockDriverState *bs, QDict *options, int flags, Error **errp); =20 - /* Protocol drivers should implement this instead of bdrv_open */ - int GRAPH_UNLOCKED_PTR (*bdrv_file_open)( - BlockDriverState *bs, QDict *options, int flags, Error **errp); void (*bdrv_close)(BlockDriverState *bs); =20 int coroutine_fn GRAPH_UNLOCKED_PTR (*bdrv_co_create)( diff --git a/block.c b/block.c index dd14ba85fc3..c1cc313d216 100644 --- a/block.c +++ b/block.c @@ -1655,9 +1655,7 @@ bdrv_open_driver(BlockDriverState *bs, BlockDriver *d= rv, const char *node_name, bs->opaque =3D g_malloc0(drv->instance_size); =20 assert(!drv->bdrv_needs_filename || bs->filename[0]); - if (drv->bdrv_file_open) { - ret =3D drv->bdrv_file_open(bs, options, open_flags, &local_err); - } else if (drv->bdrv_open) { + if (drv->bdrv_open) { ret =3D drv->bdrv_open(bs, options, open_flags, &local_err); } else { ret =3D 0; diff --git a/block/blkdebug.c b/block/blkdebug.c index 9da8c9eddc2..c95c818c388 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -1073,7 +1073,7 @@ static BlockDriver bdrv_blkdebug =3D { .is_filter =3D true, =20 .bdrv_parse_filename =3D blkdebug_parse_filename, - .bdrv_file_open =3D blkdebug_open, + .bdrv_open =3D blkdebug_open, .bdrv_close =3D blkdebug_close, .bdrv_reopen_prepare =3D blkdebug_reopen_prepare, .bdrv_child_perm =3D blkdebug_child_perm, diff --git a/block/blkio.c b/block/blkio.c index 882e1c297b4..1a38064ce76 100644 --- a/block/blkio.c +++ b/block/blkio.c @@ -1088,7 +1088,7 @@ static void blkio_refresh_limits(BlockDriverState *bs= , Error **errp) */ #define BLKIO_DRIVER_COMMON \ .instance_size =3D sizeof(BDRVBlkioState), \ - .bdrv_file_open =3D blkio_file_open, \ + .bdrv_open =3D blkio_file_open, \ .bdrv_close =3D blkio_close, \ .bdrv_co_getlength =3D blkio_co_getlength, \ .bdrv_co_truncate =3D blkio_truncate, \ diff --git a/block/blkverify.c b/block/blkverify.c index ec45d8335ed..5a9bf674d9c 100644 --- a/block/blkverify.c +++ b/block/blkverify.c @@ -321,7 +321,7 @@ static BlockDriver bdrv_blkverify =3D { .instance_size =3D sizeof(BDRVBlkverifyState), =20 .bdrv_parse_filename =3D blkverify_parse_filename, - .bdrv_file_open =3D blkverify_open, + .bdrv_open =3D blkverify_open, .bdrv_close =3D blkverify_close, .bdrv_child_perm =3D bdrv_default_perms, .bdrv_co_getlength =3D blkverify_co_getlength, diff --git a/block/curl.c b/block/curl.c index 419f7c89ef2..ef5252d00b5 100644 --- a/block/curl.c +++ b/block/curl.c @@ -1034,7 +1034,7 @@ static BlockDriver bdrv_http =3D { =20 .instance_size =3D sizeof(BDRVCURLState), .bdrv_parse_filename =3D curl_parse_filename, - .bdrv_file_open =3D curl_open, + .bdrv_open =3D curl_open, .bdrv_close =3D curl_close, .bdrv_co_getlength =3D curl_co_getlength, =20 @@ -1053,7 +1053,7 @@ static BlockDriver bdrv_https =3D { =20 .instance_size =3D sizeof(BDRVCURLState), .bdrv_parse_filename =3D curl_parse_filename, - .bdrv_file_open =3D curl_open, + .bdrv_open =3D curl_open, .bdrv_close =3D curl_close, .bdrv_co_getlength =3D curl_co_getlength, =20 @@ -1072,7 +1072,7 @@ static BlockDriver bdrv_ftp =3D { =20 .instance_size =3D sizeof(BDRVCURLState), .bdrv_parse_filename =3D curl_parse_filename, - .bdrv_file_open =3D curl_open, + .bdrv_open =3D curl_open, .bdrv_close =3D curl_close, .bdrv_co_getlength =3D curl_co_getlength, =20 @@ -1091,7 +1091,7 @@ static BlockDriver bdrv_ftps =3D { =20 .instance_size =3D sizeof(BDRVCURLState), .bdrv_parse_filename =3D curl_parse_filename, - .bdrv_file_open =3D curl_open, + .bdrv_open =3D curl_open, .bdrv_close =3D curl_close, .bdrv_co_getlength =3D curl_co_getlength, =20 diff --git a/block/file-posix.c b/block/file-posix.c index be25e35ff6e..f3bd946afac 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -3886,7 +3886,7 @@ BlockDriver bdrv_file =3D { .bdrv_needs_filename =3D true, .bdrv_probe =3D NULL, /* no probe for protocols */ .bdrv_parse_filename =3D raw_parse_filename, - .bdrv_file_open =3D raw_open, + .bdrv_open =3D raw_open, .bdrv_reopen_prepare =3D raw_reopen_prepare, .bdrv_reopen_commit =3D raw_reopen_commit, .bdrv_reopen_abort =3D raw_reopen_abort, @@ -4257,7 +4257,7 @@ static BlockDriver bdrv_host_device =3D { .bdrv_needs_filename =3D true, .bdrv_probe_device =3D hdev_probe_device, .bdrv_parse_filename =3D hdev_parse_filename, - .bdrv_file_open =3D hdev_open, + .bdrv_open =3D hdev_open, .bdrv_close =3D raw_close, .bdrv_reopen_prepare =3D raw_reopen_prepare, .bdrv_reopen_commit =3D raw_reopen_commit, @@ -4396,7 +4396,7 @@ static BlockDriver bdrv_host_cdrom =3D { .bdrv_needs_filename =3D true, .bdrv_probe_device =3D cdrom_probe_device, .bdrv_parse_filename =3D cdrom_parse_filename, - .bdrv_file_open =3D cdrom_open, + .bdrv_open =3D cdrom_open, .bdrv_close =3D raw_close, .bdrv_reopen_prepare =3D raw_reopen_prepare, .bdrv_reopen_commit =3D raw_reopen_commit, @@ -4522,7 +4522,7 @@ static BlockDriver bdrv_host_cdrom =3D { .bdrv_needs_filename =3D true, .bdrv_probe_device =3D cdrom_probe_device, .bdrv_parse_filename =3D cdrom_parse_filename, - .bdrv_file_open =3D cdrom_open, + .bdrv_open =3D cdrom_open, .bdrv_close =3D raw_close, .bdrv_reopen_prepare =3D raw_reopen_prepare, .bdrv_reopen_commit =3D raw_reopen_commit, diff --git a/block/file-win32.c b/block/file-win32.c index 48b790d9173..7e1baa1ece6 100644 --- a/block/file-win32.c +++ b/block/file-win32.c @@ -746,7 +746,7 @@ BlockDriver bdrv_file =3D { .instance_size =3D sizeof(BDRVRawState), .bdrv_needs_filename =3D true, .bdrv_parse_filename =3D raw_parse_filename, - .bdrv_file_open =3D raw_open, + .bdrv_open =3D raw_open, .bdrv_refresh_limits =3D raw_probe_alignment, .bdrv_close =3D raw_close, .bdrv_co_create_opts =3D raw_co_create_opts, @@ -920,7 +920,7 @@ static BlockDriver bdrv_host_device =3D { .bdrv_needs_filename =3D true, .bdrv_parse_filename =3D hdev_parse_filename, .bdrv_probe_device =3D hdev_probe_device, - .bdrv_file_open =3D hdev_open, + .bdrv_open =3D hdev_open, .bdrv_close =3D raw_close, .bdrv_refresh_limits =3D hdev_refresh_limits, =20 diff --git a/block/gluster.c b/block/gluster.c index d0999903dfe..f8b415f3812 100644 --- a/block/gluster.c +++ b/block/gluster.c @@ -1551,7 +1551,7 @@ static BlockDriver bdrv_gluster =3D { .format_name =3D "gluster", .protocol_name =3D "gluster", .instance_size =3D sizeof(BDRVGlusterState), - .bdrv_file_open =3D qemu_gluster_open, + .bdrv_open =3D qemu_gluster_open, .bdrv_reopen_prepare =3D qemu_gluster_reopen_prepare, .bdrv_reopen_commit =3D qemu_gluster_reopen_commit, .bdrv_reopen_abort =3D qemu_gluster_reopen_abort, @@ -1580,7 +1580,7 @@ static BlockDriver bdrv_gluster_tcp =3D { .format_name =3D "gluster", .protocol_name =3D "gluster+tcp", .instance_size =3D sizeof(BDRVGlusterState), - .bdrv_file_open =3D qemu_gluster_open, + .bdrv_open =3D qemu_gluster_open, .bdrv_reopen_prepare =3D qemu_gluster_reopen_prepare, .bdrv_reopen_commit =3D qemu_gluster_reopen_commit, .bdrv_reopen_abort =3D qemu_gluster_reopen_abort, @@ -1609,7 +1609,7 @@ static BlockDriver bdrv_gluster_unix =3D { .format_name =3D "gluster", .protocol_name =3D "gluster+unix", .instance_size =3D sizeof(BDRVGlusterState), - .bdrv_file_open =3D qemu_gluster_open, + .bdrv_open =3D qemu_gluster_open, .bdrv_reopen_prepare =3D qemu_gluster_reopen_prepare, .bdrv_reopen_commit =3D qemu_gluster_reopen_commit, .bdrv_reopen_abort =3D qemu_gluster_reopen_abort, diff --git a/block/iscsi.c b/block/iscsi.c index 2ff14b74724..979bf90cb79 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -2429,7 +2429,7 @@ static BlockDriver bdrv_iscsi =3D { =20 .instance_size =3D sizeof(IscsiLun), .bdrv_parse_filename =3D iscsi_parse_filename, - .bdrv_file_open =3D iscsi_open, + .bdrv_open =3D iscsi_open, .bdrv_close =3D iscsi_close, .bdrv_co_create_opts =3D bdrv_co_create_opts_simple, .create_opts =3D &bdrv_create_opts_simple, @@ -2468,7 +2468,7 @@ static BlockDriver bdrv_iser =3D { =20 .instance_size =3D sizeof(IscsiLun), .bdrv_parse_filename =3D iscsi_parse_filename, - .bdrv_file_open =3D iscsi_open, + .bdrv_open =3D iscsi_open, .bdrv_close =3D iscsi_close, .bdrv_co_create_opts =3D bdrv_co_create_opts_simple, .create_opts =3D &bdrv_create_opts_simple, diff --git a/block/nbd.c b/block/nbd.c index 589d28af833..d464315766e 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -2146,7 +2146,7 @@ static BlockDriver bdrv_nbd =3D { .bdrv_parse_filename =3D nbd_parse_filename, .bdrv_co_create_opts =3D bdrv_co_create_opts_simple, .create_opts =3D &bdrv_create_opts_simple, - .bdrv_file_open =3D nbd_open, + .bdrv_open =3D nbd_open, .bdrv_reopen_prepare =3D nbd_client_reopen_prepare, .bdrv_co_preadv =3D nbd_client_co_preadv, .bdrv_co_pwritev =3D nbd_client_co_pwritev, @@ -2174,7 +2174,7 @@ static BlockDriver bdrv_nbd_tcp =3D { .bdrv_parse_filename =3D nbd_parse_filename, .bdrv_co_create_opts =3D bdrv_co_create_opts_simple, .create_opts =3D &bdrv_create_opts_simple, - .bdrv_file_open =3D nbd_open, + .bdrv_open =3D nbd_open, .bdrv_reopen_prepare =3D nbd_client_reopen_prepare, .bdrv_co_preadv =3D nbd_client_co_preadv, .bdrv_co_pwritev =3D nbd_client_co_pwritev, @@ -2202,7 +2202,7 @@ static BlockDriver bdrv_nbd_unix =3D { .bdrv_parse_filename =3D nbd_parse_filename, .bdrv_co_create_opts =3D bdrv_co_create_opts_simple, .create_opts =3D &bdrv_create_opts_simple, - .bdrv_file_open =3D nbd_open, + .bdrv_open =3D nbd_open, .bdrv_reopen_prepare =3D nbd_client_reopen_prepare, .bdrv_co_preadv =3D nbd_client_co_preadv, .bdrv_co_pwritev =3D nbd_client_co_pwritev, diff --git a/block/nfs.c b/block/nfs.c index 60240a8733d..0500f60c08f 100644 --- a/block/nfs.c +++ b/block/nfs.c @@ -888,7 +888,7 @@ static BlockDriver bdrv_nfs =3D { #endif .bdrv_co_truncate =3D nfs_file_co_truncate, =20 - .bdrv_file_open =3D nfs_file_open, + .bdrv_open =3D nfs_file_open, .bdrv_close =3D nfs_file_close, .bdrv_co_create =3D nfs_file_co_create, .bdrv_co_create_opts =3D nfs_file_co_create_opts, diff --git a/block/null.c b/block/null.c index 4808704ffd3..6fa64d20d86 100644 --- a/block/null.c +++ b/block/null.c @@ -283,7 +283,7 @@ static BlockDriver bdrv_null_co =3D { .protocol_name =3D "null-co", .instance_size =3D sizeof(BDRVNullState), =20 - .bdrv_file_open =3D null_file_open, + .bdrv_open =3D null_file_open, .bdrv_parse_filename =3D null_co_parse_filename, .bdrv_co_getlength =3D null_co_getlength, .bdrv_co_get_allocated_file_size =3D null_co_get_allocated_file_size, @@ -304,7 +304,7 @@ static BlockDriver bdrv_null_aio =3D { .protocol_name =3D "null-aio", .instance_size =3D sizeof(BDRVNullState), =20 - .bdrv_file_open =3D null_file_open, + .bdrv_open =3D null_file_open, .bdrv_parse_filename =3D null_aio_parse_filename, .bdrv_co_getlength =3D null_co_getlength, .bdrv_co_get_allocated_file_size =3D null_co_get_allocated_file_size, diff --git a/block/nvme.c b/block/nvme.c index 3a3c6da73d2..c84914af6dd 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -1630,7 +1630,7 @@ static BlockDriver bdrv_nvme =3D { .create_opts =3D &bdrv_create_opts_simple, =20 .bdrv_parse_filename =3D nvme_parse_filename, - .bdrv_file_open =3D nvme_file_open, + .bdrv_open =3D nvme_file_open, .bdrv_close =3D nvme_close, .bdrv_co_getlength =3D nvme_co_getlength, .bdrv_probe_blocksizes =3D nvme_probe_blocksizes, diff --git a/block/rbd.c b/block/rbd.c index 84bb2fa5d71..9c0fd0cb3f7 100644 --- a/block/rbd.c +++ b/block/rbd.c @@ -1815,8 +1815,9 @@ static const char *const qemu_rbd_strong_runtime_opts= [] =3D { static BlockDriver bdrv_rbd =3D { .format_name =3D "rbd", .instance_size =3D sizeof(BDRVRBDState), + .bdrv_parse_filename =3D qemu_rbd_parse_filename, - .bdrv_file_open =3D qemu_rbd_open, + .bdrv_open =3D qemu_rbd_open, .bdrv_close =3D qemu_rbd_close, .bdrv_reopen_prepare =3D qemu_rbd_reopen_prepare, .bdrv_co_create =3D qemu_rbd_co_create, diff --git a/block/ssh.c b/block/ssh.c index a88171d4b53..1344822ed85 100644 --- a/block/ssh.c +++ b/block/ssh.c @@ -1362,7 +1362,7 @@ static BlockDriver bdrv_ssh =3D { .protocol_name =3D "ssh", .instance_size =3D sizeof(BDRVSSHState), .bdrv_parse_filename =3D ssh_parse_filename, - .bdrv_file_open =3D ssh_file_open, + .bdrv_open =3D ssh_file_open, .bdrv_co_create =3D ssh_co_create, .bdrv_co_create_opts =3D ssh_co_create_opts, .bdrv_close =3D ssh_close, diff --git a/block/vvfat.c b/block/vvfat.c index 9d050ba3aea..086fedf4745 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -3258,7 +3258,7 @@ static BlockDriver bdrv_vvfat =3D { .instance_size =3D sizeof(BDRVVVFATState), =20 .bdrv_parse_filename =3D vvfat_parse_filename, - .bdrv_file_open =3D vvfat_open, + .bdrv_open =3D vvfat_open, .bdrv_refresh_limits =3D vvfat_refresh_limits, .bdrv_close =3D vvfat_close, .bdrv_child_perm =3D vvfat_child_perm, --=20 2.45.2 From nobody Mon Nov 25 00:16:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719037187; cv=none; d=zohomail.com; s=zohoarc; b=JFE7yT3Lrka9e1NCDVeYJm6KqVW/XbvyCwZNP9EVMSN3usxzqMy/sNVFbkHD04lwQ45U1gBo4H6Dwh1r1kLZvBhNxSTwtvjXX8L+Ipinel8+kGg1EqHAoCIyS8HsYEPDqjJ2BHfpv/qJSzyL1FcoKwolllxxY1SULy+Yf0+/HdQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719037187; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=d1Zs3bNs8jOuOgSShaHDoScFAM7FpjL8r/fpmfWVVwk=; b=B/EVarAARxI7Hss4p+C0dLjLnRhLG2OW9FYJ9ACxr5u0F1v+aM0w69yGCUmw6yrBRo0sxQWhpCBfGPzNSKy0PKxpEWxn//NNqBPOczO+lPyP0F++IVQJsLemBmb4qx6CtCDDaYTRzY7xWt91g7UpHBBACeFL/pSI8rBk1U/1eIE= 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 1719037187743173.39135248812227; Fri, 21 Jun 2024 23:19:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKu3v-0001HB-NL; Sat, 22 Jun 2024 02:17:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu3T-0000VX-9n for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu3R-0006Uz-Bc for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:54 -0400 Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-308-zprxo6FyN0e6owYWXdnVaQ-1; Sat, 22 Jun 2024 02:16:50 -0400 Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-52c94ad861aso1953700e87.2 for ; Fri, 21 Jun 2024 23:16:50 -0700 (PDT) Received: from avogadro.local ([151.62.196.71]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6fe25f07efsm48016266b.12.2024.06.21.23.16.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 23:16:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719037012; 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=d1Zs3bNs8jOuOgSShaHDoScFAM7FpjL8r/fpmfWVVwk=; b=cVKXLrcOCsB1OwyhcHNZKq+2/Z6/O4qm8S+JPGUYwbUXHqWlhUE1j/8psu/X1JrZiIT7Cp wH9zjSN1Z31SWGG3Gvu4O+V7L8iAqqQjtcw4zu5bdM8U4L4XJKRgRLi0vB0AHgadp7bwOt OcTUCgd+JJ/qAGkOpP0l3eNGLm4eebw= X-MC-Unique: zprxo6FyN0e6owYWXdnVaQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719037008; x=1719641808; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=d1Zs3bNs8jOuOgSShaHDoScFAM7FpjL8r/fpmfWVVwk=; b=D2BdfZuqiIWCetB9j4ag9RGRth6Rad3DG5VzbNLyUoD1ak/XmQWQga5D8VzV2FLe9Z 8Yw8lLxVIP2SD9CYsgyBrzzL0DKxZDnh4ejARytvyV/qQYyHczZAoT+AU+ImWgnejmTO PNG+EDI0XBm4cJxJFxsomWXHdJMwVKX4yHuqhhQZQkx380eHqILHWtiWAq3DeGShMrR0 O97fTlblfiKav1WZT0DU/uVJNtWnV+vjTifmvPJLujBdMmLwlNTzRSUjBV1j+CusEJr9 czUGWKqm+3Limo6NaY9JsjUoCyVSaPeWIKvsYDxDABFg5fRLSyddANR/K05c29JeAYGZ F1lQ== X-Gm-Message-State: AOJu0Yw+Jru33D6B0HaQZMOPb9j2tNoj/9MEBnGTm85MSHiZuJAOSgs+ 8VNB1zFt8wtyc0bNC/Xaa721ORJtbexBKtf/9dVHD9pEYpPhfSVdXLq4iOJYUtryN2BgoT6B5lv 31NCVd/s/lflGw7b6fa1OuchEnT45AMZzxUD/VBoHCiVGHCwIm435pgvSZyccgMXZ+vVeHKPfyw E8UEo6Baeci6g7aYWe2ZZ2e7g1D8o3/wuDOJXF X-Received: by 2002:ac2:4a6a:0:b0:52b:8c88:2d6b with SMTP id 2adb3069b0e04-52ccaa55843mr6297311e87.11.1719037008328; Fri, 21 Jun 2024 23:16:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGNvUD8xUj7lBX4DyLFSl8joudMjA6d0t0XOOD/3nB2LuwlG07G+AYWC3U2KjizZ46Sgg1kPQ== X-Received: by 2002:ac2:4a6a:0:b0:52b:8c88:2d6b with SMTP id 2adb3069b0e04-52ccaa55843mr6297301e87.11.1719037007968; Fri, 21 Jun 2024 23:16:47 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Kevin Wolf Subject: [PULL 21/23] block: rename former bdrv_file_open callbacks Date: Sat, 22 Jun 2024 08:15:55 +0200 Message-ID: <20240622061558.530543-22-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240622061558.530543-1-pbonzini@redhat.com> References: <20240622061558.530543-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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719037189831100003 Content-Type: text/plain; charset="utf-8" Since there is no bdrv_file_open callback anymore, rename the implementatio= ns so that they end with "_open" instead of "_file_open". NFS is the exception because all the functions are named nfs_file_*. Suggested-by: Kevin Wolf Signed-off-by: Paolo Bonzini --- block/blkio.c | 8 ++++---- block/null.c | 8 ++++---- block/nvme.c | 8 ++++---- block/ssh.c | 6 +++--- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/block/blkio.c b/block/blkio.c index 1a38064ce76..3d9a2e764c3 100644 --- a/block/blkio.c +++ b/block/blkio.c @@ -713,7 +713,7 @@ static int blkio_virtio_blk_connect(BlockDriverState *b= s, QDict *options, * for example will fail. * * In order to open the device read-only, we are using the `read-o= nly` - * property of the libblkio driver in blkio_file_open(). + * property of the libblkio driver in blkio_open(). */ fd =3D qemu_open(path, O_RDWR, NULL); if (fd < 0) { @@ -791,8 +791,8 @@ static int blkio_virtio_blk_connect(BlockDriverState *b= s, QDict *options, return 0; } =20 -static int blkio_file_open(BlockDriverState *bs, QDict *options, int flags, - Error **errp) +static int blkio_open(BlockDriverState *bs, QDict *options, int flags, + Error **errp) { const char *blkio_driver =3D bs->drv->protocol_name; BDRVBlkioState *s =3D bs->opaque; @@ -1088,7 +1088,7 @@ static void blkio_refresh_limits(BlockDriverState *bs= , Error **errp) */ #define BLKIO_DRIVER_COMMON \ .instance_size =3D sizeof(BDRVBlkioState), \ - .bdrv_open =3D blkio_file_open, \ + .bdrv_open =3D blkio_open, \ .bdrv_close =3D blkio_close, \ .bdrv_co_getlength =3D blkio_co_getlength, \ .bdrv_co_truncate =3D blkio_truncate, \ diff --git a/block/null.c b/block/null.c index 6fa64d20d86..4730acc1eb2 100644 --- a/block/null.c +++ b/block/null.c @@ -77,8 +77,8 @@ static void null_aio_parse_filename(const char *filename,= QDict *options, } } =20 -static int null_file_open(BlockDriverState *bs, QDict *options, int flags, - Error **errp) +static int null_open(BlockDriverState *bs, QDict *options, int flags, + Error **errp) { QemuOpts *opts; BDRVNullState *s =3D bs->opaque; @@ -283,7 +283,7 @@ static BlockDriver bdrv_null_co =3D { .protocol_name =3D "null-co", .instance_size =3D sizeof(BDRVNullState), =20 - .bdrv_open =3D null_file_open, + .bdrv_open =3D null_open, .bdrv_parse_filename =3D null_co_parse_filename, .bdrv_co_getlength =3D null_co_getlength, .bdrv_co_get_allocated_file_size =3D null_co_get_allocated_file_size, @@ -304,7 +304,7 @@ static BlockDriver bdrv_null_aio =3D { .protocol_name =3D "null-aio", .instance_size =3D sizeof(BDRVNullState), =20 - .bdrv_open =3D null_file_open, + .bdrv_open =3D null_open, .bdrv_parse_filename =3D null_aio_parse_filename, .bdrv_co_getlength =3D null_co_getlength, .bdrv_co_get_allocated_file_size =3D null_co_get_allocated_file_size, diff --git a/block/nvme.c b/block/nvme.c index c84914af6dd..3b588b139f6 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -889,7 +889,7 @@ out: qemu_vfio_pci_unmap_bar(s->vfio, 0, (void *)regs, 0, sizeof(NvmeBa= r)); } =20 - /* Cleaning up is done in nvme_file_open() upon error. */ + /* Cleaning up is done in nvme_open() upon error. */ return ret; } =20 @@ -967,8 +967,8 @@ static void nvme_close(BlockDriverState *bs) g_free(s->device); } =20 -static int nvme_file_open(BlockDriverState *bs, QDict *options, int flags, - Error **errp) +static int nvme_open(BlockDriverState *bs, QDict *options, int flags, + Error **errp) { const char *device; QemuOpts *opts; @@ -1630,7 +1630,7 @@ static BlockDriver bdrv_nvme =3D { .create_opts =3D &bdrv_create_opts_simple, =20 .bdrv_parse_filename =3D nvme_parse_filename, - .bdrv_open =3D nvme_file_open, + .bdrv_open =3D nvme_open, .bdrv_close =3D nvme_close, .bdrv_co_getlength =3D nvme_co_getlength, .bdrv_probe_blocksizes =3D nvme_probe_blocksizes, diff --git a/block/ssh.c b/block/ssh.c index 1344822ed85..27d582e0e3d 100644 --- a/block/ssh.c +++ b/block/ssh.c @@ -837,8 +837,8 @@ static int connect_to_ssh(BDRVSSHState *s, BlockdevOpti= onsSsh *opts, return ret; } =20 -static int ssh_file_open(BlockDriverState *bs, QDict *options, int bdrv_fl= ags, - Error **errp) +static int ssh_open(BlockDriverState *bs, QDict *options, int bdrv_flags, + Error **errp) { BDRVSSHState *s =3D bs->opaque; BlockdevOptionsSsh *opts; @@ -1362,7 +1362,7 @@ static BlockDriver bdrv_ssh =3D { .protocol_name =3D "ssh", .instance_size =3D sizeof(BDRVSSHState), .bdrv_parse_filename =3D ssh_parse_filename, - .bdrv_open =3D ssh_file_open, + .bdrv_open =3D ssh_open, .bdrv_co_create =3D ssh_co_create, .bdrv_co_create_opts =3D ssh_co_create_opts, .bdrv_close =3D ssh_close, --=20 2.45.2 From nobody Mon Nov 25 00:16:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719037216; cv=none; d=zohomail.com; s=zohoarc; b=FEiiQL/ftcZqPGs7ZwmYnPzda6+Ntgw5W87l4FOWwwJAcFrxqMAnDTGkyerUoUgo7ddqkP5CG5xP0qNfluBhDuzpVuGEyyDnmcBSPjeW+4q47CljMWC0D5AYB59SqamJ3H090IJg+6Xr+mBY7xjR12E9h+8zuv0q4gyz5VIZvd8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719037216; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=6kgcszkIT3GM5bTEqMS2S12kBtO09xKPPZC9hsjUhfM=; b=W2A0me4VNhkYly45JAS31vS7KuX9NyOBTbpEnRet6LhSIRjn9ZnqHFVeOWF9ACNCv8xan24E90bnSy05k3p5WbyCe3gD3EVgIgamzuMKD7bsIZLSHgGKW9qByDgxkfYirIZhy1ecAobQOkAAOSAulssckTnWpuo3RI0QsQ+r5/w= 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 1719037216058348.551276949432; Fri, 21 Jun 2024 23:20:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKu43-0001hG-D7; Sat, 22 Jun 2024 02:17:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu3W-0000YE-2u for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu3U-0006VM-Iy for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:57 -0400 Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-167-4XOuxGkAMA-h0Edus5TUYQ-1; Sat, 22 Jun 2024 02:16:54 -0400 Received: by mail-lj1-f197.google.com with SMTP id 38308e7fff4ca-2ec01fa1a72so21765631fa.2 for ; Fri, 21 Jun 2024 23:16:54 -0700 (PDT) Received: from avogadro.local ([151.62.196.71]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57d30bd5f1asm1853019a12.37.2024.06.21.23.16.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 23:16:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719037015; 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=6kgcszkIT3GM5bTEqMS2S12kBtO09xKPPZC9hsjUhfM=; b=MaKxDaUPR3pz+J2B7MAA2/5k75RaahVBVNKV+Q0zLuVCKuKx2M8XgWyPCXAjj9ZkCLxIE0 44bGN7Xe7vaE1u47npseMeIYZH4tpVt1wpiHJG/elJJXNZCDvLWBiA4Rm8slSvcPkVpriJ eZ7sbDR434xDFW0XtWkUpflCE8yCEtA= X-MC-Unique: 4XOuxGkAMA-h0Edus5TUYQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719037012; x=1719641812; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6kgcszkIT3GM5bTEqMS2S12kBtO09xKPPZC9hsjUhfM=; b=J/ha6YMaLREQhkxs4+qfioMaChfwJywlfQScq98NZmSKXp82OI1Louj7qWMMRCVjFx gsG89x8RvVvtRkDIKd44u6AoYgvtw0TrWhrSxBZ7K5NYJlHc7XMSqP+odYMyxci1L3dc 8MBVmiB0+pwPthEDv8cPX/idESmsYn+YfmS931guNJdTyHetW2Qj5c8R6CtrMe7Y2iEZ RWBNgIYS70srFhFJCBt+Ak/4s12skciLJMpMEDl2XbGBUsIDQJ1zuQTWilJyXP4CpG/O DmVtgxwpZ2pBg6s5CBTGkvi5e01mv7Kk+nGGIdEm01aFKy7XItpCrkXgMM3lo4DPBX5z aLpg== X-Gm-Message-State: AOJu0YwarNBaysgpEqjlhGKMkIbbZCP0HJOS6K0qLB3MCv5oBE1+CWyx PoTIHxB+O0z/mJjcEJXOR2Tkf35aWPaNv2s8U2FLMOch09H7BZ+1QeF/dp74xsq3lOA0TPupt3i a8Kbx8mBJxEJGL7k0e3HUtVqnu4GA9R2PnToiL6ZiGQm2g0Pv8ZNGvEg6XK1c3evcciawOohluz 1IFuyPz7PcDyNs4MTcyAvHgDAGl0mAgqyUEAI6 X-Received: by 2002:a2e:9cc6:0:b0:2eb:120c:1a59 with SMTP id 38308e7fff4ca-2ec3cebac4cmr65032191fa.16.1719037011936; Fri, 21 Jun 2024 23:16:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGRHpGateCfynEPcimtoRhBKddgFfkGNYbKz7L76MZw+ekvh9BvIUWmyq5IOpdIrTVuUKetHw== X-Received: by 2002:a2e:9cc6:0:b0:2eb:120c:1a59 with SMTP id 38308e7fff4ca-2ec3cebac4cmr65032131fa.16.1719037011563; Fri, 21 Jun 2024 23:16:51 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Roman Kiryanov Subject: [PULL 22/23] exec: avoid using C++ keywords in function parameters Date: Sat, 22 Jun 2024 08:15:56 +0200 Message-ID: <20240622061558.530543-23-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240622061558.530543-1-pbonzini@redhat.com> References: <20240622061558.530543-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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719037217896100003 Content-Type: text/plain; charset="utf-8" From: Roman Kiryanov to use the QEMU headers with a C++ compiler. Signed-off-by: Roman Kiryanov Link: https://lore.kernel.org/r/20240618224553.878869-1-rkir@google.com Signed-off-by: Paolo Bonzini --- include/exec/memory.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 1be58f694c9..d7591a60d9f 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -945,7 +945,7 @@ struct MemoryListener { * the current transaction. */ void (*log_start)(MemoryListener *listener, MemoryRegionSection *secti= on, - int old, int new); + int old_val, int new_val); =20 /** * @log_stop: @@ -964,7 +964,7 @@ struct MemoryListener { * the current transaction. */ void (*log_stop)(MemoryListener *listener, MemoryRegionSection *sectio= n, - int old, int new); + int old_val, int new_val); =20 /** * @log_sync: --=20 2.45.2 From nobody Mon Nov 25 00:16:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719037204; cv=none; d=zohomail.com; s=zohoarc; b=WnAtLZ32RMzeCI8g6SKZv7czE9Z8l+oybh5wQ4iQInSv9m2YTJVKZgI6G+lFDzjU9GZahycaZYG4pwpwdS23290x/TRa9B7ndXrds3xEFOQLgjZN4SZ9TMMjnaSYcxXT1eJKLotvJOlefk0bJSlxAhgZZ2leGlzPm+Rr1Qbt+dU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719037204; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=p4JQad1sT8RnQ9lJzX0OnKgNZZx89u7Pl8uqPcJlXgY=; b=UuLSAOp2KdR6eGxS223boEq/F5Cx/HuQGKHMIWln0aLLrHybEb7NyF1bU79dfDdzAY+IBlTJNoFu483io1SspEvP+JoE03lT2VdabnHpJahtbosha9Kzr37itfX+ywk0zW75cTk/CbGCjevtEf+LfeWxF8TTLZ1Qk6BhAANB6eE= 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 1719037204458737.2979987281966; Fri, 21 Jun 2024 23:20:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKu44-0001r0-Fv; Sat, 22 Jun 2024 02:17:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu3Y-0000aa-Ns for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:17:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKu3X-0006Vk-4R for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:17:00 -0400 Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-195-AUg9BaO7NbSlt3qUAt1B9w-1; Sat, 22 Jun 2024 02:16:56 -0400 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a6fdc107e06so19451366b.1 for ; Fri, 21 Jun 2024 23:16:56 -0700 (PDT) Received: from avogadro.local ([151.62.196.71]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6fcf5605aesm157436766b.151.2024.06.21.23.16.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 23:16:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719037018; 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=p4JQad1sT8RnQ9lJzX0OnKgNZZx89u7Pl8uqPcJlXgY=; b=MiehcqPztqhpE8QDiHvUijyE5pIpjG1dl6C2qZcZlgIaASpWF2tFJuaFz+pZ0PfRxB/ERV aqCShGKIllxvEfHRjt2lUyXqmJXhz7sHv5AJmfZYOMkVBn82Cn3mhMti88WXxiXe7fb6Aa Ti4wy9nMx5Zps4k0MiDb2j8ZQuZe9po= X-MC-Unique: AUg9BaO7NbSlt3qUAt1B9w-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719037014; x=1719641814; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=p4JQad1sT8RnQ9lJzX0OnKgNZZx89u7Pl8uqPcJlXgY=; b=g0XiyXAPURn5OvV2jy/2p7S7RyTuZUrvMQzOzU0VaWZ3T99OPGxKm9vNNRTikpLgl+ s8XK7GqOm80mJZfH0vrdGqISorvRzLmwPLtP6S00ObXHyBt2D9F2l1mmAYMzrnbhbuEc 1Hd1RrTGmB5VssMhJwF8i1B1rXoYGDKvlNOwod9S1kXLa1wxalKuD9C4dSd6uWOzjf5j WCuI/3S03MBPFISzwfFzolwKA7QLqY3PsKtunYFFyuRIm+Lg1e/tlio0U8Qltunma/nv qejfsJaoD/gcfX3nlpyiFqw7bdIKBuUA0+JYCV6HgMrLFdw0k0KqUiJaUWuBrkQcXA5V lL3A== X-Gm-Message-State: AOJu0YxqNZjngoNbmD1N5yxbPrv0u0NNExA2kfDGsFKGmRBSRh9ynlET hSj9npCu3I4EqEv9TPPss42t9RyVT39zr5nIfOrZFpI291DYEHImKIyAvVVRP5j7Nvr3XDHeipp N2dZXn9kIGKFcZN0mfHjNcniDaBBJM9kAkeVNuxlKhxTEXt8Oz+kLX0+5mim0bt3UFRuGHyw2gi 77wwOwIP7Z8ath5TAjNINKiGsIpXX3gEn1mtI8 X-Received: by 2002:a17:907:c70f:b0:a6f:b1a8:e43 with SMTP id a640c23a62f3a-a6fb1a81d77mr576371566b.16.1719037014461; Fri, 21 Jun 2024 23:16:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGVJrzVnYk/VuAE42mJQuGEC24i5Lc1+31xtKO89YlsLuHr6R/p8FOvP7IlLL4wTPxgMCMpTg== X-Received: by 2002:a17:907:c70f:b0:a6f:b1a8:e43 with SMTP id a640c23a62f3a-a6fb1a81d77mr576370366b.16.1719037014149; Fri, 21 Jun 2024 23:16:54 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Roman Kiryanov Subject: [PULL 23/23] exec: don't use void* in pointer arithmetic in headers Date: Sat, 22 Jun 2024 08:15:57 +0200 Message-ID: <20240622061558.530543-24-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240622061558.530543-1-pbonzini@redhat.com> References: <20240622061558.530543-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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719037205871100002 Content-Type: text/plain; charset="utf-8" From: Roman Kiryanov void* pointer arithmetic is a GCC extentension which could not be available in other build tools (e.g. C++). This changes removes this assumption. Signed-off-by: Roman Kiryanov Suggested-by: Paolo Bonzini Link: https://lore.kernel.org/r/20240620201654.598024-1-rkir@google.com Signed-off-by: Paolo Bonzini --- include/exec/memory.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index d7591a60d9f..08ecd7e195d 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -2796,7 +2796,7 @@ MemTxResult address_space_write_rom(AddressSpace *as,= hwaddr addr, #include "exec/memory_ldst_phys.h.inc" =20 struct MemoryRegionCache { - void *ptr; + uint8_t *ptr; hwaddr xlat; hwaddr len; FlatView *fv; --=20 2.45.2