From patchwork Mon Sep 30 07:34:37 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: 831519 Delivered-To: patch@linaro.org Received: by 2002:a5d:66c8:0:b0:367:895a:4699 with SMTP id k8csp1828231wrw; Mon, 30 Sep 2024 00:48:36 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWlMzsoi+OOC3oCpRgA7zlMJ82Dxrbkz+eVGPFfyjsucNvZUKOnjmZPvzSAn6B21BLu+WkpDA==@linaro.org X-Google-Smtp-Source: AGHT+IH6sw40U44KqaymOqs1lNTqb/dfNZXcD12aTqAZEfIaAWf8ljyieeE+skS84nvlI7fHkZBl X-Received: by 2002:ac8:5843:0:b0:458:546a:3616 with SMTP id d75a77b69052e-45c9f283e53mr198080211cf.41.1727682515906; Mon, 30 Sep 2024 00:48:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727682515; cv=none; d=google.com; s=arc-20240605; b=dzL1rCt/5EH8AqfipAT2rI/Ej7TLRuItaiQ+aWVCfka3NaU6VEP4DJvYYfi6WSC6ai P1dSJWTmFBPvoN+3fVdc9B/hkTldZXfAALCpOe5RJGi8d4xh0iLoiJE1pdnxoX3juuX9 EJbh87m+zMVz5WKAj+MIzV7vC21AhkggxmIR0/rVIm4aBoeLznC3bZHhuJiV/5rFLW8z LbWD04NPgXyXz2JO9d7UljUF2nXR5JP+O2+DlU81f6hY6AZVIN4lzk40+lg9VdF8IEEP 530QsPpqD4mpTTMYNL92L9LIjs+Kl9Un9GIQKLBqHs/nmCb9xnc5hzXB4sOv6USkfL9F 5ouw== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=gRCWILJ5tP1CDEp4iIo0yM0ySxnxf6B3WCed3GxvioA=; fh=Wy2Q3sNWPDKxNwELUcZZKTFep4jJmSUk04d3iQNw3B8=; b=U3fULEcChfS8zKVjS0HQL4QztykV8afMXpEpCXERRv1MmTBHGpf0Jc7YS4uw10T8EV n/qgUoTbAZRWk52zd2u6BNZtesuhDVYA4IaUKpASF44pp7FtBg9uXbvsQFgholPFHtfJ kg5zvw12E6/WugFeQagKCj8bd/QXJZThX2NHwKxmiMWhIHl+Ks8TsRsCH8y3C0WtY4Lp dVQ75edHqGJahRvHW+/5w2rIXbeDxQ+CnCjEm8WEljnqJVdq28dT+us3rIWD1MWhOAvd IUBdqepegz4Hjf5yKJf3RbBHdySjM+gpr+4WMcpm+cm2lRSttorrukUjD4F0ApRNgGW3 fbJw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IGP2mgu7; 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-45c9f34d1d4si80894351cf.523.2024.09.30.00.48.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Sep 2024 00:48:35 -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=IGP2mgu7; 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 1svB85-0006qE-BP; Mon, 30 Sep 2024 03:47:39 -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 1svB5X-0006nJ-R4 for qemu-devel@nongnu.org; Mon, 30 Sep 2024 03:45:08 -0400 Received: from [2a00:1450:4864:20::629] (helo=mail-ej1-x629.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1svB4x-0000Zk-O6 for qemu-devel@nongnu.org; Mon, 30 Sep 2024 03:44:51 -0400 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a8d6d0fe021so710801266b.1 for ; Mon, 30 Sep 2024 00:43:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727682198; x=1728286998; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=gRCWILJ5tP1CDEp4iIo0yM0ySxnxf6B3WCed3GxvioA=; b=IGP2mgu7/T2OoJ04wHAWdF64y60TYBkDyqdYoi1so0DWyhD+SA4OR9DeSQ91IM05xg FPxXRS22IlaX4f0kqgNXO7YO48EDrddndinSV1pENM+cRHZmlwOV3ZbrmiKSblXZJD91 6tPzrQFOmSYowvJlcAjIgDafR/FzW4TpUORlvK1U68CIRZBQ5zWZ05MlxE/7UT6u0teM otfVO7UGh66jLwlGIAF2+Ja/HIjMgb8jcQ5x5mcQx1dwt0flwsKiuW0eF28es1i5AaK5 LHbYrbSvCzrxfZLqG/Ul0rwY2D85qfhuzHW0R2poR8oBiac9g8iF/ig/DDzbAV08lyTW Db/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727682198; x=1728286998; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=gRCWILJ5tP1CDEp4iIo0yM0ySxnxf6B3WCed3GxvioA=; b=dhkx4E82TWGLnfPYdN9bYH3Bmvhh/cQyHnV+NSvwgP969kP7PNagFfWe2GY3W/DVzj WDBD1ApsxanTuHHtXVls2uvj/7hsiYMQa9hMRFYNIQjtbEE8dWgXH6SHP0VAWYVsbLJZ mP24UryiVm5CIDqmTvlQX5+AikzBMctzBbn8pXifCBwuu/lVBlHGXSWvE18kDBd6bfDD XpyxJ43jRwnYzaLmqFh2p3CyGvW65thCrMDJ0m/OEFQAYU4NGvDVo4DV5OK/I2VDv75x ct6VDqd6snlh1igC5N4qzQKCa8O6pPOccCHiTfKBVL/+lEWnFpbiloOwmlAt9t0JfDlx zlwQ== X-Gm-Message-State: AOJu0YyvBjDs907s2uWsR9VYp/IO4f99VM69HENuRO+gaf+jh00Yc6SY ILSlTSYff99HQvJJEj/Tbu3V6diJe70gSQ6DYWx9GIXmF2IGudUz6fklHakvNlEbGzqyqmsPQWA xrzI= X-Received: by 2002:a05:600c:1c85:b0:42c:c073:412b with SMTP id 5b1f17b1804b1-42f58490786mr87695785e9.30.1727681696153; Mon, 30 Sep 2024 00:34:56 -0700 (PDT) Received: from localhost.localdomain (186.red-88-28-13.dynamicip.rima-tde.net. [88.28.13.186]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37cd575dd04sm8282495f8f.114.2024.09.30.00.34.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 30 Sep 2024 00:34:55 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mahmoud Mandour , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= , Thomas Huth , =?utf-8?q?Alex_Benn=C3=A9e?= , Alexandre Iooss , Jason Wang , Aleksandar Rikalo , Anton Johansson , Peter Maydell , Huacai Chen , "Michael S. Tsirkin" , Sven Schnelle , Jiaxun Yang , qemu-arm@nongnu.org, Aurelien Jarno , Pierrick Bouvier , Max Filippov , Paul Burton Subject: [PATCH 00/13] hw: Add ld/st_endian() APIs Date: Mon, 30 Sep 2024 09:34:37 +0200 Message-ID: <20240930073450.33195-1-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::629 (deferred) Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=philmd@linaro.org; helo=mail-ej1-x629.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, RDNS_NONE=0.793, T_SPF_HELO_TEMPERROR=0.01, T_SPF_TEMPERROR=0.01 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 In preparation of heterogeneous machines, remove knowledge of the target endianness in generic hw/ code. Move it to the machine level. Philippe Mathieu-Daudé (13): qemu/bswap: Introduce ld/st_endian_p() API hw/virtio/virtio-access: Use the ld/st_endian_p() API target/arm/ptw: Use the ld/st_endian_p() API hw/mips: Pass BlCpuCfg argument to bootloader API hw/mips: Add cpu_is_bigendian field to BlCpuCfg structure tests/tcg/plugins: Use the ld/st_endian_p() API hw/xtensa/xtfpga: Remove TARGET_BIG_ENDIAN #ifdef'ry hw/xtensa/xtfpga: Replace memcpy()+tswap32() by stl_endian_p() exec/memory_ldst_phys: Introduce ld/st_endian_phys() API hw/virtio/virtio-access: Use ld/st_endian_phys() API hw/pci/pci_device: Add PCI_DMA_DEFINE_LDST_END() macro hw/pci/pci_device: Introduce ld/st_endian_pci_dma() API hw/net/tulip: Use ld/st_endian_pci_dma() API include/hw/mips/bootloader.h | 18 +++- include/hw/pci/pci_device.h | 35 +++++-- include/hw/virtio/virtio-access.h | 63 ++---------- include/qemu/bswap.h | 19 ++++ include/exec/memory_ldst_phys.h.inc | 66 ++++++++++++ hw/mips/bootloader.c | 152 +++++++++++++++------------- hw/mips/boston.c | 9 +- hw/mips/fuloong2e.c | 3 +- hw/mips/malta.c | 21 ++-- hw/net/tulip.c | 32 ++---- hw/xtensa/xtfpga.c | 18 ++-- target/arm/ptw.c | 19 +--- tests/tcg/plugins/mem.c | 24 ++--- 13 files changed, 269 insertions(+), 210 deletions(-)