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=-17.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 D35C2C433E9 for ; Mon, 22 Feb 2021 12:25:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4EB6860C3E for ; Mon, 22 Feb 2021 12:25:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4EB6860C3E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 984F96B0078; Mon, 22 Feb 2021 07:25:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 934B68D0006; Mon, 22 Feb 2021 07:25:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 872E28D0005; Mon, 22 Feb 2021 07:25:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0086.hostedemail.com [216.40.44.86]) by kanga.kvack.org (Postfix) with ESMTP id 71F3F6B0078 for ; Mon, 22 Feb 2021 07:25:58 -0500 (EST) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 4182D363E for ; Mon, 22 Feb 2021 12:25:58 +0000 (UTC) X-FDA: 77845825596.09.3B0BB2C Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf27.hostedemail.com (Postfix) with ESMTP id 4FB8B80192D4 for ; Mon, 22 Feb 2021 12:25:52 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 772AB64E2F; Mon, 22 Feb 2021 12:25:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1613996751; bh=F61yD7TfzwZTNpXdixKLax2iqMRPofRipBni27VX2xM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SAl1T7KZJQQwmBaF9he+BHXzMUkMmuxBth+/0xxzpsa6fqv5Oqis3kFS/MtYzCguy ATqJ/v6/dT1POnWGmADkz8WaOI+GwO8I4FMLp6eesSzsBRAfXXgNlB3+tLIStB9WZ4 zBm+XwHVcygvLkB9feyhjgTBUP37E07KQG4Rq24EPDZboITntvu0XhiS9EhUnJyw6G XNkLQz14KNRFQmd4qbeR21szj/IZGbMceiFqH3CZscpl2UBYO86E8kWyDhaHFxtw0W 5vtcegPw5+YMFPEuMJBSCq7+MR2y4WhdulKtm45bkEj5G9rr6dAj9DbiKPbRQekucp Fs1H68Bt2620w== Date: Mon, 22 Feb 2021 12:25:46 +0000 From: Will Deacon To: Pavel Tatashin Cc: Tyler Hicks , James Morris , Catalin Marinas , Andrew Morton , Anshuman Khandual , Mike Rapoport , Logan Gunthorpe , Ard Biesheuvel , Linux ARM , LKML , Michal Hocko , linux-mm Subject: Re: [PATCH v3 1/1] arm64: mm: correct the inside linear map range during hotplug check Message-ID: <20210222122545.GA8847@willie-the-truck> References: <20210216150351.129018-1-pasha.tatashin@soleen.com> <20210216150351.129018-2-pasha.tatashin@soleen.com> <20210219191807.GB6683@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Stat-Signature: pir6sohnzo4bhikhy39mq4b9gr68dtfi X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 4FB8B80192D4 Received-SPF: none (kernel.org>: No applicable sender policy available) receiver=imf27; identity=mailfrom; envelope-from=""; helo=mail.kernel.org; client-ip=198.145.29.99 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1613996752-852935 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: On Fri, Feb 19, 2021 at 02:44:49PM -0500, Pavel Tatashin wrote: > On Fri, Feb 19, 2021 at 2:18 PM Will Deacon wrote: > > > > On Tue, Feb 16, 2021 at 10:03:51AM -0500, Pavel Tatashin wrote: > > > Memory hotplug may fail on systems with CONFIG_RANDOMIZE_BASE because the > > > linear map range is not checked correctly. > > > > > > The start physical address that linear map covers can be actually at the > > > end of the range because of randomization. Check that and if so reduce it > > > to 0. > > > > > > This can be verified on QEMU with setting kaslr-seed to ~0ul: > > > > > > memstart_offset_seed = 0xffff > > > START: __pa(_PAGE_OFFSET(vabits_actual)) = ffff9000c0000000 > > > END: __pa(PAGE_END - 1) = 1000bfffffff > > > > > > Signed-off-by: Pavel Tatashin > > > Fixes: 58284a901b42 ("arm64/mm: Validate hotplug range before creating linear mapping") > > > Tested-by: Tyler Hicks > > > --- > > > arch/arm64/mm/mmu.c | 21 +++++++++++++++++++-- > > > 1 file changed, 19 insertions(+), 2 deletions(-) > > > > I tried to queue this as a fix, but unfortunately it doesn't apply. > > Please can you send a v4 based on the arm64 for-next/fixes branch? > > The previous version, that is not built against linux-next would still > applies against current mainlein/for-next/fixes > > https://lore.kernel.org/lkml/20210215192237.362706-2-pasha.tatashin@soleen.com/ > > I just tried it. I think it would make sense to take v2 fix, so it > could also be backported to stables. Taking that won't help either though, because it will just explode when it meets 'mm' in Linus's tree. So here's what I think we need to do: - I'll apply your v3 at -rc1 - You can send backports based on your -v2 for stable once the v3 has been merged upstream. Sound good? Will