[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5 1/6] x86/debugger: Remove debugger_trap_entry()


  • To: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 22 Apr 2022 09:27:06 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=FrmLkCznumhuP0eFOrcZnX3e9fgH0jxpTDlPyTGPLhI=; b=U5NGyqLWdQkj3+mEoHD/n6Xbx3i37xps66u9N5HoItNC0vAzigCz/sQMAoJeE8Wn/v6ls4xfkx/3F+nqu6XolkoQjbzwRjPyxSSqM9PEdeWu6XisAGnXKJG/SxZdKDncsJLbJwsp8uirxo+AqIQ0aRljDRn/ji30W/HWS/jSIfe8gbs0HGKg+OPaWLrlzS4JEH6s+u53hVYiimvL1JN0S+egtJnqN8lpXP8sahRb0bghoJDxmZTGusN5uA311OmYItB0tbZSsyia7F6jyn/CPIXCaKFxOLgC/87s02L4u2ttTrkC0kjH1UdKK7ZLeB17rn+XI7dZipvRAXSDYDIiMA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m0UKiZGL8qM69gus9pNiLeMIiY0JhpFw16Hdy98A/mgV+1IQodwYZuBrla8SjgwyuTy98MezwOJcqsMhcl4D+Ex6wMPdPIMFK8djhI2AOcZxh9PRuwcJ2/QPvOzwA8uJkwV971IfAYfDvQGpXgwHto35m5EcH3zY8t4L5BT8VHi0p8tYEMLYeb/gti5ha34jkCbpIxG/q43Ce1BlogS+zrr/CKQYI7idRmX69ip+VUY3q2nZRKFgA+HoH0N/nli/kJsJbpGslKEXB1Vjj92H3F1nSVSpVVo0doyCerToZuS8Vo0JfSrrgiohp594vK/OXYUUED0oXJipLpI4y7laVQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Bobby Eshleman <bobby.eshleman@xxxxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 22 Apr 2022 07:27:30 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 21.04.2022 19:23, Andrew Cooper wrote:
> On 21/04/2022 14:02, Jan Beulich wrote:
>> On 20.04.2022 16:13, Andrew Cooper wrote:
>>> From: Bobby Eshleman <bobby.eshleman@xxxxxxxxx>
>>>
>>> debugger_trap_entry() is unrelated to the other contents of debugger.h.  It 
>>> is
>>> a no-op for everything other than #DB/#BP, and for those it invokes guest
>>> debugging (CONFIG_GDBSX) not host debugging (CONFIG_CRASH_DEBUG).
>>>
>>> Furthermore, the description of how to use debugger_trap_entry() is at best,
>>> stale.  It is not called from all exception paths,
>> But on almost all (before this change) - the exception looks to be
>> #NM.
>>
>>> and because the developer
>>> is forced to modify Xen to perform debugging, editing debugger_trap_entry() 
>>> is
>>> not the way one would efficiently go about diagnosing the problem.
>> Shouldn't it be the remote end to request which exceptions it wants
>> to be notified of? If so, removing the hook invocation isn't very
>> helpful.
> 
> That's not part of the gdb remote protocol.
> 
> In normal conditions, gdb gets to see see anything which manifests as a
> signal.  It does not get to see anything which is resolved by the kernel
> behind the scenes.  #NM you've already identified, and most #PF's would
> count too.  Back in the 32bit days, Xen-induced #GP/#SS's for non-4G
> segments would count too.
> 
> But in addition to filtering Xen's idea of "fixing up behind the
> scenes", you also need to Xen to understand when to skip notifications
> based on what a PV guest kernel can fix up, and this is getting even
> further out of gdb's comfort zone.
> 
> debugger_trap_entry() is empty (WRT gdbstub) specifically because it's
> description is nonsense in any practical debugging scenario.  And lets
> not start on the fact that the lack of ability to invoke
> pv_event_inject() means that any fault from userspace will livelock
> under debugging.
> 
> Deleting it is absolutely the right way forward, because a theoretical
> future with someone wiring this up would have to start again from scratch.
> 
> Not that qualifies as a good reason in isolation, do_trap() contains
> unreachable logic because the compiler can't figure out that #DB/#BP are
> handled via alternative paths, and the gdbsx logic is dead.

The patch description could certainly do with expanding some along these
lines.

Acked-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.