From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29556 invoked by alias); 4 Mar 2010 19:29:47 -0000 Received: (qmail 29465 invoked by uid 22791); 4 Mar 2010 19:29:46 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40 X-Spam-Check-By: sourceware.org Received: from mail-wy0-f169.google.com (HELO mail-wy0-f169.google.com) (74.125.82.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 04 Mar 2010 19:29:41 +0000 Received: by wyb29 with SMTP id 29so1539567wyb.0 for ; Thu, 04 Mar 2010 11:29:38 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.184.205 with SMTP id s55mr1004362wem.149.1267730978548; Thu, 04 Mar 2010 11:29:38 -0800 (PST) In-Reply-To: <20100304190934.GB15979@caradoc.them.org> References: <20100304180219.GA10826@intel.com> <20100304190934.GB15979@caradoc.them.org> Date: Thu, 04 Mar 2010 19:29:00 -0000 Message-ID: <6dc9ffc81003041129i72a8a79bn66721fecc7b6a83b@mail.gmail.com> Subject: Re: PATCH: 1/6: Add AVX support From: "H.J. Lu" To: "H.J. Lu" , GDB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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/msg00208.txt.bz2 On Thu, Mar 4, 2010 at 11:09 AM, Daniel Jacobowitz w= rote: > On Thu, Mar 04, 2010 at 10:02:19AM -0800, H.J. Lu wrote: >> 4. Remote gdb protocol extension. GDB will send >> >> x86:xstate=3DBYTES:xcr0=3DVALUE >> >> in qSupported request packet to indicate that GDB supports x86 XSAVE >> extended state. BYTES specifies the maximum size in bytes of x86 XSAVE >> extended state GDB supports. VALUE specifies the maximum value of XCR0 >> GDB supports. =A0Gdbserver will select the best target description >> supported by GDB, based on BYTES and VALUE. The older gdbserver will >> always return SSE target. > > The whole point of target descriptions, and the thing we've been going > to so much trouble to implement for the past month, is that this > negotiation is not supposed to be needed. =A0Why does it matter what GDB > supports? =A0If there are new registers that GDB does not know about, > in the target description supplied by gdbserver, then GDB will not use > them specially for debug info or function calls. =A0But it will > otherwise handle them fine. > AVX registers aren't new registers, on top of SSE registers. AVX registers are the super set of SSE registers. XMM0 is the alias of the lower 128bit of YMM0. So we have either SSE target or AVX target, depending on the processor/OS. We may have remote gdb stub on an AVX processor/OS. But gdb, which the stub is talking to, may not support AVX at all. If the stub sends the AVX target description to gdb, gdb won't understand it and will fail. This may not be a serious issue today since the new stub with x86 XML target descriptions can only talk to gdb with x86 XML support, which very likely supports AVX XML. But between my x86 XML checkin and AVX checkin, there are some snapshots of gdb, which only supports SSE XML. If gdbserver sends AVX XML to them, those gdbs will fail. In the future, we will add more states to XSAVE extended state and we will extend gdb to support them. Gdbserver should send the XML target, which is supported by gdb, to gdb so that the new x86 gdb stub can talk to older gdb with x86 XML support.. The XCR0 bits in qSupported request packet are used for this purpose to provide forward compatibility. --=20 H.J.