From patchwork Tue Jun 21 20:46:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 583621 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5036:0:0:0:0 with SMTP id e22csp2044399mab; Tue, 21 Jun 2022 13:53:42 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vAvlSOCdoDHK77DpzGH9V2Nk49JmBcxrRCnSYdL5oOXEKHTjPTGoxL71ImICXadetmhYZy X-Received: by 2002:a05:620a:b87:b0:6a7:48d:9d97 with SMTP id k7-20020a05620a0b8700b006a7048d9d97mr21629665qkh.67.1655844822253; Tue, 21 Jun 2022 13:53:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655844822; cv=none; d=google.com; s=arc-20160816; b=FTDwiD3WGl6D0ZhBbOsVwLCYNg4Uhn+6y+7xs9ozumQFqn0w6R8mzpTFFF+nCDcmgx 43I1igLRJ3vhX6kXDfClM3lg4UuVEdtxpjwlduylzEjABBgo0zkQRPsY07WdFE4OPnb9 WCbgU1W9GWedEMeB4+iIud/v2mHXF2RI+gRz4TRO+0eU8zPBVMX3JqY18THosNSxeoYa 9nYxmsEf5CPOFKfgMBlA2SwA6KO7fhHqTfVwro79ah3ZqfnVgCqKKUTG4tQ3A+aF5Pcn KRAwWzmb4reJqMraReZMAhaMdvyxI4UfAoTxcBzkrJiFDrR8vsh5DYq6nkfMocUq7fqf az2w== 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=1iNW8arog/kBIvl1O8Y+BsdggwiOBBLeU4FAPW4Cogk=; b=vEh7LoGZybX0iyrkAbbC+8Ikuqm1B8pNImGtvESrVOhMrtWmikZMdfEqC6SlcZFNm3 8vVgLbKEIt7FKBMBOBGqYqvR48D2AW4Zhe5d72RxLpW0SDXCReBk1qmI39W+SJFdFfUH RLqfA91ucKkTI32sMf6Sf5c4k6l6QivhjgCnCrUozuuwoTq4sifZwYMqW/KGEavxIkgd iB76BgY65gMPf3QN3HXjY0i7wgOuMnn1/784vhG8NB2dVhESPDHLLXvmFb+28f6PZ74w iVn1+FI2mRmIdxfOBb2a57g2OGoq4Q0rpuEuv9Q6uPigd7isnsG5Cq8Jwe2QJwkagfqF R1pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rZ4I7HvD; 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 l8-20020a05620a28c800b006a7032548b1si11465735qkp.39.2022.06.21.13.53.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 Jun 2022 13:53:42 -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=rZ4I7HvD; 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]:59904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3ksX-0006oA-Ry for patch@linaro.org; Tue, 21 Jun 2022 16:53:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54060) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3klz-0006c3-9W for qemu-devel@nongnu.org; Tue, 21 Jun 2022 16:46:57 -0400 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]:38637) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o3klv-00015h-O8 for qemu-devel@nongnu.org; Tue, 21 Jun 2022 16:46:55 -0400 Received: by mail-pg1-x532.google.com with SMTP id e63so12670552pgc.5 for ; Tue, 21 Jun 2022 13:46:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1iNW8arog/kBIvl1O8Y+BsdggwiOBBLeU4FAPW4Cogk=; b=rZ4I7HvDKzSQTXuBodDxS9EnrTnvREZqcGD9p2DYTkhR+tdIpWTv5F2f+8PSPsFs5l 0+2UvkXAm7/r4S0v2BpvVNzBJcvRaztVTyDed2Y4Js2rr6CDp9d8j3hX8PF5Bzei9kBf LzfQY9/XBN06nKDLitMvGPKKMd8QEv88FElfPHkrJJyrJyVRGf/+2Sn+1C5wIkoUo4av cyngexmVggEhA9h3CfXRWVEbT5EXOgdW7YUJRNC3CjYSAhMl/9q3FbkcGsldsMT1ssdd FHW9pK1nvRlCe07obNBF2OP/aLUkO7Y7oC57Gy1RNsnJc52egLj8ayVXq9XhbbHFSh+1 18fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1iNW8arog/kBIvl1O8Y+BsdggwiOBBLeU4FAPW4Cogk=; b=6OmhzjiYxCVK1MTk77LGo+4GPy0rYdZJdrUQuWNQKDUZD4QUUSvWhVidtj2OP97LCZ 6yQAtaiPG31OBGkwggx4z0ulAYblNJ9gX4CmyMgpg2GDzR8KZtvPQpBTsEHnUjwcQBVM 5Uesz4jPwdGa2cxVt2O04e+E7G3dj/aQB7Lxpk9R9hOp0EslCbPrISkyrNpFxbng7RWj 4nvhKDx/JbwSOQrRmKgVDG+rJICxbiWBHjZ86755yGRKmdxWukR8yABz395RgoUeOadc OK7L95pI3sQmy0HrBPoxeiCMyoWiIAbOuPUM4h6mOFG7leXhNPPnK8Jf9/IE1TLWmkxb AXGA== X-Gm-Message-State: AJIora+yISNwHF8Y9d77Jx4AkUvdIw32XdLDVtx0fp2ojRybKnU1JJqe 7KEHkv4al6GxR1oZD0+8HczmMvyTJc3vaA== X-Received: by 2002:a63:ae4a:0:b0:40c:2d48:5fda with SMTP id e10-20020a63ae4a000000b0040c2d485fdamr25398560pgp.434.1655844407993; Tue, 21 Jun 2022 13:46:47 -0700 (PDT) Received: from stoup.. ([2602:47:d49e:3c01:8adc:a144:6ec2:4d71]) by smtp.gmail.com with ESMTPSA id p66-20020a625b45000000b005252defb016sm3649674pfb.122.2022.06.21.13.46.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jun 2022 13:46:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 4/9] accel/tcg: Reorganize tcg_accel_ops_init() Date: Tue, 21 Jun 2022 13:46:38 -0700 Message-Id: <20220621204643.371397-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220621204643.371397-1-richard.henderson@linaro.org> References: <20220621204643.371397-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::532; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x532.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, T_SCC_BODY_TEXT_LINE=-0.01 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" From: Philippe Mathieu-Daudé Reorg TCG AccelOpsClass initialization to emphasis icount mode share more code with single-threaded TCG. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20220323171751.78612-7-philippe.mathieu.daude@gmail.com> Signed-off-by: Richard Henderson --- accel/tcg/tcg-accel-ops.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index 684dc5a137..786d90c08f 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -97,16 +97,17 @@ static void tcg_accel_ops_init(AccelOpsClass *ops) ops->create_vcpu_thread = mttcg_start_vcpu_thread; ops->kick_vcpu_thread = mttcg_kick_vcpu_thread; ops->handle_interrupt = tcg_handle_interrupt; - } else if (icount_enabled()) { - ops->create_vcpu_thread = rr_start_vcpu_thread; - ops->kick_vcpu_thread = rr_kick_vcpu_thread; - ops->handle_interrupt = icount_handle_interrupt; - ops->get_virtual_clock = icount_get; - ops->get_elapsed_ticks = icount_get; } else { ops->create_vcpu_thread = rr_start_vcpu_thread; ops->kick_vcpu_thread = rr_kick_vcpu_thread; - ops->handle_interrupt = tcg_handle_interrupt; + + if (icount_enabled()) { + ops->handle_interrupt = icount_handle_interrupt; + ops->get_virtual_clock = icount_get; + ops->get_elapsed_ticks = icount_get; + } else { + ops->handle_interrupt = tcg_handle_interrupt; + } } }