Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2219133/?format=api
{ "id": 2219133, "url": "http://patchwork.ozlabs.org/api/patches/2219133/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260402132801.16053-1-deller@kernel.org/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/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": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260402132801.16053-1-deller@kernel.org>", "list_archive_url": null, "date": "2026-04-02T13:28:01", "name": "RFC: Allow building qemu tools on 32-bit hosts", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "948c331ba3374ae5824a5c1864b83b7ff20dd5b5", "submitter": { "id": 87076, "url": "http://patchwork.ozlabs.org/api/people/87076/?format=api", "name": "Helge Deller", "email": "deller@kernel.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260402132801.16053-1-deller@kernel.org/mbox/", "series": [ { "id": 498483, "url": "http://patchwork.ozlabs.org/api/series/498483/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=498483", "date": "2026-04-02T13:28:01", "name": "RFC: Allow building qemu tools on 32-bit hosts", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/498483/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2219133/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2219133/checks/", "tags": {}, "related": [], "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=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=Y3ZSW0E4;\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 4fmjlN3kQcz1yCs\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 03 Apr 2026 00:44:48 +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 1w8IKm-00060V-Qo; Thu, 02 Apr 2026 09:43:44 -0400", "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 <deller@kernel.org>) id 1w8IKl-0005fW-Ay\n for qemu-devel@nongnu.org; Thu, 02 Apr 2026 09:43:43 -0400", "from tor.source.kernel.org ([172.105.4.254])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <deller@kernel.org>) id 1w8I5s-0002RH-AM\n for qemu-devel@nongnu.org; Thu, 02 Apr 2026 09:28:21 -0400", "from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])\n by tor.source.kernel.org (Postfix) with ESMTP id 5CFBC60008;\n Thu, 2 Apr 2026 13:28:11 +0000 (UTC)", "by smtp.kernel.org (Postfix) with ESMTPSA id 2BB22C116C6;\n Thu, 2 Apr 2026 13:28:09 +0000 (UTC)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n s=k20201202; t=1775136491;\n bh=+Q6VYouA7YTugZZPEUHit4u4mCrzCUyb9xTNxtHHngk=;\n h=From:To:Cc:Subject:Date:From;\n b=Y3ZSW0E4qJkZ7e4vsJwy0wNksXKVXI800IIJ+/T5YFBAi7GhnSP83eHkutEf7hefh\n wZUI/WrGPzbf2zSyGjtfOwkrPiZNw3L2T+W4GWL5PA2/GyO4MW/DhkVN4cVnqQv3Dd\n Dow7dDMRp+E8RalaLk6UB96rc3KeikMTfrDDYDBcnrxwIRSWuoCiATduUxKkdyq9OZ\n A08bq36WrImM0rUAWlpUDv9xsSWXPHg3Ubi6J0vZqIiEiQndzUbpiJGa/GE3NJieY2\n 30dPzZBFA2jdhsK6WWLbtn8Bh9xVeFtUMp2FQbyX8lpmb3gyWnAdRmTqXhw826T/aS\n QJos7fSHYID4g==", "From": "Helge Deller <deller@kernel.org>", "To": "qemu-devel@nongnu.org", "Cc": "deller@gmx.de,\n\tMichael Tokarev <mjt@tls.msk.ru>", "Subject": "[PATCH] RFC: Allow building qemu tools on 32-bit hosts", "Date": "Thu, 2 Apr 2026 15:28:01 +0200", "Message-ID": "<20260402132801.16053-1-deller@kernel.org>", "X-Mailer": "git-send-email 2.53.0", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Received-SPF": "pass client-ip=172.105.4.254; envelope-from=deller@kernel.org;\n helo=tor.source.kernel.org", "X-Spam_score_int": "-25", "X-Spam_score": "-2.6", "X-Spam_bar": "--", "X-Spam_report": "(-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.542,\n DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001,\n RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,\n 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": "qemu development <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": "From: Helge Deller <deller@gmx.de>\n\nQemu's tools like qemu-img are often needed on 32-bit platforms,\nalthough the actual qemu emulators have been discontinued on 32-bit.\n\nTo allow building the tools on 32-bit this patch implements two small\nchanges:\n\na) The check in meson.build is changed to still error out if the user\ntries to build qemu-system or qemu-user on a 32-bit platform, but allows\nbuilding tools (e.g. by \"--enable-tools\") alone.\n\nb) Remove the compile time checks in atomic.h because:\n- for the qemu-system and qemu-user emulators this check is redundant\n since we only allow 64-bit platforms anyway (see a)\n- it breaks those 32-bit platforms, which do provide (slower) 64-bit atomics\n- 32-bit platforms without 64-bit atomics will fail instead with linker errors\n- the runtime speed of the qemu tools aren't actually that important.\n\nI've sucessfully tested building qemu tools on 32-bit hppa.\n\nSigned-off-by: Helge Deller <deller@gmx.de>\n---\n include/qemu/atomic.h | 16 ----------------\n meson.build | 4 ++--\n 2 files changed, 2 insertions(+), 18 deletions(-)", "diff": "diff --git a/include/qemu/atomic.h b/include/qemu/atomic.h\nindex dc9290084b..f05dce36eb 100644\n--- a/include/qemu/atomic.h\n+++ b/include/qemu/atomic.h\n@@ -56,14 +56,6 @@\n */\n #define signal_barrier() __atomic_signal_fence(__ATOMIC_SEQ_CST)\n \n-/*\n- * Sanity check that the size of an atomic operation isn't \"overly large\".\n- * Despite the fact that e.g. i686 has 64-bit atomic operations, we do not\n- * want to use them because we ought not need them, and this lets us do a\n- * bit of sanity checking that other 32-bit hosts might build.\n- */\n-#define ATOMIC_REG_SIZE sizeof(void *)\n-\n /* Weak atomic operations prevent the compiler moving other\n * loads/stores past the atomic operation load/store. However there is\n * no explicit memory barrier for the processor.\n@@ -79,7 +71,6 @@\n \n #define qatomic_read(ptr) \\\n ({ \\\n- qemu_build_assert(sizeof(*ptr) <= ATOMIC_REG_SIZE); \\\n qatomic_read__nocheck(ptr); \\\n })\n \n@@ -87,7 +78,6 @@\n __atomic_store_n(ptr, i, __ATOMIC_RELAXED)\n \n #define qatomic_set(ptr, i) do { \\\n- qemu_build_assert(sizeof(*ptr) <= ATOMIC_REG_SIZE); \\\n qatomic_set__nocheck(ptr, i); \\\n } while(0)\n \n@@ -110,7 +100,6 @@\n */\n #define qatomic_rcu_read_internal(ptr, _val) \\\n ({ \\\n- qemu_build_assert(sizeof(*ptr) <= ATOMIC_REG_SIZE); \\\n typeof_strip_qual(*ptr) _val; \\\n qatomic_rcu_read__nocheck(ptr, &_val); \\\n _val; \\\n@@ -119,20 +108,17 @@\n qatomic_rcu_read_internal((ptr), MAKE_IDENTIFIER(_val))\n \n #define qatomic_rcu_set(ptr, i) do { \\\n- qemu_build_assert(sizeof(*ptr) <= ATOMIC_REG_SIZE); \\\n __atomic_store_n(ptr, i, __ATOMIC_RELEASE); \\\n } while(0)\n \n #define qatomic_load_acquire(ptr) \\\n ({ \\\n- qemu_build_assert(sizeof(*ptr) <= ATOMIC_REG_SIZE); \\\n typeof_strip_qual(*ptr) _val; \\\n __atomic_load(ptr, &_val, __ATOMIC_ACQUIRE); \\\n _val; \\\n })\n \n #define qatomic_store_release(ptr, i) do { \\\n- qemu_build_assert(sizeof(*ptr) <= ATOMIC_REG_SIZE); \\\n __atomic_store_n(ptr, i, __ATOMIC_RELEASE); \\\n } while(0)\n \n@@ -144,7 +130,6 @@\n })\n \n #define qatomic_xchg(ptr, i) ({ \\\n- qemu_build_assert(sizeof(*ptr) <= ATOMIC_REG_SIZE); \\\n qatomic_xchg__nocheck(ptr, i); \\\n })\n \n@@ -157,7 +142,6 @@\n })\n \n #define qatomic_cmpxchg(ptr, old, new) ({ \\\n- qemu_build_assert(sizeof(*ptr) <= ATOMIC_REG_SIZE); \\\n qatomic_cmpxchg__nocheck(ptr, old, new); \\\n })\n \ndiff --git a/meson.build b/meson.build\nindex daa58e46a3..98a708372b 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -323,8 +323,8 @@ endif\n # Compiler flags #\n ##################\n \n-if cc.sizeof('void *') < 8\n- error('QEMU requires a 64-bit CPU host architecture')\n+if (cc.sizeof('void *') < 8) and (have_system or have_user)\n+ error('QEMU emulator requires a 64-bit CPU host architecture. Only tools may be built for 32-bit.')\n endif\n \n foreach lang : all_languages\n", "prefixes": [] }