Received: by 10.223.164.221 with SMTP id h29csp1333314wrb; Wed, 1 Nov 2017 14:36:01 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QDN7mZcrP3AjmsdjRK9PKqZVq44DJoxFz94bIKSJnYL/C9HpF451d+t5jgmRzJWGBgPiQZ X-Received: by 10.84.240.196 with SMTP id l4mr917886plt.149.1509572161447; Wed, 01 Nov 2017 14:36:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509572161; cv=none; d=google.com; s=arc-20160816; b=R2HJEf8muxT7KjRNDKbqirsCICGMGKXG+TeEYmGK25LxCEne/qs9woZYhi2naUyd5X E7xw8oAJijW2qsdPVP9CL24vwfynua1Spj7AoCeV3ANlOO5v9OKLhE+ZbHZWU0O3D8jB qnYqy1nil+YTdMdnUtEOY7WlzxV0NvmCLFOrSqMvShIB1svxQ4XvdDXjnP0TL9WqmyZH NEcyKUt4r1HAqRV8X40CVfzF/M2EsnoyWPOxbhx1vlseWAOdYCPTQwIzIVIvZuougyYb cGrGzkksYg5GjMYgaa72UTJW9KUiZQ88RUt8f6F2RTAIjHcPV7bh9RHv6YnibyXozRS2 Ma3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=Y17pq3NUdJkQlktxrfZWhHv5PXChG3swzZPVNqniMJA=; b=nAU+JFHe6B+DuVlBfiAPIrrahyLB+2tJsKsoK6YcVavtmuQKbI1kRGURP4ooYkrUJH lAlu35eRMqeQR2EhhWY3lM0aeZqg6LG+viuNwv8sulYGppAfQ4CqIFTRWqPqXirTBg0X Q7fz2PW0TIr4MMd3BvRQO9bk6zur39/lKK57vSAKG/6rGFHB67YhtXYDi1zViQlQZaDn YQh92vuKNAEA8QekKljuv2BJN49mN8zdF3Z2I7eIDzAomjgrRayl/omnc6jafJ9UC5sw ks9okOIuI61F0bLKKosr17iEdPxASpprRQ5Fr4a82yKRRN51dKIQmlHNgEh5iVmwhRCz e8rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=vxV+oZ5t; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q4si546366plr.645.2017.11.01.14.35.48; Wed, 01 Nov 2017 14:36:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=vxV+oZ5t; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934577AbdKAVej (ORCPT + 99 others); Wed, 1 Nov 2017 17:34:39 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:54244 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933377AbdKAVeh (ORCPT ); Wed, 1 Nov 2017 17:34:37 -0400 Received: by mail-pg0-f66.google.com with SMTP id s2so3190577pge.10 for ; Wed, 01 Nov 2017 14:34:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Y17pq3NUdJkQlktxrfZWhHv5PXChG3swzZPVNqniMJA=; b=vxV+oZ5tY5P/TG+eJSnd4wUge4TCxSg8UgDHH135UIuKTKTS5WI4leq6oFj4gxJ9+9 Jib1c1PQv5qgGmR61qJXBWisGBoKZsNztBwVUHWi6pmAuzZfoINWzRsVmMRo/BppbQvA aIx0OEsqRVV9pbUhYWt/3UXxEgAHo3D7igstFZ+S3Z1ouQurGRz53JRK8xzXuJjDipTG 4lNowGiMeaU78J4RlUYhi33I1eXkN2R0oXBCdlzqMmvL2nq7YHQHBDvww96/nxICckxC ezGJlXImLgsTkkXCLyYd0/awWRxdIxO2fQA65ledW16nQIsTQUT3/+AFF34xv0le6+X/ DcZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Y17pq3NUdJkQlktxrfZWhHv5PXChG3swzZPVNqniMJA=; b=ftl0I5EH8dQj/qObEE7LgbUOxquLIMzjq/D2nvSoFhb4Pj/nc4qiyc3LoVS9Z1GyzD A2v8RzBq+rGBbxohcndkrcdc2vYSnlQ0eVmSIMHrvDsjgCyAUpIFRmfeFm8fRoXZ+MOl Cz2/H1TedL+nizDKR5GlofWFVgEgGrt4mrAGrc2OrK4O3nlV30Sz4FJqrxxkkcc4CJVC B4lny3JNeLw10ZiVQ++K8VvfFU4au2O1BvKd3SVGlqMdw3wnWnPjQ0TMGYIjrDmBcZZZ u7Gk0t+lFFbxSfeTTIek/UzJg1EeXfLIjVRGJgVWVMlk73B9dDR3p2151pIFwJFLO7wW wyCg== X-Gm-Message-State: AMCzsaVqrtQWXRnp0ytTz23am90U07X1eFM7O9/mNGsewEMgObXofGMu h6QOgrad+k7gA4opPwknS8h9DZFl4Tw= X-Received: by 10.98.75.71 with SMTP id y68mr1268040pfa.45.1509572076931; Wed, 01 Nov 2017 14:34:36 -0700 (PDT) Received: from hackmann.mtv.corp.google.com ([172.22.122.89]) by smtp.gmail.com with ESMTPSA id d190sm2392422pgc.53.2017.11.01.14.34.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Nov 2017 14:34:36 -0700 (PDT) From: Greg Hackmann To: Shuah Khan Cc: Steve Muckle , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Hackmann Subject: [PATCH v2] selftests: vdso_test: support ARM64 targets Date: Wed, 1 Nov 2017 14:34:26 -0700 Message-Id: <20171101213426.58992-1-ghackmann@google.com> X-Mailer: git-send-email 2.15.0.403.gc27cc4dac6-goog Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ARM64's vDSO exports its gettimeofday() implementation with a different name (__kernel_gettimeofday) and version (LINUX_2.6.39) from other architectures. Add a corresponding special-case to vdso_test. Signed-off-by: Greg Hackmann --- Changes since v1: * Moved definitions outside main() * Added a comment explaining the special case tools/testing/selftests/vDSO/vdso_test.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/vDSO/vdso_test.c b/tools/testing/selftests/vDSO/vdso_test.c index 8daeb7d7032c..2df26bd0099c 100644 --- a/tools/testing/selftests/vDSO/vdso_test.c +++ b/tools/testing/selftests/vDSO/vdso_test.c @@ -19,6 +19,19 @@ extern void *vdso_sym(const char *version, const char *name); extern void vdso_init_from_sysinfo_ehdr(uintptr_t base); extern void vdso_init_from_auxv(void *auxv); +/* + * ARM64's vDSO exports its gettimeofday() implementation with a different + * name and version from other architectures, so we need to handle it as + * a special case. + */ +#if defined(__aarch64__) +const char *version = "LINUX_2.6.39"; +const char *name = "__kernel_gettimeofday"; +#else +const char *version = "LINUX_2.6"; +const char *name = "__vdso_gettimeofday"; +#endif + int main(int argc, char **argv) { unsigned long sysinfo_ehdr = getauxval(AT_SYSINFO_EHDR); @@ -31,10 +44,10 @@ int main(int argc, char **argv) /* Find gettimeofday. */ typedef long (*gtod_t)(struct timeval *tv, struct timezone *tz); - gtod_t gtod = (gtod_t)vdso_sym("LINUX_2.6", "__vdso_gettimeofday"); + gtod_t gtod = (gtod_t)vdso_sym(version, name); if (!gtod) { - printf("Could not find __vdso_gettimeofday\n"); + printf("Could not find %s\n", name); return 1; } @@ -45,7 +58,7 @@ int main(int argc, char **argv) printf("The time is %lld.%06lld\n", (long long)tv.tv_sec, (long long)tv.tv_usec); } else { - printf("__vdso_gettimeofday failed\n"); + printf("%s failed\n", name); } return 0; -- 2.15.0.403.gc27cc4dac6-goog From 1582945791532371640@xxx Thu Nov 02 09:25:45 +0000 2017 X-GM-THRID: 1581783668324410479 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread