From patchwork Tue Sep 10 16:35:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 173540 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp6043374ilq; Tue, 10 Sep 2019 09:43:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqxOhzH2YD8AiaAdb84mfFwGtAzTCZ3QwXxFt6/78lMMDApPpZnQFmfBr9ImNHPj96sfQXF0 X-Received: by 2002:a37:85c7:: with SMTP id h190mr8946979qkd.233.1568133812462; Tue, 10 Sep 2019 09:43:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568133812; cv=none; d=google.com; s=arc-20160816; b=wiyqkvSjJ4FFle1x0I93gs44HK5QnvOY91dG5/cV5y8QQrEJzZuQEYWIGD/CaJyZ4q Uv4IcWX3opV6ZiuD/AO/l9OIGH995GDyWPn+NfQ6LWZBU22kAucRo9PEfdH+b3igVt4J UoRGNyJTASFkX0v9lXyznqqO6RUMTODHOhNc96AMv3r5WkO1NGTcSGd/yV0PzW4PlYdZ LrPJGzc3j4qJ3hS0mmU8mLFut8wthQlK0vIozl/KG/wtKzgOgRxR6qshDPaDN74YMR8W Feu8wO+G+z5pddR91k3/+c316mq93aT4aOc4XGhXhR8aIzyuTVFpPh4QgM1OA+o2EVQz oSZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from; bh=NFKImPmr08G8SsfslwDCiB7mSjMEwDNYejz9mjUnLgQ=; b=z05nAU5iKaP8qL2+RdkuMnHzUJIIhsCR9uDBJGadOKpcc9sHyVaMtX2MpZkgQF/iIk apE1PPzb3fIH7UqUhFlRFoGciFDK3BfzKwGi5vLmVRyjD/lf/zzYpqKg3IFvM9BSIsw7 zEALJB7ZRsauV3IzM22doe7iOD1a5SenjWToAP+Z6BITHJ9u/Zm+w9TMYt9mRVQzFjiw mRPUSf9R2kiBBLKklSDJJILHgQK2mowAWnWFL+9qIoeBr6DUgyvETyLutgZFPDCBerSs pbcyV/M545aMAADN9P110QYXipLZs8FfHGqSC5eG1jltiPFsJFNzVLhwupN3mN0ALaUY LEGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d24si13964068qtc.53.2019.09.10.09.43.31 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Sep 2019 09:43:32 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:43152 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7jEo-0003zZ-4B for patch@linaro.org; Tue, 10 Sep 2019 12:43:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53240) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7j7x-0004fa-Hq for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7j7w-00029X-Ce for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:25 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:48109) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7j7w-00028g-3y for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:24 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MEmMt-1hvvnu1rh5-00GJZm; Tue, 10 Sep 2019 18:36:09 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Tue, 10 Sep 2019 18:35:47 +0200 Message-Id: <20190910163600.19971-3-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190910163600.19971-1-laurent@vivier.eu> References: <20190910163600.19971-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:0KXaXHtt6r83pzwF5arVoOGeOG2MJZuwiWfdj6t9LUAuKaYJDOi KsXZfV/1poENgUcxzfe3k6IpKK2jX6ZTcTo3x5gQqnkKdQavG+p5K2aAK6Cxa5EOlnSgERM 5d+l3DtXNeSrmJXmG4RuGsIAyNvOnMobh78rYctUyOVT4JfUVw1dTLgCe7eqzPJKYVuXklH MMYLLmkRVcUX7J48+l7yA== X-UI-Out-Filterresults: notjunk:1; V03:K0:S01fj9U4d/k=:gRbZXPngHBiiycGGbUtTrB g1+PyRCWvXGj9g95EuHEM3B09b2N3CQK5qeNq/Xbp4PikkuzX3e3kaeUjqz7uozjTMK18D27O KCR6AKdzPiEfFF8Mj/jIabT/CAhNvgPgBv3fsAH6xCn9Ve5GXnzujem9UVx0dg62sCLhH+Cjj 4HxlKeR3Shii4y2E41tuw5sLOjqy3xEfJBGSU/sy9FoOerw87wPeQIWx9P3X+lMidNX3S9Q6Q PEbxme2e7v7XnAvbJ35e7mx4dE8XnZQ77PNeFMg8Php6ylHBbRA68KPrgaYb2kwJsip9q9FYZ rTdpxIxWaPFz02+tmu/d1ZNN7sfZoQFhw57dRQ5HCCv7iY3C/xYmpaFzI2vufEBjcrK9bb5vL AkuH9MXnboS0BtCU8zXO8xW0OyRqq7ByuvYLYhv7biR68XBbfOHrjmF7JXvYn2RsnW2ElF7uE t7Mf2b1097DdTfqtAdhe+3HKxzOdXmUwT1IS+J04cX3x2ZZIvdcF+x0n2PlE+965xVOtq36Yc 4CYExUP8PphzAbWl/uL2XvI+rIpqD7lhGV0yeNGZEGzEivSuI6MEJv8B4AwShgyR0rxrWP73E l5va/CQhQi+V8j4NXIljjqkXXe5zZcGcmVtANhBOTgTrJtrQuYWaC5FLgbgc8ID4xBu6EzXqI 3X6gV8g5ELSLx48K4f9IJNVruP3Y2UihlVLQlOon8US8AEW6fxcxqi0tlBtaivwk0U+/tr9fU 1gOMo45DrKFVk38nZpnG658xLXbjloGxaZM2C1BZla5PHE5hTbqF67ls7mKjboaJUnxfsyeoi o/nnITporo6yuO5CFPFsGNUQnV1IfgXNntx7DZRCAKxvk44+Fg= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.135 Subject: [Qemu-devel] [PULL 02/15] linux-user: Add AT_HWCAP2 for aarch64-linux-user X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov , Riku Voipio , Richard Henderson , Laurent Vivier , Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Add the HWCAP2_* bits from kernel version v5.3-rc3. Enable the bits corresponding to ARMv8.5-CondM and ARMv8.5-FRINT. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell Message-Id: <20190809171156.3476-1-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/elfload.c | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) -- 2.21.0 diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 3365e192eb3f..43c16a846d33 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -607,9 +607,23 @@ enum { ARM_HWCAP_A64_SB = 1 << 29, ARM_HWCAP_A64_PACA = 1 << 30, ARM_HWCAP_A64_PACG = 1UL << 31, + + ARM_HWCAP2_A64_DCPODP = 1 << 0, + ARM_HWCAP2_A64_SVE2 = 1 << 1, + ARM_HWCAP2_A64_SVEAES = 1 << 2, + ARM_HWCAP2_A64_SVEPMULL = 1 << 3, + ARM_HWCAP2_A64_SVEBITPERM = 1 << 4, + ARM_HWCAP2_A64_SVESHA3 = 1 << 5, + ARM_HWCAP2_A64_SVESM4 = 1 << 6, + ARM_HWCAP2_A64_FLAGM2 = 1 << 7, + ARM_HWCAP2_A64_FRINT = 1 << 8, }; -#define ELF_HWCAP get_elf_hwcap() +#define ELF_HWCAP get_elf_hwcap() +#define ELF_HWCAP2 get_elf_hwcap2() + +#define GET_FEATURE_ID(feat, hwcap) \ + do { if (cpu_isar_feature(feat, cpu)) { hwcaps |= hwcap; } } while (0) static uint32_t get_elf_hwcap(void) { @@ -621,8 +635,6 @@ static uint32_t get_elf_hwcap(void) hwcaps |= ARM_HWCAP_A64_CPUID; /* probe for the extra features */ -#define GET_FEATURE_ID(feat, hwcap) \ - do { if (cpu_isar_feature(feat, cpu)) { hwcaps |= hwcap; } } while (0) GET_FEATURE_ID(aa64_aes, ARM_HWCAP_A64_AES); GET_FEATURE_ID(aa64_pmull, ARM_HWCAP_A64_PMULL); @@ -645,11 +657,22 @@ static uint32_t get_elf_hwcap(void) GET_FEATURE_ID(aa64_sb, ARM_HWCAP_A64_SB); GET_FEATURE_ID(aa64_condm_4, ARM_HWCAP_A64_FLAGM); -#undef GET_FEATURE_ID + return hwcaps; +} + +static uint32_t get_elf_hwcap2(void) +{ + ARMCPU *cpu = ARM_CPU(thread_cpu); + uint32_t hwcaps = 0; + + GET_FEATURE_ID(aa64_condm_5, ARM_HWCAP2_A64_FLAGM2); + GET_FEATURE_ID(aa64_frint, ARM_HWCAP2_A64_FRINT); return hwcaps; } +#undef GET_FEATURE_ID + #endif /* not TARGET_AARCH64 */ #endif /* TARGET_ARM */