From nobody Tue Feb 10 07:43:04 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.42 as permitted sender) client-ip=209.85.221.42; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f42.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.42 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1614808157; cv=none; d=zohomail.com; s=zohoarc; b=ZrwgFVWgKagMowJCLRrsGuaMwfS9e4DVMyqnjVRBwkgNOdrOVdQPY9Bq528THCO/12vrO7JhTstUDw+H0W1UV4grl81uS4hO3t/piEF3Nr1DFqkC8hzq5LfU3zmIlDNvd44pQPZQolV4N8nq4lJ5xgjxCvbu48PHm7DT1+2IprQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614808157; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9CGCXi9+Tg5mub0B9murOfm8Ay83y93iGvVDRpdfsps=; b=gOg7z+o98YUUgTac322bjDxf1J8QIYSWaA3gzFlZmj7z/4kQ99NVp9erJcXOfGOwmMtF7FIY93URcB+7rlkOfTn+ZHSP2eQ8c7U/CLTiW1fKrtwaoi1Uh7G9Uq0juugrIiww3pq5BL7L9XrwbqPhyuPkSxi+hDNN5vI5qril53c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.42 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by mx.zohomail.com with SMTPS id 1614808157769799.6879392242382; Wed, 3 Mar 2021 13:49:17 -0800 (PST) Received: by mail-wr1-f42.google.com with SMTP id u14so25382705wri.3 for ; Wed, 03 Mar 2021 13:49:17 -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 d85sm7280009wmd.15.2021.03.03.13.49.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 13:49:15 -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=9CGCXi9+Tg5mub0B9murOfm8Ay83y93iGvVDRpdfsps=; b=BncbyaUijP8mQby/RC1m6CuBqJhX4f8uzsk1xf64D9tsy+AD9d9Brmpw5VZRQO5Syj o7dArspPMkOOna0J7WUiL/VZKqa53GatDrqwn81COGz1Kmg6n6n+PgYM7Ojvi0zo/SsJ OH4A6PPki8hgQwWddehU5FTIuhNRyDe0sGkriywquNcSNxM+lnOO2qlBfcA1BLLjq+o0 N5Qzx5ODP0kfUJ39RwRX1uDACMjEbHauAqY0TD3Fh7164xGvF+VquUY3zrvXwZWm8bG0 xIEOPPoEtQZaGTdgO50avbceoOmKWn2ovQKrYyYuaFK/1KFgo26ChFQUdCSNo0KtUTRb RFOw== 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=9CGCXi9+Tg5mub0B9murOfm8Ay83y93iGvVDRpdfsps=; b=onOwrH3TOjTbFkHlVbkWcLWDXTarHlTaML42/nSKj7YB6O+DN2pQgUN3pmbKQlwbiC A75hl64gsqQjK4bxOQy6vBV0/X9t/SdMpboook/459/9hHo33bE5N+eUgbBtlmjrkD/9 vE+xZXnbJt+JaASq33KSokmhLdsNw29eQ0AJ78Pvgp2ULD73P4GTV75Ub9cRp9JEJWTl lKzgS5OQaOZ9H7464ANjmli8wNUtGlYyAw8AtKrtMCJ6UDCnpr49dGCksBxKiN/es5dS 9Ut2AGd4xbPp5/7DbVxic0uRiL3g2D1sNnyU0yJCdxhfMCZZrXKLpNm4nLOEBi/HxqEq tO6g== X-Gm-Message-State: AOAM530JOC/KZQM/qeoSUnrQ4bQMAqPGuGTE/mNiiiLSg+N//1DDbe4g EZZV/YQCaM71vKoTkw+IIWQ= X-Google-Smtp-Source: ABdhPJxYM063IJN0COFfaPkajKqL++yy+J1PkY9rOTXrR2FtKls2fwIULR4oDLlqPmI4itT1CUeXgw== X-Received: by 2002:adf:fd91:: with SMTP id d17mr815714wrr.0.1614808155948; Wed, 03 Mar 2021 13:49:15 -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?= , Eduardo Habkost Subject: [PATCH v4 23/28] target/i386: Restrict watchpoint code to system emulation Date: Wed, 3 Mar 2021 22:47:03 +0100 Message-Id: <20210303214708.1727801-24-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 --- target/i386/cpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 994d58aa754..4b8f06f6193 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6182,7 +6182,6 @@ static void x86_cpu_reset(DeviceState *dev) env->dr[6] =3D DR6_FIXED_1; env->dr[7] =3D DR7_FIXED_1; cpu_breakpoint_remove_all(s, BP_CPU); - cpu_watchpoint_remove_all(s, BP_CPU); =20 cr4 =3D 0; xcr0 =3D XSTATE_FP_MASK; @@ -6205,6 +6204,8 @@ static void x86_cpu_reset(DeviceState *dev) if (env->features[FEAT_7_0_EBX] & CPUID_7_0_EBX_FSGSBASE) { cr4 |=3D CR4_FSGSBASE_MASK; } +#else + cpu_watchpoint_remove_all(s, BP_CPU); #endif =20 env->xcr0 =3D xcr0; --=20 2.26.2