From patchwork Sat Sep 30 03:11:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 728090 Delivered-To: patch@linaro.org Received: by 2002:a5d:60c8:0:b0:31d:da82:a3b4 with SMTP id x8csp752468wrt; Fri, 29 Sep 2023 20:12:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEMS/BCRGqXxuwCsKayH7RkF/LYAj3bQtXxxJW2Atsx11C5jilz9GyrvN4fQWNoUuLfOrps X-Received: by 2002:a05:620a:bc1:b0:76f:1268:9e26 with SMTP id s1-20020a05620a0bc100b0076f12689e26mr6465071qki.24.1696043526942; Fri, 29 Sep 2023 20:12:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696043526; cv=none; d=google.com; s=arc-20160816; b=y8YE6+WaprdYURZG10OBiGZ+VzWrt/9TehDy2gxmPXou1PgykIr/H4Q9V2U7yjqOYE OUNZoukKrHK+DVUf32SnfR1QQPPd2L9rNS7BVF1GT0oYSd4Mc+eKsjVF9GzvUCXeI7J7 +V+nMRV+5xoFRWIfKWqanaZbETRzB4VUhzcZcxOQQcDiBfOkc638MAtWHpX7JuR5uS6h Gsu4Y53IIZWjVcfu9uPJ5AWcCCYr7DWJdM/KtJF1apwF/MHSClVmKEvtPYoeC46erSwJ 4GcRoKEQ3nR87K8q0GuvBEMymP83+y1VMcnIEDwIEq1O2lRmANsTe9DaK1SaiDOAd3Xp Byhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=CvIZ6W7L03y5eJZB7mtYJeqixddh+4BUTJc0pWynQtU=; fh=UQCixiNfr28ZOrfhmxiGPA65dFhly8CmRsnoYC6xI9k=; b=QVa8YeWqdiZOpK69oyac4Jz2+ckHgJHpJluHeKtMw2iweZyePX5rUiX9DKsf3zDJjr ihBezJqGCbNvBIPZjSmoI2fO7WboiCXMgilnSblD94WmS8C9pO2Qxlk1hhoYOKlnjHYC ljXDiiBuLKa/o/tbOnSiAVrTNQSwDGYC3YQf6gWMruG0+De476kaOz8cppbxb0gDhjLT sg2RA89YnvWNk+75O8ogpQCUjSIKo3cGGXhLZGQb/siKe7+cfWaEV37bYpZYVRG7uVLz 1alfrUEU2HJrHSo1BWMaaoyV9NysZSAkd8tcInxkSjZfcxt01iTx00psQpaZzHf/gtmE 1NIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HuuDBEP+; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bn41-20020a05620a2ae900b0076799979daasi9624800qkb.238.2023.09.29.20.12.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Sep 2023 20:12:06 -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=HuuDBEP+; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qmQO2-0001TV-6N; Fri, 29 Sep 2023 23:11:22 -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 1qmQO0-0001RL-DQ for qemu-devel@nongnu.org; Fri, 29 Sep 2023 23:11:20 -0400 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qmQNy-0000CZ-NN for qemu-devel@nongnu.org; Fri, 29 Sep 2023 23:11:20 -0400 Received: by mail-pj1-x102d.google.com with SMTP id 98e67ed59e1d1-279067b9823so3491353a91.1 for ; Fri, 29 Sep 2023 20:11:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696043477; x=1696648277; 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=CvIZ6W7L03y5eJZB7mtYJeqixddh+4BUTJc0pWynQtU=; b=HuuDBEP+0HD4wpkH9Y8GaESeEuE4NmQYrLhWa7M4aqjelYOFyiV8wJTZXBWvUXDKyQ GiO3vzfaSFPZX08CPw/19jhotlZiveuf43NUV0GSeolHiIDip9gPmPqGlwbCtl88OSj3 AkTQtizx6QgM6xIuNAcLHy5EvqIg7KABAjxXrAnd/40+wqPJEtPLr+1Rm2QQPhvQsXc5 HdGDrPPr0KJbstY7uolnf3j8qm3lmIzmn1DwehYev7PXn0nYZDxrYNUhYQIzB4i5N3Wg pQzFlllxUy9qGuFCElI8mpsIudvJ+iC8AdzCkrjzwRi6LqCL2ydNKXervZfEIAYcHbbf 3aLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696043477; x=1696648277; 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=CvIZ6W7L03y5eJZB7mtYJeqixddh+4BUTJc0pWynQtU=; b=NB++PsfLRBkvxl6ah0VSZNM9HrljRiqb5O0h4EN/O/r8HKEZLfF4sNODnQ32xQ+Xdk zjqFCBnUJp4L5AgXYXYS/dx5FBXPffWec+Q1PeVcEvFQWUHpTMlFbMXkqbJyfeSaLqis 5AWDgveWeeCV2nccox1XC5ru375o7EXMRxw0umXbzZkgfmebi0iUOFVHocIUlqSCOjuc w2Lu0ZlYxnWSvy1d6MXCdduCMJg4b92iymHJKWfUKooFFJt0V4AG0f9yDXC9Y/szSj/h HtMQ4k1znDmxmpxS2R48mF99rSYDJL5nie+o8AUaTtBRDQk8d86j+N/41VyNOBpPPuGN 2Wog== X-Gm-Message-State: AOJu0Yyl86QXrKqig2D6waKtQN5T6U+epeEOINzgZuQqUiK/XaUmiUNr Lrgv4CB0Xb8tGAC4sfPBy5LorUXXO9yJwUvz7fI= X-Received: by 2002:a17:90a:c913:b0:274:8a03:b546 with SMTP id v19-20020a17090ac91300b002748a03b546mr5951722pjt.23.1696043477142; Fri, 29 Sep 2023 20:11:17 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id gp15-20020a17090adf0f00b002790ded9c6dsm2146821pjb.31.2023.09.29.20.11.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 20:11:16 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v2 1/2] tcg: Remove argument to tcg_prologue_init Date: Fri, 29 Sep 2023 20:11:13 -0700 Message-Id: <20230930031114.1042913-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230930031114.1042913-1-richard.henderson@linaro.org> References: <20230930031114.1042913-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102d.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 We can load tcg_ctx just as easily within the callee. Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 2 +- accel/tcg/tcg-all.c | 2 +- bsd-user/main.c | 2 +- linux-user/main.c | 2 +- tcg/tcg.c | 3 ++- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index c9c6d770d0..44aced2ddd 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -785,7 +785,7 @@ static inline void *tcg_malloc(int size) void tcg_init(size_t tb_size, int splitwx, unsigned max_cpus); void tcg_register_thread(void); -void tcg_prologue_init(TCGContext *s); +void tcg_prologue_init(void); void tcg_func_start(TCGContext *s); int tcg_gen_code(TCGContext *s, TranslationBlock *tb, uint64_t pc_start); diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index 03dfd67e9e..d9d8dde202 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -121,7 +121,7 @@ static int tcg_init_machine(MachineState *ms) * There's no guest base to take into account, so go ahead and * initialize the prologue now. */ - tcg_prologue_init(tcg_ctx); + tcg_prologue_init(); #endif return 0; diff --git a/bsd-user/main.c b/bsd-user/main.c index f913cb55a7..dcdaf059bc 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -586,7 +586,7 @@ int main(int argc, char **argv) * generating the prologue until now so that the prologue can take * the real value of GUEST_BASE into account. */ - tcg_prologue_init(tcg_ctx); + tcg_prologue_init(); target_cpu_init(env, regs); diff --git a/linux-user/main.c b/linux-user/main.c index 96be354897..66962e1d4a 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -994,7 +994,7 @@ int main(int argc, char **argv, char **envp) /* Now that we've loaded the binary, GUEST_BASE is fixed. Delay generating the prologue until now so that the prologue can take the real value of GUEST_BASE into account. */ - tcg_prologue_init(tcg_ctx); + tcg_prologue_init(); target_cpu_copy_regs(env, regs); diff --git a/tcg/tcg.c b/tcg/tcg.c index 604fa9bf3e..4ec4f34b93 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -1387,8 +1387,9 @@ TranslationBlock *tcg_tb_alloc(TCGContext *s) return tb; } -void tcg_prologue_init(TCGContext *s) +void tcg_prologue_init(void) { + TCGContext *s = tcg_ctx; size_t prologue_size; s->code_ptr = s->code_gen_ptr;