Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3988986ybl; Tue, 20 Aug 2019 05:29:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqx4xUNuM6hOZwrUT4gLlsV/gYnZJzXy5PTJBV+AHKIwstCn89AT4SiayijUKPcPhAMztdyl X-Received: by 2002:a17:902:bb94:: with SMTP id m20mr27499217pls.336.1566304158202; Tue, 20 Aug 2019 05:29:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566304158; cv=none; d=google.com; s=arc-20160816; b=PX/mK0Ds4dnC1gZMaF8M7F7K9UtkwwCo6JCxMBsVNLFQr8bWjx9t5cOsPF+NmXpmAr 6MUEm/pMhAOuxsi5Gpt+jjPuTtBrz1thGp3r2l/UsEGdfkMPtuAPQFr8UEYDj7Fxi4XT HI760zNFwQtQRk1wB9Ppl/fPALGi/R/IyfadFXoijWzOUYT6b4qMbtS5zi/CFOUNIAVn R2P/f22SczTvtakbjhTSc4CEPsRpczFQ+kfWopx9nqF7KvH6GaoZrnyIFFVfK+JnUdJR vqMVADp5faNk158RnB0y+FqLUsWcoUOH/JbybgcN5TPVU0t17PDQ3C8HwEa08BJKSxeH 8zcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Fc9kgafPA2gUOPbQU1W3ajBr+1WrHB60fZSaC4Wi+Sg=; b=q7lZjq4VkIQ1oP12MACc/QnY25HvVzfYtXLdK9ByGLSsrhNOhZgS3HbY7SxupcQXrw vc0ZegBZbWkeWEbuyR9/oSBWb2qGMzMESRxQt+dFzBcW6vtZ2N/qVGS0l1SI9CRo+Wl0 hlMiI7+hdCF+sgzApZ651b/C4d1cQVe0XEqJPa2dJP01v1b1cnfSPQlPFjZFYPh9WLNn gQdtqZO2eABL5nyKme6H2Qc0qMYXunewf1aqMFf8hx8keZtqt04u7rWeKAnkPS8TqQz2 9/c+UN1+7oX7XkttbeSGL4+s5oaFz8j3JapruNKNrXse5cKAv4v+v7Qm6y3M9pMf6eDL g7tQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NlUKtmn9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a123si12951197pfd.114.2019.08.20.05.29.03; Tue, 20 Aug 2019 05:29:18 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=NlUKtmn9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729525AbfHTM1g (ORCPT + 99 others); Tue, 20 Aug 2019 08:27:36 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:55173 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728777AbfHTM1g (ORCPT ); Tue, 20 Aug 2019 08:27:36 -0400 Received: by mail-wm1-f65.google.com with SMTP id p74so2448707wme.4 for ; Tue, 20 Aug 2019 05:27:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Fc9kgafPA2gUOPbQU1W3ajBr+1WrHB60fZSaC4Wi+Sg=; b=NlUKtmn9iGLGYzl/EGuxT5/QFDiWGwqT+SyseUqGQ8qv1eVKlAZutSafi0AbgwxVya 6dqyEnKyli5cUAbyM+8YbVFbhOu1g4+mjswnShlQVVmHQ74gvUa5wUgoJq+rcOUOCvp2 /U6ehhgch2rOD/YINXpXSo6Gl1MDVdnWaODFMbh+HsJrCi//AnlfQ1VitYLR3Vcqnujk 4euj7syu8yOnXtSIDBrNYa44gL/mcHfIA5JvOAiTKPyRh/RjIEdyPBCtYMxXb3hmso6F dm3NpN8gr1s4exi5lvCCKYMLdjzcAo+jvdxcx8iU45Rf227pWO1z6xbvBMFCIZ1djaO5 mSWQ== 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:cc; bh=Fc9kgafPA2gUOPbQU1W3ajBr+1WrHB60fZSaC4Wi+Sg=; b=HGGW42YnYXn35d+WOQNPP6htPBn4ERFVr19OHCMrnH7yylEwTCLDf9GDVBkCYqPnaj SGL91rTseD76y7dXmS/GdF4pkHwVnONdXUoiVWyl2YcObjxIz7ULjO3A3P1jarwThsKX 5US8XkWODwYK4NA8rthocAMR+i/VhsKUn9p9pAqwLlwVMBEilT25m8LIbJCMvrUoSbyr 2xklMiy19k30zLRjHsvZ2dTw+P1SdicZnatN8g4Daln/iDr7M1itCzc9bl/8t7LzXvCS uBr4CfPJwg/Gl06LCOZqizw+x9qpz25ypacDR2r47XxdhKVqocuLFHO///yeYUhU4ykq cp6A== X-Gm-Message-State: APjAAAW76BdFK7J7bt5iTA4ED4t/ocXU3z6uGkb5uOHRBWN2f55hvIuz 49UId1lqQM4Z2VTbD/Ao6Y5ZIuh6JvkVZ2J1E9i2jA== X-Received: by 2002:a05:600c:231a:: with SMTP id 26mr17871560wmo.136.1566304054078; Tue, 20 Aug 2019 05:27:34 -0700 (PDT) MIME-Version: 1.0 References: <20190802053744.5519-1-clin@suse.com> <20190820115409.GO13294@shell.armlinux.org.uk> In-Reply-To: <20190820115409.GO13294@shell.armlinux.org.uk> From: Ard Biesheuvel Date: Tue, 20 Aug 2019 15:27:23 +0300 Message-ID: Subject: Re: [PATCH] efi/arm: fix allocation failure when reserving the kernel base To: Russell King - ARM Linux admin Cc: Chester Lin , "akpm@linux-foundation.org" , "rppt@linux.ibm.com" , "ren_guo@c-sky.com" , Juergen Gross , "geert@linux-m68k.org" , "mingo@kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "linux-efi@vger.kernel.org" , "guillaume.gardet@arm.com" , Joey Lee , Gary Lin Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 20 Aug 2019 at 14:54, Russell King - ARM Linux admin wrote: > > On Sun, Aug 04, 2019 at 10:57:00AM +0300, Ard Biesheuvel wrote: > > (The first TEXT_OFFSET bytes are no longer used in practice, which is > > why putting a reserved region of 4 KB bytes works at the moment, but > > this is fragile). > > That is not correct for 32-bit ARM. The swapper page table is still > located 16kiB below the kernel. > Right. So that means we can only permit reserved regions in the first (TEXT_OFFSET - 16 kiB) bytes starting at the first 128 MiB aligned address covered by system RAM, if we want to ensure that the decompressor or the early kernel don't trample on it. (or TEXT_OFFSET - 20 kiB for LPAE kernels)