From patchwork Sat May 25 11:33:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 13673963 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BD085C25B7A for ; Sat, 25 May 2024 11:36:23 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sApev-0002KG-Kz; Sat, 25 May 2024 07:33:58 -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 1sApet-0002JQ-Hk for qemu-devel@nongnu.org; Sat, 25 May 2024 07:33: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 1sApej-0003xh-3u for qemu-devel@nongnu.org; Sat, 25 May 2024 07:33:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716636824; 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=FM19mLkY5Da4/5rzgrlyeYl8tkvhtaXzdU7oyrzvNEY=; b=Ut+3usvuthbcpKpz0SDdWGIBR9SajZ9rBc6X+ocwx+MuG5kBXJpFYeeQJYLt3rFZrGS0cR TUY+nu2w785j+7eeMdIvzp9bhQpvPNLSBa9meDzVdJWnOy51od4HOgao9CYEWCEkLRKjPO 7KSLLwwhD6Df44Es+pwkv8jjOWFPClc= Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-638-aAv6PdqIPfmPj1zekouzEg-1; Sat, 25 May 2024 07:33:42 -0400 X-MC-Unique: aAv6PdqIPfmPj1zekouzEg-1 Received: by mail-lf1-f69.google.com with SMTP id 2adb3069b0e04-5295f0125dbso1143668e87.1 for ; Sat, 25 May 2024 04:33:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716636820; x=1717241620; 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=FM19mLkY5Da4/5rzgrlyeYl8tkvhtaXzdU7oyrzvNEY=; b=Mbh7TF2xZIx9SNdoeVlM5oGn7XrmSeDBVvBBQcTtTIBqilz1mqW9IyedyFx34PR6Tj sVT6J39tJmRFWVErmEiXlN3NaNVxE7YJjDDyo+80AW0GnDcoGTP3cgf2ur67qpOFUR81 80e/7L5jsdWwAsS26vKHfBA7zmvnEsimQVnRuNicrzFwwrce7Yx3yy8LGGZ8k5kMLaqx Q+joHYnaCWHw97TwX6dY8+6AOFabhMbXh6bOomeRPUxCpn5i7QMoWbJwGdsGu9Hc2d/o szGimWKIpfQrx5D01lXQrB0mTYYJdvQVZ+rsF76c6eJzMa80y09MpVsJeFxBWVYoQ1Ps AMwA== X-Gm-Message-State: AOJu0YyFBtZs376fIocrQ3H/QWnrBE0If4prdJp9YKrx+opaheLUJYmq lFFBH9n3jJsOZhjACJZb9+pdj/geQGgNjqa9CwlFxvF7HjebpvxPQZB8WHaxZVVP+C0YBM5oXGq SetrfTM6B/MuYiFFkOMcwXZTajhkk0gcdk+B2Tl8x0nkE4CrgphDB+WeJvvSznjBN+P9+dCXWcF nhZGMD2fR94dJ0ERS9tpi688vL18gdzR/wRVwA X-Received: by 2002:ac2:4244:0:b0:518:b4a3:dee1 with SMTP id 2adb3069b0e04-52966ca87demr2481507e87.66.1716636820242; Sat, 25 May 2024 04:33:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFlTlIh42wrajgeOh7+zLUcGJI0oVL98sQBl1zvDxO3oQwK1yaqpb9w6+xIXneF3hIJIhT1ug== X-Received: by 2002:ac2:4244:0:b0:518:b4a3:dee1 with SMTP id 2adb3069b0e04-52966ca87demr2481491e87.66.1716636819591; Sat, 25 May 2024 04:33:39 -0700 (PDT) Received: from [192.168.10.117] ([151.95.155.52]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-578523c885bsm3059031a12.34.2024.05.25.04.33.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 04:33:39 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Artyom Kunakovsky Subject: [PULL 01/24] configure: move -mcx16 flag out of CPU_CFLAGS Date: Sat, 25 May 2024 13:33:09 +0200 Message-ID: <20240525113332.1404158-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240525113332.1404158-1-pbonzini@redhat.com> References: <20240525113332.1404158-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Artyom Kunakovsky The point of CPU_CFLAGS is really just to select the appropriate multilib, for example for library linking tests, and -mcx16 is not needed for that purpose. Furthermore, if -mcx16 is part of QEMU's choice of a basic x86_64 instruction set, it should be applied to cross-compiled x86_64 code too; it is plausible that tests/tcg would want to cover cmpxchg16b as well, for example. In the end this makes just as much sense as a per sub-build tweak, so move the flag to meson.build and cross_cc_cflags_x86_64. This leaves out contrib/plugins, which would fail when attempting to use __sync_val_compare_and_swap_16 (note it does not do yet); while minor, this *is* a disadvantage of this change. But building contrib/plugins with a Makefile instead of meson.build is something self-inflicted just for the sake of showing that it can be done, and if this kind of papercut started becoming a problem we could make the directory part of the meson build. Until then, we can live with the limitation. Signed-off-by: Artyom Kunakovsky Message-ID: <20240523051118.29367-1-artyomkunakovsky@gmail.com> [rewrite commit message, remove from configure. - Paolo] Signed-off-by: Paolo Bonzini --- configure | 7 ++----- meson.build | 7 +++++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/configure b/configure index 38ee2577013..4d01a42ba65 100755 --- a/configure +++ b/configure @@ -512,10 +512,7 @@ case "$cpu" in cpu="x86_64" host_arch=x86_64 linux_arch=x86 - # ??? Only extremely old AMD cpus do not have cmpxchg16b. - # If we truly care, we should simply detect this case at - # runtime and generate the fallback to serial emulation. - CPU_CFLAGS="-m64 -mcx16" + CPU_CFLAGS="-m64" ;; esac @@ -1203,7 +1200,7 @@ fi : ${cross_cc_cflags_sparc64="-m64 -mcpu=ultrasparc"} : ${cross_cc_sparc="$cross_cc_sparc64"} : ${cross_cc_cflags_sparc="-m32 -mcpu=supersparc"} -: ${cross_cc_cflags_x86_64="-m64"} +: ${cross_cc_cflags_x86_64="-m64 -mcx16"} compute_target_variable() { eval "$2=" diff --git a/meson.build b/meson.build index a9de71d4506..7fd82b5f48c 100644 --- a/meson.build +++ b/meson.build @@ -336,6 +336,13 @@ if host_arch == 'i386' and not cc.links(''' qemu_common_flags = ['-march=i486'] + qemu_common_flags endif +# ??? Only extremely old AMD cpus do not have cmpxchg16b. +# If we truly care, we should simply detect this case at +# runtime and generate the fallback to serial emulation. +if host_arch == 'x86_64' + qemu_common_flags = ['-mcx16'] + qemu_common_flags +endif + if get_option('prefer_static') qemu_ldflags += get_option('b_pie') ? '-static-pie' : '-static' endif From patchwork Sat May 25 11:33:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 13673955 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5CABDC25B7C for ; Sat, 25 May 2024 11:35:32 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sApeo-0002G8-M8; Sat, 25 May 2024 07:33:50 -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 1sApen-0002Fk-8o for qemu-devel@nongnu.org; Sat, 25 May 2024 07:33:49 -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 1sApel-0003yG-RE for qemu-devel@nongnu.org; Sat, 25 May 2024 07:33:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716636826; 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=IY+J9gIwc6O/z2KshmSDRzcH/AtrVZMym5rFBX/8Gdk=; b=HqgIywUOMSYyCYOmyTVdGsqWkvW033K98QfQCxTt94VDbAVNlZOiMGLj8awAeAvinLSF64 9rZT0gKQIcpIc3Nwrhf961VEqYTOmOIHUR6qNFE9ToFA4B7jjOphNN6JpgvLJ2wdmKemIH /QVEO6pfeoKF0N50nexNarKe0NaSMqw= 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-223-FXqwh0b6PeqKtx4W-gz5-w-1; Sat, 25 May 2024 07:33:45 -0400 X-MC-Unique: FXqwh0b6PeqKtx4W-gz5-w-1 Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-523ea081507so2637545e87.3 for ; Sat, 25 May 2024 04:33:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716636823; x=1717241623; 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=IY+J9gIwc6O/z2KshmSDRzcH/AtrVZMym5rFBX/8Gdk=; b=XYz1tWwAy7cwdhb5u8iZPKLtWC5FAnvIzzDfkpQ/kFN7fGGaMI9FJ4DmL5t3tMtpNC 4tJvw4sJ6/ZgCIqetKReamSIogc608Ac4sHSUtdQPNHybI5nl0GPF7M/xLmak8KaMWvg kP6YQEEN/npExEJfVmVQyQUH8XOVcT3WuawpLgrh5qOxjVIpng4bnLwJfor25ZLi+G8J LLJjZjmpeeTHvnL9mTG3TM2jwo8WiuxUjS7Du+TGL2IN0Gic1/Nb/LUYUGOJyTHt418H RmA7BuliZ1mMDVFje4dN3tLaYBGOiNfljfNQ439LI05IIzKA17K43ipzAyNsT4wiULSA phYg== X-Gm-Message-State: AOJu0YxTeIO02ZcOaJ5h9Gggzt5BTMyMaeZ1DdVFxO4eWuy2/XIN4TrY Hjw9jaVBleWQ/qW0dtDS3ob2jdvbc/pnq0HIsYqE9FPT4ZyUPgeiTw5fOawoTceaG//wM5S3YlW /BLNWDD0y1YtWtLq1h5wCxvq8APx/cK85DfDjJOx1elxU8lnOQU7Zjs+aakDRpcy+KyCI2ch2qG EWYzW2akgJCqRagWff6qcHOo+juX/QMBfVRHt/ X-Received: by 2002:a05:6512:3ca0:b0:523:8c7a:5f7 with SMTP id 2adb3069b0e04-5296410a4abmr3589051e87.6.1716636823354; Sat, 25 May 2024 04:33:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEqtmDqtm6x0jRGl3uhcOf3fukbF4E/QB/WniYKdzzEhM1Rb5MiXi0UJV9MRfbg+JAEZ8I5cA== X-Received: by 2002:a05:6512:3ca0:b0:523:8c7a:5f7 with SMTP id 2adb3069b0e04-5296410a4abmr3589039e87.6.1716636822845; Sat, 25 May 2024 04:33:42 -0700 (PDT) Received: from [192.168.10.117] ([151.95.155.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a626cc519f5sm246018466b.98.2024.05.25.04.33.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 04:33:42 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson , qemu-stable@nongnu.org Subject: [PULL 02/24] target/i386: disable jmp_opt if EFLAGS.RF is 1 Date: Sat, 25 May 2024 13:33:10 +0200 Message-ID: <20240525113332.1404158-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240525113332.1404158-1-pbonzini@redhat.com> References: <20240525113332.1404158-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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=unavailable 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org If EFLAGS.RF is 1, special processing in gen_eob_worker() is needed and therefore goto_tb cannot be used. Suggested-by: Richard Henderson Reviewed-by: Richard Henderson Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 76be7425800..ebcff8766cf 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -4660,7 +4660,7 @@ static void i386_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cpu) dc->cpuid_7_1_eax_features = env->features[FEAT_7_1_EAX]; dc->cpuid_xsave_features = env->features[FEAT_XSAVE]; dc->jmp_opt = !((cflags & CF_NO_GOTO_TB) || - (flags & (HF_TF_MASK | HF_INHIBIT_IRQ_MASK))); + (flags & (HF_RF_MASK | HF_TF_MASK | HF_INHIBIT_IRQ_MASK))); /* * If jmp_opt, we want to handle each string instruction individually. * For icount also disable repz optimization so that each iteration From patchwork Sat May 25 11:33:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 13673964 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 10022C25B7A for ; Sat, 25 May 2024 11:36:40 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sApez-0002L7-Q3; Sat, 25 May 2024 07:34:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sApey-0002Kw-RQ for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34:00 -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 1sApep-0003zY-4N for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716636830; 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=yYmuT/t9cN1cwGnGDJ6cJrCwsqnHZePl9S+Nn7OVFJw=; b=JXFpftHyfGEo8jjqOh63eCB2UGxW4zqfEA7TZFHl242r/xVln8rKr5bF98ticCynRb+r+N KIFVVdmcFYqB96oH4f6FXyJd+Ra79svdf0dBPgnJqblMASJleN7tgF6PHbttgSAILUS2Pg 5Ud4gH6HQfhN7WvG6Xc+eBoAZdrHT38= 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-658-pGI4U2_AMSKKBHj6273kzg-1; Sat, 25 May 2024 07:33:48 -0400 X-MC-Unique: pGI4U2_AMSKKBHj6273kzg-1 Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-57860e2b596so301917a12.3 for ; Sat, 25 May 2024 04:33:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716636826; x=1717241626; 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=yYmuT/t9cN1cwGnGDJ6cJrCwsqnHZePl9S+Nn7OVFJw=; b=QloZAZk53aUaKs7nSI7kOzCs4bfV3nU1bdiGmmk6dcn9HuHwVngGOzHPX8PXNiiw3d y5uL498VDnzYCx/mZsmi9BOsUWLvLpyX8L/c6WHZeZ29/6w5wQ+eMEYbSzsRKRN3AI+3 u3oD5CGC/TZdKFaILlHxUVeZJbFihUq2KaSMhX31vwDsQjuDo2KjYmpxvZSiUVl70vhg LDtn69jAGVDjw/tN7IlpFAPweEVcpLlVdpxB8Q8E0elpdQr6H6wvp/fyAFx8aWz2d7GH tcI+0Q4JE9QqDrnyj8BZNx5vl9QPOwtl8Y/9C2VZvqKNx0OYD7bWtyTrbGDwzO1oHFWX jEEg== X-Gm-Message-State: AOJu0YytdtkCugik09IvV739yssKUNIclUDtSnfD/B6q4+rnAv6A4+cg bd5FbEascmodJiH9bzzkVvUUdsDCDa6ylkNwRhR6o8GDn0/qjouTrpNNYFpQ72rLb/oWx1c2OP5 omhxH9hOCzIa7TM2+7qVE63UvdSHlT+zoUQ60tA11oyHdzJRcbpJOf7825U18GOWcIr2sDs8RbG whipPSOgjFZEuARaaNdEgJeDkXfenDve0YqQ4f X-Received: by 2002:a50:c35d:0:b0:578:57b9:8e13 with SMTP id 4fb4d7f45d1cf-57861d60208mr2893489a12.10.1716636826285; Sat, 25 May 2024 04:33:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGNZ9IZkByHD4OZPSTyYCD8KOw3oDOQ3SWyx+lvQ1l0FtqhCDL1eskCm+y994fOMjTWtLUPxw== X-Received: by 2002:a50:c35d:0:b0:578:57b9:8e13 with SMTP id 4fb4d7f45d1cf-57861d60208mr2893479a12.10.1716636825873; Sat, 25 May 2024 04:33:45 -0700 (PDT) Received: from [192.168.10.117] ([151.95.155.52]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57852339fc4sm3014419a12.15.2024.05.25.04.33.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 04:33:45 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org Subject: [PULL 03/24] target/i386: no single-step exception after MOV or POP SS Date: Sat, 25 May 2024 13:33:11 +0200 Message-ID: <20240525113332.1404158-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240525113332.1404158-1-pbonzini@redhat.com> References: <20240525113332.1404158-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Intel SDM 18.3.1.4 "If an occurrence of the MOV or POP instruction loads the SS register executes with EFLAGS.TF = 1, no single-step debug exception occurs following the MOV or POP instruction." Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index ebcff8766cf..9782250b20b 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -2273,7 +2273,7 @@ gen_eob_worker(DisasContext *s, bool inhibit, bool recheck_tf, bool jr) if (recheck_tf) { gen_helper_rechecking_single_step(tcg_env); tcg_gen_exit_tb(NULL, 0); - } else if (s->flags & HF_TF_MASK) { + } else if ((s->flags & HF_TF_MASK) && !inhibit) { gen_helper_single_step(tcg_env); } else if (jr && /* give irqs a chance to happen */ From patchwork Sat May 25 11:33:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 13673974 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7AC62C25B7A for ; Sat, 25 May 2024 11:38:37 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sApev-0002Jx-6K; Sat, 25 May 2024 07:33: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 1sApet-0002JV-N9 for qemu-devel@nongnu.org; Sat, 25 May 2024 07:33: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 1sApes-00040J-5P for qemu-devel@nongnu.org; Sat, 25 May 2024 07:33:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716636833; 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=3xGlyA/FI5OW5CcwO6tDBjZeAqJPAIk1z3SFIw+wSBU=; b=NyHNDQ2fQ0vQaeh89O6yAHtKGZk99btgJYPNlxiJ6dCvcwAahENTYlmMqegirkArNCORPc RWrlED2TcFi2r3xVmki6URhJcr8AoV6nQVUkZVnlwtIVbl+4GYmGk3jSvm0ZmyntmptfWB A/bs/p134lE+oD8PoP1wqDTf7gJ2QoY= 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-572-BUXMfdYhOPGBNk1POMpYGw-1; Sat, 25 May 2024 07:33:52 -0400 X-MC-Unique: BUXMfdYhOPGBNk1POMpYGw-1 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-a6265d3cb71so72914466b.0 for ; Sat, 25 May 2024 04:33:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716636830; x=1717241630; 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=3xGlyA/FI5OW5CcwO6tDBjZeAqJPAIk1z3SFIw+wSBU=; b=U8q8w5r5gRUuu0vU/jKQzh49PRdfjKacsWbjgMDfwcPZTEy/mgVtaahrLsTnbUTAk/ +/RSJ5VSN5ipoM61eJXMWoUa6RR9f0I9oJGm2dAoGnpprqqPPq/J+FhrK9e8BiaA0OIX e3dat84d1Wx9zUeHSzE6BiD2iDvuWof4ckdGA38UEt9JuJ+Q4zaeiDlIGpZfC3SKxYIN E6rmLnL+wANw66fE3B+Mae6TaxwClotdz1z8CkcuEoAoEfj+tCVRzwN0/q9PYu/FbFj8 FyGS2zJGSFUZcSp0OnDMTKC16nVJD5GwhiD5p6m+JOIwgmnn2EcBZoqmSNAyyEJa65mu NWEQ== X-Gm-Message-State: AOJu0Ywbj9gmfo6WKDV6C3x6jxeFMHqN8b/m1VPYjd7nlo5oLBoH3GOB GDt3sKbUN1mAaUoZalqO8HZyF0Z9boldg/iZ13yhx+iXZmrmMCvuhg0h4yB2owK3qcsitxtxFAH +zrS+X1v5Wl4rAakiw+Vfpa8yovRkMu49waLIZeLUlxUM5Pol8VVbR2+lD4Ds2u8mvAnaTVAYrR B1gL1RggAuNK7FQE4ZWY+tjdX/1dvMz/AlzIz1 X-Received: by 2002:a17:907:82a5:b0:a5a:3da6:7712 with SMTP id a640c23a62f3a-a6265134c8fmr262099866b.71.1716636830210; Sat, 25 May 2024 04:33:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IECDFvnDg2OHd4yByoyYyCz2OQVGN6bni20WVtP/R+6pam4keYJEp8lByhIon+9DWzPprApBA== X-Received: by 2002:a17:907:82a5:b0:a5a:3da6:7712 with SMTP id a640c23a62f3a-a6265134c8fmr262098666b.71.1716636829769; Sat, 25 May 2024 04:33:49 -0700 (PDT) Received: from [192.168.10.81] ([151.95.155.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a626cc5147dsm243608666b.124.2024.05.25.04.33.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 04:33:47 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 04/24] target/i386: cleanup eob handling of RSM Date: Sat, 25 May 2024 13:33:12 +0200 Message-ID: <20240525113332.1404158-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240525113332.1404158-1-pbonzini@redhat.com> References: <20240525113332.1404158-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org gen_helper_rsm cannot generate an exception, and reloads the flags. So there's no need to spill cc_op and update cpu_eip, but on the other hand cc_op must be reset to CC_OP_EFLAGS before returning. It all works by chance, because by spilling cc_op before the call to the helper, it becomes non-dirty and gen_eob will not overwrite the CC_OP_EFLAGS value that is placed there by the helper. But let's clean it up. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 9782250b20b..849864d1aa2 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -4488,9 +4488,8 @@ static void disas_insn_old(DisasContext *s, CPUState *cpu, int b) /* we should not be in SMM mode */ g_assert_not_reached(); #else - gen_update_cc_op(s); - gen_update_eip_next(s); gen_helper_rsm(tcg_env); + set_cc_op(s, CC_OP_EFLAGS); #endif /* CONFIG_USER_ONLY */ s->base.is_jmp = DISAS_EOB_ONLY; break; From patchwork Sat May 25 11:33:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 13673970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B797BC25B7A for ; Sat, 25 May 2024 11:37:59 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sApf0-0002Lh-FJ; Sat, 25 May 2024 07:34:03 -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 1sApey-0002Kl-Jg for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34:00 -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 1sApew-00042a-5h for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716636837; 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=BSJN/i12F1p262vXEsjh5CJqJbwGkeoetfhWIy9cGpY=; b=Jij5ubEPjKWrp0sLJtrrGC5VUr/lyoLWbLuNDx34ZC3Geg1k9bLeeU79vxZe9plyj78uV4 s8isiGsWIj7NoMGJ9agHVpYM2SHfd9GYlbEGWPtgptuSxzfYoFiPPw/jMiaHB7eaqU4/H3 s76sTxxeBUWm13o6mG0CHurCPlcnp6g= 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-586--bJB4RD0NriukFOMU5qeUQ-1; Sat, 25 May 2024 07:33:55 -0400 X-MC-Unique: -bJB4RD0NriukFOMU5qeUQ-1 Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-52348f2e47cso2794156e87.1 for ; Sat, 25 May 2024 04:33:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716636833; x=1717241633; 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=BSJN/i12F1p262vXEsjh5CJqJbwGkeoetfhWIy9cGpY=; b=iLULbw5ZKfdQPGjpQ8QVnYOQmNBMxVHWOyvccLrUCLLsOHEdnVAXMc8noXHfQfgTYC Y6s/a8kjKu3gw2Ni2NKX4QgBswI1UGL/T0ByQUihVlZaofENj0xg7QPwwNCHENoLfoyd ZnP7gsu57QSGuOqHcYyNZ0VKJXxu9oeevHPToaO4zKP90/ZNqHaDrNfoBM2d7I0tVC0r rPpu9Cr4SJ4GJqdYDdoZ4gn4D8tm4PcJ372WwMdIZnjbIZgmQPJQd2pPip4+bovMCZdS ACEZXr7na/xYUmuPoZRsQCbBHX9v97yT0WVOBqjwzGk2Ro2/7eetrBVU8s5/XJEHFDFo i4Vw== X-Gm-Message-State: AOJu0Yx/g2vS6VXw56YVwMzyeyGYY8xG6dYfL42lmqoUcx80Nl2l5e7o koVpPCAyhXcKzPJoU2iHhVMvXPuOGc3O9mTboGONoiDP75EMNgmW6gWf+txkeenH1pOgtblyvyu FF9xqmCFmSnWCjnyfegNmkH37Wh9busaZoaliZlidVHZknkuXLgmWJRuQUXaJxhdlWdBNbKaT7Z aRiApiwq+oyN3p3jCS2F9FPQIOZOKV4bAEoUsQ X-Received: by 2002:a19:6407:0:b0:51d:a78e:9036 with SMTP id 2adb3069b0e04-52966f8f8acmr2598443e87.69.1716636833043; Sat, 25 May 2024 04:33:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG7wHGBDJ+C5Ne70cP08PmoEifhihkNlHj5Pm+XmsD5MZqAH2TdGsMRu38fkt7Ow1/8T5Mv5A== X-Received: by 2002:a19:6407:0:b0:51d:a78e:9036 with SMTP id 2adb3069b0e04-52966f8f8acmr2598431e87.69.1716636832554; Sat, 25 May 2024 04:33:52 -0700 (PDT) Received: from [192.168.10.117] ([151.95.155.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a626cda63dbsm243609966b.210.2024.05.25.04.33.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 04:33:52 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 05/24] target/i386: remove unnecessary gen_update_cc_op before gen_eob* Date: Sat, 25 May 2024 13:33:13 +0200 Message-ID: <20240525113332.1404158-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240525113332.1404158-1-pbonzini@redhat.com> References: <20240525113332.1404158-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org This is already handled in gen_eob(). Before adding another DISAS_* case, remove the double calls. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 849864d1aa2..920d854c2b5 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -4775,14 +4775,12 @@ static void i386_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) gen_jmp_rel_csize(dc, 0, 0); break; case DISAS_EOB_NEXT: - gen_update_cc_op(dc); gen_update_eip_cur(dc); /* fall through */ case DISAS_EOB_ONLY: gen_eob(dc); break; case DISAS_EOB_INHIBIT_IRQ: - gen_update_cc_op(dc); gen_update_eip_cur(dc); gen_eob_inhibit_irq(dc); break; From patchwork Sat May 25 11:33:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 13673971 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D4CABC25B78 for ; Sat, 25 May 2024 11:38:30 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sApf2-0002MI-7p; Sat, 25 May 2024 07:34:04 -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 1sApf0-0002Lb-A1 for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34:02 -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 1sApey-00042y-8b for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716636839; 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=6AzBA78pbflNThNfuRdbt+YMVvZA2AmBw1wMegaaFwc=; b=Cct9YdkX2GUSxbQp/Nr8/L3o8EhlejrGj6eCLlYf+ndNxJii9JMK1OglrUKq2mb1uM1Hvg HVyVGC7RZq6+6xyzUhRsHuIJoR287nNrJ1qcJY78Ob0SDruPeiVEn/Fq8a2c6s0ZKsyw53 4/ZNd68EggB+EZSCCYwqAabjfhlZDKU= 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-602-6SAIdBPFPkKycWEMrolMZg-1; Sat, 25 May 2024 07:33:58 -0400 X-MC-Unique: 6SAIdBPFPkKycWEMrolMZg-1 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a6267bcfb5fso32435066b.2 for ; Sat, 25 May 2024 04:33:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716636836; x=1717241636; 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=6AzBA78pbflNThNfuRdbt+YMVvZA2AmBw1wMegaaFwc=; b=B8Ayz9+0b5IcYPeLXjacF7MqROcKe7ZFCBEONIrRzS1Jp/J1hq1tp7PzEYl5A+xJgF Pq+BfdDT6Pu7G9CVL0xph2s8RgBzr0KZQPebQs9oBlil7HtazY2M0VtwoyjG1cSoj5Tw 4025Qyy2mrg7YGRZ4HlGH3h+XC337aIR77licMIKR+OUlQ60GwsHGKt7ikmPn6THXsNF vDzkpTr9jnlh0jkWdr4oIkDKQO7JqeGSLJctISvMF+n4lfAWIhCPH/rT8ulI1woekrZK IJ234aANFP4zNiiqm+qbXSWmeypYgmQ/gcv2be4CaUukZP/+DpOBq7OJJrBtG/4YL2/7 RDmw== X-Gm-Message-State: AOJu0YwEXpNqLJEwNKs5J3bQTP+KNFL8ikx14HXAQ0hU68Lyrv46VCMX zTEeX89/r9RdLOU83CC2I9A2Q6gt9vTHFD9HGKZZ0JiVDcOaTLktM8S+6kfVQIzoZ2dsgqOko+6 Ou3ZoSZIBaBb3r4wteL4on7rtlliggrFWGGIXftWb3yLTVwZEkEwWLZNuI5k5qbMGEoY39BSbOz HDxFXwl2vKQ5v2lLgw44fdWQLU7u9HXOKcB2Oc X-Received: by 2002:a50:cd5d:0:b0:578:881e:7b77 with SMTP id 4fb4d7f45d1cf-578884c43e8mr1093196a12.34.1716636836081; Sat, 25 May 2024 04:33:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEckXUv7UbucwIzjAjV+uRTkRUTm3bavUmfopiYM+TacbJFz5QQ7IBC007pcLbANOM8tN7tjA== X-Received: by 2002:a50:cd5d:0:b0:578:881e:7b77 with SMTP id 4fb4d7f45d1cf-578884c43e8mr1093175a12.34.1716636835566; Sat, 25 May 2024 04:33:55 -0700 (PDT) Received: from [192.168.10.116] ([151.95.155.52]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-579c004108esm348864a12.23.2024.05.25.04.33.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 04:33:55 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 06/24] target/i386: cpu_load_eflags already sets cc_op Date: Sat, 25 May 2024 13:33:14 +0200 Message-ID: <20240525113332.1404158-7-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240525113332.1404158-1-pbonzini@redhat.com> References: <20240525113332.1404158-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org No need to set it again at the end of the translation block, cc_op_dirty can be set to false. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 37 ++++++++++++++++++++++++------------- target/i386/tcg/emit.c.inc | 2 +- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 920d854c2b5..25c973e20c6 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -309,7 +309,7 @@ static const uint8_t cc_op_live[CC_OP_NB] = { [CC_OP_POPCNT] = USES_CC_SRC, }; -static void set_cc_op(DisasContext *s, CCOp op) +static void set_cc_op_1(DisasContext *s, CCOp op, bool dirty) { int dead; @@ -332,20 +332,27 @@ static void set_cc_op(DisasContext *s, CCOp op) tcg_gen_discard_tl(s->cc_srcT); } - if (op == CC_OP_DYNAMIC) { - /* The DYNAMIC setting is translator only, and should never be - stored. Thus we always consider it clean. */ - s->cc_op_dirty = false; - } else { - /* Discard any computed CC_OP value (see shifts). */ - if (s->cc_op == CC_OP_DYNAMIC) { - tcg_gen_discard_i32(cpu_cc_op); - } - s->cc_op_dirty = true; + if (dirty && s->cc_op == CC_OP_DYNAMIC) { + tcg_gen_discard_i32(cpu_cc_op); } + s->cc_op_dirty = dirty; s->cc_op = op; } +static void set_cc_op(DisasContext *s, CCOp op) +{ + /* + * The DYNAMIC setting is translator only, everything else + * will be spilled later. + */ + set_cc_op_1(s, op, op != CC_OP_DYNAMIC); +} + +static void assume_cc_op(DisasContext *s, CCOp op) +{ + set_cc_op_1(s, op, false); +} + static void gen_update_cc_op(DisasContext *s) { if (s->cc_op_dirty) { @@ -3554,6 +3561,10 @@ static void disas_insn_old(DisasContext *s, CPUState *cpu, int b) gen_update_cc_op(s); gen_update_eip_cur(s); gen_helper_syscall(tcg_env, cur_insn_len_i32(s)); + /* condition codes are modified only in long mode */ + if (LMA(s)) { + assume_cc_op(s, CC_OP_EFLAGS); + } /* TF handling for the syscall insn is different. The TF bit is checked after the syscall insn completes. This allows #DB to not be generated after one has entered CPL0 if TF is set in FMASK. */ @@ -3570,7 +3581,7 @@ static void disas_insn_old(DisasContext *s, CPUState *cpu, int b) gen_helper_sysret(tcg_env, tcg_constant_i32(dflag - 1)); /* condition codes are modified only in long mode */ if (LMA(s)) { - set_cc_op(s, CC_OP_EFLAGS); + assume_cc_op(s, CC_OP_EFLAGS); } /* TF handling for the sysret insn is different. The TF bit is checked after the sysret insn completes. This allows #DB to be @@ -4489,7 +4500,7 @@ static void disas_insn_old(DisasContext *s, CPUState *cpu, int b) g_assert_not_reached(); #else gen_helper_rsm(tcg_env); - set_cc_op(s, CC_OP_EFLAGS); + assume_cc_op(s, CC_OP_EFLAGS); #endif /* CONFIG_USER_ONLY */ s->base.is_jmp = DISAS_EOB_ONLY; break; diff --git a/target/i386/tcg/emit.c.inc b/target/i386/tcg/emit.c.inc index c78e35b1e28..3f2ae0aa7e7 100644 --- a/target/i386/tcg/emit.c.inc +++ b/target/i386/tcg/emit.c.inc @@ -1883,7 +1883,7 @@ static void gen_IRET(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode) gen_helper_iret_protected(tcg_env, tcg_constant_i32(s->dflag - 1), eip_next_i32(s)); } - set_cc_op(s, CC_OP_EFLAGS); + assume_cc_op(s, CC_OP_EFLAGS); s->base.is_jmp = DISAS_EOB_ONLY; } From patchwork Sat May 25 11:33:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 13673968 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 23503C25B7A for ; Sat, 25 May 2024 11:37:39 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sApfD-0002Og-PI; Sat, 25 May 2024 07:34: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 1sApf9-0002Nj-G6 for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34:11 -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 1sApf7-000447-B7 for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716636847; 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=JcaWSoqXnDbQEksQVvSiLMdeB+3Qnl+sHWRJxLEbkU8=; b=MYrOJ0aaSFIvpAtZGfkSyM1yHRBUeWRpfvMCA8aWLgcDlRlYW8iCVx/OgOfTct6TxslOI7 4nXvDEoovbYUkrgKtThjfN/jvfEUWYYnbrj/yvZ3pE9fJNbwJXuCZfwY+8GH3CfqV//wVu gPhL324uy8GU6++CqL4hW4792zWfa14= 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-333-DEqn0TjbNXaVsQq-NgC6Hw-1; Sat, 25 May 2024 07:34:00 -0400 X-MC-Unique: DEqn0TjbNXaVsQq-NgC6Hw-1 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-a5a812308daso206575266b.0 for ; Sat, 25 May 2024 04:34:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716636839; x=1717241639; 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=JcaWSoqXnDbQEksQVvSiLMdeB+3Qnl+sHWRJxLEbkU8=; b=uhKkmWZ+Ivp0JfpuNa8eyJviz+MAkfV7+4UXbZqpBXVPsVTzBQoV8GASEKEhz4WfUg CC0LrfCxRj0dKgWzvFe+S8mG/QMgDgBhXb/7KCHlgenISpGU0zwNHgb9c133hy+B5tSp obu9PSwtF4oHsOyqfJvvEiK1I+BB/Jg2MEZyIOkav1YZOpqtVXLGEuOAuN5ARZuJTeRz 7sKmmj8KbBlWe9fPRsZ1NCH0BMBxEZSEp06afr4xPFcGIRtsow5nAGG8wi8iEoGJzzvH bqaRroTsB5M9Ru76wzY0odkKLOFBcuOktAPpFqVYEw1eKrPiI7U90JFGZJSE6mhtmkSo wdXw== X-Gm-Message-State: AOJu0YztxxbQTZxcjJe8knvlnm1P9wQ7b7j3zFdcVTRIAPUormhT2bwy znqnfhKa3YX5bWXUK6u2bx/Lun9cvunSQlbz9j9WGMpPEEem+nLT+oPeXKb7qKZ84zRTTT+pQfn j1Y2W8eF1jjfTT2OBf6f2Np9Ptsv8SRxLDc+ERzK1HKCKMszQGkWAUxhTVTuhm/V0INpjf+XRnC oiXFsr58fs4qrcquXdntffUT7jxdFy8+eWpXQt X-Received: by 2002:a17:906:27cc:b0:a5a:3579:b908 with SMTP id a640c23a62f3a-a62643eb6abmr297257366b.38.1716636838848; Sat, 25 May 2024 04:33:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHl0jruTnLTGDbqG/GuyGRqGONohp4QcSUu36o1MBK0GeAQ9Zv0A/Rvtsmtqre92ZXKASK+3w== X-Received: by 2002:a17:906:27cc:b0:a5a:3579:b908 with SMTP id a640c23a62f3a-a62643eb6abmr297255666b.38.1716636838389; Sat, 25 May 2024 04:33:58 -0700 (PDT) Received: from [192.168.10.117] ([151.95.155.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a626c817ac8sm244081966b.2.2024.05.25.04.33.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 04:33:57 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 07/24] target/i386: set CC_OP in helpers if they want CC_OP_EFLAGS Date: Sat, 25 May 2024 13:33:15 +0200 Message-ID: <20240525113332.1404158-8-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240525113332.1404158-1-pbonzini@redhat.com> References: <20240525113332.1404158-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Mark cc_op as clean and do not spill it at the end of the translation block. Technically this is a tiny bit less efficient, but: * it results in translations that are a tiny bit smaller * for most of these instructions, it is not unlikely that they are close to the end of the basic block, in which case cc_op would not be overwritten * anyway the cost is probably dwarfed by that of computing flags. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/ops_sse.h | 8 ++++++++ target/i386/tcg/fpu_helper.c | 2 ++ target/i386/tcg/int_helper.c | 13 +++++++++---- target/i386/tcg/seg_helper.c | 16 ++++++++-------- target/i386/tcg/translate.c | 12 ++++++------ target/i386/tcg/emit.c.inc | 22 +++++++++++----------- 6 files changed, 44 insertions(+), 29 deletions(-) diff --git a/target/i386/ops_sse.h b/target/i386/ops_sse.h index 6a465a35fdb..f0aa1894aa2 100644 --- a/target/i386/ops_sse.h +++ b/target/i386/ops_sse.h @@ -1111,6 +1111,7 @@ void helper_ucomiss(CPUX86State *env, Reg *d, Reg *s) s1 = s->ZMM_S(0); ret = float32_compare_quiet(s0, s1, &env->sse_status); CC_SRC = comis_eflags[ret + 1]; + CC_OP = CC_OP_EFLAGS; } void helper_comiss(CPUX86State *env, Reg *d, Reg *s) @@ -1122,6 +1123,7 @@ void helper_comiss(CPUX86State *env, Reg *d, Reg *s) s1 = s->ZMM_S(0); ret = float32_compare(s0, s1, &env->sse_status); CC_SRC = comis_eflags[ret + 1]; + CC_OP = CC_OP_EFLAGS; } void helper_ucomisd(CPUX86State *env, Reg *d, Reg *s) @@ -1133,6 +1135,7 @@ void helper_ucomisd(CPUX86State *env, Reg *d, Reg *s) d1 = s->ZMM_D(0); ret = float64_compare_quiet(d0, d1, &env->sse_status); CC_SRC = comis_eflags[ret + 1]; + CC_OP = CC_OP_EFLAGS; } void helper_comisd(CPUX86State *env, Reg *d, Reg *s) @@ -1144,6 +1147,7 @@ void helper_comisd(CPUX86State *env, Reg *d, Reg *s) d1 = s->ZMM_D(0); ret = float64_compare(d0, d1, &env->sse_status); CC_SRC = comis_eflags[ret + 1]; + CC_OP = CC_OP_EFLAGS; } #endif @@ -1610,6 +1614,7 @@ void glue(helper_ptest, SUFFIX)(CPUX86State *env, Reg *d, Reg *s) cf |= (s->Q(i) & ~d->Q(i)); } CC_SRC = (zf ? 0 : CC_Z) | (cf ? 0 : CC_C); + CC_OP = CC_OP_EFLAGS; } #define FMOVSLDUP(i) s->L((i) & ~1) @@ -1966,6 +1971,7 @@ static inline unsigned pcmpxstrx(CPUX86State *env, Reg *d, Reg *s, validd--; CC_SRC = (valids < upper ? CC_Z : 0) | (validd < upper ? CC_S : 0); + CC_OP = CC_OP_EFLAGS; switch ((ctrl >> 2) & 3) { case 0: @@ -2297,6 +2303,7 @@ void glue(helper_vtestps, SUFFIX)(CPUX86State *env, Reg *d, Reg *s) cf |= (s->L(i) & ~d->L(i)); } CC_SRC = ((zf >> 31) ? 0 : CC_Z) | ((cf >> 31) ? 0 : CC_C); + CC_OP = CC_OP_EFLAGS; } void glue(helper_vtestpd, SUFFIX)(CPUX86State *env, Reg *d, Reg *s) @@ -2309,6 +2316,7 @@ void glue(helper_vtestpd, SUFFIX)(CPUX86State *env, Reg *d, Reg *s) cf |= (s->Q(i) & ~d->Q(i)); } CC_SRC = ((zf >> 63) ? 0 : CC_Z) | ((cf >> 63) ? 0 : CC_C); + CC_OP = CC_OP_EFLAGS; } void glue(helper_vpmaskmovd_st, SUFFIX)(CPUX86State *env, diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fpu_helper.c index ece22a3553f..8df8cae6310 100644 --- a/target/i386/tcg/fpu_helper.c +++ b/target/i386/tcg/fpu_helper.c @@ -487,6 +487,7 @@ void helper_fcomi_ST0_FT0(CPUX86State *env) ret = floatx80_compare(ST0, FT0, &env->fp_status); eflags = cpu_cc_compute_all(env) & ~(CC_Z | CC_P | CC_C); CC_SRC = eflags | fcomi_ccval[ret + 1]; + CC_OP = CC_OP_EFLAGS; merge_exception_flags(env, old_flags); } @@ -499,6 +500,7 @@ void helper_fucomi_ST0_FT0(CPUX86State *env) ret = floatx80_compare_quiet(ST0, FT0, &env->fp_status); eflags = cpu_cc_compute_all(env) & ~(CC_Z | CC_P | CC_C); CC_SRC = eflags | fcomi_ccval[ret + 1]; + CC_OP = CC_OP_EFLAGS; merge_exception_flags(env, old_flags); } diff --git a/target/i386/tcg/int_helper.c b/target/i386/tcg/int_helper.c index 4cc59f15203..e1f92405282 100644 --- a/target/i386/tcg/int_helper.c +++ b/target/i386/tcg/int_helper.c @@ -187,6 +187,7 @@ void helper_aaa(CPUX86State *env) } env->regs[R_EAX] = (env->regs[R_EAX] & ~0xffff) | al | (ah << 8); CC_SRC = eflags; + CC_OP = CC_OP_EFLAGS; } void helper_aas(CPUX86State *env) @@ -211,6 +212,7 @@ void helper_aas(CPUX86State *env) } env->regs[R_EAX] = (env->regs[R_EAX] & ~0xffff) | al | (ah << 8); CC_SRC = eflags; + CC_OP = CC_OP_EFLAGS; } void helper_daa(CPUX86State *env) @@ -238,6 +240,7 @@ void helper_daa(CPUX86State *env) eflags |= parity_table[al]; /* pf */ eflags |= (al & 0x80); /* sf */ CC_SRC = eflags; + CC_OP = CC_OP_EFLAGS; } void helper_das(CPUX86State *env) @@ -269,6 +272,7 @@ void helper_das(CPUX86State *env) eflags |= parity_table[al]; /* pf */ eflags |= (al & 0x80); /* sf */ CC_SRC = eflags; + CC_OP = CC_OP_EFLAGS; } #ifdef TARGET_X86_64 @@ -449,10 +453,11 @@ target_ulong HELPER(rdrand)(CPUX86State *env) error_free(err); /* Failure clears CF and all other flags, and returns 0. */ env->cc_src = 0; - return 0; + ret = 0; + } else { + /* Success sets CF and clears all others. */ + env->cc_src = CC_C; } - - /* Success sets CF and clears all others. */ - env->cc_src = CC_C; + env->cc_op = CC_OP_EFLAGS; return ret; } diff --git a/target/i386/tcg/seg_helper.c b/target/i386/tcg/seg_helper.c index 34ccabd8ce3..0301459004e 100644 --- a/target/i386/tcg/seg_helper.c +++ b/target/i386/tcg/seg_helper.c @@ -2326,7 +2326,7 @@ void helper_verr(CPUX86State *env, target_ulong selector1) int rpl, dpl, cpl; selector = selector1 & 0xffff; - eflags = cpu_cc_compute_all(env); + eflags = cpu_cc_compute_all(env) | CC_Z; if ((selector & 0xfffc) == 0) { goto fail; } @@ -2351,11 +2351,11 @@ void helper_verr(CPUX86State *env, target_ulong selector1) } else { if (dpl < cpl || dpl < rpl) { fail: - CC_SRC = eflags & ~CC_Z; - return; + eflags &= ~CC_Z; } } - CC_SRC = eflags | CC_Z; + CC_SRC = eflags; + CC_OP = CC_OP_EFLAGS; } void helper_verw(CPUX86State *env, target_ulong selector1) @@ -2364,7 +2364,7 @@ void helper_verw(CPUX86State *env, target_ulong selector1) int rpl, dpl, cpl; selector = selector1 & 0xffff; - eflags = cpu_cc_compute_all(env); + eflags = cpu_cc_compute_all(env) | CC_Z; if ((selector & 0xfffc) == 0) { goto fail; } @@ -2385,9 +2385,9 @@ void helper_verw(CPUX86State *env, target_ulong selector1) } if (!(e2 & DESC_W_MASK)) { fail: - CC_SRC = eflags & ~CC_Z; - return; + eflags &= ~CC_Z; } } - CC_SRC = eflags | CC_Z; + CC_SRC = eflags; + CC_OP = CC_OP_EFLAGS; } diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 25c973e20c6..1b0485e01b3 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -2984,7 +2984,7 @@ static bool disas_insn_x87(DisasContext *s, CPUState *cpu, int b) gen_update_cc_op(s); gen_helper_fmov_FT0_STN(tcg_env, tcg_constant_i32(opreg)); gen_helper_fucomi_ST0_FT0(tcg_env); - set_cc_op(s, CC_OP_EFLAGS); + assume_cc_op(s, CC_OP_EFLAGS); break; case 0x1e: /* fcomi */ if (!(s->cpuid_features & CPUID_CMOV)) { @@ -2993,7 +2993,7 @@ static bool disas_insn_x87(DisasContext *s, CPUState *cpu, int b) gen_update_cc_op(s); gen_helper_fmov_FT0_STN(tcg_env, tcg_constant_i32(opreg)); gen_helper_fcomi_ST0_FT0(tcg_env); - set_cc_op(s, CC_OP_EFLAGS); + assume_cc_op(s, CC_OP_EFLAGS); break; case 0x28: /* ffree sti */ gen_helper_ffree_STN(tcg_env, tcg_constant_i32(opreg)); @@ -3052,7 +3052,7 @@ static bool disas_insn_x87(DisasContext *s, CPUState *cpu, int b) gen_helper_fmov_FT0_STN(tcg_env, tcg_constant_i32(opreg)); gen_helper_fucomi_ST0_FT0(tcg_env); gen_helper_fpop(tcg_env); - set_cc_op(s, CC_OP_EFLAGS); + assume_cc_op(s, CC_OP_EFLAGS); break; case 0x3e: /* fcomip */ if (!(s->cpuid_features & CPUID_CMOV)) { @@ -3062,7 +3062,7 @@ static bool disas_insn_x87(DisasContext *s, CPUState *cpu, int b) gen_helper_fmov_FT0_STN(tcg_env, tcg_constant_i32(opreg)); gen_helper_fcomi_ST0_FT0(tcg_env); gen_helper_fpop(tcg_env); - set_cc_op(s, CC_OP_EFLAGS); + assume_cc_op(s, CC_OP_EFLAGS); break; case 0x10 ... 0x13: /* fcmovxx */ case 0x18 ... 0x1b: @@ -3268,7 +3268,7 @@ static void disas_insn_old(DisasContext *s, CPUState *cpu, int b) gen_helper_rdrand(s->T0, tcg_env); rm = (modrm & 7) | REX_B(s); gen_op_mov_reg_v(s, dflag, rm, s->T0); - set_cc_op(s, CC_OP_EFLAGS); + assume_cc_op(s, CC_OP_EFLAGS); break; default: @@ -3655,7 +3655,7 @@ static void disas_insn_old(DisasContext *s, CPUState *cpu, int b) } else { gen_helper_verw(tcg_env, s->T0); } - set_cc_op(s, CC_OP_EFLAGS); + assume_cc_op(s, CC_OP_EFLAGS); break; default: goto unknown_op; diff --git a/target/i386/tcg/emit.c.inc b/target/i386/tcg/emit.c.inc index 3f2ae0aa7e7..e0ac21abe28 100644 --- a/target/i386/tcg/emit.c.inc +++ b/target/i386/tcg/emit.c.inc @@ -918,7 +918,7 @@ static void gen_##uname(DisasContext *s, CPUX86State *env, X86DecodedInsn *decod } else { \ gen_helper_##lname##_ymm(tcg_env, OP_PTR1, OP_PTR2); \ } \ - set_cc_op(s, CC_OP_EFLAGS); \ + assume_cc_op(s, CC_OP_EFLAGS); \ } UNARY_CMP_SSE(VPTEST, ptest) UNARY_CMP_SSE(VTESTPS, vtestps) @@ -1079,7 +1079,7 @@ static void gen_AAA(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode) { gen_update_cc_op(s); gen_helper_aaa(tcg_env); - set_cc_op(s, CC_OP_EFLAGS); + assume_cc_op(s, CC_OP_EFLAGS); } static void gen_AAD(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode) @@ -1102,7 +1102,7 @@ static void gen_AAS(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode) { gen_update_cc_op(s); gen_helper_aas(tcg_env); - set_cc_op(s, CC_OP_EFLAGS); + assume_cc_op(s, CC_OP_EFLAGS); } static void gen_ADC(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode) @@ -1566,14 +1566,14 @@ static void gen_DAA(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode) { gen_update_cc_op(s); gen_helper_daa(tcg_env); - set_cc_op(s, CC_OP_EFLAGS); + assume_cc_op(s, CC_OP_EFLAGS); } static void gen_DAS(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode) { gen_update_cc_op(s); gen_helper_das(tcg_env); - set_cc_op(s, CC_OP_EFLAGS); + assume_cc_op(s, CC_OP_EFLAGS); } static void gen_DEC(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode) @@ -2353,14 +2353,14 @@ static void gen_PCMPESTRI(DisasContext *s, CPUX86State *env, X86DecodedInsn *dec { TCGv_i32 imm = tcg_constant8u_i32(decode->immediate); gen_helper_pcmpestri_xmm(tcg_env, OP_PTR1, OP_PTR2, imm); - set_cc_op(s, CC_OP_EFLAGS); + assume_cc_op(s, CC_OP_EFLAGS); } static void gen_PCMPESTRM(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode) { TCGv_i32 imm = tcg_constant8u_i32(decode->immediate); gen_helper_pcmpestrm_xmm(tcg_env, OP_PTR1, OP_PTR2, imm); - set_cc_op(s, CC_OP_EFLAGS); + assume_cc_op(s, CC_OP_EFLAGS); if ((s->prefix & PREFIX_VEX) && !s->vex_l) { tcg_gen_gvec_dup_imm(MO_64, offsetof(CPUX86State, xmm_regs[0].ZMM_X(1)), 16, 16, 0); @@ -2371,14 +2371,14 @@ static void gen_PCMPISTRI(DisasContext *s, CPUX86State *env, X86DecodedInsn *dec { TCGv_i32 imm = tcg_constant8u_i32(decode->immediate); gen_helper_pcmpistri_xmm(tcg_env, OP_PTR1, OP_PTR2, imm); - set_cc_op(s, CC_OP_EFLAGS); + assume_cc_op(s, CC_OP_EFLAGS); } static void gen_PCMPISTRM(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode) { TCGv_i32 imm = tcg_constant8u_i32(decode->immediate); gen_helper_pcmpistrm_xmm(tcg_env, OP_PTR1, OP_PTR2, imm); - set_cc_op(s, CC_OP_EFLAGS); + assume_cc_op(s, CC_OP_EFLAGS); if ((s->prefix & PREFIX_VEX) && !s->vex_l) { tcg_gen_gvec_dup_imm(MO_64, offsetof(CPUX86State, xmm_regs[0].ZMM_X(1)), 16, 16, 0); @@ -3595,7 +3595,7 @@ static void gen_VCOMI(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode) SSEFunc_0_epp fn; fn = s->prefix & PREFIX_DATA ? gen_helper_comisd : gen_helper_comiss; fn(tcg_env, OP_PTR1, OP_PTR2); - set_cc_op(s, CC_OP_EFLAGS); + assume_cc_op(s, CC_OP_EFLAGS); } static void gen_VCVTPD2PS(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode) @@ -3982,7 +3982,7 @@ static void gen_VUCOMI(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode SSEFunc_0_epp fn; fn = s->prefix & PREFIX_DATA ? gen_helper_ucomisd : gen_helper_ucomiss; fn(tcg_env, OP_PTR1, OP_PTR2); - set_cc_op(s, CC_OP_EFLAGS); + assume_cc_op(s, CC_OP_EFLAGS); } static void gen_VZEROALL(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode) From patchwork Sat May 25 11:33:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 13673956 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 40B4DC25B7A for ; Sat, 25 May 2024 11:35:33 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sApfQ-0002Xd-Bj; Sat, 25 May 2024 07:34:28 -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 1sApfJ-0002RG-MI for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34: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 1sApf8-000455-NI for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716636849; 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=5lB1PVNS3MVtMz/CPvzlI0uG9BYZEF10RS2KlIpk+5c=; b=UYX5xnChcKabXJUQ03ych3L2iHk3IlmXsD8lpobSYITz2PTcyCE0DbihCjO6TM/wG/L/y2 OESIitnft9KYIV0DmvjoFm4SLOVoP0zJvlHkgGx8aiEfCfK51inEbScjFBh5oF0gdsN8wx 4gRRi5orzlAVbKhZYzh+ivJu4CI647o= 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-664-xYhfNIypO7KuNjoZ0Oynqw-1; Sat, 25 May 2024 07:34:02 -0400 X-MC-Unique: xYhfNIypO7KuNjoZ0Oynqw-1 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a5a5fdd6185so398723866b.1 for ; Sat, 25 May 2024 04:34:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716636841; x=1717241641; 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=5lB1PVNS3MVtMz/CPvzlI0uG9BYZEF10RS2KlIpk+5c=; b=YVMKyfal/+AKvp0ppV7G+EsTqt5iHyUf7j5A8GbNEQ8GOUiugOgeHiiiTAFbMw/rov XxKYhMQD8X9veKXsfBuH+pPLR8nkUiJCDr5MGB4kmUU10PMP3R9loqK4zmsSGPXsA2WB GuDzlvO/I7V4jVHnYNoOkipoPY/IlS4Fs4fkp8wUV2r8oXB1oMUoYBL2ir91i01Wr42V 9ig5s/f9aQQ65UU2fAk49FvAR+aYKwXF+H8ves8M/hdypTS8ttnZi5Pot/v+FL61euoc AqQKmsvGFlK86wg+wXpoCQ3FpMLK4hU2rXvmUVxnQs0pocQuRevO1p7YKqLn74McamZZ N93g== X-Gm-Message-State: AOJu0Yw5dA9AAGg8DZuzr4MIhwxlxUVaZvDqIADVNkFcEqZSbgGWwqA5 xJxr7EbiQyw1M2VeAxxNNGTCcoxc7gAabe3Sbasr343fw07ILQUVTQAyFNjwQ2wYHKp0Zd6PqfJ 0aGu9T1enqKdd64Ta//AdMMdFYvxoeyFf+HwC4NCBDXotDp9ThxCg835Q6ok8XcvYACbQDiIBft hJJJ4VXau5AgKj2cvUDIHEDwLUzs7iO7cMNSqw X-Received: by 2002:a17:906:b0e:b0:a5a:8afd:33b4 with SMTP id a640c23a62f3a-a6262b146f7mr355972166b.37.1716636841262; Sat, 25 May 2024 04:34:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH/+sIYxhhK8uAshYqN6eiXF+M1fQzFwQ60DnLaij1DCcAjhCvD+vxYjBwd2AqXwzXsaI2Wng== X-Received: by 2002:a17:906:b0e:b0:a5a:8afd:33b4 with SMTP id a640c23a62f3a-a6262b146f7mr355971066b.37.1716636840885; Sat, 25 May 2024 04:34:00 -0700 (PDT) Received: from [192.168.10.116] ([151.95.155.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a626cda1c32sm243892266b.190.2024.05.25.04.33.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 04:33:59 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 08/24] target/i386: document and group DISAS_* constants Date: Sat, 25 May 2024 13:33:16 +0200 Message-ID: <20240525113332.1404158-9-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240525113332.1404158-1-pbonzini@redhat.com> References: <20240525113332.1404158-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Place DISAS_* constants that update cpu_eip first, and the "jump" ones last. Add comments explaining the differences and usage. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 1b0485e01b3..1246118e42b 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -144,9 +144,28 @@ typedef struct DisasContext { TCGOp *prev_insn_end; } DisasContext; -#define DISAS_EOB_ONLY DISAS_TARGET_0 -#define DISAS_EOB_NEXT DISAS_TARGET_1 -#define DISAS_EOB_INHIBIT_IRQ DISAS_TARGET_2 +/* + * Point EIP to next instruction before ending translation. + * For instructions that can change hflags. + */ +#define DISAS_EOB_NEXT DISAS_TARGET_0 + +/* + * Point EIP to next instruction and set HF_INHIBIT_IRQ if not + * already set. For instructions that activate interrupt shadow. + */ +#define DISAS_EOB_INHIBIT_IRQ DISAS_TARGET_1 + +/* + * Return to the main loop; EIP might have already been updated + * but even in that case do not use lookup_and_goto_ptr(). + */ +#define DISAS_EOB_ONLY DISAS_TARGET_2 + +/* + * EIP has already been updated. For jumps that wish to use + * lookup_and_goto_ptr() + */ #define DISAS_JUMP DISAS_TARGET_3 /* The environment in which user-only runs is constrained. */ From patchwork Sat May 25 11:33:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 13673953 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 707DBC25B78 for ; Sat, 25 May 2024 11:35:14 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sApfC-0002OE-MH; Sat, 25 May 2024 07:34:14 -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 1sApf8-0002NZ-V1 for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34:11 -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 1sApf7-00044R-BT for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716636847; 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=Wbd4E/05WUdNKIkx4SA2xBZKuCnPUAlJCLsAjzirtJc=; b=SPhgDbopNKy5JWe3t00VAEeEy7CuWtqwHsa2xEHv9IJI+XlGM2KKuJlUtgfm3VXytpfgWT ciSrDDrEtTEg+ANelaXzu7zchP6qS3yyTNaDs3+fpgicWEPq3PKnVMOidZ1mnhAJAOxzIC iS9JA+5eXZTbrfI1i9WI3D9D6UymgP0= 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-647-rcazl4BtPTa1s6qLYGbQUQ-1; Sat, 25 May 2024 07:34:06 -0400 X-MC-Unique: rcazl4BtPTa1s6qLYGbQUQ-1 Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-5785fc97facso816621a12.0 for ; Sat, 25 May 2024 04:34:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716636844; x=1717241644; 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=Wbd4E/05WUdNKIkx4SA2xBZKuCnPUAlJCLsAjzirtJc=; b=uN42sLBYac1LnmtnU53tjpviWBkreI4nd8/tknQ3wURvWKTu0hnLjH4EPAmyJ2+4uU 9uW01us7nFjKy0/nL/jzKRriRK6hcVO9I/VjjyAd5JOyEvHlAPwd2glaY5KZotKpjrcR FwimbJ5Xie4sz6N1M0nS0tBHqOUUCdKAnY+nldJiwSmELYlK6GRVIZ9NQ8aEnRIFQPBi Ro418jqQesQrK+k25Biispp03mS6fAlqhrSPu2Hw8s43oRo1gjBJwyVv6O5muOL09NjH z8X7w6g4qRWkT/eqzAhuxI/9iv+aFPOCDHwu7QRR0fb08mO8xLLjITE5Ss8SEinaWDhf B4Yg== X-Gm-Message-State: AOJu0YxdtqeaQ+H3/KdMLGODAHYQ9SfN3TByVQYItVFsbOacqmDVSvOT TGD9rtZgYgGYmtruklcJQZOKPXjzCk2llnBa1u0z/U/a6E9ku6GlUi1SrXbK8r/CTaH5do1X/wL LFwHW2CT7hQBqnD/cu/qaAomBgUu6up6zMV2dYgoGlqpV1KcjonvTkvPv8jqd10X04NmKM5G9st hRCLrYs4xkvp90801f9fR5495+r4JdcVYYZ/Og X-Received: by 2002:a50:d74e:0:b0:572:9d24:257a with SMTP id 4fb4d7f45d1cf-578519a91f8mr3195122a12.23.1716636844358; Sat, 25 May 2024 04:34:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHF2kXKoTrhP2nx6akXDfxYyKZOkgqRo1xIIJwTrQd2L7hUIAf3Ao534/uB+6bobAZ8VUcaDw== X-Received: by 2002:a50:d74e:0:b0:572:9d24:257a with SMTP id 4fb4d7f45d1cf-578519a91f8mr3195107a12.23.1716636843874; Sat, 25 May 2024 04:34:03 -0700 (PDT) Received: from [192.168.10.117] ([151.95.155.52]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-578523d58afsm3058889a12.44.2024.05.25.04.34.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 04:34:03 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 09/24] target/i386: avoid calling gen_eob_syscall before tb_stop Date: Sat, 25 May 2024 13:33:17 +0200 Message-ID: <20240525113332.1404158-10-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240525113332.1404158-1-pbonzini@redhat.com> References: <20240525113332.1404158-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org syscall and sysret only have one exit, so they do not need to generate the end-of-translation code inline. It can be deferred to tb_stop. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 1246118e42b..06aaaa00b43 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -168,6 +168,12 @@ typedef struct DisasContext { */ #define DISAS_JUMP DISAS_TARGET_3 +/* + * EIP has already been updated. Use updated value of + * EFLAGS.TF to determine singlestep trap (SYSCALL/SYSRET). + */ +#define DISAS_EOB_RECHECK_TF DISAS_TARGET_4 + /* The environment in which user-only runs is constrained. */ #ifdef CONFIG_USER_ONLY #define PE(S) true @@ -3587,7 +3593,7 @@ static void disas_insn_old(DisasContext *s, CPUState *cpu, int b) /* TF handling for the syscall insn is different. The TF bit is checked after the syscall insn completes. This allows #DB to not be generated after one has entered CPL0 if TF is set in FMASK. */ - gen_eob_syscall(s); + s->base.is_jmp = DISAS_EOB_RECHECK_TF; break; case 0x107: /* sysret */ /* For Intel SYSRET is only valid in long mode */ @@ -3606,7 +3612,7 @@ static void disas_insn_old(DisasContext *s, CPUState *cpu, int b) checked after the sysret insn completes. This allows #DB to be generated "as if" the syscall insn in userspace has just completed. */ - gen_eob_syscall(s); + s->base.is_jmp = DISAS_EOB_RECHECK_TF; } break; case 0x1a2: /* cpuid */ @@ -4810,6 +4816,9 @@ static void i386_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) case DISAS_EOB_ONLY: gen_eob(dc); break; + case DISAS_EOB_RECHECK_TF: + gen_eob_syscall(dc); + break; case DISAS_EOB_INHIBIT_IRQ: gen_update_eip_cur(dc); gen_eob_inhibit_irq(dc); From patchwork Sat May 25 11:33:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 13673965 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 92AA6C25B78 for ; Sat, 25 May 2024 11:37:10 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sApfM-0002TP-3Q; Sat, 25 May 2024 07:34:24 -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 1sApfK-0002SL-S7 for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34: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 1sApfJ-00046n-3t for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716636859; 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=hgBhn5gAD6U95AlcziLtUsku3a2fWbySPlP3IcoaJdU=; b=MZ73ox0ZrE8KpJbHt3Xjuz7ZMGyAfzF2wIhogshVHB3uS14YB8Fzsx0dgww2U0ds+Loqo6 uB3XPCMOao9j66iweGx8d6JWMH9e2Ec11gcJDyAyxt9Lksz1ijDOvEboRJpJ7hyYNgJ6LY eYV6E+nrt3uhnDylJ1sNuJu6mOJmN/c= Received: from mail-lf1-f72.google.com (mail-lf1-f72.google.com [209.85.167.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-171-1CxE1bgjOr6FyyaYw38aSQ-1; Sat, 25 May 2024 07:34:09 -0400 X-MC-Unique: 1CxE1bgjOr6FyyaYw38aSQ-1 Received: by mail-lf1-f72.google.com with SMTP id 2adb3069b0e04-523b4b04fa2so2677157e87.1 for ; Sat, 25 May 2024 04:34:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716636847; x=1717241647; 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=hgBhn5gAD6U95AlcziLtUsku3a2fWbySPlP3IcoaJdU=; b=tjMmAHUA1ivyp0Vwr6DMS59oCcHvVkfqmEWaYC8mDqOXqEh4om2UNPYr8fwK90iIQw V87cxWwWQd/RGh1tRguG+4Pb4NpJpVYLl10sXfXbQx1yGbfa+8rJbfQ5o673AlE0CY8p CCjBQvAYnNHVzLIe+3jl8+go6B0QrlUrmxM5ubfer8h+QAdvRlIH54wlW4ltwELoXE+0 BSXVh7G83xBs9b0tZmoMjjsTira6nAyuZysgks9VvR9T+MWqz59a0K3Wi1u6w24h0ZnU 5J9mF2/a/WNpPlSbnRzc5m5HAk6w9raAzjIDCS1dxtzJeWlGv3wibD5cq231UvGCKTbS 6j6w== X-Gm-Message-State: AOJu0YwgdRZoycM1f6IvFn+qiAuzBti8S/ykk4e1SOi8UpTDBDrv/Qw8 l/C+EJHuBGhHw+dpZ/iTJcWX4S2WVRU4lTY1vL8HXJGnZvuH265mMIcEJajrnSzWiQoUPRzUolS vzOBJraMR+/PbcAMGvCTEUkpAxyOrQBuFXg/9LE5ynECaNL1nLx9VT9bfiA89CLaP3IM+QhYFUP OBEJgXqdQRpyMAP1E/stQf5UaBEAVIprwtWv5t X-Received: by 2002:a19:910a:0:b0:51f:2a80:a982 with SMTP id 2adb3069b0e04-5296736bb70mr3180456e87.47.1716636847533; Sat, 25 May 2024 04:34:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGA4mFjkAsp2vwMuegTAgIsvQRL5K3wzViAmW8Bj69YjvrRFZ2Jem/bnNRlEO5a0rsTMfkIyw== X-Received: by 2002:a19:910a:0:b0:51f:2a80:a982 with SMTP id 2adb3069b0e04-5296736bb70mr3180447e87.47.1716636847066; Sat, 25 May 2024 04:34:07 -0700 (PDT) Received: from [192.168.10.117] ([151.95.155.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a626cda843fsm243874866b.220.2024.05.25.04.34.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 04:34:05 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 10/24] target/i386: avoid calling gen_eob_inhibit_irq before tb_stop Date: Sat, 25 May 2024 13:33:18 +0200 Message-ID: <20240525113332.1404158-11-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240525113332.1404158-1-pbonzini@redhat.com> References: <20240525113332.1404158-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org sti only has one exit, so it does not need to generate the end-of-translation code inline. It can be deferred to tb_stop. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 13 ------------- target/i386/tcg/emit.c.inc | 4 +--- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 06aaaa00b43..a7493b5ccfd 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -564,19 +564,6 @@ static void gen_update_eip_cur(DisasContext *s) s->pc_save = s->base.pc_next; } -static void gen_update_eip_next(DisasContext *s) -{ - assert(s->pc_save != -1); - if (tb_cflags(s->base.tb) & CF_PCREL) { - tcg_gen_addi_tl(cpu_eip, cpu_eip, s->pc - s->pc_save); - } else if (CODE64(s)) { - tcg_gen_movi_tl(cpu_eip, s->pc); - } else { - tcg_gen_movi_tl(cpu_eip, (uint32_t)(s->pc - s->cs_base)); - } - s->pc_save = s->pc; -} - static int cur_insn_len(DisasContext *s) { return s->pc - s->base.pc_next; diff --git a/target/i386/tcg/emit.c.inc b/target/i386/tcg/emit.c.inc index e0ac21abe28..88bcb9699c3 100644 --- a/target/i386/tcg/emit.c.inc +++ b/target/i386/tcg/emit.c.inc @@ -3475,9 +3475,7 @@ static void gen_STD(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode) static void gen_STI(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode) { gen_set_eflags(s, IF_MASK); - /* interruptions are enabled only the first insn after sti */ - gen_update_eip_next(s); - gen_eob_inhibit_irq(s); + s->base.is_jmp = DISAS_EOB_INHIBIT_IRQ; } static void gen_VAESKEYGEN(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode) From patchwork Sat May 25 11:33:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 13673961 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 18515C25B78 for ; Sat, 25 May 2024 11:36:11 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sApfG-0002PM-KJ; Sat, 25 May 2024 07:34: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 1sApfD-0002OV-Gj for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34:15 -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 1sApfC-00045f-4z for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716636853; 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=jd+kExSymCJLihhwRU1jpy365jv3dLyODR1tvy8Vmq4=; b=GTETg6SictH1N0NMkC4BQQDhmiDnvGwhM9xNUnx0dNGf22cze6CoRisM9z4h40k87oQmzD CPomnTj7c4Q5FZiBHJoJhWWkTXfQfzjq6yvu+xrXHEn3yHvBLXAiY2Jf/yactoIC4MsrXW a3zQEFYR5nmseqp5WjrcwlZpeGoXpS4= 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-422-RY-tXSlKMCCYmzvO7X_A4Q-1; Sat, 25 May 2024 07:34:11 -0400 X-MC-Unique: RY-tXSlKMCCYmzvO7X_A4Q-1 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-a629e32f5fdso23542566b.2 for ; Sat, 25 May 2024 04:34:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716636850; x=1717241650; 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=jd+kExSymCJLihhwRU1jpy365jv3dLyODR1tvy8Vmq4=; b=etK/pyyN9QshNPch3e526v9LsWLmMIpXUrSlnjymmaEqrBiuZPa2pCk2lnYOX5Wqwc Fttp5NVeTUC2KrhmSMMehsjpIPnUswJNmmA4aDydNt3r+bKE/rUmq1VomVjzPfCRn2aE oXSTDdI2JHim8AsG/yDE7xOsRR1dY2/zSA93HYBAWO0+n7ITWNfFRe5JEuMejbyWHtvT 9+yC23WGvJhleBkyjTfyBeNiYPKwYeYHY0nLV/x1GbBI1hi1wulwwHF5If3u7ECl9PHi pyjeUKlmGmL9ZQyN+fSpfeI8oncQCGmCX9FrfgrkgGYdRMHGl9qTjLqwOM2/YG9jPZWu JcMg== X-Gm-Message-State: AOJu0YyRkUuskYePVPyVc2tG8jdcRplFyFd0zfE/isABoooUYO/TFWvq VG5kZZeSk4HHFm8lJz+KOHPsoXAu9F2MtFP3Y9FzMrFiGP6l3Qvhgk2jXvfpoMoDseJsNwpFNpm 0CkVDDI58cPAvcj0dD+1vk+bWChWlHX4M2rxvQ0ZObZV1Otpyxv1r8qoB0/6Sm5eBV0jyuQ7qt5 fRnnkPquusnd1X3wDiVLLUf4nq0FUm0cKcAVFG X-Received: by 2002:a50:9f4b:0:b0:578:6378:bc4 with SMTP id 4fb4d7f45d1cf-57863780cb5mr1648138a12.10.1716636850204; Sat, 25 May 2024 04:34:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEjys5jE4uHCVT75JyIvtVeYx9QYYJk8nUMPnvXuQDigc+qX6TM9HDfWGf/xCQrJcsvU3+dag== X-Received: by 2002:a50:9f4b:0:b0:578:6378:bc4 with SMTP id 4fb4d7f45d1cf-57863780cb5mr1648125a12.10.1716636849901; Sat, 25 May 2024 04:34:09 -0700 (PDT) Received: from [192.168.10.116] ([151.95.155.52]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-578523d2507sm3043199a12.40.2024.05.25.04.34.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 04:34:09 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 11/24] target/i386: assert that gen_update_eip_cur and gen_update_eip_next are the same in tb_stop Date: Sat, 25 May 2024 13:33:19 +0200 Message-ID: <20240525113332.1404158-12-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240525113332.1404158-1-pbonzini@redhat.com> References: <20240525113332.1404158-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org This is an invariant now that there are no calls to gen_eob_inhibit_irq() outside tb_stop. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index a7493b5ccfd..fcb7934efa7 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -4798,6 +4798,7 @@ static void i386_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) gen_jmp_rel_csize(dc, 0, 0); break; case DISAS_EOB_NEXT: + assert(dc->base.pc_next == dc->pc); gen_update_eip_cur(dc); /* fall through */ case DISAS_EOB_ONLY: @@ -4807,6 +4808,7 @@ static void i386_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) gen_eob_syscall(dc); break; case DISAS_EOB_INHIBIT_IRQ: + assert(dc->base.pc_next == dc->pc); gen_update_eip_cur(dc); gen_eob_inhibit_irq(dc); break; From patchwork Sat May 25 11:33:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 13673957 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3EF7DC25B78 for ; Sat, 25 May 2024 11:35:41 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sApfL-0002SV-FA; Sat, 25 May 2024 07:34: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 1sApfJ-0002Qy-Bs for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34:21 -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 1sApfG-00046G-Is for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716636856; 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=lPJphoBXA3e7GLva9dPpUH8gCqB6k2MjTgzSB+qrDsA=; b=NpdgcKZPFZRkjqkV6kKbGgOV1jHIe9buk7fFwcDTZ+I5AXIU/z31a7Ghb8uAHCBtkHa7EJ PdNsXl+jlmyNsSL6aUPczW1qQGG+5HTeGtSeMMM2njIQmG5iLXQLILlAPqlumIEOwKusMW U7qwUpprLV2bPlxP4u55v4EKVHMWskE= 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-353-Tyn64myyMPiXjI5kpD4eog-1; Sat, 25 May 2024 07:34:15 -0400 X-MC-Unique: Tyn64myyMPiXjI5kpD4eog-1 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a626ac4cd07so76764266b.3 for ; Sat, 25 May 2024 04:34:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716636853; x=1717241653; 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=lPJphoBXA3e7GLva9dPpUH8gCqB6k2MjTgzSB+qrDsA=; b=XFhiGvMNs+dgLkzMevNT8WPBeEz2QkifbkCG9O7zR83eYRfbauOTsqAeba2XJ/RbC+ 83n14Z7XsfQ+EUjE6ucT86HHkZZDBL+UNJJYmsWX3Ep/S11zcOiQk88HQRzqQcsCYmaC POjAbZGahDZ2K/dDhCeMc95LflwNP73J5dSkiakyFLDoUXXgxmUwccP+kU0pomkJNX1g kiyTX/0SPjqHvBjUPf9GLOP5uRlPwd3ZiTPJp32Gd0/HuqfSsYhxlmmWt5UubGJS/2vp hXY6TtYxu435SAakR2gTd2ar+Wt8j5GnPEB+kazjX7Rt/p/nxhFmOdJcgpoGavLo7C52 ybag== X-Gm-Message-State: AOJu0YxcJvkmFkTiGcByqAWSm3g/7sFhKLY8Qq/jgWqTEicHvZp7qvgX SAWCtjeCXfS/xEnj4SlHckS1u9xFQQ1dsd8CnPoWDtvHXrwi/ctQ6Up+4jcUO9CJiDONOQxXaLx dHhMzzgBb9hU8oRNV/O0VTyUkdmljCqKPY2Qs78scfRWXrnrX+wQPv+pTNNxQvBexzayCo+35m6 1opxR1yNdsu0lFDh/e6B01CPcar6rYavjyMZ8f X-Received: by 2002:a17:907:1059:b0:a59:a0ec:e02d with SMTP id a640c23a62f3a-a62641a3155mr323797366b.8.1716636853560; Sat, 25 May 2024 04:34:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGZK5rkd24c/yYVwFodtWlG+FaWzJp6CCJ+DxKQw5AXVGopxPl8DibbV8qmbVZH1JeFA2EHQA== X-Received: by 2002:a17:907:1059:b0:a59:a0ec:e02d with SMTP id a640c23a62f3a-a62641a3155mr323795166b.8.1716636852837; Sat, 25 May 2024 04:34:12 -0700 (PDT) Received: from [192.168.10.81] ([151.95.155.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a626cda4151sm243056266b.197.2024.05.25.04.34.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 04:34:12 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 12/24] target/i386: raze the gen_eob* jungle Date: Sat, 25 May 2024 13:33:20 +0200 Message-ID: <20240525113332.1404158-13-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240525113332.1404158-1-pbonzini@redhat.com> References: <20240525113332.1404158-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Make gen_eob take the DISAS_* constant as an argument, so that it is not necessary to have wrappers around it. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 62 +++++++++---------------------------- 1 file changed, 15 insertions(+), 47 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index fcb7934efa7..46c452032ba 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -260,8 +260,6 @@ STUB_HELPER(write_crN, TCGv_env env, TCGv_i32 reg, TCGv val) STUB_HELPER(wrmsr, TCGv_env env) #endif -static void gen_eob(DisasContext *s); -static void gen_jr(DisasContext *s); static void gen_jmp_rel(DisasContext *s, MemOp ot, int diff, int tb_num); static void gen_jmp_rel_csize(DisasContext *s, int diff, int tb_num); static void gen_exception_gpf(DisasContext *s); @@ -2266,12 +2264,13 @@ static void gen_bnd_jmp(DisasContext *s) } } -/* Generate an end of block. Trace exception is also generated if needed. - If INHIBIT, set HF_INHIBIT_IRQ_MASK if it isn't already set. - If RECHECK_TF, emit a rechecking helper for #DB, ignoring the state of - S->TF. This is used by the syscall/sysret insns. */ +/* + * Generate an end of block, including common tasks such as generating + * single step traps, resetting the RF flag, and handling the interrupt + * shadow. + */ static void -gen_eob_worker(DisasContext *s, bool inhibit, bool recheck_tf, bool jr) +gen_eob(DisasContext *s, int mode) { bool inhibit_reset; @@ -2282,52 +2281,29 @@ gen_eob_worker(DisasContext *s, bool inhibit, bool recheck_tf, bool jr) if (s->flags & HF_INHIBIT_IRQ_MASK) { gen_reset_hflag(s, HF_INHIBIT_IRQ_MASK); inhibit_reset = true; - } else if (inhibit) { + } else if (mode == DISAS_EOB_INHIBIT_IRQ) { gen_set_hflag(s, HF_INHIBIT_IRQ_MASK); } if (s->base.tb->flags & HF_RF_MASK) { gen_reset_eflags(s, RF_MASK); } - if (recheck_tf) { + if (mode == DISAS_EOB_RECHECK_TF) { gen_helper_rechecking_single_step(tcg_env); tcg_gen_exit_tb(NULL, 0); - } else if ((s->flags & HF_TF_MASK) && !inhibit) { + } else if ((s->flags & HF_TF_MASK) && mode != DISAS_EOB_INHIBIT_IRQ) { gen_helper_single_step(tcg_env); - } else if (jr && + } else if (mode == DISAS_JUMP && /* give irqs a chance to happen */ !inhibit_reset) { tcg_gen_lookup_and_goto_ptr(); } else { tcg_gen_exit_tb(NULL, 0); } + s->base.is_jmp = DISAS_NORETURN; } -static inline void -gen_eob_syscall(DisasContext *s) -{ - gen_eob_worker(s, false, true, false); -} - -/* End of block. Set HF_INHIBIT_IRQ_MASK if it isn't already set. */ -static void gen_eob_inhibit_irq(DisasContext *s) -{ - gen_eob_worker(s, true, false, false); -} - -/* End of block, resetting the inhibit irq flag. */ -static void gen_eob(DisasContext *s) -{ - gen_eob_worker(s, false, false, false); -} - -/* Jump to register */ -static void gen_jr(DisasContext *s) -{ - gen_eob_worker(s, false, false, true); -} - /* Jump to eip+diff, truncating the result to OT. */ static void gen_jmp_rel(DisasContext *s, MemOp ot, int diff, int tb_num) { @@ -2379,9 +2355,9 @@ static void gen_jmp_rel(DisasContext *s, MemOp ot, int diff, int tb_num) tcg_gen_movi_tl(cpu_eip, new_eip); } if (s->jmp_opt) { - gen_jr(s); /* jump to another page */ + gen_eob(s, DISAS_JUMP); /* jump to another page */ } else { - gen_eob(s); /* exit to main loop */ + gen_eob(s, DISAS_EOB_ONLY); /* exit to main loop */ } } } @@ -4798,22 +4774,14 @@ static void i386_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) gen_jmp_rel_csize(dc, 0, 0); break; case DISAS_EOB_NEXT: + case DISAS_EOB_INHIBIT_IRQ: assert(dc->base.pc_next == dc->pc); gen_update_eip_cur(dc); /* fall through */ case DISAS_EOB_ONLY: - gen_eob(dc); - break; case DISAS_EOB_RECHECK_TF: - gen_eob_syscall(dc); - break; - case DISAS_EOB_INHIBIT_IRQ: - assert(dc->base.pc_next == dc->pc); - gen_update_eip_cur(dc); - gen_eob_inhibit_irq(dc); - break; case DISAS_JUMP: - gen_jr(dc); + gen_eob(dc, dc->base.is_jmp); break; default: g_assert_not_reached(); From patchwork Sat May 25 11:33:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 13673972 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C3358C25B78 for ; Sat, 25 May 2024 11:38:33 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sApfL-0002SP-0v; Sat, 25 May 2024 07:34: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 1sApfJ-0002Qx-BX for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34: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 1sApfH-00046b-4f for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716636858; 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=ypmfESkNybagHKfxWS2jwXuxZV2IYRYZI2tTdh7sRrU=; b=ENGfX8m5LtOu0JBoR6VC6vlPW0uC5DWq49YwdEXQWXJ2+ZxdNyzW6G+SffuaZ96caOK6Ns D6BiwUpOydiQPsyDyMmReI8qPcxpl8iCtOxfzVJYOQmXOSP4bR4qAy2+E6ZBwD8f58woV2 V1a9TNkBHia4ptylqtX+Jftf9GNULCg= 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-604-O3E-qFkHNruj6_AkwkOoCg-1; Sat, 25 May 2024 07:34:16 -0400 X-MC-Unique: O3E-qFkHNruj6_AkwkOoCg-1 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-a6269ad7288so81933466b.2 for ; Sat, 25 May 2024 04:34:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716636855; x=1717241655; 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=ypmfESkNybagHKfxWS2jwXuxZV2IYRYZI2tTdh7sRrU=; b=GH8/v/xoRAOciPh+CxHNb1++mOtDWMayqCjRB4BYmFhT1k4SQlYHz5ldfup8cLE4vT wMfqvlOkKPwcYQ40lqEbdQk0y2sh3JIxP2xp7A01+fmDtOQjPaE5JKd3v/a1SAWr6+GB q741w3nBQUAEXRD1vvXyRH3mnTW0iuKtCaHEFuCdbThdeTJcOd33jI4ppmDZw34uX1SE 6eFVv9w17SLUB52Bs4tMmIVcXse5RYVIETtXu9QL/PYRv6V9QOR3Nisg97qLbI/5/or0 SsWT3C2xe+ZzkCsAjeBRhtXBs3pNH0C5/BtTEbYlB7SeEAVO0GIzUGWXHgUWu+LKzMIA HpbQ== X-Gm-Message-State: AOJu0Yz7k0Yk4Er9IbLYdVtEJ08RH++0SvBB88V/Gz5iwD1PnT4KRIuG Hw6QZI5KRxnfJbr+M/AGJ1PpWH71FyTKZI1dkVFagkUWfUqNo2axnx8GAoFZQM6SpzocYFY08NS 6u/JqVV1A+PNUKdplX2IvITV1WG99je8KyB5Iv4L/sRBtvyXiVzlW8crKG/SXaKyjUkWELfQCh3 eSkyxYzwyIn6DUrvymuUaxAQYttx07E5KUg6cA X-Received: by 2002:a17:906:c095:b0:a5a:6bde:c3fb with SMTP id a640c23a62f3a-a62641dff7dmr316425666b.28.1716636855118; Sat, 25 May 2024 04:34:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG7XcY/bbNKtpteL7GX5590WOzqnJ81yb3cYS0PrjgQASneh3K78qZJSGJ4qk4+k3YlGrh78g== X-Received: by 2002:a17:906:c095:b0:a5a:6bde:c3fb with SMTP id a640c23a62f3a-a62641dff7dmr316424466b.28.1716636854662; Sat, 25 May 2024 04:34:14 -0700 (PDT) Received: from [192.168.10.117] ([151.95.155.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a626cc519a2sm241938666b.126.2024.05.25.04.34.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 04:34:14 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 13/24] target/i386: reg in gen_ldst_modrm is always OR_TMP0 Date: Sat, 25 May 2024 13:33:21 +0200 Message-ID: <20240525113332.1404158-14-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240525113332.1404158-1-pbonzini@redhat.com> References: <20240525113332.1404158-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Values other than OR_TMP0 were only ever used by MOV and MOVNTI opcodes. Now that these have been converted to the new decoder, remove the argument. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 46c452032ba..4bb932af16b 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -1828,10 +1828,9 @@ static void gen_add_A0_ds_seg(DisasContext *s) gen_lea_v_seg(s, s->aflag, s->A0, R_DS, s->override); } -/* generate modrm memory load or store of 'reg'. TMP0 is used if reg == - OR_TMP0 */ +/* generate modrm memory load or store of 'reg'. */ static void gen_ldst_modrm(CPUX86State *env, DisasContext *s, int modrm, - MemOp ot, int reg, int is_store) + MemOp ot, int is_store) { int mod, rm; @@ -1839,24 +1838,16 @@ static void gen_ldst_modrm(CPUX86State *env, DisasContext *s, int modrm, rm = (modrm & 7) | REX_B(s); if (mod == 3) { if (is_store) { - if (reg != OR_TMP0) - gen_op_mov_v_reg(s, ot, s->T0, reg); gen_op_mov_reg_v(s, ot, rm, s->T0); } else { gen_op_mov_v_reg(s, ot, s->T0, rm); - if (reg != OR_TMP0) - gen_op_mov_reg_v(s, ot, reg, s->T0); } } else { gen_lea_modrm(env, s, modrm); if (is_store) { - if (reg != OR_TMP0) - gen_op_mov_v_reg(s, ot, s->T0, reg); gen_op_st_v(s, ot, s->T0, s->A0); } else { gen_op_ld_v(s, ot, s->T0, s->A0); - if (reg != OR_TMP0) - gen_op_mov_reg_v(s, ot, reg, s->T0); } } } @@ -3447,7 +3438,7 @@ static void disas_insn_old(DisasContext *s, CPUState *cpu, int b) ot = dflag; modrm = x86_ldub_code(env, s); reg = ((modrm >> 3) & 7) | REX_R(s); - gen_ldst_modrm(env, s, modrm, ot, OR_TMP0, 0); + gen_ldst_modrm(env, s, modrm, ot, 0); gen_extu(ot, s->T0); /* Note that lzcnt and tzcnt are in different extensions. */ @@ -3598,14 +3589,14 @@ static void disas_insn_old(DisasContext *s, CPUState *cpu, int b) tcg_gen_ld32u_tl(s->T0, tcg_env, offsetof(CPUX86State, ldt.selector)); ot = mod == 3 ? dflag : MO_16; - gen_ldst_modrm(env, s, modrm, ot, OR_TMP0, 1); + gen_ldst_modrm(env, s, modrm, ot, 1); 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_ldst_modrm(env, s, modrm, MO_16, OR_TMP0, 0); + gen_ldst_modrm(env, s, modrm, MO_16, 0); tcg_gen_trunc_tl_i32(s->tmp2_i32, s->T0); gen_helper_lldt(tcg_env, s->tmp2_i32); } @@ -3620,14 +3611,14 @@ static void disas_insn_old(DisasContext *s, CPUState *cpu, int b) tcg_gen_ld32u_tl(s->T0, tcg_env, offsetof(CPUX86State, tr.selector)); ot = mod == 3 ? dflag : MO_16; - gen_ldst_modrm(env, s, modrm, ot, OR_TMP0, 1); + gen_ldst_modrm(env, s, modrm, ot, 1); 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_ldst_modrm(env, s, modrm, MO_16, OR_TMP0, 0); + gen_ldst_modrm(env, s, modrm, MO_16, 0); tcg_gen_trunc_tl_i32(s->tmp2_i32, s->T0); gen_helper_ltr(tcg_env, s->tmp2_i32); } @@ -3636,7 +3627,7 @@ static void disas_insn_old(DisasContext *s, CPUState *cpu, int b) case 5: /* verw */ if (!PE(s) || VM86(s)) goto illegal_op; - gen_ldst_modrm(env, s, modrm, MO_16, OR_TMP0, 0); + gen_ldst_modrm(env, s, modrm, MO_16, 0); gen_update_cc_op(s); if (op == 4) { gen_helper_verr(tcg_env, s->T0); @@ -3900,7 +3891,7 @@ static void disas_insn_old(DisasContext *s, CPUState *cpu, int b) */ mod = (modrm >> 6) & 3; ot = (mod != 3 ? MO_16 : s->dflag); - gen_ldst_modrm(env, s, modrm, ot, OR_TMP0, 1); + gen_ldst_modrm(env, s, modrm, ot, 1); break; case 0xee: /* rdpkru */ if (s->prefix & (PREFIX_LOCK | PREFIX_DATA @@ -3927,7 +3918,7 @@ static void disas_insn_old(DisasContext *s, CPUState *cpu, int b) break; } gen_svm_check_intercept(s, SVM_EXIT_WRITE_CR0); - gen_ldst_modrm(env, s, modrm, MO_16, OR_TMP0, 0); + gen_ldst_modrm(env, s, modrm, MO_16, 0); /* * Only the 4 lower bits of CR0 are modified. * PE cannot be set to zero if already set to one. @@ -3999,7 +3990,7 @@ static void disas_insn_old(DisasContext *s, CPUState *cpu, int b) ot = dflag != MO_16 ? MO_32 : MO_16; modrm = x86_ldub_code(env, s); reg = ((modrm >> 3) & 7) | REX_R(s); - gen_ldst_modrm(env, s, modrm, MO_16, OR_TMP0, 0); + gen_ldst_modrm(env, s, modrm, MO_16, 0); t0 = tcg_temp_new(); gen_update_cc_op(s); if (b == 0x102) { @@ -4503,7 +4494,7 @@ static void disas_insn_old(DisasContext *s, CPUState *cpu, int b) reg = ((modrm >> 3) & 7) | REX_R(s); ot = dflag; - gen_ldst_modrm(env, s, modrm, ot, OR_TMP0, 0); + gen_ldst_modrm(env, s, modrm, ot, 0); gen_extu(ot, s->T0); tcg_gen_mov_tl(cpu_cc_src, s->T0); tcg_gen_ctpop_tl(s->T0, s->T0); From patchwork Sat May 25 11:33:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 13673966 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D17CEC25B78 for ; Sat, 25 May 2024 11:37:26 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sApfN-0002Ty-BN; Sat, 25 May 2024 07:34:25 -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 1sApfM-0002Tb-6b for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34:24 -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 1sApfK-00047S-FO for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716636861; 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=WBkZJsxUjQCschxBUdmlajywVV3FGiU9N2lB0Rg7DLg=; b=bnwAtSFMjwMk7aFXYuLepmB18kZukHg9cwj7leRsAZYZbFlzyxCx48hbcccg2oe8u3e8DH atuMJGinlPStT7B6d8c49rEIz//HsBdIIEVeJix4+E/yGbXgU6m6p2r3ppUMgo2yyrL8R/ oP5z6piIxervCk/crZoxm+ZoBOZSBXM= 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-681-pO_kd6EIO4qoukvizMEkpg-1; Sat, 25 May 2024 07:34:19 -0400 X-MC-Unique: pO_kd6EIO4qoukvizMEkpg-1 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a592c35ac06so416390766b.0 for ; Sat, 25 May 2024 04:34:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716636858; x=1717241658; 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=WBkZJsxUjQCschxBUdmlajywVV3FGiU9N2lB0Rg7DLg=; b=aT30wqtdIhhWydWFzE4YJnqU3qcDQgdPBYMhUCU/gDIy510BF/uuuQwOVmhz718wJL DFOMEX6XxKx2AdpV+VyhKCn/INcHhefS4SMyhdpgG60nGVI9wxgtBnGVzvQnAGi68H94 NETLITp1fEZ09NAkbCzELejNrPGh8zEpXh13wCSkk+6B44RG3sqDFxcmzbp1PdbAXyI2 APN1JFr49YdVYPaWReMXUhKzXR+xW5At3QluOXQMTv/zdgPEpYKqCd1IJ0esWbzdLAt0 5hkkJWOkxtYcGYJ099N/8bAWkCFpcws6pPr/hu0WJYYT56cqvuwpl7DKqU9xA7MaDH6c 0+Yw== X-Gm-Message-State: AOJu0YxINXFS5pCrZb0TESevwsUYxggMccHWaC+0aW2DFTHKqlif9kFP vGrMMgReq9Kme+u/14ojsuBC3dUG7d180FLb4q5vtIxNqJZfsDDMvNqGwVVxC10D1KkGPQVrMuK LKUtDGhmmd2QmrzW38XOj/t1JsnDOiiHiNdIQLKl9NXi76SF/ayrocF2tEGdH8gK9aksXTdTkbV t/676MC+vgQewISfsh+7spGDQpNWBHV7h5SHtU X-Received: by 2002:a17:906:358e:b0:a62:49ae:cd7b with SMTP id a640c23a62f3a-a626250ddcemr409072366b.24.1716636858057; Sat, 25 May 2024 04:34:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHoVMOEa2tJTmt491sGj8Dq8796mfUUUspdsRPxOvshBpj8lfXpnVHKQJWrbxRRIaw09SEzwQ== X-Received: by 2002:a17:906:358e:b0:a62:49ae:cd7b with SMTP id a640c23a62f3a-a626250ddcemr409071366b.24.1716636857594; Sat, 25 May 2024 04:34:17 -0700 (PDT) Received: from [192.168.10.117] ([151.95.155.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a626cc8c27bsm244459166b.156.2024.05.25.04.34.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 04:34:17 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 14/24] target/i386: split gen_ldst_modrm for load and store Date: Sat, 25 May 2024 13:33:22 +0200 Message-ID: <20240525113332.1404158-15-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240525113332.1404158-1-pbonzini@redhat.com> References: <20240525113332.1404158-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org The is_store argument of gen_ldst_modrm has only ever been passed a constant. Just split the function in two. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 52 +++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 4bb932af16b..afbed87056a 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -1828,27 +1828,33 @@ static void gen_add_A0_ds_seg(DisasContext *s) gen_lea_v_seg(s, s->aflag, s->A0, R_DS, s->override); } -/* generate modrm memory load or store of 'reg'. */ -static void gen_ldst_modrm(CPUX86State *env, DisasContext *s, int modrm, - MemOp ot, int is_store) +/* generate modrm load of memory or register. */ +static void gen_ld_modrm(CPUX86State *env, DisasContext *s, int modrm, MemOp ot) { int mod, rm; mod = (modrm >> 6) & 3; rm = (modrm & 7) | REX_B(s); if (mod == 3) { - if (is_store) { - gen_op_mov_reg_v(s, ot, rm, s->T0); - } else { - gen_op_mov_v_reg(s, ot, s->T0, rm); - } + gen_op_mov_v_reg(s, ot, s->T0, rm); } else { gen_lea_modrm(env, s, modrm); - if (is_store) { - gen_op_st_v(s, ot, s->T0, s->A0); - } else { - gen_op_ld_v(s, ot, s->T0, s->A0); - } + gen_op_ld_v(s, ot, s->T0, s->A0); + } +} + +/* generate modrm store of memory or register. */ +static void gen_st_modrm(CPUX86State *env, DisasContext *s, int modrm, MemOp ot) +{ + int mod, rm; + + mod = (modrm >> 6) & 3; + rm = (modrm & 7) | REX_B(s); + if (mod == 3) { + gen_op_mov_reg_v(s, ot, rm, s->T0); + } else { + gen_lea_modrm(env, s, modrm); + gen_op_st_v(s, ot, s->T0, s->A0); } } @@ -3438,7 +3444,7 @@ static void disas_insn_old(DisasContext *s, CPUState *cpu, int b) ot = dflag; modrm = x86_ldub_code(env, s); reg = ((modrm >> 3) & 7) | REX_R(s); - gen_ldst_modrm(env, s, modrm, ot, 0); + gen_ld_modrm(env, s, modrm, ot); gen_extu(ot, s->T0); /* Note that lzcnt and tzcnt are in different extensions. */ @@ -3589,14 +3595,14 @@ static void disas_insn_old(DisasContext *s, CPUState *cpu, int b) tcg_gen_ld32u_tl(s->T0, tcg_env, offsetof(CPUX86State, ldt.selector)); ot = mod == 3 ? dflag : MO_16; - gen_ldst_modrm(env, s, modrm, ot, 1); + gen_st_modrm(env, s, modrm, 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_ldst_modrm(env, s, modrm, MO_16, 0); + gen_ld_modrm(env, s, modrm, MO_16); tcg_gen_trunc_tl_i32(s->tmp2_i32, s->T0); gen_helper_lldt(tcg_env, s->tmp2_i32); } @@ -3611,14 +3617,14 @@ static void disas_insn_old(DisasContext *s, CPUState *cpu, int b) tcg_gen_ld32u_tl(s->T0, tcg_env, offsetof(CPUX86State, tr.selector)); ot = mod == 3 ? dflag : MO_16; - gen_ldst_modrm(env, s, modrm, ot, 1); + gen_st_modrm(env, s, modrm, 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_ldst_modrm(env, s, modrm, MO_16, 0); + gen_ld_modrm(env, s, modrm, MO_16); tcg_gen_trunc_tl_i32(s->tmp2_i32, s->T0); gen_helper_ltr(tcg_env, s->tmp2_i32); } @@ -3627,7 +3633,7 @@ static void disas_insn_old(DisasContext *s, CPUState *cpu, int b) case 5: /* verw */ if (!PE(s) || VM86(s)) goto illegal_op; - gen_ldst_modrm(env, s, modrm, MO_16, 0); + gen_ld_modrm(env, s, modrm, MO_16); gen_update_cc_op(s); if (op == 4) { gen_helper_verr(tcg_env, s->T0); @@ -3891,7 +3897,7 @@ static void disas_insn_old(DisasContext *s, CPUState *cpu, int b) */ mod = (modrm >> 6) & 3; ot = (mod != 3 ? MO_16 : s->dflag); - gen_ldst_modrm(env, s, modrm, ot, 1); + gen_st_modrm(env, s, modrm, ot); break; case 0xee: /* rdpkru */ if (s->prefix & (PREFIX_LOCK | PREFIX_DATA @@ -3918,7 +3924,7 @@ static void disas_insn_old(DisasContext *s, CPUState *cpu, int b) break; } gen_svm_check_intercept(s, SVM_EXIT_WRITE_CR0); - gen_ldst_modrm(env, s, modrm, MO_16, 0); + gen_ld_modrm(env, s, modrm, MO_16); /* * Only the 4 lower bits of CR0 are modified. * PE cannot be set to zero if already set to one. @@ -3990,7 +3996,7 @@ static void disas_insn_old(DisasContext *s, CPUState *cpu, int b) ot = dflag != MO_16 ? MO_32 : MO_16; modrm = x86_ldub_code(env, s); reg = ((modrm >> 3) & 7) | REX_R(s); - gen_ldst_modrm(env, s, modrm, MO_16, 0); + gen_ld_modrm(env, s, modrm, MO_16); t0 = tcg_temp_new(); gen_update_cc_op(s); if (b == 0x102) { @@ -4494,7 +4500,7 @@ static void disas_insn_old(DisasContext *s, CPUState *cpu, int b) reg = ((modrm >> 3) & 7) | REX_R(s); ot = dflag; - gen_ldst_modrm(env, s, modrm, ot, 0); + gen_ld_modrm(env, s, modrm, ot); gen_extu(ot, s->T0); tcg_gen_mov_tl(cpu_cc_src, s->T0); tcg_gen_ctpop_tl(s->T0, s->T0); From patchwork Sat May 25 11:33:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 13673951 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 338CEC25B78 for ; Sat, 25 May 2024 11:35:06 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sApfS-0002gO-Jw; Sat, 25 May 2024 07:34: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 1sApfR-0002c7-4u for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34:29 -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 1sApfO-000486-CH for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716636864; 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=nmao0q6LQviEK0BFtAjWWlLJmjAOM3Vqxn/I8hAl6HE=; b=PTJkCo3skG78V3xnGkbyVaLaAaN3edGCYuqqr83obzXQiwQdi6qf5Nn4cBHCeY6F9wBo4C 70zCwolH/J49cWo+uTvP7q9OXu8BIgVIQRMZsPRbm+utAtkbyR7fSDpP0xFwj3OFU6IhfC 4t6GdUm1P5yegXd8I1pN1aD4QPcXpSE= 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-42-SwVb5jBHNvS4qNFXS2m_UA-1; Sat, 25 May 2024 07:34:23 -0400 X-MC-Unique: SwVb5jBHNvS4qNFXS2m_UA-1 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-a62684ef298so84186866b.3 for ; Sat, 25 May 2024 04:34:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716636861; x=1717241661; 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=nmao0q6LQviEK0BFtAjWWlLJmjAOM3Vqxn/I8hAl6HE=; b=IA8fxghFs5qvKR2+yTpabT98UrXWBAge3JSa/nUeX7DI/A2JwjOedKyh2t7rkViMco 1B3iyVFHLfSYatpMifV9bs86PdGveGxsvhLnWtHLlFWSSocCk8e27VTuc3yp6slAerED 7xhIGEsSiJ+kyLqccIP13Yn+/FJYmOVoYj3mbGG0/Y8WGKI7dsNQOuzYN9EjgiD+SkZd EHHAxF0YcjWJurB2a4QkX7i17SwM9p8q1YT6/JlB1xhbLqeXcTTDHBgE4lxJv4HZBxEH +4QzfqN+4Vg8avFq3jZnoqL3dQb89cwInqY2QRoC3um+S1/MFRfw4Q4aLlcbnaohjHGA vAig== X-Gm-Message-State: AOJu0YygAiCs1I+tqfRVouECDZhxl3ZsIgSHZcUKcDXURUChJJy1QgAJ 3LeI7r8x13cgfqMztgnRMxRak9bsw9RYMuj4cGpuoynV2lUqz5LrhXs3mZ4bckGRW9L8DURWH2f LcUferQN2YaieL39wpTDeJJXiBIbQ+OE2vF4zoD5GSJvHQjBJG4cjeMouxYMnqsozsMfrP8HvRM SeV1zjECaUd0uUDNBO+qfXDVkRczxYu09DwyI1 X-Received: by 2002:a17:906:e0d3:b0:a59:c3d0:5507 with SMTP id a640c23a62f3a-a62641e0007mr342267966b.26.1716636861009; Sat, 25 May 2024 04:34:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEDufGisi6e11h2/mVdeifjaAz7COTCLaWAes9rQzy3DGqdlV+GARCgW3ABBPAlFMkiMw8DyA== X-Received: by 2002:a17:906:e0d3:b0:a59:c3d0:5507 with SMTP id a640c23a62f3a-a62641e0007mr342266766b.26.1716636860532; Sat, 25 May 2024 04:34:20 -0700 (PDT) Received: from [192.168.10.117] ([151.95.155.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a626cc8e2b2sm245545666b.171.2024.05.25.04.34.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 04:34:18 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 15/24] target/i386: inline gen_add_A0_ds_seg Date: Sat, 25 May 2024 13:33:23 +0200 Message-ID: <20240525113332.1404158-16-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240525113332.1404158-1-pbonzini@redhat.com> References: <20240525113332.1404158-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org It is only used in MONITOR, where a direct call of gen_lea_v_seg is simpler, and in XLAT. Inline it in the latter. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 9 +-------- target/i386/tcg/emit.c.inc | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index afbed87056a..2039ccf283a 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -1822,12 +1822,6 @@ static void gen_bndck(CPUX86State *env, DisasContext *s, int modrm, gen_helper_bndck(tcg_env, s->tmp2_i32); } -/* used for LEA and MOV AX, mem */ -static void gen_add_A0_ds_seg(DisasContext *s) -{ - gen_lea_v_seg(s, s->aflag, s->A0, R_DS, s->override); -} - /* generate modrm load of memory or register. */ static void gen_ld_modrm(CPUX86State *env, DisasContext *s, int modrm, MemOp ot) { @@ -3674,8 +3668,7 @@ static void disas_insn_old(DisasContext *s, CPUState *cpu, int b) } gen_update_cc_op(s); gen_update_eip_cur(s); - tcg_gen_mov_tl(s->A0, cpu_regs[R_EAX]); - gen_add_A0_ds_seg(s); + gen_lea_v_seg(s, s->aflag, cpu_regs[R_EAX], R_DS, s->override); gen_helper_monitor(tcg_env, s->A0); break; diff --git a/target/i386/tcg/emit.c.inc b/target/i386/tcg/emit.c.inc index 88bcb9699c3..01ad57629e4 100644 --- a/target/i386/tcg/emit.c.inc +++ b/target/i386/tcg/emit.c.inc @@ -4043,7 +4043,7 @@ static void gen_XLAT(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode) { /* AL is already zero-extended into s->T0. */ tcg_gen_add_tl(s->A0, cpu_regs[R_EBX], s->T0); - gen_add_A0_ds_seg(s); + gen_lea_v_seg(s, s->aflag, s->A0, R_DS, s->override); gen_op_ld_v(s, MO_8, s->T0, s->A0); } From patchwork Sat May 25 11:33:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 13673958 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 30155C25B7C for ; Sat, 25 May 2024 11:35:43 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sApfU-0002jL-5D; Sat, 25 May 2024 07:34: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 1sApfR-0002c9-9s for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34:29 -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 1sApfP-00048O-HQ for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716636866; 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=It018iaxeGCuxdfv9rBK6rIbGhk5sPnz7MmsFCaZFeM=; b=iLvV61gutHHdC5JZzzxxdZ2kTr6beX5fd375lkjPT8Gd55dglYQKr/d9lOnVntLschLuih HIyZzYSTcm/TqZYyHRRIBlWrtmlgUiGC6bOcIwy1+2VAQF2ZWuM3WVNVc5/NGqwV7+ey33 ukDKbKAoQ4XLaN3rTpI0vWgmKD5lDdI= 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-652-KBTmR73-P36L8HN-7srY4g-1; Sat, 25 May 2024 07:34:25 -0400 X-MC-Unique: KBTmR73-P36L8HN-7srY4g-1 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a6266ffe72eso80921066b.1 for ; Sat, 25 May 2024 04:34:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716636864; x=1717241664; 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=It018iaxeGCuxdfv9rBK6rIbGhk5sPnz7MmsFCaZFeM=; b=EFNBftdl36SzujqVO23Z83/Lb/QGwp2G35qXXlUbQDeQ8E7GiypOEOsloVnX3aKwwh +PmNenRoLsuNLHA/kRT7uNLMzGcL53/uZs9Y/xJimQwW8TA01iiQsxjAynb7/zDdOi4A deaYMG65KO13mKG0QpEuDAdIyBbFw+kEGSH64xzZe5ojxzguWbxkbcNHCqcoyymhEc+l Pe24rPNbX6tcW4utN3Gg14dzE9XgsBm9yfK0m+BWc3/PgzFsa3avSfL7LWjtYw/+G5O+ bNPIx2qJzvjNAJA2f75+9emEeCBJYreZBQxXRzSKvS8UPgQFQA7NKCzOXekhLE5VkmyG 4qWQ== X-Gm-Message-State: AOJu0Yz+mvj3PJMTi/arqN9DiY8DF5/dcBsC45Yo6y0tvD1+tkTLCVd5 ol3S37D2uvHCF5TYtzkLFhCGMg/mk6XVLGFJEoJDMpsYy92v+bZ0jma0Kc64u0WcVw2Raua4mrh MN2Q3LpxAqgJ/Ohaihpzr+Fx3iEStQ78l/5yKlY8KuI3H3P73nO2kuMAaijfWWEBMD+eCWXe2D2 tJIwiBQLdv8Bs2VmJL8MrsW7Dtqz+5PGIqUkeU X-Received: by 2002:a17:906:39cf:b0:a5c:f73d:67b3 with SMTP id a640c23a62f3a-a6265010976mr329838766b.63.1716636863802; Sat, 25 May 2024 04:34:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHEX3rYQ+UkgMBwvNr1Rw67yoPlsF/6n+a4vX599PNJAKjKa9w660dQNvdi935R6vhvSnsKwg== X-Received: by 2002:a17:906:39cf:b0:a5c:f73d:67b3 with SMTP id a640c23a62f3a-a6265010976mr329836866b.63.1716636863340; Sat, 25 May 2024 04:34:23 -0700 (PDT) Received: from [192.168.10.117] ([151.95.155.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a626c9376edsm243631266b.59.2024.05.25.04.34.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 04:34:22 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 16/24] target/i386: use mo_stacksize more Date: Sat, 25 May 2024 13:33:24 +0200 Message-ID: <20240525113332.1404158-17-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240525113332.1404158-1-pbonzini@redhat.com> References: <20240525113332.1404158-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Use mo_stacksize for all stack accesses, including when a 64-bit code segment is impossible and the code is therefore checking only for SS32(s). Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 2039ccf283a..2a20f9bafbb 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -2075,12 +2075,12 @@ static inline void gen_pop_update(DisasContext *s, MemOp ot) static inline void gen_stack_A0(DisasContext *s) { - gen_lea_v_seg(s, SS32(s) ? MO_32 : MO_16, cpu_regs[R_ESP], R_SS, -1); + gen_lea_v_seg(s, mo_stacksize(s), cpu_regs[R_ESP], R_SS, -1); } static void gen_pusha(DisasContext *s) { - MemOp s_ot = SS32(s) ? MO_32 : MO_16; + MemOp s_ot = mo_stacksize(s); MemOp d_ot = s->dflag; int size = 1 << d_ot; int i; @@ -2096,7 +2096,7 @@ static void gen_pusha(DisasContext *s) static void gen_popa(DisasContext *s) { - MemOp s_ot = SS32(s) ? MO_32 : MO_16; + MemOp s_ot = mo_stacksize(s); MemOp d_ot = s->dflag; int size = 1 << d_ot; int i; @@ -2118,7 +2118,7 @@ static void gen_popa(DisasContext *s) static void gen_enter(DisasContext *s, int esp_addend, int level) { MemOp d_ot = mo_pushpop(s, s->dflag); - MemOp a_ot = CODE64(s) ? MO_64 : SS32(s) ? MO_32 : MO_16; + MemOp a_ot = mo_stacksize(s); int size = 1 << d_ot; /* Push BP; compute FrameTemp into T1. */ From patchwork Sat May 25 11:33:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 13673969 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B39F5C25B78 for ; Sat, 25 May 2024 11:37:45 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sApfg-0003P0-BR; Sat, 25 May 2024 07:34:44 -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 1sApfe-0003O3-VX for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34: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 1sApfU-00049R-CI for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716636870; 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=UnQ8XaXrLzcSQsikYbP5n1x5Mt965H3dqhhEnw6Bkp0=; b=Sx6hDHSiL8/KXUMqDU0lN5aMxOmciiJeKKgjCNAkxfadW0rcd8LCdLQJLNflLJsG3f4O9a P5W0BjcTjoSMtI+X+66kD0/fp+gFDOECg5n7eONZ/KrxlEmrlRd8wrAdfX9Vui/u+dQKSN 1hfMFDq+V0V0uNhPVvDyfPysWGJPty0= 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-646-PkEY-N03OwateNCqJXrBQw-1; Sat, 25 May 2024 07:34:29 -0400 X-MC-Unique: PkEY-N03OwateNCqJXrBQw-1 Received: by mail-lj1-f200.google.com with SMTP id 38308e7fff4ca-2e95ad38ad1so14782161fa.3 for ; Sat, 25 May 2024 04:34:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716636867; x=1717241667; 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=UnQ8XaXrLzcSQsikYbP5n1x5Mt965H3dqhhEnw6Bkp0=; b=m1QPaHD/3l9Ai9Kdo3wTDUQbLr8y6WzyFr7RLjFTqjGhsk6MxvKaiLFg4yCN56s9bU pZ+W5nMgL4lRBnfTekRYCqIXmZ2Lv7OlHfqpWXUbOyNJuwmzUHXOio+nsgJBYiWduDcR B7KAauGDJsHHsKg1LapyA38lm4/esBpQM3+RUZP12HKvyxYssZAfGHOw64/A/iRf+xZk lh1P34LqzjAZj9mZnU0EgEqsQwDH/pO1mNVbv5fPJVmRMz4xFYFDoHrRA+/aKJ7cRs7g KfIkVq62vjodOhYwoJDelUKWxm/Ho/nMdTA52f/zipVgT2zNfKhCOd3A5+zBNSgIJkBn 4LPA== X-Gm-Message-State: AOJu0YxknomiKVwoaegMwR6UC4CxLVnIHvl0+sFuBxBLIojxaSaqIT7/ k25ztQP45LDZP7XAi4nhIv9RdYjX3SBc0dd+HqrSIvwXSQyw9J7hlSw/2oo4y4HeINR3OzXJCQC WoN1mmsZuthN8GraSS5cJR0+L6/F+8NJATFxMP8UXsznelsmQYRjZBurialWbekRaWg+F+fPqtZ kLyYYZbQPl5LdGDMNlZqTWd5YU2Zc2eyh8wk+X X-Received: by 2002:a05:651c:2222:b0:2de:ca7f:c849 with SMTP id 38308e7fff4ca-2e95b279514mr44795671fa.43.1716636866736; Sat, 25 May 2024 04:34:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEFMgxgqCuK/qIRDRXRM0xm9/2a+3H1SszWZnAkX/TX3+bnmrwFpiUvx9q5dcSxgBVwAp0Fiw== X-Received: by 2002:a05:651c:2222:b0:2de:ca7f:c849 with SMTP id 38308e7fff4ca-2e95b279514mr44795501fa.43.1716636866233; Sat, 25 May 2024 04:34:26 -0700 (PDT) Received: from [192.168.10.117] ([151.95.155.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a626c93a812sm246492166b.50.2024.05.25.04.34.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 04:34:25 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 17/24] target/i386: introduce gen_lea_ss_ofs Date: Sat, 25 May 2024 13:33:25 +0200 Message-ID: <20240525113332.1404158-18-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240525113332.1404158-1-pbonzini@redhat.com> References: <20240525113332.1404158-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Generalize gen_stack_A0() to include an initial add and to use an arbitrary destination. This is a common pattern and it is not a huge burden to add the extra arguments to the only caller of gen_stack_A0(). Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 51 +++++++++++++++---------------------- target/i386/tcg/emit.c.inc | 2 +- 2 files changed, 22 insertions(+), 31 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 2a20f9bafbb..15993f83024 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -2035,24 +2035,27 @@ static inline void gen_stack_update(DisasContext *s, int addend) gen_op_add_reg_im(s, mo_stacksize(s), R_ESP, addend); } +static void gen_lea_ss_ofs(DisasContext *s, TCGv dest, TCGv src, target_ulong offset) +{ + if (offset) { + tcg_gen_addi_tl(dest, src, offset); + src = dest; + } + gen_lea_v_seg_dest(s, mo_stacksize(s), dest, src, R_SS, -1); +} + /* Generate a push. It depends on ss32, addseg and dflag. */ static void gen_push_v(DisasContext *s, TCGv val) { MemOp d_ot = mo_pushpop(s, s->dflag); MemOp a_ot = mo_stacksize(s); int size = 1 << d_ot; - TCGv new_esp = s->A0; + TCGv new_esp = tcg_temp_new(); - tcg_gen_subi_tl(s->A0, cpu_regs[R_ESP], size); - - if (!CODE64(s)) { - if (ADDSEG(s)) { - new_esp = tcg_temp_new(); - tcg_gen_mov_tl(new_esp, s->A0); - } - gen_lea_v_seg(s, a_ot, s->A0, R_SS, -1); - } + tcg_gen_subi_tl(new_esp, cpu_regs[R_ESP], size); + /* Now reduce the value to the address size and apply SS base. */ + gen_lea_ss_ofs(s, s->A0, new_esp, 0); gen_op_st_v(s, d_ot, val, s->A0); gen_op_mov_reg_v(s, a_ot, R_ESP, new_esp); } @@ -2062,7 +2065,7 @@ static MemOp gen_pop_T0(DisasContext *s) { MemOp d_ot = mo_pushpop(s, s->dflag); - gen_lea_v_seg_dest(s, mo_stacksize(s), s->T0, cpu_regs[R_ESP], R_SS, -1); + gen_lea_ss_ofs(s, s->T0, cpu_regs[R_ESP], 0); gen_op_ld_v(s, d_ot, s->T0, s->T0); return d_ot; @@ -2073,21 +2076,14 @@ static inline void gen_pop_update(DisasContext *s, MemOp ot) gen_stack_update(s, 1 << ot); } -static inline void gen_stack_A0(DisasContext *s) -{ - gen_lea_v_seg(s, mo_stacksize(s), cpu_regs[R_ESP], R_SS, -1); -} - static void gen_pusha(DisasContext *s) { - MemOp s_ot = mo_stacksize(s); MemOp d_ot = s->dflag; int size = 1 << d_ot; int i; for (i = 0; i < 8; i++) { - tcg_gen_addi_tl(s->A0, cpu_regs[R_ESP], (i - 8) * size); - gen_lea_v_seg(s, s_ot, s->A0, R_SS, -1); + gen_lea_ss_ofs(s, s->A0, cpu_regs[R_ESP], (i - 8) * size); gen_op_st_v(s, d_ot, cpu_regs[7 - i], s->A0); } @@ -2096,7 +2092,6 @@ static void gen_pusha(DisasContext *s) static void gen_popa(DisasContext *s) { - MemOp s_ot = mo_stacksize(s); MemOp d_ot = s->dflag; int size = 1 << d_ot; int i; @@ -2106,8 +2101,7 @@ static void gen_popa(DisasContext *s) if (7 - i == R_ESP) { continue; } - tcg_gen_addi_tl(s->A0, cpu_regs[R_ESP], i * size); - gen_lea_v_seg(s, s_ot, s->A0, R_SS, -1); + gen_lea_ss_ofs(s, s->A0, cpu_regs[R_ESP], i * size); gen_op_ld_v(s, d_ot, s->T0, s->A0); gen_op_mov_reg_v(s, d_ot, 7 - i, s->T0); } @@ -2123,7 +2117,7 @@ static void gen_enter(DisasContext *s, int esp_addend, int level) /* Push BP; compute FrameTemp into T1. */ tcg_gen_subi_tl(s->T1, cpu_regs[R_ESP], size); - gen_lea_v_seg(s, a_ot, s->T1, R_SS, -1); + gen_lea_ss_ofs(s, s->A0, s->T1, 0); gen_op_st_v(s, d_ot, cpu_regs[R_EBP], s->A0); level &= 31; @@ -2132,18 +2126,15 @@ static void gen_enter(DisasContext *s, int esp_addend, int level) /* Copy level-1 pointers from the previous frame. */ for (i = 1; i < level; ++i) { - tcg_gen_subi_tl(s->A0, cpu_regs[R_EBP], size * i); - gen_lea_v_seg(s, a_ot, s->A0, R_SS, -1); + gen_lea_ss_ofs(s, s->A0, cpu_regs[R_EBP], -size * i); gen_op_ld_v(s, d_ot, s->tmp0, s->A0); - tcg_gen_subi_tl(s->A0, s->T1, size * i); - gen_lea_v_seg(s, a_ot, s->A0, R_SS, -1); + gen_lea_ss_ofs(s, s->A0, s->T1, -size * i); gen_op_st_v(s, d_ot, s->tmp0, s->A0); } /* Push the current FrameTemp as the last level. */ - tcg_gen_subi_tl(s->A0, s->T1, size * level); - gen_lea_v_seg(s, a_ot, s->A0, R_SS, -1); + gen_lea_ss_ofs(s, s->A0, s->T1, -size * level); gen_op_st_v(s, d_ot, s->T1, s->A0); } @@ -2160,7 +2151,7 @@ static void gen_leave(DisasContext *s) MemOp d_ot = mo_pushpop(s, s->dflag); MemOp a_ot = mo_stacksize(s); - gen_lea_v_seg(s, a_ot, cpu_regs[R_EBP], R_SS, -1); + gen_lea_ss_ofs(s, s->A0, cpu_regs[R_EBP], 0); gen_op_ld_v(s, d_ot, s->T0, s->A0); tcg_gen_addi_tl(s->T1, cpu_regs[R_EBP], 1 << d_ot); diff --git a/target/i386/tcg/emit.c.inc b/target/i386/tcg/emit.c.inc index 01ad57629e4..0a13be4989a 100644 --- a/target/i386/tcg/emit.c.inc +++ b/target/i386/tcg/emit.c.inc @@ -3077,7 +3077,7 @@ static void gen_RETF(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode) int16_t adjust = decode->e.op2 == X86_TYPE_I ? decode->immediate : 0; if (!PE(s) || VM86(s)) { - gen_stack_A0(s); + gen_lea_ss_ofs(s, s->A0, cpu_regs[R_ESP], 0); /* pop offset */ gen_op_ld_v(s, s->dflag, s->T0, s->A0); /* NOTE: keeping EIP updated is not a problem in case of From patchwork Sat May 25 11:33:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 13673960 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0F310C25B78 for ; Sat, 25 May 2024 11:36:04 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sApfZ-00038A-8F; Sat, 25 May 2024 07:34:38 -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 1sApfX-0002ye-9y for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34:35 -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 1sApfV-00049p-LC for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716636872; 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=c6zwylRhfgSaIYxfMePasb6a88uh2JdmZkISP91K2CU=; b=MUodaaAGfzM00Yk5DUL+/cSLPYxjZ3lgYsX1/ap4LaeyCMbltVDa97lGyn/0HAaXAaNPvw nzZVlgR02D4f8LZI/eqPnoa3s14H9BahN3ykM/J9srv9XWGMxYDYBZ4Buq+WAG/S7khkg5 sTAKToIQT1KbeUwl59TA+JXFuE5pEKI= 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-427-vdcIuTWVMNC9g_I1ftdwkA-1; Sat, 25 May 2024 07:34:31 -0400 X-MC-Unique: vdcIuTWVMNC9g_I1ftdwkA-1 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-a6266ffdb45so87188366b.1 for ; Sat, 25 May 2024 04:34:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716636869; x=1717241669; 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=c6zwylRhfgSaIYxfMePasb6a88uh2JdmZkISP91K2CU=; b=L7ceKXx8F+wRjjRTZ3e/25ADd+JnRx1GwQ4t6cEk0ARKQ4BiudBZ8i4cdklN1puRow YQPE9T8ii3KjQ5Ag5Op39LoroZMxzjr4zGSJfJ4Jc27O31XchYmXF/pyTKwX0c77jIb2 bHq6729e7rqe2Eh2z32g+hVgClITisfvqu1AC15NCOOu3n+6QwEuYU73ue9CaPmUkDVK x1E8mZ9dW96XOEeNc228jYqoaR6Q1x5rHhnP6sbJ7lUrDZM5XAgF7o53ROJTlC8QyUg5 qoUGBJjI3XFAItVdBy4XE4wF4QP3EkmjrEnBOVeYSClOFVgrqBBe21YJiO9fWm5IfJNR tm8Q== X-Gm-Message-State: AOJu0YzL0e8rnMvhNu6xtCuJQKh2j4uxHe/9/ZBdWUYDf/nDH9WxHbz5 dq2qYAB2Cjjn8oEZHWiwFTHIn/GOVNlDwk6Tb5Uarh/xHjSBZrfniZsO1hdjpLxCw/mxhEES8uc 7HAWi3qUoxwC07B9Lzh60L6IQKq26HAVjrLMY22N3qyywg2qiCIXUHRxfvs6rvh5o0tz0xhMrS5 TbJ6jAaJHn2Z5mxRqsq6+n3JAIoK6cWm7dXAsj X-Received: by 2002:a17:906:c017:b0:a59:9b52:cfc5 with SMTP id a640c23a62f3a-a62649bd8f5mr308578466b.37.1716636869453; Sat, 25 May 2024 04:34:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHupV3Om9XGlYQbAg0u+yLIxxXmycVLArHcH3HXAuYdA393feV0ZjnnLrSqlloNwQ/PjfXE/Q== X-Received: by 2002:a17:906:c017:b0:a59:9b52:cfc5 with SMTP id a640c23a62f3a-a62649bd8f5mr308577466b.37.1716636869103; Sat, 25 May 2024 04:34:29 -0700 (PDT) Received: from [192.168.10.117] ([151.95.155.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a626cda6e1esm243023966b.215.2024.05.25.04.34.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 04:34:28 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 18/24] target/i386: clean up repeated string operations Date: Sat, 25 May 2024 13:33:26 +0200 Message-ID: <20240525113332.1404158-19-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240525113332.1404158-1-pbonzini@redhat.com> References: <20240525113332.1404158-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Do not bother generating inline wrappers for gen_repz and gen_repz2; use s->prefix to separate REPZ from REPNZ in the case of SCAS and CMPS. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 22 ++++------------------ target/i386/tcg/emit.c.inc | 22 +++++++++------------- 2 files changed, 13 insertions(+), 31 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 15993f83024..7dd7ebf60d4 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -1327,14 +1327,12 @@ static void gen_repz(DisasContext *s, MemOp ot, gen_jmp_rel_csize(s, -cur_insn_len(s), 0); } -#define GEN_REPZ(op) \ - static inline void gen_repz_ ## op(DisasContext *s, MemOp ot) \ - { gen_repz(s, ot, gen_##op); } - -static void gen_repz2(DisasContext *s, MemOp ot, int nz, - void (*fn)(DisasContext *s, MemOp ot)) +static void gen_repz_nz(DisasContext *s, MemOp ot, + void (*fn)(DisasContext *s, MemOp ot)) { TCGLabel *l2; + int nz = (s->prefix & PREFIX_REPNZ) ? 1 : 0; + l2 = gen_jz_ecx_string(s); fn(s, ot); gen_op_add_reg_im(s, s->aflag, R_ECX, -1); @@ -1350,18 +1348,6 @@ static void gen_repz2(DisasContext *s, MemOp ot, int nz, gen_jmp_rel_csize(s, -cur_insn_len(s), 0); } -#define GEN_REPZ2(op) \ - static inline void gen_repz_ ## op(DisasContext *s, MemOp ot, int nz) \ - { gen_repz2(s, ot, nz, gen_##op); } - -GEN_REPZ(movs) -GEN_REPZ(stos) -GEN_REPZ(lods) -GEN_REPZ(ins) -GEN_REPZ(outs) -GEN_REPZ2(scas) -GEN_REPZ2(cmps) - static void gen_helper_fp_arith_ST0_FT0(int op) { switch (op) { diff --git a/target/i386/tcg/emit.c.inc b/target/i386/tcg/emit.c.inc index 0a13be4989a..377d2201c91 100644 --- a/target/i386/tcg/emit.c.inc +++ b/target/i386/tcg/emit.c.inc @@ -1508,10 +1508,8 @@ static void gen_CMPccXADD(DisasContext *s, CPUX86State *env, X86DecodedInsn *dec static void gen_CMPS(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode) { MemOp ot = decode->op[2].ot; - if (s->prefix & PREFIX_REPNZ) { - gen_repz_cmps(s, ot, 1); - } else if (s->prefix & PREFIX_REPZ) { - gen_repz_cmps(s, ot, 0); + if (s->prefix & (PREFIX_REPZ | PREFIX_REPNZ)) { + gen_repz_nz(s, ot, gen_cmps); } else { gen_cmps(s, ot); } @@ -1834,7 +1832,7 @@ static void gen_INS(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode) translator_io_start(&s->base); if (s->prefix & (PREFIX_REPZ | PREFIX_REPNZ)) { - gen_repz_ins(s, ot); + gen_repz(s, ot, gen_ins); } else { gen_ins(s, ot); } @@ -1993,7 +1991,7 @@ static void gen_LODS(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode) { MemOp ot = decode->op[2].ot; if (s->prefix & (PREFIX_REPZ | PREFIX_REPNZ)) { - gen_repz_lods(s, ot); + gen_repz(s, ot, gen_lods); } else { gen_lods(s, ot); } @@ -2155,7 +2153,7 @@ static void gen_MOVS(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode) { MemOp ot = decode->op[2].ot; if (s->prefix & (PREFIX_REPZ | PREFIX_REPNZ)) { - gen_repz_movs(s, ot); + gen_repz(s, ot, gen_movs); } else { gen_movs(s, ot); } @@ -2321,7 +2319,7 @@ static void gen_OUTS(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode) translator_io_start(&s->base); if (s->prefix & (PREFIX_REPZ | PREFIX_REPNZ)) { - gen_repz_outs(s, ot); + gen_repz(s, ot, gen_outs); } else { gen_outs(s, ot); } @@ -3329,10 +3327,8 @@ static void gen_SBB(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode) static void gen_SCAS(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode) { MemOp ot = decode->op[2].ot; - if (s->prefix & PREFIX_REPNZ) { - gen_repz_scas(s, ot, 1); - } else if (s->prefix & PREFIX_REPZ) { - gen_repz_scas(s, ot, 0); + if (s->prefix & (PREFIX_REPZ | PREFIX_REPNZ)) { + gen_repz_nz(s, ot, gen_scas); } else { gen_scas(s, ot); } @@ -3495,7 +3491,7 @@ static void gen_STOS(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode) { MemOp ot = decode->op[1].ot; if (s->prefix & (PREFIX_REPZ | PREFIX_REPNZ)) { - gen_repz_stos(s, ot); + gen_repz(s, ot, gen_stos); } else { gen_stos(s, ot); } From patchwork Sat May 25 11:33:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 13673959 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 56DD7C25B7A for ; Sat, 25 May 2024 11:36:00 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sApfd-0003MN-IV; Sat, 25 May 2024 07:34:41 -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 1sApfc-0003I8-BA for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34:40 -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 1sApfY-0004AK-8Y for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716636875; 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=P3M9ywOxaASVOOG3Tp7/CLQyP00X1ishhis/9n+JJcM=; b=DSPviPfPrFdbQY4E9KslLP2QHiZOKVD6Rj8mIHfDi1mfFaEFHn8ZOJwV8UhTeXvSilqbh1 K/HplX7cKqc4vJ7p1u9jlKT+165gwN/UDRhVYEe0OBOpbQtn7iGDxwP16TwGXvINJEA/vv 9vU6ltf4Vm+Az6EWPZFAa4jHm+q3j5k= 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-102-DfzQfri0MWmMnmf6VOgGNg-1; Sat, 25 May 2024 07:34:34 -0400 X-MC-Unique: DfzQfri0MWmMnmf6VOgGNg-1 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-a6267bcfb5fso32441366b.2 for ; Sat, 25 May 2024 04:34:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716636872; x=1717241672; 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=P3M9ywOxaASVOOG3Tp7/CLQyP00X1ishhis/9n+JJcM=; b=DK7xjROYKSR42pMcgtj9yL/lgOe/MCBR9r42INlcbNgC8kbz7idCKtLCs3/u21s2Hj qgG7EIzmnZaOJLI5SriG5Id+wTLis25yT6PZg5bhOCp3L86wqLRD4UlxXGBaSohBruL4 gkyUeti2e1U2Iz+kPCBTYIA7y05pOEl6q4PFJSr2cLsgtvLUIWUEpaFlzgwexlQvJo/d cYXYWE8rsE4HBjq3hyBwaOBgdM/t12hG6rglYRFkOVf3f3q5iYfwCUq9r+pySaT1hikd r++D5/wszzBr2bxZ8YFeK9tuBUKyT/kxDE87h4r7HDuRxkzKmJimBxkVl+ORUHlLZALh 195w== X-Gm-Message-State: AOJu0YxFGQlRAYo1V95R5kCZSdUftJBmZlawjS07+CBRxvoN5a1Z8s2n umOb75OuJRaAJRRQBctH/Z/hfN7GYbpEX22zRg4kDpF0sSk4ozBaSYRdS8hoo9WlR2sVLxu9zcv bTtrbFydBaJ/Z82kz89GekKSkZXlTDGkwwSa30EHAzJbIxKv8mPdtRhCMpI4bj2OkYUIQLWDdrj +wEO39UecTm5F/zwrXxorQ4gHVb+Y75qtkrKhu X-Received: by 2002:a50:8a98:0:b0:578:63c3:dfd0 with SMTP id 4fb4d7f45d1cf-57863c40306mr2053591a12.24.1716636872355; Sat, 25 May 2024 04:34:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHmMDQEVuOeamwKghc68UaPUqYh4+48YLY/niAKoeY84OmzA3CVt3paf7zlUUl4YgzV1Th/Pw== X-Received: by 2002:a50:8a98:0:b0:578:63c3:dfd0 with SMTP id 4fb4d7f45d1cf-57863c40306mr2053583a12.24.1716636871988; Sat, 25 May 2024 04:34:31 -0700 (PDT) Received: from [192.168.10.116] ([151.95.155.52]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-579c3bbee4asm60965a12.76.2024.05.25.04.34.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 04:34:31 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 19/24] target/i386: remove aflag argument of gen_lea_v_seg Date: Sat, 25 May 2024 13:33:27 +0200 Message-ID: <20240525113332.1404158-20-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240525113332.1404158-1-pbonzini@redhat.com> References: <20240525113332.1404158-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org It is always s->aflag. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 20 ++++++++++---------- target/i386/tcg/emit.c.inc | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 7dd7ebf60d4..6dedfe94c04 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -680,20 +680,20 @@ static void gen_lea_v_seg_dest(DisasContext *s, MemOp aflag, TCGv dest, TCGv a0, } } -static void gen_lea_v_seg(DisasContext *s, MemOp aflag, TCGv a0, +static void gen_lea_v_seg(DisasContext *s, TCGv a0, int def_seg, int ovr_seg) { - gen_lea_v_seg_dest(s, aflag, s->A0, a0, def_seg, ovr_seg); + gen_lea_v_seg_dest(s, s->aflag, s->A0, a0, def_seg, ovr_seg); } static inline void gen_string_movl_A0_ESI(DisasContext *s) { - gen_lea_v_seg(s, s->aflag, cpu_regs[R_ESI], R_DS, s->override); + gen_lea_v_seg(s, cpu_regs[R_ESI], R_DS, s->override); } static inline void gen_string_movl_A0_EDI(DisasContext *s) { - gen_lea_v_seg(s, s->aflag, cpu_regs[R_EDI], R_ES, -1); + gen_lea_v_seg(s, cpu_regs[R_EDI], R_ES, -1); } static inline TCGv gen_compute_Dshift(DisasContext *s, MemOp ot) @@ -1784,7 +1784,7 @@ static void gen_lea_modrm(CPUX86State *env, DisasContext *s, int modrm) { AddressParts a = gen_lea_modrm_0(env, s, modrm); TCGv ea = gen_lea_modrm_1(s, a, false); - gen_lea_v_seg(s, s->aflag, ea, a.def_seg, s->override); + gen_lea_v_seg(s, ea, a.def_seg, s->override); } static void gen_nop_modrm(CPUX86State *env, DisasContext *s, int modrm) @@ -2523,7 +2523,7 @@ static bool disas_insn_x87(DisasContext *s, CPUState *cpu, int b) bool update_fdp = true; tcg_gen_mov_tl(last_addr, ea); - gen_lea_v_seg(s, s->aflag, ea, a.def_seg, s->override); + gen_lea_v_seg(s, ea, a.def_seg, s->override); switch (op) { case 0x00 ... 0x07: /* fxxxs */ @@ -3320,7 +3320,7 @@ static void disas_insn_old(DisasContext *s, CPUState *cpu, int b) 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->aflag, s->A0, a.def_seg, s->override); + 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); } @@ -3645,7 +3645,7 @@ static void disas_insn_old(DisasContext *s, CPUState *cpu, int b) } gen_update_cc_op(s); gen_update_eip_cur(s); - gen_lea_v_seg(s, s->aflag, cpu_regs[R_EAX], R_DS, s->override); + gen_lea_v_seg(s, cpu_regs[R_EAX], R_DS, s->override); gen_helper_monitor(tcg_env, s->A0); break; @@ -4051,7 +4051,7 @@ static void disas_insn_old(DisasContext *s, CPUState *cpu, int b) } else { tcg_gen_movi_tl(s->A0, 0); } - gen_lea_v_seg(s, s->aflag, s->A0, a.def_seg, s->override); + gen_lea_v_seg(s, s->A0, a.def_seg, s->override); if (a.index >= 0) { tcg_gen_mov_tl(s->T0, cpu_regs[a.index]); } else { @@ -4156,7 +4156,7 @@ static void disas_insn_old(DisasContext *s, CPUState *cpu, int b) } else { tcg_gen_movi_tl(s->A0, 0); } - gen_lea_v_seg(s, s->aflag, s->A0, a.def_seg, s->override); + gen_lea_v_seg(s, s->A0, a.def_seg, s->override); if (a.index >= 0) { tcg_gen_mov_tl(s->T0, cpu_regs[a.index]); } else { diff --git a/target/i386/tcg/emit.c.inc b/target/i386/tcg/emit.c.inc index 377d2201c91..e990141454b 100644 --- a/target/i386/tcg/emit.c.inc +++ b/target/i386/tcg/emit.c.inc @@ -76,7 +76,7 @@ static void gen_NM_exception(DisasContext *s) static void gen_load_ea(DisasContext *s, AddressParts *mem, bool is_vsib) { TCGv ea = gen_lea_modrm_1(s, *mem, is_vsib); - gen_lea_v_seg(s, s->aflag, ea, mem->def_seg, s->override); + gen_lea_v_seg(s, ea, mem->def_seg, s->override); } static inline int mmx_offset(MemOp ot) @@ -2044,7 +2044,7 @@ static void gen_MOV(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode) static void gen_MASKMOV(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode) { - gen_lea_v_seg(s, s->aflag, cpu_regs[R_EDI], R_DS, s->override); + gen_lea_v_seg(s, cpu_regs[R_EDI], R_DS, s->override); if (s->prefix & PREFIX_DATA) { gen_helper_maskmov_xmm(tcg_env, OP_PTR1, OP_PTR2, s->A0); @@ -4039,7 +4039,7 @@ static void gen_XLAT(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode) { /* AL is already zero-extended into s->T0. */ tcg_gen_add_tl(s->A0, cpu_regs[R_EBX], s->T0); - gen_lea_v_seg(s, s->aflag, s->A0, R_DS, s->override); + gen_lea_v_seg(s, s->A0, R_DS, s->override); gen_op_ld_v(s, MO_8, s->T0, s->A0); } From patchwork Sat May 25 11:33:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 13673962 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7140BC25B78 for ; Sat, 25 May 2024 11:36:17 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sApff-0003OF-9b; Sat, 25 May 2024 07:34:43 -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 1sApfe-0003Lf-9u for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34: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 1sApfb-0004Ag-PR for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716636877; 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=TLcj+G3nZNoagmtde0jJ4iaxwOIbWk0F9rsJ0Ab16Xo=; b=EKn46F2X3klPRLp5frTAzoRAkYAbAXEBSYFRjCHuECViknJNh5ZnrH4jXSA/XjeBu8ILxO oxusTal3Lf5gm6srLszAnDnILvbJd3eMkF6/8WsBXz9phV4lp6I8g60LxrVsIGaXV8QsJD RGT4yQfNj95TuYcFbPMLVNzw3Uxmq1U= 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-205-ibeF3mAQOqiFxmcU6Xfdcw-1; Sat, 25 May 2024 07:34:35 -0400 X-MC-Unique: ibeF3mAQOqiFxmcU6Xfdcw-1 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-a626ac4d29aso82040066b.3 for ; Sat, 25 May 2024 04:34:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716636874; x=1717241674; 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=TLcj+G3nZNoagmtde0jJ4iaxwOIbWk0F9rsJ0Ab16Xo=; b=W1hs+aFSaziST1fxS8nAicbqBPP37p/nV/oFEs/S0p5xuKOenV4QHWl5eNdV2GG4c8 dtqK5+pLTtL4ku+j8rRcyKMW4dGZppcvI8hQ5guFF6si2+THCM5g31t836+rQfUkqmNX wh8OlNc+YV5pKbduphh3HKNvrHe4VC/w4vtTwIf0U5AUK73r6amxkyqb1tCWGeYyAbuR AUOCQ0oD3v9tyLIDSXKo97P6N6HnrOsmT0IbJUaOcpMx6v7ltafwmeOATU6hQgx8oFPd 95Y0XDfanP5ak2tTE+8Bn0Ec8sOuOs41JeO74k8DatpKUg/iYLTXxWKvaWsvXaboihTs rIFA== X-Gm-Message-State: AOJu0YyyNysXP6wFgnRVq74HUw/ih01I0y7z5SfDg+kNRpl4MBFtnOoH iFZdRYmzrcknxg4GM3luXd37TFC/WhpvD92ndVQ32y6yd4OemOTxPC5LbseWfsej6Zk44q6iL2T 0D9gMdcTKO4B3ccauifB2YSR2XdTwSHJP5KvnAtAim/jHnfZh96nUN5rRajtQq3E2XLKDrzx2Oh ca6pQpH9u1tcRQTwNy95DPtjxDpQxtLyrnCLIP X-Received: by 2002:a17:906:79c1:b0:a5d:3889:da9a with SMTP id a640c23a62f3a-a626514edf1mr308089166b.50.1716636874135; Sat, 25 May 2024 04:34:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF9J03ih6REXIYrr6dF6rSng6RSS7fcA9xOlQlep43VTbksaD3u6G/YXSKZELvwGfQCECELPQ== X-Received: by 2002:a17:906:79c1:b0:a5d:3889:da9a with SMTP id a640c23a62f3a-a626514edf1mr308088066b.50.1716636873773; Sat, 25 May 2024 04:34:33 -0700 (PDT) Received: from [192.168.10.116] ([151.95.155.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a626c817b0asm245957466b.3.2024.05.25.04.34.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 04:34:33 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 20/24] meson: remove unnecessary reference to libm Date: Sat, 25 May 2024 13:33:28 +0200 Message-ID: <20240525113332.1404158-21-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240525113332.1404158-1-pbonzini@redhat.com> References: <20240525113332.1404158-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org libm is linked into all targets via libqemuutil, no need to specify it explicitly. Signed-off-by: Paolo Bonzini --- block/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/meson.build b/block/meson.build index e1f03fd773e..8993055c75e 100644 --- a/block/meson.build +++ b/block/meson.build @@ -110,7 +110,7 @@ foreach m : [ [blkio, 'blkio', files('blkio.c')], [curl, 'curl', files('curl.c')], [glusterfs, 'gluster', files('gluster.c')], - [libiscsi, 'iscsi', [files('iscsi.c'), libm]], + [libiscsi, 'iscsi', files('iscsi.c')], [libnfs, 'nfs', files('nfs.c')], [libssh, 'ssh', files('ssh.c')], [rbd, 'rbd', files('rbd.c')], From patchwork Sat May 25 11:33:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 13673967 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5706CC25B78 for ; Sat, 25 May 2024 11:37:32 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sApfh-0003PM-0D; Sat, 25 May 2024 07:34:45 -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 1sApff-0003OU-Nj for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34: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 1sApfe-0004B6-7D for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716636880; 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=3sEk1rvH/evWwEYWhEaFKw6+w0WamReoUwldQRZvSf0=; b=M13DRuCdu2P4nR+BLqY5OQeHrsDZ679uHpBEIuLVjddC02azJc5TvbKJEiWDOjk8wSAfld 4ZmPUzgm+J3VWcLjbWqOgIS/aVcPizDHKeeXFWlDobxEPMYfSINMPd+4dMvIGUKVhr4bKC ZqRiN6lDU7QdT58IcKbNyIHT61aqf2k= 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-158-FstQo-nVM_2RYTObatxp5w-1; Sat, 25 May 2024 07:34:38 -0400 X-MC-Unique: FstQo-nVM_2RYTObatxp5w-1 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a621c9a65f4so137735366b.2 for ; Sat, 25 May 2024 04:34:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716636877; x=1717241677; 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=3sEk1rvH/evWwEYWhEaFKw6+w0WamReoUwldQRZvSf0=; b=l32GQDEia/RHzQSN+LhPexvsU1+aqOUSigSIoIah62/InAY6rmF/+NtcVd6z7ZSIyC /E8s7vcKQ8NLPOOVoyrpfHoF3i4fELfxiG7sYK3F9Ej1zIVms1D+ctkeQchgqKWhcTNT 41iw2gEy+5podNMxR2Li//ZvP0bLrYD2FRnb2Skyqr1LK/NP0rJZsfuHgnegjSbMzR0f 8NVKjWvlx08jGFAyMoqIkBX7SsDEFmkzTWgf2IV3/flZRErPJdWednOk7AOG8l1EluCj M98ok9lJ7aTVR6A4CfZMuy439zdUTs+BY6ZlQOutpQ+DC948wf6DnMrKFnQx3ICrCu3R LZnQ== X-Gm-Message-State: AOJu0Yy8as3hdV7Z+Rw+o6+gU951z2tc54Gu4krY8ny3rXjQquHZuY8V oLDm7AWGd2pNddvrE6WEBrf12ujrkoRzlirkp//z1/JUTbt1ni/GZov1/2Jc4unS/tCmw989yul mLaumKSwzZj1Z2ABK68vILLHtVDhIkdC/+8ntNQx9oAkofZOYLia6fSArnR1+w9suptwyNfV4Zv NaI3oQqmXvkGHewA4J5XifMZc1SZy1pv5PFirC X-Received: by 2002:a17:906:2719:b0:a62:ad3e:2528 with SMTP id a640c23a62f3a-a62ad3e2616mr93825066b.14.1716636877188; Sat, 25 May 2024 04:34:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGIHZDAwSEN6dZBp8XzkZGTcd1q8BsawcvAFBsq/YcGh9JkqVoBdI9wKksHK7pyPOVI4ANOWQ== X-Received: by 2002:a17:906:2719:b0:a62:ad3e:2528 with SMTP id a640c23a62f3a-a62ad3e2616mr93824066b.14.1716636876605; Sat, 25 May 2024 04:34:36 -0700 (PDT) Received: from [192.168.10.81] ([151.95.155.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a626cc893fasm247057466b.143.2024.05.25.04.34.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 04:34:36 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 21/24] meson: remove unnecessary dependency Date: Sat, 25 May 2024 13:33:29 +0200 Message-ID: <20240525113332.1404158-22-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240525113332.1404158-1-pbonzini@redhat.com> References: <20240525113332.1404158-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org The dbus_display1_dep is not really used since all occurrences also request gio independently. Just list the generated sources and drop dbus_display1_dep. Signed-off-by: Paolo Bonzini --- audio/meson.build | 4 ++-- tests/qtest/meson.build | 2 +- ui/meson.build | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/audio/meson.build b/audio/meson.build index 608f35e6af7..59f0a431d51 100644 --- a/audio/meson.build +++ b/audio/meson.build @@ -30,8 +30,8 @@ endforeach if dbus_display module_ss = ss.source_set() - module_ss.add(when: [gio, dbus_display1_dep, pixman], - if_true: files('dbusaudio.c')) + module_ss.add(when: [gio, pixman], + if_true: [dbus_display1, files('dbusaudio.c')]) audio_modules += {'dbus': module_ss} endif diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 86293051dce..b98fae6a6dd 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -354,7 +354,7 @@ if vnc.found() endif if dbus_display - qtests += {'dbus-display-test': [dbus_display1_dep, gio]} + qtests += {'dbus-display-test': [dbus_display1, gio]} endif qtest_executables = {} diff --git a/ui/meson.build b/ui/meson.build index 5d89986b0ee..cfbf29428df 100644 --- a/ui/meson.build +++ b/ui/meson.build @@ -91,8 +91,7 @@ if dbus_display '--interface-prefix', 'org.qemu.', '--c-namespace', 'QemuDBus', '--generate-c-code', '@BASENAME@']) - dbus_display1_dep = declare_dependency(sources: dbus_display1, dependencies: gio) - dbus_ss.add(when: [gio, dbus_display1_dep], + dbus_ss.add(when: gio, if_true: [files( 'dbus-chardev.c', 'dbus-clipboard.c', @@ -100,7 +99,7 @@ if dbus_display 'dbus-error.c', 'dbus-listener.c', 'dbus.c', - ), opengl, gbm, pixman]) + ), opengl, gbm, pixman, dbus_display1]) ui_modules += {'dbus' : dbus_ss} endif From patchwork Sat May 25 11:33:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 13673954 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2D4A8C25B78 for ; Sat, 25 May 2024 11:35:31 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sApfi-0003WV-NF; Sat, 25 May 2024 07:34:46 -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 1sApfg-0003PK-Ur for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34: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 1sApff-0004BS-Fg for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716636882; 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=k9B/mifen37RkDdPX/cKKRcV68jn85LxP2cbyY6xOFI=; b=YPV8XdNgqgGG0Gd0FKLalhEgQJnugE2U2qEddqDb2XwtNoAUc660MrDuuwKMwp2q78TAG+ DQN4YLpVIG2xvsDoIO6iCgysAf6V4ryTWNTPVSm2Uq8mG/H1+pz1mikWhAorcAXV8pNG5S zlA9FmxQLjea2jEO3MH8uIdmr7seegc= 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-237-vzhl6wPBMCWcxVTGljyMww-1; Sat, 25 May 2024 07:34:41 -0400 X-MC-Unique: vzhl6wPBMCWcxVTGljyMww-1 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a6266ffd2fcso76780666b.1 for ; Sat, 25 May 2024 04:34:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716636880; x=1717241680; 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=k9B/mifen37RkDdPX/cKKRcV68jn85LxP2cbyY6xOFI=; b=fsQPG+LXESysr7BhK1Jp7Eo+CEpj1VB8m8wqlZmh9kIc7zmAv7rQcygNrPncDdPOjX HOCKJO2y76P/Z4yzr700j4aRgoocEHOBFzjR6S/0pkPzXTLjR29R3rwaI8uryu9ofpY9 8Pvg/nsj7sFUabcJ5o3uCVxmBdco/U7t1QH3oeeqWNFgs4QzU42YyoociKp/leD00MUY 1ugfC+IVI7DonW4eLP0dQO+NDF3vjgjxXyhO0Odm+OQM3Y2lB81s09YEzgrP3w94/8uZ vCKquC9wxFX++exHB+MPAC+I3RUqpcz5MhLPw9UKHP39umk2FNfuaP7nIdAzZdjCTEFx VwlQ== X-Gm-Message-State: AOJu0YzTVaibYUQ80axDMN8ZhYB41pO5kRtc1M1cEt/WwEEvNL/d6cWG zkq/kxJUwSUdmLR/a1vOZR29RnjKNO7nzoH6u40fGAV+/dRqja1Ijo/RSudEUe9Llp5r38v/85Q eyTCXm3AtJ018GtoLD2OTkIoX/Sot4nEpJ5TYPsA3HR3ebRF2VcLE5pgwawn2lC9s5xAIn56H35 L5KoehMi26qolkCPo4O22fFvE49NF2FJ6erfKF X-Received: by 2002:a17:906:4bd8:b0:a59:aae5:b0bc with SMTP id a640c23a62f3a-a62646d7f53mr295625066b.42.1716636879906; Sat, 25 May 2024 04:34:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEsCn+IOtYJifazZo7o49GJuGWVIT+Af3gjJR/6CMDuUbB3fmFUcLa887X/kCSUX+tKq/22qw== X-Received: by 2002:a17:906:4bd8:b0:a59:aae5:b0bc with SMTP id a640c23a62f3a-a62646d7f53mr295624666b.42.1716636879558; Sat, 25 May 2024 04:34:39 -0700 (PDT) Received: from [192.168.10.116] ([151.95.155.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a626cda1c32sm243947366b.190.2024.05.25.04.34.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 04:34:39 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 22/24] tcg: include dependencies in static_library() Date: Sat, 25 May 2024 13:33:30 +0200 Message-ID: <20240525113332.1404158-23-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240525113332.1404158-1-pbonzini@redhat.com> References: <20240525113332.1404158-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org This ensures that for example libffi can be reached even if it is not in /usr/include. Signed-off-by: Paolo Bonzini --- tcg/meson.build | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tcg/meson.build b/tcg/meson.build index 8251589fd4e..ffbe754d8b3 100644 --- a/tcg/meson.build +++ b/tcg/meson.build @@ -32,19 +32,19 @@ tcg_ss = tcg_ss.apply({}) libtcg_user = static_library('tcg_user', tcg_ss.sources() + genh, name_suffix: 'fa', + dependencies: tcg_ss.dependencies(), c_args: '-DCONFIG_USER_ONLY', build_by_default: false) -tcg_user = declare_dependency(link_with: libtcg_user, - dependencies: tcg_ss.dependencies()) +tcg_user = declare_dependency(link_with: libtcg_user) user_ss.add(tcg_user) libtcg_system = static_library('tcg_system', tcg_ss.sources() + genh, name_suffix: 'fa', + dependencies: tcg_ss.dependencies(), c_args: '-DCONFIG_SOFTMMU', build_by_default: false) -tcg_system = declare_dependency(link_with: libtcg_system, - dependencies: tcg_ss.dependencies()) +tcg_system = declare_dependency(link_with: libtcg_system) system_ss.add(tcg_system) From patchwork Sat May 25 11:33:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 13673952 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8C2B2C25B7C for ; Sat, 25 May 2024 11:35:14 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sApfl-0003ZL-96; Sat, 25 May 2024 07:34: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 1sApfk-0003Z0-Ca for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34: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 1sApfi-0004CA-V7 for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716636886; 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=DrQKXlw5u4HCxCSjJA+nYUSNZLIT05jc7Oc0v9l+ebg=; b=Re8dPe8RA0wY5z1hiRHWPj2keh5FjxFwIhU1un1NKsiYnoKnklytnQFXraeCF3Vt5fQUHi bhAM2ixeFGSVDILMeROVeFEiKNKr7uvD2G1cmSUZ3bcIJCJJnnMTLFZ58XiA+/6vtHVv8p 7lcVStUHswBIGtfqEygPvZLGJcAj+nE= 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-347-niL656yVNuGzITaF6kIOYg-1; Sat, 25 May 2024 07:34:44 -0400 X-MC-Unique: niL656yVNuGzITaF6kIOYg-1 Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-522362e8317so3074104e87.0 for ; Sat, 25 May 2024 04:34:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716636882; x=1717241682; 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=DrQKXlw5u4HCxCSjJA+nYUSNZLIT05jc7Oc0v9l+ebg=; b=Cnbz0XtkbGd7pI0FtaEm+z0RWsxpgTojZSnPUHRLa/kXVYQt8WuuAziY2Qjr1CLGQ+ dGUTjX36RH9gqVRwG03g7ctrJwwslmbo8Kqc1RgQuCEjA3Tdbl/02Zw3kHYa1BmPz/WV BkidXgmJnOaqvC8LPnDGVwSau3d48r0PgQ1Sk+EOXTAwnreZNV+N8kg1cQPtN7BXZ/1U EbXZQOi0ZNHAwUvpNa90jAHLv35IhaSEVe7ExhluBYawlvBqACkPcLCySUvOFt8mUL3L /XzXovShSVCJsGwOwO8POyDmq2KY/fY7wtfDCPGM44gcdeYTevU7MCfPmCzylawWSF6W Q3cA== X-Gm-Message-State: AOJu0YxTue00gRGglnAayg3ZlEOuyWXv9wFHT+0ca5QxEFnkOmskkNg2 Imo8CiTabw0psdxX0EM65F7X1T3KB62uNwR2xNYFsr0NDzkh5oqe6vP+90TTXbC7ZK4hNvQbX6C ddxxjezBAsd13g27PtboW9dVwplc+47BpzkLusIsKlyB3YuN7zl6YKPuivh6n8JmEK93lBTHN6A JZVugkxBlngEfDbekL1mh+2JuA6PE9xFlF2q+H X-Received: by 2002:a05:6512:1390:b0:522:2ada:c02e with SMTP id 2adb3069b0e04-5296736b884mr5069551e87.53.1716636882676; Sat, 25 May 2024 04:34:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEt4EP4TIrcWGlxlNqFMLceZHzi8A367GmNNHNUXj7kavbelGzdwa1AxqauY98FxX/9OgA6og== X-Received: by 2002:a05:6512:1390:b0:522:2ada:c02e with SMTP id 2adb3069b0e04-5296736b884mr5069539e87.53.1716636882226; Sat, 25 May 2024 04:34:42 -0700 (PDT) Received: from [192.168.10.117] ([151.95.155.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a626c97a1fbsm243946266b.92.2024.05.25.04.34.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 04:34:40 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 23/24] meson: do not query modules before they are processed Date: Sat, 25 May 2024 13:33:31 +0200 Message-ID: <20240525113332.1404158-24-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240525113332.1404158-1-pbonzini@redhat.com> References: <20240525113332.1404158-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Paolo Bonzini --- block/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/meson.build b/block/meson.build index 8993055c75e..158dc3b89db 100644 --- a/block/meson.build +++ b/block/meson.build @@ -119,7 +119,7 @@ foreach m : [ module_ss = ss.source_set() module_ss.add(when: m[0], if_true: m[2]) if enable_modules - modsrc += module_ss.all_sources() + modsrc += m[2] endif block_modules += {m[1] : module_ss} endif From patchwork Sat May 25 11:33:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 13673973 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E509AC25B7A for ; Sat, 25 May 2024 11:38:34 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sApfv-0003gV-Eb; Sat, 25 May 2024 07:34: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 1sApfr-0003cz-2F for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34: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 1sApfm-0004CX-Aj for qemu-devel@nongnu.org; Sat, 25 May 2024 07:34:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716636888; 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=T19z2VhLiDxwW2xj7PM4ylgGCJRFuMIgK7muAk4JXtI=; b=M4mOb56ck9Hm53ie48aQAzgP8zOl0XbE00b0d+xfofPG0mNA+42Nr6h4bp7N/81Ts/m+A/ qV9pQmjskAtEuzZpYP46vth2mcbrL8493avUctzTTPZWxt1kOWyI3fw7fdzmEtrIMqNezW wnWvHXIHVgbzQ4pWGVRLxk57hPeH0kI= 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-660-fagN3y3MMlmgdMHRTdfSjQ-1; Sat, 25 May 2024 07:34:47 -0400 X-MC-Unique: fagN3y3MMlmgdMHRTdfSjQ-1 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a6266ffd474so90899766b.1 for ; Sat, 25 May 2024 04:34:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716636885; x=1717241685; 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=T19z2VhLiDxwW2xj7PM4ylgGCJRFuMIgK7muAk4JXtI=; b=bmrq3ESKl1hyuxBXSCHpxDKOVeCyW/k4dc0VWQeLFZua1PiMax3f8opzOawdJ1dz79 6OYJTV9bjozM3n30oOkiMQHEFVRFrdU8GggCaBZoBf6i7GZchy9ULeEt+Rhm8eWoAAwl zp3/R6+G4WaxTZ8N2+dAg9peaiDvn41b8+tdOBMfEbIms9+Hdh92T/SPRCXesVH9cdB8 F+xw/LGbmuxswYM8Liy8Yb9BtOc9NYPZf6HAz5XVTP9qtY3Bt+79MkpHpqzFqYpvVsG/ DFf3dOydauhuLzK9pdejMkGWsUMjTz8rqkzC+CoKyw75GRzpRrSoPyMCThkd4gj0NfmC cEfg== X-Gm-Message-State: AOJu0Ywg7xuhZAmBf2O2iE/rjta3KXAc+sO2OthePRGdz581S1Z8Dxtw JVm3l5UAId6hfpNhLxouR6oddPhrGOi0uzyQkhyXdrEq7v9g9ZdePkTzrkxGKbcW0a8V1PLhngq 6O7f5/vJbRrjzcQL+Gwc2KxpEOxHnyA5GrOT9yBuZWGn3v3/TwOctySRb23E7JcxWmLkt0VewQ5 FsOAseXA/YK+9FVqcVM8bmh7EssZxs/8zE3P7Z X-Received: by 2002:a17:906:2c08:b0:a5c:eafb:5288 with SMTP id a640c23a62f3a-a62642e9bbbmr431354366b.31.1716636885706; Sat, 25 May 2024 04:34:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH7fPKZDp/MVdId72OJeLxvV6HE42v/Sn/U3l+BFTLyY+fZCtj5BZ3sDS5SNNc3i0OavMZ0Ng== X-Received: by 2002:a17:906:2c08:b0:a5c:eafb:5288 with SMTP id a640c23a62f3a-a62642e9bbbmr431353066b.31.1716636885191; Sat, 25 May 2024 04:34:45 -0700 (PDT) Received: from [192.168.10.117] ([151.95.155.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a626c817b15sm245047266b.40.2024.05.25.04.34.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 04:34:44 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 24/24] migration: remove unnecessary zlib dependency Date: Sat, 25 May 2024 13:33:32 +0200 Message-ID: <20240525113332.1404158-25-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240525113332.1404158-1-pbonzini@redhat.com> References: <20240525113332.1404158-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org zlib code is only used by the emulators, not by the tests. Signed-off-by: Paolo Bonzini --- meson.build | 2 +- migration/dirtyrate.c | 1 - migration/qemu-file.c | 1 - migration/meson.build | 2 +- 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 7fd82b5f48c..63866071445 100644 --- a/meson.build +++ b/meson.build @@ -3696,7 +3696,7 @@ libmigration = static_library('migration', sources: migration_files + genh, name_suffix: 'fa', build_by_default: false) migration = declare_dependency(link_with: libmigration, - dependencies: [zlib, qom, io]) + dependencies: [qom, io]) system_ss.add(migration) block_ss = block_ss.apply({}) diff --git a/migration/dirtyrate.c b/migration/dirtyrate.c index d02d70b7b4b..1d9db812990 100644 --- a/migration/dirtyrate.c +++ b/migration/dirtyrate.c @@ -12,7 +12,6 @@ #include "qemu/osdep.h" #include "qemu/error-report.h" -#include #include "hw/core/cpu.h" #include "qapi/error.h" #include "exec/ramblock.h" diff --git a/migration/qemu-file.c b/migration/qemu-file.c index 9ccbbb00991..b6d2f588bd7 100644 --- a/migration/qemu-file.c +++ b/migration/qemu-file.c @@ -22,7 +22,6 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" -#include #include "qemu/madvise.h" #include "qemu/error-report.h" #include "qemu/iov.h" diff --git a/migration/meson.build b/migration/meson.build index 8815f808374..bdc3244bce0 100644 --- a/migration/meson.build +++ b/migration/meson.build @@ -29,7 +29,7 @@ system_ss.add(files( 'socket.c', 'tls.c', 'threadinfo.c', -), gnutls) +), gnutls, zlib) if get_option('replication').allowed() system_ss.add(files('colo-failover.c', 'colo.c'))