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=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,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 429AEC433DF for ; Thu, 14 May 2020 05:44:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1E3472073E for ; Thu, 14 May 2020 05:44:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725794AbgENFor (ORCPT ); Thu, 14 May 2020 01:44:47 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:46972 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725788AbgENFor (ORCPT ); Thu, 14 May 2020 01:44:47 -0400 Received: by mail-io1-f68.google.com with SMTP id j8so581645iog.13 for ; Wed, 13 May 2020 22:44:45 -0700 (PDT) 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=7oDc3kobxbLN8zQjue8D4ls6OVvEC00+vj04oio67vo=; b=qyxEGwwl5itlw9LTfker6uysZv472O64uxajOCMORYDg9L+WKEg89KT4IhLyAY4i5W IPoUL9btH6bxZzPOxAYIgL5uj97cTN64isKn/YROtUml3ftB/W4NR1Wkd2Z4z85/rghT PLbZIKahDDKhCHEXiykgeUbABxuTrMwnBMVZ9SRNntX8z1htp0oGj/tZ6idBx5huYe3z EUEeVQnai4/wC0fD5LFkPmwGQsu1EDawHR8B3q/mpIGWWpq4Y2WnyhFBOl1NamG5e0vo DWqMpWtWLnRxVN+orMoRuZiTDJFtzThUlzwRgYJHYUCAqzTbG1lZkiZcTK3+eUbV5i3Y W1pA== X-Gm-Message-State: AOAM533FAn2rETfL9EwLVgjnrC9U8FinTGP8ZrKUIpb4ChT4lmnV1h3d wFQbHY+m7aPuB05uGme8uDN7gxnRkNW6LenKlPQ= X-Google-Smtp-Source: ABdhPJxroh5u40yQ5KepP31yU6zZog4e7NkAyytC6rlf4B9qjFb0lyX1srCDgrm+zoX1IvYldw0zfrc13Af9bIPqSVk= X-Received: by 2002:a5e:880b:: with SMTP id l11mr2704858ioj.42.1589435085215; Wed, 13 May 2020 22:44:45 -0700 (PDT) MIME-Version: 1.0 References: <1588153121-28507-1-git-send-email-chenhc@lemote.com> <20200429183305.GB21234@alpha.franken.de> In-Reply-To: From: Huacai Chen Date: Thu, 14 May 2020 13:44:34 +0800 Message-ID: Subject: Re: [PATCH 1/2] MIPS: Loongson-3: Enable COP2 usage in kernel To: "Maciej W. Rozycki" Cc: Thomas Bogendoerfer , "open list:MIPS" , Fuxin Zhang , Zhangjin Wu , Jiaxun Yang Content-Type: text/plain; charset="UTF-8" Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org Hi, Maiej, On Thu, May 14, 2020 at 6:42 AM Maciej W. Rozycki wrote: > > On Thu, 30 Apr 2020, Huacai Chen wrote: > > > > > diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h > > > > index ce40fbf..0f71540 100644 > > > > --- a/arch/mips/include/asm/mipsregs.h > > > > +++ b/arch/mips/include/asm/mipsregs.h > > > > @@ -386,6 +386,7 @@ > > > > #define ST0_CU1 0x20000000 > > > > #define ST0_CU2 0x40000000 > > > > #define ST0_CU3 0x80000000 > > > > +#define ST0_MM 0x40000000 /* Loongson-3 naming */ > > > > > > please use ST0_CU2, so everybody understands it's COO2 > > I see that there is already an alias ST0_XX for ST0_CU3, and I think > > use a ST0_MM for ST0_CU2 is more meaningful in some places (at least > > in traps.c where ST0_XX is also used). If there are places only used > > to describe the CU Mask (such as in stackframe.h), I will use ST0_CU2. > > Well ST0_XX is not an alias, because the bit has a different meaning that > has nothing to do with CP3. It just happens to share the bit position in > CP0.Status with ST0_CU3. Yes, ST0_XX is misplaced and misnamed as it > applies to R10k processors only, but it is our legacy from the old days of > chaos and some three processor types supported. This is similar to say > ST0_ERL vs ST0_IEP, which also share the bit position in CP0.Status, but > have different meanings each. > > All this could have been cleaned up (e.g. s/ST0_XX/R10K_ST0_XX/) if > someone had the incentive; I occasionally had and poked at these macros, > but apparently missed this one and a couple of other ones. Maybe on some > rainy autumn evening... > > However ST0_MM does enable CP2, even if a specific implementation, making > it no different from ST0_CU2 really. I have send a new version, could you please review that?Thank you. > > Maciej > > Huacai