From patchwork Tue Apr 22 19:27:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 883110 Delivered-To: patch@linaro.org Received: by 2002:a5d:474d:0:b0:38f:210b:807b with SMTP id o13csp2595765wrs; Tue, 22 Apr 2025 12:58:54 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWTHJlYwhiORh1wwzj7ZRJZluNRapi4kuyGMVCZs5rWqK1pjPqSVjtDeEdk0GspcS47a2mvMg==@linaro.org X-Google-Smtp-Source: AGHT+IHwORc4PV0fDOGetpnzB75C2DrMobbXWqytxaRLxGzf2UNk+ilTUYe8LtbHxA5mHw6Ze4At X-Received: by 2002:a05:620a:244f:b0:7c5:60c7:339 with SMTP id af79cd13be357-7c927f5948fmr2559094585a.9.1745351933973; Tue, 22 Apr 2025 12:58:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1745351933; cv=none; d=google.com; s=arc-20240605; b=H7ddqpxr1jiZSgyPpJelSlmxl1lc38jrSbgpvs/uuEXTxy1Z9tkFz3XcggPaqqmsZr icCJ1+kedBnLWAhMTyTE10IQGs/e0fyoBVllBmCuLvaCZFxgUnxd//XuyNGWizW4evjw HVc91qdoRWdvYHfVWU0RmXEnkA9LToJuDqGRiK/K1dd0H9noVZBDa3QR5VRS5Q+yBxlm JRHsa8w+uRr5IVcLxf4d5Elr7vrm8/cFQBHFd0s/gZzEEi5DpHEU5W6m+BI0tY+x78wX OdtICFRTIJi9naSV0s25nUTPyYdq03IVwSx1C5ZRec/lYefhWwFbIDubDaGavnhoFgVA BF6g== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=B2dng6uyh/TVtKzBLSnew6/1cI3Pxi8Kdl7ghuagDjo=; fh=i/pWNGcx7KiR3ewgypxpPkuORYlkCnVXLqKVm9/UgNc=; b=Vm83J9UmHM1DfEoaaGL1gGjfHy52dWFXtaPTnV9wJZMaT357Huy72cjwEnyJWqfhlY zijDvtYiazx8nT84M6p02tvDSLRaA9Yn4UxH+IlOwaCiDQCLctc30ZJYWAznSeNzwqOP CslmpTTI56FKdjLO3HSKDg/dS5nFVHLoAwcGi/nYzXBrBq1fMRPfmrD6b5wDGi71I7Qw dY7EbK0vN8qqimrhd28jjSeNoyZtMd1h4Wa8jn57kJ2DAKD6xV6c3JOPZaMbDQlyQ3/t 7rmBV3Dk+5bddZ2BBGqd5GTtqdW9JCsCNEdvWu5Gg5UEp2JiP4nSz4OgqiPhk8Gvqies x5ug==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AUbGAmac; 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-7c925b7eb26si1180460485a.278.2025.04.22.12.58.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Apr 2025 12:58:53 -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=AUbGAmac; 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 1u7JQZ-0000NS-PW; Tue, 22 Apr 2025 15:37:08 -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 1u7JOy-0005AP-MD for qemu-devel@nongnu.org; Tue, 22 Apr 2025 15:35:31 -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 1u7JOu-00073a-VU for qemu-devel@nongnu.org; Tue, 22 Apr 2025 15:35:28 -0400 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-225477548e1so57017145ad.0 for ; Tue, 22 Apr 2025 12:35:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745350523; x=1745955323; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=B2dng6uyh/TVtKzBLSnew6/1cI3Pxi8Kdl7ghuagDjo=; b=AUbGAmacNLauXAn7sy+sGXnofPcI2DGfXvYWeGU+tldxYog9WaUTFKBQcaVHHWT/az 9vm6ZSx6ym+J/aDyYWYwf2f6EGkHDoVBG1+C8ovy6jXjK+j/ccvTtq3qPS2PibSYls5W HW83tr6R08i/PYMN8xBeTP6jj79ZHXvlaglqGIx4tkNRQNh350NL5h497meD60AdG/Lw G5LJKYNlJQh/qyq3zfEg2/1/8e+rdhsiXVqwcdq9YFa5GUpOVmIkLRHZ5edhTZtmUmpR F4aagJYGhGGR4xkquFijZpVoRQpu86NyB2oUAl5UpzehIG4/JvAMJzyX2Uu6lBAkNk7Q Uh8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745350523; x=1745955323; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=B2dng6uyh/TVtKzBLSnew6/1cI3Pxi8Kdl7ghuagDjo=; b=K9wxich1bJU+tCX8EcMv+j2c2WIDQLYmggWd4tkpaoy61AbMLXhSFU8ByoBh9CGpc5 BeIyaMn/EFWCY90PV820WDnrohJS9pRYmlRNGyCQXVH2ES7TObfKWLTcayofucNWROAu GvIwlpgnZjCTFSQFKOntheOywdkj+eceEmjCFVavI9tOUQG801NsF8PPDFIXf7Ez5lko M9SjpN/J2F6WaH02hjFIY4q0AsS3hW3dDUAsv1QXhKuEu1JOat7z8W1MXYMHrgPeqDrr pEuY7fUtDRAkHZ8Lg6Mk/tQN6qY9Iz8fUMQ6kaTtpScqwErgpZGTufKVc+pV/BYymatq rWXw== X-Gm-Message-State: AOJu0YzXMdBj60Rf/P2Dj4Nxl3oEXpyh5gTPV3mLYyFI71gHfGjLT3hu y7FDq5citZ7WH/4r5qG8sNBc+3VedH0xhv0dQ82+7hea18i0nXjmYKn0mNSQGIxkjnVokW1GEFt i X-Gm-Gg: ASbGncu+xCi1I14+OqDBt9wkYXVXO7GG7qbMTajxqeQu3Rwko045yDzzKnWDVqsM+xJ D7swEt4GR/KWAfv4B0Pgt/y1R6W98iIx9sYr7v50XhWJKvzGP2aQLVCwsXoCNePuyWNyMhzWtV1 rIST/ycoryYh1Qy1qV58m3Zh8UiiR5CihN1r+HhlR6lwgMQeHcPUXsqHb1DWXh0QYnmlDjl5xQK f/6Xr++jsrgv6dE1e/7H9rBiUCZxIJgK56Eo5S02HmZenltuPjYuj5nbPJD4pJXodNzflvEPzIh HRBtr6EavgDjwNwTyeuWEjUDmTyZrFTUVnMjbvxsU8SkV4OaeaxEyNtkAppb/KagMa+AXT+KZ3u DmAsL4K/Eqw== X-Received: by 2002:a17:902:ef0a:b0:22c:35c5:e30a with SMTP id d9443c01a7336-22c53580d0dmr229853135ad.16.1745350523568; Tue, 22 Apr 2025 12:35:23 -0700 (PDT) Received: from stoup.. (71-212-47-143.tukw.qwest.net. [71.212.47.143]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-22c50fdf1f1sm88996795ad.237.2025.04.22.12.35.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Apr 2025 12:35:23 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Pierrick Bouvier Subject: [PATCH 096/147] accel/tcg: Build translator.c twice Date: Tue, 22 Apr 2025 12:27:25 -0700 Message-ID: <20250422192819.302784-97-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250422192819.302784-1-richard.henderson@linaro.org> References: <20250422192819.302784-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@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 Drop some unnecessary includes. Change the offsetof expressions to be based on CPUState instead of ArchCPU. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- accel/tcg/translator.c | 14 ++++++-------- accel/tcg/meson.build | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index 5f0aa9d56a..c53bbdef99 100644 --- a/accel/tcg/translator.c +++ b/accel/tcg/translator.c @@ -11,14 +11,13 @@ #include "qemu/bswap.h" #include "qemu/log.h" #include "qemu/error-report.h" -#include "exec/exec-all.h" #include "exec/cpu-ldst-common.h" #include "accel/tcg/cpu-mmu-index.h" +#include "exec/target_page.h" #include "exec/translator.h" #include "exec/plugin-gen.h" #include "tcg/tcg-op-common.h" #include "internal-common.h" -#include "internal-target.h" #include "disas/disas.h" #include "tb-internal.h" @@ -26,8 +25,7 @@ static void set_can_do_io(DisasContextBase *db, bool val) { QEMU_BUILD_BUG_ON(sizeof_field(CPUState, neg.can_do_io) != 1); tcg_gen_st8_i32(tcg_constant_i32(val), tcg_env, - offsetof(ArchCPU, parent_obj.neg.can_do_io) - - offsetof(ArchCPU, env)); + offsetof(CPUState, neg.can_do_io) - sizeof(CPUState)); } bool translator_io_start(DisasContextBase *db) @@ -50,8 +48,8 @@ static TCGOp *gen_tb_start(DisasContextBase *db, uint32_t cflags) if ((cflags & CF_USE_ICOUNT) || !(cflags & CF_NOIRQ)) { count = tcg_temp_new_i32(); tcg_gen_ld_i32(count, tcg_env, - offsetof(ArchCPU, parent_obj.neg.icount_decr.u32) - - offsetof(ArchCPU, env)); + offsetof(CPUState, neg.icount_decr.u32) - + sizeof(CPUState)); } if (cflags & CF_USE_ICOUNT) { @@ -80,8 +78,8 @@ static TCGOp *gen_tb_start(DisasContextBase *db, uint32_t cflags) if (cflags & CF_USE_ICOUNT) { tcg_gen_st16_i32(count, tcg_env, - offsetof(ArchCPU, parent_obj.neg.icount_decr.u16.low) - - offsetof(ArchCPU, env)); + offsetof(CPUState, neg.icount_decr.u16.low) - + sizeof(CPUState)); } return icount_start_insn; diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build index 72d4acfe5e..047afa49a2 100644 --- a/accel/tcg/meson.build +++ b/accel/tcg/meson.build @@ -8,6 +8,7 @@ tcg_ss.add(files( 'cpu-exec-common.c', 'tcg-runtime.c', 'tcg-runtime-gvec.c', + 'translator.c', )) if get_option('plugins') tcg_ss.add(files('plugin-gen.c')) @@ -22,7 +23,6 @@ tcg_specific_ss.add(files( 'cpu-exec.c', 'tb-maint.c', 'translate-all.c', - 'translator.c', )) tcg_specific_ss.add(when: 'CONFIG_USER_ONLY', if_true: files('user-exec.c')) specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_specific_ss)