From patchwork Mon May 5 23:19:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 887470 Delivered-To: patch@linaro.org Received: by 2002:a5d:430f:0:b0:38f:210b:807b with SMTP id h15csp2289568wrq; Mon, 5 May 2025 16:21:14 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVEYumQ+LhTkzg4J5rrGURddZroW7BVTkLTuTnqsy5DgYv3QjXQwMuvg9b3SqBRW50uwY3WiQ==@linaro.org X-Google-Smtp-Source: AGHT+IFCRuMvvaUsimbBDwyoR6yMy+mJvtPwNlKgai95f3iCwCEh0URaOvGSFtJbjD7Bpx8RC+b7 X-Received: by 2002:a05:620a:2710:b0:7c7:5ad8:aece with SMTP id af79cd13be357-7caf09450e0mr227583185a.25.1746487273881; Mon, 05 May 2025 16:21:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1746487273; cv=none; d=google.com; s=arc-20240605; b=QhiHdv4PP7fQcBwIEiwQQWsO0mvh1VXO016dKCeQMgpu1ov91+RbmJuzuJu0mDq54U t9+61JnHK6LQ8AGLm1193wx4r+pjbRZFdwJ2iGFY9EoqdGq6iD3CIc1XrB9ykWRcYOdz MaLIpxUJH/aJVDb6oR3/BXqF5RU7+LaJUDSpPPVW97+O5r2Vi2X9G6JTXI8pCH+UZUfn EW0riI97aLJmIcGIVjvar/kHRk13j4bu3Whtd5rctn06CUaXpVokVZoA7ChEpeC9XeqD 3wYOmPEMevEljaCmWxIyKxUH7cExLNYY6uBwcYU/A+kmNQsnQ6P6Jd1b4ynvrwc21EZQ bX1Q== 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=04Ix3M4tuJXhEIQ9AeSHf28aqJlTNZ3AOq6Hx3kur6A=; fh=sKdX4/MHbRvqsf1uWWiw/b4mRzIm0SRNXacICL4/ZgI=; b=j7Ww55n2AZjybS+8jSrBNhEzsMza3NmSOcbI7/Zyoj8d8uWrc6NLQqx5KV5Al/wLa+ Xm0+oveatYiLQZBxFx3BPSPC3VZODvnwUYt7GDWBfg7Bnz7mT98YRRWQu9IPnClIzr8r hyLWobLMN39pNLDsdOfhKbxQqP5hbzDrkFPICcKTygD7gw9s41KAMx7EUHoJBTnZpPW1 Nh5FP9M+vPTeQd7xb6rSQnQVnNMkShSEjv3y/URLVg2qnok9ek3ygg+fTcY1ZVHQvFcJ ldBpa00kQie4RoOpoKtf+WuOjHiWZepYVvyYG/U+KfAOb3BKrto+eZL/b7N9pK2BjcWX Xagg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Mszb/SJ4"; 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 af79cd13be357-7cad24459a2si957366785a.480.2025.05.05.16.21.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 05 May 2025 16:21:13 -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="Mszb/SJ4"; 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 1uC56r-00067B-9G; Mon, 05 May 2025 19:20:29 -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 1uC56o-00065P-Cg for qemu-devel@nongnu.org; Mon, 05 May 2025 19:20:26 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uC56l-0003U6-Eh for qemu-devel@nongnu.org; Mon, 05 May 2025 19:20:26 -0400 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-2241053582dso75173865ad.1 for ; Mon, 05 May 2025 16:20:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1746487221; x=1747092021; 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=04Ix3M4tuJXhEIQ9AeSHf28aqJlTNZ3AOq6Hx3kur6A=; b=Mszb/SJ4mDTX3RQsmJsLGu5GzTdoff6dm6++3f7NaP4rI7NtOzeCjOBRqgEvyYcCk1 glosX5RTL7HY9a0fpZRnQcq+ZBshFVcGXAHuEHS55wscEAVY42rEStXy+whPEiVVkmKP Jo2wdRXGM7qwhhoq3UUit0xz34M6bTNx7Y/zWWncdL9aFzKJmIEUY5Z8Ol9AXV6ss9WA qTVaKa4m76lPjH6zrGtn0uCfzFcnvThZOvqDuO/tsoAOZF6aVgghTFpmpvJ4F3BZDoTZ up/GmH0spA7nGMJpv8aSzz8CPd9+g03M6UpLE0gaeNgqA6wHe5u8ynaiKtW6peLlSXgU 08GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746487221; x=1747092021; 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=04Ix3M4tuJXhEIQ9AeSHf28aqJlTNZ3AOq6Hx3kur6A=; b=vyEoU7rfTnC7Sq/k42mUNHv9jojqwBfpIRCDNYk0xC6dtxdqxsZSyRGKE8p8ee1QNM 5f3w+aByUiDO2g38RrNRZ9NYxMPaY5yLSWlJs3jbHW1GIHuZJ99IaXWlPbfEHb3AlsfP CmdnnwDCemH2HywW1GgRq8BCMcG50eQWNsusOy24vwiRM1+Qg8Rq7O5vU5mi0m2g09K1 V+Nfvf9oQlfClyt8AdyDE2R7l8Anasnj9Uea1ozgKlMopTmflXUKDjmuBIwSdZhADRax w3fZGH3R6PqQ920ghSP/OFP0xCCi543z9zTx5sYpa41Bd3hnMkgZ7njzI0C+ARijycuI pvYQ== X-Gm-Message-State: AOJu0YxzVVFQ5WtJ4Zn84RgbYuP78xIXD7JAzea7j5G0vohOXGTlMmk9 AILyEqas3G4Wev4oM8nKWsZMVo624gxs4DKE1DXGbZ4gARa1IOCpmxW2vCM0vPnhmUZ7Vrcm+xy X/4Q= X-Gm-Gg: ASbGncsuBS4eDoR88o6y7/lIFvCoK+ndK6EX3NzEJGvzSXaj+g5VRjafP9uipWhBo1a heHfDNBopw/Npku+90JojoQYpgu1ivFTcmqpeqiFSviy4sVJ/WeHn5UTS1PIrBquVehHxwoVUam HIep1F7CFBNtT3tQCekffWKNXXGviLMT0IJVefGsPkBjO9C8Ajq6jmra1qwdnFSUoUe2B7K4REK hx7tdX+kI08wzETnab4lJmWmbWx0klQNsSxPN/5K5kukv46ZiEt5bVmt86rtuy7UEMoRzqS5wIS OqkrcBSIHrDQ1buTIH26yW3/e8kOdfuYYlXst8Wo X-Received: by 2002:a17:903:41cb:b0:220:e1e6:4472 with SMTP id d9443c01a7336-22e328cf92emr16217105ad.13.1746487220678; Mon, 05 May 2025 16:20:20 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-22e1522917asm60981715ad.201.2025.05.05.16.20.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 May 2025 16:20:20 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, anjo@rev.ng, Peter Maydell , alex.bennee@linaro.org, kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, Pierrick Bouvier Subject: [PATCH v6 00/50] single-binary: compile target/arm twice Date: Mon, 5 May 2025 16:19:25 -0700 Message-ID: <20250505232015.130990-1-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pl1-x62d.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=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: 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 More work toward single-binary. Some files have external dependencies for the single-binary: - target/arm/gdbstub.c: gdbhelpers - target/arm/arm-qmp-cmds.c: qapi - target/arm/tcg/translate*: need deep cleanup in include/tcg - target/arm/tcg/cpu*: need TargetInfo implemented for arm/aarch64 - target/arm/tcg/*-helper*: need deeper split between aarch64 and arm code They will not be ported in this series. Built on {linux, windows, macos} x {x86_64, aarch64} Fully tested on linux-x86_64 v6 --- CI: https://github.com/pbo-linaro/qemu/actions/runs/14844742069/job/41675865456 - Replace target_ulong -> vaddr for HWBreakpoint (Philippe) - build target/arm/tcg/crypto_helper.c once (Richard) - build target/arm/tcg/tlb-insns for system only (Richard) - build target/arm/tcg/arith_helper once (Richard) v5 -- CI: https://github.com/pbo-linaro/qemu/actions/runs/14825451208/job/41617949501 - Do not define a separate vaddr type in tcg, simply alias to i32/i64 (Richard) - target/arm/tcg/crypto_helper.c - target/arm/tcg/hflags.c - target/arm/tcg/iwmmxt_helper.c - target/arm/tcg/neon_helper.c - target/arm/tcg/tlb_helper.c - target/arm/tcg/tlb-insns.c - target/arm/tcg/arith_helper.c - target/arm/tcg/vfp_helper.c v4 -- CI: https://github.com/pbo-linaro/qemu/actions/runs/14816460393/job/41597560792 - add patch to apply target config for picking files in libsystem/libuser Useful for Philippe series for semihosting: https://lore.kernel.org/qemu-devel/20250502220524.81548-1-philmd@linaro.org/T/#me750bbaeeba4d16791121fe98b44202afaec4068 - update some patches description (Philippe & Richard) - tcg: introduce vaddr type (Richard) - modify concerned helpers to use vaddr instead of i64 (Richard) - use int64_t instead of uint64_t for top_bits in ptw.c (Philippe) - arm_casq_ptw: use CONFIG_ATOMIC64 instead of TARGET_AARCH64 and comment why (Richard) - target/arm/machine.c v3 -- CI: https://github.com/pbo-linaro/qemu/actions/runs/14765763846/job/41456754153 - Add missing license for new files (Richard) - target/arm/debug_helper.c - target/arm/helper.c - target/arm/vfp_fpscr.c - target/arm/arch_dump.c - target/arm/arm-powerctl.c - target/arm/cortex-regs.c - target/arm/ptw.c - target/arm/kvm-stub.c v2 -- - Remove duplication of kvm struct and constant (Alex) - Use target_big_endian() (Anton) v1 -- - target/arm/cpu.c Philippe Mathieu-Daudé (1): target/arm: Replace target_ulong -> vaddr for HWBreakpoint Pierrick Bouvier (49): include/system/hvf: missing vaddr include meson: add common libs for target and target_system meson: apply target config for picking files from libsystem and libuser target/arm: move kvm stubs and remove CONFIG_KVM from kvm_arm.h target/arm/kvm-stub: add kvm_arm_reset_vcpu stub target/arm/cpu: move arm_cpu_kvm_set_irq to kvm.c accel/hvf: add hvf_enabled() for common code target/arm/cpu: remove TARGET_BIG_ENDIAN dependency target/arm/cpu: remove TARGET_AARCH64 around aarch64_cpu_dump_state common target/arm/cpu: remove TARGET_AARCH64 in arm_cpu_finalize_features target/arm/cpu: compile file twice (user, system) only target/arm/cpu32-stubs.c: compile file twice (user, system) tcg: add vaddr type for helpers target/arm/helper: use vaddr instead of target_ulong for exception_pc_alignment target/arm/helper: use vaddr instead of target_ulong for probe_access target/arm/helper: extract common helpers target/arm/debug_helper: only include common helpers target/arm/debug_helper: remove target_ulong target/arm/debug_helper: compile file twice (user, system) target/arm/helper: restrict include to common helpers target/arm/helper: replace target_ulong by vaddr target/arm/helper: expose aarch64 cpu registration target/arm/helper: remove remaining TARGET_AARCH64 target/arm/helper: compile file twice (user, system) target/arm/vfp_fpscr: compile file twice (user, system) target/arm/arch_dump: remove TARGET_AARCH64 conditionals target/arm/arch_dump: compile file once (system) target/arm/arm-powerctl: compile file once (system) target/arm/cortex-regs: compile file once (system) target/arm/ptw: replace target_ulong with int64_t target/arm/ptw: replace TARGET_AARCH64 by CONFIG_ATOMIC64 from arm_casq_ptw target/arm/ptw: compile file once (system) target/arm/meson: accelerator files are not needed in user mode target/arm/kvm-stub: compile file once (system) target/arm/machine: reduce migration include to avoid target specific definitions target/arm/machine: remove TARGET_AARCH64 from migration state target/arm/machine: move cpu_post_load kvm bits to kvm_arm_cpu_post_load function target/arm/kvm-stub: add missing stubs target/arm/machine: compile file once (system) target/arm/tcg/vec_internal: use forward declaration for CPUARMState target/arm/tcg/crypto_helper: compile file once target/arm/tcg/hflags: compile file twice (system, user) target/arm/tcg/iwmmxt_helper: compile file twice (system, user) target/arm/tcg/neon_helper: compile file twice (system, user) target/arm/tcg/tlb_helper: compile file twice (system, user) target/arm/helper: restrict define_tlb_insn_regs to system target target/arm/tcg/tlb-insns: compile file once (system) target/arm/tcg/arith_helper: compile file once target/arm/tcg/vfp_helper: compile file twice (system, user) meson.build | 104 ++- include/system/hvf.h | 15 +- include/tcg/tcg-op-common.h | 1 + include/tcg/tcg.h | 14 + target/arm/helper.h | 1152 +------------------------------ target/arm/internals.h | 6 +- target/arm/kvm_arm.h | 87 +-- target/arm/tcg/helper.h | 1153 ++++++++++++++++++++++++++++++++ target/arm/tcg/vec_internal.h | 2 + include/exec/helper-head.h.inc | 11 + accel/hvf/hvf-stub.c | 5 + target/arm/arch_dump.c | 6 - target/arm/cpu.c | 47 +- target/arm/cpu32-stubs.c | 26 + target/arm/debug_helper.c | 6 +- target/arm/helper.c | 23 +- target/arm/hyp_gdbstub.c | 6 +- target/arm/kvm-stub.c | 97 +++ target/arm/kvm.c | 42 +- target/arm/machine.c | 15 +- target/arm/ptw.c | 6 +- target/arm/tcg/arith_helper.c | 5 +- target/arm/tcg/crypto_helper.c | 6 +- target/arm/tcg/hflags.c | 4 +- target/arm/tcg/iwmmxt_helper.c | 4 +- target/arm/tcg/neon_helper.c | 4 +- target/arm/tcg/op_helper.c | 2 +- target/arm/tcg/tlb-insns.c | 7 - target/arm/tcg/tlb_helper.c | 5 +- target/arm/tcg/translate-a64.c | 2 +- target/arm/tcg/translate.c | 2 +- target/arm/tcg/vfp_helper.c | 4 +- tcg/tcg.c | 5 + accel/hvf/meson.build | 1 + target/arm/meson.build | 41 +- target/arm/tcg/meson.build | 29 +- 36 files changed, 1547 insertions(+), 1398 deletions(-) create mode 100644 target/arm/tcg/helper.h create mode 100644 accel/hvf/hvf-stub.c create mode 100644 target/arm/cpu32-stubs.c