From patchwork Tue Oct 15 15:44:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 835470 Delivered-To: patch@linaro.org Received: by 2002:a5d:4c8f:0:b0:37d:45d0:187 with SMTP id z15csp304982wrs; Tue, 15 Oct 2024 08:47:04 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWQ4gEKk4qkXIXeha+OkVH1AbEFPHZ/2+vd+c9G1Jdol6BzpFPe6fMUsXkd4Mn8zomozS7U6Q==@linaro.org X-Google-Smtp-Source: AGHT+IGvV7iZ9u5EvVZ79Qlp7kJMNwlmfYMddw/AyYmEuPNhfff4LLBuJACaEqDE0+KFym18weVv X-Received: by 2002:a05:6902:150b:b0:e24:9a82:eb9b with SMTP id 3f1490d57ef6-e29780e1503mr855298276.0.1729007223926; Tue, 15 Oct 2024 08:47:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1729007223; cv=none; d=google.com; s=arc-20240605; b=lZ6RmkjCkYFdGQO9PhFUDPb4t+ihlN8Q0GmmaXnlydlPhs+obCPEkU/BlXpjslGVlM FJH04JYduc/Hbpj71Ps/XY54kMU/WMKv2HDSz6eRlq0gNuxRNWVDLqI6UU3JBcl02jiE UCuINoX1e9+lA4fXv5JaRiY3JMhXp5aHdjeHWakKXLzxTtz6Ot8sfQUHSherqC7JUTy7 zO5ZfEXqFcQzznL7GZvRCjUIP5zetRBSzXBbAgy1a2q1rkuXgbsRELlZHTTFDh7Yd0XO pP1dApPVkkOxrM1TQt9zBk/PfPYO/sTKxAPTjlOFTGbFhuuQfJ4jjKbW/1rJIrcEuTD8 pmpA== 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:dkim-signature; bh=wE+j6sYSDQnj04FOXSrYmsK1n/6FhkfUBDKG2lPE568=; fh=PGfEOx04XnvL/8Nun0MfKnWqAt99bm+Sh5MxcMxSB00=; b=cdAnCTlJdZytoMVDz70/n0h0QYkGP1bxyi1emNVbgWdHELLid93ceQBzahTXrU6QJu q+yWPooQ74ORKkUIarLF08ud5xDvRZfGciuU/I5nAzkZD7hV8AwiM7bi+HcZpP1HMJAo EsR6gNMI4FLHEtZx5X5XsbwenMkt8UBWvAgIuUYX1KUumGTu3edecj7IWHk1+HgFAPPe x1QT1CtbA+BWZITURzoo2B5bDIw11x4yN+9LqTgyWsuAO0qZq3Rzj4sMZfX1YER8E29Q d0/GL5QU2PzMZSOWiLCXXzr3dBTbLVwvZtDm9DHwBtnryH8AlIDCjPQrRKjV5FSmIZ6z 9aoA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CzqHmWxM; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46089ea8764si4772521cf.724.2024.10.15.08.47.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 15 Oct 2024 08:47:03 -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=pass header.i=@linaro.org header.s=google header.b=CzqHmWxM; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t0jl9-0002EP-08; Tue, 15 Oct 2024 11:46:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t0jkO-0000tu-LP for qemu-devel@nongnu.org; Tue, 15 Oct 2024 11:46:13 -0400 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t0jkM-0000oH-9b for qemu-devel@nongnu.org; Tue, 15 Oct 2024 11:46:08 -0400 Received: by mail-pg1-x533.google.com with SMTP id 41be03b00d2f7-7ea80863f12so1040569a12.1 for ; Tue, 15 Oct 2024 08:46:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729007164; x=1729611964; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wE+j6sYSDQnj04FOXSrYmsK1n/6FhkfUBDKG2lPE568=; b=CzqHmWxM8wAqvx+avqXhpJQxTYV8lPbZNWc6+YLlYu4giE0JWOdfh+qyceECVFBYlr 1HGIGbDVbtY8KjS8jRsXpRjW9B8jEO3xNaRFvzWYLX2Nb/LM1HjuorXysHIFhd1CkZBJ 11STLNr5OSpjgF8S8mnvYDXuRZDO6QxQ5ZnaC6pomeZ/aXooAQ10EPTpwBEg0xG+3EIH 53JrbF0D2bL1r7mGfFDGi/KXgTVUaOraNnflcnyOpU0o5OqMjiENc30Pf7mU0o16aMVi KmbhyFiLwJ8fllQxXeijNzpzHC2FGgWYiF1Xl6/h8uWh3wX3wIYUO5Osd19/oiUvtZcX 05AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729007164; x=1729611964; 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=wE+j6sYSDQnj04FOXSrYmsK1n/6FhkfUBDKG2lPE568=; b=kHOtZhug5xCSBf42TUU5B/Phtw01HFLsSYhayWXSJurCv3GryH8bk4NrtJJzvSClEg ILauftPj7tisCOefDoaUZklbN7zNYyFo0TP36S64KsgDCthHCpIb5prZevokL2l542EE n9R3K7/82OuLtMTQnpU/wACWvVKHcBgqF19HK/OYylr5uchUHPYgq53GIHzhXt96N+eY K3MvK9d4PCx/amUL/KXce0uVDhXojASZPbQ7soHCi+EWtXdp4UJtY68NvuGD7jdhHJhi 41MDO22FwpkNVRB9jMspr2RPu8BhIZLf5cc+5lWl8qjjj9eQ4RU3SkUhudSrrq50u2To XrQg== X-Gm-Message-State: AOJu0YyFqYKm+alMB1GhRB5k8uJT44d8qOecf+AAjTvBhI5taseKbkD9 QWZNRmAuXwMiV6BfRyWXAb5HovWrukuHT6FkC1Oop4JoRf4brGzoTiFcX62litBZfQ71f4alimK s X-Received: by 2002:a05:6a21:3943:b0:1d8:af46:2152 with SMTP id adf61e73a8af0-1d905ec45c0mr886004637.11.1729007164507; Tue, 15 Oct 2024 08:46:04 -0700 (PDT) Received: from localhost.localdomain ([45.176.88.167]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71e77518a5fsm1398077b3a.214.2024.10.15.08.46.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Oct 2024 08:46:04 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Thomas Huth , Richard Henderson Subject: [PULL 11/33] linux-user/i386: Use explicit little-endian LD/ST API Date: Tue, 15 Oct 2024 12:44:20 -0300 Message-ID: <20241015154443.71763-12-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241015154443.71763-1-philmd@linaro.org> References: <20241015154443.71763-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::533; envelope-from=philmd@linaro.org; helo=mail-pg1-x533.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The x86 architecture uses little endianness. Directly use the little-endian LD/ST API. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Message-Id: <20241003234211.53644-4-philmd@linaro.org> Reviewed-by: Richard Henderson --- linux-user/i386/signal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-user/i386/signal.c b/linux-user/i386/signal.c index cb90711834f..0f11dba831f 100644 --- a/linux-user/i386/signal.c +++ b/linux-user/i386/signal.c @@ -754,8 +754,8 @@ static bool restore_sigcontext(CPUX86State *env, struct target_sigcontext *sc) env->eip = tswapl(sc->rip); #endif - cpu_x86_load_seg(env, R_CS, lduw_p(&sc->cs) | 3); - cpu_x86_load_seg(env, R_SS, lduw_p(&sc->ss) | 3); + cpu_x86_load_seg(env, R_CS, lduw_le_p(&sc->cs) | 3); + cpu_x86_load_seg(env, R_SS, lduw_le_p(&sc->ss) | 3); tmpflags = tswapl(sc->eflags); env->eflags = (env->eflags & ~0x40DD5) | (tmpflags & 0x40DD5);