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

Re: [Xen-devel] [PATCH] x86/debug: Plumb pending_dbg through the monitor and devicemodel interfaces


  • To: Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Petre Ovidiu PIRCALABU <ppircalabu@xxxxxxxxxxxxxxx>
  • Date: Wed, 4 Dec 2019 16:40:41 +0000
  • Accept-language: ro-RO, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=bitdefender.com; dmarc=pass action=none header.from=bitdefender.com; dkim=pass header.d=bitdefender.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-SenderADCheck; bh=EeZmVwu1u9L8nIdbnKupQZzIILfiXFVYjVCq5qqodtU=; b=oBu0DHz5QLJFAI8Ub4SW8keHH1n2NqvvgwX7UmH9w3lsmE/zK89uhYV4j0TMiS8RiJbJRlEwJYNwrYNnf3ZARnwtO0+kmaj0NcivAt3eBIdme+8HBQ/94cYcDcaEY+NNR/Q/iPBARTaKyniOyQ+GHVGZ+FHxaKGScaxtWijT6Ez8dUvScyW3nPN6tsZ1MGYIuKXS8KhkYeH0gxyTM5Nrr4FliOSMuCn324uwRW7iQjciJUpB+UFeQcCMSj+Afu46UQaVKZV9Ey40vJtA35EmyeaHLAuWM/gqRUIr80hX8bDov/+zY5og0TClqa8fnCwopPF3dC36fs7Yq9LdYIHnwQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hq8paEy0fG21WCdrtjBR+2wIomUPGfkUSfsD47PR/dFGatvtkReKUZ/vkA0K9vRZKtU+1qJbYi1DIxsc7mXoG9gacbT6ssvV4Us3x8jOXCL88tYMxjtHg4DJj58FEMRGfseV0+IzwVHy+cKTK4LJBQQUxgSYiZW2UkaTFO0MGie1Q52aW1Jz+Od7qJA5h38s4PfRe+LGLd32x9bfCs/9774Mef/D0UMcedTQL6+pH4UySFKT3qsHJlb8z0qJEFHeeid3S4I8YsQavgBcAjqtNIWsK6Mvt1tF79aWF5R3dNmMeUrj1ToxVEP7AvARLwan+NDmn4DqLgrt04yuRKDj7A==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=ppircalabu@xxxxxxxxxxxxxxx;
  • Cc: Tamas K Lengyel <tamas@xxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Razvan COJOCARU <rcojocaru@xxxxxxxxxxxxxxx>, Ian Jackson <Ian.Jackson@xxxxxxxxxx>, Alexandru Stefan ISAILA <aisaila@xxxxxxxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Wed, 04 Dec 2019 16:41:11 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVqfyqJfL5ZJWFbkCmEracwCthr6epr8gAgAB/XYA=
  • Thread-topic: [PATCH] x86/debug: Plumb pending_dbg through the monitor and devicemodel interfaces

On Wed, 2019-12-04 at 10:04 +0100, Jan Beulich wrote:
> On 03.12.2019 18:10, Andrew Cooper wrote:
> > --- a/xen/include/public/hvm/dm_op.h
> > +++ b/xen/include/public/hvm/dm_op.h
> > @@ -324,7 +324,7 @@ struct xen_dm_op_inject_event {
> >      /* IN - error code (or ~0 to skip) */
> >      uint32_t error_code;
> >      uint32_t pad1;
> > -    /* IN - CR2 for page faults */
> > +    /* IN - type-specific extra data (%cr2 for #PF, pending_dbg
> > for #DB) */
> >      uint64_aligned_t cr2;
> >  };
> 
> How about
> 
>      uint32_t error_code;
>      uint32_t pad1;
>     /* IN - type-specific extra data (%cr2 for #PF, pending_dbg for
> #DB) */
> #if defined(__XEN__) || defined(__XEN_TOOLS__)
>     uint64_aligned_t extra;
> #else
>     uint64_aligned_t cr2;
> #endif
> };
> 
> or something along these lines (e.g. could also be an unnamed
> union guarded by a __GNUC__ check, or a __XEN_INTERFACE_VERSION__
> conditional), to have a less confusing name in Xen and the tools?
> Either way hypervisor bits
> 
Honestly, this looks a little bit scary.
However, it might be a good opportunity to discuss upgrading to C11,
which supports anonymous unions and offers a cleaner (and safer) way to
handle this type of problems.

Best regards,
Petre

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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