From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49769C433DB for ; Wed, 10 Feb 2021 12:33:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 12AF964E40 for ; Wed, 10 Feb 2021 12:33:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231877AbhBJMcW (ORCPT ); Wed, 10 Feb 2021 07:32:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231868AbhBJMaN (ORCPT ); Wed, 10 Feb 2021 07:30:13 -0500 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 097DCC06174A for ; Wed, 10 Feb 2021 04:29:33 -0800 (PST) Received: by mail-wm1-x334.google.com with SMTP id 190so1686383wmz.0 for ; Wed, 10 Feb 2021 04:29:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=HSBGzyNlTheaTP9Pm689kFtenx8ASuk2y6uL2Tc/WCo=; b=ja8uBoCHnX3lV+218wuF4ozP9tqIM2twFANPvabPFO9wvMTYXLQfh8QD46knAfpuMN EmVCvgfqXLC0BwOPAqhj24425FF98V2EcIEOFDvxhjDl/LYym/D80JGuM/astu89Q6QU jQ1x6wNKProSzpJHYNZO6b5d3UDcgJ43ManuVMdqQesg6SEmz8qyfYE7gW/uUJ+VtfD2 SGccTg91+1RR0uB/lUsQDCp+VfhPgSN2UrxntP3WOOz1d226AyI5+uFud9KZVI/a73Qc r0bYtcmwIo/L4Wxt7QZiVUe1rMqML0+AgIAEWOKw9C+hCUdzedpRdcFe9cDabgssblUf 5kyw== 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=HSBGzyNlTheaTP9Pm689kFtenx8ASuk2y6uL2Tc/WCo=; b=ONQPZMAblrPGjq2d1MlH0Hs75xR3xCBjmDsnYEuAR2CJc7GBUlZWO1DoIN+zuzfvrx LdfoAYVfxVMaEyPoziTpd7Zxg/WRTbGP7mr9FT5w482Qni95tyxjfHMreOX5zOUieVgu sPNQUyf23AHmGen9H3qKEqDmTwg/qkEaQU1/2J9hpBiHAn1GjBpbcKT0t9Wu5Tj6eBzk VuwVSaRQhWYKavAd+SVzEdSgURw2ZOE6EIJxDXD0ThNaRx43pi0cna3rlVE0FXsSJQtf yvVKpzUt1nuqQvz8T4YMLowk8G9ARlnUXxRexEcp+jDLZj3ZP3xS64Vn3jCQDU/9Q5t7 o4sQ== X-Gm-Message-State: AOAM533OplQ72dwWLzEafOXyG6HvonVW+5VvJXAxp6xOWTUP9mVNzvlp KIh/B6W7Dx+XcccA/00RicUo/Q== X-Google-Smtp-Source: ABdhPJy8lL+GC/UgvYW10eu0d2mdCe/coatt2HAvvEKb9SYiGAKLYi3dUtCIF2vTvX8AshBPeMzWQA== X-Received: by 2002:a7b:cb92:: with SMTP id m18mr2732673wmi.35.1612960171708; Wed, 10 Feb 2021 04:29:31 -0800 (PST) Received: from maple.lan (cpc141216-aztw34-2-0-cust174.18-1.cable.virginm.net. [80.7.220.175]) by smtp.gmail.com with ESMTPSA id m18sm11864608wmq.1.2021.02.10.04.29.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Feb 2021 04:29:31 -0800 (PST) Date: Wed, 10 Feb 2021 12:29:29 +0000 From: Daniel Thompson To: "Maciej W. Rozycki" Cc: Arnd Bergmann , Thomas Bogendoerfer , Arnd Bergmann , kernel test robot , Jiaxun Yang , Paul Cercueil , Paul Burton , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] MIPS: make kgdb depend on FPU support Message-ID: <20210210122929.rgqfkoop4rsso3yo@maple.lan> References: <20210122110307.934543-1-arnd@kernel.org> <20210122110307.934543-2-arnd@kernel.org> <20210210113830.xeechzpctz5repv5@maple.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 10, 2021 at 01:11:28PM +0100, Maciej W. Rozycki wrote: > On Wed, 10 Feb 2021, Daniel Thompson wrote: > > > > Wrapping the relevant parts of this file into #ifdef MIPS_FP_SUPPORT > > > would be as easy though and would qualify as a proper fix given that we > > > have no XML description support for the MIPS target (so we need to supply > > > the inexistent registers in the protocol; or maybe we can return NULL in > > > `dbg_get_reg' to get them padded out in the RSP packet, I haven't checked > > > if generic KGDB code supports this feature). > > > > Returning NULL should be fine. > > > > The generic code will cope OK. The values in the f.p. registers may > > act a little odd if gdb uses a 'G' packet to set them to non-zero values > > (since kgdb will cache the values gdb sent it) but the developer > > operating the debugger will probably figure out what is going on without > > too much pain. > > Ack, thanks! > > NB if GDB sees a register padded out (FAOD it means all-x's rather than a > hex string placed throughout the respective slot) in a `g' packet, then it > will mark the register internally as "unavailable" and present it to the > receiver of the information as such rather than giving any specific value. > I don't remember offhand what the syntax for the `G' packet is in that > case; possibly GDB just sends all-zeros, and in any case you can't make > GDB write any specific value to such a register via any user > interface. kgdb doesn't track register validity and adding would be a fairly big change. Everything internally (including some of the interactions with arch code) is based on updating a binary shadow of register state which is only bin2hex'ed just before transmitting a packet. It will simply default them to zero and update them on a 'G' packet. > The way the unavailability is shown depends on the interface used, i.e. > it will be different between the `info all-registers'/`info register $reg' > commands, and the `p $reg' command (or any expression involving `$reg'), > and the MI interface. But in any case it will be unambiguous. I guess this probably does create a technical protocol violation since kgdb will reject per-register read/write for register that its report says are zero rather then invalid. Daniel.