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=-15.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,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 0D846C04FF3 for ; Mon, 24 May 2021 16:34:05 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CD30E613D8 for ; Mon, 24 May 2021 16:34:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CD30E613D8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=hisilicon.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:CC:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=nJNXsBqL8RWO9j88f03xee2/lLPznEeyGRHZxZK0DLw=; b=1Q64eZ20q+P469eibtPkHEcLDA bUHyka6LZjDvC0w8nGSxmlKcbylEdtogUWaZy9ML9DeeGU5Y5cFuRMovdJDKj7nSr8p2nlN2q26Ug g6Xaro4shf6z2cwkhmfjhcGRlnqtrzYf+Tb5rNovC+/GiTutwwXRwg3i2y73wAttZcONHxXHeFD5I FM71atMeWTu8L9Q9rY5L0W3yDuvHVV2Zr6kxAK+5q2Ep1K4jW+l3DRcIwHbso/ahz8G9o/1Sj9LOj Q8gJ1nn3wPKMHZbv4HbS1rhWIlOqVTPNh6xo9smwyGiF0gY/xhcsshB8mrxLp5k2nDjPBd/thp7VL Nfwk2/6g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1llDUq-0017Pk-Mo; Mon, 24 May 2021 16:32:05 +0000 Received: from szxga07-in.huawei.com ([45.249.212.35]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lkzRW-000dnc-PT for linux-arm-kernel@lists.infradead.org; Mon, 24 May 2021 01:31:45 +0000 Received: from dggems706-chm.china.huawei.com (unknown [172.30.72.60]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4FpKNn0jv2zBv96; Mon, 24 May 2021 09:28:41 +0800 (CST) Received: from dggpeml500023.china.huawei.com (7.185.36.114) by dggems706-chm.china.huawei.com (10.3.19.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 24 May 2021 09:31:25 +0800 Received: from [10.67.77.175] (10.67.77.175) by dggpeml500023.china.huawei.com (7.185.36.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 24 May 2021 09:31:24 +0800 Subject: Re: [PATCH 1/2] arm64: Change the cpuinfo_arm64 member type for some sysregs to u64 To: Catalin Marinas , CC: Will Deacon , Mark Rutland , "Suzuki K Poulose" References: <20210511182322.3830-1-catalin.marinas@arm.com> <20210511182322.3830-2-catalin.marinas@arm.com> From: Shaokun Zhang Message-ID: <99c5660c-fe45-144b-ce23-66ed644d10b3@hisilicon.com> Date: Mon, 24 May 2021 09:31:24 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210511182322.3830-2-catalin.marinas@arm.com> Content-Language: en-US X-Originating-IP: [10.67.77.175] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpeml500023.china.huawei.com (7.185.36.114) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210523_183143_220976_FABD2311 X-CRM114-Status: GOOD ( 23.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Catalin, On 2021/5/12 2:23, Catalin Marinas wrote: > The architecture has been updated and the CTR_EL0, CNTFRQ_EL1, s/CNTFRQ_EL1/CNTFRQ_EL0? > DCZID_EL0, MIDR_EL1, REVIDR_EL1 registers are all 64-bit, even if most > of them have a RES0 top 32-bit. > > Change their type to u64 in struct cpuinfo_arm64. > > Signed-off-by: Catalin Marinas > Cc: Will Deacon > Cc: Mark Rutland > Cc: Suzuki K Poulose > --- > > CTR_EL0 gained a new field with MTE in the top 32-bit, TminLine. I have > no idea what software is supposed to do with this field. I even have a > Jira ticket from 2019 asking for it to be removed. So I don't think we > should bother adding the mask/checks for it to the kernel. > > arch/arm64/include/asm/cpu.h | 10 +++++----- > arch/arm64/kernel/cpuinfo.c | 2 +- > 2 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/arch/arm64/include/asm/cpu.h b/arch/arm64/include/asm/cpu.h > index 7faae6ff3ab4..fe5a8499ddc2 100644 > --- a/arch/arm64/include/asm/cpu.h > +++ b/arch/arm64/include/asm/cpu.h > @@ -15,11 +15,11 @@ > struct cpuinfo_arm64 { > struct cpu cpu; > struct kobject kobj; > - u32 reg_ctr; > - u32 reg_cntfrq; > - u32 reg_dczid; > - u32 reg_midr; > - u32 reg_revidr; > + u64 reg_ctr; > + u64 reg_cntfrq; One more question: is it ok to change the function prototype to u64 also? For CNTFRQ_EL0, if the Arm ARM expand the clock to more than 4GHz and it will also work this change (arch_timer and watchdog shall change at the the same time). Thanks, Shaokun > + u64 reg_dczid; > + u64 reg_midr; > + u64 reg_revidr; > > u64 reg_id_aa64dfr0; > u64 reg_id_aa64dfr1; > diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c > index 77605aec25fe..4bea701117d4 100644 > --- a/arch/arm64/kernel/cpuinfo.c > +++ b/arch/arm64/kernel/cpuinfo.c > @@ -246,7 +246,7 @@ static struct kobj_type cpuregs_kobj_type = { > struct cpuinfo_arm64 *info = kobj_to_cpuinfo(kobj); \ > \ > if (info->reg_midr) \ > - return sprintf(buf, "0x%016x\n", info->reg_##_field); \ > + return sprintf(buf, "0x%016llx\n", info->reg_##_field); \ > else \ > return 0; \ > } \ > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel > . > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel