Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1027333ybi; Fri, 14 Jun 2019 07:24:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqyYJut1RCcMDnG24YCPM2sq6SSHqVtkXgX04koyOelgLWQZv90/MvgzMxFQmPNlKLT268hU X-Received: by 2002:a63:dc09:: with SMTP id s9mr36697517pgg.425.1560522293874; Fri, 14 Jun 2019 07:24:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560522293; cv=none; d=google.com; s=arc-20160816; b=FyPj/5xRe7pAYR8Nkg3yVby9MxtPweaPMek6FiuVjz5S3Ln6lld3WjI9Ulbwx1BahX /LGj+Dg4E6zgNsD8JKARgPTiNL9tAdtgeVCwA5retjXMDNTvBhZ5sd0C24rF4NcUMChL k2p4uOcriTDWtWIa6pYVsJdPWDshL2VhCb/+leVIn5z3XRPShF3P1aj9VBYK3kjLTA46 Bi6TqMjVR0kKPzPU8YEJgLK37fGgeZU96m9QuYaq7cdFH1yCA1XHsdCn4jSmJlq55ZJB YBZexN9d7++eOxk3/AHV93ec8kqrZS80RdAL3nldWjCTlHUeAHo/JQsiCgIMKhFqSodg Icxg== 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=jD2viq5keIiw0kmsS2Q9EpB9HmFtAc8UXc6TfdfP2dc=; b=BTpxtEuqUclZtJ5BNm4qUDc6ZuVw1c1VMvMDCMx1oSZZQ2mdZqu3pwQadM6GNKAODv C/dMNFOGrcvsAlPsw3a8so/K8Dz8PAeqFUx03VIihpZZga0nrVJ6OD0+r0PPOTi6izFI ySU04CCQwKBzzBsOztvWVaSJkncSfX/gUb/HdvsVNUe5UbTrh+oKXzxVvZzB+yAxCX1m JSaRGauUhfzSC14RiVahaR8HwV+wRxq0z/yya8A5Piwws4n/JSnUNU2oO1x/HegWuiL7 8zJf1farq+9n33P7dbOenZvX+MepCDVIv7y9rlGPyLEsaM04hoZ8+kYhmzoreUttRref CKkA== 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 s197si2487192pfs.289.2019.06.14.07.24.37; Fri, 14 Jun 2019 07:24:53 -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 S1728428AbfFNOWl (ORCPT + 99 others); Fri, 14 Jun 2019 10:22:41 -0400 Received: from foss.arm.com ([217.140.110.172]:35154 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728300AbfFNOWk (ORCPT ); Fri, 14 Jun 2019 10:22:40 -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 0FA17344; Fri, 14 Jun 2019 07:22:40 -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 8BF923F246; Fri, 14 Jun 2019 07:22:38 -0700 (PDT) Date: Fri, 14 Jun 2019 15:22:31 +0100 From: Will Deacon To: Anisse Astier Cc: Dave Martin , Catalin Marinas , linux-arm-kernel@lists.infradead.org, Mark Rutland , Richard Henderson , Rich Felker , linux-kernel@vger.kernel.org, Kristina Martsenko , "Dmitry V . Levin" , Ricardo Salveti Subject: Re: [PATCH] arm64/sve: should not depend on Message-ID: <20190614142231.GA29231@fuggles.cambridge.arm.com> References: <20190613163801.21949-1-aastier@freebox.fr> <20190613171432.GA2790@e103592.cambridge.arm.com> <20190614112222.GA47082@anisse-station> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190614112222.GA47082@anisse-station> 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 Anisse, Dave, On Fri, Jun 14, 2019 at 01:22:22PM +0200, Anisse Astier wrote: > On Thu, Jun 13, 2019 at 06:14:44PM +0100, Dave Martin wrote: > > On Thu, Jun 13, 2019 at 06:38:01PM +0200, Anisse Astier wrote: > > > -#define SVE_PT_VL_INHERIT (PR_SVE_VL_INHERIT >> 16) > > > -#define SVE_PT_VL_ONEXEC (PR_SVE_SET_VL_ONEXEC >> 16) > > > +#define SVE_PT_VL_INHERIT (1 << 1) /* PR_SVE_VL_INHERIT */ > > > +#define SVE_PT_VL_ONEXEC (1 << 2) /* PR_SVE_SET_VL_ONEXEC */ > > > > Makes sense, but... > > > > Since sve_context.h was already introduced to solve a closely related > > problem, I wonder whether we can provide shadow definitions there, > > similarly to way the arm64/include/uapi/asm/ptrace.h definitions are > > derived. Although it's a slight abuse of that header, I think that > > would be my preferred approach. > > Yes I saw this, and I considered doing something similar. But, those > defines are in uapi/linux/prctl.h, which does not include any asm/*.h > header. This would have then required adding a full infrastructure for > asm/prctl.h (that could then include sve_context.h for example), which > does not exist yet, instead of copying these two values. x86 appears to have an asm/prctl.h implementation, but it's not included by anybody so I guess that doesn't really help us here. > Since this is part of the kernel-userspace ABI, I don't see this values > changing anytime soon, which is why I thought copying them shouldn't be > a big issue. Certainly not a big issue, just that the harder we make this to change the better. > A simple solution would be to to include sve_context.h or a third > header, maybe linux/prctl_arm64_sve.h (with only these two/five > defines), in linux/prctl.h, and reuse it in uapi/asm/ptrace.h; but this > would break the self-contained nature of linux/prctl.h. > > > > Otherwise, at least make the required relationship between ptrace.h and > > prctl.h constants a bit more obvious, say, > > > > #define SVE_PT_VL_INHERIT ((1 << 17) /* PR_SVE_SET_VL_INHERIT */ >> 16) > > This one is much simpler and closer to what I had in mind with this > patch. > > Will, what do you think of this second approach Dave proposed ? Duplication is grotty, but it does the job so I'm ok with it. I don't have any better ideas. Thanks, Will