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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 68B70C31E57 for ; Mon, 17 Jun 2019 12:22:17 +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 3BFC420657 for ; Mon, 17 Jun 2019 12:22:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="PW8UzsbL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3BFC420657 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arndb.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-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.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=25DX9sb7AtHBqvW4pghBEPSORITKtYpsorYScPdGWqQ=; b=PW8UzsbLu3PM9J oSnuEn82esHvpw+E6uvmN/0KokQvXfb78S/veQv5BXYnPDUXYcolx6/hhud9SbkHAMtsh7ny8rs3l RWpjRxErZYRcLFS+ukDcAFJdGLv2WHx0wTzclBpG9rX0ugZCGCUx3UN3VRr0wVzqV8XnnYa6kpB65 cQ9XpXMCOMGxvyd8gyrJzeH2ZYIvc32tP8RbBNQ+9JZmBuFV8Twi6XJlHMNMPtzcb7vnNPr9VKmeW a9PoW15OW71PJdVgVpnu9tR+r0PA/C0Y9IQKaYQRBfvtFPKKxNPeaA4OTO3RCHWwG0Xnrqbmbz2cr ZQMru49aVnI02v7jMsYg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hcqeG-0004xq-MX; Mon, 17 Jun 2019 12:22:08 +0000 Received: from mail-qt1-f196.google.com ([209.85.160.196]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hcqeC-0004x9-Uk for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2019 12:22:06 +0000 Received: by mail-qt1-f196.google.com with SMTP id d23so10402560qto.2 for ; Mon, 17 Jun 2019 05:22:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=J1D0wRVIBxkLJPdsyEaqbWMW7xmtTDyWae7i+70qMQs=; b=AV2zFpvOw4Wcdl4s5yX1ZFqs4Whv+aCUIP+eynx8Kjr9DFdXGeDWWP+2rL0Qe5RprM /QB3mbI8kUuzzM7xVO68XZBJpTATNj+5x5lMyG99ZdjoCnx7vpt6PTAM0ZfSqY2wXYXA rdH2cR4BDh08FSPmc/DJSbvzNQFSUgCWveAM7TeBjLkmThYrX/2zhM4/swWvNsc4yZcf vOFA33EQggEC1IeSv40kTB5IWzkJjIfHERGnoz9UnB6KRhIP1uEQDwMQi+aistk/eWKS wiAVNtxdx+R0NJ+XMd1/UUhKGnxHdqLGW1eAdrVVqYGFJgpgoVhwN8mGp3Gr0e35n3pT ZB/Q== X-Gm-Message-State: APjAAAUNgaL5wbR3ys1QKjitLA9vF/2jTliX6xrN6uTgOLCnOgHMo/t1 R6Il8sEueKBkK/ntabKqiDceDjXImznrt7agaLx20stJ0uM= X-Google-Smtp-Source: APXvYqzBS9/f+FzXIzoMEx/rQKNZckt6bdT2jsoQ/5V9Nb2UOXwEEV6V5B/6sbBr2C25lfeCYsPalMWFzJMpk3UwffM= X-Received: by 2002:a0c:b758:: with SMTP id q24mr21150036qve.45.1560774123691; Mon, 17 Jun 2019 05:22:03 -0700 (PDT) MIME-Version: 1.0 References: <20190617104237.2082388-1-arnd@arndb.de> <20190617112652.GB30800@fuggles.cambridge.arm.com> In-Reply-To: <20190617112652.GB30800@fuggles.cambridge.arm.com> From: Arnd Bergmann Date: Mon, 17 Jun 2019 14:21:46 +0200 Message-ID: Subject: Re: [PATCH] arm64/sve: fix genksyms generation To: Will Deacon X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190617_052204_989619_A4AE39C1 X-CRM114-Status: GOOD ( 28.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Peter Maydell , Ard Biesheuvel , Marc Zyngier , Catalin Marinas , Linux Kernel Mailing List , Julien Grall , Alan Hayward , Andrew Murray , =?UTF-8?B?QWxleCBCZW5uw6ll?= , Dave Martin , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jun 17, 2019 at 1:26 PM Will Deacon wrote: > > 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. It happened for me on randconfig builds, you can find one such configuration at https://pastebin.com/cU8iQ4ta now. I was building this with clang rather than gcc, which may affect the issue, but I assumed not. > > 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. The problem is only in files that export a symbol. This is also the case in arch/x86/kernel/kvm.c, but it may be lucky because the type only appears /after/ the last export in that file. > > 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. The entire point is genksyms is to ensure that types of exported symbols are compatible. To do this, it has a limited parser for C source code that understands the basic types (char, int, long, _Bool, etc) and how to aggregate them into structs and function arguments. This process has always been fragile, and it clearly breaks when it fails to understand a particular type. Arnd _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel