From patchwork Fri Sep 6 05:16:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 825903 Delivered-To: patch@linaro.org Received: by 2002:adf:a345:0:b0:367:895a:4699 with SMTP id d5csp638345wrb; Thu, 5 Sep 2024 22:21:43 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWQtPXu9pMJ6o7HstL55qZLJC80msaZ+2B1Fz0ufbucu1OZHmrumSqkUxO6Jnp+ytmn0GqJXw==@linaro.org X-Google-Smtp-Source: AGHT+IFQbz7jTaKYtGjggSHsa7Z4HqsuchCNwwd+GmW9qsxOtsLmhXHLf/sN+2FwBG3pcSh4NgSK X-Received: by 2002:a05:6214:5507:b0:6c3:56db:c292 with SMTP id 6a1803df08f44-6c356dbc354mr173806436d6.54.1725600103299; Thu, 05 Sep 2024 22:21:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725600103; cv=none; d=google.com; s=arc-20240605; b=Mpe5QTmHG8VZZ5sSObMwiW0B3Cm7GS6bti9D3QPbKnIoiZxUiSZi7whMXuaHDJleb/ 54wGMuoke0Rxh+7G2TIGZsF/uu/fdivXIHw+AxFfH8H3ffbKAdx2Bbzcg7WCOrWbF5z0 hodKZ1+RVye09pkJVn0ZH8pId323mxdxn/JdJ7VTZOwnsYPS9dLmUCKmX8Es6As4ypJ2 JeC4K2whZDQ1sUxFqi5d6Yutat6qJtANoPHO25fxuK84G6Ep0qIega2Lh18FQRIgghbl fKDUwUbcknuWu3eDHaH3dJ3kSwqj0UrDxE70Hh8HQ4gYfBho3nC838K1DcgVPtwW/0Yo D+mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=+in/DyVFu2COOQcr3zqxsRFMHNEtFrYSIMNT2sL7X0M=; fh=73++FxpCBH5KDXgG1Nqvg9f5zGI68qj4hqVYWy1KEho=; b=agiEBtZKID9uV8McUZfm0KFIb3r76GUxaaSEgeM852T2JHt9oCVBnyEG49mc+FHlJ1 YgffHjX1wnHXo/4wK2RwHCIFHlKes8QF/5Q6bA3n9ZMdqW9At0XhtKJfSTVSzGjBs2jV /LR9HgqwksJp3SoQ6SY1RihSwtFKrdkkSlV8LhxEdnIGvsfYzjW6hv+RKWh7gZsZqlX/ HCzrpyC6WQKQVKHhlkNgmPed3M8Ggpz2v71IusmgsQ45VL5vfl3YoDUlylsruEvVGd9r iV+Or8OmjFyJtSJ/rh19C8DpPKjBT7ysVaYH6E9sB7FJ6xXLU5nv/bYw3OoUEOkSRiki LYbg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6c52031fd9dsi36348646d6.235.2024.09.05.22.21.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 05 Sep 2024 22:21:43 -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; 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" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1smROo-0005p1-84; Fri, 06 Sep 2024 01:20:48 -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 1smROO-0004RO-V8; Fri, 06 Sep 2024 01:20:26 -0400 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1smROB-0008NS-0b; Fri, 06 Sep 2024 01:20:08 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 7F4318C13A; Fri, 6 Sep 2024 08:15:18 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 2FAE413337F; Fri, 6 Sep 2024 08:16:36 +0300 (MSK) Received: (nullmailer pid 10498 invoked by uid 1000); Fri, 06 Sep 2024 05:16:34 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , Paolo Bonzini , Michael Tokarev Subject: [Stable-7.2.14 37/40] target/i386: Do not apply REX to MMX operands Date: Fri, 6 Sep 2024 08:16:25 +0300 Message-Id: <20240906051633.10288-37-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Cc: qemu-stable@nongnu.org Fixes: b3e22b2318a ("target/i386: add core of new i386 decoder") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2495 Signed-off-by: Richard Henderson Link: https://lore.kernel.org/r/20240812025844.58956-2-richard.henderson@linaro.org Signed-off-by: Paolo Bonzini (cherry picked from commit 416f2b16c02c618c0f233372ebfe343f9ee667d4) Signed-off-by: Michael Tokarev diff --git a/target/i386/tcg/decode-new.c.inc b/target/i386/tcg/decode-new.c.inc index 1dfc368456..88de92ed16 100644 --- a/target/i386/tcg/decode-new.c.inc +++ b/target/i386/tcg/decode-new.c.inc @@ -1176,7 +1176,10 @@ static bool decode_op(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode, op->unit = X86_OP_SSE; } get_reg: - op->n = ((get_modrm(s, env) >> 3) & 7) | REX_R(s); + op->n = ((get_modrm(s, env) >> 3) & 7); + if (op->unit != X86_OP_MMX) { + op->n |= REX_R(s); + } break; case X86_TYPE_E: /* ALU modrm operand */