From mboxrd@z Thu Jan 1 00:00:00 1970 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=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 AC5DFECE58E for ; Thu, 17 Oct 2019 14:26:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6EA6220820 for ; Thu, 17 Oct 2019 14:26:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b="TKjxRtPw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6EA6220820 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=soleen.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1A5C68E000F; Thu, 17 Oct 2019 10:26:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 130708E000A; Thu, 17 Oct 2019 10:26:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F38F98E000F; Thu, 17 Oct 2019 10:26:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0200.hostedemail.com [216.40.44.200]) by kanga.kvack.org (Postfix) with ESMTP id CC9588E000A for ; Thu, 17 Oct 2019 10:26:46 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id 7785D52C0 for ; Thu, 17 Oct 2019 14:26:46 +0000 (UTC) X-FDA: 76053502812.06.ducks33_3b138129f504c X-HE-Tag: ducks33_3b138129f504c X-Filterd-Recvd-Size: 4677 Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) by imf45.hostedemail.com (Postfix) with ESMTP for ; Thu, 17 Oct 2019 14:26:45 +0000 (UTC) Received: by mail-ed1-f68.google.com with SMTP id y91so1887256ede.9 for ; Thu, 17 Oct 2019 07:26:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=pTZm79Y77en4+WVH2R/MS/mKWiM//Hl1RgvICjEclrk=; b=TKjxRtPwWpvtdWaMYbV45LyV9HVOzaOpAFbMpF2wo5zHCbYg0VRPUUtdJ1VyU2CUc6 l/GfxXIxUHAzOJXFyL/sOqbcEBBADqp8Pq1no/2KigSG5eGP/nwp1ooFXzgeBH8HEdjO GmJV/kE/BTVPJEGV8LKAdzay5o0rhZDFgVvRTWl/8/mJ/iwqxTg0IqZ6T9qTkiFc8x78 2EcQkBTDbFH6XEMf1N3dkNFpK4jjV2/42IkyvXgNWCq+s3Q6czyEmpaIe60dwwf0EJUc 0QeFMbdS9HQHYMtc2JQUheqYhHhaL2gcvWIPxKnh27DvXjcivpklLdfmftATrLQDcDfZ nO4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=pTZm79Y77en4+WVH2R/MS/mKWiM//Hl1RgvICjEclrk=; b=n9g56IrF3XzqeQad4SBqjJ4p/fih0/0BrlCZBtHECp6B8QoPQZiIdcEHffQU2KbPIp hvpJ/MdQrtS4mMqfv/OFSE/8m28zkovAUFGyIF7OChnbFY8RBidKrhZJxSO9kV6dNiqv id5rZomNDLcqG/toXKrW+/CJrPhaQrSaaDMdgcmQ2nwDmJG4AXe4BGPRQ/H5F8K2PFki 4u3lM6CkOTvM9IhYzVWEW37AXmYXSotVEzpggkaXsXiE0Ss4aBJlh3aOR8pcHDi2qhs+ rGWbUna4go0hRjiG/VHvpZA/iiaknZHDt3XN9a6tdXeqsBIud5+sQTwcS9EbeZZqcPX5 PHvg== X-Gm-Message-State: APjAAAXzqt5WpA08R/KHmA2FMIljrnUVxAL5gPh9j4M1wH4F12AuOObQ m1HcuGnNdFd7caQb3hbFdpgZTdBlmxnl2Soi0i2ICg== X-Google-Smtp-Source: APXvYqziFMNgpgw2iHsErr96SyZ2uSmSqs5rGVbMozjNUXiBuLfqaEtdRt8edlaf9N0bltup9A+f3kj+ItWHzZYFDds= X-Received: by 2002:aa7:dd0f:: with SMTP id i15mr4281166edv.0.1571322404589; Thu, 17 Oct 2019 07:26:44 -0700 (PDT) MIME-Version: 1.0 References: <20191016200034.1342308-1-pasha.tatashin@soleen.com> In-Reply-To: <20191016200034.1342308-1-pasha.tatashin@soleen.com> From: Pavel Tatashin Date: Thu, 17 Oct 2019 10:26:33 -0400 Message-ID: Subject: Re: [PATCH v7 00/25] arm64: MMU enabled kexec relocation To: Pavel Tatashin , James Morris , Sasha Levin , "Eric W. Biederman" , kexec mailing list , LKML , Jonathan Corbet , Catalin Marinas , will@kernel.org, Linux ARM , Marc Zyngier , James Morse , Vladimir Murzin , Matthias Brugger , Bhupesh Sharma , linux-mm , Mark Rutland , steve.capper@arm.com, rfontana@redhat.com, Thomas Gleixner Content-Type: text/plain; charset="UTF-8" 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: > https://lore.kernel.org/lkml/45a2f0b8-5bac-8b5d-d595-f92e9acb27ad@arm.com > > + /* Map relocation function va == pa */ > > + rc = trans_pgd_map_page(&info, trans_ttbr0, __va(kern_reloc), > > + kern_reloc, PAGE_KERNEL_EXEC); > > + if (rc) > > + return rc; > James wrote: > You can't do this with the page table helpers. We support platforms > with no memory in range of TTBR0's VA space. See dd006da21646f > > You will need some idmapped memory to turn the MMU off on a system > that booted at EL1. This will need to be in a set of page tables > that the helpers can't easily touch - so it should only be a single > page. (like the arch code's existing idmap - although that may > have been overwritten). > > (I have a machine where this is a problem, if I get the time I will > have a stab at making hibernate's safe page idmaped). > --- > > As I understand, there are platforms where TTBR0 cannot include all > physical memory for idmap. However, kexec must have at least one page > idmapped (kimage->control_code_page) to be able to relocate kernel > while MMU is enabled: > > I am still trying to fully understand the problem: > CONFIG_ARM64_VA_BITS must be smaller than 48 and physical memory must > start at a high address for this problem to occur. > > Why can't we simply decrease T0SZ to cover all physical memory? Is there a way to reproduce this platform with qemu? Pasha