From patchwork Sun Apr 28 22:14:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 792928 Delivered-To: patch@linaro.org Received: by 2002:adf:cc13:0:b0:346:15ad:a2a with SMTP id x19csp1423592wrh; Sun, 28 Apr 2024 15:16:31 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVJ5B49iZNZIHTCzQHTQXVFaR+R12vjBBJ2taYXs/gUYmGWsejlMfGjLJtrRjV40KMFYmVKOou2aAgx6teewVGF X-Google-Smtp-Source: AGHT+IExhuseJZfeJeCxoCj1dMubiZ865gj7RZhFl3cg5cWijFECFIpt2tqRaQC7v/Ndr0qHoMq6 X-Received: by 2002:a05:620a:460b:b0:790:e856:81e0 with SMTP id br11-20020a05620a460b00b00790e85681e0mr4944909qkb.43.1714342590930; Sun, 28 Apr 2024 15:16:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714342590; cv=none; d=google.com; s=arc-20160816; b=H3jlbCae/LqEOMmoYPIMSZTxaphXcQhc23dI4+MfDUohwPT0JFl+FcsKbqMn+H6/iG fSd2G/ZM2AXocOfzgMFT1gqKHAPG22gCbuzU4WCoaAg8OY2bg2LGlM742SzYk9yNfWLs PhMjMXFZgu0xlRSh9X8Y4t6hE/5Hn7oDmuNUP/KTMU/1wGCwP1PjG2hHxvClSJkuC6wf xEsMw/DLxtsNAFxXSYyQzxsY26u8C7cCoPcogExEjF7w1F5X7NQwp+PXxD5IumP1rJzp kO4qwh47Z9owCTU4khWfTrTLnH2IFa78PdCrzrlWzAx9g/edrvBWTAaNnq8VszBDokAo f6hg== 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=k0P/VtJjh42zf7hktk88GWMfGQHzmvaE6RmKFsHTdzk=; fh=+kTJNlX4d/Ktp/5WO5d77IkVGYcQ7tiev+NqB54rN/Q=; b=WR7OihnP2bOJfyKmBbz8cVQtNVhsogfVuq9bxmzx3MQP9ldn4auV2RRduQl9atl3c8 IklREyx4fZQ2JRWQgm+pj/AAbP5oylHOmYlx9jIRy9RiWWuPRGg2IKERA8qbe9IrhvQ9 sXwG9nY9urp00tNafa1goLAtCC/H8aNV94IDlh7a5WeIFHWeZknfQ3x1stz8jsWoGGlB i9xTX0/KDpxzX6jrOemRAeE/RbH5HWYZZIypKhp9UdwPluf0Pka/mYHIneneTSZVna6A jULZWROPtcCLhK7z7pM5XXZif5gcU0xTR2f2gpZR/xU92j8uVONVCbdbB9+PHlBJNdNG G0VA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=azwa6ccv; 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 g16-20020a05620a109000b0078f1bd893d5si21191605qkk.592.2024.04.28.15.16.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 28 Apr 2024 15:16:30 -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=azwa6ccv; 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 1s1Co4-0006K3-To; Sun, 28 Apr 2024 18:15:36 -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 1s1Co3-0006HS-B8 for qemu-devel@nongnu.org; Sun, 28 Apr 2024 18:15:35 -0400 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s1Co1-0005bO-0r for qemu-devel@nongnu.org; Sun, 28 Apr 2024 18:15:35 -0400 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a58872c07d8so868551466b.0 for ; Sun, 28 Apr 2024 15:15:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714342531; x=1714947331; 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=k0P/VtJjh42zf7hktk88GWMfGQHzmvaE6RmKFsHTdzk=; b=azwa6ccv7KJnDz85n7WCXjG1j1YOcrW3SUdFBuFU5cRzDxM28Gwd598JE03ii381G4 dVpaH7aMDMBboR+ZwotgNCTyWd8RpyMXkgCcnQ34uNTEzLLlkLKvE32Ds/zU2Xjte/WP r3dl22KBHLFuLUbxxoVFMsVlaUxoSlRAPGx2DVzAwgj7qgG1K1Tj6NDiIXPUqVsN/7JX jD0OeZqPK/NxZSg7rq/NlscJuWA/E/wYQMPqRaV6zVzg+mE4VG/MNyI67LfConaj1SUX lxv+tbkJajlEM98mTbS5z5qEttyggYuTKx2xlahxpPqASGlJeYZq3MEI8JeulhX5ILfI s/dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714342531; x=1714947331; 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=k0P/VtJjh42zf7hktk88GWMfGQHzmvaE6RmKFsHTdzk=; b=FTg37rtvsSdxGJEuWffyuADwntHlxlA2rM1s/VnyesIwgsIoT8rhr85tsxXDdRH7SR 4UinuBVdPm4I6tnTE9mBYjiCCje0mzTFCpHCkyYxcHaa4zZibuSOSgJ+IkQFuryij0PH OJhRp+bz9s7SFAZyU6CcBmszEYyJb8scWBgsvQmT6he1VsRUCxM5ME3zMdJ9Dtmt+9jy 5bZnTBzF9chgRyK6urSFhpbdTshKka+4/+l1qAPXqqy8UwIOt1qa2MyTS6EA90GtKSRn JWM7xfoVRfP6d9xz8ViRnZ+hqCBF1K15nAUz7bPZKFvUWEAs4np3wNCZBMi5ALI4vN0r fnQA== X-Gm-Message-State: AOJu0Yxjwuvli3Ked//lfaXR87tIknaJKKlOJXW23j1QdoHvx2sb38AF 2RLfbroyWrz8dVqWO0595zLkky8PDZ+gErPW+duN/gQjCrfOOqyM+DUfG06n5hAO0e9HGFhqg5z M X-Received: by 2002:a17:906:e17:b0:a58:921a:970d with SMTP id l23-20020a1709060e1700b00a58921a970dmr7426286eji.6.1714342530907; Sun, 28 Apr 2024 15:15:30 -0700 (PDT) Received: from m1x-phil.lan ([176.176.142.130]) by smtp.gmail.com with ESMTPSA id g10-20020a1709067c4a00b00a4e5866448bsm13044579ejp.155.2024.04.28.15.15.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 28 Apr 2024 15:15:30 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Anton Johansson , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 07/24] accel/tcg: Implement AccelOpsClass::exit_vcpu_thread() handler Date: Mon, 29 Apr 2024 00:14:33 +0200 Message-ID: <20240428221450.26460-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240428221450.26460-1-philmd@linaro.org> References: <20240428221450.26460-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=philmd@linaro.org; helo=mail-ej1-x633.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 The TCG-specific code from the system generic cpu_exit() is equivalent of tcg_cpu_exit(). Define the AccelOpsClass exit_vcpu_thread() handler to it, making cpu_exit() generic. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- accel/tcg/tcg-accel-ops.c | 2 ++ system/cpus.c | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index 7ac5f0c974..56bbad9fcd 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -43,6 +43,7 @@ #include "tcg-accel-ops-mttcg.h" #include "tcg-accel-ops-rr.h" #include "tcg-accel-ops-icount.h" +#include "internal-common.h" /* common functionality among all TCG variants */ @@ -218,6 +219,7 @@ static void tcg_accel_ops_init(AccelOpsClass *ops) } } + ops->exit_vcpu_thread = tcg_cpu_exit; ops->cpu_reset_hold = tcg_cpu_reset_hold; ops->supports_guest_debug = tcg_supports_guest_debug; ops->insert_breakpoint = tcg_insert_breakpoint; diff --git a/system/cpus.c b/system/cpus.c index d0d585e8b9..3e86b488d3 100644 --- a/system/cpus.c +++ b/system/cpus.c @@ -422,9 +422,6 @@ void run_on_cpu(CPUState *cpu, run_on_cpu_func func, run_on_cpu_data data) void cpu_exit(CPUState *cpu) { qatomic_set(&cpu->exit_request, 1); - /* Ensure cpu_exec will see the exit request after TCG has exited. */ - smp_wmb(); - qatomic_set(&cpu->neg.icount_decr.u16.high, -1); if (cpus_accel->exit_vcpu_thread) { cpus_accel->exit_vcpu_thread(cpu); }