Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp230035imu; Tue, 27 Nov 2018 11:29:46 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wp9WaGqdPkB8aMtwAjB2YeCmfIBSKMIhUgkjw42Tm+o5DIiP2BaYTxAwDT5Y+hpkYQpuKh X-Received: by 2002:a17:902:c85:: with SMTP id 5-v6mr32275420plt.42.1543346986079; Tue, 27 Nov 2018 11:29:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543346986; cv=none; d=google.com; s=arc-20160816; b=LZVwTBKZWob83SgxovPEidy2/sl7KG5vyzm6UH6wpX+UthpHT0BkI9OV/+5AcomQty 9x5k5h0H95uVqwM8W2DZeu6ScWatYLZR0m/R3przsOptllfvC1NLoxzRq6ZRSj+whMN+ 6nbX+Rp4Gf93jwSeG/E8NAXR7JOaH5+gC9UWXb71qW3t4+rGtPheyMkXVBw808kuVaLW aW8hJJhKlmGZwbgW93MTuejezMWWIlV6+NuJmMLL/y8H5xLO7unL+g/dyjR2dX0edG3P gXbFdJluSJYAWahxy90FeZKbapkb9CrWvKgvlKiw4hndQbmOmTrtT8V/iqwPFHZ+NCaD 5yEg== 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=+1RzWawJ5BZ61B0RTspdAuDeap/V3DWLuKbWCMPolU0=; b=XTZ3fRvwrhn4u1pJoRw4rZPmZ8KXDnVQRyS9h1kfClqvy2pn1yd2SRX7iymS8QyOYZ LbOJyIU+koO20lVm57yeVyaKQZn83/RPS7j36slzHvlgWU+zUwRbmQNIq2VWrfnRR8om N5xLkdCuv23H0cGOP+lwP9dPi4RC7Ks8XhKzuqBNts/dW/oF7PDwBccAFxhBwh481aCi VS2aYbEyUMEgvPCIzsVmr/XtaqCFlwrFqrziJmHBuJWLTPE4R2gqJKSfLNkiQrHapgtS Mznl6/Dehk1IQq2Haq0oaDhFP+nvPY5c5V2EEEa8kGv1+JNPs7CJxAChuf29OUzJC80g FNrA== 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 gn22si4609283plb.19.2018.11.27.11.29.30; Tue, 27 Nov 2018 11:29:46 -0800 (PST) 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 S1732079AbeK1FUb (ORCPT + 99 others); Wed, 28 Nov 2018 00:20:31 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:44998 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727835AbeK1FUa (ORCPT ); Wed, 28 Nov 2018 00:20:30 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F176E2379; Tue, 27 Nov 2018 10:21:45 -0800 (PST) Received: from edgewater-inn.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id C072B3F575; Tue, 27 Nov 2018 10:21:45 -0800 (PST) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id 981131AE0A0D; Tue, 27 Nov 2018 18:22:03 +0000 (GMT) Date: Tue, 27 Nov 2018 18:22:03 +0000 From: Will Deacon To: Ard Biesheuvel Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, ast@fb.com, daniel@iogearbox.net Subject: Re: [PATCH] arm64/bpf: use movn/movk/movk sequence to generate kernel addresses Message-ID: <20181127182203.GA19721@arm.com> References: <20181123172902.21480-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181123172902.21480-1-ard.biesheuvel@linaro.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ard, On Fri, Nov 23, 2018 at 06:29:02PM +0100, Ard Biesheuvel wrote: > On arm64, all executable code is guaranteed to reside in the vmalloc > space (or the module space), and so jump targets will only use 48 > bits at most, and the remaining bits are guaranteed to be 0x1. > > This means we can generate an immediate jump address using a sequence > of one MOVN (move wide negated) and two MOVK instructions, where the > first one sets the lower 16 bits but also sets all top bits to 0x1. > > Signed-off-by: Ard Biesheuvel > --- Acked-by: Will Deacon Denial, Alexei, shall I take this via arm64, or would you rather take it via davem? Cheers, Will