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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 50198C4727D for ; Wed, 23 Sep 2020 00:23:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1BF5F2085B for ; Wed, 23 Sep 2020 00:23:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727058AbgIWAXS (ORCPT ); Tue, 22 Sep 2020 20:23:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727034AbgIWAXS (ORCPT ); Tue, 22 Sep 2020 20:23:18 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DFA4C061755; Tue, 22 Sep 2020 17:23:18 -0700 (PDT) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKsZ1-004BGH-0x; Wed, 23 Sep 2020 00:23:15 +0000 Date: Wed, 23 Sep 2020 01:23:15 +0100 From: Al Viro To: Guo Ren Cc: Zhenzhong Duan , Linux Kernel Mailing List , linux-csky@vger.kernel.org, Oleg Nesterov Subject: Re: [PATCH] csky: Fix a size determination in gpr_get() Message-ID: <20200923002315.GC3421308@ZenIV.linux.org.uk> References: <20200922091505.471-1-zhenzhong.duan@gmail.com> <20200922162901.GA3421308@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 23, 2020 at 08:03:20AM +0800, Guo Ren wrote: > Thx Duan, > > Acked-by: Guo Ren > > Hi AI, > > I found the broken commit still has a question: > > > commit dcad7854fcce6a2d49b6a3ead5bbefeff047e559 > > Author: Al Viro > > Date: Tue Jun 16 15:28:29 2020 -0400 > > > csky: switch to ->regset_get() > > > NB: WTF "- what the fuck :(" is fpregs_get() playing at??? > The fpregs_get() is for REGSET_FPR regset used by ptrace (gdb) and all > fp regs are stored in threads' context. > So, WTF question for? The part under #if defined(CONFIG_CPU_HAS_FPUV2) && !defined(CONFIG_CPU_HAS_VDSP) What's going on there? The mapping is really weird - assuming you had v0..v31 in the first 32 elements of regs->vr[], you end up with v0 v1 v2 v3 v2 v3 v6 v7 v4 v5 v10 v11 v6 v7 v14 v15 v8 v9 v18 v19 v10 v11 v22 v23 v12 v13 v26 v27 v14 v15 v30 v31 in the beginning of the output. Assuming it is the intended behaviour, it's probably worth some comments...