From nobody Tue Feb 10 11:15:31 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.50 as permitted sender) client-ip=209.85.221.50; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f50.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.50 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1614808168; cv=none; d=zohomail.com; s=zohoarc; b=mlN7VAk199wm2e3LPbzBh2sInC8+xOaEf0SuShBUvBIE+7FS8+OB3BgAL+xzhqJfHQ7fXQJCwjUm0e5QSPhl1MQKHQ08rgk2kAXFAVA7L5QjGWmR863jcpqQT9IRA41Idj6IAvovNtNeaGYPxiRnKpFuq42KXmXpazwT+oT8NcA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614808168; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4R5DcpwiVyH1crneA2P/IW+Ft2bwjopPdJYmPr1uTds=; b=I3umkX9zvN1WflXBr0+yMIzHM4JfTgcLAfybU1Ml/F9K6VKdD6VzKH7SfyfhpthjaB9SHrZoSHZQqcuC786WcLIGk2M4R/JAXCjb4nVaLVWjoGkVeOLR72w2QmSZstdV8NS2Ig69N6RjLXlHuH/onV7oNMVdvBLsgr/cKddOfJ4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.50 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by mx.zohomail.com with SMTPS id 1614808168777749.5987470439259; Wed, 3 Mar 2021 13:49:28 -0800 (PST) Received: by mail-wr1-f50.google.com with SMTP id l12so25366742wry.2 for ; Wed, 03 Mar 2021 13:49:27 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (68.red-83-57-175.dynamicip.rima-tde.net. [83.57.175.68]) by smtp.gmail.com with ESMTPSA id o13sm38037052wro.15.2021.03.03.13.49.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 13:49:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4R5DcpwiVyH1crneA2P/IW+Ft2bwjopPdJYmPr1uTds=; b=NbAIWa7c7wZe+GDH8szDSnlBZPWxefFR6ntjrAyy3SKVtlc+p67YkOygXelyZmOmah OacmPQiMQ0lbJXnBe+33mRgfmD5dw7+k+5Ow/5Pn1Ci9mGYzyOz5bhtpFfpCkY3+QQrZ 5OpMSLo+GrtqvuQrFkRHoCmjX4zqF9222pqR0ZAzPPMiqRDPvrAK4bs5UwU7ZNOVznZF f9Xvgwp06LFaXUxDXE7xbatRKqokXNme+UMnhRg/a+IFQ5sisTntQew93UxnY+Pof4nA KfW9JorwSMGyM8dJqxFIBkOk5Xngz0MR+vlqm+6W06idIcZ7v2TDzmRgin0C7txbfgFy 8uTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=4R5DcpwiVyH1crneA2P/IW+Ft2bwjopPdJYmPr1uTds=; b=fiDtzZ6rc+1hntZo4p5U6ZzTrc+1uub0N4QlKcsmwRHlpXNUSz6V4XYsnLeTYrDF6v ZXUucbwO0Qs/5CAIZcsETyhoiOKNKF1UTMnu0ur73qskYejPtJ9CmhkTDmemAz4WBjjR 3Rv9/CaIsIdyyjaGynwCimNfeO30xeMBtVU99cKZ1dxKvi1JBFERi0NtqTmXqO/z2/J2 WCdX+RZF61ODgj7rDh5IRRg8nhEE1D3iMlHIgS6Ucsc2aDYm8xS6DQR9qHkIyXl8RpDo TbHyHC98MGLQ5f3LqtDCSD4vCyILveTeca2WC79iAm4tfUaps14If49pI9RMv0PuqRK2 OfKA== X-Gm-Message-State: AOAM531+lwJ8SDL+pOM63DVDr2uKZvTkaFsk3zfQLufQCnVNW1HCP3Cd VP5volvovKHBdigGeyodxhA= X-Google-Smtp-Source: ABdhPJw5M5BRw3KaT9S7Kgh8uaaWjhLQQiXmBsGhFLwNCBpvbqOZzXsB1MohyDvx9cI1GkLbED4wdA== X-Received: by 2002:adf:a418:: with SMTP id d24mr663327wra.187.1614808166003; Wed, 03 Mar 2021 13:49:26 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Claudio Fontana , qemu-arm@nongnu.org, Peter Maydell , Paolo Bonzini , Richard Henderson , qemu-s390x@nongnu.org, Thomas Huth , qemu-ppc@nongnu.org, Laurent Vivier , Cornelia Huck , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v4 25/28] accel/tcg/cpu-exec: Restrict watchpoint code to system emulation Date: Wed, 3 Mar 2021 22:47:05 +0100 Message-Id: <20210303214708.1727801-26-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210303214708.1727801-1-f4bug@amsat.org> References: <20210303214708.1727801-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) We can not use watchpoints in user-mode emulation because we need the softmmu slow path to detect accesses to watchpointed memory. Add #ifdef'ry around it. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- accel/tcg/cpu-exec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 16e4fe3ccd8..3a6436013ea 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -471,13 +471,16 @@ static inline bool cpu_handle_halt(CPUState *cpu) static inline void cpu_handle_debug_exception(CPUState *cpu) { CPUClass *cc =3D CPU_GET_CLASS(cpu); - CPUWatchpoint *wp; =20 +#ifndef CONFIG_USER_ONLY if (!cpu->watchpoint_hit) { + CPUWatchpoint *wp; + QTAILQ_FOREACH(wp, &cpu->watchpoints, entry) { wp->flags &=3D ~BP_WATCHPOINT_HIT; } } +#endif =20 if (cc->tcg_ops->debug_excp_handler) { cc->tcg_ops->debug_excp_handler(cpu); --=20 2.26.2