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=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 4F59AC433DB for ; Thu, 4 Mar 2021 01:42:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1315B65077 for ; Thu, 4 Mar 2021 01:42:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233877AbhCDBmr (ORCPT ); Wed, 3 Mar 2021 20:42:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233692AbhCDBmU (ORCPT ); Wed, 3 Mar 2021 20:42:20 -0500 Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::4]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7A0DCC061756 for ; Wed, 3 Mar 2021 17:41:39 -0800 (PST) Received: by angie.orcam.me.uk (Postfix, from userid 500) id 72ACF92009C; Thu, 4 Mar 2021 02:40:54 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 6DCAD92009B; Thu, 4 Mar 2021 02:40:54 +0100 (CET) Date: Thu, 4 Mar 2021 02:40:54 +0100 (CET) From: "Maciej W. Rozycki" To: Huang Pei cc: Thomas Bogendoerfer , ambrosehua@gmail.com, Bibo Mao , Andrew Morton , linux-mips@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, Jiaxun Yang , Paul Burton , Li Xuefeng , Yang Tiezhu , Gao Juxin , Fuxin Zhang , Huacai Chen Subject: Re: [PATCH] MIPS: clean up CONFIG_MIPS_PGD_C0_CONTEXT handling In-Reply-To: <20210304010623.4tyzpzgllsdy3ssg@ambrosehua-HP-xw6600-Workstation> Message-ID: References: <20210227061944.266415-1-huangpei@loongson.cn> <20210227061944.266415-2-huangpei@loongson.cn> <20210304010623.4tyzpzgllsdy3ssg@ambrosehua-HP-xw6600-Workstation> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-arch@vger.kernel.org On Thu, 4 Mar 2021, Huang Pei wrote: > > > @@ -1164,8 +1165,8 @@ build_fast_tlb_refill_handler (u32 **p, struct uasm_label **l, > > > > > > if (pgd_reg == -1) { > > > vmalloc_branch_delay_filled = 1; > > > - /* 1 0 1 0 1 << 6 xkphys cached */ > > > - uasm_i_ori(p, ptr, ptr, 0x540); > > > + /* insert bit[63:59] of CAC_BASE into bit[11:6] of ptr */ > > > + uasm_i_ori(p, ptr, ptr, (CAC_BASE >> 53)); > > > > Instead I'd paper the issue over by casting the constant to `s64'. > > > > Or better yet fixed it properly by defining CAC_BASE, etc. as `unsigned > > long long' long rather than `unsigned long' to stop all this nonsense > > (e.g. PHYS_TO_XKPHYS already casts the result to `s64'). Thomas, WDYT? > Sorry, I do not get it , on MIPS32, how can CAC_BASE be unsigned long > long ? By using the `ULL' suffix with constants. It won't change code produced, because they are unsigned anyway and the compiler will truncate them with no change to the actual value to fit in narrower data types as needed, but it will silence the warnings. Maciej