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: 10682661 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 4F65E17F3 for ; Wed, 14 Nov 2018 13:40:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40B792B4AB for ; Wed, 14 Nov 2018 13:40:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 34F9F2B4E0; Wed, 14 Nov 2018 13:40:00 +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=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D3BD12B4AB for ; Wed, 14 Nov 2018 13:39:59 +0000 (UTC) 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=I2/Ohkc6DfBj9WFhvFhxkRbC0Wm69cVdysZP20tGZfI=; b=RvA 5KrrTxDmKZafse6HYotXbvLTpy229j6gRtCIGGX2A1UAfEz7RwpDjM0WBVdCo+eZp+doRlO39duAI rN8PVv1/K4xtQuYvP26f2TFb3GYO0runOvXPDzy57cS2a92TSLMORlAhO2xOqigOfSjUkm+nuRs/Q 9xI7RCfxz0FW7tZHYp8+GNOKO3OO0ln4mJC+2JzFr0doUYiPpN7CJCHwAqk4jucxYpLZnuv8IF8v6 KWLfr87ULlSQFRGVgQjTQQUsavMdL5rCouc4tC/kHojIl3I1WNNt/WyzSLnzVoHhZRLoDG6Slt979 G1vVFcmjO1lMsue3Cgfw9R3Me8bStMQ==; 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 1gMvOf-0008KE-96; Wed, 14 Nov 2018 13:39:57 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gMvOd-0008Je-JA for linux-arm-kernel@bombadil.infradead.org; Wed, 14 Nov 2018 13:39:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Ez5tCca/4oXpF1Q+GmWatxFkjQne0xnMrBJlwPNm+II=; b=GZDfJrF1HK0radR4bLlaEmYnN P+qT7+FePjS9Lu8vnr9Heoov/wmYlUGdJJ8luCplXhIb5TEhoEqPxMhXrhvS2HgJsc9D3vSzhhizo 5TZGRavvJqHWduT/63EJlSWYZXNuHdl26hi8HHHL5eKahjMhPImT6VD5zbEskd4hXc1Zwxi9kegOv pJOvpXdE8mYQ8eJPb1Jink0XioxRA5NT4xDgPn0vZ+y/XfEj0r8qQ1foRL5ypzJRXzD/mbRGyPkZp rU7RLsj8Q7HV3g4CE+YFY75Az/jFWV5i9lhNfKqRikVcorSUmXRVImTfrRVjb6/YSReDMTmFAe3O7 TQmyKGZNA==; Received: from foss.arm.com ([217.140.101.70]) by casper.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gMvOZ-0000lt-MU for linux-arm-kernel@lists.infradead.org; Wed, 14 Nov 2018 13:39:53 +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 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 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181114_133951_865519_F00566C4 X-CRM114-Status: GOOD ( 13.39 ) 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: catalin.marinas@arm.com, Steve Capper , will.deacon@arm.com, jcm@redhat.com, ard.biesheuvel@linaro.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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(-)