From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31355 invoked by alias); 3 Mar 2010 23:23:15 -0000 Received: (qmail 31343 invoked by uid 22791); 3 Mar 2010 23:23:14 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 03 Mar 2010 23:23:10 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.3/8.14.3) with ESMTP id o23NN6PB025419; Thu, 4 Mar 2010 00:23:06 +0100 (CET) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.3/8.14.3/Submit) id o23NN400000171; Thu, 4 Mar 2010 00:23:04 +0100 (CET) Date: Wed, 03 Mar 2010 23:23:00 -0000 Message-Id: <201003032323.o23NN400000171@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: hjl.tools@gmail.com CC: gdb-patches@sourceware.org In-reply-to: <20100302194559.GA14466@intel.com> (hongjiu.lu@intel.com) Subject: Re: PATCH: Add common files for x86 XSAVE extended state References: <20100302152826.GA28158@intel.com> <20100302194559.GA14466@intel.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-03/txt/msg00137.txt.bz2 > Date: Tue, 2 Mar 2010 11:45:59 -0800 > From: "H.J. Lu" > > On Tue, Mar 02, 2010 at 07:28:26AM -0800, H.J. Lu wrote: > > Hi, > > > > This patch adds common files for x86 XSAVE extended state. They > > are used by native x86 gdb and gdbserver to discover x86 XSAVE > > extended state support. You can see IA32/Intel64 SDM at > > > > http://developer.intel.com/products/processor/manuals/index.htm > > > > for details. OK to install? > > > > Thanks. > > > > > > H.J. > > --- > > 2010-03-02 H.J. Lu > > > > * common/i386-cpuid.h: New. > > * common/i386-xstate.c: Likewise. > > * common/i386-xstate.h: Likewise. > > > > > Here is the updated patch to define macros used by native gdb and > gdbserver. There is no need for common/i386-xstate.c nor > common/i386-cpuid.h. OK to install? Looks a lot less repulsive than the first diff. But there are quite a few oddities in there (what the heck are those strings good for?), that make me question whether we want such a file at all. Again, difficult to review without seeing where and how this actually gets used. > 2010-03-02 H.J. Lu > > * common/i386-xstate.h: New. > > diff --git a/gdb/common/i386-xstate.h b/gdb/common/i386-xstate.h > new file mode 100644 > index 0000000..41c7ce1 > --- /dev/null > +++ b/gdb/common/i386-xstate.h > @@ -0,0 +1,48 @@ > +/* Common code for i386 XSAVE extended state. > + > + Copyright (C) 2010 Free Software Foundation, Inc. > + > + This file is part of GDB. > + > + This program is free software; you can redistribute it and/or modify > + it under the terms of the GNU General Public License as published by > + the Free Software Foundation; either version 3 of the License, or > + (at your option) any later version. > + > + This program is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + GNU General Public License for more details. > + > + You should have received a copy of the GNU General Public License > + along with this program. If not, see . */ > + > +#ifndef I386_XSTATE_H > +#define I386_XSTATE_H 1 > + > +/* The extended state feature bits. */ > +#define bit_I386_XSTATE_X87 (1ULL << 0) > +#define bit_I386_XSTATE_SSE (1ULL << 1) > +#define bit_I386_XSTATE_AVX (1ULL << 2) > + > +/* Supported mask and size of the extended state. */ > +#define I386_XSTATE_SSE_MASK \ > + (bit_I386_XSTATE_X87 | bit_I386_XSTATE_SSE) > +#define I386_XSTATE_AVX_MASK \ > + (I386_XSTATE_SSE_MASK | bit_I386_XSTATE_AVX) > +#define I386_XSTATE_MAX_MASK \ > + I386_XSTATE_AVX_MASK > + > +#define I386_XSTATE_SSE_MASK_STRING "0x3" > +#define I386_XSTATE_AVX_MASK_STRING "0x7" > +#define I386_XSTATE_MAX_MASK_STRING "0x7" > + > +#define I386_XSTATE_SSE_SIZE 576 > +#define I386_XSTATE_AVX_SIZE 832 > +#define I386_XSTATE_MAX_SIZE 832 > + > +#define I386_XSTATE_SSE_SIZE_STRING "576" > +#define I386_XSTATE_AVX_SIZE_STRING "832" > +#define I386_XSTATE_MAX_SIZE_STRING "832" > + > +#endif /* I386_XSTATE_H */ >