From patchwork Wed Dec 4 20:26:00 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: 847334 Delivered-To: patch@linaro.org Received: by 2002:a5d:434d:0:b0:385:e875:8a9e with SMTP id u13csp530488wrr; Wed, 4 Dec 2024 12:32:23 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVhui4nYv6dwA3+Zy4akb3JN6JRT0ab6a54F+ZEVrXqtb/GkkK4NeB2sp3a1VTxkw6Ckt2NkA==@linaro.org X-Google-Smtp-Source: AGHT+IGybaiFKOn7MbtSi8eIOUqXmYzQ5SrvdPlRE73i0AjG8qRUW/qhM+sZvE1cjp9JdRpvjvG8 X-Received: by 2002:ac8:7fd6:0:b0:466:88ba:2023 with SMTP id d75a77b69052e-4670c6fd0e6mr168813461cf.55.1733344342827; Wed, 04 Dec 2024 12:32:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733344342; cv=none; d=google.com; s=arc-20240605; b=P3HE5RRO2EYyG9RaQuVBm0fXiR0m+crCMYh/TxqzjQlhqQUfFNZZEcuAhUpSLt5lwa CuSJMdPd5nqAOXkCATZpxVfrexHOrNPdD8b2M97Tct7FcidxfP+A/cl27hmVUgeF3fkP xS+hhusBy2XnFbtXVxJXZixweNCBmy8kakeqLo+revs7eZN2A2zVXmaDXeLD8eHpbCp1 deTtifLWCYMCJSk3yuu1piWWn/JEsgk3YlOd6afv1sYFFUrPKXmWjzxrnskMitXoYE3r AHLTifUwsyXnSZ8Mu/UJVA2pwhLEf3UV7aesmn58i1UfK92pgqZDijvKMH/JOv4Ijz5z CU1A== 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=+kCFZSFSFl2GPP7FnxAPq5KUTVvEzSw2EnjHpYSMwwc=; fh=L8jp5KII9BO+EuE1/Uny/8be6w87XhXr9oO98kXieYU=; b=MqlQJ6eveGe4e17sXapzOJNToxNmCysNuDl/9bbVfDMzJZzJmrPq+PIMgqhS7CINyX RsyabQAOiR/Ee5BTG/UVwidfDwsS4yD/QN5jojZSl6Tx/sEuHWZHOBE50VWup3xb+ig8 27kgipIwJyjXbIBBUHoIvpw46nsyk48s9qBy8kSoU9qDwwne78ZXJtmxPZoVsQTzjcyQ 9hLP2ErcehIQwYne1SGD4K+LTxRQ/yR/mR54lHfzpyA2YdYE68aXLNnokR5PyLiNP8Yu kLm9Q+WN0XyFo6VWFxXfgVQmoGooeJebfXapDtyhio236avKe/e3my3v5YdnphVoPY+V cW5g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PTM+th+l; 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-466c41030desi208232141cf.315.2024.12.04.12.32.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Dec 2024 12:32:22 -0800 (PST) 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=PTM+th+l; 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 1tIvzW-0004NE-VH; Wed, 04 Dec 2024 15:28:59 -0500 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 1tIvyz-0003BE-Re for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:28:25 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIvyx-0003Ur-41 for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:28:25 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-434ab114753so1474975e9.0 for ; Wed, 04 Dec 2024 12:28:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733344101; x=1733948901; 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=+kCFZSFSFl2GPP7FnxAPq5KUTVvEzSw2EnjHpYSMwwc=; b=PTM+th+lByViOglR4dEWHAsKgVxSUueLcvOeIDvXbWY/hBirkZpWJ1wVQq379hpKbo 4nxiSau9O0FOUN/WW5X14hI/zFEvUlHc77ORhJAdkrxfd0zr3bmlykv2C8JgooYyJnyG LWc8DXjyYigwQ7RuXmbk+CDLBiBb2O93pWnPZmpCVFNH0g0gtsu2s+ADdF71Vp3dC7vf ZvH1MO5DAlg1Tc3MaGmtrSg74qDEhVDcwWeSzvnXlYX4LC8EXG+LF/Bzd8PD0m1cHLgh r2dfqhh+QI0SXOncQGKSk4tcEz2k4Y1y7XRsYDgC9cDm9jRvkEFHijZRx7XNfxN0Gjnh 85Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733344101; x=1733948901; 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=+kCFZSFSFl2GPP7FnxAPq5KUTVvEzSw2EnjHpYSMwwc=; b=U4iIUF8hy2SjUexU1l/oKShqCirN+tCW0cUShx9HhoIZGpvNshZSn5Ncwg6lg2QpAm tamZuVaQP43Xjtg+WtG/sW1CSgkFYpnvc3pS+plzr+4D3ZZM3wU3WiGzVinyvUVZHhKL Kqz8sz1pDKy7DOms/PreGmWleZjplOu2Fd2ypT6dKfi0Rb/szTpeXfdyuL1XZ3gV+Nvv gZ0XLMXrQY4wwImsxcg4N1/HCaqE3L0zd676UBWKCI16gZDzA86Os1Qg4XBfZxG2mRa5 JGpvmKhAMYw2MhML1Hf2U3JuUfhC/6SF1QljBxOszC8D7KVQyxnDKjz8hZa6HRd6n3xM vFGw== X-Gm-Message-State: AOJu0YwEY/cLvVXYQ1q6mLKKkSIbhXi9ZukOrTE1hhM5eocW/+bhh4iP MeqGe6mXhBisNmlhVSJcyo2TvcXD8TGYk9gN4A9vymav27H+xgG0pQgB9s+PjVz5oYKzFsaB2am J X-Gm-Gg: ASbGncvQtuh7sorJV2fAgHDoczeQNd2mk1Gv97qJ6wISF8YJfjGIfzDKPV9NenPRwIU sOC5s7K7GJkV63BVIG38ek7AozgrVMFQwGR+4/MZrrwl9RXrnhDmtAlNhkJYZlvFPAwFaNXMoa5 IpM3qQ1uCS4PzjsVoV97+AemRHZLADpRUs51BKLWZFnykdPC1pdw7T29Ycr+PcuS7F4+W2K4BPC 2oFV81g6oRke8eKO8OPW1GlhYzLcX1UiWmx3K+L7ysEI7OjjQaN9PmqQhGxRfcLy03mLgRlDmJ7 BgPi/E12giJ7uGHZql9AFyud X-Received: by 2002:a05:600c:4e8a:b0:426:616e:db8d with SMTP id 5b1f17b1804b1-434d09c8d82mr70145375e9.15.1733344101212; Wed, 04 Dec 2024 12:28:21 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434d526b375sm36220955e9.9.2024.12.04.12.28.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Dec 2024 12:28:20 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , "Michael S. Tsirkin" , Peter Maydell , Laurent Vivier , Mark Cave-Ayland , Alistair Francis , Anton Johansson , Zhao Liu , "Edgar E. Iglesias" , David Hildenbrand , qemu-s390x@nongnu.org, Max Filippov , Paolo Bonzini , Nicholas Piggin , qemu-arm@nongnu.org, Thomas Huth , qemu-riscv@nongnu.org, Alistair Francis , qemu-ppc@nongnu.org, Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 18/20] hw/core/generic-loader: Use cpu_datapath_is_big_endian() Date: Wed, 4 Dec 2024 21:26:00 +0100 Message-ID: <20241204202602.58083-19-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241204202602.58083-1-philmd@linaro.org> References: <20241204202602.58083-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Rather that using the binary endianness, use the vCPU one. Signed-off-by: Philippe Mathieu-Daudé --- hw/core/generic-loader.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/core/generic-loader.c b/hw/core/generic-loader.c index abdd4c08a38..7b3b5f06565 100644 --- a/hw/core/generic-loader.c +++ b/hw/core/generic-loader.c @@ -31,7 +31,6 @@ */ #include "qemu/osdep.h" -#include "exec/tswap.h" #include "sysemu/dma.h" #include "sysemu/reset.h" #include "hw/boards.h" @@ -66,7 +65,6 @@ static void generic_loader_realize(DeviceState *dev, Error **errp) { GenericLoaderState *s = GENERIC_LOADER(dev); hwaddr entry; - int big_endian; ssize_t size = 0; s->set_pc = false; @@ -134,14 +132,13 @@ static void generic_loader_realize(DeviceState *dev, Error **errp) s->cpu = first_cpu; } - big_endian = qemu_binary_is_bigendian(); - if (s->file) { AddressSpace *as = s->cpu ? s->cpu->as : NULL; if (!s->force_raw) { size = load_elf_as(s->file, NULL, NULL, NULL, &entry, NULL, NULL, - NULL, big_endian, 0, 0, 0, as); + NULL, cpu_datapath_is_big_endian(s->cpu), + 0, 0, 0, as); if (size < 0) { size = load_uimage_as(s->file, &entry, NULL, NULL, NULL, NULL,