Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1008314pxb; Tue, 3 Nov 2020 19:53:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJwkMw04RY3bHN4sCLG39NP02UXZuJtELbdv63I3x4Rkmje6idafTYGLjNeORFDnca6yqJTn X-Received: by 2002:a17:906:3fc5:: with SMTP id k5mr23672104ejj.158.1604462000134; Tue, 03 Nov 2020 19:53:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604462000; cv=none; d=google.com; s=arc-20160816; b=T9PV5K6cM62bN5iaURJD2gbmBvnlXREFjj0GaotgPusQrdRWy3MNFLaPYZgR7Mt7CX NDMgKMtk0NTYE7plVzvlVxZl4EnZWXWZXNkGSB4Ry70Jq8EC6qGgeKPa8Sqs7W268lSO epn9P1Mv95Koh0QMp4Nz0N4YSSY8fjgp2N+W+lx+mEHG9nO3KSmKLyzQRUzm3mJKvVQ+ +zQS05Siu93kEjrIi81hft3dYKx2hFvRfQWt+c9SzsgOdihKr1FGMyAY2uEqQq/nYx37 PlLXUfoQz3imeEhtDoPPI0Cyab9VZWn2K8zZg/XgyloZ8xs9mzf2XAmIM6MqXWr2DWC9 sS9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=4o+Yo/nUROS9FU4rKiUe2mItIDwsRVFsTKQ74JDTpuY=; b=HpQx1fg34/Qyut5Qq4Ofpm3W3cVv5Rp0IrC1k72c2rBARuqIO2bECZZhwUc5wpEU7L l18q/i6Ii1P0uEgxA9VdL8nLqAufVUSOfCWuxXVg0ye1FWd7scW1FXOBpNAhYUnXmkwL ZQuYYnUx7u9yNhy4LHQ+UzLdS/lilZeLQMYTNCzE+6WxMrVaY3BkrKeyHXr10if/p5eM oRGOL5tSDNQ0hWOr+8lmG6fh02c5UbTFHXLQxg8JKuBLUIWsmABHLCZO99GJmjQXTNh5 dz3bWbd0Fzcnns646U8HkFtI1l/3GzQNOwEfiGv4Il+iED74ehfI1Po28WhzHzw2SPNl gjMQ== 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 d2si698658ejm.502.2020.11.03.19.52.56; Tue, 03 Nov 2020 19:53:20 -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 S1728420AbgKDDvB (ORCPT + 99 others); Tue, 3 Nov 2020 22:51:01 -0500 Received: from mail.loongson.cn ([114.242.206.163]:40318 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726008AbgKDDvB (ORCPT ); Tue, 3 Nov 2020 22:51:01 -0500 Received: from [10.130.0.80] (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9AxmtEdJaJfkGIFAA--.15514S3; Wed, 04 Nov 2020 11:50:54 +0800 (CST) Subject: Re: [PATCH v3 1/6] MIPS: Loongson64: Do not write the read only field LPA of CP0_CONFIG3 To: Huacai Chen References: <1604387525-23400-1-git-send-email-yangtiezhu@loongson.cn> <1604387525-23400-2-git-send-email-yangtiezhu@loongson.cn> Cc: Thomas Bogendoerfer , Jiaxun Yang , "open list:MIPS" , LKML , Xuefeng Li From: Tiezhu Yang Message-ID: Date: Wed, 4 Nov 2020 11:50:53 +0800 User-Agent: Mozilla/5.0 (X11; Linux mips64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-CM-TRANSID: AQAAf9AxmtEdJaJfkGIFAA--.15514S3 X-Coremail-Antispam: 1UD129KBjvJXoWxWrW3Cry7Wr13ArWkCw4UArb_yoW5Jw1fpa n5Aa1kGF4UXr1UuFnYy34DWrWrJ39xtrW2kanFqr95X3s3K3sFgr1fJ3W8JFyrZry8Ka10 qFyF9rWjvanrC3JanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUvl14x267AKxVW8JVW5JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26r4j6ryUM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4j 6F4UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Cr 1j6rxdM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj 6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr 0_Gr1lF7xvr2IY64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7Mxk0xIA0c2IEe2xFo4CE bIxvr21lc2xSY4AK67AK6r48MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r 4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF 67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2I x0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw20EY4v20xvaj40_WFyUJVCq3wCI42IY 6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r1j6r4UYxBIdaVFxhVjvj DU0xZFpf9x0JU-miiUUUUU= X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > 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 >>