Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp275176pxb; Wed, 4 Nov 2020 22:40:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJwjxAdditJHEDO7qA7+iRCjCmHvWx9y0K1YaZQpR4b/em5vCy9NQ1ZSc1H1bcy2dWDuooTe X-Received: by 2002:a17:906:b110:: with SMTP id u16mr872083ejy.55.1604558440742; Wed, 04 Nov 2020 22:40:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604558440; cv=none; d=google.com; s=arc-20160816; b=f6+YXKljBp+DFU7tdRFfnZzOYb3WErnCQt70UcjtSXmvVP855oaBmmrV2P9zHSiZkQ 3VCbihjXS/eEdc0EyHmXdNhOA5hTk/woPhCdt2Wm34LIiTGXbtewGG5l4skM91H0fmk7 piQ7jcFbBPYq/m0fXFE9sseXCpymYBMQTu+FUNySzC37TPMllnFo5NbRTOCQiewfJ0rP 3+WIfDVSIbr7ak7ygy0qMPx93v6EIywQq2+5390nC7Rn12umEO+9eKOuVS+dGtZ8Q2Ps ikDxreQrPtP8+QOQW7AT7qkDlhWWqlXKTgpnVZX6cOV2/nmhRsjNP6I7ThBTmul5S/XQ 94iQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=AyVi8nv9bxB+fUfbHsfwKKKH6LwJfTRc39uOuRnky6M=; b=dg2mP/Cgg9BkqGWjUpX6EkwjmYmXcuckpvhMKgyAxCmjZupDvBDShPlUHQgP5o6nEk OFjJP1zibmMeZdnatx2ONf7RHeGko/OGgRrvwsppuGvtrQkola7J8Obhtgcyys3ZVDI4 jXn/ryZB48Mx8SLe2lvP99M/UHIJG+9fdZvceiCsFGoKMXkiYFVLym0KHxYBl/neBRTF fj4bCHRqzagXJuTGbBJLg4lnbj5Myd0HHno1BRZjwzBX21GU4aACrAsajWn4TWsLDfis K3OllOqJqCQtm9heozngbMA+20dntu4+/k4GvLAIHpbdTgtp69jiSQPQQpR5dj44xRDq ggZw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z2si513876edi.245.2020.11.04.22.40.17; Wed, 04 Nov 2020 22:40:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727483AbgKEF6G (ORCPT + 99 others); Thu, 5 Nov 2020 00:58:06 -0500 Received: from mail-io1-f66.google.com ([209.85.166.66]:41782 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726213AbgKEF6F (ORCPT ); Thu, 5 Nov 2020 00:58:05 -0500 Received: by mail-io1-f66.google.com with SMTP id u62so613031iod.8; Wed, 04 Nov 2020 21:58:04 -0800 (PST) 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=AyVi8nv9bxB+fUfbHsfwKKKH6LwJfTRc39uOuRnky6M=; b=Cn11NBERHf9WhUG2tce/ni+mT/QoMaRz+irsjgG3xuRgKyY9nfK+OoUrHJSSu2A4n/ 6cZpxCf7XXDFdd89oWz9VtgP0MSm9Xgp73QR+wxrbmMxqhxk0XyxxoWkuTL4DaqzsPON 8V6B6DNimMievN8MuFVZh2MiXYx+4HkkpqkfBsQr5YaVKuTQf0zd8JvIraxOEbRKJwZN 4vLFG5rrFDFWFY+rh5IRabwK5D8rXN2v4fRnI9gHdGnGpn4C7uvj04s+lB9i9M9z0CdK ZLVoQztxrxytnfwu1j59jP6/py4Rcsmujn90nAW+Px3er7KdAX4XvN1OCNJsuyc48w30 p+vg== X-Gm-Message-State: AOAM533Da1Ha2ve9xhRYy3JDPU5GdFRf9PuM+sswPE4b6H3ZKp59Ed7C khnxPJQTUtzwY8XMmfr2+spaEdUop1aoZ/kuGkcTZCAi0k9yCw== X-Received: by 2002:a05:6638:15a:: with SMTP id y26mr848982jao.57.1604555884629; Wed, 04 Nov 2020 21:58:04 -0800 (PST) MIME-Version: 1.0 References: <1604387525-23400-1-git-send-email-yangtiezhu@loongson.cn> <1604387525-23400-2-git-send-email-yangtiezhu@loongson.cn> In-Reply-To: From: Huacai Chen Date: Thu, 5 Nov 2020 13:57:53 +0800 Message-ID: Subject: Re: [PATCH v3 1/6] MIPS: Loongson64: Do not write the read only field LPA of CP0_CONFIG3 To: Tiezhu Yang Cc: Thomas Bogendoerfer , Jiaxun Yang , "open list:MIPS" , LKML , Xuefeng Li Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Tiezhu, On Wed, Nov 4, 2020 at 11:51 AM Tiezhu Yang wrote: > > On 11/04/2020 10:00 AM, Huacai Chen wrote: > > Hi, Tiezhu, > > > > On Tue, Nov 3, 2020 at 3:13 PM Tiezhu Yang wrote: > >> The field LPA of CP0_CONFIG3 register is read only for Loongson64, so the > >> write operations are meaningless, remove them. > >> > >> Signed-off-by: Tiezhu Yang > >> --- > >> > >> v2: No changes > >> v3: No changes > >> > >> arch/mips/include/asm/mach-loongson64/kernel-entry-init.h | 8 -------- > >> arch/mips/loongson64/numa.c | 3 --- > >> 2 files changed, 11 deletions(-) > >> > >> diff --git a/arch/mips/include/asm/mach-loongson64/kernel-entry-init.h b/arch/mips/include/asm/mach-loongson64/kernel-entry-init.h > >> index 87a5bfb..e4d77f4 100644 > >> --- a/arch/mips/include/asm/mach-loongson64/kernel-entry-init.h > >> +++ b/arch/mips/include/asm/mach-loongson64/kernel-entry-init.h > >> @@ -19,10 +19,6 @@ > >> .macro kernel_entry_setup > >> .set push > >> .set mips64 > >> - /* Set LPA on LOONGSON3 config3 */ > >> - mfc0 t0, CP0_CONFIG3 > >> - or t0, (0x1 << 7) > >> - mtc0 t0, CP0_CONFIG3 > > Sorry for the late response, I have the same worry as Jiaxun. As you > > know, Loongson's user manuals are not always correct, but the original > > code comes from Loongson are usually better. So, my opinion is "Don't > > change it if it doesn't break anything". > > Hi Huacai, > > Thanks for your reply, I have confirmed by Loongson user manuals and > hardware designers, CP0_CONFIG3 register is read only. > > Without this patch, the related kernel code is meaningless, with > this patch, it can reflect the reality. > > Thanks, > Tiezhu Then you should at least test your code on Loongson-3A R1 two way machine. Huacai > > > > > Huacai > > > >> /* Set ELPA on LOONGSON3 pagegrain */ > >> mfc0 t0, CP0_PAGEGRAIN > >> or t0, (0x1 << 29) > >> @@ -54,10 +50,6 @@ > >> .macro smp_slave_setup > >> .set push > >> .set mips64 > >> - /* Set LPA on LOONGSON3 config3 */ > >> - mfc0 t0, CP0_CONFIG3 > >> - or t0, (0x1 << 7) > >> - mtc0 t0, CP0_CONFIG3 > >> /* Set ELPA on LOONGSON3 pagegrain */ > >> mfc0 t0, CP0_PAGEGRAIN > >> or t0, (0x1 << 29) > >> diff --git a/arch/mips/loongson64/numa.c b/arch/mips/loongson64/numa.c > >> index cf9459f..c7e3cced 100644 > >> --- a/arch/mips/loongson64/numa.c > >> +++ b/arch/mips/loongson64/numa.c > >> @@ -40,9 +40,6 @@ static void enable_lpa(void) > >> unsigned long value; > >> > >> value = __read_32bit_c0_register($16, 3); > >> - value |= 0x00000080; > >> - __write_32bit_c0_register($16, 3, value); > >> - value = __read_32bit_c0_register($16, 3); > >> pr_info("CP0_Config3: CP0 16.3 (0x%lx)\n", value); > >> > >> value = __read_32bit_c0_register($5, 1); > >> -- > >> 2.1.0 > >> >