From patchwork Mon May 5 01:51:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 887396 Delivered-To: patch@linaro.org Received: by 2002:a5d:430f:0:b0:38f:210b:807b with SMTP id h15csp1824105wrq; Sun, 4 May 2025 18:53:18 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUksyQNuxXKHqurqXD/f2YGB7sDgcmnAwVJH1Gp/MvpoB7zbNK1/BN6ASouEywlk7BysTSJ3g==@linaro.org X-Google-Smtp-Source: AGHT+IEGFP4c6+TD5oUJZIeAsH30sN0/d/ScVSDJNKpqMo4lPTZFszzJeWpmoATHHTnal2YaSDEL X-Received: by 2002:a05:620a:4381:b0:7c7:56ac:1e89 with SMTP id af79cd13be357-7cae3a93f60mr878842385a.3.1746409997984; Sun, 04 May 2025 18:53:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1746409997; cv=none; d=google.com; s=arc-20240605; b=R2miE/gc3AV5+9cbwIICk9G9Wek4whzzWO88keELmcm1dJ+MM1DPGmr3C/Ez8bLdEa qWKEowZTJeiVKOdrdUi33ZYQgzBaO7LdVlptFUmfoJExE7a+Mta8j7t48LUYDwcQSove vuXnTtCtP2Q3Fq8bfOvk1Gf3riUhAbE/Acg0SNBQWeZOmp/AtPBw2OsIYSPVj1kABPNV gKVgtBwuYinGFlEm7evaIIVYbFvx5KIw5piHIvL2pTSQ6VDIzfKXZLklVNCy4OqjM9S8 RbK0MgH6uyKlXw4l9/7AEg4Y+3Zz/w3oK6bVXWDWFVlR2IxLp8WVvRUHdJuQ70uryoxv Ts4A== 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=ahgA2NICchATUWyUqONsVh9cLKvE33L09maAByMkPyk=; fh=NjGqp/B1Bwp2wtTnyHxTvlXYBfwRSGY9cE7hmKIZquY=; b=eIqI6n6eH47AsEQLPe3EmvDqi+10YfMvWkVxI4ZQZsh+4mNAFYsbbC6Sat1HMI/5Kb D1P0FB0GETCHhumo6gvTnTXdMlCxtQPh1YpkofdquxuvGDjJ2lKunqdC5u5RZlt0Aml6 UrD0Px+t8KalWbSPlsOx1k1oO92VkXPsyjTzvkNKDTnYm6QHqOP+ppZoThdTfvEFDyEJ byvma6/szltz2JRAZH/BSsrxqotVqvh2olxELiicgqpQ3tSkNeCMLSJTJiiz88qMcdml EGR9XNGxf5fSg8ID3WKVPBfYSTDCslX7b/mYzJWWbe/ZvdOoGNVKJBGRCB3Nl2jCLiUi TSHw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="sxtfpQ7/"; 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-7cad241bd1bsi786989885a.205.2025.05.04.18.53.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 04 May 2025 18:53:17 -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="sxtfpQ7/"; 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 1uBl0U-0003ol-Dy; Sun, 04 May 2025 21:52:34 -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 1uBl0S-0003o5-Kh for qemu-devel@nongnu.org; Sun, 04 May 2025 21:52:32 -0400 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uBl0O-0002TO-LG for qemu-devel@nongnu.org; Sun, 04 May 2025 21:52:32 -0400 Received: by mail-pg1-x534.google.com with SMTP id 41be03b00d2f7-af548cb1f83so3809829a12.3 for ; Sun, 04 May 2025 18:52:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1746409947; x=1747014747; 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=ahgA2NICchATUWyUqONsVh9cLKvE33L09maAByMkPyk=; b=sxtfpQ7/PZlMYEn7yaiV1bYudqSreSEJ+1RqNEVDHRaSq6KVmLHdcBz9Bf+FG4dV4S Q6ceTPRR3emm0xoJyJEdUz8XWY60/OAQPVXwnzlGBMENZCwVytXyr8I0XRkrVn4sbeYa /m3+uhgzyNMq93UDJP4Gi9Q7ccok9c0VEtMs6tQVDHPp9fG7IhmyAOyMFfIUV/N5iuVE Fyrczmj+yORCnDpg8tMEohLNAGwaUh0Q4+g88Bb05U/gzEXgM5BosEvtrx9/TJtzax+T oIA1zXmqlo5bSuAtAIy0qqXTIgXF6eojFI5C9CPG3PTXq1tRGuc8liL69Y03XRVsKQry 48aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746409947; x=1747014747; 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=ahgA2NICchATUWyUqONsVh9cLKvE33L09maAByMkPyk=; b=hfUh2O1mp8VeqIfoaGChiUXogYEq/QvcilCjD6VCBKaddlkICPm0H3HZ1Y52XVq0ns CEKFhks58+If/HnXgpvlXD+Bva88cNv3XsDfSNOLVTelN7f1y/aBp7blr8EPPIqjw55P lydpss8SYvdMJd58k/BI3OpmLaflrHLLUPXsFobTfqpteyrZmUWHxW2XmRXuKoYUp1qh euL7P0LJtb72QXtIrGYXSDnh7mX9zgqD8bnpIiZn4rRhxt20AHKnsmwRJo+gARtqayqJ Pcl4NpHjMDpeOp4SLxkgTTLFrTOJNLPA8mDqifiZHuc6p8ZvzWQf+/um43vKHHFc5mda 5j0w== X-Gm-Message-State: AOJu0YybvhJdjJcc9izDwVbPcvsc58cgFT+6/UezDFWwj93qDtqdtGwc SSNMwFRFA/MPkEUBXSqKih2tUd4nQfStYJ93lFn9o1bWcGQz/5tJJeR0xeBKxqookLu/NsRWsaE hcBI= X-Gm-Gg: ASbGncsfP4gMgwvxN2lrmXUE6umY3FyQ4Vxaccz5pkQh/koCOdmzfwOg0SPsY/6R3kh 6xr/b4+1EoypzlNF/CfCkRxPRyBojnlui5hrJiQ5agxm2ztvolyuzkPzYJTJ1pdLhhumq3+z7hJ cRLGDhYwpr6mta9R8ihUE/espomtg4JIQJxpGczKRz2fmn5MgvMX5dbwHaDmLlN9b34hhpohtyi jc9iNinibnO5bak6Kev70R0H67hri6goDgqxIf3NsuyHZaDcs/0OO5H6g5aDgnL1KxGIrbKCWiT H22WUOjfzgN+y1zr5YtBsX3t15P2AVC814/PzZhY X-Received: by 2002:a05:6a20:9f4d:b0:1f5:9d5d:bcdd with SMTP id adf61e73a8af0-20e96205cebmr7161534637.1.1746409946929; Sun, 04 May 2025 18:52:26 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b1fb3920074sm4462101a12.11.2025.05.04.18.52.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 May 2025 18:52:26 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Paolo Bonzini , qemu-arm@nongnu.org, richard.henderson@linaro.org, alex.bennee@linaro.org, kvm@vger.kernel.org, Peter Maydell , anjo@rev.ng, =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Pierrick Bouvier Subject: [PATCH v5 00/48] single-binary: compile target/arm twice Date: Sun, 4 May 2025 18:51:35 -0700 Message-ID: <20250505015223.3895275-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::534; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pg1-x534.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 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 -> uint64_t for HWBreakpoint Pierrick Bouvier (47): 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/crypto_helper: compile file twice (system, user) 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/tcg/tlb-insns: compile file twice (system, user) target/arm/tcg/arith_helper: compile file twice (system, user) 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 ++++++++++++++++++++++++++++++++ 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/arith_helper.c | 4 +- target/arm/tcg/crypto_helper.c | 4 +- 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 +- 35 files changed, 1542 insertions(+), 1396 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