From patchwork Wed Nov 14 13:39:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Capper X-Patchwork-Id: 10682647 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D501017F3 for ; Wed, 14 Nov 2018 13:39:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C77C62B4AB for ; Wed, 14 Nov 2018 13:39:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B8D4D2B4D7; Wed, 14 Nov 2018 13:39:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 50F172B4AB for ; Wed, 14 Nov 2018 13:39:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 254946B0006; Wed, 14 Nov 2018 08:39:42 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 204396B0008; Wed, 14 Nov 2018 08:39:42 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 11C1F6B000A; Wed, 14 Nov 2018 08:39:42 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ot1-f69.google.com (mail-ot1-f69.google.com [209.85.210.69]) by kanga.kvack.org (Postfix) with ESMTP id DA21A6B0006 for ; Wed, 14 Nov 2018 08:39:41 -0500 (EST) Received: by mail-ot1-f69.google.com with SMTP id p29so11271305ote.3 for ; Wed, 14 Nov 2018 05:39:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id; bh=Ez5tCca/4oXpF1Q+GmWatxFkjQne0xnMrBJlwPNm+II=; b=SwKEIbzUTQYCqqo2y8ZRQid+2yw3it+OYcjJY1CUorNi0oQ3r0e6ivX41pA9lzw2NG 0Byw51J0IIxm9bMewlXJfYHM8+RebUmcy1ZHDOpTBDh7n1lWqnr32z4BwwzYHbwOuJ0y ebJ1Azexkyjw6gTU9dBNkiKRfO47RDIypoSteX/+taoaq95JUxjW3HnxC48Jk1hodWIa bPkDlcUuhLZIBBFXrEXdBsMAA5kvaw5NwHTqUcK6ZMdQwAiQ8n3V6ggpLt0sdxktIYk0 R4xgZQy3sBRed0U5QmKXHL04B4SRRN9clN2NQIF9jHpJRIoINbjYXxweVvwO7taU6jSy xd5g== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of steve.capper@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=steve.capper@arm.com X-Gm-Message-State: AGRZ1gIK/hWAwHr062vAKltzJpodwFDGHUmwHkFdm2glO+UHqjeYqaQk sQBWfZExKnkEwMhLuTHbut5AVqQOeUJBt7m+ipHujsmkqboq1r1aLWBfYjxUMOoIHFnen9QsXyl 7GTjVJ+wJTcU6ab0KV+97i/4lx5XpGajYtgmdESrT0kh2AsD6k0M2RWQrvlhPZ66xmQ== X-Received: by 2002:a9d:2fb2:: with SMTP id r47mr1124884otb.306.1542202781521; Wed, 14 Nov 2018 05:39:41 -0800 (PST) X-Google-Smtp-Source: AJdET5c+b76I10FOr78rv5OI6f3GQZEQa9D2fiZ4LUXBLdt1AI/Q3ihPRVlgn3HtKsHC7G6CBdv/ X-Received: by 2002:a9d:2fb2:: with SMTP id r47mr1124844otb.306.1542202780590; Wed, 14 Nov 2018 05:39:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542202780; cv=none; d=google.com; s=arc-20160816; b=dP0fAObheFe5jeEnavL+AhOhujoOMYySdhg8o4zCNJO5U50oK/EW+NozrzZLQEu+8s DiE+dJ1g6wLiy+BZzDVxhirVOz3qHv7zydl1jDZcRvfSkehMYENdgiosuq+w8O87n9i1 sU6oofYCfmkYZahBQgTlgsZAMTe/6I+F8+a4AWdfJdbIa3n3jUQcveNQwbwXbuj4KQVI wk8WBQM8L8AgX69QPrOlUrXLLSzeSyZ1diq5qE5tqXQq7hffSP9K9YUGvL6MJDzlb8ur V4i4CeVkR0LTshqYg7Xe5MN0CVyxGssupwS7C+k0r8vAj+fKeYBGIUsgHF1FbBtZ2k38 h7wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from; bh=Ez5tCca/4oXpF1Q+GmWatxFkjQne0xnMrBJlwPNm+II=; b=DUZqDaPTgttKMlVZlVvRUJMlAzMx7ct01Q04iIcXPFj+tOiEDA3ScuT93LQ472ZWvM oGTvGzCWLlJ0tGTD7+E4bYHld3OYAKCXqrU/0n6eQEu3JjIpnlO3kakMbZUdu4THNZta 8bP34+ce0BEnI1iMjavqGRqni1ZHu5+GXOYPamOsprdOmBQAGX/VOoc4051fzifZSza5 tOnDDt+vYAjmvFtW6g7GmyilZUucdM0i68miLLQNL7Ehg4XhA+hZellA5a6qCIelHokY ar/hGJBaiX09v0unPbSSRZEcg4O/+0ayoMFCeLzE9O2SmzKA5rjlqiqdeeoUYGfo6/lz dHbA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of steve.capper@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=steve.capper@arm.com Received: from foss.arm.com (foss.arm.com. [217.140.101.70]) by mx.google.com with ESMTP id n125si2503216oig.113.2018.11.14.05.39.40 for ; Wed, 14 Nov 2018 05:39:40 -0800 (PST) Received-SPF: pass (google.com: domain of steve.capper@arm.com designates 217.140.101.70 as permitted sender) client-ip=217.140.101.70; Authentication-Results: mx.google.com; spf=pass (google.com: domain of steve.capper@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=steve.capper@arm.com 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 D5511A78; Wed, 14 Nov 2018 05:39:39 -0800 (PST) Received: from capper-debian.arm.com (unknown [10.37.12.126]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 7F7273F718; Wed, 14 Nov 2018 05:39:38 -0800 (PST) From: Steve Capper To: linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org Cc: catalin.marinas@arm.com, will.deacon@arm.com, ard.biesheuvel@linaro.org, jcm@redhat.com, Steve Capper Subject: [PATCH V3 0/5] 52-bit userspace VAs Date: Wed, 14 Nov 2018 13:39:15 +0000 Message-Id: <20181114133920.7134-1-steve.capper@arm.com> X-Mailer: git-send-email 2.11.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP This patch series brings support for 52-bit userspace VAs to systems that have ARMv8.2-LVA and are running with a 48-bit VA_BITS and a 64KB PAGE_SIZE. If no hardware support is present, the kernel runs with a 48-bit VA space for userspace. Userspace can exploit this feature by providing an address hint to mmap where addr[51:48] != 0. Otherwise all the VA mappings will behave in the same way as a 48-bit VA system (this is to maintain compatibility with software that assumes the maximum VA size on arm64 is 48-bit). This patch series applies to 4.20-rc1. Testing was in a model with Trusted Firmware and UEFI for boot. Changed in V3, COMPAT fixes added (and tested with 32-bit userspace code). Extra patch added to allow forcing all userspace allocations to come from 52-bits (to allow for debugging and testing). The major change to V2 of the series is that mm/mmap.c is altered in the first patch of the series (rather than copied over to arch/arm64). Steve Capper (5): mm: mmap: Allow for "high" userspace addresses arm64: mm: Introduce DEFAULT_MAP_WINDOW arm64: mm: Define arch_get_mmap_end, arch_get_mmap_base arm64: mm: introduce 52-bit userspace support arm64: mm: Allow forcing all userspace addresses to 52-bit arch/arm64/Kconfig | 18 ++++++++++++++++++ arch/arm64/include/asm/assembler.h | 7 +++---- arch/arm64/include/asm/elf.h | 4 ++++ arch/arm64/include/asm/mmu_context.h | 3 +++ arch/arm64/include/asm/pgalloc.h | 4 ++++ arch/arm64/include/asm/pgtable.h | 16 +++++++++++++--- arch/arm64/include/asm/processor.h | 33 ++++++++++++++++++++++++++++----- arch/arm64/kernel/head.S | 13 +++++++++++++ arch/arm64/mm/fault.c | 2 +- arch/arm64/mm/init.c | 2 +- arch/arm64/mm/mmu.c | 1 + arch/arm64/mm/proc.S | 10 +++++++++- drivers/firmware/efi/arm-runtime.c | 2 +- drivers/firmware/efi/libstub/arm-stub.c | 2 +- mm/mmap.c | 25 ++++++++++++++++++------- 15 files changed, 118 insertions(+), 24 deletions(-)