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=-2.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, USER_AGENT_MUTT autolearn=ham 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 70B95C43381 for ; Tue, 19 Feb 2019 13:01:55 +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 3766720823 for ; Tue, 19 Feb 2019 13:01:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="aHk1Ax1A" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3766720823 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com 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:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Pl2PosI7chDx6lTfdiCdAbxyj9ifWvZVGc1ix/5F08M=; b=aHk1Ax1AVo0qX1 ji+f1bN+YP7dlB7uf+yhYvl2E0RZYLU29iEa1H41o6VTeWnxqWA+LEo3/MTBuAAYoorP2HNJDWnjM Ww1NENC+8tVoUdtTQOKJyF6fX726NX695UmIsHzcHT4kZ0EUkQ2xIRq47SZ3GZ828AMAZ2IeOXrYY k3AuALYtrEVX+3OVoFc+SYt+zwkqy3bO4hHBxecp+LxfY5tpTXFeBPcy2RKjPGa3u2o82KZjrqIbh 67gP56keonxwdqGjOEqMIKMjOMVdTU9WAHH5ax4/0ZrYgCZxpmrm1oNZIPRfPBhRupY99ichHItX3 NX88MVB2dbVfqDOow1QA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gw51v-0004O4-EU; Tue, 19 Feb 2019 13:01:47 +0000 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gw51r-0004NX-6N for linux-arm-kernel@lists.infradead.org; Tue, 19 Feb 2019 13:01:44 +0000 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 26B58EBD; Tue, 19 Feb 2019 05:01:42 -0800 (PST) Received: from fuggles.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E6A863F720; Tue, 19 Feb 2019 05:01:40 -0800 (PST) Date: Tue, 19 Feb 2019 13:01:38 +0000 From: Will Deacon To: Ard Biesheuvel Subject: Re: [PATCH 0/9] 52-bit kernel + user VAs Message-ID: <20190219130138.GI8501@fuggles.cambridge.arm.com> References: <20190218170245.14915-1-steve.capper@arm.com> <20190219124825.GH8501@fuggles.cambridge.arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.1+86 (6f28e57d73f2) () X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190219_050143_249969_46A46B16 X-CRM114-Status: GOOD ( 31.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marc Zyngier , Catalin Marinas , crecklin@redhat.com, linux-arm-kernel , Steve Capper 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 Tue, Feb 19, 2019 at 01:51:51PM +0100, Ard Biesheuvel wrote: > On Tue, 19 Feb 2019 at 13:48, Will Deacon wrote: > > > > On Tue, Feb 19, 2019 at 01:13:32PM +0100, Ard Biesheuvel wrote: > > > On Mon, 18 Feb 2019 at 18:05, Steve Capper wrote: > > > > > > > > This patch series adds support for 52-bit kernel VAs using some of the > > > > machinery already introduced by the 52-bit userspace VA code in 5.0. > > > > > > > > As 52-bit virtual address support is an optional hardware feature, > > > > software support for 52-bit kernel VAs needs to be deduced at early boot > > > > time. If HW support is not available, the kernel falls back to 48-bit. > > > > > > > > A significant proportion of this series focuses on "de-constifying" > > > > VA_BITS related constants. > > > > > > > > In order to allow for a KASAN shadow that changes size at boot time, one > > > > must fix the KASAN_SHADOW_END for both 48 & 52-bit VAs and "grow" the > > > > start address. Also, it is highly desirable to maintain the same > > > > function addresses in the kernel .text between VA sizes. Both of these > > > > requirements necessitate us to flip the kernel address space halves s.t. > > > > the direct linear map occupies the lower addresses. > > > > > > > > One obvious omission is 52-bit kernel VA + 48-bit userspace VA which I > > > > can add with some more #ifdef'ery if needed. > > > > > > > > > > Hi Steve, > > > > > > Apologies if I am bringing up things that have been addressed > > > internally already. We discussed the 52-bit kernel VA work at > > > plumber's at some point, and IIUC, KASAN is the complicating factor > > > when it comes to having compile time constants for VA_BITS_MIN, > > > VA_BITS_MAX and PAGE_OFFSET, right? > > > > > > To clarify what I mean, please refer to the diagram below, which > > > describes a hybrid 48/52 kernel VA arrangement that does not rely on > > > runtime variable quantities. (VA_BITS_MIN == 48, VA_BITS_MAX == 52) > > > > > > +------------------- (~0) -------------------------+ > > > | | > > > | PCI IO / fixmap spaces | > > > | | > > > +------------------------------------------------+ > > > | | > > > | kernel/vmalloc space | > > > | | > > > +------------------------------------------------+ > > > | | > > > | module space | > > > | | > > > +------------------------------------------------+ > > > | | > > > | BPF space | > > > | | > > > +------------------------------------------------+ > > > | | > > > | | > > > | vmemmap space (size based on VA_BITS_MAX) | > > > | | > > > | | > > > +-- linear/vmalloc split based on VA_BITS_MIN -- + > > > | | > > > | linear mapping (48 bit addressable region) | > > > | | > > > +------------------------------------------------+ > > > | | > > > | linear mapping (52 bit addressable region) | > > > | | > > > +------ PAGE_OFFSET based on VA_BITS_MAX --------+ > > > > > > Since KASAN is what is preventing this, would it be acceptable for > > > KASAN to only be supported when you use a true 48 bit or a true 52 bit > > > configuration, and disable it for the 48/52 hybrid configuration? > > > > > > Just thinking out loud (and in ASCII art :-)) > > > > TBH, if we end up having support for 52-bit kernel VA, I'd be inclined to > > drop the 48/52 configuration altogether. But Catalin's on holiday at the > > moment, and may have a different opinion ;) > > > > But that implies that you cannot have an image that supports 52-bit > kernel VAs but can still boot on hardware that does not implement > support for it. If that is acceptable, then none of this hoop jumping > that Steve is doing in these patches is necessary to begin with, > right? Sorry, I misunderstood what you meant by a "48/52 hybrid configuration". I thought you were referring to the configuration where userspace is 52-bit and the kernel is 48-bit, which is something I think we can drop if we gain support for 52-bit kernel. Now that I understand what you mean, I think disabling KASAN would be fine as long as it's a runtime thing and the kernel continues to work in every other respect. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel