Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.0/patches/2175762/?format=api
{ "id": 2175762, "url": "http://patchwork.ozlabs.org/api/1.0/patches/2175762/?format=api", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/1.0/projects/14/?format=api", "name": "QEMU Development", "link_name": "qemu-devel", "list_id": "qemu-devel.nongnu.org", "list_email": "qemu-devel@nongnu.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20251218212814.61445-5-philmd@linaro.org>", "date": "2025-12-18T21:28:14", "name": "[4/4] system/memory: Restrict legacy 'native-endian' APIs", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "1eef15760121f367dcf72b568f5abccccf394a9c", "submitter": { "id": 85046, "url": "http://patchwork.ozlabs.org/api/1.0/people/85046/?format=api", "name": "Philippe Mathieu-Daudé", "email": "philmd@linaro.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20251218212814.61445-5-philmd@linaro.org/mbox/", "series": [ { "id": 485917, "url": "http://patchwork.ozlabs.org/api/1.0/series/485917/?format=api", "date": "2025-12-18T21:28:11", "name": "system/memory: Allow restricting legacy 'native-endian' APIs", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/485917/mbox/" } ], "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2175762/checks/", "tags": {}, "headers": { "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=QBbOZeLu;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)" ], "Received": [ "from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4dXP27479Rz1y3t\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 19 Dec 2025 08:29:34 +1100 (AEDT)", "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1vWLYO-0001KG-4A; Thu, 18 Dec 2025 16:28:56 -0500", "from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <philmd@linaro.org>) id 1vWLYM-0001Jb-U5\n for qemu-devel@nongnu.org; Thu, 18 Dec 2025 16:28:54 -0500", "from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <philmd@linaro.org>) id 1vWLYL-0007So-3U\n for qemu-devel@nongnu.org; Thu, 18 Dec 2025 16:28:54 -0500", "by mail-wm1-x32c.google.com with SMTP id\n 5b1f17b1804b1-4779cc419b2so7703705e9.3\n for <qemu-devel@nongnu.org>; Thu, 18 Dec 2025 13:28:52 -0800 (PST)", "from localhost.localdomain (88-187-86-199.subs.proxad.net.\n [88.187.86.199]) by smtp.gmail.com with ESMTPSA id\n ffacd0b85a97d-4324ea22674sm1047786f8f.10.2025.12.18.13.28.48\n (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256);\n Thu, 18 Dec 2025 13:28:49 -0800 (PST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1766093331; x=1766698131; darn=nongnu.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=zvmQqDTuAn2+vm7yu5oXpG7v42LAWlpVJ2+BBQOBjKY=;\n b=QBbOZeLu5SedtKezVCxynAP0n8Fp6lScACY07KouEiI424U84qFpiYPnwjMmW+YGTO\n NSg66EI0zvd8cAD4fEioVN2/Tdq+SeUzPSahihVsMBhgkBSkYLq7pylg7fat+VcwY/9F\n eMY/CZROK7b3lYJnmOcJRqEa7bl00AzyBKmCftDlnMu5pmg9EeZSMToO+F6kHopnberU\n QWc6GJlDLLXk4t5/8Z39rMcKIiObulqeJ0hWGlmL4/xCUifGkn684sxtU7u61z2O8PoB\n GG+BkUYe2guIEG4UVBvMn8Q4tc+2YaD5lYop5GnYj3ZE538Du25Q05oJMsEVM/zJPjRs\n wOdg==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1766093331; x=1766698131;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=zvmQqDTuAn2+vm7yu5oXpG7v42LAWlpVJ2+BBQOBjKY=;\n b=A77jH7Nd3pzYLjzomlK+ReRmz8+tipWW/O0jbz2+EEi3CrVzd1OHvoC8DB/ek0ZicR\n OGRHDYCifpxIrxUelxFgPf7XjiFOalU5633liVwXwNjCSSiHuom6dXuGPaboy3uR41+z\n qS8HPVkvCvitzgOT4PJRgOqyb2Gfk7Dc6Ie7AAWaq7ilIxhr3y58qqM+g635q6wpsaif\n nz3vqGPuSmrF9fcfuY2mlnva5OAZovnzLEDjlYZJF84A5XKuzApjThdpy1pdjlMH9IMR\n TbFOayKFx+ra+1N/GEiSGHVMOAgtFclELCv+vqet0bL6zMAD4QGKlKd0ytQKRbU1sxJY\n F0tA==", "X-Gm-Message-State": "AOJu0YxWJHzonAVMx+BpMLyNn/UlGCiF2EsmlqvK2KTbukyzqpV9kqxB\n xZIsRaE91dLCJzBi9PPWOLMF/wju//tMIpPiPo0QT3vB+yf9L53mM5CyBPgxnRz3XyD7FUyBqgv\n y3M3yEFg=", "X-Gm-Gg": "AY/fxX6bnJy/oPhYj+w++Kgiy11ntrfdwDPHm4UoP+9RgFcTqSGzBhZHLozU3cla9Gx\n tPkadepzaepNIi8ZHeVy7ZGWcMRn/EuC5L4m01RZfnbRPEoQj8arvSq7PVqjqrV73bMEm6gdOu6\n KxSHVi4508GifSLeDw/G4wRQByBBC6s9EZuSABeWt7eMPaIzdM4fYscgdAfP/1Eo3lozee67+sL\n q4Db+XnjAiFykKQuwCf4kvKliYq9p1HLEfC7hfyKemdEuQuenTSbzq6cbBHv62gQToARVcgAfGe\n RB4jKnyVzSH87TonYXblfBZosLzkA3V9Ph6JCydPMIYOWh8k3eoFz+M90UZG78kadsSv77FfNuo\n oI1IkxZ//9J8UUi4p1Qy4qUN+MheQgZk0PLGpE8dlp0OTgM/QEiovOmh5Fl/SRjfiuYm45tTqeu\n q7yhUQ8RBKJIcjC4vj52aDlUZWeKUO50I/NI4/XMQKpnc767Tl9fGr12UHKSpr", "X-Google-Smtp-Source": "\n AGHT+IFTMqJ5n8E+yTdI9QjvfQGN80DnPSmLhCTv7+gaDKHYwnuCV//STQ3yodAihc6k9TwmPL9Atg==", "X-Received": "by 2002:a05:600c:8710:b0:475:da13:2568 with SMTP id\n 5b1f17b1804b1-47d19592102mr5135165e9.25.1766093331125;\n Thu, 18 Dec 2025 13:28:51 -0800 (PST)", "From": "=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org>", "To": "qemu-devel@nongnu.org", "Cc": "Anton Johansson <anjo@rev.ng>,\n Richard Henderson <richard.henderson@linaro.org>,\n Daniel Henrique Barboza <dbarboza@ventanamicro.com>,\n Pierrick Bouvier <pierrick.bouvier@linaro.org>, =?utf-8?q?Philippe_Mathieu-?=\n\t=?utf-8?q?Daud=C3=A9?= <philmd@linaro.org>,\n Paolo Bonzini <pbonzini@redhat.com>, Peter Xu <peterx@redhat.com>,\n David Hildenbrand <david@kernel.org>", "Subject": "[PATCH 4/4] system/memory: Restrict legacy 'native-endian' APIs", "Date": "Thu, 18 Dec 2025 22:28:14 +0100", "Message-ID": "<20251218212814.61445-5-philmd@linaro.org>", "X-Mailer": "git-send-email 2.52.0", "In-Reply-To": "<20251218212814.61445-1-philmd@linaro.org>", "References": "<20251218212814.61445-1-philmd@linaro.org>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "Received-SPF": "pass client-ip=2a00:1450:4864:20::32c;\n envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n 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": "<qemu-devel.nongnu.org>", "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>", "List-Archive": "<https://lists.nongnu.org/archive/html/qemu-devel>", "List-Post": "<mailto:qemu-devel@nongnu.org>", "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>", "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>", "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org", "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org" }, "content": "Guard the native endian APIs we want to remove by surrounding\nthem with TARGET_USE_LEGACY_NATIVE_ENDIAN_API #ifdef'ry.\n\nOnce a target gets cleaned we'll unset the definition in the\ntarget config, then the target won't be able to use the legacy\nAPI anymore.\n\nSigned-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>\n---\n include/accel/tcg/cpu-ldst.h | 2 ++\n include/exec/translator.h | 2 +-\n include/qemu/bswap.h | 5 +++++\n include/system/memory_cached.h | 2 ++\n system/memory-internal.h | 2 ++\n include/exec/memory_ldst.h.inc | 2 ++\n include/exec/memory_ldst_phys.h.inc | 2 ++\n system/memory_ldst.c.inc | 2 ++\n 8 files changed, 18 insertions(+), 1 deletion(-)", "diff": "diff --git a/include/accel/tcg/cpu-ldst.h b/include/accel/tcg/cpu-ldst.h\nindex 0de7f5eaa6b..91b618c2f41 100644\n--- a/include/accel/tcg/cpu-ldst.h\n+++ b/include/accel/tcg/cpu-ldst.h\n@@ -428,6 +428,7 @@ cpu_stq_le_data(CPUArchState *env, abi_ptr addr, uint64_t val)\n cpu_stq_le_data_ra(env, addr, val, 0);\n }\n \n+#ifdef TARGET_USE_LEGACY_NATIVE_ENDIAN_API\n #if TARGET_BIG_ENDIAN\n # define cpu_lduw_data cpu_lduw_be_data\n # define cpu_ldsw_data cpu_ldsw_be_data\n@@ -501,5 +502,6 @@ static inline uint64_t cpu_ldq_code(CPUArchState *env, abi_ptr addr)\n MemOpIdx oi = make_memop_idx(MO_TEUQ, cpu_mmu_index(cs, true));\n return cpu_ldq_code_mmu(env, addr, oi, 0);\n }\n+#endif /* TARGET_USE_LEGACY_NATIVE_ENDIAN_API */\n \n #endif /* ACCEL_TCG_CPU_LDST_H */\ndiff --git a/include/exec/translator.h b/include/exec/translator.h\nindex 3c326555696..30e6596c5d7 100644\n--- a/include/exec/translator.h\n+++ b/include/exec/translator.h\n@@ -188,7 +188,7 @@ uint32_t translator_ldl_end(CPUArchState *env, DisasContextBase *db,\n uint64_t translator_ldq_end(CPUArchState *env, DisasContextBase *db,\n vaddr pc, MemOp endian);\n \n-#ifdef COMPILING_PER_TARGET\n+#if defined(TARGET_USE_LEGACY_NATIVE_ENDIAN_API) && defined(COMPILING_PER_TARGET)\n static inline uint16_t\n translator_lduw(CPUArchState *env, DisasContextBase *db, vaddr pc)\n {\ndiff --git a/include/qemu/bswap.h b/include/qemu/bswap.h\nindex 65a1b3634f4..8b0070d26a6 100644\n--- a/include/qemu/bswap.h\n+++ b/include/qemu/bswap.h\n@@ -412,7 +412,9 @@ static inline void stq_be_p(void *ptr, uint64_t v)\n } \\\n }\n \n+#ifdef TARGET_USE_LEGACY_NATIVE_ENDIAN_API\n DO_STN_LDN_P(he)\n+#endif\n DO_STN_LDN_P(le)\n DO_STN_LDN_P(be)\n \n@@ -423,6 +425,7 @@ DO_STN_LDN_P(be)\n #undef le_bswaps\n #undef be_bswaps\n \n+#ifdef TARGET_USE_LEGACY_NATIVE_ENDIAN_API\n \n /* Return ld{word}_{le,be}_p following target endianness. */\n #define LOAD_IMPL(word, args...) \\\n@@ -494,4 +497,6 @@ static inline void stn_p(void *ptr, int sz, uint64_t v)\n \n #undef STORE_IMPL\n \n+#endif /* TARGET_USE_LEGACY_NATIVE_ENDIAN_API */\n+\n #endif /* BSWAP_H */\ndiff --git a/include/system/memory_cached.h b/include/system/memory_cached.h\nindex 1a07774b6ad..356023f5729 100644\n--- a/include/system/memory_cached.h\n+++ b/include/system/memory_cached.h\n@@ -77,8 +77,10 @@ static inline void address_space_stb_cached(MemoryRegionCache *cache,\n }\n }\n \n+#ifdef TARGET_USE_LEGACY_NATIVE_ENDIAN_API\n #define ENDIANNESS\n #include \"exec/memory_ldst_cached.h.inc\"\n+#endif\n \n #define ENDIANNESS _le\n #include \"exec/memory_ldst_cached.h.inc\"\ndiff --git a/system/memory-internal.h b/system/memory-internal.h\nindex 46f758fa7e4..d781d437642 100644\n--- a/system/memory-internal.h\n+++ b/system/memory-internal.h\n@@ -41,9 +41,11 @@ void mtree_print_dispatch(struct AddressSpaceDispatch *d,\n /* returns true if end is big endian. */\n static inline bool devend_big_endian(enum device_endian end)\n {\n+#ifdef TARGET_USE_LEGACY_NATIVE_ENDIAN_API\n if (end == DEVICE_NATIVE_ENDIAN) {\n return target_big_endian();\n }\n+#endif\n return end == DEVICE_BIG_ENDIAN;\n }\n \ndiff --git a/include/exec/memory_ldst.h.inc b/include/exec/memory_ldst.h.inc\nindex dd1fb482eac..8ff6e563310 100644\n--- a/include/exec/memory_ldst.h.inc\n+++ b/include/exec/memory_ldst.h.inc\n@@ -25,8 +25,10 @@ uint8_t glue(address_space_ldub, SUFFIX)(ARG1_DECL,\n void glue(address_space_stb, SUFFIX)(ARG1_DECL,\n hwaddr addr, uint8_t val, MemTxAttrs attrs, MemTxResult *result);\n \n+#ifdef TARGET_USE_LEGACY_NATIVE_ENDIAN_API\n #define ENDIANNESS\n #include \"system/memory_ldst_endian.h.inc\"\n+#endif /* TARGET_USE_LEGACY_NATIVE_ENDIAN_API */\n \n #define ENDIANNESS _le\n #include \"system/memory_ldst_endian.h.inc\"\ndiff --git a/include/exec/memory_ldst_phys.h.inc b/include/exec/memory_ldst_phys.h.inc\nindex f4c91dc7a91..e0da6d19a5b 100644\n--- a/include/exec/memory_ldst_phys.h.inc\n+++ b/include/exec/memory_ldst_phys.h.inc\n@@ -31,8 +31,10 @@ static inline void glue(stb_phys, SUFFIX)(ARG1_DECL, hwaddr addr, uint8_t val)\n MEMTXATTRS_UNSPECIFIED, NULL);\n }\n \n+#ifdef TARGET_USE_LEGACY_NATIVE_ENDIAN_API\n #define ENDIANNESS\n #include \"system/memory_ldst_phys_endian.h.inc\"\n+#endif /* TARGET_USE_LEGACY_NATIVE_ENDIAN_API */\n \n #define ENDIANNESS _le\n #include \"system/memory_ldst_phys_endian.h.inc\"\ndiff --git a/system/memory_ldst.c.inc b/system/memory_ldst.c.inc\nindex 5a979ea6ac3..2f707e5f5b4 100644\n--- a/system/memory_ldst.c.inc\n+++ b/system/memory_ldst.c.inc\n@@ -181,9 +181,11 @@ void glue(address_space_stq_internal, SUFFIX)(ARG1_DECL, MemOp mop,\n attrs, result);\n }\n \n+#ifdef TARGET_USE_LEGACY_NATIVE_ENDIAN_API\n #define ENDIANNESS\n #define MO_ENDIAN (target_big_endian() ? MO_BE : MO_LE)\n #include \"memory_ldst_endian.c.inc\"\n+#endif /* TARGET_USE_LEGACY_NATIVE_ENDIAN_API */\n \n #define ENDIANNESS _le\n #define MO_ENDIAN MO_LE\n", "prefixes": [ "4/4" ] }