From patchwork Tue Apr 19 09:10:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 563321 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6886:0:0:0:0 with SMTP id m6csp3106531map; Tue, 19 Apr 2022 02:38:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwuPwpnvlQcjEA74/9nUELKnmxW24LxDKtWuBBPNaQmr41CUf4IMJhep0fSmVJirxZl4Z8I X-Received: by 2002:a05:620a:424b:b0:67d:36cc:5afb with SMTP id w11-20020a05620a424b00b0067d36cc5afbmr9090580qko.598.1650361119726; Tue, 19 Apr 2022 02:38:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650361119; cv=none; d=google.com; s=arc-20160816; b=fBdYfs4tDHfa8al2A83dg/1YN+JQJm1SKEkSVvGp8e+Dr+0GvAOy2WQkL4D/ZlMYaH O5s9ffqLOIDTiVi8hBMsSLE7ib+gc73Rb0jmPfnpPABCuliLJiSMN6O0oR/vxGZQkjQL kJ9821xcnOQgazYtFTI6cDi51A0/8IffzOvWwg2FuwFy+ay6RNz+ODqgwpRTHtMWxVPP Wfm8yDqNOYoRLpCFPFwfuWpAJuiqs6EHEpsjeMzL5LH/+uGUUdiwFJzNxi7bmtaAB2PQ +xvFLURSN70lfGAA16YzqAPPc9aOZHqaQNLlvYdEtxPLwrXV67qY6S1N9j7SLzbISx9f 2plw== 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:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=19yBPFT8fDkA88OxAXBAkM2RLEH19AEV2wzR+Tq5Ue0=; b=URy/izKjrM683bLc98QLnTNEbI7oUPWdhbsW5zzvydPOEnI2U9nPre3Y+JB9tnqGSr 7i471U/DEvKTI+PuxAhZn5fnxK/80/dQnImUUJCdH3D4CIyQCl8CiKfUW1bnp4WbpiLL Egxy1/Grm25KiyI5PWInfC114Vg+ZE387Bh/g+EWg/MgaDzzvMcHs2eFOAINUmlJHaLo 7Zxjmp4IZUWC5PnUPhUBfa/kBU7gYIE/x72g8GfUMzivyaBgO3P/C1YYa0+WTKPKbyGV d9otTHZ18MsqPcEhw/zr5Pw/P9rHXtDJtGDYBf4bNAPrOV2G/D90F0hB0hImM8C8+Tn4 XFUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=JHICkion; 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 k3-20020ac85fc3000000b002f1f9385c0asi2134139qta.423.2022.04.19.02.38.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Apr 2022 02:38:39 -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=JHICkion; 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]:36802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ngkJj-0008HY-Ae for patch@linaro.org; Tue, 19 Apr 2022 05:38:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38918) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ngk1d-0007UI-0G for qemu-devel@nongnu.org; Tue, 19 Apr 2022 05:20:01 -0400 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]:39502) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ngk1b-0001Qc-1e for qemu-devel@nongnu.org; Tue, 19 Apr 2022 05:19:56 -0400 Received: by mail-ej1-x632.google.com with SMTP id bv19so31605691ejb.6 for ; Tue, 19 Apr 2022 02:19:54 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=19yBPFT8fDkA88OxAXBAkM2RLEH19AEV2wzR+Tq5Ue0=; b=JHICkionZ8Hlnhxk0EdmX3iMP6rVF0P3LP9Bb7FeulKcjwXFJdAD5bY2AtQI3QZnz0 OV2jGVOmKthQ2nY2XJIzzWvfwi+BRUyAArGG4ZsI865l7cjKPR0xuHexUMX38JyYppX0 i9sb6j5bZwBxXnvvPkWVsM3W4WWyoFTvX8l7vpxJ8h7iLwaE0Bbar1kSfqWLD1HQSaJg gm/YhX27NJO4HewP/+hD7nsv0LGGjeAMAoLrx6Lu/AEh0ssj0Fi9cIxHwlbJG1M6wnH6 fBUJkHiaPD3DzKLno3/QUSGHESUlE8gIexjXq+tFpaGIpweOKTNaKHJsPMiBn8LNP/ge 7d/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=19yBPFT8fDkA88OxAXBAkM2RLEH19AEV2wzR+Tq5Ue0=; b=j+C42a3Inrdb/LS8EKDiprsca/34z3V/oA3Dc1t3gfleaU+ZJlwbnsbxqwBxl/pTd9 Xu+gxDX6CrWKZKfowzgzqzbsvBno36kytPayY0gfJAOCjInERFpX9CyH6bs6Ka+o7OYf 0g8V4Kq6tyViSD/22vH9uBngPYAROrqFyhC291N0azKlWgRXDXfygM0I83OmqIgFTgKH XTNlP/B0uIzsECLXjFwZNEMJESFFm7qj4SRAhpk9o4kkwCP+0sjEGVwbT2zZV90kDNZt a+OqOoSHcARxeg5v0drJs/1h+WxppGhqaZ9hpvbnJg9SEJAnJ5ifi81UOO/D1Am8c9tJ hsyQ== X-Gm-Message-State: AOAM532WIAIFZCveMNLuWuWWvPdpLt4q/JbZkfnl0P3e/2pYI37ZeyY5 zl5hbOTGvr8D8zXp59jd/4ohig== X-Received: by 2002:a17:907:2ce3:b0:6ef:eadf:443b with SMTP id hz3-20020a1709072ce300b006efeadf443bmr706073ejc.288.1650359993675; Tue, 19 Apr 2022 02:19:53 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id a18-20020a170906671200b006e05929e66csm5449973ejp.20.2022.04.19.02.19.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Apr 2022 02:19:49 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id B3D121FFCF; Tue, 19 Apr 2022 10:10:22 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 24/25] target/i386: fix byte swap issue with XMM register access Date: Tue, 19 Apr 2022 10:10:19 +0100 Message-Id: <20220419091020.3008144-25-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220419091020.3008144-1-alex.bennee@linaro.org> References: <20220419091020.3008144-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x632.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, T_SCC_BODY_TEXT_LINE=-0.01 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: , Cc: fam@euphon.net, berrange@redhat.com, Richard Henderson , f4bug@amsat.org, qemu-stable@nongnu.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" During the conversion to the gdb_get_reg128 helpers the high and low parts of the XMM register where inadvertently swapped. This causes reads of the register to report the incorrect value to gdb. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/971 Fixes: b7b8756a9c (target/i386: use gdb_get_reg helpers) Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Cc: qemu-stable@nongnu.org --- target/i386/gdbstub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386/gdbstub.c b/target/i386/gdbstub.c index 098a2ad15a..c3a2cf6f28 100644 --- a/target/i386/gdbstub.c +++ b/target/i386/gdbstub.c @@ -129,8 +129,8 @@ int x86_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n) n -= IDX_XMM_REGS; if (n < CPU_NB_REGS32 || TARGET_LONG_BITS == 64) { return gdb_get_reg128(mem_buf, - env->xmm_regs[n].ZMM_Q(0), - env->xmm_regs[n].ZMM_Q(1)); + env->xmm_regs[n].ZMM_Q(1), + env->xmm_regs[n].ZMM_Q(0)); } } else { switch (n) {