Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5706535imu; Wed, 26 Dec 2018 07:32:26 -0800 (PST) X-Google-Smtp-Source: AFSGD/V2y2WQ5B1e9nTkSQxglk6ptyfHoaX003Y3YAsYAwoN8npZE/NIuDh6Hf2ldT4tFEveA0jV X-Received: by 2002:aa7:8286:: with SMTP id s6mr20228210pfm.63.1545838346063; Wed, 26 Dec 2018 07:32:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545838346; cv=none; d=google.com; s=arc-20160816; b=nXE2WAeAHkhrMqsfjNfBJwdw0YYeWg1iouzBOreo2pBRcatkJXQ/TkUxpNW7cqtWUt 3mM3OlM44NWwxCxKEqUCGkHIrvg6iOA+U0Y/OYy84i4S3nMmgtAC5oMExpWlSPCJGdWD g80BfzCyOiyZ20BS2n1MGU+nLiWspE3xsRyIVIlcQCeJbq2pFbot7ZCrhy7cmIGLrUdd BCzNN2akOlUWdbO4a2J2HfTNuypHuyxOOqKr3NvZEPGUj2gMQEuC1AOsvTxqGQbUHQx3 6XHLDHDrutA/HKF6m6wTLHNwaJO0EFou6GonajEMQSST+l6qX74at2NHsrJ9ZnCcgPTF magw== 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=rpefWYxTp7K5+y32hWQHW+Yxgg8596jDt8IjeQS2Lqk=; b=tulCAuXeQLvELLyMuD9HCuirxqF2KZjJA2PIxg05vWtDDlKCjDEJdailfJ3j7CzqUo ZeqjImzNd45MwQnVF4fBxl1mReR4lLYouNGULMrg9wWpQtiSzMniH/995rg0NfeAgYfH qoDUaT99ydaEqlGVq3vTA+PdCGdZlIUp4qTLF+70j2i8yKR/kLErHDRxBlgmGl8TvsCm TmS0REvilcY4SnFYTiywh36f8cLa6zfyBwaxg7+GINleGyZYT50jpTrZluQGMcJt7UXy ZBBCPU9ftCL2klOeQ4yJp+y2MQkkYMcckvCent2BnN5EAa0j2zqI5NZ7L/c08vV4jZRi So2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fpP6v3CO; 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 m3si17272251pld.331.2018.12.26.07.32.10; Wed, 26 Dec 2018 07:32:26 -0800 (PST) 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=fpP6v3CO; 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 S1727027AbeLZNuK (ORCPT + 99 others); Wed, 26 Dec 2018 08:50:10 -0500 Received: from mail-it1-f193.google.com ([209.85.166.193]:35175 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726716AbeLZNuK (ORCPT ); Wed, 26 Dec 2018 08:50:10 -0500 Received: by mail-it1-f193.google.com with SMTP id p197so20302175itp.0 for ; Wed, 26 Dec 2018 05:50:09 -0800 (PST) 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=rpefWYxTp7K5+y32hWQHW+Yxgg8596jDt8IjeQS2Lqk=; b=fpP6v3COoYlw/6EUG8iSCrroLZuU0AFy683JPU7y+/A1Ebn10N4PMSziJfoZZly10k AZLDiBQ+2rb9bvHtooT/QrniD7nxa9w7F2RMZMnSDWstXLmRY8lc7vpXa3+HkhDHjW83 WVm15pMZu7MkpEXzIXBqg52DVswYBTQQ6cPFU= 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=rpefWYxTp7K5+y32hWQHW+Yxgg8596jDt8IjeQS2Lqk=; b=HoCM5XPizXaN/h73LCNiva8XU6Sd3wOdUF3tOmo+PUy2UEV+1SMp1k+D7aBP5mWCqM wnodADtqsJaIW52nGW0yMaXFcBZNjpsGpxmH7gtv3UdVQ3LZP+FUrOch2K3wz/BtPiM0 O/eaehvy7upcUBdPyoqLyaR7U3EXevsNScpIP38bke1PUtgRkRB/1HNUuSo7UoOx6sbq iNQGl3KRE0KkzVM/RxNqYL7FXb65KL1qvvhZVH1ebB7CB2yyHlXbo3yTg8tG1t8RpT8P vOLgLXUqZibKU5GoJCUCnjmSFoyVzBtTjsMTtyGRl6itA3MWEdOE4flTB8NQ9+nB/YGP pgVA== X-Gm-Message-State: AA+aEWakePlgmcGZGBFnGPR/1JHu691MFOZi/eTVd7veiE1Ab549nJQH OFdTsQ3WWIR1Sk5yTO1k6AB1vKKKF48PtMEsrosx1w== X-Received: by 2002:a24:edc4:: with SMTP id r187mr14064037ith.158.1545832209400; Wed, 26 Dec 2018 05:50:09 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Ard Biesheuvel Date: Wed, 26 Dec 2018 14:49:58 +0100 Message-ID: Subject: Re: [PATCH] arm64: kaslr: Reserve size of ARM64_MEMSTART_ALIGN in linear region To: Yueyi Li Cc: "catalin.marinas@arm.com" , "will.deacon@arm.com" , "akpm@linux-foundation.org" , "linux-arm-kernel@lists.infradead.org" , "markus@oberhumer.com" , "linux-kernel@vger.kernel.org" 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, 25 Dec 2018 at 03:30, Yueyi Li wrote: > > Hi Ard, > > > On 2018/12/24 17:45, Ard Biesheuvel wrote: > > Does the following change fix your issue as well? > > > > index 9b432d9fcada..9dcf0ff75a11 100644 > > --- a/arch/arm64/mm/init.c > > +++ b/arch/arm64/mm/init.c > > @@ -447,7 +447,7 @@ void __init arm64_memblock_init(void) > > * memory spans, randomize the linear region as well. > > */ > > if (memstart_offset_seed > 0 && range >= ARM64_MEMSTART_ALIGN) { > > - range = range / ARM64_MEMSTART_ALIGN + 1; > > + range /= ARM64_MEMSTART_ALIGN; > > memstart_addr -= ARM64_MEMSTART_ALIGN * > > ((range * memstart_offset_seed) >> 16); > > } > > Yes, it can fix this also. I just think modify the first *range* > calculation would be easier to grasp, what do you think? > I don't think there is a difference, to be honest, but I will leave it up to the maintainers to decide which approach they prefer.