From nobody Sun Nov 24 01:24:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1727999067; cv=none; d=zohomail.com; s=zohoarc; b=WGK2zBWPaJ2w+uggkobO/rO6WoCWofF7KWv5B9jElVx1ajnV+C5N/kpUGzFV9VOhwicmQUFU4l40M93P5UF3x9fTO0OVVWpanc7nAPBUdeuovgDgEV53veL9S18k3AzIVSAwIj+YvR934y+5hNZTea66VR2a3Ie+4TNu8h3ipKc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727999067; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Z1QD6cD3yUP4Co4YUKGgzzxrZ+bpsLuJ7Figy/5ND0k=; b=gxBO+usNwpbIp6HKSVaymjFqWvcY1FkCvNXQeXmZm3PQHQyAk1NFgou1a5n1aMKWZTzs9dlEBOJSIzc1hJCZ63fw4nJforDyQE5Esh5TChuBPAGK61/V25jIkJgAgHWeGtdkZgEf+RzJiOFAo/jrV0QwL1XmAUgQ1WJcP7Sbbf0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1727999067191602.9007712437945; Thu, 3 Oct 2024 16:44:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1swVTW-0007fu-CV; Thu, 03 Oct 2024 19:43:14 -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 1swVTT-0007ef-3H for qemu-devel@nongnu.org; Thu, 03 Oct 2024 19:43:11 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1swVTQ-0003oA-5m for qemu-devel@nongnu.org; Thu, 03 Oct 2024 19:43:10 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-42e5e758093so13320175e9.1 for ; Thu, 03 Oct 2024 16:43:07 -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-42f86a20537sm1340495e9.15.2024.10.03.16.43.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Oct 2024 16:43:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727998986; x=1728603786; 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=Z1QD6cD3yUP4Co4YUKGgzzxrZ+bpsLuJ7Figy/5ND0k=; b=InJv+gx02WJp74aMtkkGQjVqi92Bnf7F/OWzvMm2doFX6P6rO3kPupha5KUvJLlHpE Ch0mICgcZbfdrpI2zG12s8eIwT6xfzU0zPWZIXo20a8qLVbayiQO+okZx13ClCRp1zpB qQSkwBaxNi8IVFN662d/NujMB2ADZMOLz27GvpBQoJe752Jb3FkID748zgoVNAQYR1zF NCWaVk0lRWFA2K57AiEKlEWh8jeR+/plOQy+pmG2QMfKusqFXj3DV3SrZAldaev7m/oQ tfLKsxvxcOZ+Ocbk9QCyKDAGpALjFJlKcrnqYAOf81I6oUOGUJXyLDR7pEiWI+33Fq9e 97Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727998986; x=1728603786; 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=Z1QD6cD3yUP4Co4YUKGgzzxrZ+bpsLuJ7Figy/5ND0k=; b=mf55CP7m5MHzoCzrS5bVRX32E3K3O60XBSzDu/WuAnK1Bxra32+F9vmFblWZjtZ1CG Tn9UG6Gd7IVJYyyhTMlGwCGw2o2sjUYUMFKsgmuCjAUEMf6jFrU+AIcKBeFRdJsEcQjD b3elUk6TSdTAbBHkuKWvAJ2uFSDenkeYvnGP6KIYSlXsSyC1mt/49h/nr8dBkj/feCJe fu2M1TAqUHJLpdY2r7xeGaNTKzDaWgvokk+bkzGfiihSQQ8fjRotN0E538jmgnmEaqvG WOrziqU3enjIQ0Duz5mbNtSO8t0gM4YfGw5Fl9J9n7se0Dw3YnmvxR76GNvcEsbTSMFC f1nw== X-Gm-Message-State: AOJu0YwyAUrY9KdQ0iymf4GO8c/8ipPmi4WwtW9CIin3kLaLgirQQHmh cS5FCbj/HSczm3zxDvONhkLLtaU16LRy9aEdXAISoyFHDKYXJEcHruBax0tm8+/e2k19+UVSyRV rdio= X-Google-Smtp-Source: AGHT+IHnogbccrvdvf0bnbP1G/jvo+XfKiRZju4L/aWRsl3BFT5ro7mTJVZpSj4D60pGQ9j/vMh9UA== X-Received: by 2002:a05:600c:524c:b0:42c:bae0:f065 with SMTP id 5b1f17b1804b1-42f85aa32famr4151435e9.5.1727998986282; Thu, 03 Oct 2024 16:43:06 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-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=20Mathieu-Daud=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=20Chigot?= , Paolo Bonzini , "Michael S. Tsirkin" , Thomas Huth , Bastian Koppelmann , Richard Henderson , Pierrick Bouvier Subject: [PATCH 06/16] hw/m68k: Use explicit big-endian LD/ST API Date: Fri, 4 Oct 2024 01:42:01 +0200 Message-ID: <20241003234211.53644-7-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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=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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1727999069072116600 The M68K architecture uses big endianness. Directly use the big-endian LD/ST API. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- hw/m68k/bootinfo.h | 28 ++++++++++++++-------------- hw/m68k/mcf5208.c | 2 +- hw/m68k/next-cube.c | 2 +- hw/m68k/q800.c | 4 ++-- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/hw/m68k/bootinfo.h b/hw/m68k/bootinfo.h index 70c1dc0e8c3..0b3e7c4ea01 100644 --- a/hw/m68k/bootinfo.h +++ b/hw/m68k/bootinfo.h @@ -14,39 +14,39 @@ =20 #define BOOTINFO0(base, id) \ do { \ - stw_p(base, id); \ + stw_be_p(base, id); \ base +=3D 2; \ - stw_p(base, sizeof(struct bi_record)); \ + stw_be_p(base, sizeof(struct bi_record)); \ base +=3D 2; \ } while (0) =20 #define BOOTINFO1(base, id, value) \ do { \ - stw_p(base, id); \ + stw_be_p(base, id); \ base +=3D 2; \ - stw_p(base, sizeof(struct bi_record) + 4); \ + stw_be_p(base, sizeof(struct bi_record) + 4); \ base +=3D 2; \ - stl_p(base, value); \ + stl_be_p(base, value); \ base +=3D 4; \ } while (0) =20 #define BOOTINFO2(base, id, value1, value2) \ do { \ - stw_p(base, id); \ + stw_be_p(base, id); \ base +=3D 2; \ - stw_p(base, sizeof(struct bi_record) + 8); \ + stw_be_p(base, sizeof(struct bi_record) + 8); \ base +=3D 2; \ - stl_p(base, value1); \ + stl_be_p(base, value1); \ base +=3D 4; \ - stl_p(base, value2); \ + stl_be_p(base, value2); \ base +=3D 4; \ } while (0) =20 #define BOOTINFOSTR(base, id, string) \ do { \ - stw_p(base, id); \ + stw_be_p(base, id); \ base +=3D 2; \ - stw_p(base, \ + stw_be_p(base, \ (sizeof(struct bi_record) + strlen(string) + \ 1 /* null termination */ + 3 /* padding */) & ~3); \ base +=3D 2; \ @@ -59,13 +59,13 @@ =20 #define BOOTINFODATA(base, id, data, len) \ do { \ - stw_p(base, id); \ + stw_be_p(base, id); \ base +=3D 2; \ - stw_p(base, \ + stw_be_p(base, \ (sizeof(struct bi_record) + len + \ 2 /* length field */ + 3 /* padding */) & ~3); \ base +=3D 2; \ - stw_p(base, len); \ + stw_be_p(base, len); \ base +=3D 2; \ for (unsigned i_ =3D 0; i_ < len; ++i_) { \ stb_p(base++, data[i_]); \ diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c index b6677ad6bc3..e37cd50d189 100644 --- a/hw/m68k/mcf5208.c +++ b/hw/m68k/mcf5208.c @@ -359,7 +359,7 @@ static void mcf5208evb_init(MachineState *machine) /* Initial PC is always at offset 4 in firmware binaries */ ptr =3D rom_ptr(0x4, 4); assert(ptr !=3D NULL); - env->pc =3D ldl_p(ptr); + env->pc =3D ldl_be_p(ptr); } =20 /* Load kernel. */ diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index 9b78767ea8e..9832213e7ec 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -1036,7 +1036,7 @@ static void next_cube_init(MachineState *machine) /* Initial PC is always at offset 4 in firmware binaries */ ptr =3D rom_ptr(0x01000004, 4); g_assert(ptr !=3D NULL); - env->pc =3D ldl_p(ptr); + env->pc =3D ldl_be_p(ptr); if (env->pc >=3D 0x01020000) { error_report("'%s' does not seem to be a valid firmware image.= ", bios_name); diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c index fa7683bf76f..556604e1dcf 100644 --- a/hw/m68k/q800.c +++ b/hw/m68k/q800.c @@ -684,9 +684,9 @@ static void q800_machine_init(MachineState *machine) =20 ptr =3D rom_ptr(MACROM_ADDR, bios_size); assert(ptr !=3D NULL); - stl_phys(cs->as, 0, ldl_p(ptr)); /* reset initial SP */ + stl_phys(cs->as, 0, ldl_be_p(ptr)); /* reset initial SP */ stl_phys(cs->as, 4, - MACROM_ADDR + ldl_p(ptr + 4)); /* reset initial PC */ + MACROM_ADDR + ldl_be_p(ptr + 4)); /* reset initial PC= */ } } } --=20 2.45.2