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 1FBFCC433E0 for ; Fri, 5 Mar 2021 07:13:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4883765000 for ; Fri, 5 Mar 2021 07:13:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4883765000 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4287A6B0007; Fri, 5 Mar 2021 02:13:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3D8016B0008; Fri, 5 Mar 2021 02:13:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 252916B000A; Fri, 5 Mar 2021 02:13:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0033.hostedemail.com [216.40.44.33]) by kanga.kvack.org (Postfix) with ESMTP id 034656B0007 for ; Fri, 5 Mar 2021 02:13:44 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id BD9F6180199CA for ; Fri, 5 Mar 2021 07:13:44 +0000 (UTC) X-FDA: 77884955568.06.4C764C6 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by imf24.hostedemail.com (Postfix) with ESMTP id D0364A0009DD for ; Fri, 5 Mar 2021 07:13:40 +0000 (UTC) Received: from ambrosehua-HP-xw6600-Workstation (unknown [182.149.161.105]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9AxCdYS2kFgsLUUAA--.7112S2; Fri, 05 Mar 2021 15:13:24 +0800 (CST) Date: Fri, 5 Mar 2021 15:13:22 +0800 From: Huang Pei To: "Maciej W. Rozycki" 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 Message-ID: <20210305071322.srv5gv5sro5p4dll@ambrosehua-HP-xw6600-Workstation> References: <20210227061944.266415-1-huangpei@loongson.cn> <20210227061944.266415-2-huangpei@loongson.cn> <20210304010623.4tyzpzgllsdy3ssg@ambrosehua-HP-xw6600-Workstation> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171215 X-CM-TRANSID:AQAAf9AxCdYS2kFgsLUUAA--.7112S2 X-Coremail-Antispam: 1UD129KBjvJXoWxCw13Xr1ktr1rWFW3Wr17ZFb_yoWrGw17pa yDu34DtrW5KryUXryj9w1vyrs0qr4UCryaqFy7KFWkAFyxKF18Xws7Gr90vryqqFsY9a1U Wryag3s8GrZ7Zw7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUvl14x267AKxVW8JVW5JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26ryj6F1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26F4j 6r4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oV Cq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0 I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r 4UM4x0Y48IcVAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwACI402YVCY1x02628vn2kI c2xKxwCY02Avz4vE14v_GF4l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr 1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE 14v26r1q6r43MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7 IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rVWrZr1j6s0DMIIF0xvE x4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvj DU0xZFpf9x0JUBpB-UUUUU= X-CM-SenderInfo: xkxd0whshlqz5rrqw2lrqou0/ X-Stat-Signature: kgpyiu8gaq7bae3bz7fne4s4jpfmzzkq X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: D0364A0009DD Received-SPF: none (loongson.cn>: No applicable sender policy available) receiver=imf24; identity=mailfrom; envelope-from=""; helo=loongson.cn; client-ip=114.242.206.163 X-HE-DKIM-Result: none/none X-HE-Tag: 1614928420-558187 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000007, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi, On Thu, Mar 04, 2021 at 02:40:54AM +0100, Maciej W. Rozycki wrote: > On Thu, 4 Mar 2021, Huang Pei wrote: >=20 > > > > @@ -1164,8 +1165,8 @@ build_fast_tlb_refill_handler (u32 **p, str= uct uasm_label **l, > > > > =20 > > > > if (pgd_reg =3D=3D -1) { > > > > vmalloc_branch_delay_filled =3D 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)); > > >=20 > > > Instead I'd paper the issue over by casting the constant to `s64'. > > >=20 > > > Or better yet fixed it properly by defining CAC_BASE, etc. as `uns= igned > > > long long' long rather than `unsigned long' to stop all this nonsen= se=20 > > > (e.g. PHYS_TO_XKPHYS already casts the result to `s64'). Thomas, W= DYT? > > Sorry, I do not get it , on MIPS32, how can CAC_BASE be unsigned long > > long ? >=20 > By using the `ULL' suffix with constants. It won't change code produc= ed,=20 > because they are unsigned anyway and the compiler will truncate them wi= th=20 > no change to the actual value to fit in narrower data types as needed, = but=20 > it will silence the warnings. >=20 > Maciej On Linux 5.11 with this patch and **ONLY** attaching ULL to CAC_BASE in=20 arch/mips/include/asm/mach-generic/space.h for CONFIG_32BIT, cross gcc 7.5 in Ubuntu 18.04, loongon1c_defconfig .......... make[1]: Entering directory '/home/hp/projects/Linux/temp/out_stable' GEN Makefile CALL /home/hp/projects/Linux/temp/linux-stable/scripts/atomic/check-= atomics.sh CALL /home/hp/projects/Linux/temp/linux-stable/scripts/checksyscalls= .sh CC arch/mips/mm/cache.o CC arch/mips/kernel/branch.o CC arch/mips/mm/context.o CC arch/mips/loongson32/common/time.o CC arch/mips/loongson32/ls1c/board.o CHK include/generated/compile.h CC arch/mips/vdso/vgettimeofday.o HOSTCC arch/mips/vdso/genvdso CC kernel/sched/cputime.o In file included from /home/hp/projects/Linux/temp/linux-stable/arch/mips= /include/asm/mmiowb.h:5:0, from /home/hp/projects/Linux/temp/linux-stable/include/l= inux/spinlock.h:61, from /home/hp/projects/Linux/temp/linux-stable/include/l= inux/wait.h:9, from /home/hp/projects/Linux/temp/linux-stable/include/l= inux/wait_bit.h:8, from /home/hp/projects/Linux/temp/linux-stable/include/l= inux/fs.h:6, from /home/hp/projects/Linux/temp/linux-stable/arch/mips= /mm/cache.c:9: /home/hp/projects/Linux/temp/linux-stable/arch/mips/include/asm/io.h: In = function =E2=80=98phys_to_virt=E2=80=99: /home/hp/projects/Linux/temp/linux-stable/arch/mips/include/asm/io.h:122:= 9: error: cast to pointer=20 from integer of different size [-Werror=3Dint-to-pointer-cast] return (void *)(address + PAGE_OFFSET - PHYS_OFFSET); ^ In file included from /home/hp/projects/Linux/temp/linux-stable/arch/mips= /include/asm/mmiowb.h:5:0, from /home/hp/projects/Linux/temp/linux-stable/include/l= inux/spinlock.h:61, from /home/hp/projects/Linux/temp/linux-stable/include/l= inux/wait.h:9, from /home/hp/projects/Linux/temp/linux-stable/include/l= inux/pid.h:6, from /home/hp/projects/Linux/temp/linux-stable/include/l= inux/sched.h:14, from /home/hp/projects/Linux/temp/linux-stable/include/l= inux/sched/signal.h:7, from /home/hp/projects/Linux/temp/linux-stable/arch/mips= /kernel/branch.c:10: /home/hp/projects/Linux/temp/linux-stable/arch/mips/include/asm/io.h: In = function =E2=80=98phys_to_virt=E2=80=99: /home/hp/projects/Linux/temp/linux-stable/arch/mips/include/asm/io.h:122:= 9: error: cast to pointer=20 from integer of different size [-Werror=3Dint-to-pointer-cast] return (void *)(address + PAGE_OFFSET - PHYS_OFFSET); ......... Only change CAC_BASE Does NOT work=20 Huang Pei