From patchwork Sun Apr 28 22:14:49 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: 792938 Delivered-To: patch@linaro.org Received: by 2002:adf:cc13:0:b0:346:15ad:a2a with SMTP id x19csp1424065wrh; Sun, 28 Apr 2024 15:18:23 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWIwUYzBXQWYJWi8zXWfxb35m2BXVuZ5kcxYkeRC2YCNvWbRgv268o2BMDY9/Gkbf3mNcXx/YnC0dSl4L8leBtV X-Google-Smtp-Source: AGHT+IFCY07SbBuk7XmtAc139RZTYg/mgI7WX13iiSYm0RAl1qZq5lpagj38kSqQdJPl7mzQkFQm X-Received: by 2002:a05:620a:4910:b0:78e:5148:b04f with SMTP id vy16-20020a05620a491000b0078e5148b04fmr8850018qkn.61.1714342703070; Sun, 28 Apr 2024 15:18:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714342703; cv=none; d=google.com; s=arc-20160816; b=gCJnjSpXNX0yWOqvOfVQfZWE581WKkW6lqsbW4OOr7fKZwUl0jzIsT4wr66OeIcQRW snPiNi/soOs6+0r/C88dDQRymMiJ86+5h2MNdmnRj7V7ExQy5wQRcrUP0TnA98Ab9TUm ubqRyuwJPH5u1/xX0XzgFinrvyDe72zy2FFAlk8gvuVy0OHkA42pdyOWUaklHb5Odnw5 A4n5/ewXHd9zlzZY/zOx/FL5SrOYdrhbca6Qd/0IttrH/JsTqf3ERFv1R8mgbIQIPzz/ OIv1fMpCEhV+7tkSBxFSo5kRmtrZGyrN5Xh2wiAroXM0NwhetS2DTOXSsXQfVs/cvgWq vfzw== 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=5RHFpScpX3RBz3SndWvBFhPouPtIMynd6+ol800GYZ0=; fh=+kTJNlX4d/Ktp/5WO5d77IkVGYcQ7tiev+NqB54rN/Q=; b=qTc7cg0SifsYKwKuzRy3yVLr2WbES+wLMcPtAH0pOBS7D5FF7an5WSMpMs62JoIYns Cpc2PobCKz5kut+u44OM8BWut4PjLykbOgoLhlJKf9228aOKpBQxJTuYlIkhjtLcMaEZ JSEGPy4UOlHodSpkx8wK2vffsZk39kBfslk5T/E2Z0NT+Y1x016m/dmG07Z4nY3w8v23 TqsmbfZKxgwJMhVXELJ35HRlWiAb0mZ3iEYmkhGFetWpXLIaVj+Ta3sYvXaluPjApWO+ Ck9D45FkTzdQG+cteLOGwk5oihc4D+y1ez4fcKge2OGr1qHJFE0g1/nwUty4P4nscLDo WyaQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PQosyhLw; 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 yf13-20020a05620a3bcd00b0078d699ba683si24352801qkn.635.2024.04.28.15.18.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 28 Apr 2024 15:18:23 -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=PQosyhLw; 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 1s1Cpi-0002ze-4r; Sun, 28 Apr 2024 18:17:18 -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 1s1CpS-0001iB-Jk for qemu-devel@nongnu.org; Sun, 28 Apr 2024 18:17:03 -0400 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s1CpP-0005lb-P8 for qemu-devel@nongnu.org; Sun, 28 Apr 2024 18:17:02 -0400 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-a4702457ccbso513924066b.3 for ; Sun, 28 Apr 2024 15:16:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714342617; x=1714947417; 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=5RHFpScpX3RBz3SndWvBFhPouPtIMynd6+ol800GYZ0=; b=PQosyhLwrUJQFw01doa4zBCubWS7sveYWpp4LU4PUcHrajtJrajymsHrWcGcafuTyL Q29c1MylxnA+H+4rY3THl7j3cKPLYKQH4qssxo7q35otlPZghoNNMyY3RV2knd7H1NJd 1f2senut0CBmij0aWfYobLayFKLUJ52USWq0PtZsmC6cARxKWckzm2RhdsW0Ow9q3bWw o9mg98anh0DsXy/xd+jTB3XqA8u5GOfSuvNmCaSkGpF74wg7LDjcNf2qzuFyP9i50Jqd n3peO6jYEWTa9Guvo5Sxk4GM5Y/Wpg5lhoKabJ5G527sz5j1HRkwccUCX1qzdwCIv/5L FbPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714342617; x=1714947417; 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=5RHFpScpX3RBz3SndWvBFhPouPtIMynd6+ol800GYZ0=; b=kYRLSVUKHsS35e9odez6MsHHMrJj7ZDjmK9y23Jl3xnD/LmdxWqgNMC76riYkmT0xJ /IjDPEYMVfIR9U2LZftcuy7B4TuJbv2aOQNYfw1WFyHf9OjOSAehmsyv5Vs/ps6Mv0oc NsnV71cvOC096G8yr13k5MvxdrsFL6sJS1JAbn0T22vKyBdIWaKmTXPqb57JU2TzYUpx xsAHqCBCwFkxx5lfftNfKhFVmJdcCQtH67UW2qdg2uvoZCPuK1ridOvG6avaIuwWsY6L CFkHHq48GOy51MqnZRYyPA3j38cfZVSvuzRI6Loeo4k++cZHc+8TRNp83QreyUWnvx44 wy2w== X-Gm-Message-State: AOJu0Yz0V/szhKMiot3XzXoAOcCeYXxmZthDeupWpnfNmbOkLeYw8frk NuUjizWBG6rL6vPcR9tCgCN+N9geNQ6Mlvm7ujKj251CUTSk1D+wq63vYkb1T7lTs5kriC9z11X s X-Received: by 2002:a17:906:2bcd:b0:a58:cd39:d154 with SMTP id n13-20020a1709062bcd00b00a58cd39d154mr4272888ejg.11.1714342617110; Sun, 28 Apr 2024 15:16:57 -0700 (PDT) Received: from m1x-phil.lan ([176.176.142.130]) by smtp.gmail.com with ESMTPSA id p2-20020a170906614200b00a588e0e0d9bsm5903912ejl.93.2024.04.28.15.16.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 28 Apr 2024 15:16:56 -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 23/24] accel/tcg: Restrict icount to system emulation Date: Mon, 29 Apr 2024 00:14:49 +0200 Message-ID: <20240428221450.26460-24-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::62e; envelope-from=philmd@linaro.org; helo=mail-ej1-x62e.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 So far we don't support icount on user emulation. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- accel/tcg/cpu-exec.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 84fd041aec..1f618f6c2e 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -780,6 +780,9 @@ static inline bool cpu_handle_exception(CPUState *cpu, int *ret) static inline bool icount_exit_request(CPUState *cpu) { +#if defined(CONFIG_USER_ONLY) + return false; +#else if (!icount_enabled()) { return false; } @@ -787,6 +790,7 @@ static inline bool icount_exit_request(CPUState *cpu) return false; } return cpu->neg.icount_decr.u16.low + cpu->icount_extra == 0; +#endif } static inline bool cpu_handle_interrupt(CPUState *cpu, @@ -801,12 +805,14 @@ static inline bool cpu_handle_interrupt(CPUState *cpu, return false; } +#if !defined(CONFIG_USER_ONLY) /* Clear the interrupt flag now since we're processing * cpu->interrupt_request and cpu->exit_request. * Ensure zeroing happens before reading cpu->exit_request or * cpu->interrupt_request (see also smp_wmb in cpu_exit()) */ qatomic_set_mb(&cpu->neg.icount_decr.u16.high, 0); +#endif /* !CONFIG_USER_ONLY */ if (unlikely(qatomic_read(&cpu->interrupt_request))) { int interrupt_request;