Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2736152ybi; Mon, 17 Jun 2019 09:46:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxCS68rSkHpKx9cHyVt7khk66+jGiCk2KSGjG3srIOUoX6BJFVOgFhJjcuIcI1nNBzKx4j+ X-Received: by 2002:a63:2b92:: with SMTP id r140mr50534533pgr.363.1560790003797; Mon, 17 Jun 2019 09:46:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560790003; cv=none; d=google.com; s=arc-20160816; b=yGWFVlmedaqmM3D0tHFYIdRA4vEq1jrDwYUeBFVj6yY1T81kBW60yPHo7X+lJz82v+ 0ThmyBAZhs2A95lH7wqR53y+K8V7Sbrn6ZucwmsSNl8/HwUX9INeMEmRpPAYxaWg2WMM zLnzYPn7/pMMORs8s6OoqaHC0YamnQt6KGKVKppnrBEu8sXMqMFPn60ZQGO8eDWoAjSg s5LaGbKoTcWJm68b8RnvKqz/pCSAGymQ6QDJgjuoUfOR6KI7KCX5bfBDf2EwTCQgV+74 Ob7/eEiv8SHpzPG8kGSAtbXA+hGBAkwQxktpY6K8H295JLigF0SftJGOI1gIJNIXL2D9 KxZg== 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=Qxgzy3sslDsEELMDnP8bLwXUkmBEKhaZNA5QJ0F2tik=; b=vIDNgVPydvaMth5PzLjTKC7GIrzNLh77qUeQWCbkgX0Z4H8Wpv+cVIdTcMDSbn9J3+ f8QIXRNxUtIpmdTWjJp+p2rgcTVsuEotge4x9SVEKJJ4rN1Pyold50s+nzFBN5tXY9Hi DCCTPKsXz3rFe5M4LjgNn5VTjODwpVDy56GQSJjzEsmOg8Y39SVRFXq9npLPeMoHe4Ee zlDkph09uaoXAfO1ZnFAqK/UGhgLwxDMszGf/PT8Tds1PX8VgWFkAjFUqWlLaxCphfAH C8IueimVrBHEnujcWnv5nQmJYbQEV38AhDPabpbwMRaKl36mu9liSPSHj+cbWbIVq4ub ZMww== 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 m7si11832060pgj.15.2019.06.17.09.46.28; Mon, 17 Jun 2019 09:46:43 -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 S1726974AbfFQQp5 (ORCPT + 99 others); Mon, 17 Jun 2019 12:45:57 -0400 Received: from foss.arm.com ([217.140.110.172]:56204 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725995AbfFQQp5 (ORCPT ); Mon, 17 Jun 2019 12:45:57 -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 D108028; Mon, 17 Jun 2019 09:45: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 2A1343F718; Mon, 17 Jun 2019 09:45:55 -0700 (PDT) Date: Mon, 17 Jun 2019 17:45:53 +0100 From: Will Deacon To: Ard Biesheuvel Cc: Arnd Bergmann , Catalin Marinas , Dave Martin , Alex =?iso-8859-1?Q?Benn=E9e?= , Peter Maydell , Alan Hayward , Julien Grall , Marc Zyngier , Mark Rutland , Andrew Murray , Linux ARM , Linux Kernel Mailing List Subject: Re: [PATCH] arm64/sve: fix genksyms generation Message-ID: <20190617164553.GI30800@fuggles.cambridge.arm.com> References: <20190617104237.2082388-1-arnd@arndb.de> <20190617112652.GB30800@fuggles.cambridge.arm.com> <20190617161330.GD30800@fuggles.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 On Mon, Jun 17, 2019 at 06:32:16PM +0200, Ard Biesheuvel wrote: > On Mon, 17 Jun 2019 at 18:13, Will Deacon wrote: > > On Mon, Jun 17, 2019 at 02:21:46PM +0200, Arnd Bergmann wrote: > > > On Mon, Jun 17, 2019 at 1:26 PM Will Deacon wrote: > > > > On Mon, Jun 17, 2019 at 12:42:11PM +0200, Arnd Bergmann wrote: > > > > > 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. > > > > Ok, but the patch that appears to cause this problem doesn't change the > > type of anything we're exporting. The symbol in your log is > > "kernel_neon_begin" which is: > > > > void kernel_neon_begin(void); > > > > so I'm still fairly confused about the problem. In fact, even if I create > > a silly: > > > > void will_kernel_neon_begin(__uint128_t); > > > > function, then somehow I see it being processed: > > > > __crc_will_kernel_neon_begin = 0x5401d250; > > > > Is there some way that your passing '-w' to genksyms? > > > > The problem is not about the types we're *exporting*. Genksyms just > gives up halfway through the file, as soon as it encounters something > it doesn't like, and any symbol that hasn't been encountered yet at > that point will not have a crc generated for it. Hmm, but it appears to be either working or failing silently for me, which doesn't match what Arnd is seeing. I'd prefer to fix genksyms but I'm not happy touching it if I can't show it's broken to begin with. If I pass '-w' I see it barfing on all sorts of random stuff, for example the static_assert in include/linux/fs.h: static_assert(offsetof(struct filename, iname) % sizeof(long) == 0); Will