From patchwork Sun May 4 05:28:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 887199 Delivered-To: patch@linaro.org Received: by 2002:a5d:430f:0:b0:38f:210b:807b with SMTP id h15csp1494429wrq; Sat, 3 May 2025 22:46:16 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX1gaPo5ilo/qlezvMB02Ov3jRBPjgK2ERxJCHh3AyzMcqXhuxZEl8LD0r9mqShaTVjWTHAVA==@linaro.org X-Google-Smtp-Source: AGHT+IHp9f9FrCRzDkmaJOjWeDADRUgEtA5L/9wucI9mOJIXSd9+QBXSow8t+06Rl6BVZB8VTm5j X-Received: by 2002:a05:620a:394e:b0:7c5:94a1:7975 with SMTP id af79cd13be357-7cad5a5e98cmr1025850685a.0.1746337576467; Sat, 03 May 2025 22:46:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1746337576; cv=none; d=google.com; s=arc-20240605; b=SLwJ/9qny6C8XDIXmfWr+l1OjQcEg2ykwxiMf05SQrgrMIqcd9PlOKF4VrvLD72RoJ b+Ld6+Hniuxo+Pwsnz1zrDs5+Kv16MaEabNAK9r0TPBsk+w2skIqQUnRl/MsbPbe8SLV 3OPo1lTEYA/Jl1lNS4hzbhaf/rBno2rNHnEOgaiMT2cPxd2txvt/w24OhcuKumtkfIf1 +8kYqdrd6GtZ7NE331J9/wj0h0/fL1oS7jEb7OA9bPk2JMjSzi9yGktx5wayTE/zKHYm W6iqmnz5PMGEFgSjn4pzpxSs++vLOknwghbsTUCCcTYALBVKJOjZWkW9p4wraf5YpgFI 1Zlg== 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=irSEhIVJB8mOBUgNyh7cPK4XpLIapKVpALnmORMTl0E=; fh=02AUoSaH/mYMQTzo2+A6j8m/qDfXAxVzTrBZ7wPvRqc=; b=E9eiQT5oOK6f9kQHHWuCM98/9tFMkPRpZfgct2kSoAijxG+x4XpAfUfv/N6ituybwj 6sDQ72c8GAc7kVeV0mOwZg0zb+AlaVLQmBdtpwS+zmSGMl3FuVfAGSUbWYEOzqlC6bFS haxY9VF+DEfy1FkvVd7TESG2zZTCWVpbXN5JQJM4ZnM5huGQZVInQq0nIIPrjBiDp2CT Qqfve3i5CB+qcgO1Nn31rcDhKOGfrSzWDSZ1OJ0N6mSF3LuDDzP1n7WAe//PQgK4PvJ4 6v3JVXsGKVxw3yE2ho4xdJMFqi2fN7ey266zSe83+JIiXcwIcJ9QCGj0hKNvCm1sJmcY 4pfg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L6ttj9NZ; 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-7cad23cae70si641461485a.182.2025.05.03.22.46.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 03 May 2025 22:46:16 -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=L6ttj9NZ; 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 1uBRuo-0001xc-Kn; Sun, 04 May 2025 01:29:26 -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 1uBRum-0001wt-LX for qemu-devel@nongnu.org; Sun, 04 May 2025 01:29:24 -0400 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uBRuk-0004FE-Ca for qemu-devel@nongnu.org; Sun, 04 May 2025 01:29:24 -0400 Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-ae727e87c26so2077516a12.0 for ; Sat, 03 May 2025 22:29:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1746336560; x=1746941360; 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=irSEhIVJB8mOBUgNyh7cPK4XpLIapKVpALnmORMTl0E=; b=L6ttj9NZqJ8ENthENrkWDvu5z6gA8nEzttA65a8oYUrPVEc5l1YGwgCL7KUP+N6xGU G8/FOdsFfF3ds6PVP5KWFb/GxAuoEr3+7A9VOg3PPVE5XvIdlP737HwIg0Dh/cCqY9Om WD5ya280MHiHa0H9lY0ZvFs8neZ4JzMjbUlfv3rSy63phRiO3xAGrm6bcm3I3jPfDCtQ uCxKpqyVAeH0cva97xnRjg0qw1DsI7+E1CmAZD8ikrYPHjvFLoEF5Bz2+BTRGlMOh7u8 64SyAr/5cfuCfa+36v/exDstJD8IdbUSfVAdQbb6scdoBBBOKMpUlXFIsdtc+XtlMXuW AhIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746336560; x=1746941360; 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=irSEhIVJB8mOBUgNyh7cPK4XpLIapKVpALnmORMTl0E=; b=JYbvT4DYwUwoaLVlHLriNMgQkTP7B1XKuacmveYDKnbx9IR23fw3rb8CU0cvXckvyU gWwmc9/JhZgD/qkcINIGiK5PBj/vHYi6+eonDp4xWf0lsB0Q2WJhV43nI2t0jWENB7Vv oGIjkD+vuTUe8kxyY0agAR/hXza3murUGN6hP4pQHo1O8aHtw8px9mc/IEB91j7COadc zewInnDTzI/O4h6G4eA5JtBDZPrjqfOTnBJz9qxfYPY8MEYHWdYPq92u7aue6Eh8P6Ab KRCkDBGfCXaYjAReUuXIi6z8NnzPXCjaRoFfRtqPDDLcbBRJkSe0GK1Jew90K91KhqFI 8Qrg== X-Gm-Message-State: AOJu0YzeU7ZTg/tQ/UP6fn3BfL6alQrD5ydVe3khJvtzJ9Y6hWtD2v22 QUUAVB4DMXSJr7Xz5S2AWUIG2qbn3+hnKIBw5r8zFy4ajK/oz5uK61JztqAeVcuI7+Jj107eSon xmqE= X-Gm-Gg: ASbGnctZxnWGt66EefEcpIqxUk0MjRw2K8oGbisOzaKF5Ang4+nry8IbhMFMbPZZyfr EPP8yblwzGH+bgWVoHlzf0hxPS2483zrdav6B4dmqj9eduTlQ+B2Wgx1Ee/w5l6pLbdYBbWKFBe 355sJB26bqKtkBxuxVsZu0mzU39C89DtXsxNxJON2AY/7e4RbLvbEnxJhrjowTEYD8+uU4i0UtR /fIUv5As+p0VdQHIH5gtADlIjo1WAB5iNPyQQoK+UR4FvUXEH0fN1cxee8GM+4HS5M6Bzp6uuue VAq0Kooaq423B6TCsqfGopCKGhivuKnmot+zn6mF X-Received: by 2002:a17:903:1aa3:b0:224:76f:9e4a with SMTP id d9443c01a7336-22e102d01ebmr143378185ad.14.1746336560539; Sat, 03 May 2025 22:29:20 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-740590207e3sm4400511b3a.94.2025.05.03.22.29.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 May 2025 22:29:20 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Paolo Bonzini , qemu-arm@nongnu.org, anjo@rev.ng, kvm@vger.kernel.org, richard.henderson@linaro.org, Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , alex.bennee@linaro.org, Pierrick Bouvier Subject: [PATCH v4 00/40] single-binary: compile target/arm twice Date: Sat, 3 May 2025 22:28:34 -0700 Message-ID: <20250504052914.3525365-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::52c; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pg1-x52c.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 They will not be ported in this series. Built on {linux, windows, macos} x {x86_64, aarch64} Fully tested on linux-x86_64 v1 --- - target/arm/cpu.c v2 -- - Remove duplication of kvm struct and constant (Alex) - Use target_big_endian() (Anton) 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 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 Philippe Mathieu-Daudé (1): target/arm: Replace target_ulong -> uint64_t for HWBreakpoint Pierrick Bouvier (39): 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) meson.build | 104 ++- include/system/hvf.h | 15 +- include/tcg/tcg-op-common.h | 1 + include/tcg/tcg.h | 17 + target/arm/helper.h | 1152 +------------------------------ target/arm/internals.h | 6 +- target/arm/kvm_arm.h | 87 +-- target/arm/tcg/helper.h | 1153 ++++++++++++++++++++++++++++++++ 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 | 21 +- 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/op_helper.c | 2 +- target/arm/tcg/tlb_helper.c | 2 +- target/arm/tcg/translate-a64.c | 4 +- target/arm/tcg/translate.c | 2 +- tcg/tcg.c | 6 + accel/hvf/meson.build | 1 + target/arm/meson.build | 41 +- 27 files changed, 1506 insertions(+), 1375 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