From patchwork Fri May 14 15:12:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 438909 Delivered-To: patch@linaro.org Received: by 2002:a02:b78d:0:0:0:0:0 with SMTP id f13csp431732jam; Fri, 14 May 2021 08:14:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQkfM52fNKqYRFa72+7LHCIpVoe9BcujysnV4YLvSoM7JovuydAAdVFTbn8Ju6GWLdVtDc X-Received: by 2002:a92:c26a:: with SMTP id h10mr40366716ild.294.1621005287411; Fri, 14 May 2021 08:14:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621005287; cv=none; d=google.com; s=arc-20160816; b=dW7QCAU/+0ac0EUkOJYhRL1FwiSIzUM/RxXWJhQQTslPXNomc4GYl088rMpR5lRt04 P0uF28RPYRItsq9cRThhk194/gQb+zUDFXDi351YwemX6CQ7MMEkA/0DaE++r2f4Do/k DYEhAWJU7+3te+Nv8ZuZI3DakoKmfo8OMw2NS1gaBc3fDOTE2/2Fmuh9vQIOGZf0KW2a XEarriIDO43wqrgrm/5hADQ/91VA/WXpAnIMpCnXKYO92UWxbaoBQ6rK4lOyvGIlm9Zi wij9jiOPnC1Ug4WjAB4ZHT9hGNRs9gHZLZSf8lFPLEfWNriaNvjeDZ4QdweYYwoYClLc Mk2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature; bh=m5pOvmri75aSMp9jUNbeNGu2Eucnq9QWheV45DR8TJ8=; b=XELHRFWqIXL23K3rH4SUQe7epdZRsDGzitt6zRt6fzQOHknRSTKySQ/Epd29Y2WYGR rozpTx0bnWxXkpIo6oe7mIpFn97HnZIPxZQ77AB7zuu8VFhrbmywPWcTBUp675IM3GFw tehkJ+tcl6cLTW6KVB/phFV38Yhf8WLCoLz00r7thifXd/qMXLEniR35VSU97nufiC/H YwMIhT8I+fGXatApj9FTGM0gpHia0uZtZ/3zgU5/0XI1oBfbX6BM4XCENb/VKKVKa8in z1sr5Wv52hFFOtnr832aeu79PrcFADdtgu3UMpmgkfUmjLZLuQe+ASS5c+/NS6UOmnYg ixnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="Chu/flMd"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k16si8255942jan.10.2021.05.14.08.14.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 May 2021 08:14:47 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="Chu/flMd"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:43734 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhZWY-00055D-LB for patch@linaro.org; Fri, 14 May 2021 11:14:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36476) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhZVb-000550-8E for qemu-devel@nongnu.org; Fri, 14 May 2021 11:13:47 -0400 Received: from mail-qv1-xf2c.google.com ([2607:f8b0:4864:20::f2c]:36831) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lhZVZ-0006sE-If for qemu-devel@nongnu.org; Fri, 14 May 2021 11:13:47 -0400 Received: by mail-qv1-xf2c.google.com with SMTP id ez19so1210257qvb.3 for ; Fri, 14 May 2021 08:13:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=m5pOvmri75aSMp9jUNbeNGu2Eucnq9QWheV45DR8TJ8=; b=Chu/flMdl0d8e9iFiO9mzN33UuRYNa8Bo86vF1uTjLIZrm2bHQR0mWexVUji0k/xe8 lDg554J4XLYUg4PyNi+tEPSwYakY2VfN7lLYT75nQ9vFvd9LBLx2ryT/pux+CExIhTmG qA6/+mzrYvsb7UxhG162kcSsJzBL9RyOTaUaicPzpDMPcEm0OC3gdvaxJHa6haYQUvLz le/w7IfIaOhWXx0/H+9EZGnfx6D6SH2sxh4el7wo4zXZ9nM1OJsqm2k0ZIS30Ds8j6So 2G2uzZfxejRTTnWhQ//q01e797QLzH10nU3NYbe0pqdGuAfoWT1voNwj6e5cqN/hSngZ rUBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=m5pOvmri75aSMp9jUNbeNGu2Eucnq9QWheV45DR8TJ8=; b=YRnoo2goZKzENYjzew3ePvucJjQlAwlz3PEV/4shqvYZEvD16MzLcnQCV2ZuRYN75Q gDhEZWe1BurU5jaYJcuuWxlJ3i6I1jUrUHEBL6AlHCD91hcETW+BITMSKWWIQ4/1XDbp 3FQZt6RXaBZZwI72d5f0aYpqiefGcrndy+RdlOrW9ptk8Y/XLnKhLZX2IQpDRxLiAFsN cJoDkKfDq0Zg35WVcg92So0MzpXVniEXxSglJQAs5riIKz9HA6yDBzcB/EFsEaiC/K4Z xuSfY2HZbqvMnUDmqp0I2AK4d3emnfn1sIpkX17758cFpb5Go5cE1p7uNrWKTP8TyLp+ ib9A== X-Gm-Message-State: AOAM532wv4xWpqHecXQWg9rEr+CwIDQ/UL8VxYBw4bf4MeEwr/h332No NUp1kWGP7d2ouRRE/WvvE/qKeUmBxAdXrP+fu+Q= X-Received: by 2002:a0c:ee23:: with SMTP id l3mr46903013qvs.55.1621005224407; Fri, 14 May 2021 08:13:44 -0700 (PDT) Received: from localhost.localdomain (163.189-204-200.bestelclientes.com.mx. [189.204.200.163]) by smtp.gmail.com with ESMTPSA id u6sm4778966qkj.117.2021.05.14.08.13.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 08:13:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 00/50] target/i386 translate cleanups Date: Fri, 14 May 2021 10:12:52 -0500 Message-Id: <20210514151342.384376-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::f2c; envelope-from=richard.henderson@linaro.org; helo=mail-qv1-xf2c.google.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, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pbonzini@redhat.com, f4bug@amsat.org, ehabkost@redhat.com, cfontana@suse.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Supercedes: 20210228232321.322053-1-richard.henderson@linaro.org ("i386 cleanup part 3") Claudio's prerequite patch set ("i386 cleanup part 2"), is now merged. Version 2 here fixes some minor rebase conflicts that crept in. Only 4 of the 50 patches have been reviewed. Blurb from v1: This started out to address a fixme in Claudio's patch set, then wandered a bit, with cleanups and bug fixes in the code that I was touching. I stopped when I reached my original goal of removing target/i386/tcg/user/*_stubs.c. There are a lot of patches, but hopefully they're all small enough to be obvious. r~ Richard Henderson (50): target/i386: Split out gen_exception_gpf target/i386: Split out check_cpl0 target/i386: Unify code paths for IRET target/i386: Split out check_vm86_iopl target/i386: Split out check_iopl target/i386: Assert PE is set for user-only target/i386: Assert CPL is 3 for user-only target/i386: Assert IOPL is 0 for user-only target/i386: Assert !VM86 for x86_64 user-only target/i386: Assert CODE32 for x86_64 user-only target/i386: Assert SS32 for x86_64 user-only target/i386: Assert CODE64 for x86_64 user-only target/i386: Assert LMA for x86_64 user-only target/i386: Assert !ADDSEG for x86_64 user-only target/i386: Introduce REX_PREFIX target/i386: Tidy REX_B, REX_X definition target/i386: Move rex_r into DisasContext target/i386: Move rex_w into DisasContext target/i386: Remove DisasContext.f_st as unused target/i386: Reduce DisasContext.flags to uint32_t target/i386: Reduce DisasContext.override to int8_t target/i386: Reduce DisasContext.prefix to uint8_t target/i386: Reduce DisasContext.vex_[lv] to uint8_t target/i386: Reduce DisasContext popl_esp_hack and rip_offset to uint8_t target/i386: Leave TF in DisasContext.flags target/i386: Reduce DisasContext jmp_opt, repz_opt to bool target/i386: Fix the comment for repz_opt target/i386: Reorder DisasContext members target/i386: Add stub generator for helper_set_dr target/i386: Assert !SVME for user-only target/i386: Assert !GUEST for user-only target/i386: Implement skinit in translate.c target/i386: Eliminate SVM helpers for user-only target/i386: Mark some helpers as noreturn target/i386: Simplify gen_debug usage target/i386: Tidy svm_check_intercept from tcg target/i386: Remove pc_start argument to gen_svm_check_intercept target/i386: Remove user stub for cpu_vmexit target/i386: Cleanup read_crN, write_crN, lmsw target/i386: Pass env to do_pause and do_hlt target/i386: Move invlpg, hlt, monitor, mwait to sysemu target/i386: Unify invlpg, invlpga target/i386: Inline user cpu_svm_check_intercept_param target/i386: Eliminate user stubs for read/write_crN, rd/wrmsr target/i386: Exit tb after wrmsr target/i386: Tidy gen_check_io target/i386: Pass in port to gen_check_io target/i386: Create helper_check_io target/i386: Move helper_check_io to sysemu target/i386: Remove user-only i/o stubs target/i386/cpu.h | 8 + target/i386/helper.h | 43 +- target/i386/tcg/helper-tcg.h | 5 +- target/i386/tcg/bpt_helper.c | 2 +- target/i386/tcg/excp_helper.c | 18 +- target/i386/tcg/misc_helper.c | 79 +-- target/i386/tcg/seg_helper.c | 43 -- target/i386/tcg/sysemu/misc_helper.c | 52 +- target/i386/tcg/sysemu/seg_helper.c | 29 + target/i386/tcg/sysemu/svm_helper.c | 30 +- target/i386/tcg/translate.c | 891 ++++++++++++++------------- target/i386/tcg/user/misc_stubs.c | 75 --- target/i386/tcg/user/svm_stubs.c | 76 --- target/i386/tcg/user/meson.build | 2 - 14 files changed, 600 insertions(+), 753 deletions(-) delete mode 100644 target/i386/tcg/user/misc_stubs.c delete mode 100644 target/i386/tcg/user/svm_stubs.c -- 2.25.1