From patchwork Mon Oct 14 03:44:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xuelei Zhang X-Patchwork-Id: 34932 Received: (qmail 55271 invoked by alias); 14 Oct 2019 03:44:24 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 55263 invoked by uid 89); 14 Oct 2019 03:44:24 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-13.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.1 spammy=H*r:sk:libc-al, huawei, Huawei X-HELO: huawei.com From: Xuelei Zhang To: Subject: [PATCH 1/2] aarch64: Add Huawei Kunpeng to tunable cpu list Date: Mon, 14 Oct 2019 11:44:10 +0800 Message-ID: <20191014034410.10276-1-zhangxuelei4@huawei.com> MIME-Version: 1.0 Kunpeng processer is a 64-bit Arm-compatible CPU released by Huawei, and we have already signed a copyright assignement with the FSF. This patch adds its to cpu list, and related macro for IFUNC. * manual/tunables.texi (Tunable glibc.cpu.name): Add Kunpeng. * sysdeps/unix/sysv/linux/aarch64/cpu-features.c (cpu_list): Add kunpeng. * sysdeps/unix/sysv/linux/aarch64/cpu-features.h (IS_KUNPENG): New macro. --- manual/tunables.texi | 2 +- sysdeps/unix/sysv/linux/aarch64/cpu-features.c | 1 + sysdeps/unix/sysv/linux/aarch64/cpu-features.h | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/manual/tunables.texi b/manual/tunables.texi index 1687f9c939..ec18b10834 100644 --- a/manual/tunables.texi +++ b/manual/tunables.texi @@ -372,7 +372,7 @@ This tunable is specific to powerpc, powerpc64 and powerpc64le. The @code{glibc.cpu.name=xxx} tunable allows the user to tell @theglibc{} to assume that the CPU is @code{xxx} where xxx may have one of these values: @code{generic}, @code{falkor}, @code{thunderxt88}, @code{thunderx2t99}, -@code{thunderx2t99p1}, @code{ares}, @code{emag}. +@code{thunderx2t99p1}, @code{ares}, @code{emag}, @code{kunpeng}. This tunable is specific to aarch64. @end deftp diff --git a/sysdeps/unix/sysv/linux/aarch64/cpu-features.c b/sysdeps/unix/sysv/linux/aarch64/cpu-features.c index 4fc241a6e5..d0e50d0898 100644 --- a/sysdeps/unix/sysv/linux/aarch64/cpu-features.c +++ b/sysdeps/unix/sysv/linux/aarch64/cpu-features.c @@ -38,6 +38,7 @@ static struct cpu_list cpu_list[] = { {"phecda", 0x680F0000}, {"ares", 0x411FD0C0}, {"emag", 0x503F0001}, + {"kunpeng", 0x481FD010}, {"generic", 0x0} }; diff --git a/sysdeps/unix/sysv/linux/aarch64/cpu-features.h b/sysdeps/unix/sysv/linux/aarch64/cpu-features.h index 0fa57dc66f..87c4995627 100644 --- a/sysdeps/unix/sysv/linux/aarch64/cpu-features.h +++ b/sysdeps/unix/sysv/linux/aarch64/cpu-features.h @@ -57,6 +57,9 @@ #define IS_EMAG(midr) (MIDR_IMPLEMENTOR(midr) == 'P' \ && MIDR_PARTNUM(midr) == 0x000) +#define IS_KUNPENG(midr) (MIDR_IMPLEMENTOR(midr) == 'H' \ + && MIDR_PARTNUM(midr) == 0xd01) + struct cpu_features { uint64_t midr_el1;