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

Re: [PATCH 3/3] x86: Fix calculation of %dr6/dr7 reserved bits


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 29 Aug 2023 16:21:51 +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=fqZQyZrY36izFBLb6hlQzKneQ331m94pD6mWUsh/gkA=; b=fyS92K21tMZjhCEX6qDLtJJr4vUggTwUOmeMKR8SB8KKg60ywhCDaimruelgoA4+5DVDrXiKP7WA4ZtxH7fMebmWhq4X3CrzQVPzTsW7K6nuo1+Eu4oT2RZiTDx3mSSM6eOXqGjHPt5g0UPnm4n0AC+DL7EnnXK6H6wfXuJmfIjjBrFieBEFpG8WBGGY+6vmk5TcM0HRYlsgBaiCY7O4/vJ2Vb5HuZHh29pH2xoyPsIFPP8lA0EMFesuaSu+a712lUQiKlCNsDzxQju+19jrWNBspPNku6DV4HrpdmliLJRjfgI5C3oqpM/34Sita+WOv9f2jFb4CXOgI50GOryYJA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UCpD/ou05MZ05+LSgAzn5xo1jvapsqqquI9jYnNZUQieox65NoLtFuispmav/dCfMGlrRynrUL1fnKbVcm4NX8OBaN77NiO/HBiPDp5O29HP6apHCO+vm5iBT/LCfp49rpBJh7UWWuVPKUnXn7Vzmd3zSa/wECvT0qV0gkzZvUwDlkl1GlsiiD1l98nHUnCjAoHQbgPAJgqkKXDX1MRduH7QHeEagmC+u3xt7eGr2U4mntDKCIZ7uFjREL+7TzEA20hBfo9lfK2QxLVLpAC7HneHVTwdACD+rhwb3BVjbf6bVDt9JVnqG66F2mU2VPeIDbbB838Z8fPrUNFtBJRPzA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Jinoh Kang <jinoh.kang.kr@xxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 29 Aug 2023 14:22:28 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 29.08.2023 15:43, Andrew Cooper wrote:
> --- a/xen/arch/x86/include/asm/debugreg.h
> +++ b/xen/arch/x86/include/asm/debugreg.h
> @@ -1,6 +1,7 @@
>  #ifndef _X86_DEBUGREG_H
>  #define _X86_DEBUGREG_H
>  
> +#include <asm/x86-defns.h>
>  
>  /* Indicate the register numbers for a number of the specific
>     debug registers.  Registers 0-3 contain the addresses we wish to trap on 
> */
> @@ -21,7 +22,6 @@
>  #define DR_STEP         (0x4000)        /* single-step */
>  #define DR_SWITCH       (0x8000)        /* task switch */
>  #define DR_NOT_RTM      (0x10000)       /* clear: #BP inside RTM region */
> -#define DR_STATUS_RESERVED_ZERO (~0xffffefffUL) /* Reserved, read as zero */

As you're dropping constants from here, how about the others? Especially
DR_NOT_RTM would be nice to go away as well (I don't really like its name),
yet DR_SWITCH looks to also be unused.

> --- a/xen/arch/x86/include/asm/x86-defns.h
> +++ b/xen/arch/x86/include/asm/x86-defns.h
> @@ -102,13 +102,30 @@
>  
>  /*
>   * Debug status flags in DR6.
> + *
> + * For backwards compatibility, status flags which overlap with
> + * X86_DR6_DEFAULT have inverted polarity.
>   */
> -#define X86_DR6_DEFAULT         0xffff0ff0  /* Default %dr6 value. */
> +#define X86_DR6_B0              (_AC(1, UL) <<  0)   /* Breakpoint 0         
>        */
> +#define X86_DR6_B1              (_AC(1, UL) <<  1)   /* Breakpoint 1         
>        */
> +#define X86_DR6_B2              (_AC(1, UL) <<  2)   /* Breakpoint 2         
>        */
> +#define X86_DR6_B3              (_AC(1, UL) <<  3)   /* Breakpoint 3         
>        */
> +#define X86_DR6_BLD             (_AC(1, UL) << 11)   /* BusLock detect (INV) 
>        */
> +#define X86_DR6_BD              (_AC(1, UL) << 13)   /* %dr access           
>        */
> +#define X86_DR6_BS              (_AC(1, UL) << 14)   /* Single step          
>        */
> +#define X86_DR6_BT              (_AC(1, UL) << 15)   /* Task switch          
>        */
> +#define X86_DR6_RTM             (_AC(1, UL) << 16)   /* #DB/#BP in RTM 
> region (INV) */
> +
> +#define X86_DR6_ZEROS           _AC(0x00010000, UL)  /* %dr6 bits forced to 
> 0       */

0x00001000?

Jan



 


Rackspace

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