From patchwork Thu Oct 3 23:42:02 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: 832440 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp529290wra; Thu, 3 Oct 2024 16:44:40 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVmL5TEDqQP+w7kd0P0knc/B6u5urpMFAWPhzrRiS+3Q459T+2ipQa2i75kcOR4Tv3zmSoYWQ==@linaro.org X-Google-Smtp-Source: AGHT+IHQfKHx4qiGewLKIL0afXkBfCneH6WHD6Wo0z1BXEO36dLcG471kGtvMulYF112Gqwm6Cw6 X-Received: by 2002:a05:622a:407:b0:458:5992:34c1 with SMTP id d75a77b69052e-45d9ba4ae1cmr12185571cf.16.1727999080710; Thu, 03 Oct 2024 16:44:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727999080; cv=none; d=google.com; s=arc-20240605; b=fDdylSbzwMqvGMjt7gMLq3tlTiJvfihlreVxuQX1ftLyZ2zpN5CGCdzcUwghIt5Y/0 q/k9yn9WOGlOtmy8QwTOCHDjpjitTRo35SMvHy8ywL7vOOU2RPIJIiePZG56RkbVqp6T nx4bOD9K1FqKqcgeNaqZcrI0yvMiFhviXRaXcHHkoZu4kCxQM+7+YLZfEySqBW5eBnsB rWCFGm7+gmvVH1BmNrqsEOaI5r8/Ryp+H+Yo+xGcLXyz3AtgDc35ChD7To8xbvLTxfvA Qnv02NUBUMfFRYYS571C7Gl6J5yvIEiXGm7jeHZsuhQPexjnHxIjopVEHAiL8qSVaAWV g6/w== 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=Gli2giWmo6/3/Q3D0dlOvqkXZTs2pwWeMPJl2E3h3vs=; fh=nW81HitAWvlF9bIdfU4jFbnEE30qf0mnop6z+LPTekQ=; b=ipd+eB5Meo7zLj3BbDFSFz8BWyjKvFKuu0kHYr4Z5BYo1SGp6n/D5BIwfVeypZPml1 OzV7hp87Ytkd24gztgZ0HlHdXnucYpw8ChqiwRM5kRBaPILwQ740aLyVVcYWlPHOX/fK e7yVFmm5gf+hV+8SbrSJYDPsDOpHUZK/NGdQXCmu6Ib1OZJt7KrttWkisB3l1n9ebHJR 0HhFwjWkDop/0+86TxhmRxKlen/mwHaWU9sB0MqyFxKtAw449gLEVkUwGr61lYP2SNZs J7eNB5CQJ6yJhcRDl7VTlKU44S5nVF+JWvN8wM6VG5q2J46DIFzETMSjF37KdwnvC9lQ PMHQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YcXLwcrg; 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-45d9551835asi18329431cf.531.2024.10.03.16.44.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Oct 2024 16:44:40 -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=YcXLwcrg; 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 1swVTr-0007wt-JY; Thu, 03 Oct 2024 19:43: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 1swVTZ-0007hm-K8 for qemu-devel@nongnu.org; Thu, 03 Oct 2024 19:43:18 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1swVTY-0003pI-08 for qemu-devel@nongnu.org; Thu, 03 Oct 2024 19:43:17 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-42cbc22e1c4so12171895e9.2 for ; Thu, 03 Oct 2024 16:43:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727998993; x=1728603793; 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=Gli2giWmo6/3/Q3D0dlOvqkXZTs2pwWeMPJl2E3h3vs=; b=YcXLwcrgzol2HcyeU7eme7WKRviJcfPOei3p/7lJN7+hxmEp7Om1rPOelEaZzbVtix 1ZXAmsk6MtQ0xSst88adylWUvm06leeF0nCEtmPYf0fumN4iGyt1YteQJ/UqYxK5Sjck AGuvNGd/SWfbyAvREeIYNUdynLTyd4GYkbVrrHhMwtC4j9odK9VeacEoIPKIdbS8o1kW xJBSkHit7yBi8XHtuIkBP23dtLO7e5JSAwDA01SWdpzXIIPLgFCqZ7g8liQuq2wTLMfO Lsi7C5DT1vlThGNCEEMxy2jOYeowKj6VT8Mw34JlyMQ7Lkx2be1L7ho7KQkJTzcncosE NvGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727998993; x=1728603793; 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=Gli2giWmo6/3/Q3D0dlOvqkXZTs2pwWeMPJl2E3h3vs=; b=jG9J1HUagQ7CESV4r0chzI+U4rFo7T3NkCcFWYNdSzJJx3mtjRLu9lvFBBhtfYaS9R HnQkFKnMp53nRp0EyAdFNC3SJQzQVJFYciQ4nheNVZ0gUbyCA8KtwZDwNhn3RuEZNvzk YVuwH0Bpsx65yrSHcd48mTYZIJcFkXiXa2Zpxz27aphhZhnYvaO69UA7xXHdfipXEPlV 8m2IX+DvInnsllqAtyrtXuSbWThyJH58srDi0Oiu0iPl4F7Pfv6U2Tw9PpcaYYefXPTw 8x8IDbYzk/HLrDO0kX8m/tWF+M9TT+LwHJ9LMxoDd+LRKHkYTXpIlm0wsv+kOg7Ldfhf bVIg== X-Gm-Message-State: AOJu0Yyz6QCURas7Hxk9ppIrBYCU3CEaO/FRDh0ONvnR3ys55L+W2hyK AK+EaK4z1YdlCRdb8NI5RSDPXb96eUlOhWnX9U5zHpV5imTVA6+LPVsPstuD72U//QLVIHOuwZ0 fiZE= X-Received: by 2002:a05:600c:1ca4:b0:42f:8515:e479 with SMTP id 5b1f17b1804b1-42f85aa142dmr3417795e9.4.1727998993421; Thu, 03 Oct 2024 16:43:13 -0700 (PDT) Received: from localhost.localdomain (45.red-88-29-191.dynamicip.rima-tde.net. [88.29.191.45]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42f86b1d06csm1322645e9.11.2024.10.03.16.43.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Oct 2024 16:43:12 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Michael Rolnik , Halil Pasic , Christian Borntraeger , Mark Cave-Ayland , Frederic Konrad , Artyom Tarasenko , Matthew Rosato , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , David Hildenbrand , Peter Xu , Ilya Leoshkevich , Song Gao , Thomas Huth , Marcel Apfelbaum , Eduardo Habkost , qemu-s390x@nongnu.org, Laurent Vivier , Eric Farman , =?utf-8?q?Cl=C3=A9ment_Chigot?= , Paolo Bonzini , "Michael S. Tsirkin" , Thomas Huth , Bastian Koppelmann , Richard Henderson , Pierrick Bouvier Subject: [PATCH 07/16] target/m68k: Use explicit big-endian LD/ST API Date: Fri, 4 Oct 2024 01:42:02 +0200 Message-ID: <20241003234211.53644-8-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241003234211.53644-1-philmd@linaro.org> References: <20241003234211.53644-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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.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 M68K architecture uses big endianness. Directly use the big-endian LD/ST API. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- target/m68k/gdbstub.c | 2 +- target/m68k/helper.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/target/m68k/gdbstub.c b/target/m68k/gdbstub.c index 15547e2313c..136159f98f2 100644 --- a/target/m68k/gdbstub.c +++ b/target/m68k/gdbstub.c @@ -52,7 +52,7 @@ int m68k_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) CPUM68KState *env = cpu_env(cs); uint32_t tmp; - tmp = ldl_p(mem_buf); + tmp = ldl_be_p(mem_buf); if (n < 8) { /* D0-D7 */ diff --git a/target/m68k/helper.c b/target/m68k/helper.c index 4c85badd5d3..9d3db8419de 100644 --- a/target/m68k/helper.c +++ b/target/m68k/helper.c @@ -57,15 +57,15 @@ static int cf_fpu_gdb_set_reg(CPUState *cs, uint8_t *mem_buf, int n) if (n < 8) { float_status s; - env->fregs[n].d = float64_to_floatx80(ldq_p(mem_buf), &s); + env->fregs[n].d = float64_to_floatx80(ldq_be_p(mem_buf), &s); return 8; } switch (n) { case 8: /* fpcontrol */ - cpu_m68k_set_fpcr(env, ldl_p(mem_buf)); + cpu_m68k_set_fpcr(env, ldl_be_p(mem_buf)); return 4; case 9: /* fpstatus */ - env->fpsr = ldl_p(mem_buf); + env->fpsr = ldl_be_p(mem_buf); return 4; case 10: /* fpiar, not implemented */ return 4; @@ -107,10 +107,10 @@ static int m68k_fpu_gdb_set_reg(CPUState *cs, uint8_t *mem_buf, int n) } switch (n) { case 8: /* fpcontrol */ - cpu_m68k_set_fpcr(env, ldl_p(mem_buf)); + cpu_m68k_set_fpcr(env, ldl_be_p(mem_buf)); return 4; case 9: /* fpstatus */ - cpu_m68k_set_fpsr(env, ldl_p(mem_buf)); + cpu_m68k_set_fpsr(env, ldl_be_p(mem_buf)); return 4; case 10: /* fpiar, not implemented */ return 4;