From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 106624 invoked by alias); 14 Dec 2016 16:51:49 -0000 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 Received: (qmail 106561 invoked by uid 89); 14 Dec 2016 16:51:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=receipt, among X-HELO: mail-wj0-f195.google.com Received: from mail-wj0-f195.google.com (HELO mail-wj0-f195.google.com) (209.85.210.195) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 14 Dec 2016 16:51:46 +0000 Received: by mail-wj0-f195.google.com with SMTP id xy5so5803793wjc.1 for ; Wed, 14 Dec 2016 08:51:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=J/Ryn8BRn5yuR8UXP6q0aJoIgLEqc+sJjkHxCbgKSKE=; b=bcc2vthz9UwD833DlQQB9WcFEMEbqfJMqgudxzM34FHhcAZmacKzhhBMLSVJr70s7q DW6hqgQcum8eYxzhny+am88IE0dmNH3ZjkmI4CadvsdIRlw+n3rqvvojEilGI+tu8byL DSOLUzkAbtfzpyL2Rh59cPlwUT1++80HyhQFtsqGsTvrtw0Am/yk9mzbNLv6SBOJW5uz +q5wv7lDKmsihb6DI+OsfYIhkl3/zLNj/A4XoUGbgqnnSJ0kJWba0tcpXvGDm0hXBFkN Aew6lY1sA5N6nfnHRopJBbX/74KxFxmZUZpyDlx7uEB8U97J9nx2/FhKZCJG8ntAVBjk 8A/w== X-Gm-Message-State: AKaTC00NYJzIFtlTpEo4eYjC+Tdks8qInsvr1LnlvqA7DrUZ/t5N6JAHSvd0F6VeHeYqYQ== X-Received: by 10.194.198.196 with SMTP id je4mr86937554wjc.25.1481734304572; Wed, 14 Dec 2016 08:51:44 -0800 (PST) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id k11sm8387180wmb.18.2016.12.14.08.51.42 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 14 Dec 2016 08:51:44 -0800 (PST) Date: Wed, 14 Dec 2016 16:51:00 -0000 From: Yao Qi To: Alan Hayward Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 8/8] AARCH64 SVE: Enable AARCH64 SVE in gdbserver Message-ID: <20161214165124.GI25542@E107787-LIN> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2016-12/txt/msg00296.txt.bz2 On 16-12-05 12:31:08, Alan Hayward wrote: > > VG is included in the SVE register set and is marked as an expediated > register > (added in a previous patch). > > In the gdb remote side, on receipt on a stop-reply the VG value in the stop > reply is compared against the currently known VG value. If there is a > difference, then the current target description and register cache is > cleared > and a new target description is found (using the new VG value). This only works when target descriptions change among different VG values (VG != 0). If the program starts with VG = 0, the target description is still the normal aarch64 one, which doesn't understand register number of VG. (gdb) c Continuing. Remote sent bad register number 0x55: 55:0000000000000000;thread:p2ad9.2ad9;core:5; Packet: 'T0b1d:0000000000000000;1f:0000000000000000;20:0000000000000000;55:0000000000000000;thread:p2ad9.2ad9;core:5;' I applied your patches, hack aarch64_read_vg a little bit, let it return some random even number, like 0, 2, 4, 8. Looks adding a new expedite register doesn't help detecting architecture change. We may need to add a new stop reason "tdesc:id", "id" is an integer, the id of a known target description. > int aarch64_validate_tdesc (struct thread_info *thread) > { > - return 1; > + int tid = ptid_get_lwp (thread_to_gdb_id (thread)); > + long vg = aarch64_read_vg (tid); > + struct regcache *regcache = inferior_regcache_data (thread); > + struct process_info *proc; > + > + /* Non SVE targets always validate as true. */ > + if (vg == 0) > + return 1; This function doesn't handle the case VG = 2 changed to VG = 0. What we need to do is to compare tdesc, like this, return (proc->tdesc == aarch64_get_tdesc(vg)); which is simpler. > + > + if (regcache) > + return (register_size (regcache->tdesc, AARCH64_SVE_Z0_REGNO) > + == sve_vl_from_vg (vg)); > + > + proc = get_thread_process (thread); > + return (register_size (proc->tdesc, AARCH64_SVE_Z0_REGNO) > + == sve_vl_from_vg (vg)); > } > -- Yao (齐尧)