From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua1-x932.google.com (mail-ua1-x932.google.com [IPv6:2607:f8b0:4864:20::932]) by sourceware.org (Postfix) with ESMTPS id 5A58E385DC00 for ; Tue, 9 Jun 2020 01:19:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5A58E385DC00 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=jimw@sifive.com Received: by mail-ua1-x932.google.com with SMTP id b13so6565959uav.3 for ; Mon, 08 Jun 2020 18:19:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lkIVfJ2adXNbArnvMv7o28qhiyU7g2STL9UMLsvziTM=; b=YDhqsb5dPeqeb2giipCFsYUQGDl4fMUreEsAOxjtNU3etS5u6blx+G7XZvVBObzsBg A2g6bxi4nOZCIQekPW9IIgm1/oVlAMj6TT9AQvfqKKlAdAW/HHJhnOxKBGjaT21wJMgm 6cjzByqeP9zpNTCPj2GHuaduTxp8lm6GWSwsTuRUVEaz5hPcCVLwct9co2Ouv4AEuvxW qhBcFx40/R2bXf7ggDbU4WepNPmKna/3fhAGU8bDsFCSRzscmpkzg3aVDeDA8uldQ5QQ lb8l1dJqLhKkZTennLNpO9I/uZsJr0ObJ9/QxBajQCORgQ3l7qJv1A8QZHGyQosras46 ISvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lkIVfJ2adXNbArnvMv7o28qhiyU7g2STL9UMLsvziTM=; b=D8zkgJ8xQSExUY5jibp+Vzak/ZecH/7gcc+HL9h9uaspa2tC1bYPjaM4IUjOoQaJP2 u1shLJoLVprwb56BiiliPoX9wkGbBT0Vzo4+CdP64BbOfotXM959k4B8IHLvhxAVPnIi H+HD4qW+pwjgbgG3McvsJI0HYN7HB2XaMcaUBIWuAxHWbK8AEHpbEzjBksnWuKwsV+pd tWPrmwJz8AqoC6rq1QsK1DznxWurnFfaSpS5pnsXt0C+1Mg2NH4n2aCe5/JAGOozcCKk Fj+rWSYiavemMQBiZomtobBqh2rPvtiuAyjMeUBK+uMF8mN151T0G630tbl7FoVjZusH +ILw== X-Gm-Message-State: AOAM5312tGZQ4q4QVtnpC7UzA2cSIPO519IWD2Q+EwzHZNu9f0y1tlN0 RvR7CQC8yYOS01DOl7opaG8D+v/DewZGw2euHTdB5/N/ X-Google-Smtp-Source: ABdhPJxJTZ6B15A3iKXmvB/fHlhHZfCheN7SnaIlVa5CzotYWvOTiclFLkJnn0rmUhn1g6Cfsrbnbcg5Vh3lscG+s/4= X-Received: by 2002:ab0:a81:: with SMTP id d1mr1034450uak.67.1591665567848; Mon, 08 Jun 2020 18:19:27 -0700 (PDT) MIME-Version: 1.0 References: <1584007257-14466-1-git-send-email-nelson.chu@sifive.com> <87r1upefg8.fsf@tromey.com> <20200608213927.GC2737@embecosm.com> In-Reply-To: <20200608213927.GC2737@embecosm.com> From: Jim Wilson Date: Mon, 8 Jun 2020 18:19:17 -0700 Message-ID: Subject: Re: [0/1] RISC-V: Update CSR to priv 1.11. To: Andrew Burgess Cc: Tom Tromey , gdb-patches@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jun 2020 01:19:29 -0000 On Mon, Jun 8, 2020 at 2:39 PM Andrew Burgess wrote: > Unless I misunderstand here, you asking why we don't use the xml > target descriptions? We do. Or we _should_ do. Maybe it's not > working? Is your target definitely sending back a description? And > it definitely includes register "dscratch" ? qemu does have xml support; I added it. The xml register files were copied straight from the gdb xml files at the time I wrote the patches. Unfortunately, no one is actively maintaining this code, or actively testing it, unless maybe you count Tom who is apparently testing it, so the xml files no longer match the gdb ones. The old qemu version of the files does have a dscratch register because gdb had it at the time. qemu does have a concept of priv spec version, but I doubt anyone has given any thought about how to match the xml files to the priv spec version. Currently, there is a single set of xml files, and that isn't going to work long term. The list of csr registers needs to depend on the priv spec version. descratch was added in priv spec 1.9, and was dropped in 1.11. qemu 4.0 has 1.9.1 and 1.10 support, so dscratch is a valid register name for priv spec versions supported by qemu (though qemu is dropping 1.9.1 from the development tree). Anyways, dscratch needs to work in gdb, adding an alias sounds like a reasonable solution. There is a DECLARE_CSR_ALIAS in include/opcode/riscv-opc.h for dscratch and other affected csrs, but I guess gdb isn't handling those at the moment Jim