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=ham 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 25654C433DB for ; Thu, 4 Mar 2021 01:40:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 883A665034 for ; Thu, 4 Mar 2021 01:40:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 883A665034 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=orcam.me.uk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 169446B0005; Wed, 3 Mar 2021 20:40:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0F14E6B0006; Wed, 3 Mar 2021 20:40:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EACB46B0007; Wed, 3 Mar 2021 20:40:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0005.hostedemail.com [216.40.44.5]) by kanga.kvack.org (Postfix) with ESMTP id CBDE56B0005 for ; Wed, 3 Mar 2021 20:40:57 -0500 (EST) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 82139824999B for ; Thu, 4 Mar 2021 01:40:57 +0000 (UTC) X-FDA: 77880488154.28.A695B44 Received: from angie.orcam.me.uk (angie.orcam.me.uk [157.25.102.26]) by imf19.hostedemail.com (Postfix) with ESMTP id 6C33290009EA for ; Thu, 4 Mar 2021 01:40:56 +0000 (UTC) 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 X-Stat-Signature: btotfsfm77ghbga7yy1jdcfo9pd8kp41 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 6C33290009EA Received-SPF: none (orcam.me.uk>: No applicable sender policy available) receiver=imf19; identity=mailfrom; envelope-from=""; helo=angie.orcam.me.uk; client-ip=157.25.102.26 X-HE-DKIM-Result: none/none X-HE-Tag: 1614822056-299915 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000004, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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