Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2410900ybi; Mon, 17 Jun 2019 04:27:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqydGs6TGjAfF8NimIgeGXf/ooiFoEbof39+3f/SXfpAggGmPpBDx6/oImWI2vklTQT1MErj X-Received: by 2002:a17:90a:8985:: with SMTP id v5mr25227806pjn.136.1560770857042; Mon, 17 Jun 2019 04:27:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560770857; cv=none; d=google.com; s=arc-20160816; b=CXZ0FAjapzL3WVbybbxuGSz1iqFl4IAA1LRZSk3sr4AKxT0XHIThkezw1TeP0NM1P8 3wEvMtTx9/fm/zT1zDdPcpaBBDQMxNGPsCg7mR2C1A9JNrXiGUTwEMuvCykZUAtQ+xIF AhqM2XEh3PVX2CcCSmGEb359pZ5YwZVVyBnb1jCaFapYqzzbhl/9ujH7LjuKzILj/3JY NQtJD57QorXVhBVE+0OnD7VJMKTkUWux1VEkzcKSENG8boXsJ98wBHn13jQ3sOWqkhaA 4HCxBfmhCGpg8svyztQOFmmbIvkYbYARyFVEykUNmgdqwJ+dJA8E0Q8Boel8ZIhwb4YA 5jjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=wR4rqi4F8geq5nbBDIbeMAKiFRxR/H6iG/jxl9Gfzgk=; b=SOvpfyd9xl95fiYPZ3cBujweFSi+7yajx2HjY8MRjoasyMsBRYTFmCpxjIPsTRWZ/j wo6A6x/kXC+jRRz1o4y2npGkuMNqo0YT66R1P4SH+BfTnCVLGyar8/XxDze8alzuDAa7 5LSdSf7BGm34MvkzDU3wMG0Jft+HCzXGSEJZRyxKQhrpJBaLds4xKdzrzOwRCyDqbdGn j28RqiB+WsX65YrMXOO069JbROz7pD5o/VimL75wlhWyDJQ3X2bSjobKcFR/C1eWrBLv P/JAfTmiLw230pR/4QsOK5aUI5uYo7Kpl22gwmj+HKBJjO7GpvKS7tbSqsJOkOOulogL VE4A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t17si7684707pjw.99.2019.06.17.04.27.20; Mon, 17 Jun 2019 04:27:37 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728045AbfFQL05 (ORCPT + 99 others); Mon, 17 Jun 2019 07:26:57 -0400 Received: from foss.arm.com ([217.140.110.172]:46146 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727688AbfFQL04 (ORCPT ); Mon, 17 Jun 2019 07:26:56 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 86272344; Mon, 17 Jun 2019 04:26:56 -0700 (PDT) Received: from fuggles.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2CE733F246; Mon, 17 Jun 2019 04:28:40 -0700 (PDT) Date: Mon, 17 Jun 2019 12:26:52 +0100 From: Will Deacon To: Arnd Bergmann Cc: Catalin Marinas , Dave Martin , Ard Biesheuvel , Alex =?iso-8859-1?Q?Benn=E9e?= , Peter Maydell , Alan Hayward , Julien Grall , Marc Zyngier , Mark Rutland , Andrew Murray , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64/sve: fix genksyms generation Message-ID: <20190617112652.GB30800@fuggles.cambridge.arm.com> References: <20190617104237.2082388-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190617104237.2082388-1-arnd@arndb.de> User-Agent: Mutt/1.11.1+86 (6f28e57d73f2) () Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnd, On Mon, Jun 17, 2019 at 12:42:11PM +0200, Arnd Bergmann wrote: > genksyms does not understand __uint128_t, so we get a build failure > in the fpsimd module when it cannot export a symbol right: The fpsimd code is builtin, so which module is actually failing? My allmodconfig build succeeds, so I must be missing something. > WARNING: EXPORT symbol "kernel_neon_begin" [vmlinux] version generation failed, symbol will not be versioned. > /home/arnd/cross/x86_64/gcc-8.1.0-nolibc/aarch64-linux/bin/aarch64-linux-ld: arch/arm64/kernel/fpsimd.o: relocation R_AARCH64_ABS32 against `__crc_kernel_neon_begin' can not be used when making a shared object > arch/arm64/kernel/fpsimd.o:(.data+0x0): dangerous relocation: unsupported relocation > arch/arm64/kernel/fpsimd.o:(".discard.addressable"+0x0): dangerous relocation: unsupported relocation > arch/arm64/kernel/fpsimd.o:(".discard.addressable"+0x8): dangerous relocation: unsupported relocation > > We could teach genksyms about the type, but it's easier to just > work around it by defining that type locally in a way that genksyms > understands. > > Fixes: 41040cf7c5f0 ("arm64/sve: Fix missing SVE/FPSIMD endianness conversions") I can't see which part of that patch causes the problem, so I'm a bit wary of the fix. We've been using __uint128_t for a while now, and I see there's one in the x86 kvm code as well, so it would be nice to understand what's happening here so that we can avoid running into it in future as well. > Signed-off-by: Arnd Bergmann > --- > arch/arm64/kernel/fpsimd.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c > index 07f238ef47ae..2aba07cccf50 100644 > --- a/arch/arm64/kernel/fpsimd.c > +++ b/arch/arm64/kernel/fpsimd.c > @@ -400,6 +400,9 @@ static int __init sve_sysctl_init(void) { return 0; } > #define ZREG(sve_state, vq, n) ((char *)(sve_state) + \ > (SVE_SIG_ZREG_OFFSET(vq, n) - SVE_SIG_REGS_OFFSET)) > > +#ifdef __GENKSYMS__ > +typedef __u64 __uint128_t[2]; > +#endif I suspect I need to figure out what genksyms is doing, but I'm nervous about exposing this as an array type without understanding whether or not that has consequences for its operation. Will