From nobody Fri Oct 31 09:32:49 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1748292810; cv=none; d=zohomail.com; s=zohoarc; b=l8g/SPQGogeXVhUu2MvK9rN5R7uhYllfA23Jl3UO+92gcExlIsF6SUF+5pXaMxUoH1Wpm0OsF1Mt1G84Ui31cEc1tJe6ARv/+VdwP0dSqNV9lWMFQEMO9Ef9vj6+tHERU4zbN3NKhUp23+ntaELH6ycWyOm0kh5QqRXjeKZskmw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748292810; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Qb25bEXVG3p9CU9Sg8KmV/sBuke8+/L1M/Zbvd+67i8=; b=hZpL7p0eOrgmoTRcN9ikMI3lHI7kYf2G7l9q9DF+7kSud1LJ0w1FJKVvzzmoSn2NZaJVCLe/8FLYc66dr5kUrRetn3wQkiNVhPhH6gu6og/5HfT0y6V2et1yw+S4jwXluat1r828BZfeOEBy+tFgRhqBzUZknCUhZhzsBVtYoYY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1748292810947727.3275294996184; Mon, 26 May 2025 13:53:30 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.997799.1378614 (Exim 4.92) (envelope-from ) id 1uJeom-0001hB-Ii; Mon, 26 May 2025 20:53:08 +0000 Received: by outflank-mailman (output) from mailman id 997799.1378614; Mon, 26 May 2025 20:53:08 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uJeom-0001h4-GB; Mon, 26 May 2025 20:53:08 +0000 Received: by outflank-mailman (input) for mailman id 997799; Mon, 26 May 2025 20:53:08 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uJeom-0001gy-2C for xen-devel@lists.xenproject.org; Mon, 26 May 2025 20:53:08 +0000 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [2a00:1450:4864:20::336]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 6be53ef9-3a73-11f0-b893-0df219b8e170; Mon, 26 May 2025 22:53:05 +0200 (CEST) Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-442ea341570so18939665e9.1 for ; Mon, 26 May 2025 13:53:05 -0700 (PDT) Received: from localhost.localdomain (host-92-26-98-202.as13285.net. [92.26.98.202]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-447f18251basm243682185e9.4.2025.05.26.13.53.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 May 2025 13:53:04 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 6be53ef9-3a73-11f0-b893-0df219b8e170 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1748292785; x=1748897585; darn=lists.xenproject.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=Qb25bEXVG3p9CU9Sg8KmV/sBuke8+/L1M/Zbvd+67i8=; b=aeIEDEZM9nnq7weJdN+06u4w3NXYTGKHJQuQJiMWS3Kn+OPyT1UFoWFjEycmUgO2BV Kb6De4PD7nZi4ZUQpS0wCXrqc1LlDGNgLvncFzXGhBAcjA/zjwfwI2SfNFfHBFYnnuPB 3Y4pGTZiPT4fmVK+gHLZaKehVHR/txpQfqjHw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748292785; x=1748897585; 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=Qb25bEXVG3p9CU9Sg8KmV/sBuke8+/L1M/Zbvd+67i8=; b=ZiX85G8Qw6nrwMjZ2MAXKY3yOHa3sgl8TiGlBO4AOSE5vwVmmBY8cVMNFOC3RWP0dG Q4IJE2Wbs7dxUi9SdN04g6UYedhQte2WVKR0CYa6ggCqWmizSKuqtvAD1B0OaNFgyP6d VsRbOsUPXSa+yhxPGwtNf3HDxIJppnqykvo7V/LCXs6h0BU3DA0pVNT141ZEIGW1yWIb w+cXRkjv/HjBNP+fqB8iHOr7xiFmgDzowQQq3oSnucj35w1EGaTnjRAM50RTnnsKDsVZ 6OA9CdA5mAt6G1R3al68NgKMC1Ilki6WyTfKbXKJG4pCOn11nkNmc6f4X/FUzD3SZtf8 NGRQ== X-Gm-Message-State: AOJu0YySUTj2WX04EQ5wmKsdEXZ04sUWeMqO+FARsyPgM/gUlSvUGwKi oNcwmZCWHN8XHbNW5f61FaB0h8d/BV0mzuNgtfgGGYFRqr/a64QxjtAMGY8qkSXpaS8p7b5yQ1G WP4RZ X-Gm-Gg: ASbGncu63YGWcf6eL5eqeU0Oltmsdybogo4PbDESEaV7fOt4sgY+GVolYGHrvZDx1aI +tOqA3ON5CwlGttifh3aPndXnm6f4z2+odIiq+TTrmwUoHXLALibX00c267p60UE2yfWpG3lXQU Df8D2Hf104uunEfQqemmAauKTessDtq+xYvrkg03vYtLXBs9fcGca03GTgRBSTGbA0torMZM2Hp Vy3J8nnm4mFNQBHYOykaxf3joRu6m2qyVnjY7p+fIWHNDyiZ5Dry6zfA7c5dHGJftcqMxiLOggA q6QheaSYAsr45/hQ9A5gNjQxjzomPjJDd+w9feErmEj/kIzbZetmz30wjVMpJlL2Vg0dMqeGsMc gk5KjkKmklx4SRIGDenHRua1y X-Google-Smtp-Source: AGHT+IFhtiPVFvy2L+RuChqZ8Sza3/nbyDe0zbfKlBB5ArCPhO1/1PN5F+kb5kRipzYLeRLpiawOqA== X-Received: by 2002:a05:600c:1e1c:b0:441:d438:4ea5 with SMTP id 5b1f17b1804b1-44c9493e6b1mr78478795e9.20.1748292784695; Mon, 26 May 2025 13:53:04 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Manuel Bouyer , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH] x86/pv: Fix breakpoint reporting Date: Mon, 26 May 2025 21:53:02 +0100 Message-Id: <20250526205302.997387-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1748292812845116600 x86_merge_dr6() is not a no-op when 0 is passed in; it will discard the previously latched breakpoint bits. The combination of do_debug()'s manual call to x86_merge_dr6() for external debuggers, and pv_inject_DB() calling pv_inject_event(), results in two x86_merge_dr6() calls. Feed the same pending_dbg in the second time. This makes pv_inject_event()= 's update of dr6 effectively a no-op, retaining the correct breakpoint bits. Fixes: db39fa4b27ea ("x86/pv: Fix merging of new status bits into %dr6") Reported-by: Manuel Bouyer Signed-off-by: Andrew Cooper Acked-by: Roger Pau Monn=C3=A9 --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 CC: Manuel Bouyer Now to figure out why my testing didn't spot this... --- xen/arch/x86/traps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 22f20629327d..e7b4693415cd 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -1823,7 +1823,7 @@ void asmlinkage do_debug(struct cpu_user_regs *regs) return; } =20 - pv_inject_DB(0 /* N/A, already merged */); + pv_inject_DB(dr6 ^ X86_DR6_DEFAULT); } =20 void asmlinkage do_entry_CP(struct cpu_user_regs *regs) base-commit: 6cfe3ae346fc84fbd4380fc45c70780935da590a --=20 2.39.5