From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by sourceware.org (Postfix) with ESMTPS id 97D543858026 for ; Wed, 2 Dec 2020 17:46:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 97D543858026 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=andrew.burgess@embecosm.com Received: by mail-wm1-x341.google.com with SMTP id g185so10593205wmf.3 for ; Wed, 02 Dec 2020 09:46:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=DeWWkslG6gxHZkUDjTdycXH99INhluZY8ar3FsAYs/4=; b=Si9iHCMVpm333+XtlCWaa+/f3g1KBIPMJ9Sj8VeK6D93FF7gMvGMM9/t6BTwc3Hvj7 ti20zNPE1ON6iU0O2cSnuAKfdlAGNZSmyWolakggwdINT5rKcPlbylh2NdCvN2IT7CGM +vI0RHV4QeQSv3I+5nkSCCPaxKhY39Ljhi1L2q77xbtHK5NJ+Cc0Te16aVDfpLFf4cvn DKnbkVnLwDnxsD0RaZ5NaH/gK1pgybJ0GnimdLtrYUufYU2s+QAiTsExAndJwBJpolAt DZtQXNwpEAuiJI65YW/PGtirT+b04qdiKgk1+NRB6dL/KhvZbOX7/oBQUa4MincYeZrj VDZQ== 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:in-reply-to; bh=DeWWkslG6gxHZkUDjTdycXH99INhluZY8ar3FsAYs/4=; b=cMPSpeaEYywsnMBB6Gy4FDLY5Vb/IkFhjtJvSD2Ihz4zev0Db3pPe4eAQpNzBykdGW wLbu2UCV9cGquZ1JQInOOKkJ1U5yETnfx1T2009yJU5J0h0yXNK1/kODkW5IXcMy7/xn JvTRW3DuKlHi4y6y+pg+ZTzZlFbGgoSPpWlobGGdk9Kffy79qqThUJSXim3EcQCgOJ7/ XnhUpPiCS/4ldhH29w2a3PmN5diaL6NbzsYGyCLYCRP7sTTnF1RLcXv72VwFbIa6sjN/ EP6B54Ziv39YQYl8EaP+ekRPgkAf+PZXlkaKxOOHUtEpLN3PSdM3Fcsdq1LBRolbLL72 lRdQ== X-Gm-Message-State: AOAM532g6v4y+924BUfmPR0iJL53TWDb+pCIHXeqrmw++mY98kBw/h2e HtRsL5XIpffCqbviUA7toSy1Kg== X-Google-Smtp-Source: ABdhPJwgiYmV5WGEyF+HdI567/nEdZ32a5RcUjLYGwjcqCoSuSw+A6EwOttDy+UUnHExSHyEvlujcA== X-Received: by 2002:a05:600c:2886:: with SMTP id g6mr4234552wmd.110.1606931207787; Wed, 02 Dec 2020 09:46:47 -0800 (PST) Received: from localhost (host109-154-20-215.range109-154.btcentralplus.com. [109.154.20.215]) by smtp.gmail.com with ESMTPSA id u12sm2840265wmu.28.2020.12.02.09.46.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2020 09:46:47 -0800 (PST) Date: Wed, 2 Dec 2020 17:46:46 +0000 From: Andrew Burgess To: Jim Wilson Cc: gdb-patches@sourceware.org, Nelson Chu Subject: Re: [PATCH 1/2] gdb/riscv: place unknown csrs into the correct register groups Message-ID: <20201202174646.GB2729@embecosm.com> References: <000963007279f4ed3796170299e4904150c107d3.1606392278.git.andrew.burgess@embecosm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: Linux/5.8.13-100.fc31.x86_64 (x86_64) X-Uptime: 17:41:25 up 38 days, 8:44, X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] X-Spam-Status: No, score=-5.6 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: Wed, 02 Dec 2020 17:46:50 -0000 * Jim Wilson [2020-11-27 14:38:44 -0800]: > On Thu, Nov 26, 2020 at 5:09 AM Andrew Burgess > wrote: > > > To see this in action connect to QEMU, this target advertises two > > registers dscratch and mucounteren which are unknown to GDB (these are > > legacy CSRs). Before this commit these registers would show up in the > > output of: > > > > The real problem here is that no one is maintaining the RISC-V qemu gdb > stub support. I wrote the original version of it, but I can't single > handedly do everything, so I'm still hoping someone else takes up > maintenance of this. Ideally, the qemu gdb stub should be updated when gdb > is updated. I know we've had discussions on this topic before, but this position makes no sense to me. The target description should describe the features that the TARGET knows about, not be some super-set of registers pulled from GDB (or anywhere else). It should be: Q: Does QEMU emulate register XXXXX ? Yes -> Add register to target description. No -> Don't add register to target description. If QEMU only offers a single configuration of RISC-V then we can get away with a fixed XML description on the QEMU side. If QEMU allows us to change the configuration we're emulating then the target description will need to be dynamically built on the QEMU side based on which features are in use. > Last time I looked at qemu, all of the xml files in qemu are > identical to the gdb ones, except for RISC-V, which was identical when I > added it, but no longer is, because the gdb ones are changing but the qemu > ones are not. > > Anyways, I don't have any objections to this patch. This is just a > wishlist for someone to start maintaining qemu properly. Indeed. I do have a task on my list to look at this - it's just pretty low down on my priorities right now :-/ Anyway, thanks for your feedback. Andrew